summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-12-12 23:21:35 +0000
committerLudovic Courtès <ludo@gnu.org>2010-12-12 23:21:35 +0000
commitef8619b4b2ed2589285f543e7ae409ac8bd07405 (patch)
tree9800b39af5ae77d7ffdb533f8ad0e30369ab5391 /pkgs/tools
parent0847b74a2c18f7bc9ba99653d079bcc57f35efd1 (diff)
downloadnixpkgs-ef8619b4b2ed2589285f543e7ae409ac8bd07405.tar
nixpkgs-ef8619b4b2ed2589285f543e7ae409ac8bd07405.tar.gz
nixpkgs-ef8619b4b2ed2589285f543e7ae409ac8bd07405.tar.bz2
nixpkgs-ef8619b4b2ed2589285f543e7ae409ac8bd07405.tar.lz
nixpkgs-ef8619b4b2ed2589285f543e7ae409ac8bd07405.tar.xz
nixpkgs-ef8619b4b2ed2589285f543e7ae409ac8bd07405.tar.zst
nixpkgs-ef8619b4b2ed2589285f543e7ae409ac8bd07405.zip
GNU Parted: Allow cross-GNU builds.
svn path=/nixpkgs/branches/stdenv-updates/; revision=25088
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/misc/parted/default.nix22
1 files changed, 17 insertions, 5 deletions
diff --git a/pkgs/tools/misc/parted/default.nix b/pkgs/tools/misc/parted/default.nix
index c4061949424..622753e2303 100644
--- a/pkgs/tools/misc/parted/default.nix
+++ b/pkgs/tools/misc/parted/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, devicemapper, libuuid, gettext, readline
-, utillinuxng, xz }:
+, utillinuxng, xz, enableStatic ? false, hurd ? null }:
 
 stdenv.mkDerivation rec {
   name = "parted-2.3";
@@ -9,14 +9,26 @@ stdenv.mkDerivation rec {
     sha256 = "0sabj81nawcjm8ww34lxg65ka8crv3w2ab4crh8ypw5agg681836";
   };
 
-  buildInputs = [ xz libuuid gettext readline libuuid devicemapper ];
+  buildNativeInputs = [ xz ];
+  buildInputs = [ libuuid ]
+    ++ stdenv.lib.optional (readline != null) readline
+    ++ stdenv.lib.optional (gettext != null) gettext
+    ++ stdenv.lib.optional (devicemapper != null) devicemapper
+    ++ stdenv.lib.optional (hurd != null) hurd;
 
-  configureFlags = "--with-readline";
+  configureFlags =
+       (if (readline != null)
+        then [ "--with-readline" ]
+        else [ "--without-readline" ])
+    ++ stdenv.lib.optional (devicemapper == null) "--disable-device-mapper"
+    ++ stdenv.lib.optional enableStatic "--enable-static";
 
   doCheck = true;
 
-  # The `t0400-loop-clobber-infloop.sh' test wants `mkswap'.
-  preCheck = "export PATH=\"${utillinuxng}/sbin:$PATH\"";
+  preCheck =
+    stdenv.lib.optionalString doCheck
+      # The `t0400-loop-clobber-infloop.sh' test wants `mkswap'.
+      "export PATH=\"${utillinuxng}/sbin:$PATH\"";
 
   meta = {
     description = "GNU Parted, a tool to create, destroy, resize, check, and copy partitions";