From 996e11d92b7df39896067a969f9d4269b6e18d14 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Tue, 7 Jan 2020 09:49:54 +0100 Subject: bash: enable PGRP_PIPE deterministically #77055 --- pkgs/shells/bash/4.4.nix | 3 ++- pkgs/shells/bash/5.0.nix | 5 +++-- pkgs/shells/bash/pgrp-pipe-4.4.patch | 29 +++++++++++++++++++++++++++++ pkgs/shells/bash/pgrp-pipe-5.0.patch | 31 +++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 pkgs/shells/bash/pgrp-pipe-4.4.patch create mode 100644 pkgs/shells/bash/pgrp-pipe-5.0.patch 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" ;; -- cgit 1.4.1