From 2c387ccce11e0723b94f99cec4901c3543eb149a Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 15 Apr 2024 13:09:14 -0700 Subject: [PATCH] pcsclite: make udevSupport optional This commit allows the use of pcscd on platforms which use mdevd and libudev-zero instead of systemd-udevd. When udevd is not running, pcscd needs to link against libusb so that it can scan the USB busses itself, rather than relying on udevd to do that. --- pkgs/tools/security/pcsclite/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/security/pcsclite/default.nix b/pkgs/tools/security/pcsclite/default.nix index bc0caffe4ff1..f0e61ac6f9c3 100644 --- a/pkgs/tools/security/pcsclite/default.nix +++ b/pkgs/tools/security/pcsclite/default.nix @@ -12,6 +12,8 @@ , systemdLibs , dbusSupport ? stdenv.isLinux , systemdSupport ? stdenv.isLinux +, udevSupport ? dbusSupport +, libusb1 , IOKit , testers , nix-update-script @@ -45,6 +47,8 @@ stdenv.mkDerivation (finalAttrs: { "--enable-ipcdir=/run/pcscd" ] ++ lib.optionals systemdSupport [ "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + ] ++ lib.optionals (!udevSupport) [ + "--disable-libudev" ]; makeFlags = [ @@ -78,7 +82,8 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals systemdSupport [ systemdLibs ] ++ lib.optionals stdenv.isDarwin [ IOKit ] ++ lib.optionals dbusSupport [ dbus ] - ++ lib.optionals polkitSupport [ polkit ]; + ++ lib.optionals polkitSupport [ polkit ] + ++ lib.optionals (!udevSupport) [ libusb1 ]; passthru = { tests = {