nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 curl,
6 fuse,
7 libxml2,
8 pkg-config,
9}:
10
11let
12 srcs = {
13 boxfs2 = fetchFromGitHub {
14 sha256 = "10af1l3sjnh25shmq5gdnpyqk4vrq7i1zklv4csf1n2nrahln8j8";
15 rev = "d7018b0546d2dae956ae3da3fb95d2f63fa6d3ff";
16 repo = "boxfs2";
17 owner = "drotiro";
18 };
19 libapp = fetchFromGitHub {
20 sha256 = "1p2sbxiranan2n2xsfjkp3c6r2vcs57ds6qvjv4crs1yhxr7cp00";
21 rev = "febebe2bc0fb88d57bdf4eb4a2a54c9eeda3f3d8";
22 repo = "libapp";
23 owner = "drotiro";
24 };
25 libjson = fetchFromGitHub {
26 sha256 = "1vhss3gq44nl61fbnh1l3qzwvz623gwhfgykf1lf1p31rjr7273w";
27 rev = "75a7f50fca2c667bc5f32cdd6dd98f2b673f6657";
28 repo = "libjson";
29 owner = "vincenthz";
30 };
31 };
32in
33stdenv.mkDerivation {
34 pname = "boxfs";
35 version = "2-20150109";
36
37 src = srcs.boxfs2;
38
39 prePatch = with srcs; ''
40 substituteInPlace Makefile --replace "git pull" "true"
41 cp -a --no-preserve=mode ${libapp} libapp
42 cp -a --no-preserve=mode ${libjson} libjson
43 '';
44 patches = [
45 ./work-around-API-borkage.patch
46 ./libapp-include-ctype.diff
47 ];
48
49 buildInputs = [
50 curl
51 fuse
52 libxml2
53 ];
54 nativeBuildInputs = [ pkg-config ];
55
56 buildFlags = [
57 "static"
58 "CC=${stdenv.cc.targetPrefix}cc"
59 ]
60 ++ lib.optional stdenv.hostPlatform.isDarwin "CFLAGS=-D_BSD_SOURCE";
61
62 installPhase = ''
63 mkdir -p $out/bin
64 install boxfs boxfs-init $out/bin
65 '';
66
67 meta = {
68 description = "FUSE file system for box.com accounts";
69 longDescription = ''
70 Store files on box.com (an account is required). The first time you run
71 boxfs, you will need to complete the authentication (oauth2) process and
72 grant access to your box.com account. Just follow the instructions on
73 the terminal and in your browser. When you've done using your files,
74 unmount the file system with `fusermount -u mountpoint`.
75 '';
76 homepage = "https://github.com/drotiro/boxfs2";
77 license = lib.licenses.gpl3;
78 platforms = lib.platforms.unix;
79 };
80}