about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArnout Engelen <arnout@bzzt.net>2020-01-07 09:49:54 +0100
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2020-01-15 09:45:11 +0100
commit996e11d92b7df39896067a969f9d4269b6e18d14 (patch)
tree5e0ec42c82e3486c1862e0f0c4ade55ed6cf26e9
parent320a4c15265d6afb7eb6e28fcc1f72a80367ccc1 (diff)
downloadnixlib-996e11d92b7df39896067a969f9d4269b6e18d14.tar
nixlib-996e11d92b7df39896067a969f9d4269b6e18d14.tar.gz
nixlib-996e11d92b7df39896067a969f9d4269b6e18d14.tar.bz2
nixlib-996e11d92b7df39896067a969f9d4269b6e18d14.tar.lz
nixlib-996e11d92b7df39896067a969f9d4269b6e18d14.tar.xz
nixlib-996e11d92b7df39896067a969f9d4269b6e18d14.tar.zst
nixlib-996e11d92b7df39896067a969f9d4269b6e18d14.zip
bash: enable PGRP_PIPE deterministically #77055
-rw-r--r--pkgs/shells/bash/4.4.nix3
-rw-r--r--pkgs/shells/bash/5.0.nix5
-rw-r--r--pkgs/shells/bash/pgrp-pipe-4.4.patch29
-rw-r--r--pkgs/shells/bash/pgrp-pipe-5.0.patch31
4 files changed, 65 insertions, 3 deletions
diff --git a/pkgs/shells/bash/4.4.nix b/pkgs/shells/bash/4.4.nix
index 121368abf4c7..7ca57ac01564 100644
--- a/pkgs/shells/bash/4.4.nix
+++ b/pkgs/shells/bash/4.4.nix
@@ -41,9 +41,10 @@ stdenv.mkDerivation rec {
     -DSSH_SOURCE_BASHRC
   '';
 
-  patchFlags = [ "-p0" ];
+  patchFlags = [ "-p0" "-T" ];
 
   patches = upstreamPatches
+    ++ [ ./pgrp-pipe-4.4.patch ]
     ++ optional stdenv.hostPlatform.isCygwin ./cygwin-bash-4.4.11-2.src.patch
     # https://lists.gnu.org/archive/html/bug-bash/2016-10/msg00006.html
     ++ optional stdenv.hostPlatform.isMusl (fetchurl {
diff --git a/pkgs/shells/bash/5.0.nix b/pkgs/shells/bash/5.0.nix
index a06b08a5599c..05aaf39b3404 100644
--- a/pkgs/shells/bash/5.0.nix
+++ b/pkgs/shells/bash/5.0.nix
@@ -41,9 +41,10 @@ stdenv.mkDerivation rec {
     -DSSH_SOURCE_BASHRC
   '';
 
-  patchFlags = [ "-p0" ];
+  patchFlags = [ "-p0" "-T" ];
 
-  patches = upstreamPatches;
+  patches = upstreamPatches
+    ++ [ ./pgrp-pipe-5.0.patch ];
 
   configureFlags = [
     (if interactive then "--with-installed-readline" else "--disable-readline")
diff --git a/pkgs/shells/bash/pgrp-pipe-4.4.patch b/pkgs/shells/bash/pgrp-pipe-4.4.patch
new file mode 100644
index 000000000000..ea3d7bdf92b4
--- /dev/null
+++ b/pkgs/shells/bash/pgrp-pipe-4.4.patch
@@ -0,0 +1,29 @@
+diff -u ./configure ../bash-4.4-fixed/configure
+--- ./configure	2016-09-07 22:57:01.000000000 +0200
++++ ../bash-4.4-fixed/configure	2020-01-08 14:10:26.316858174 +0100
+@@ -16064,10 +16064,7 @@
+ solaris2*)	LOCAL_CFLAGS=-DSOLARIS ;;
+ lynxos*)	LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
+ linux*)		LOCAL_LDFLAGS=-rdynamic		 # allow dynamic loading
+-		case "`uname -r`" in
+-		2.[456789]*|[34]*)	$as_echo "#define PGRP_PIPE 1" >>confdefs.h
+- ;;
+-		esac ;;
++		$as_echo "#define PGRP_PIPE 1" >>confdefs.h ;;
+ *qnx6*)		LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;;
+ *qnx*)		LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
+ powerux*)	LOCAL_LIBS="-lgen" ;;
+diff -u ./configure.ac ../bash-4.4-fixed/configure.ac
+--- ./configure.ac	2016-09-07 22:56:28.000000000 +0200
++++ ../bash-4.4-fixed/configure.ac	2016-09-07 22:56:28.000000000 +0200
+@@ -1092,9 +1092,7 @@
+ solaris2*)	LOCAL_CFLAGS=-DSOLARIS ;;
+ lynxos*)	LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
+ linux*)		LOCAL_LDFLAGS=-rdynamic		 # allow dynamic loading
+-		case "`uname -r`" in
+-		2.[[456789]]*|[[34]]*)	AC_DEFINE(PGRP_PIPE) ;;
+-		esac ;;
++		AC_DEFINE(PGRP_PIPE) ;;
+ *qnx6*)		LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;;
+ *qnx*)		LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
+ powerux*)	LOCAL_LIBS="-lgen" ;;
diff --git a/pkgs/shells/bash/pgrp-pipe-5.0.patch b/pkgs/shells/bash/pgrp-pipe-5.0.patch
new file mode 100644
index 000000000000..2a9fa6f33c3b
--- /dev/null
+++ b/pkgs/shells/bash/pgrp-pipe-5.0.patch
@@ -0,0 +1,31 @@
+diff -u ./configure ../bash-5.0-fixed/configure
+--- ./configure	2019-01-02 15:43:31.000000000 +0100
++++ ../bash-5.0-fixed/configure	2020-01-08 14:18:21.017296179 +0100
+@@ -16312,11 +16312,7 @@
+ solaris2*)	LOCAL_CFLAGS=-DSOLARIS ;;
+ lynxos*)	LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
+ linux*)		LOCAL_LDFLAGS=-rdynamic		 # allow dynamic loading
+-		case "`uname -r`" in
+-		1.*|2.[0123]*)	: ;;
+-		*)	$as_echo "#define PGRP_PIPE 1" >>confdefs.h
+- ;;
+-		esac ;;
++		$as_echo "#define PGRP_PIPE 1" >>confdefs.h ;;
+ netbsd*|openbsd*)	LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;;
+ *qnx[67]*)	LOCAL_LIBS="-lncurses" ;;
+ *qnx*)		LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
+diff -u ./configure.ac ../bash-5.0-fixed/configure.ac
+--- ./configure.ac	2019-01-02 15:39:11.000000000 +0100
++++ ../bash-5.0-fixed/configure.ac	2019-01-02 15:39:11.000000000 +0100
+@@ -1108,10 +1108,7 @@
+ solaris2*)	LOCAL_CFLAGS=-DSOLARIS ;;
+ lynxos*)	LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
+ linux*)		LOCAL_LDFLAGS=-rdynamic		 # allow dynamic loading
+-		case "`uname -r`" in
+-		1.*|2.[[0123]]*)	: ;;
+-		*)	AC_DEFINE(PGRP_PIPE) ;;
+-		esac ;;
++		AC_DEFINE(PGRP_PIPE) ;;
+ netbsd*|openbsd*)	LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;;
+ *qnx[[67]]*)	LOCAL_LIBS="-lncurses" ;;
+ *qnx*)		LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;