libusb1: use lib.getLib to find systemd.lib

This allows this package to build with eudev instead.
This commit is contained in:
Yorick van Pelt 2019-10-31 17:27:03 +07:00 committed by Alexander Bantyev
parent a1cc0f1d5f
commit b3862e2bcf
No known key found for this signature in database
GPG Key ID: E081FF12ADCB4AD5

View File

@ -28,13 +28,8 @@ stdenv.mkDerivation (rec {
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
configureFlags =
# We use `isLinux` here only to avoid mass rebuilds for Darwin, where
# disabling udev happens automatically. Remove `isLinux` at next big change!
stdenv.lib.optional (stdenv.isLinux && !enableSystemd) "--disable-udev";
preFixup = stdenv.lib.optionalString enableSystemd ''
sed 's,-ludev,-L${systemd.lib}/lib -ludev,' -i $out/lib/libusb-1.0.la
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
sed 's,-ludev,-L${stdenv.lib.getLib systemd}/lib -ludev,' -i $out/lib/libusb-1.0.la
'';
meta = with stdenv.lib; {