Author: ludo
Date: Tue Nov  9 13:12:31 2010
New Revision: 24627
URL: https://svn.nixos.org/websvn/nix/?rev=24627&sc=1

Log:
GNU grep: Fix build on non-GNU platforms.

Modified:
   nixpkgs/branches/stdenv-updates/pkgs/tools/text/gnugrep/default.nix
   nixpkgs/branches/stdenv-updates/pkgs/top-level/all-packages.nix

Modified: nixpkgs/branches/stdenv-updates/pkgs/tools/text/gnugrep/default.nix
==============================================================================
--- nixpkgs/branches/stdenv-updates/pkgs/tools/text/gnugrep/default.nix Tue Nov 
 9 13:12:26 2010        (r24626)
+++ nixpkgs/branches/stdenv-updates/pkgs/tools/text/gnugrep/default.nix Tue Nov 
 9 13:12:31 2010        (r24627)
@@ -1,16 +1,17 @@
-{stdenv, fetchurl, pcre}:
+{ stdenv, fetchurl, pcre, libiconv ? null}:
 
 let version = "2.7"; in
 
 stdenv.mkDerivation {
   name = "gnugrep-${version}";
-  
+
   src = fetchurl {
     url = "mirror://gnu/grep/grep-${version}.tar.gz";
     sha256 = "1b8vksfd1ngharac3ygaqim3lrf0yqap992sg0vfm7572l88655d";
   };
-  
-  buildInputs = [pcre];
+
+  buildInputs = [ pcre ]
+    ++ (stdenv.lib.optional (libiconv != null) libiconv);
 
   doCheck = if stdenv.isDarwin then false else true;
 
@@ -31,6 +32,9 @@
     '';
 
     license = "GPLv3+";
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+    platforms = stdenv.lib.platforms.all;
   };
 
   passthru = {inherit pcre;};

Modified: nixpkgs/branches/stdenv-updates/pkgs/top-level/all-packages.nix
==============================================================================
--- nixpkgs/branches/stdenv-updates/pkgs/top-level/all-packages.nix     Tue Nov 
 9 13:12:26 2010        (r24626)
+++ nixpkgs/branches/stdenv-updates/pkgs/top-level/all-packages.nix     Tue Nov 
 9 13:12:31 2010        (r24627)
@@ -666,7 +666,13 @@
     inherit (gtkLibs) gtk glib;
   };
 
-  gnugrep = callPackage ../tools/text/gnugrep { };
+  gnugrep =
+    # Use libiconv only on non-GNU platforms (we can't test with
+    # `stdenv ? glibc' at this point.)
+    let gnu = stdenv.isLinux; in
+      callPackage ../tools/text/gnugrep {
+        libiconv = if gnu then null else libiconv;
+      };
 
   gnupatch = callPackage ../tools/text/gnupatch { };
 
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to