From 96d6f0a2ddb07916cd1a3230fbe6a21e4dc6b29e Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 29 May 2024 18:32:39 +0000 Subject: [PATCH] pcsclite: 2.1.0 -> 2.2.3 --- pkgs/tools/security/pcsclite/default.nix | 65 ++++++++++++++---------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/pkgs/tools/security/pcsclite/default.nix b/pkgs/tools/security/pcsclite/default.nix index e75be683a6f3..eedec6b239fd 100644 --- a/pkgs/tools/security/pcsclite/default.nix +++ b/pkgs/tools/security/pcsclite/default.nix @@ -1,8 +1,9 @@ { stdenv , lib , fetchFromGitLab -, autoreconfHook -, autoconf-archive +, fetchpatch +, meson +, ninja , flex , pkg-config , perl @@ -15,6 +16,7 @@ , systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemdLibs , udevSupport ? dbusSupport , libusb1 +, Foundation , IOKit , testers , nix-update-script @@ -27,7 +29,7 @@ assert systemdSupport -> dbusSupport; stdenv.mkDerivation (finalAttrs: { inherit pname; - version = "2.1.0"; + version = "2.2.3"; outputs = [ "out" "lib" "dev" "doc" "man" ]; @@ -36,35 +38,46 @@ stdenv.mkDerivation (finalAttrs: { owner = "rousseau"; repo = "PCSC"; rev = "refs/tags/${finalAttrs.version}"; - hash = "sha256-aJKI6pWrZJFmiTxZ9wgCuxKRWRMFVRAkzlo+tSqV8B4="; + hash = "sha256-hKyxXqZaqg8KGFoBWhRHV1/50uoxqiG0RsYtgw2BuQ4="; }; - configureFlags = [ - "--enable-confdir=/etc" - # The OS should care on preparing the drivers into this location - "--enable-usbdropdir=/var/lib/pcsc/drivers" - (lib.enableFeature systemdSupport "libsystemd") - (lib.enableFeature polkitSupport "polkit") - "--enable-ipcdir=/run/pcscd" - ] ++ lib.optionals systemdSupport [ - "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - ] ++ lib.optionals (!udevSupport) [ - "--disable-libudev" + # fix build with macOS 11 SDK + patches = [ + (fetchpatch { + url = "https://salsa.debian.org/rousseau/PCSC/-/commit/f41fdaaf7c82bc270af6d7439c6da037bf149be8.patch"; + revert = true; + hash = "sha256-8A76JfYqcILi52X9l/uIpJXeRJDf2dkrNEToOsxGZXk="; + }) ]; - makeFlags = [ - "POLICY_DIR=$(out)/share/polkit-1/actions" + mesonFlags = [ + (lib.mesonOption "sysconfdir" "/etc") + # The OS should care on preparing the drivers into this location + (lib.mesonOption "usbdropdir" "/var/lib/pcsc/drivers") + (lib.mesonBool "libsystemd" systemdSupport) + (lib.mesonBool "polkit" polkitSupport) + (lib.mesonOption "ipcdir" "/run/pcscd") + ] ++ lib.optionals systemdSupport [ + (lib.mesonOption "systemdunit" "system") + ] ++ lib.optionals (!udevSupport) [ + (lib.mesonBool "libudev" false) ]; # disable building pcsc-wirecheck{,-gen} when cross compiling # see also: https://github.com/LudovicRousseau/PCSC/issues/25 - postPatch = lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - substituteInPlace src/Makefile.am \ - --replace-fail "noinst_PROGRAMS = testpcsc pcsc-wirecheck pcsc-wirecheck-gen" \ - "noinst_PROGRAMS = testpcsc" - '' + '' + postPatch = '' substituteInPlace src/libredirect.c src/spy/libpcscspy.c \ --replace-fail "libpcsclite_real.so.1" "$lib/lib/libpcsclite_real.so.1" + '' + lib.optionalString systemdSupport '' + substituteInPlace meson.build \ + --replace-fail \ + "systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemd' + unit + 'unitdir')" \ + "systemdsystemunitdir = '${placeholder "out"}/lib/systemd/system'" + '' + lib.optionalString polkitSupport '' + substituteInPlace meson.build \ + --replace-fail \ + "install_dir : polkit_dep.get_variable('policydir')" \ + "install_dir : '${placeholder "out"}/share/polkit-1/actions'" ''; postInstall = '' @@ -72,11 +85,9 @@ stdenv.mkDerivation (finalAttrs: { moveToOutput bin/pcsc-spy "$dev" ''; - enableParallelBuilding = true; - nativeBuildInputs = [ - autoreconfHook - autoconf-archive + meson + ninja flex pkg-config perl @@ -85,7 +96,7 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ python3 ] ++ lib.optionals systemdSupport [ systemdLibs ] ++ lib.optionals (!systemdSupport && udevSupport) [ udev ] - ++ lib.optionals stdenv.isDarwin [ IOKit ] + ++ lib.optionals stdenv.isDarwin [ Foundation IOKit ] ++ lib.optionals dbusSupport [ dbus ] ++ lib.optionals polkitSupport [ polkit ] ++ lib.optionals (!udevSupport) [ libusb1 ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b644950f1661..ef7761b923e1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11662,7 +11662,7 @@ with pkgs; otpauth = callPackage ../tools/security/otpauth { }; pcsclite = callPackage ../tools/security/pcsclite { - inherit (darwin.apple_sdk.frameworks) IOKit; + inherit (darwin.apple_sdk.frameworks) Foundation IOKit; }; pcscliteWithPolkit = pcsclite.override {