about summary refs log tree commit diff
path: root/pkgs/tools/text
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/text')
-rw-r--r--pkgs/tools/text/diffutils/default.nix10
-rw-r--r--pkgs/tools/text/diffutils/gets-undeclared.patch71
-rw-r--r--pkgs/tools/text/gawk/default.nix4
-rw-r--r--pkgs/tools/text/gnugrep/default.nix2
-rw-r--r--pkgs/tools/text/gnugrep/test-localeconv.patch18
-rw-r--r--pkgs/tools/text/gnupatch/bashishms.patch67
-rw-r--r--pkgs/tools/text/gnupatch/default.nix5
-rw-r--r--pkgs/tools/text/gnused/default.nix6
8 files changed, 99 insertions, 84 deletions
diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix
index fc4293ad7cff..f8413b9a0d0f 100644
--- a/pkgs/tools/text/diffutils/default.nix
+++ b/pkgs/tools/text/diffutils/default.nix
@@ -1,15 +1,13 @@
 { stdenv, fetchurl, coreutils ? null }:
 
-stdenv.mkDerivation {
-  name = "diffutils-3.2";
+stdenv.mkDerivation rec {
+  name = "diffutils-3.3";
 
   src = fetchurl {
-    url = mirror://gnu/diffutils/diffutils-3.2.tar.gz;
-    sha256 = "1lsf0ln0h3mnm2y0mwgrfk0lyfi7bnm4r886acvdrrsvc7pypaia";
+    url = "mirror://gnu/diffutils/${name}.tar.xz";
+    sha256 = "1761vymxbp4wb5rzjvabhdkskk95pghnn67464byvzb5mfl8jpm2";
   };
 
-  patches = [ ./gets-undeclared.patch ];
-
   /* If no explicit coreutils is given, use the one from stdenv. */
   nativeBuildInputs = [ coreutils ];
 
diff --git a/pkgs/tools/text/diffutils/gets-undeclared.patch b/pkgs/tools/text/diffutils/gets-undeclared.patch
deleted file mode 100644
index b6cdc77caa84..000000000000
--- a/pkgs/tools/text/diffutils/gets-undeclared.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-This patch is needed to allow builds with newer versions of
-the GNU libc (2.16+).
-
-
-commit 66712c23388e93e5c518ebc8515140fa0c807348
-Author: Eric Blake <eblake@redhat.com>
-Date:   Thu Mar 29 13:30:41 2012 -0600
-
-    stdio: don't assume gets any more
-    
-    Gnulib intentionally does not have a gets module, and now that C11
-    and glibc have dropped it, we should be more proactive about warning
-    any user on a platform that still has a declaration of this dangerous
-    interface.
-    
-    * m4/stdio_h.m4 (gl_STDIO_H, gl_STDIO_H_DEFAULTS): Drop gets
-    support.
-    * modules/stdio (Makefile.am): Likewise.
-    * lib/stdio-read.c (gets): Likewise.
-    * tests/test-stdio-c++.cc: Likewise.
-    * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Fix comment.
-    * lib/stdio.in.h (gets): Make warning occur in more places.
-    * doc/posix-functions/gets.texi (gets): Update documentation.
-    Reported by Christer Solskogen.
-    
-    Signed-off-by: Eric Blake <eblake@redhat.com>
-
-diff --git a/lib/stdio.in.h b/lib/stdio.in.h
-index aa7b599..c377b6e 100644
---- a/lib/stdio.in.h
-+++ b/lib/stdio.in.h
-@@ -698,22 +698,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
- # endif
- #endif
- 
--#if @GNULIB_GETS@
--# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
--#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
--#   undef gets
--#   define gets rpl_gets
--#  endif
--_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
--_GL_CXXALIAS_RPL (gets, char *, (char *s));
--# else
--_GL_CXXALIAS_SYS (gets, char *, (char *s));
--#  undef gets
--# endif
--_GL_CXXALIASWARN (gets);
- /* It is very rare that the developer ever has full control of stdin,
--   so any use of gets warrants an unconditional warning.  Assume it is
--   always declared, since it is required by C89.  */
-+   so any use of gets warrants an unconditional warning; besides, C11
-+   removed it.  */
-+#undef gets
-+#if HAVE_RAW_DECL_GETS
- _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
- #endif
- 
-@@ -1053,9 +1042,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
- # endif
- #endif
- 
--/* Some people would argue that sprintf should be handled like gets
--   (for example, OpenBSD issues a link warning for both functions),
--   since both can cause security holes due to buffer overruns.
-+/* Some people would argue that all sprintf uses should be warned about
-+   (for example, OpenBSD issues a link warning for it),
-+   since it can cause security holes due to buffer overruns.
-    However, we believe that sprintf can be used safely, and is more
-    efficient than snprintf in those safe cases; and as proof of our
-    belief, we use sprintf in several gnulib modules.  So this header
diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix
index eba1dc2ac7fd..901f53c5e5cc 100644
--- a/pkgs/tools/text/gawk/default.nix
+++ b/pkgs/tools/text/gawk/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, libsigsegv }:
 
 stdenv.mkDerivation rec {
-  name = "gawk-4.0.2";
+  name = "gawk-4.1.0";
 
   src = fetchurl {
     url = "mirror://gnu/gawk/${name}.tar.xz";
-    sha256 = "04vd0axif762mf781pj3days6ilv2333b9zi9c50y5mma66g5q91";
+    sha256 = "0hin2hswbbd6kd6i4zzvgciwpl5fba8d2s524z8y5qagyz3x010q";
   };
 
   patches = [];
diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix
index 98a737339d27..fde9123adf29 100644
--- a/pkgs/tools/text/gnugrep/default.nix
+++ b/pkgs/tools/text/gnugrep/default.nix
@@ -13,6 +13,8 @@ stdenv.mkDerivation {
   buildInputs = [ pcre ]
     ++ stdenv.lib.optional (libiconv != null) libiconv;
 
+  patches = [ ./test-localeconv.patch ];
+
   NIX_LDFLAGS = stdenv.lib.optionalString (libiconv != null) "-L${libiconv}/lib -liconv";
 
   doCheck = !stdenv.isDarwin;
diff --git a/pkgs/tools/text/gnugrep/test-localeconv.patch b/pkgs/tools/text/gnugrep/test-localeconv.patch
new file mode 100644
index 000000000000..f5efaf222217
--- /dev/null
+++ b/pkgs/tools/text/gnugrep/test-localeconv.patch
@@ -0,0 +1,18 @@
+--- grep-2.14/gnulib-tests/test-localeconv.c.orig	2013-02-15 18:41:50.213433059 +0000
++++ grep-2.14/gnulib-tests/test-localeconv.c	2013-02-15 18:50:33.964751303 +0000
+@@ -37,13 +37,13 @@
+ 
+     ASSERT (STREQ (l->decimal_point, "."));
+     ASSERT (STREQ (l->thousands_sep, ""));
+-#if !defined __FreeBSD__
++#if !(defined __FreeBSD__ || defined __sun)
+     ASSERT (STREQ (l->grouping, ""));
+ #endif
+ 
+     ASSERT (STREQ (l->mon_decimal_point, ""));
+     ASSERT (STREQ (l->mon_thousands_sep, ""));
+-#if !defined __FreeBSD__
++#if !(defined __FreeBSD__ || defined __sun)
+     ASSERT (STREQ (l->mon_grouping, ""));
+ #endif
+     ASSERT (STREQ (l->positive_sign, ""));
diff --git a/pkgs/tools/text/gnupatch/bashishms.patch b/pkgs/tools/text/gnupatch/bashishms.patch
new file mode 100644
index 000000000000..1a2cfbd8e4a2
--- /dev/null
+++ b/pkgs/tools/text/gnupatch/bashishms.patch
@@ -0,0 +1,67 @@
+http://lists.gnu.org/archive/html/bug-patch/2012-11/msg00001.html
+Tested on Illumos, where ksh is /bin/sh.
+
+--- patch-2.7.1/tests/test-lib.sh
++++ patch-2.7.1/tests/test-lib.sh
+@@ -118,7 +118,7 @@
+ }
+ 
+ if test -z "`echo -n`"; then
+-    if eval 'test -n "${BASH_LINENO[0]}" 2>/dev/null'; then
++    if (eval 'test -n "${BASH_LINENO[0]}"') 2>/dev/null; then
+ 	eval '
+ 	    _start_test() {
+ 		echo -n "[${BASH_LINENO[2]}] $* -- "
+
+--- patch-2.7.1/tests/crlf-handling
++++ patch-2.7.1/tests/crlf-handling
+@@ -14,7 +14,7 @@
+ use_tmpdir
+ 
+ lf2crlf() {
+-    while read l; do echo -e "$l\r"; done
++    while read l; do printf "%s\r\n" "$l"; done
+ }
+ 
+ echo 1 > a
+
+--- patch-2.7.1/tests/merge
++++ patch-2.7.1/tests/merge
+@@ -32,18 +32,20 @@
+     shift
+     done > a.sed
+     echo "$body" | sed -f a.sed > b
+-    shift
+-    while test $# -gt 0 ; do
+-	echo "$1"
++    if test $# -gt 0 ; then
+ 	shift
+-    done > b.sed
++    while test $# -gt 0 ; do
++	echo "$1"
++	shift
++    done
++    fi > b.sed
+     echo "$body" | sed -f b.sed > c
+     rm -f a.sed b.sed
+     output=`diff -u a b | patch $ARGS -f c`
+     status=$?
+     echo "$output" | sed -e '/^$/d' -e '/^patching file c$/d'
+     cat c
+-    test $status == 0 || echo "Status: $status"
++    test $status = 0 || echo "Status: $status"
+ }
+ 
+ x() {
+
+--- patch-2.7.1/tests/read-only-files
++++ patch-2.7.1/tests/read-only-files
+@@ -16,7 +16,7 @@
+
+ : > read-only
+ chmod a-w read-only
+-if : 2> /dev/null > read-only; then
++if (: > read-only) 2> /dev/null; then
+     echo "Files with read-only permissions are writable" \
+         "(probably running as superuser)" >&2
+     exit 77
diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix
index c8c336ad202c..83430a87105c 100644
--- a/pkgs/tools/text/gnupatch/default.nix
+++ b/pkgs/tools/text/gnupatch/default.nix
@@ -14,8 +14,9 @@ stdenv.mkDerivation rec {
     configureFlags = [ "ac_cv_func_strnlen_working=yes" ];
   };
 
-  # Tests fail on FreeBSD due to a Bashism in the tests.
-  doCheck = !stdenv.isFreeBSD;
+  patches = [ ./bashishms.patch ];
+
+  doCheck = true;
 
   meta = {
     description = "GNU Patch, a program to apply differences to files";
diff --git a/pkgs/tools/text/gnused/default.nix b/pkgs/tools/text/gnused/default.nix
index 66fcb3d19290..d16ce1e0a299 100644
--- a/pkgs/tools/text/gnused/default.nix
+++ b/pkgs/tools/text/gnused/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "gnused-4.2.1";
+  name = "gnused-4.2.2";
 
   src = fetchurl {
-    url = mirror://gnu/sed/sed-4.2.1.tar.gz;
-    sha256 = "0q1hzjvr6pzhaagidg7pj76k1fzz5nl15np7p72w9zcpw0f58ww7";
+    url = mirror://gnu/sed/sed-4.2.2.tar.bz2;
+    sha256 = "f048d1838da284c8bc9753e4506b85a1e0cc1ea8999d36f6995bcb9460cddbd7";
   };
 
   meta = {