Google Drive FUSE filesystem on Fedora

Google Drive FUSE filesystem on Fedora

We are going to build google-drive-ocamlfuse from source, a FUSE (filesystem in userspace) backed by Google Drive written in OCaml by Alessandro Strada. It lets you mount your Google Drive on Linux as a filesystem, a service that Google has yet to make available.

What is OCaml?

OCaml is a general purpose programming language with an emphasis on expressiveness and safety. Developed for more than 20 years at Inria by a group of leading researchers, it has an advanced type system that helps catch your mistakes without getting in your way. It’s used in environments where a single mistake can cost millions and speed matters, is supported by an active community, and has a rich set of libraries and development tools.

Alessandro makes available .deb packages for Ubuntu, and there are details on using OPAM to install for other distributions. OPAM is an OCaml package manager. OPAM is not available in the standard Fedora repositories, and rather than manually installing and configuring yet another package manager, it would seem simpler to just build the three required ocaml packages from source. Below are details on all the Fedora dependencies and commands for building google-drive-ocamlfuse. This has been tested and confirmed working on Fedora 25.

First we need to install gapi-ocaml, a simple, unofficial, OCaml client for Google Services, and also all of the required Fedora dependencies.

# dnf install ocaml ocaml-ocamldoc ocaml-findlib ocaml-cryptokit-devel ocaml-curl-devel ocaml-extlib-devel ocaml-ocamlnet-devel ocaml-xmlm-devel ocaml-yojson-devel
$ git clone https://github.com/astrada/gapi-ocaml.git
$ cd gapi-ocaml
$ ocaml setup.ml -configure
$ ocaml setup.ml -build
# ocaml setup.ml -install

Now we need the ocaml binding for FUSE which enables you to write your own multithreaded, efficient userspace filesystems using the ocaml programming language. We also need a couple more Fedora dependencies.

# dnf install ocaml-camlidl-devel fuse-devel
$ git clone https://github.com/astrada/ocamlfuse.git
$ cd ocamlfuse
$ ocaml setup.ml -configure
$ ocaml setup.ml -build
# ocaml setup.ml -install

Finally we can install google-drive-ocamlfuse, and yet more Fedora dependencies.

# dnf install ocaml-sqlite-devel ocaml-biniou-devel ocaml-easy-format-devel zlib-devel
$ git clone https://github.com/astrada/google-drive-ocamlfuse.git
$ cd google-drive-ocamlfuse
$ ocaml setup.ml -configure
$ ocaml setup.ml -build
# ocaml setup.ml -install

google-drive-ocamlfuse should now be ready to use and authorise against your Google account following the standard authorisation instructions!