about summary refs log tree commit diff
path: root/pkgs/tools/security/ccid
diff options
context:
space:
mode:
authorAnthony Roussel <anthony@roussel.dev>2023-12-06 20:20:18 +0100
committerAnthony Roussel <anthony@roussel.dev>2023-12-07 21:24:12 +0100
commit6899899596af18ba8a3bbdf71c065418a8624dee (patch)
tree24d1218374c56be25dd29ca18b0d534af7dc5881 /pkgs/tools/security/ccid
parent1490bec7461558f3fa40ddc289a6b9aeb825ba59 (diff)
ccid: 1.5.2 -> 1.5.4
https://salsa.debian.org/rousseau/CCID/-/compare/1.5.2...1.5.4
Diffstat (limited to 'pkgs/tools/security/ccid')
-rw-r--r--pkgs/tools/security/ccid/default.nix40
1 files changed, 33 insertions, 7 deletions
diff --git a/pkgs/tools/security/ccid/default.nix b/pkgs/tools/security/ccid/default.nix
index e3adf5190e72f..c13ec56c4b6a3 100644
--- a/pkgs/tools/security/ccid/default.nix
+++ b/pkgs/tools/security/ccid/default.nix
@@ -1,20 +1,22 @@
 { lib
 , stdenv
 , fetchurl
+, flex
 , pcsclite
 , pkg-config
 , libusb1
 , perl
+, zlib
 , gitUpdater
 }:
 
 stdenv.mkDerivation rec {
   pname = "ccid";
-  version = "1.5.2";
+  version = "1.5.4";
 
   src = fetchurl {
     url = "https://ccid.apdu.fr/files/${pname}-${version}.tar.bz2";
-    sha256 = "sha256-E5NEh+b4tI9pmhbTZ8x6GvejyodN5yGsbpYzvrhuchk=";
+    hash = "sha256-boMq3Bcuzc/e4rVvMxRGhIgsvpctr/GTjnqcc6ZPiL8=";
   };
 
   postPatch = ''
@@ -22,12 +24,36 @@ stdenv.mkDerivation rec {
     substituteInPlace src/Makefile.in --replace /bin/echo echo
   '';
 
-  preConfigure = ''
-    configureFlagsArray+=("--enable-usbdropdir=$out/pcsc/drivers")
-  '';
+  configureFlags = [
+    "--enable-twinserial"
+    "--enable-serialconfdir=${placeholder "out"}/etc/reader.conf.d"
+    "--enable-ccidtwindir=${placeholder "out"}/pcsc/drivers/serial"
+    "--enable-usbdropdir=${placeholder "out"}/pcsc/drivers"
+  ];
+
+  # error: call to undeclared function 'InterruptRead';
+  # ISO C99 and later do not support implicit function declarations
+  env = lib.optionalAttrs stdenv.cc.isClang {
+    NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
+  };
 
-  nativeBuildInputs = [ pkg-config perl ];
-  buildInputs = [ pcsclite libusb1 ];
+  nativeBuildInputs = [
+    flex
+    pkg-config
+    perl
+  ];
+
+  buildInputs = [
+    pcsclite
+    libusb1
+    zlib
+  ];
+
+  postInstall = ''
+    install -Dm 0444 -t $out/lib/udev/rules.d src/92_pcscd_ccid.rules
+    substituteInPlace $out/lib/udev/rules.d/92_pcscd_ccid.rules \
+      --replace "/usr/sbin/pcscd" "${pcsclite}/bin/pcscd"
+  '';
 
   # The resulting shared object ends up outside of the default paths which are
   # usually getting stripped.