summary refs log tree commit diff
path: root/pkgs/os-specific/linux/lvm2
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-07-12 11:29:38 +0200
committerFlorian Klink <flokli@flokli.de>2020-07-12 23:04:33 +0200
commit9f8390701363a767cb409a2931402a4effb972c7 (patch)
tree06c683c097c078c21bd594987cf11b8a5626d7de /pkgs/os-specific/linux/lvm2
parentb8129312bd6d0849e108c4821eecf9f53f72c2f3 (diff)
downloadnixpkgs-9f8390701363a767cb409a2931402a4effb972c7.tar
nixpkgs-9f8390701363a767cb409a2931402a4effb972c7.tar.gz
nixpkgs-9f8390701363a767cb409a2931402a4effb972c7.tar.bz2
nixpkgs-9f8390701363a767cb409a2931402a4effb972c7.tar.lz
nixpkgs-9f8390701363a767cb409a2931402a4effb972c7.tar.xz
nixpkgs-9f8390701363a767cb409a2931402a4effb972c7.tar.zst
nixpkgs-9f8390701363a767cb409a2931402a4effb972c7.zip
lvm2: only split bin and lib out from out if cmdlib isn't enabled
Diffstat (limited to 'pkgs/os-specific/linux/lvm2')
-rw-r--r--pkgs/os-specific/linux/lvm2/default.nix27
1 files changed, 18 insertions, 9 deletions
diff --git a/pkgs/os-specific/linux/lvm2/default.nix b/pkgs/os-specific/linux/lvm2/default.nix
index fbde55b75ee..35624f421fa 100644
--- a/pkgs/os-specific/linux/lvm2/default.nix
+++ b/pkgs/os-specific/linux/lvm2/default.nix
@@ -28,18 +28,19 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--disable-readline"
     "--enable-pkgconfig"
-    "--bindir=${placeholder "bin"}/bin"
-    "--sbindir=${placeholder "bin"}/bin"
-    "--libdir=${placeholder "lib"}/lib"
     "--with-default-locking-dir=/run/lock/lvm"
     "--with-default-run-dir=/run/lvm"
     "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
-  ] ++ stdenv.lib.optionals enable_dmeventd [
+  ] ++ stdenv.lib.optionals (!enable_cmdlib) [
+    "--bindir=${placeholder "bin"}/bin"
+    "--sbindir=${placeholder "bin"}/bin"
+    "--libdir=${placeholder "lib"}/lib"
+  ] ++ stdenv.lib.optional enable_cmdlib "--enable-cmdlib"
+  ++ stdenv.lib.optionals enable_dmeventd [
     "--enable-dmeventd"
     "--with-dmeventd-pidfile=/run/dmeventd/pid"
     "--with-default-dm-run-dir=/run/dmeventd"
-  ] ++ stdenv.lib.optional enable_cmdlib "--enable-cmdlib"
-  ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_malloc_0_nonnull=yes"
     "ac_cv_func_realloc_0_nonnull=yes"
   ] ++
@@ -100,12 +101,20 @@ stdenv.mkDerivation rec {
     "install_tmpfiles_configuration"
   ];
 
-  postInstall = ''
+  # only split bin and lib out from out if cmdlib isn't enabled
+  outputs = [
+    "out"
+    "dev"
+    "man"
+  ] ++ stdenv.lib.optionals (enable_cmdlib != true) [
+    "bin"
+    "lib"
+  ];
+
+  postInstall = stdenv.lib.optionalString (enable_cmdlib != true) ''
     moveToOutput lib/libdevmapper.so $lib
   '';
 
-  outputs = [ "out" "bin" "lib" "dev" "man" ];
-
   meta = with stdenv.lib; {
     homepage = "http://sourceware.org/lvm2/";
     description = "Tools to support Logical Volume Management (LVM) on Linux";