summary refs log tree commit diff
path: root/pkgs/tools/filesystems/boxfs/default.nix
blob: 3ddc95273972897f5abc425ae8ac5868ea9cea64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ stdenv, fetchFromGitHub, curl, fuse, libxml2, pkgconfig }:

let
  srcs = {
    boxfs2 = fetchFromGitHub {
      sha256 = "10af1l3sjnh25shmq5gdnpyqk4vrq7i1zklv4csf1n2nrahln8j8";
      rev = "d7018b0546d2dae956ae3da3fb95d2f63fa6d3ff";
      repo = "boxfs2";
      owner = "drotiro";
    };
    libapp = fetchFromGitHub {
      sha256 = "1p2sbxiranan2n2xsfjkp3c6r2vcs57ds6qvjv4crs1yhxr7cp00";
      rev = "febebe2bc0fb88d57bdf4eb4a2a54c9eeda3f3d8";
      repo = "libapp";
      owner = "drotiro";
    };
    libjson = fetchFromGitHub {
      sha256 = "1vhss3gq44nl61fbnh1l3qzwvz623gwhfgykf1lf1p31rjr7273w";
      rev = "75a7f50fca2c667bc5f32cdd6dd98f2b673f6657";
      repo = "libjson";
      owner = "vincenthz";
    };
  };
in stdenv.mkDerivation {
  pname = "boxfs";
  version = "2-20150109";

  src = srcs.boxfs2;

  prePatch = with srcs; ''
    substituteInPlace Makefile --replace "git pull" "true"
    cp -a --no-preserve=mode ${libapp} libapp
    cp -a --no-preserve=mode ${libjson} libjson
  '';
  patches = [ ./work-around-API-borkage.patch ];

  buildInputs = [ curl fuse libxml2 ];
  nativeBuildInputs = [ pkgconfig ];

  buildFlags = [ "static" ];

  installPhase = ''
    mkdir -p $out/bin
    install boxfs boxfs-init $out/bin
  '';

  meta = with stdenv.lib; {
    description = "FUSE file system for box.com accounts";
    longDescription = ''
      Store files on box.com (an account is required). The first time you run
      boxfs, you will need to complete the authentication (oauth2) process and
      grant access to your box.com account. Just follow the instructions on
      the terminal and in your browser. When you've done using your files,
      unmount the file system with `fusermount -u mountpoint`.
    '';
    homepage = https://github.com/drotiro/boxfs2;
    license = licenses.gpl3;
    platforms = platforms.linux;
  };
}