2018-07-17 21:11:16 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, udev, dbus, perl, python2
|
2016-08-12 04:51:32 +01:00
|
|
|
, IOKit ? null }:
|
2011-09-19 14:01:47 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-06-04 12:20:17 +01:00
|
|
|
name = "pcsclite-${version}";
|
2019-04-09 20:13:17 +01:00
|
|
|
version = "1.8.25";
|
2010-01-09 17:35:57 +00:00
|
|
|
|
2018-06-21 11:40:15 +01:00
|
|
|
outputs = [ "bin" "out" "dev" "doc" "man" ];
|
|
|
|
|
2010-01-09 17:35:57 +00:00
|
|
|
src = fetchurl {
|
2018-06-12 21:40:32 +01:00
|
|
|
url = "https://pcsclite.apdu.fr/files/pcsc-lite-${version}.tar.bz2";
|
2019-04-09 20:13:17 +01:00
|
|
|
sha256 = "14l7irs1nsh8b036ag4cfy8wryyysch78scz5dw6xxqwqgnpjvfp";
|
2010-01-09 17:35:57 +00:00
|
|
|
};
|
|
|
|
|
2016-06-04 11:42:16 +01:00
|
|
|
patches = [ ./no-dropdir-literals.patch ];
|
|
|
|
|
2013-02-23 13:00:49 +00:00
|
|
|
configureFlags = [
|
2015-08-06 03:25:37 +01:00
|
|
|
# The OS should care on preparing the drivers into this location
|
2013-02-23 13:00:49 +00:00
|
|
|
"--enable-usbdropdir=/var/lib/pcsc/drivers"
|
2015-08-06 03:25:37 +01:00
|
|
|
"--enable-confdir=/etc"
|
2016-06-04 14:52:04 +01:00
|
|
|
"--enable-ipcdir=/run/pcscd"
|
2015-12-03 18:13:31 +00:00
|
|
|
] ++ stdenv.lib.optional stdenv.isLinux
|
2018-01-04 23:39:44 +00:00
|
|
|
"--with-systemdsystemunitdir=\${out}/etc/systemd/system"
|
|
|
|
++ stdenv.lib.optional (!stdenv.isLinux)
|
|
|
|
"--disable-libsystemd";
|
2010-01-09 17:35:57 +00:00
|
|
|
|
2016-06-04 11:42:16 +01:00
|
|
|
postConfigure = ''
|
|
|
|
sed -i -re '/^#define *PCSCLITE_HP_DROPDIR */ {
|
|
|
|
s/(DROPDIR *)(.*)/\1(getenv("PCSCLITE_HP_DROPDIR") ? : \2)/
|
|
|
|
}' config.h
|
|
|
|
'';
|
|
|
|
|
2018-06-21 11:40:15 +01:00
|
|
|
postInstall = ''
|
|
|
|
# pcsc-spy is a debugging utility and it drags python into the closure
|
|
|
|
moveToOutput bin/pcsc-spy "$dev"
|
|
|
|
'';
|
|
|
|
|
2015-11-13 11:41:19 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig perl python2 ];
|
2018-07-17 21:11:16 +01:00
|
|
|
buildInputs = stdenv.lib.optionals stdenv.isLinux [ udev dbus ]
|
2016-08-12 04:51:32 +01:00
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin [ IOKit ];
|
2010-01-09 17:35:57 +00:00
|
|
|
|
2014-03-21 21:32:21 +00:00
|
|
|
meta = with stdenv.lib; {
|
2010-01-09 17:35:57 +00:00
|
|
|
description = "Middleware to access a smart card using SCard API (PC/SC)";
|
2018-06-12 21:40:32 +01:00
|
|
|
homepage = https://pcsclite.apdu.fr/;
|
2014-03-21 21:32:21 +00:00
|
|
|
license = licenses.bsd3;
|
2015-12-03 18:13:31 +00:00
|
|
|
platforms = with platforms; unix;
|
2010-01-09 17:35:57 +00:00
|
|
|
};
|
|
|
|
}
|