Skip to content

Commit

Permalink
pythonPackages.pyscard: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
itepastra committed Nov 1, 2024
1 parent 4bf1468 commit a6e58e4
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions pkgs/development/python-modules/pyscard/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,25 @@ buildPythonPackage rec {
nativeCheckInputs = [ pytestCheckHook ];

postPatch =
if withApplePCSC then
''
substituteInPlace smartcard/scard/winscarddll.c \
--replace-fail "/System/Library/Frameworks/PCSC.framework/PCSC" \
"${PCSC}/Library/Frameworks/PCSC.framework/PCSC"
''
else
''
substituteInPlace setup.py --replace "pkg-config" "$PKG_CONFIG"
substituteInPlace smartcard/scard/winscarddll.c \
--replace-fail "libpcsclite.so.1" \
"${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"
'';
''
substituteInPlace pyproject.toml \
--replace-fail "\"setuptools\",\"swig\"" "\"setuptools\""
''
+ (
if withApplePCSC then
''
substituteInPlace smartcard/scard/winscarddll.c \
--replace-fail "/System/Library/Frameworks/PCSC.framework/PCSC" \
"${PCSC}/Library/Frameworks/PCSC.framework/PCSC"
''
else
''
substituteInPlace setup.py --replace "pkg-config" "$PKG_CONFIG"
substituteInPlace smartcard/scard/winscarddll.c \
--replace-fail "libpcsclite.so.1" \
"${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"
''
);

preCheck = ''
# remove src module, so tests use the installed module instead
Expand Down

0 comments on commit a6e58e4

Please sign in to comment.