nixpkgs-suyu/pkgs/tools/security/pcsclite/default.nix

50 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, pkgconfig, udev, dbus, perl, python2
2016-08-12 05:51:32 +02:00
, IOKit ? null }:
stdenv.mkDerivation rec {
name = "pcsclite-${version}";
2018-01-04 09:34:43 +01:00
version = "1.8.23";
2018-06-21 12:40:15 +02:00
outputs = [ "bin" "out" "dev" "doc" "man" ];
src = fetchurl {
2018-06-12 22:40:32 +02:00
url = "https://pcsclite.apdu.fr/files/pcsc-lite-${version}.tar.bz2";
2018-06-10 14:42:13 +02:00
sha256 = "1jc9ws5ra6v3plwraqixin0w0wfxj64drahrbkyrrwzghqjjc9ss";
};
patches = [ ./no-dropdir-literals.patch ];
configureFlags = [
2015-08-06 04:25:37 +02:00
# The OS should care on preparing the drivers into this location
"--enable-usbdropdir=/var/lib/pcsc/drivers"
2015-08-06 04:25:37 +02:00
"--enable-confdir=/etc"
"--enable-ipcdir=/run/pcscd"
2015-12-03 19:13:31 +01:00
] ++ stdenv.lib.optional stdenv.isLinux
2018-01-05 00:39:44 +01:00
"--with-systemdsystemunitdir=\${out}/etc/systemd/system"
++ stdenv.lib.optional (!stdenv.isLinux)
"--disable-libsystemd";
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"
'';
2015-11-13 12:41:19 +01:00
nativeBuildInputs = [ pkgconfig perl python2 ];
buildInputs = stdenv.lib.optionals stdenv.isLinux [ udev dbus ]
2016-08-12 05:51:32 +02:00
++ stdenv.lib.optionals stdenv.isDarwin [ IOKit ];
2014-03-21 22:32:21 +01:00
meta = with stdenv.lib; {
description = "Middleware to access a smart card using SCard API (PC/SC)";
2018-06-12 22:40:32 +02:00
homepage = https://pcsclite.apdu.fr/;
2014-03-21 22:32:21 +01:00
license = licenses.bsd3;
maintainers = with maintainers; [ wkennington ];
2015-12-03 19:13:31 +01:00
platforms = with platforms; unix;
};
}