2021-04-26 19:14:03 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
|
|
|
, pkg-config
|
|
|
|
, systemd
|
|
|
|
, dbus
|
|
|
|
, pcsclite
|
|
|
|
, wget
|
|
|
|
, coreutils
|
|
|
|
, perlPackages
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pcsc-tools";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "1.5.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-04-26 19:14:03 +00:00
|
|
|
url = "http://ludovic.rousseau.free.fr/softwares/pcsc-tools/${pname}-${version}.tar.bz2";
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "sha256-h8HtvbjJc1Bj9oiqPgXjiTqI54syLcaa+AdX7ZAoIhI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ATR_analysis \
|
|
|
|
--replace /usr/local/pcsc /etc/pcsc \
|
|
|
|
--replace /usr/share/pcsc $out/share/pcsc
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ dbus perlPackages.perl pcsclite ]
|
|
|
|
++ lib.optional stdenv.isLinux systemd;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/scriptor \
|
|
|
|
--set PERL5LIB "${with perlPackages; makePerlPath [ pcscperl ]}"
|
|
|
|
wrapProgram $out/bin/gscriptor \
|
2020-07-18 16:06:22 +00:00
|
|
|
--set PERL5LIB "${with perlPackages; makePerlPath [ pcscperl GlibObjectIntrospection Glib Gtk3 Pango Cairo CairoGObject ]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $out/bin/ATR_analysis \
|
|
|
|
--set PERL5LIB "${with perlPackages; makePerlPath [ pcscperl ]}"
|
|
|
|
wrapProgram $out/bin/pcsc_scan \
|
2021-04-26 19:14:03 +00:00
|
|
|
--prefix PATH : "$out/bin:${lib.makeBinPath [ coreutils wget ]}"
|
|
|
|
|
|
|
|
install -Dm444 -t $out/share/pcsc smartcard_list.txt
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Tools used to test a PC/SC driver, card or reader";
|
|
|
|
homepage = "http://ludovic.rousseau.free.fr/softwares/pcsc-tools/";
|
|
|
|
license = licenses.gpl2Plus;
|
2021-04-26 19:14:03 +00:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|