Unverified Commit 779054ff authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

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

parents b569c6cb 744bb913
Loading
Loading
Loading
Loading
+21 −17
Original line number Diff line number Diff line
{
  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,20 +67,22 @@ 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 = ''
  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/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; {