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.
This commit is contained in:
Adam Joseph
2024-04-19 11:51:02 +03:00
committed by Florian Klink
parent a87a075306
commit 2c387ccce1
+6 -1
View File
@@ -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 = {