2020-09-08 10:57:58 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2023-01-30 04:06:49 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
2020-09-08 10:57:58 +00:00
|
|
|
, makeWrapper
|
|
|
|
, pkg-config
|
|
|
|
, systemd
|
|
|
|
, dbus
|
|
|
|
, pcsclite
|
|
|
|
, wget
|
|
|
|
, coreutils
|
|
|
|
, perlPackages
|
2015-11-13 12:24:03 +00:00
|
|
|
}:
|
2015-03-09 10:50:44 +00:00
|
|
|
|
2020-09-08 10:57:58 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pcsc-tools";
|
2023-01-30 04:06:49 +00:00
|
|
|
version = "1.6.2";
|
2015-03-09 10:50:44 +00:00
|
|
|
|
2023-01-30 04:06:49 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "LudovicRousseau";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-c7md8m1llvz0EQqA0qY4aGb3guGFoj+8uS4hUTzie5o=";
|
2015-03-09 10:50:44 +00:00
|
|
|
};
|
|
|
|
|
2020-09-08 10:57:58 +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;
|
2015-03-09 10:50:44 +00:00
|
|
|
|
2023-01-30 04:06:49 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook makeWrapper pkg-config ];
|
2015-11-13 12:24:03 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/scriptor \
|
2018-12-15 03:50:31 +00:00
|
|
|
--set PERL5LIB "${with perlPackages; makePerlPath [ pcscperl ]}"
|
2015-11-13 12:24:03 +00:00
|
|
|
wrapProgram $out/bin/gscriptor \
|
2020-07-10 12:08:14 +00:00
|
|
|
--set PERL5LIB "${with perlPackages; makePerlPath [ pcscperl GlibObjectIntrospection Glib Gtk3 Pango Cairo CairoGObject ]}"
|
2015-11-13 12:24:03 +00:00
|
|
|
wrapProgram $out/bin/ATR_analysis \
|
2018-12-15 03:50:31 +00:00
|
|
|
--set PERL5LIB "${with perlPackages; makePerlPath [ pcscperl ]}"
|
2015-11-13 12:24:03 +00:00
|
|
|
wrapProgram $out/bin/pcsc_scan \
|
2020-09-08 10:57:58 +00:00
|
|
|
--prefix PATH : "$out/bin:${lib.makeBinPath [ coreutils wget ]}"
|
|
|
|
|
|
|
|
install -Dm444 -t $out/share/pcsc smartcard_list.txt
|
2015-11-13 12:24:03 +00:00
|
|
|
'';
|
2015-03-09 10:50:44 +00:00
|
|
|
|
2015-11-13 12:24:03 +00:00
|
|
|
meta = with lib; {
|
2015-03-09 10:50:44 +00:00
|
|
|
description = "Tools used to test a PC/SC driver, card or reader";
|
2023-01-30 04:06:49 +00:00
|
|
|
homepage = "https://pcsc-tools.apdu.fr/";
|
2015-03-09 15:01:10 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-09-08 10:57:58 +00:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
2015-11-17 20:29:29 +00:00
|
|
|
platforms = platforms.linux;
|
2015-03-09 10:50:44 +00:00
|
|
|
};
|
|
|
|
}
|