2019-04-06 23:03:28 +01:00
|
|
|
{ stdenv, fetchPypi, fetchpatch, buildPythonPackage, swig, pcsclite, PCSC }:
|
2017-01-17 01:18:27 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2019-04-02 19:07:52 +01:00
|
|
|
version = "1.9.8";
|
2017-05-27 10:25:35 +01:00
|
|
|
pname = "pyscard";
|
2017-01-17 01:18:27 +00:00
|
|
|
|
2018-06-23 14:27:58 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-04-02 19:07:52 +01:00
|
|
|
sha256 = "15fh00z1an6r5j7hrz3jlq0rb3jygwf3x4jcwsa008bv8vpcg7gm";
|
2017-01-17 01:18:27 +00:00
|
|
|
};
|
|
|
|
|
2018-06-23 14:27:58 +01:00
|
|
|
postPatch = ''
|
2018-06-21 11:40:15 +01:00
|
|
|
sed -e 's!"libpcsclite\.so\.1"!"${stdenv.lib.getLib pcsclite}/lib/libpcsclite.so.1"!' \
|
2017-01-19 14:20:54 +00:00
|
|
|
-i smartcard/scard/winscarddll.c
|
|
|
|
'';
|
2017-01-17 01:18:27 +00:00
|
|
|
|
2018-06-21 11:40:15 +01:00
|
|
|
NIX_CFLAGS_COMPILE = "-isystem ${stdenv.lib.getDev pcsclite}/include/PCSC/";
|
2017-01-17 01:18:27 +00:00
|
|
|
|
2019-04-06 23:03:28 +01:00
|
|
|
patches = [
|
|
|
|
# Fixes darwin tests
|
|
|
|
# See: https://github.com/LudovicRousseau/pyscard/issues/77
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/LudovicRousseau/pyscard/commit/62e675028086c75656444cc21d563d9f08ebf8e7.patch";
|
|
|
|
sha256 = "1lr55npcpc8j750vf7vaisqyk18d5f00l7nii2lvawg4sssjaaf7";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2017-01-19 14:20:54 +00:00
|
|
|
propagatedBuildInputs = [ pcsclite ];
|
2019-03-01 13:38:48 +00:00
|
|
|
buildInputs = stdenv.lib.optional stdenv.isDarwin PCSC;
|
|
|
|
nativeBuildInputs = [ swig ];
|
2017-01-17 01:18:27 +00:00
|
|
|
|
|
|
|
meta = {
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = https://pyscard.sourceforge.io/;
|
2017-01-17 01:18:27 +00:00
|
|
|
description = "Smartcard library for python";
|
|
|
|
license = stdenv.lib.licenses.lgpl21;
|
2017-01-19 14:20:54 +00:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ layus ];
|
2017-01-17 01:18:27 +00:00
|
|
|
};
|
|
|
|
}
|