summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2015-04-24 12:37:40 +0200
committerVladimír Čunát <vcunat@gmail.com>2015-05-05 11:52:07 +0200
commit647f0ab36604fa633169e540ce290a2f92436a92 (patch)
treeecaad7ae47df5621a912bd87b7fd002821fd53b9 /pkgs/os-specific
parentf074e5957d1aa5543cdd38679921bc4e426f875b (diff)
downloadnixlib-647f0ab36604fa633169e540ce290a2f92436a92.tar
nixlib-647f0ab36604fa633169e540ce290a2f92436a92.tar.gz
nixlib-647f0ab36604fa633169e540ce290a2f92436a92.tar.bz2
nixlib-647f0ab36604fa633169e540ce290a2f92436a92.tar.lz
nixlib-647f0ab36604fa633169e540ce290a2f92436a92.tar.xz
nixlib-647f0ab36604fa633169e540ce290a2f92436a92.tar.zst
nixlib-647f0ab36604fa633169e540ce290a2f92436a92.zip
systemd: give up on "dev" output for now
There are too many references to ${systemd}/foo,
and the savings would be on the order of 100 kB.

Also:
 - fix udev install paths (again), hopefully OK now;
 - fix one RPATH
 - clean libudev propagation
 - pick examples/ changes from staging (probably lost by some auto-merge)
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix29
1 files changed, 17 insertions, 12 deletions
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index baa76d969376..d61a242ed4dc 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -18,7 +18,10 @@ stdenv.mkDerivation rec {
     sha256 = "163l1y4p2a564d4ynfq3k3xf53j2v5s81blb6cvpn1y7rpxyccd0";
   };
 
-  outputs = [ "dev" "out" "libudev" "doc" ];
+  outputs = [ "out" "libudev" "doc" ]; # TODO: "dev"
+  # note: there are many references to ${systemd}/...
+  outputDev = "out";
+  propagatedOutputs = "libudev";
 
   patches =
     [ # These are all changes between upstream and
@@ -91,15 +94,15 @@ stdenv.mkDerivation rec {
     '';
 
   makeFlags = [
-    "udevlibexecdir=$(libudev)/lib"
+    "udevlibexecdir=$(libudev)/lib/udev"
     # udev rules refer to $out, and anything but libs should probably go to $out
-    "udevrulesdir=$(out)/lib/rules.d"
-    "udevhwdbdir=$(out)/lib/hwdb.d"
+    "udevrulesdir=$(out)/lib/udev/rules.d"
+    "udevhwdbdir=$(out)/lib/udev/hwdb.d"
   ];
 
   # This is needed because systemd uses the gold linker, which doesn't
   # yet have the wrapper script to add rpath flags automatically.
-  NIX_LDFLAGS = "-rpath ${pam.out}/lib -rpath ${libcap.out}/lib -rpath ${acl.out}/lib -rpath ${stdenv.cc.cc}/lib";
+  NIX_LDFLAGS = "-rpath ${pam.out}/lib -rpath ${libcap.out}/lib -rpath ${acl.out}/lib -rpath ${stdenv.cc.cc.lib}/lib";
 
   PYTHON_BINARY = "${coreutils}/bin/env python"; # don't want a build time dependency on Python
 
@@ -134,6 +137,9 @@ stdenv.mkDerivation rec {
       # sysinit.target).
       mv $out/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup-dev.service $out/lib/systemd/system/multi-user.target.wants/
 
+      mkdir -p $out/example/systemd
+      mv $out/lib/{modules-load.d,binfmt.d,sysctl.d,tmpfiles.d} $out/example
+      mv $out/lib/systemd/{system,user} $out/example/systemd
 
       rm -rf $out/etc/systemd/system
 
@@ -156,9 +162,12 @@ stdenv.mkDerivation rec {
       mkdir -p "$libudev/lib"
       mv "$out"/lib/lib{,g}udev* "$libudev/lib/"
 
-      for i in "$libudev"/lib/*.la "$out"/lib/pkgconfig/*udev*.pc; do
+      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
     ''; # */
 
   # some libs fail to link to liblzma and/or libffi
@@ -169,12 +178,6 @@ stdenv.mkDerivation rec {
       done
     '';
 
-  # propagate the libudev output
-  postPhases = "postPostFixup";
-  postPostFixup = ''
-    echo -n " $libudev" >> "$dev"/nix-support/propagated-*build-inputs
-  '';
-
   # The interface version prevents NixOS from switching to an
   # incompatible systemd at runtime.  (Switching across reboots is
   # fine, of course.)  It should be increased whenever systemd changes
@@ -190,3 +193,5 @@ stdenv.mkDerivation rec {
     maintainers = [ stdenv.lib.maintainers.eelco stdenv.lib.maintainers.simons ];
   };
 }
+
+