summary refs log tree commit diff
path: root/pkgs/tools/security/pcsctools/default.nix
blob: 59db6889a57894b7f1092c1d9ef718a7033da52f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ stdenv, lib, fetchurl, makeWrapper, pkgconfig, udev, dbus_libs, pcsclite
, wget, coreutils
, perl, pcscperl, Glib, Gtk2, Pango
}:

let deps = lib.makeSearchPath "bin" [ wget coreutils ];

in stdenv.mkDerivation rec {
  name = "pcsc-tools-1.4.25";

  src = fetchurl {
    url = "http://ludovic.rousseau.free.fr/softwares/pcsc-tools/${name}.tar.gz";
    sha256 = "0iqcy28pb963ds4pjrpi37577vm6nkgf3i0b3rr978jy9qi1bix9";
  };

  buildInputs = [ udev dbus_libs perl pcsclite ];

  makeFlags = [ "DESTDIR=$(out)" ];

  nativeBuildInputs = [ makeWrapper pkgconfig ];

  postInstall = ''
    wrapProgram $out/bin/scriptor \
      --set PERL5LIB "${lib.makePerlPath [ pcscperl ]}"
    wrapProgram $out/bin/gscriptor \
      --set PERL5LIB "${lib.makePerlPath [ pcscperl Glib Gtk2 Pango ]}"
    wrapProgram $out/bin/ATR_analysis \
      --set PERL5LIB "${lib.makePerlPath [ pcscperl ]}"
    wrapProgram $out/bin/pcsc_scan \
      --set PATH "$out/bin:${deps}"
  '';

  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;
    maintainers = with maintainers; [ viric ];
    platforms = with platforms; linux;
  };
}