jcline / fuse-google-drive

A fuse filesystem wrapper for Google Drive.
GNU General Public License v2.0
285 stars 48 forks source link

Build on OSX #22

Closed mbrownnycnyc closed 12 years ago

mbrownnycnyc commented 12 years ago

Hello, I'd like to build this on OSX, but it appears to be overly complex.

It would be good to include either instructions or a patch that would allow it to be built.

If I figure out a way, I will post the patch.

Thanks,

Matt

jcline commented 12 years ago

I don't actually have an OSX box I can test on. From what I do know, you would probably need to install the dependencies I list in the readme through macports or whatever it is called. If one of those isn't available, then I'm not sure if there would be a good way to build it on OSX at this time.

I imagine the fuse port (is it actually a port?) might have a different name which autoconf would need to check for... Does autoconf even work on OSX?

mbrownnycnyc commented 12 years ago

I'll look into it further shortly and update this issue with anything I find. You are correct that you'd likely have to use macports or fink, neither of which seem to have the proper version of autoconf built. But I have read that building autoconf is possible on OSX. Thanks for getting back.

jcline commented 12 years ago

You could also try reducing the required version in AC_PREREQ([2.68]) in the configure.ac file, if that helps. I'm not sure what the minimum version actually is for the autoconf features that are being used.

sorin-ionescu commented 12 years ago

I've tried to compile it on Mac OS X using fuse4x.

There is a problem with the following line in configure.ac.

AC_CHECK_HEADER([fuse.h],,[AC_MSG_ERROR([<fuse.h> header not found])], [AC_INCLUDES_DEFAULT])

It results in the following.

checking for fuse.h... no
configure: error: <fuse.h> header not found

The file is found in /usr/local/include/fuse.h.

After getting rid of that check, it attempts to compile, but then I get the following error.

In file included from gd_interface.c:31:
In file included from ./gd_interface.h:24:
In file included from /usr/local/include/fuse/fuse.h:26:
/usr/local/include/fuse/fuse_common.h:323:8: error: #error On FreeBSD API version 25 or greater must be used
#            error On FreeBSD API version 25 or greater must be used
             ^
1 error generated.
make: *** [fuse_google_drive-gd_interface.o] Error 1
make: *** Waiting for unfinished jobs....
mv -f .deps/fuse_google_drive-gd_fuse_operations.Tpo .deps/fuse_google_drive-gd_fuse_operations.Po
jcline commented 12 years ago

Try with commit c284e14866613bf3f500c68084bca86a0f09e642

I changed to using the PKG_CHECK_MODULES feature for finding fuse, which may or may not help.

sorin-ionescu commented 12 years ago

Thanks. That fixed the first error but not the second about the API version.

sorin-ionescu commented 12 years ago

This line is throwing the error.

jcline commented 12 years ago

Well, that's kind of strange, since https://github.com/jcline/fuse-google-drive/blob/master/gd_fuse_operations.c#L19

jcline commented 12 years ago

Try adding #define FUSE_USE_VERSION 26 to https://github.com/jcline/fuse-google-drive/blob/master/gd_interface.h#L21

sorin-ionescu commented 12 years ago

That made it compile.

sorin-ionescu commented 12 years ago

b7fefbf builds and installs fine now. I have not tested if it works yet, but I'm getting the missing clientsecrets notification. So, it looks promising.

jcline commented 12 years ago

If you need slightly better instructions than those in the README for generating the clientsecrets and clientid: https://github.com/jcline/fuse-google-drive/issues/28#issuecomment-5650294

sorin-ionescu commented 12 years ago

@mbrownnycnyc, if you use Homebrew, execute the following. Make sure you install Fuse4X first.

brew install https://github.com/sorin-ionescu/homebrew/blob/master/Library/Formula/fuse-google-drive.rb
mbrownnycnyc commented 12 years ago

Thanks Sorin.

I use fink, and occasionally ports (because I like to get confused); but no homebrew. Regardless, I'll look back at this thread and try to derive what's needed.

On Tue, May 15, 2012 at 10:34 PM, Sorin Ionescu < reply@reply.github.com

wrote:

@mbrownnycnyc, if you use Homebrew, execute the following. Make sure you install Fuse4X first.

brew install
https://github.com/sorin-ionescu/homebrew/blob/master/Library/Formula/fuse-google-drive.rb

Reply to this email directly or view it on GitHub: https://github.com/jcline/fuse-google-drive/issues/22#issuecomment-5732332

sorin-ionescu commented 12 years ago

@mbrownnycnyc Use that formula to make yourself a Fink/MacPorts package.

sorin-ionescu commented 12 years ago

@jcline It mounted, but it doesn't work properly. It mounts Recent instead of My Drive. Most files are zero bytes since they are Google Docs documents, which cannot be opened. However, binary files that are not Google Docs documents are corrupt.

jcline commented 12 years ago

It mounts Recent instead of My Drive.

That seems to just be what they return when getting the file listing, and it should include all the files in your drive itself. There may be a way to filter it, but I'm not sure that's a better solution. I will probably look into this more, since it probably makes sense to have mount options for specifying this behavior.

Most files are zero bytes since they are Google Docs documents, which cannot be opened.

Yeah. I have no great ideas for dealing with Google Docs at the moment. There are some possibilities, but none seem ideal. Perhaps being able to filter them out with a mount option would also be appropriate.

However, binary files that are not Google Docs documents are corrupt.

That's interesting. If you make a short text file in your google drive and open that, does it come out OK? I have had success on Linux with 2-5MB image files, so I'm not sure exactly what that might be caused by.

sorin-ionescu commented 12 years ago

Text files seem to show up ok. PDF files are corrupt though.

jcline commented 12 years ago

If you

cp mountpoint/file.pdf file.pdf

then open the copied file, is it still corrupt?

sorin-ionescu commented 12 years ago

It's still corrupt.

jcline commented 12 years ago

c15986f74031d275af1fc6f976c58f9a0067b462 updated a lot of memory management stuff which I don't think will have fixed this, but may have somehow.

Second, assuming those changes did not help, can you try the following, preferably with a large text file that is :

In one shell: ./fuse-google-drive -d -s testdir Then, in a second shell: cp testdir/somefile somefile; fusermount -u testdir Verify that somefile is corrupt. In the first shell, ./fuse-google-drive -d -s testdir In the second shell: cp testdir/somefile somefile2 Then, md5sum somefile somefile2.

The point of all this -- are somefile and somefile2 the same? That is, were they corrupted identically?

sorin-ionescu commented 12 years ago

Like I have said, text files are fine. Binary files like PDFs are corrupt. Copying them out of the test directory does not fix them.

jcline commented 12 years ago

If you get two copies of a binary file out, as above, are they corrupted identically?

sorin-ionescu commented 12 years ago

Yes, they are both equally corrupt, according to the hash.

jcline commented 12 years ago

Try c130ed30d2d2e371ad6128c2170f1d70ddf681ab

sorin-ionescu commented 12 years ago

The PDFs are no longer corrupt.

mbrownnycnyc commented 12 years ago

Does this signify a "horray" moment?

On Sun, May 20, 2012 at 12:10 AM, Sorin Ionescu < reply@reply.github.com

wrote:

The PDFs are no longer corrupt.


Reply to this email directly or view it on GitHub: https://github.com/jcline/fuse-google-drive/issues/22#issuecomment-5806535

sorin-ionescu commented 12 years ago

Yes, a muted hooray. :)

On 20 May 2012, at 09:10, mbrownnycnyc wrote:

Does this signify a "horray" moment?

On Sun, May 20, 2012 at 12:10 AM, Sorin Ionescu < reply@reply.github.com

wrote:

The PDFs are no longer corrupt.


Reply to this email directly or view it on GitHub: https://github.com/jcline/fuse-google-drive/issues/22#issuecomment-5806535


Reply to this email directly or view it on GitHub: https://github.com/jcline/fuse-google-drive/issues/22#issuecomment-5808765

jcline commented 12 years ago

So, I think this gets OSX to the same basic level of functionality as the Linux folks.