6 , gobject-introspection
10 , systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
11 , dbusSupport ? stdenv.hostPlatform.isLinux, dbus
20 # gui does not cross compile properly
21 , withGui ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
24 assert systemdSupport -> dbusSupport;
26 stdenv.mkDerivation (finalAttrs: {
30 src = fetchFromGitHub {
31 owner = "LudovicRousseau";
33 rev = "refs/tags/${finalAttrs.version}";
34 hash = "sha256-5a3sVcFEFzBkbRKUqlCPV7sL3O17G7hDVpxLpAWofdE=";
38 "--datarootdir=${placeholder "out"}/share"
41 buildInputs = lib.optionals dbusSupport [
44 perlPackages.perl pcsclite
45 ] ++ lib.optional stdenv.hostPlatform.isDarwin PCSC
46 ++ lib.optional systemdSupport systemd;
53 ] ++ lib.optionals withGui [
59 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
63 wrapProgram $out/bin/scriptor \
64 --set PERL5LIB "${with perlPackages; makePerlPath [ ChipcardPCSC libintl-perl ]}"
66 '' + lib.optionalString withGui ''
67 wrapProgram $out/bin/gscriptor \
68 ''${makeWrapperArgs[@]} \
69 --set PERL5LIB "${with perlPackages; makePerlPath [
72 GlibObjectIntrospection
81 wrapProgram $out/bin/ATR_analysis \
82 --set PERL5LIB "${with perlPackages; makePerlPath [ ChipcardPCSC libintl-perl ]}"
84 wrapProgram $out/bin/pcsc_scan \
85 --prefix PATH : "$out/bin:${lib.makeBinPath [ coreutils wget ]}"
87 install -Dm444 -t $out/share/pcsc smartcard_list.txt
91 tests.version = testers.testVersion {
92 package = finalAttrs.finalPackage;
93 command = "pcsc_scan -V";
95 updateScript = nix-update-script { };
99 description = "Tools used to test a PC/SC driver, card or reader";
100 homepage = "https://pcsc-tools.apdu.fr/";
101 changelog = "https://github.com/LudovicRousseau/pcsc-tools/releases/tag/${finalAttrs.version}";
102 license = licenses.gpl2Plus;
103 mainProgram = "pcsc_scan";
104 maintainers = with maintainers; [ peterhoeg anthonyroussel ];
105 platforms = platforms.unix;