1
1
{ version , sha256Hash , maintainers } :
2
2
3
3
{ stdenv , fetchFromGitHub , fetchpatch
4
- , utillinux , autoconf , automake , libtool , gettext
5
- , fusePackages } :
4
+ , fusePackages , utillinux , gettext
5
+ , autoconf , automake , libtool
6
+ , meson , ninja , pkgconfig
7
+ } :
6
8
7
9
let
8
10
isFuse3 = stdenv . lib . hasPrefix "3" version ;
@@ -16,15 +18,25 @@ in stdenv.mkDerivation rec {
16
18
sha256 = sha256Hash ;
17
19
} ;
18
20
19
- patches = stdenv . lib . optional
20
- ( ! isFuse3 && stdenv . isAarch64 )
21
- ( fetchpatch {
22
- url = "https://github.com/libfuse/libfuse/commit/914871b20a901e3e1e981c92bc42b1c93b7ab81b.patch" ;
23
- sha256 = "1w4j6f1awjrycycpvmlv0x5v9gprllh4dnbjxl4dyl2jgbkaw6pa" ;
24
- } ) ;
25
-
26
- nativeBuildInputs = [ libtool autoconf automake ] ;
27
- buildInputs = [ gettext utillinux ] ;
21
+ patches =
22
+ stdenv . lib . optional
23
+ ( ! isFuse3 && stdenv . isAarch64 )
24
+ ( fetchpatch {
25
+ url = "https://github.com/libfuse/libfuse/commit/914871b20a901e3e1e981c92bc42b1c93b7ab81b.patch" ;
26
+ sha256 = "1w4j6f1awjrycycpvmlv0x5v9gprllh4dnbjxl4dyl2jgbkaw6pa" ;
27
+ } )
28
+ ++ stdenv . lib . optionals isFuse3 [
29
+ ./fuse3-no-udev.patch # only required for udevrulesdir
30
+ ./fuse3-install.patch
31
+ # install_man makes the build non-reproducible by encoding the date
32
+ ./fuse3-install_man.patch
33
+ ] ;
34
+
35
+
36
+ nativeBuildInputs = if isFuse3
37
+ then [ meson ninja pkgconfig ]
38
+ else [ autoconf automake libtool ] ;
39
+ buildInputs = stdenv . lib . optional ( ! isFuse3 ) gettext ;
28
40
29
41
outputs = [ "out" ] ++ stdenv . lib . optional isFuse3 "common" ;
30
42
@@ -39,27 +51,27 @@ in stdenv.mkDerivation rec {
39
51
export NIX_CFLAGS_COMPILE="-DFUSERMOUNT_DIR=\"/run/wrappers/bin\""
40
52
41
53
sed -e 's@/bin/@${ utillinux } /bin/@g' -i lib/mount_util.c
42
- sed -e 's@CONFIG_RPATH=/usr/share/gettext/config.rpath@CONFIG_RPATH=${ gettext } /share/gettext/config.rpath@' -i makeconf.sh
43
-
44
- ./makeconf.sh
45
- '' ;
46
-
47
- postFixup = if isFuse3 then ''
48
- cd $out
49
-
54
+ '' + ( if isFuse3 then ''
55
+ # The configure phase will delete these files (temporary workaround for
56
+ # ./fuse3-install_man.patch)
57
+ install -D -m444 doc/fusermount3.1 $out/share/man/man1/fusermount3.1
58
+ install -D -m444 doc/mount.fuse.8 $out/share/man/man8/mount.fuse.8
59
+ '' else ''
60
+ sed -e 's@CONFIG_RPATH=/usr/share/gettext/config.rpath@CONFIG_RPATH=${ gettext } /share/gettext/config.rpath@' -i makeconf.sh
61
+ ./makeconf.sh
62
+ '' ) ;
63
+
64
+ postFixup = "cd $out\n " + ( if isFuse3 then ''
50
65
mv bin/mount.fuse3 bin/mount.fuse
51
- mv etc/udev/rules.d/99-fuse3.rules etc/udev/rules.d/99-fuse.rules
52
66
53
67
install -D -m555 bin/mount.fuse $common/bin/mount.fuse
54
68
install -D -m444 etc/udev/rules.d/99-fuse.rules $common/etc/udev/rules.d/99-fuse.rules
55
69
install -D -m444 share/man/man8/mount.fuse.8.gz $common/share/man/man8/mount.fuse.8.gz
56
70
'' else ''
57
- cd $out
58
-
59
71
cp ${ fusePackages . fuse_3 . common } /bin/mount.fuse bin/mount.fuse
60
72
cp ${ fusePackages . fuse_3 . common } /etc/udev/rules.d/99-fuse.rules etc/udev/rules.d/99-fuse.rules
61
73
cp ${ fusePackages . fuse_3 . common } /share/man/man8/mount.fuse.8.gz share/man/man8/mount.fuse.8.gz
62
- '' ;
74
+ '' ) ;
63
75
64
76
enableParallelBuilding = true ;
65
77
0 commit comments