Merge pull request #228781 from wegank/apfs-fuse-darwin

apfs-fuse: add darwin support

authored by

Weijia Wang and committed by
GitHub
87d526ff affa4b59

+17 -3
+17 -3
pkgs/tools/filesystems/apfs-fuse/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, fuse3, bzip2, zlib, attr, cmake }: 1 + { lib, stdenv, fetchFromGitHub, fuse, fuse3, bzip2, zlib, attr, cmake }: 2 2 3 3 stdenv.mkDerivation { 4 4 pname = "apfs-fuse-unstable"; ··· 12 12 fetchSubmodules = true; 13 13 }; 14 14 15 - buildInputs = [ fuse3 bzip2 zlib attr ]; 15 + postPatch = lib.optionalString stdenv.isDarwin '' 16 + substituteInPlace CMakeLists.txt \ 17 + --replace "/usr/local/lib/libosxfuse.dylib" "fuse" 18 + ''; 19 + 16 20 nativeBuildInputs = [ cmake ]; 17 21 22 + buildInputs = [ 23 + (if stdenv.isDarwin then fuse else fuse3) 24 + bzip2 25 + zlib 26 + ] ++ lib.optional stdenv.isLinux attr; 27 + 28 + cmakeFlags = lib.optional stdenv.isDarwin "-DUSE_FUSE3=OFF"; 29 + 30 + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DUSE_FUSE2"; 31 + 18 32 postFixup = '' 19 33 ln -s $out/bin/apfs-fuse $out/bin/mount.fuse.apfs-fuse 20 34 ''; ··· 24 38 description = "FUSE driver for APFS (Apple File System)"; 25 39 license = licenses.gpl2Plus; 26 40 maintainers = with maintainers; [ ealasu ]; 27 - platforms = platforms.linux; 41 + platforms = platforms.unix; 28 42 }; 29 43 30 44 }