From a5746b7e42be2f8c658bc35855a3cb6f3c7b2a3b Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Fri, 1 Nov 2024 10:41:27 +0100 Subject: [PATCH] pyscard: fix build --- .../python-modules/pyscard/default.nix | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/pyscard/default.nix b/pkgs/development/python-modules/pyscard/default.nix index 4392b3cb60121..eb9232a3deb53 100644 --- a/pkgs/development/python-modules/pyscard/default.nix +++ b/pkgs/development/python-modules/pyscard/default.nix @@ -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