diff options
author | Edmund Wu <22758444+eadwu@users.noreply.github.com> | 2018-11-01 05:41:28 -0400 |
---|---|---|
committer | Robert Schütz <rschuetz17@gmail.com> | 2018-11-01 10:41:28 +0100 |
commit | 0111c7d8515d229cc19b487bb0c2e62571413e3c (patch) | |
tree | 33f7e8b51b717bca08fde86fcbc806b557758b08 /pkgs/development | |
parent | 9fce8d52034e4bd7c6ad89921056011aceeeb985 (diff) | |
download | nixpkgs-0111c7d8515d229cc19b487bb0c2e62571413e3c.tar nixpkgs-0111c7d8515d229cc19b487bb0c2e62571413e3c.tar.gz nixpkgs-0111c7d8515d229cc19b487bb0c2e62571413e3c.tar.bz2 nixpkgs-0111c7d8515d229cc19b487bb0c2e62571413e3c.tar.lz nixpkgs-0111c7d8515d229cc19b487bb0c2e62571413e3c.tar.xz nixpkgs-0111c7d8515d229cc19b487bb0c2e62571413e3c.tar.zst nixpkgs-0111c7d8515d229cc19b487bb0c2e62571413e3c.zip |
pythonPackages.zstd: init at 1.3.5.1 (#49339)
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/python-modules/zstd/default.nix | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/zstd/default.nix b/pkgs/development/python-modules/zstd/default.nix new file mode 100644 index 00000000000..53c3c8969ab --- /dev/null +++ b/pkgs/development/python-modules/zstd/default.nix @@ -0,0 +1,49 @@ +{ stdenv, pkgconfig, fetchpatch, fetchFromGitHub, buildPythonPackage +, zstd, pytest }: + +buildPythonPackage rec { + pname = "zstd"; + version = "1.3.5.1"; + + # Switch back to fetchPypi when tests/ is included, see https://github.com/NixOS/nixpkgs/pull/49339 + src = fetchFromGitHub { + owner = "sergey-dryabzhinsky"; + repo = "python-zstd"; + rev = "v${version}"; + sha256 = "08n1vz4zavas4cgzpdfcbpy33lnv39xxhq5mgj0zv3xi03ypc1rl"; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace "/usr/bin/pkg-config" "${pkgconfig}/bin/pkg-config" + ''; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ zstd ]; + + setupPyBuildFlags = [ + "--external" + "--include-dirs=${zstd}/include" + "--libraries=zstd" + "--library-dirs=${zstd}/lib" + ]; + + # Running tests via setup.py triggers an attempt to recompile with the vendored zstd + ZSTD_EXTERNAL = 1; + VERSION = zstd.version; + PKG_VERSION = version; + + checkInputs = [ pytest ]; + checkPhase = '' + pytest + ''; + + meta = with stdenv.lib; { + description = "Simple python bindings to Yann Collet ZSTD compression library"; + homepage = https://github.com/sergey-dryabzhinsky/python-zstd; + license = licenses.bsd2; + maintainers = with maintainers; [ + eadwu + ]; + }; +} |