9 buildPythonPackage rec {
11 version = "22.12.4.2";
12 format = "setuptools";
14 src = fetchFromGitHub {
17 rev = "TS-${version}";
18 hash = "sha256-vBLbjP1gQEQNsTLc2W6uRzCFHQXZp+jGiwE0Pe8VTuw=";
21 nativeBuildInputs = [ cython_0 ];
22 buildInputs = [ zfs ];
24 # Passing CFLAGS in configureFlags does not work, see https://github.com/truenas/py-libzfs/issues/107
25 postPatch = lib.optionalString stdenv.isLinux ''
26 substituteInPlace configure \
28 'CFLAGS="-DCYTHON_FALLTHROUGH"' \
29 'CFLAGS="-DCYTHON_FALLTHROUGH -I${zfs.dev}/include/libzfs -I${zfs.dev}/include/libspl"' \
30 --replace 'zof=false' 'zof=true'
33 pythonImportsCheck = [ "libzfs" ];
36 description = "Python libzfs bindings";
37 homepage = "https://github.com/truenas/py-libzfs";
38 license = licenses.bsd2;
39 maintainers = with maintainers; [ chuangzhu ];
40 # The project also supports macOS (OpenZFS on OSX, O3X), FreeBSD and OpenSolaris
41 # I don't have a machine to test out, thus only packaged for Linux
42 platforms = platforms.linux;