about summary refs log tree commit diff
path: root/pkgs/tools/filesystems/nixpart
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-05 18:59:00 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-05 19:17:14 +0200
commit78178d5854901e1b17a14bce3fe43515984b7b91 (patch)
tree350b6cb98c5a86ce3a15c18032afd6acdf28ccd7 /pkgs/tools/filesystems/nixpart
parent5d8c54746066eb454bee5c10ba93b3a9e078bf45 (diff)
downloadnixlib-78178d5854901e1b17a14bce3fe43515984b7b91.tar
nixlib-78178d5854901e1b17a14bce3fe43515984b7b91.tar.gz
nixlib-78178d5854901e1b17a14bce3fe43515984b7b91.tar.bz2
nixlib-78178d5854901e1b17a14bce3fe43515984b7b91.tar.lz
nixlib-78178d5854901e1b17a14bce3fe43515984b7b91.tar.xz
nixlib-78178d5854901e1b17a14bce3fe43515984b7b91.tar.zst
nixlib-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/tools/filesystems/nixpart')
-rw-r--r--pkgs/tools/filesystems/nixpart/0.4/blivet.nix10
-rw-r--r--pkgs/tools/filesystems/nixpart/0.4/default.nix4
-rw-r--r--pkgs/tools/filesystems/nixpart/0.4/lvm2.nix6
-rw-r--r--pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix10
4 files changed, 17 insertions, 13 deletions
diff --git a/pkgs/tools/filesystems/nixpart/0.4/blivet.nix b/pkgs/tools/filesystems/nixpart/0.4/blivet.nix
index 7a8501b7a891..edb2978001b2 100644
--- a/pkgs/tools/filesystems/nixpart/0.4/blivet.nix
+++ b/pkgs/tools/filesystems/nixpart/0.4/blivet.nix
@@ -1,9 +1,11 @@
+# FIXME: Unify with pkgs/development/python-modules/blivet/default.nix.
+
 { stdenv, fetchurl, buildPythonApplication, pykickstart, pyparted, pyblock
 , libselinux, cryptsetup, multipath_tools, lsof, utillinux
-, useNixUdev ? true, libudev ? null
+, useNixUdev ? true, systemd ? null
 }:
 
-assert useNixUdev -> libudev != null;
+assert useNixUdev -> systemd != null;
 
 buildPythonApplication rec {
   name = "blivet-${version}";
@@ -29,13 +31,13 @@ buildPythonApplication rec {
     sed -i '/pvscan/s/, *"--cache"//' blivet/devicelibs/lvm.py
   '' + stdenv.lib.optionalString useNixUdev ''
     sed -i -e '/find_library/,/find_library/ {
-      c libudev = "${libudev.out}/lib/libudev.so.1"
+      c libudev = "${systemd.lib}/lib/libudev.so.1"
     }' blivet/pyudev.py
   '';
 
   propagatedBuildInputs = [
     pykickstart pyparted pyblock libselinux cryptsetup
-  ] ++ stdenv.lib.optional useNixUdev libudev;
+  ] ++ stdenv.lib.optional useNixUdev systemd;
 
   # tests are currently _heavily_ broken upstream
   doCheck = false;
diff --git a/pkgs/tools/filesystems/nixpart/0.4/default.nix b/pkgs/tools/filesystems/nixpart/0.4/default.nix
index bdf0a5c4323d..5ae32093e7f7 100644
--- a/pkgs/tools/filesystems/nixpart/0.4/default.nix
+++ b/pkgs/tools/filesystems/nixpart/0.4/default.nix
@@ -12,7 +12,7 @@ let
     inherit stdenv fetchurl buildPythonApplication;
     inherit pykickstart pyparted pyblock cryptsetup multipath_tools;
     inherit useNixUdev;
-    inherit (pkgs) lsof utillinux libudev;
+    inherit (pkgs) lsof utillinux systemd;
     libselinux = pkgs.libselinux.override { enablePython = true; };
   };
 
@@ -29,7 +29,7 @@ let
 
   lvm2 = import ./lvm2.nix {
     inherit stdenv fetchurl;
-    inherit (pkgs) pkgconfig utillinux libudev systemd coreutils;
+    inherit (pkgs) pkgconfig utillinux systemd coreutils;
   };
 
   multipath_tools = import ./multipath-tools.nix {
diff --git a/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix b/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix
index b92c40ba99e6..6301cbb6842a 100644
--- a/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix
+++ b/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libudev, systemd, utillinux, coreutils }:
+{ stdenv, fetchurl, pkgconfig, systemd, utillinux, coreutils }:
 
 let
   v = "2.02.106";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   configureFlags =
     "--disable-readline --enable-udev_rules --enable-udev_sync --enable-pkgconfig --enable-applib";
 
-  buildInputs = [ pkgconfig libudev ];
+  buildInputs = [ pkgconfig systemd ];
 
   preConfigure =
     ''
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
         --replace /usr/bin/tr ${coreutils}/bin/tr
       substituteInPlace scripts/lvm2_activation_generator_systemd_red_hat.c \
         --replace /usr/sbin/lvm $out/sbin/lvm \
-        --replace /usr/bin/udevadm ${systemd.udev.bin}/bin/udevadm
+        --replace /usr/bin/udevadm ${systemd}/bin/udevadm
 
       sed -i /DEFAULT_SYS_DIR/d Makefile.in
       sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in
diff --git a/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix b/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix
index 48fa0069d6f0..f30bd958cf3a 100644
--- a/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix
+++ b/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix
@@ -1,3 +1,5 @@
+# FIXME: unify with pkgs/os-specific/linux/multipath-tools/default.nix.
+
 { stdenv, fetchurl, lvm2, libaio, gzip, readline, systemd }:
 
 stdenv.mkDerivation rec {
@@ -15,15 +17,15 @@ stdenv.mkDerivation rec {
   preBuild =
     ''
       makeFlagsArray=(GZIP="-9" prefix=$out mandir=$out/share/man/man8 man5dir=$out/share/man/man5 LIB=lib)
-      
+
       substituteInPlace multipath/Makefile --replace /etc $out/etc
       substituteInPlace kpartx/Makefile --replace /etc $out/etc
-      
+
       substituteInPlace kpartx/kpartx.rules --replace /sbin/kpartx $out/sbin/kpartx
       substituteInPlace kpartx/kpartx_id --replace /sbin/dmsetup ${lvm2}/sbin/dmsetup
 
-      substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${systemd.udev.lib}/lib/udev/scsi_id
-      substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${systemd.udev.lib}/lib/udev/scsi_id
+      substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${systemd.lib}/lib/udev/scsi_id
+      substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${systemd.lib}/lib/udev/scsi_id
     '';
 
   meta = {