2021-02-10 00:37:24 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-05-23 14:13:46 +02:00
|
|
|
, fetchpatch
|
2021-02-10 00:37:24 +01:00
|
|
|
, kernel
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "apfs";
|
2022-04-01 19:13:33 +02:00
|
|
|
version = "unstable-2022-02-03-${kernel.version}";
|
2021-02-10 00:37:24 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linux-apfs";
|
|
|
|
repo = "linux-apfs-rw";
|
2022-04-01 19:13:33 +02:00
|
|
|
rev = "a0d6a4dca69b6eab3cabaaee4d4284807828a266";
|
|
|
|
sha256 = "sha256-3T1BNc6g3SDTxb0VrronLUIp/CWbwnzXTsc8Qk5c4jY=";
|
2021-02-10 00:37:24 +01:00
|
|
|
};
|
|
|
|
|
2022-05-23 14:13:46 +02:00
|
|
|
patches = [
|
|
|
|
# Fix build for Linux 5.18+.
|
|
|
|
# https://github.com/linux-apfs/linux-apfs-rw/pull/24
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/linux-apfs/linux-apfs-rw/commit/93b93767acab614c4e6426c9fd38bdf9af00bc13.patch";
|
|
|
|
sha256 = "1ss7cal851qadcmkn3jcckpa2f003nzb03xsx1g8vkb1cl0n8gi7";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-10 00:37:24 +01:00
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
2022-02-10 02:35:56 +01:00
|
|
|
makeFlags = kernel.makeFlags ++ [
|
2021-02-10 00:37:24 +01:00
|
|
|
"KERNELRELEASE=${kernel.modDirVersion}"
|
|
|
|
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
"INSTALL_MOD_PATH=$(out)"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "APFS module for linux";
|
|
|
|
homepage = "https://github.com/linux-apfs/linux-apfs-rw";
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
platforms = platforms.linux;
|
2021-09-06 18:39:57 +02:00
|
|
|
broken = kernel.kernelOlder "4.9";
|
2021-02-10 00:37:24 +01:00
|
|
|
maintainers = with maintainers; [ Luflosi ];
|
|
|
|
};
|
|
|
|
}
|