1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00
nixpkgs/pkgs/by-name/ap/apfs-fuse/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

45 lines
1.3 KiB
Nix

{ lib, stdenv, fetchFromGitHub, fuse, fuse3, bzip2, zlib, attr, cmake }:
stdenv.mkDerivation {
pname = "apfs-fuse";
version = "unstable-2023-03-12";
src = fetchFromGitHub {
owner = "sgan81";
repo = "apfs-fuse";
rev = "66b86bd525e8cb90f9012543be89b1f092b75cf3";
hash = "sha256-uYAlqnQp0K880XEWuH1548DUA3ii53+hfsuh/T3Vwzg=";
fetchSubmodules = true;
};
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace CMakeLists.txt \
--replace "/usr/local/lib/libosxfuse.dylib" "fuse"
'';
nativeBuildInputs = [ cmake ];
buildInputs = [
(if stdenv.hostPlatform.isDarwin then fuse else fuse3)
bzip2
zlib
] ++ lib.optional stdenv.hostPlatform.isLinux attr;
cmakeFlags = lib.optional stdenv.hostPlatform.isDarwin "-DUSE_FUSE3=OFF";
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DUSE_FUSE2";
postFixup = ''
ln -s $out/bin/apfs-fuse $out/bin/mount.fuse.apfs-fuse
'';
meta = with lib; {
homepage = "https://github.com/sgan81/apfs-fuse";
description = "FUSE driver for APFS (Apple File System)";
license = licenses.gpl2Plus;
mainProgram = "apfs-fuse";
maintainers = with maintainers; [ ealasu ];
platforms = platforms.unix;
};
}