mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-29 19:30:11 +00:00
python3Packages.pyscard: clean up apple_sdk stubs
Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
PCSC,
|
||||
pcsclite,
|
||||
pkg-config,
|
||||
pytestCheckHook,
|
||||
@@ -11,11 +10,6 @@
|
||||
swig,
|
||||
}:
|
||||
|
||||
let
|
||||
# Package does not support configuring the pcsc library.
|
||||
withApplePCSC = stdenv.hostPlatform.isDarwin;
|
||||
in
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyscard";
|
||||
version = "2.2.1";
|
||||
@@ -30,9 +24,9 @@ buildPythonPackage rec {
|
||||
|
||||
build-system = [ setuptools ];
|
||||
|
||||
nativeBuildInputs = [ swig ] ++ lib.optionals (!withApplePCSC) [ pkg-config ];
|
||||
nativeBuildInputs = [ swig ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ];
|
||||
|
||||
buildInputs = if withApplePCSC then [ PCSC ] else [ pcsclite ];
|
||||
buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ pcsclite ];
|
||||
|
||||
nativeCheckInputs = [ pytestCheckHook ];
|
||||
|
||||
@@ -41,21 +35,12 @@ buildPythonPackage rec {
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace-fail 'requires = ["setuptools","swig"]' 'requires = ["setuptools"]'
|
||||
''
|
||||
+ (
|
||||
if withApplePCSC then
|
||||
''
|
||||
substituteInPlace src/smartcard/scard/winscarddll.c \
|
||||
--replace-fail "/System/Library/Frameworks/PCSC.framework/PCSC" \
|
||||
"${PCSC}/Library/Frameworks/PCSC.framework/PCSC"
|
||||
''
|
||||
else
|
||||
''
|
||||
substituteInPlace setup.py --replace-fail "pkg-config" "$PKG_CONFIG"
|
||||
substituteInPlace src/smartcard/scard/winscarddll.c \
|
||||
--replace-fail "libpcsclite.so.1" \
|
||||
"${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||
''
|
||||
);
|
||||
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
|
||||
substituteInPlace setup.py --replace-fail "pkg-config" "$PKG_CONFIG"
|
||||
substituteInPlace src/smartcard/scard/winscarddll.c \
|
||||
--replace-fail "libpcsclite.so.1" \
|
||||
"${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Smartcard library for python";
|
||||
|
||||
@@ -13200,9 +13200,7 @@ self: super: with self; {
|
||||
|
||||
pyscaffoldext-travis = callPackage ../development/python-modules/pyscaffoldext-travis { };
|
||||
|
||||
pyscard = callPackage ../development/python-modules/pyscard {
|
||||
inherit (pkgs.darwin.apple_sdk.frameworks) PCSC;
|
||||
};
|
||||
pyscard = callPackage ../development/python-modules/pyscard { };
|
||||
|
||||
pyscf = callPackage ../development/python-modules/pyscf { };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user