systemd: Separate lib output

This moves libsystemd.so and libudev.so into systemd.lib, and gets rid
of libudev (which just contained a copy of libudev.so and the udev
headers). It thus reduces the closure size of all packages that
(indirectly) depend on libsystemd, of which there are quite a few (for
instance, PulseAudio and dbus). For example, it reduces the closure of
Blender from 430.8 to 400.8 MiB.
This commit is contained in:
Eelco Dolstra
2016-09-05 19:17:14 +02:00
parent 5d8c547460
commit 78178d5854
31 changed files with 80 additions and 123 deletions
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, libudev ? null, libobjc, IOKit }:
{ stdenv, fetchurl, pkgconfig, systemd ? null, libobjc, IOKit }:
stdenv.mkDerivation rec {
name = "libusb-1.0.19";
@@ -12,13 +12,13 @@ stdenv.mkDerivation rec {
buildInputs = [ pkgconfig ];
propagatedBuildInputs =
stdenv.lib.optional stdenv.isLinux libudev ++
stdenv.lib.optional stdenv.isLinux systemd ++
stdenv.lib.optionals stdenv.isDarwin [ libobjc IOKit ];
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
sed 's,-ludev,-L${libudev.out}/lib -ludev,' -i $out/lib/libusb-1.0.la
sed 's,-ludev,-L${systemd.lib}/lib -ludev,' -i $out/lib/libusb-1.0.la
'';
meta = {