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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.8 KiB
Nix
Raw Normal View History

2020-09-08 14:32:01 +02:00
{ stdenv
, lib
, fetchurl
, autoreconfHook
2021-10-18 13:56:45 +02:00
, autoconf-archive
2020-09-08 14:32:01 +02:00
, pkg-config
, perl
, python3
, dbus
, polkit
, systemdMinimal
2020-09-08 14:32:01 +02:00
, IOKit
, pname ? "pcsclite"
, polkitSupport ? false
2020-09-08 14:32:01 +02:00
}:
stdenv.mkDerivation rec {
inherit pname;
version = "1.9.5";
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";
2022-06-03 02:54:04 +02:00
hash = "sha256-nuP5szNTdWIXeJNVmtT3uNXCPr6Cju9TBWwC2xQEnQg=";
};
patches = [ ./no-dropdir-literals.patch ];
2020-09-08 14:32:01 +02:00
postPatch = ''
sed -i configure.ac \
-e "s@polkit_policy_dir=.*@polkit_policy_dir=$bin/share/polkit-1/actions@"
'';
configureFlags = [
2020-09-08 14:32:01 +02:00
"--enable-confdir=/etc"
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"
2022-11-07 02:01:06 +01:00
(lib.enableFeature stdenv.isLinux "libsystemd")
(lib.enableFeature polkitSupport "polkit")
] ++ lib.optionals stdenv.isLinux [
2020-09-08 14:32:01 +02:00
"--enable-ipcdir=/run/pcscd"
"--with-systemdsystemunitdir=${placeholder "bin"}/lib/systemd/system"
];
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"
'';
2020-09-08 14:32:01 +02:00
enableParallelBuilding = true;
2021-10-18 13:56:45 +02:00
nativeBuildInputs = [ autoreconfHook autoconf-archive pkg-config perl ];
buildInputs = [ python3 ]
++ lib.optionals stdenv.isLinux [ systemdMinimal ]
++ lib.optionals stdenv.isDarwin [ IOKit ]
++ lib.optionals polkitSupport [ dbus polkit ];
meta = with lib; {
description = "Middleware to access a smart card using SCard API (PC/SC)";
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;
};
}