From c441868a7e536240c65f5214b3923183403f8bf9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 16 Jul 2008 15:05:49 +0000 Subject: [PATCH] * bash: use the global /etc/bashrc and /etc/bash_logout files. Changed the built-in default $PATH to /no-such-path. (This also applies to the "standard utilities path" used by "command -p", so that doesn't work anymore, but it didn't work anyway on NixOS and nobody uses it.) Include the startup files for non-interactive login shells. Use bashrc when started from ssh. svn path=/nixpkgs/trunk/; revision=12365 --- pkgs/shells/bash/new.nix | 40 +++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 pkgs/shells/bash/new.nix diff --git a/pkgs/shells/bash/new.nix b/pkgs/shells/bash/new.nix new file mode 100644 index 000000000000..beaf2f845e75 --- /dev/null +++ b/pkgs/shells/bash/new.nix @@ -0,0 +1,40 @@ +{stdenv, fetchurl, bison, interactive ? false, ncurses ? null, texinfo ? null}: + +assert interactive -> ncurses != null; + +stdenv.mkDerivation { + name = "bash-3.2-p39"; + + src = fetchurl { + url = http://nixos.org/tarballs/bash-3.2-p39.tar.bz2; + sha256 = "075qs6nfjql57y8ffg3f4glb3l5yl3xy5hny75x6kpwxkqlcxqfy"; + }; + + 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 + ]; + + # !!! 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 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 d7547e95b1bb..5b2a78528f15 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1207,7 +1207,7 @@ let pkgs = rec { bison = bison23; })); - bashInteractive = appendToName "interactive" (import ../shells/bash { + bashInteractive = appendToName "interactive" (import ../shells/bash/new.nix { inherit fetchurl stdenv ncurses texinfo; bison = bison23; interactive = true;