depot/third_party/nixpkgs/pkgs/by-name/ap/apfsprogs/package.nix
Default email c7cb07f092 Project import generated by Copybara.
GitOrigin-RevId: 1536926ef5621b09bba54035ae2bb6d806d72ac8
2024-02-29 21:09:43 +01:00

57 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, nixosTests
}:
stdenv.mkDerivation (finalAttrs: {
pname = "apfsprogs";
version = "unstable-2023-11-30";
src = fetchFromGitHub {
owner = "linux-apfs";
repo = "apfsprogs";
rev = "990163894d871f51ba102a75aed384a275c5991b";
hash = "sha256-yCShZ+ALzSe/svErt9/i1JyyEvbIeABGPbpS4lVil0A=";
};
postPatch = let
shortRev = builtins.substring 0 9 finalAttrs.src.rev;
in ''
substituteInPlace \
apfs-snap/Makefile apfsck/Makefile mkapfs/Makefile \
--replace \
'$(shell git describe --always HEAD | tail -c 9)' \
'${shortRev}'
'';
buildPhase = ''
runHook preBuild
make -C apfs-snap $makeFlags
make -C apfsck $makeFlags
make -C mkapfs $makeFlags
runHook postBuild
'';
installPhase = ''
runHook preInstall
make -C apfs-snap install DESTDIR="$out" $installFlags
make -C apfsck install DESTDIR="$out" $installFlags
make -C mkapfs install DESTDIR="$out" $installFlags
runHook postInstall
'';
passthru.tests = {
apfs = nixosTests.apfs;
};
strictDeps = true;
meta = with lib; {
description = "Experimental APFS tools for linux";
homepage = "https://github.com/linux-apfs/apfsprogs";
license = licenses.gpl2Only;
platforms = platforms.linux;
maintainers = with maintainers; [ Luflosi ];
};
})