diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-09-05 18:59:00 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-09-05 19:17:14 +0200 |
commit | 78178d5854901e1b17a14bce3fe43515984b7b91 (patch) | |
tree | 350b6cb98c5a86ce3a15c18032afd6acdf28ccd7 /pkgs/os-specific/linux | |
parent | 5d8c54746066eb454bee5c10ba93b3a9e078bf45 (diff) | |
download | nixpkgs-78178d5854901e1b17a14bce3fe43515984b7b91.tar nixpkgs-78178d5854901e1b17a14bce3fe43515984b7b91.tar.gz nixpkgs-78178d5854901e1b17a14bce3fe43515984b7b91.tar.bz2 nixpkgs-78178d5854901e1b17a14bce3fe43515984b7b91.tar.lz nixpkgs-78178d5854901e1b17a14bce3fe43515984b7b91.tar.xz nixpkgs-78178d5854901e1b17a14bce3fe43515984b7b91.tar.zst nixpkgs-78178d5854901e1b17a14bce3fe43515984b7b91.zip |
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.
Diffstat (limited to 'pkgs/os-specific/linux')
-rw-r--r-- | pkgs/os-specific/linux/multipath-tools/default.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/systemd/default.nix | 38 | ||||
-rw-r--r-- | pkgs/os-specific/linux/systemd/libudev.nix | 22 | ||||
-rw-r--r-- | pkgs/os-specific/linux/util-linux/default.nix | 3 |
4 files changed, 10 insertions, 57 deletions
diff --git a/pkgs/os-specific/linux/multipath-tools/default.nix b/pkgs/os-specific/linux/multipath-tools/default.nix index 409eb31e14f..d09c192abfc 100644 --- a/pkgs/os-specific/linux/multipath-tools/default.nix +++ b/pkgs/os-specific/linux/multipath-tools/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, lvm2, libaio, gzip, readline, udev }: +{ stdenv, fetchurl, lvm2, libaio, gzip, readline, systemd }: stdenv.mkDerivation rec { name = "multipath-tools-0.5.0"; @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ gzip ]; - buildInputs = [ udev lvm2 libaio readline ]; + buildInputs = [ systemd lvm2 libaio readline ]; makeFlags = [ "LIB=lib" diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index d02f7291df5..7fdebc5c1e8 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -28,13 +28,7 @@ stdenv.mkDerivation rec { }) ]; - /* gave up for now! - outputs = [ "out" "libudev" "doc" ]; # maybe: "dev" - # note: there are many references to ${systemd}/... - outputDev = "out"; - propagatedBuildOutputs = "libudev"; - */ - outputs = [ "out" "man" ]; + outputs = [ "out" "lib" "man" "dev" ]; buildInputs = [ linuxHeaders pkgconfig intltool gperf libcap kmod xz pam acl @@ -119,16 +113,6 @@ stdenv.mkDerivation rec { #export NIX_CFLAGS_LINK+=" -Wl,-rpath,$libudev/lib" ''; - /* - makeFlags = [ - "udevlibexecdir=$(libudev)/lib/udev" - # udev rules refer to $out, and anything but libs should probably go to $out - "udevrulesdir=$(out)/lib/udev/rules.d" - "udevhwdbdir=$(out)/lib/udev/hwdb.d" - ]; - */ - - PYTHON_BINARY = "${coreutils}/bin/env python"; # don't want a build time dependency on Python NIX_CFLAGS_COMPILE = @@ -180,26 +164,18 @@ stdenv.mkDerivation rec { rm -rf $out/etc/rpm - rm $out/lib/*.la + rm $lib/lib/*.la # "kernel-install" shouldn't be used on NixOS. find $out -name "*kernel-install*" -exec rm {} \; - ''; # */ - /* - # Move lib(g)udev to a separate output. TODO: maybe split them up - # to avoid libudev pulling glib - mkdir -p "$libudev/lib" - mv "$out"/lib/lib{,g}udev* "$libudev/lib/" - for i in "$libudev"/lib/*.la; do - substituteInPlace $i --replace "$out" "$libudev" - done - for i in "$out"/lib/pkgconfig/{libudev,gudev-1.0}.pc; do - substituteInPlace $i --replace "libdir=$out" "libdir=$libudev" - done - */ + # Keep only libudev and libsystemd in the lib output. + mkdir -p $out/lib + mv $lib/lib/security $lib/lib/libnss* $out/lib/ + ''; # */ enableParallelBuilding = true; + /* # some libs fail to link to liblzma and/or libffi postFixup = let extraLibs = stdenv.lib.makeLibraryPath [ xz.out libffi.out zlib.out ]; diff --git a/pkgs/os-specific/linux/systemd/libudev.nix b/pkgs/os-specific/linux/systemd/libudev.nix deleted file mode 100644 index 401e1ba6805..00000000000 --- a/pkgs/os-specific/linux/systemd/libudev.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ stdenv, systemd }: - -stdenv.mkDerivation { - name = "libudev-${systemd.version}"; - - unpackPhase = ":"; - outputs = [ "out" "dev" ]; - installPhase = '' - mkdir -p "$out/lib" "$dev/lib/pkgconfig" "$dev/include" - cp -P "${systemd}"/lib/libudev.* "$out/lib/" - cp -P "${systemd}"/lib/pkgconfig/libudev.pc "$dev/lib/pkgconfig/" - cp -P "${systemd}"/include/libudev.h "$dev/include/" - - substituteInPlace "$dev"/lib/pkgconfig/*.pc \ - --replace "${systemd}" "$out" - sed "/^includedir=/cincludedir=$dev/include" -i "$dev"/lib/pkgconfig/*.pc - ''; - - meta = { - platforms = stdenv.lib.platforms.linux; - }; -} diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix index 003dd792966..0cc7a8a4548 100644 --- a/pkgs/os-specific/linux/util-linux/default.nix +++ b/pkgs/os-specific/linux/util-linux/default.nix @@ -20,7 +20,6 @@ stdenv.mkDerivation rec { # due to lots of ${utillinux}/bin occurences and headers being rather small outputDev = "bin"; - #FIXME: make it also work on non-nixos? postPatch = '' # Substituting store paths would create a circular dependency on systemd @@ -57,7 +56,7 @@ stdenv.mkDerivation rec { buildInputs = [ zlib pam ] ++ lib.optional (ncurses != null) ncurses - ++ lib.optional (systemd != null) [ systemd pkgconfig ] + ++ lib.optional (systemd != null) systemd ++ lib.optional (perl != null) perl; postInstall = '' |