11 buildPythonPackage rec {
14 format = "setuptools";
16 src = fetchFromGitHub {
19 rev = "TS-${version}";
20 hash = "sha256-Uiu0RNE06++iNWUNcKpbZvreT2D7/EqHlFZJXKe3F4A=";
25 url = "https://github.com/truenas/py-libzfs/commit/b5ffe1f1d6097df6e2f5cc6dd3c968872ec60804.patch";
26 hash = "sha256-6r5hQ/o7c4vq4Tfh0l1WbeK3AuPvi+1wzkwkIn1qEes=";
30 build-system = [ cython_0 ];
31 buildInputs = [ zfs ];
33 # Passing CFLAGS in configureFlags does not work, see https://github.com/truenas/py-libzfs/issues/107
34 postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
35 substituteInPlace configure \
37 'CFLAGS="-DCYTHON_FALLTHROUGH"' \
38 'CFLAGS="-DCYTHON_FALLTHROUGH -I${zfs.dev}/include/libzfs -I${zfs.dev}/include/libspl"' \
39 --replace-fail 'zof=false' 'zof=true'
42 pythonImportsCheck = [ "libzfs" ];
45 description = "Python libzfs bindings";
46 homepage = "https://github.com/truenas/py-libzfs";
47 license = licenses.bsd2;
48 maintainers = with maintainers; [ chuangzhu ];
49 # The project also supports macOS (OpenZFS on OSX, O3X), FreeBSD and OpenSolaris
50 # I don't have a machine to test out, thus only packaged for Linux
51 platforms = platforms.linux;