python312Packages.py-libzfs: modernize

This commit is contained in:
Peder Bergebakken Sundt
2024-08-24 19:10:42 +02:00
parent 0f502f437e
commit d8d377ecbb
@@ -4,6 +4,7 @@
buildPythonPackage,
fetchFromGitHub,
fetchpatch2,
setuptools,
cython_0,
zfs,
}:
@@ -27,16 +28,16 @@ buildPythonPackage rec {
})
];
nativeBuildInputs = [ cython_0 ];
build-system = [ cython_0 ];
buildInputs = [ zfs ];
# Passing CFLAGS in configureFlags does not work, see https://github.com/truenas/py-libzfs/issues/107
postPatch = lib.optionalString stdenv.isLinux ''
substituteInPlace configure \
--replace \
--replace-fail \
'CFLAGS="-DCYTHON_FALLTHROUGH"' \
'CFLAGS="-DCYTHON_FALLTHROUGH -I${zfs.dev}/include/libzfs -I${zfs.dev}/include/libspl"' \
--replace 'zof=false' 'zof=true'
--replace-fail 'zof=false' 'zof=true'
'';
pythonImportsCheck = [ "libzfs" ];