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