1 { lib, stdenv, fetchFromGitHub, cmake, fuse }:
3 stdenv.mkDerivation rec {
4 pname = "unionfs-fuse";
7 src = fetchFromGitHub {
11 sha256 = "sha256-EJryML6E0CW4kvsqMRqV3cq77j50HuylNzgaHD6CL/o=";
15 # Prevent the unionfs daemon from being killed during
17 # http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/
19 ./prevent-kill-on-shutdown.patch
22 postPatch = lib.optionalString stdenv.isDarwin ''
23 substituteInPlace CMakeLists.txt \
24 --replace '/usr/local/include/osxfuse/fuse' '${fuse}/include/fuse'
27 nativeBuildInputs = [ cmake ];
28 buildInputs = [ fuse ];
30 # Put the unionfs mount helper in place as mount.unionfs-fuse. This makes it
32 # mount -t unionfs-fuse none /dest -o dirs=/source1=RW,/source2=RO
34 # This must be done in preConfigure because the build process removes
35 # helper from the source directory during the build.
36 preConfigure = lib.optionalString (!stdenv.isDarwin) ''
38 cp -a mount.unionfs $out/sbin/mount.unionfs-fuse
39 substituteInPlace $out/sbin/mount.unionfs-fuse --replace mount.fuse ${fuse}/sbin/mount.fuse
40 substituteInPlace $out/sbin/mount.unionfs-fuse --replace unionfs $out/bin/unionfs
44 broken = stdenv.isDarwin;
45 description = "FUSE UnionFS implementation";
46 homepage = "https://github.com/rpodgorny/unionfs-fuse";
47 license = licenses.bsd3;
48 platforms = platforms.unix;
49 maintainers = with maintainers; [ orivej ];