about summary refs log tree commit diff
path: root/pkgs/tools/security/pcsc-cyberjack/default.nix
blob: fa96753a54f64ca13d99558609c31feca8da3fe9 (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
41
42
43
44
{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, libusb1, pcsclite }:

let
  version = "3.99.5";
  suffix = "SP15";
  tarBall = "${version}final.${suffix}";

in
stdenv.mkDerivation rec {
  pname = "pcsc-cyberjack";
  inherit version;

  src = fetchurl {
    url =
      "https://support.reiner-sct.de/downloads/LINUX/V${version}_${suffix}/${pname}_${tarBall}.tar.bz2";
    sha256 = "sha256-rLfCgyRQcYdWcTdnxLPvUAgy1lLtUbNRELkQsR69Rno=";
  };

  outputs = [ "out" "tools" ];

  nativeBuildInputs = [ autoreconfHook pkg-config ];

  buildInputs = [ libusb1 pcsclite ];

  enableParallelBuilding = true;

  env.NIX_CFLAGS_COMPILE = "-Wno-error=narrowing";

  configureFlags = [
    "--with-usbdropdir=${placeholder "out"}/pcsc/drivers"
    "--bindir=${placeholder "tools"}/bin"
  ];

  postInstall = "make -C tools/cjflash install";

  meta = with lib; {
    description = "REINER SCT cyberJack USB chipcard reader user space driver";
    mainProgram = "cjflash";
    homepage = "https://www.reiner-sct.com/";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ aszlig flokli ];
    platforms = platforms.linux;
  };
}