1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 automake,
6 autoconf,
7 pkg-config,
8 gettext,
9 libtool,
10 pandoc,
11 which,
12 attr,
13 libiconv,
14}:
15
16stdenv.mkDerivation rec {
17 pname = "mergerfs";
18 version = "2.40.2";
19
20 src = fetchFromGitHub {
21 owner = "trapexit";
22 repo = pname;
23 rev = version;
24 sha256 = "sha256-3DfSGuTtM+h0IdtsIhLVXQxX5/Tj9G5Qcha3DWmyyq4=";
25 };
26
27 nativeBuildInputs = [
28 automake
29 autoconf
30 pkg-config
31 gettext
32 libtool
33 pandoc
34 which
35 ];
36 prePatch = ''
37 sed -i -e '/chown/d' -e '/chmod/d' libfuse/Makefile
38 '';
39 buildInputs = [
40 attr
41 libiconv
42 ];
43
44 preConfigure = ''
45 echo "${version}" > VERSION
46 '';
47
48 makeFlags = [
49 "DESTDIR=${placeholder "out"}"
50 "XATTR_AVAILABLE=1"
51 "PREFIX=/"
52 "SBINDIR=/bin"
53 ];
54 enableParallelBuilding = true;
55
56 postFixup = ''
57 ln -srf $out/bin/mergerfs $out/bin/mount.fuse.mergerfs
58 ln -srf $out/bin/mergerfs $out/bin/mount.mergerfs
59 '';
60
61 meta = {
62 description = "FUSE based union filesystem";
63 homepage = "https://github.com/trapexit/mergerfs";
64 license = lib.licenses.isc;
65 platforms = lib.platforms.linux;
66 maintainers = with lib.maintainers; [ makefu ];
67 };
68}