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,6 +1,6 @@
{ stdenv, fetchurl, buildEnv, zlib, glib, alsaLib, makeDesktopItem
, dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf
, cairo, cups, expat, libgpgerror, nspr, gnome3, nss, xorg, libudev, libnotify
, cairo, cups, expat, libgpgerror, nspr, gnome3, nss, xorg, systemd, libnotify
}:
let
@@ -45,9 +45,9 @@ stdenv.mkDerivation rec {
mv $out/share/LightTable/light $out/bin/light
ln -sf ${libudev.out}/lib/libudev.so.1 $out/share/LightTable/libudev.so.0
ln -sf ${systemd.lib}/lib/libudev.so.1 $out/share/LightTable/libudev.so.0
substituteInPlace $out/bin/light \
--replace "/usr/lib/x86_64-linux-gnu" "${libudev.out}/lib" \
--replace "/usr/lib/x86_64-linux-gnu" "${systemd.lib}/lib" \
--replace "/lib/x86_64-linux-gnu" "$out/share/LightTable" \
--replace 'HERE=`dirname $(readlink -f $0)`' "HERE=$out/share/LightTable"