1{ lib
2, stdenv
3, fetchFromGitHub
4, autoconf
5, automake
6, libtool
7, gettext
8, flex
9, perl
10, pkg-config
11, pcsclite
12, libusb1
13, libiconv
14}:
15
16stdenv.mkDerivation rec {
17 version = "1.1.8";
18 pname = "acsccid";
19
20 src = fetchFromGitHub {
21 owner = "acshk";
22 repo = pname;
23 rev = "v${version}";
24 sha256 = "12aahrvsk21qgpjwcrr01s742ixs44nmjkvcvqyzhqb307x1rrn3";
25 };
26
27 nativeBuildInputs = [
28 pkg-config
29 autoconf
30 automake
31 libtool
32 gettext
33 flex
34 perl
35 ];
36
37 buildInputs = [
38 pcsclite
39 libusb1
40 ] ++ lib.optionals stdenv.isDarwin [
41 libiconv
42 ];
43
44 configureFlags = [
45 "--enable-usbdropdir=${placeholder "out"}/pcsc/drivers"
46 ];
47
48 doCheck = true;
49
50 postPatch = ''
51 sed -e s_/bin/echo_echo_g -i src/Makefile.am
52 patchShebangs src/convert_version.pl
53 patchShebangs src/create_Info_plist.pl
54 '';
55
56 preConfigure = ''
57 libtoolize --force
58 aclocal
59 autoheader
60 automake --force-missing --add-missing
61 autoconf
62 '';
63
64 meta = with lib; {
65 description = "A PC/SC driver for Linux/Mac OS X and it supports ACS CCID smart card readers";
66 longDescription = ''
67 acsccid is a PC/SC driver for Linux/Mac OS X and it supports ACS CCID smart card
68 readers. This library provides a PC/SC IFD handler implementation and
69 communicates with the readers through the PC/SC Lite resource manager (pcscd).
70
71 acsccid is based on ccid. See CCID free software driver for more
72 information:
73 https://ccid.apdu.fr/
74
75 It can be enabled in /etc/nixos/configuration.nix by adding:
76 services.pcscd.enable = true;
77 services.pcscd.plugins = [ pkgs.acsccid ];
78 '';
79 homepage = src.meta.homepage;
80 license = licenses.lgpl2Plus;
81 maintainers = with maintainers; [ ];
82 platforms = with platforms; unix;
83 };
84}