pythonPackages.pcsclite: refactor

This commit is contained in:
Guillaume Maudoux 2017-01-19 15:20:54 +01:00
parent 805e6804b1
commit e735f85c4d

View File

@ -1,27 +1,28 @@
{ stdenv, fetchurl, fetchpatch, python, buildPythonPackage, swig, pcsclite }: { stdenv, fetchurl, buildPythonPackage, swig, pcsclite }:
buildPythonPackage rec { buildPythonPackage rec {
name = "pyscard-1.9.4"; name = "pyscard-${version}";
namePrefix = ""; version = "1.9.4";
src = fetchurl { src = fetchurl {
url = "mirror://pypi/p/pyscard/${name}.tar.gz"; url = "mirror://pypi/p/pyscard/${name}.tar.gz";
sha256 = "0gn0p4p8dhk99g8vald0dcnh45jbf82bj72n4djyr8b4hawkck4v"; sha256 = "0gn0p4p8dhk99g8vald0dcnh45jbf82bj72n4djyr8b4hawkck4v";
}; };
configurePhase = ""; patchPhase = ''
sed -e 's!"libpcsclite\.so\.1"!"${pcsclite}/lib/libpcsclite.so.1"!' \
-i smartcard/scard/winscarddll.c
'';
NIX_CFLAGS_COMPILE = "-isystem ${pcsclite}/include/PCSC/";
LDFLAGS="-L${pcsclite}/lib"; propagatedBuildInputs = [ pcsclite ];
CFLAGS="-I${pcsclite}/include/PCSC"; buildInputs = [ swig ];
propagatedBuildInputs = [ swig pcsclite ];
#doCheck = !(python.isPypy or stdenv.isDarwin); # error: AF_UNIX path too long
meta = { meta = {
homepage = "https://pyscard.sourceforge.io/"; homepage = "https://pyscard.sourceforge.io/";
description = "Smartcard library for python"; description = "Smartcard library for python";
license = stdenv.lib.licenses.lgpl21; license = stdenv.lib.licenses.lgpl21;
maintainers = with stdenv.lib.maintainers; [ layus ];
}; };
} }