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

48 lines
1.4 KiB
Nix
Raw Normal View History

2021-01-17 03:51:22 +00:00
{ lib, stdenv, fetchurl, pkg-config, udev, dbus, perl, python3
2016-08-12 04:51:32 +01:00
, IOKit ? null }:
stdenv.mkDerivation rec {
pname = "pcsclite";
2020-07-05 23:31:16 +01:00
version = "1.9.0";
2018-06-21 11:40:15 +01:00
outputs = [ "bin" "out" "dev" "doc" "man" ];
src = fetchurl {
2018-06-12 21:40:32 +01:00
url = "https://pcsclite.apdu.fr/files/pcsc-lite-${version}.tar.bz2";
2020-07-05 23:31:16 +01:00
sha256 = "1y9f9zipnrmgiw0mxrvcgky8vfrcmg6zh40gbln5a93i2c1x8j01";
};
patches = [ ./no-dropdir-literals.patch ];
configureFlags = [
2015-08-06 03:25:37 +01:00
# The OS should care on preparing the drivers into this location
"--enable-usbdropdir=/var/lib/pcsc/drivers"
2015-08-06 03:25:37 +01:00
"--enable-confdir=/etc"
2021-01-15 09:19:50 +00:00
] ++ lib.optional stdenv.isLinux
2018-01-04 23:39:44 +00:00
"--with-systemdsystemunitdir=\${out}/etc/systemd/system"
2021-01-15 09:19:50 +00:00
++ lib.optional (!stdenv.isLinux)
2018-01-04 23:39:44 +00:00
"--disable-libsystemd";
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"
'';
2021-01-17 03:51:22 +00:00
nativeBuildInputs = [ pkg-config perl ];
2021-01-15 09:19:50 +00:00
buildInputs = [ python3 ] ++ lib.optionals stdenv.isLinux [ udev dbus ]
++ lib.optionals stdenv.isDarwin [ IOKit ];
meta = with lib; {
description = "Middleware to access a smart card using SCard API (PC/SC)";
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;
};
}