2023-04-29 16:46:19 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fuse, fuse3, bzip2, zlib, attr, cmake }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2024-02-07 01:22:34 +00:00
|
|
|
pname = "apfs-fuse";
|
|
|
|
version = "unstable-2023-03-12";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sgan81";
|
|
|
|
repo = "apfs-fuse";
|
2024-02-07 01:22:34 +00:00
|
|
|
rev = "66b86bd525e8cb90f9012543be89b1f092b75cf3";
|
|
|
|
hash = "sha256-uYAlqnQp0K880XEWuH1548DUA3ii53+hfsuh/T3Vwzg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace "/usr/local/lib/libosxfuse.dylib" "fuse"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
buildInputs = [
|
|
|
|
(if stdenv.isDarwin then fuse else fuse3)
|
|
|
|
bzip2
|
|
|
|
zlib
|
|
|
|
] ++ lib.optional stdenv.isLinux attr;
|
|
|
|
|
|
|
|
cmakeFlags = lib.optional stdenv.isDarwin "-DUSE_FUSE3=OFF";
|
|
|
|
|
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DUSE_FUSE2";
|
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
postFixup = ''
|
|
|
|
ln -s $out/bin/apfs-fuse $out/bin/mount.fuse.apfs-fuse
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/sgan81/apfs-fuse";
|
|
|
|
description = "FUSE driver for APFS (Apple File System)";
|
2021-03-23 19:22:30 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2024-02-07 01:22:34 +00:00
|
|
|
mainProgram = "apfs-fuse";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ ealasu ];
|
2023-04-29 16:46:19 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|