about summary refs log tree commit diff
path: root/pkgs/tools/text/gawk
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-05-25 09:11:51 +0000
committerLudovic Courtès <ludo@gnu.org>2012-05-25 09:11:51 +0000
commite38bf5459263396e61752a2192451c2ffa1dfbab (patch)
treec7cb1e1cb6064f80d50625d0d95cfce3f6004af9 /pkgs/tools/text/gawk
parentc0be42fd6826a0d75fcfb7d341e3eb07c06c8a37 (diff)
downloadnixlib-e38bf5459263396e61752a2192451c2ffa1dfbab.tar
nixlib-e38bf5459263396e61752a2192451c2ffa1dfbab.tar.gz
nixlib-e38bf5459263396e61752a2192451c2ffa1dfbab.tar.bz2
nixlib-e38bf5459263396e61752a2192451c2ffa1dfbab.tar.lz
nixlib-e38bf5459263396e61752a2192451c2ffa1dfbab.tar.xz
nixlib-e38bf5459263396e61752a2192451c2ffa1dfbab.tar.zst
nixlib-e38bf5459263396e61752a2192451c2ffa1dfbab.zip
GNU Awk: Fix Cygwin builds.
svn path=/nixpkgs/trunk/; revision=34240
Diffstat (limited to 'pkgs/tools/text/gawk')
-rw-r--r--pkgs/tools/text/gawk/cygwin-identifiers.patch75
-rw-r--r--pkgs/tools/text/gawk/default.nix8
2 files changed, 82 insertions, 1 deletions
diff --git a/pkgs/tools/text/gawk/cygwin-identifiers.patch b/pkgs/tools/text/gawk/cygwin-identifiers.patch
new file mode 100644
index 000000000000..baff9b55481d
--- /dev/null
+++ b/pkgs/tools/text/gawk/cygwin-identifiers.patch
@@ -0,0 +1,75 @@
+This patch fixes compilation on Windows, where some of the identifiers
+would clash.
+
+commit 5a0b7f9953f24dc034eca4052214da49fbad8bd0
+Author: Arnold D. Robbins <arnold@skeeve.com>
+Date:   Fri Jul 29 13:25:57 2011 +0300
+
+    Fix DJGPP problem with libsigsegv.
+
+diff --git a/builtin.c b/builtin.c
+index 4d87592..941f5ad 100644
+--- a/builtin.c
++++ b/builtin.c
+@@ -605,7 +605,7 @@ format_tree(
+ 	NODE *arg;
+ 	long fw, prec, argnum;
+ 	int used_dollar;
+-	int lj, alt, big, bigbig, small, have_prec, need_format;
++	int lj, alt, big_flag, bigbig_flag, small_flag, have_prec, need_format;
+ 	long *cur = NULL;
+ 	uintmax_t uval;
+ 	int sgn;
+@@ -725,7 +725,7 @@ format_tree(
+ 		signchar = FALSE;
+ 		zero_flag = FALSE;
+ 		quote_flag = FALSE;
+-		lj = alt = big = bigbig = small = FALSE;
++		lj = alt = big_flag = bigbig_flag = small_flag = FALSE;
+ 		fill = sp;
+ 		cp = cend;
+ 		chbuf = lchbuf;
+@@ -907,7 +907,7 @@ check_pos:
+ 			goto retry;  
+ #endif
+ 		case 'l':
+-			if (big)
++			if (big_flag)
+ 				break;
+ 			else {
+ 				static short warned = FALSE;
+@@ -921,10 +921,10 @@ check_pos:
+ 					goto out;
+ 				}
+ 			}
+-			big = TRUE;
++			big_flag = TRUE;
+ 			goto retry;
+ 		case 'L':
+-			if (bigbig)
++			if (bigbig_flag)
+ 				break;
+ 			else {
+ 				static short warned = FALSE;
+@@ -938,10 +938,10 @@ check_pos:
+ 					goto out;
+ 				}
+ 			}
+-			bigbig = TRUE;
++			bigbig_flag = TRUE;
+ 			goto retry;
+ 		case 'h':
+-			if (small)
++			if (small_flag)
+ 				break;
+ 			else {
+ 				static short warned = FALSE;
+@@ -955,7 +955,7 @@ check_pos:
+ 					goto out;
+ 				}
+ 			}
+-			small = TRUE;
++			small_flag = TRUE;
+ 			goto retry;
+ 		case 'c':
+ 			need_format = FALSE;
diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix
index f760e832ccc2..bb6e4e20d244 100644
--- a/pkgs/tools/text/gawk/default.nix
+++ b/pkgs/tools/text/gawk/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, libsigsegv }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (rec {
   name = "gawk-4.0.0";
 
   src = fetchurl {
@@ -37,3 +37,9 @@ stdenv.mkDerivation rec {
     maintainers = [ stdenv.lib.maintainers.ludo ];
   };
 }
+
+//
+
+stdenv.lib.optionalAttrs stdenv.isCygwin {
+  patches = [ ./cygwin-identifiers.patch ];
+})