From 15bd0f4beb1eb6e609bd365893289d3a163a4ef2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 26 Jun 2013 13:34:55 +0200 Subject: [PATCH] systemd: Put libudev in a separate output This way, packages that need libudev (like Mesa) don't pull in all of systemd as a runtime dependency. --- pkgs/os-specific/linux/systemd/default.nix | 18 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 7 +++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index e7184aa27b96..05257aa3e0a9 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { sha256 = "07gvn3rpski8sh1nz16npjf2bvj0spsjdwc5px9685g2pi6kxcb1"; }; + outputs = [ "out" "man" "libudev" ]; + patches = [ ./0001-Make-systemctl-daemon-reexec-do-the-right-thing-on-N.patch ./0002-Ignore-duplicate-paths-in-systemctl-start.patch @@ -65,6 +67,8 @@ stdenv.mkDerivation rec { substituteInPlace src/journal/catalog.c \ --replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/ + + export NIX_CFLAGS_LINK+=" -Wl,-rpath,$libudev/lib" ''; PYTHON_BINARY = "${coreutils}/bin/env python"; # don't want a build time dependency on Python @@ -114,6 +118,20 @@ stdenv.mkDerivation rec { done rm -rf $out/etc/rpm + + # Move libudev to a separate output. + mkdir -p $libudev/lib/pkgconfig $libudev/include + mv $out/lib/libudev* $libudev/lib/ + mv $out/lib/pkgconfig/libudev*.pc $libudev/lib/pkgconfig/ + mv $out/include/libudev.h $libudev/include/ + + for i in $libudev/lib/*.la $libudev/lib/pkgconfig/*.pc; do + substituteInPlace $i --replace $out $libudev + done + + # FIXME: move into stdenv + prefix="$libudev" patchELF + prefix="$libudev" stripDirs "lib" "''${stripDebugFlags:--S}" ''; # */ enableParallelBuilding = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index da5334935202..ad02fbf77ae9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6637,7 +6637,9 @@ let sysstat = callPackage ../os-specific/linux/sysstat { }; - systemd = callPackage ../os-specific/linux/systemd { }; + systemd = callPackage ../os-specific/linux/systemd { + stdenv = stdenvMulti; + }; sysvinit = callPackage ../os-specific/linux/sysvinit { }; @@ -6679,7 +6681,8 @@ let }); udev145 = callPackage ../os-specific/linux/udev/145.nix { }; - udev = pkgs.systemd; + + udev = pkgs.systemd.libudev; udisks1 = callPackage ../os-specific/linux/udisks/1-default.nix { }; udisks2 = callPackage ../os-specific/linux/udisks/2-default.nix { };