blob: 8ad883cdd91952a77b5216a0131c6dead12f352a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
{
lib,
buildPythonPackage,
fetchFromGitHub,
pcsclite,
pkg-config,
pytestCheckHook,
setuptools,
stdenv,
swig,
}:
buildPythonPackage rec {
pname = "pyscard";
version = "2.3.1";
pyproject = true;
src = fetchFromGitHub {
owner = "LudovicRousseau";
repo = "pyscard";
tag = version;
hash = "sha256-MW/Cg7Ta/LdY/pOomsEecVIt62rc5qSAGjpJl4m+ruM=";
};
build-system = [ setuptools ];
nativeBuildInputs = [ swig ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ];
buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ pcsclite ];
nativeCheckInputs = [ pytestCheckHook ];
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'requires = ["setuptools","swig"]' 'requires = ["setuptools"]'
''
+ 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";
homepage = "https://pyscard.sourceforge.io/";
changelog = "https://github.com/LudovicRousseau/pyscard/releases/tag/${src.tag}";
license = lib.licenses.lgpl21Plus;
maintainers = with lib.maintainers; [ layus ];
};
}
|