From ae474690eaa2fc92eaed84c1c378df1f78e0fbfc Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 17 Mar 2009 14:03:03 +0000 Subject: [PATCH] Added bash 4.0 (and readline 6.0, which is required by bash). svn path=/nixpkgs/trunk/; revision=14573 --- pkgs/development/libraries/readline/6.0.nix | 12 ++++++ pkgs/shells/bash/4.0.nix | 44 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 16 ++++++-- 3 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/libraries/readline/6.0.nix create mode 100644 pkgs/shells/bash/4.0.nix diff --git a/pkgs/development/libraries/readline/6.0.nix b/pkgs/development/libraries/readline/6.0.nix new file mode 100644 index 000000000000..667a46881fc0 --- /dev/null +++ b/pkgs/development/libraries/readline/6.0.nix @@ -0,0 +1,12 @@ +args: with args; + +stdenv.mkDerivation { + name = "readline-6.0"; + src = fetchurl { + url = mirror://gnu/readline/readline-6.0.tar.gz; + sha256 = "1pn13j6f9376kwki69050x3zh62yb1w31l37rws5nwr5q02xk68i"; + }; + propagatedBuildInputs = [ncurses]; + configureFlags = "--enable-shared --disable-static"; + patches = stdenv.lib.optional stdenv.isDarwin ./shobj-darwin.patch; +} diff --git a/pkgs/shells/bash/4.0.nix b/pkgs/shells/bash/4.0.nix new file mode 100644 index 000000000000..0554039f279c --- /dev/null +++ b/pkgs/shells/bash/4.0.nix @@ -0,0 +1,44 @@ +{stdenv, fetchurl, bison, interactive ? false, ncurses ? null, texinfo ? null, readline ? null}: + +assert interactive -> ncurses != null; +assert interactive -> readline != null; + +stdenv.mkDerivation { + name = "bash-4.0"; + + src = fetchurl { + url = mirror://gnu/bash/bash-4.0.tar.gz; + sha256 = "9793d394f640a95030c77d5ac989724afe196921956db741bcaf141801c50518"; + }; + + NIX_CFLAGS_COMPILE = '' + -DSYS_BASHRC="/etc/bashrc" + -DSYS_BASH_LOGOUT="/etc/bash_logout" + -DDEFAULT_PATH_VALUE="/no-such-path" + -DSTANDARD_UTILS_PATH="/no-such-path" + -DNON_INTERACTIVE_LOGIN_SHELLS + -DSSH_SOURCE_BASHRC + ''; + + postInstall = "ln -s bash $out/bin/sh"; + + patches = [ + # For dietlibc builds. + ./winsize.patch + ]; + + configureFlags = if interactive then "--enable-readline --with-installed-readline" else ""; + + # !!! Bison is only needed for bash-3.2 (because of bash32-001.patch) + buildInputs = [bison] + ++ stdenv.lib.optional (texinfo != null) texinfo + ++ stdenv.lib.optional interactive readline + ++ stdenv.lib.optional interactive ncurses; + + meta = { + homepage = http://www.gnu.org/software/bash/; + description = + "GNU Bourne-Again Shell, the de facto standard shell on Linux" + + (if interactive then " (for interactive use)" else ""); + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ea484b7da88c..1ba12ebd8855 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1381,6 +1381,12 @@ let interactive = true; }); + bash4 = appendToName "interactive" (import ../shells/bash/4.0.nix { + inherit fetchurl stdenv ncurses texinfo bison; + readline = readline6; + interactive = true; + }); + tcsh = import ../shells/tcsh { inherit fetchurl stdenv ncurses; }; @@ -2782,7 +2788,7 @@ let inherit (gtkLibs) glib; inherit (xlibs) libX11; }; - + coredumper = import ../development/libraries/coredumper { inherit fetchurl stdenv; }; @@ -3781,6 +3787,10 @@ let inherit fetchurl stdenv ncurses; }; + readline6 = import ../development/libraries/readline/6.0.nix { + inherit fetchurl stdenv ncurses; + }; + # Also known as librdf, includes raptor and rasqal redland = import ../development/libraries/redland { inherit fetchurl stdenv openssl libxml2 pkgconfig perl postgresql sqlite @@ -5700,7 +5710,7 @@ let }; propagatedBuildInputs = [ perlTestDeep perlTestException perlTestWarn - ]; + ]; }; perlSQLAbstractLimit = buildPerlPackage rec { @@ -9291,7 +9301,7 @@ let kdelibs = kde3.kdelibs; kdebase = kde3.kdebase; - + ### SCIENCE/GEOMETRY drgeo = builderDefsPackage (import ../applications/science/geometry/drgeo) {