diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2022-10-19 05:24:28 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2022-10-19 05:24:28 +0200 |
commit | 457f28f6f85eea1b1671d62d2abe39297c9c90f7 (patch) | |
tree | 3c6e68534e7bfcde19893c830af7498b0606e6d2 /pkgs/development/python-modules/py-libzfs/default.nix | |
parent | a25e03e76ae1e0367419db1de009e1139d08de68 (diff) | |
parent | 1aa7d4e6c61526606d9e26f939cdb60ec8f45fcd (diff) |
Merge branch 'master' into staging-next
; Conflicts: ; pkgs/development/tools/codespell/default.nix codespell 2.2.2 switched to pyproject & setuptools_scm: https://github.com/codespell-project/codespell/pull/2523
Diffstat (limited to 'pkgs/development/python-modules/py-libzfs/default.nix')
-rw-r--r-- | pkgs/development/python-modules/py-libzfs/default.nix | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/py-libzfs/default.nix b/pkgs/development/python-modules/py-libzfs/default.nix new file mode 100644 index 0000000000000..21663ba802383 --- /dev/null +++ b/pkgs/development/python-modules/py-libzfs/default.nix @@ -0,0 +1,44 @@ +{ lib +, stdenv +, buildPythonPackage +, fetchFromGitHub +, cython +, zfs +}: + +buildPythonPackage rec { + pname = "py-libzfs"; + version = "22.02.4"; + + src = fetchFromGitHub { + owner = "truenas"; + repo = pname; + rev = "TS-${version}"; + sha256 = "sha256-BJG+cw07Qu4aL99pVKNd7JAgr+w/6Uv2eI46EB615/I="; + }; + + nativeBuildInputs = [ cython ]; + 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 \ + 'CFLAGS="-DCYTHON_FALLTHROUGH"' \ + 'CFLAGS="-DCYTHON_FALLTHROUGH -I${zfs.dev}/include/libzfs -I${zfs.dev}/include/libspl"' \ + --replace 'zof=false' 'zof=true' + ''; + + pythonImportsCheck = [ "libzfs" ]; + + meta = with lib; { + description = "Python libzfs bindings"; + homepage = "https://github.com/truenas/py-libzfs"; + license = licenses.bsd2; + maintainers = with maintainers; [ chuangzhu ]; + # The project also supports macOS (OpenZFS on OSX, O3X), FreeBSD and OpenSolaris + # I don't have a machine to test out, thus only packaged for Linux + platforms = platforms.linux; + }; +} + |