ccid: fix installCheckPhase on darwin, use fetchFromGitHub (#428170)

Aleksana 779054ff b569c6cb

Changed files
+21 -17
pkgs
by-name
cc
+21 -17
pkgs/by-name/cc/ccid/package.nix
···
{
lib,
stdenv,
-
fetchurl,
+
fetchFromGitHub,
flex,
-
gitUpdater,
libusb1,
meson,
ninja,
+
nix-update-script,
pcsclite,
perl,
pkg-config,
···
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 = ''
···
# usually getting stripped.
stripDebugList = [ "pcsc" ];
-
passthru.updateScript = gitUpdater {
-
url = "https://salsa.debian.org/rousseau/CCID.git";
-
};
+
passthru.updateScript = nix-update-script { };
-
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";