From 3cf54f81d3d70ef69ef123c7f25d1e92edfe1f41 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Wed, 6 Dec 2023 20:18:53 +0100 Subject: [PATCH 1/4] ccid: add passthru.updateScript --- pkgs/tools/security/ccid/default.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/security/ccid/default.nix b/pkgs/tools/security/ccid/default.nix index 5006007035ee..d97e6b378abf 100644 --- a/pkgs/tools/security/ccid/default.nix +++ b/pkgs/tools/security/ccid/default.nix @@ -1,4 +1,12 @@ -{ lib, stdenv, fetchurl, pcsclite, pkg-config, libusb1, perl }: +{ lib +, stdenv +, fetchurl +, pcsclite +, pkg-config +, libusb1 +, perl +, gitUpdater +}: stdenv.mkDerivation rec { pname = "ccid"; @@ -25,6 +33,10 @@ stdenv.mkDerivation rec { # usually getting stripped. stripDebugList = ["pcsc"]; + passthru.updateScript = gitUpdater { + url = "https://salsa.debian.org/rousseau/CCID.git"; + }; + meta = with lib; { description = "ccid drivers for pcsclite"; homepage = "https://ccid.apdu.fr/"; From 1270c8e9033ae44dc7e118eac92cc398577f4d6e Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Thu, 7 Dec 2023 13:48:48 +0100 Subject: [PATCH 2/4] ccid: update meta.{description,license} --- pkgs/tools/security/ccid/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/ccid/default.nix b/pkgs/tools/security/ccid/default.nix index d97e6b378abf..04d45725a5e7 100644 --- a/pkgs/tools/security/ccid/default.nix +++ b/pkgs/tools/security/ccid/default.nix @@ -38,9 +38,9 @@ stdenv.mkDerivation rec { }; meta = with lib; { - description = "ccid drivers for pcsclite"; + description = "PC/SC driver for USB CCID smart card readers"; homepage = "https://ccid.apdu.fr/"; - license = licenses.gpl2Plus; + license = licenses.lgpl21Plus; platforms = platforms.unix; }; } From 1490bec7461558f3fa40ddc289a6b9aeb825ba59 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Thu, 7 Dec 2023 14:22:29 +0100 Subject: [PATCH 3/4] ccid: add anthonyroussel to maintainers --- pkgs/tools/security/ccid/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tools/security/ccid/default.nix b/pkgs/tools/security/ccid/default.nix index 04d45725a5e7..e3adf5190e72 100644 --- a/pkgs/tools/security/ccid/default.nix +++ b/pkgs/tools/security/ccid/default.nix @@ -41,6 +41,7 @@ stdenv.mkDerivation rec { description = "PC/SC driver for USB CCID smart card readers"; homepage = "https://ccid.apdu.fr/"; license = licenses.lgpl21Plus; + maintainers = [ maintainers.anthonyroussel ]; platforms = platforms.unix; }; } From 6899899596af18ba8a3bbdf71c065418a8624dee Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Wed, 6 Dec 2023 20:20:18 +0100 Subject: [PATCH 4/4] ccid: 1.5.2 -> 1.5.4 https://salsa.debian.org/rousseau/CCID/-/compare/1.5.2...1.5.4 --- pkgs/tools/security/ccid/default.nix | 40 +++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/security/ccid/default.nix b/pkgs/tools/security/ccid/default.nix index e3adf5190e72..c13ec56c4b6a 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" + ]; - nativeBuildInputs = [ pkg-config perl ]; - buildInputs = [ pcsclite libusb1 ]; + # 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 = [ + 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.