From 2dd01df27a3da4b155469c96d019f5fdda885615 Mon Sep 17 00:00:00 2001 From: Anthony ROUSSEL Date: Fri, 25 Jul 2025 00:10:49 +0200 Subject: [PATCH 1/2] ccid: fix installCheckPhase on darwin --- pkgs/by-name/cc/ccid/package.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/cc/ccid/package.nix b/pkgs/by-name/cc/ccid/package.nix index f46499111ae3..b0a6702a1cd0 100644 --- a/pkgs/by-name/cc/ccid/package.nix +++ b/pkgs/by-name/cc/ccid/package.nix @@ -69,17 +69,21 @@ stdenv.mkDerivation rec { url = "https://salsa.debian.org/rousseau/CCID.git"; }; - installCheckPhase = '' - runHook preInstallCheck + installCheckPhase = + let + platform = if stdenv.hostPlatform.isLinux then "Linux" else "MacOS"; + in + lib.optionalString (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin) '' + runHook preInstallCheck - [ -f $out/etc/reader.conf.d/libccidtwin ] - [ -f $out/lib/udev/rules.d/92_pcscd_ccid.rules ] - [ -f $out/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist ] - [ -f $out/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so ] - [ -f $out/pcsc/drivers/serial/libccidtwin.so ] + [ -f $out/etc/reader.conf.d/libccidtwin ] + [ -f $out/lib/udev/rules.d/92_pcscd_ccid.rules ] + [ -f $out/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist ] + [ -f $out/pcsc/drivers/ifd-ccid.bundle/Contents/${platform}/libccid${stdenv.hostPlatform.extensions.sharedLibrary} ] + [ -f $out/pcsc/drivers/serial/libccidtwin${stdenv.hostPlatform.extensions.sharedLibrary} ] - runHook preInstallCheck - ''; + runHook postInstallCheck + ''; meta = with lib; { description = "PC/SC driver for USB CCID smart card readers"; From 744bb9139aab9e81915eedcd0df47a8c14b63a7c Mon Sep 17 00:00:00 2001 From: Anthony ROUSSEL Date: Sat, 26 Jul 2025 20:59:38 +0200 Subject: [PATCH 2/2] ccid: use fetchFromGitHub --- pkgs/by-name/cc/ccid/package.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/cc/ccid/package.nix b/pkgs/by-name/cc/ccid/package.nix index b0a6702a1cd0..c18ad31b92d2 100644 --- a/pkgs/by-name/cc/ccid/package.nix +++ b/pkgs/by-name/cc/ccid/package.nix @@ -1,12 +1,12 @@ { lib, stdenv, - fetchurl, + fetchFromGitHub, flex, - gitUpdater, libusb1, meson, ninja, + nix-update-script, pcsclite, perl, pkg-config, @@ -17,9 +17,11 @@ stdenv.mkDerivation rec { pname = "ccid"; version = "1.6.2"; - src = fetchurl { - url = "https://ccid.apdu.fr/files/${pname}-${version}.tar.xz"; - hash = "sha256-QZWEEJUBV+Yi+dkcnnjHtwjbdOIvcRkMWB0k0gVk1Ek="; + src = fetchFromGitHub { + owner = "LudovicRousseau"; + repo = "CCID"; + tag = version; + hash = "sha256-n7rOjnLZH4RLmddtBycr3FK2Bi/OLR+9IjWBRbWjnUw="; }; postPatch = '' @@ -65,9 +67,7 @@ stdenv.mkDerivation rec { # usually getting stripped. stripDebugList = [ "pcsc" ]; - passthru.updateScript = gitUpdater { - url = "https://salsa.debian.org/rousseau/CCID.git"; - }; + passthru.updateScript = nix-update-script { }; installCheckPhase = let