git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #115318 from kalekseev/macos/unionfs-fuse

unionfs-fuse: enable darwin

commit6f3eea320cce950fe21d9236ec90fdd2cd11e51b authorSandro <sandro.jaeckel@gmail.com> dateTue 9 Mar 2021, 10:27 (6 years ago) parent9ffb2295a49c95
1 file changed+18−11
pkgs/tools/filesystems/unionfs-fuse/default.nix+18−11
pkgs/tools/filesystems/unionfs-fuse/default.nix+18−11
@@ -1,4 +1,4 @@
1−{ lib, stdenv, fetchFromGitHub, cmake, fuse }:
1+{ lib, stdenv, fetchFromGitHub, cmake, fuse, osxfuse }:
22
33stdenv.mkDerivation rec {
44 pname = "unionfs-fuse";
@@ -11,16 +11,23 @@ stdenv.mkDerivation rec {
1111 sha256 = "0bwx70x834qgqh53vqp18bhbxbsny80hz922rbgj8k9wj7cbfilm";
1212 };
1313
14− patches =
15− [ # Prevent the unionfs daemon from being killed during
16− # shutdown. See
17− # http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/
18− # for details.
19− ./prevent-kill-on-shutdown.patch
20− ];
14+ patches = [
15+ # Prevent the unionfs daemon from being killed during
16+ # shutdown. See
17+ # http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/
18+ # for details.
19+ ./prevent-kill-on-shutdown.patch
20+ ];
21+
22+ postPatch = lib.optionalString stdenv.isDarwin ''
23+ substituteInPlace CMakeLists.txt \
24+ --replace '/usr/local/include/osxfuse/fuse' '${osxfuse}/include/osxfuse/fuse'
25+ substituteInPlace src/CMakeLists.txt \
26+ --replace 'target_link_libraries(unionfs fuse pthread)' 'target_link_libraries(unionfs osxfuse pthread)'
27+ '';
2128
2229 nativeBuildInputs = [ cmake ];
23− buildInputs = [ fuse ];
30+ buildInputs = [ (if stdenv.isDarwin then osxfuse else fuse) ];
2431
2532 # Put the unionfs mount helper in place as mount.unionfs-fuse. This makes it
2633 # possible to do:
@@ -28,7 +35,7 @@ stdenv.mkDerivation rec {
2835 #
2936 # This must be done in preConfigure because the build process removes
3037 # helper from the source directory during the build.
31− preConfigure = ''
38+ preConfigure = lib.optionalString (!stdenv.isDarwin) ''
3239 mkdir -p $out/sbin
3340 cp -a mount.unionfs $out/sbin/mount.unionfs-fuse
3441 substituteInPlace $out/sbin/mount.unionfs-fuse --replace mount.fuse ${fuse}/sbin/mount.fuse
@@ -39,7 +46,7 @@ stdenv.mkDerivation rec {
3946 description = "FUSE UnionFS implementation";
4047 homepage = "https://github.com/rpodgorny/unionfs-fuse";
4148 license = licenses.bsd3;
42− platforms = platforms.linux;
49+ platforms = platforms.unix;
4350 maintainers = with maintainers; [ orivej ];
4451 };
4552}