14 # Package does not support configuring the pcsc library.
15 withApplePCSC = stdenv.isDarwin;
18 buildPythonPackage rec {
23 src = fetchFromGitHub {
24 owner = "LudovicRousseau";
26 rev = "refs/tags/${version}";
27 hash = "sha256-nkDI1OPQ4SsNhWkg53ZTsG7j0+mvpkJI7dsyaOl1a/8=";
33 ] ++ lib.optionals (!withApplePCSC) [
37 buildInputs = if withApplePCSC then [ PCSC ] else [ pcsclite ];
44 if withApplePCSC then ''
45 substituteInPlace smartcard/scard/winscarddll.c \
46 --replace "/System/Library/Frameworks/PCSC.framework/PCSC" \
47 "${PCSC}/Library/Frameworks/PCSC.framework/PCSC"
49 substituteInPlace setup.py --replace "pkg-config" "$PKG_CONFIG"
50 substituteInPlace smartcard/scard/winscarddll.c \
51 --replace "libpcsclite.so.1" \
52 "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"
56 # remove src module, so tests use the installed module instead
61 homepage = "https://pyscard.sourceforge.io/";
62 description = "Smartcard library for python";
63 license = licenses.lgpl21;
64 maintainers = with maintainers; [ layus ];