GNU grep: Fix build on non-GNU platforms.

svn path=/nixpkgs/branches/stdenv-updates/; revision=24627
This commit is contained in:
Ludovic Courtès 2010-11-09 13:12:31 +00:00
parent e729128faa
commit c317c7f4bd
2 changed files with 15 additions and 5 deletions

View file

@ -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 @@ stdenv.mkDerivation {
'';
license = "GPLv3+";
maintainers = [ stdenv.lib.maintainers.ludo ];
platforms = stdenv.lib.platforms.all;
};
passthru = {inherit pcre;};

View file

@ -666,7 +666,13 @@ let
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 { };