From 6c6ff6f36ff26932aa730875bd237c8e37210f0e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 6 Mar 2007 22:46:03 +0000 Subject: * Yes! Finally! Bash built with ncurses support! This fixes the annoying problem with lines longer than 80 (?) characters. svn path=/nixpkgs/trunk/; revision=8248 --- pkgs/shells/bash-interactive/bash32-001.patch | 47 +++++++++++++++++++++++++++ pkgs/shells/bash-interactive/default.nix | 29 +++++++++++++++++ pkgs/shells/bash-interactive/winsize.patch | 14 ++++++++ pkgs/top-level/all-packages.nix | 6 ++++ 4 files changed, 96 insertions(+) create mode 100644 pkgs/shells/bash-interactive/bash32-001.patch create mode 100644 pkgs/shells/bash-interactive/default.nix create mode 100644 pkgs/shells/bash-interactive/winsize.patch (limited to 'pkgs') diff --git a/pkgs/shells/bash-interactive/bash32-001.patch b/pkgs/shells/bash-interactive/bash32-001.patch new file mode 100644 index 000000000000..9f8a885df1f2 --- /dev/null +++ b/pkgs/shells/bash-interactive/bash32-001.patch @@ -0,0 +1,47 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 3.2 +Patch-ID: bash32-001 + +Bug-Reported-by: Greg Schafer +Bug-Reference-ID: <20061012084940.GA15768@tigers.local> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2006-10/msg00046.html + +Bug-Description: + +When using historical ``-style command substitution, bash incorrectly attempts +to interpret shell comments while scanning for the closing backquote. + +Patch: + +*** bash-3.2/parse.y Tue Sep 19 16:37:21 2006 +--- new-bash/parse.y Thu Oct 12 10:30:57 2006 +*************** +*** 2736,2740 **** + count = 1; + pass_next_character = backq_backslash = was_dollar = in_comment = 0; +! check_comment = (flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ +--- 2736,2740 ---- + count = 1; + pass_next_character = backq_backslash = was_dollar = in_comment = 0; +! check_comment = (flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ +*** bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006 +--- new-bash/patchlevel.h Mon Oct 16 14:22:54 2006 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 0 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 1 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/pkgs/shells/bash-interactive/default.nix b/pkgs/shells/bash-interactive/default.nix new file mode 100644 index 000000000000..678e6b40aed0 --- /dev/null +++ b/pkgs/shells/bash-interactive/default.nix @@ -0,0 +1,29 @@ +{stdenv, fetchurl, bison, interactive ? false, ncurses ? null}: + +assert interactive -> ncurses != null; + +stdenv.mkDerivation { + name = "bash-3.2"; + + src = fetchurl { + url = ftp://ftp.nluug.nl/pub/gnu/bash/bash-3.2.tar.gz; + md5 = "00bfa16d58e034e3c2aa27f390390d30"; + }; + + postInstall = "ln -s bash $out/bin/sh"; + + patches = [ + # Fix a nasty bug in bash-3.2. + ./bash32-001.patch + + # For dietlibc builds. + ./winsize.patch + ]; + + # !!! only needed for bash-3.2 (because of bash32-001.patch) + buildInputs = [bison] ++ (if interactive then [ncurses] else []); + + meta = { + description = "GNU Bourne-Again Shell, the de facto standard shell on Linux"; + }; +} diff --git a/pkgs/shells/bash-interactive/winsize.patch b/pkgs/shells/bash-interactive/winsize.patch new file mode 100644 index 000000000000..bbe4151e0cc7 --- /dev/null +++ b/pkgs/shells/bash-interactive/winsize.patch @@ -0,0 +1,14 @@ +diff -rc bash-3.1-orig/lib/sh/winsize.c bash-3.1/lib/sh/winsize.c +*** bash-3.1-orig/lib/sh/winsize.c 2006-10-18 18:08:25.000000000 +0200 +--- bash-3.1/lib/sh/winsize.c 2006-10-18 18:10:00.000000000 +0200 +*************** +*** 30,35 **** +--- 30,37 ---- + + #include + ++ #include ++ + #if !defined (STRUCT_WINSIZE_IN_SYS_IOCTL) + /* For struct winsize on SCO */ + /* sys/ptem.h has winsize but needs mblk_t from sys/stream.h */ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ab8611ec4c8d..7b2e53146084 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -567,6 +567,12 @@ rec { bison = bison23; }); + bashInteractive = import ../shells/bash-interactive { + inherit fetchurl stdenv ncurses; + bison = bison23; + interactive = true; + }; + tcsh = import ../shells/tcsh { inherit fetchurl stdenv ncurses; }; -- cgit 1.4.1