diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix index 3c21bfd2f254..36012dc6f507 100644 --- a/pkgs/tools/text/gnugrep/default.nix +++ b/pkgs/tools/text/gnugrep/default.nix @@ -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;}; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d281d9483b1e..e62e7afbaa56 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };