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