python3Packages.argon2-cffi-bindings: use system libargon2

argon2-cffi-bindings uses a vendored copy of libargon2 by default, but can
be configured to use a system installation. This reduces the output size
avoids issues with the build system mistakenly trying to use SSE2 on
non-x86 platforms when cross-compiling.
This commit is contained in:
Ben Wolsieffer 2023-09-01 13:57:33 -04:00
parent 805576cd9b
commit b55e27cc5c
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchPypi
, libargon2
, cffi
, setuptools-scm
}:
@ -14,6 +15,8 @@ buildPythonPackage rec {
sha256 = "bb89ceffa6c791807d1305ceb77dbfacc5aa499891d2c55661c6459651fc39e3";
};
buildInputs = [ libargon2 ];
nativeBuildInputs = [
setuptools-scm
cffi
@ -23,6 +26,8 @@ buildPythonPackage rec {
cffi
];
env.ARGON2_CFFI_USE_SYSTEM = 1;
# tarball doesn't include tests, but the upstream tests are minimal
doCheck = false;
pythonImportsCheck = [ "_argon2_cffi_bindings" ];

View File

@ -29,8 +29,6 @@ buildPythonPackage rec {
propagatedBuildInputs = [ six argon2-cffi-bindings ]
++ lib.optional (!isPy3k) enum34;
ARGON2_CFFI_USE_SSE2 = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) "0";
nativeCheckInputs = [ hypothesis pytest wheel ];
checkPhase = ''
pytest tests