1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00
nixpkgs/pkgs/by-name/ap/apfsprogs/package.nix
Luflosi 573a0dc7fc
apfsprogs: unstable-2023-06-06 -> unstable-2023-11-30
Diff: 91827679df...990163894d

Patch the code to let the tools output the git commit they were built with when running them with `-v`.
2024-01-21 17:19:50 +01:00

58 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 ];
};
})