-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
pythonPackages.zstd: init at 1.3.5.1 #49339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Perhaps it would make sense to use {
setupPyBuildFlags = [
"--external"
"--include-dirs=${zstd}/include"
"--libraries=zstd"
"--library-dirs=${zstd}/lib"
];
} |
How should the src attribute be set? Just a random placeholder file/folder? |
cebf13e
to
e5f8aa7
Compare
e5f8aa7
to
e674e1b
Compare
@eadwu May I suggest a following change diff --git a/pkgs/development/python-modules/zstd/default.nix b/pkgs/development/python-modules/zstd/default.nix
index 5d1485c2720..785dd9d3946 100644
--- a/pkgs/development/python-modules/zstd/default.nix
+++ b/pkgs/development/python-modules/zstd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPythonPackage, fetchpatch, fetchFromGitHub }:
+{ stdenv, buildPythonPackage, fetchpatch, fetchFromGitHub, pkgconfig, pytest, zstd }:
buildPythonPackage rec {
pname = "zstd";
@@ -8,18 +8,33 @@ buildPythonPackage rec {
owner = "sergey-dryabzhinsky";
repo = "python-zstd";
rev = "v${version}";
- sha256 = "0sy1ccqsh3bilzs7f6qkgqq9r734kgp8410vyv2x5vvzx3azp45d";
- fetchSubmodules = true;
+ sha256 = "08n1vz4zavas4cgzpdfcbpy33lnv39xxhq5mgj0zv3xi03ypc1rl";
};
- patches = [
- # make sure tests directory is included
- (fetchpatch {
- url = "https://github.com/sergey-dryabzhinsky/python-zstd/commit/cbdfbe2477b43e2d527fa4ee5dc960134a051be4.patch";
- sha256 = "18ws563nmvx5rnpm1lyzi2379rgbsc614wp2cd5m40k3j21g0sfq";
- })
+ 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";
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 2e99065a727..b2554dc53bf 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -10917,7 +10917,9 @@ EOF
todoist = callPackage ../development/python-modules/todoist { };
- zstd = callPackage ../development/python-modules/zstd { };
+ zstd = callPackage ../development/python-modules/zstd {
+ inherit (pkgs) pkgconfig zstd;
+ };
zxcvbn-python = callPackage ../development/python-modules/zxcvbn-python { };
You don't need the https://github.com/sergey-dryabzhinsky/python-zstd/commit/cbdfbe2477b43e2d527fa4ee5dc960134a051be4.patch . You switched to fetching from github and that was enough to get the tests directory, it is just not available from Pypi. |
e674e1b
to
ccd983c
Compare
ccd983c
to
5983aef
Compare
@GrahamcOfBorg build python2Packages.zstd python3Packages.zstd |
Success on aarch64-linux (full log) Attempted: python2Packages.zstd, python3Packages.zstd Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: python2Packages.zstd, python3Packages.zstd Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: python2Packages.zstd, python3Packages.zstd Partial log (click to expand)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)