From 4eb10206503ed38136269701ef4823ba401926a0 Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 18 Feb 2024 07:52:30 +0000 Subject: [PATCH] bash: define DEFAULT_LOADABLE_BUILTINS_PATH for non-FHS builds this compile-time constant becomes the runtime value for BASH_LOADABLES_PATH when otherwise not set. it was added in bash 4.4, with an upstream default of: "/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:." (see: ) and is documented here: nixpkgs' bash already builds these loadables: this patch simply improves the ergonomics, from: ``` bash -i $ BASH_LOADABLES_PATH="$(dirname $(which bash))/../lib/bash" $ enable -f realpath realpath $ realpath ... ``` to: ``` bash -i $ enable -f realpath realpath $ realpath ... ``` Co-authored-by: Arne Keller <2012gdwu+github@posteo.de> --- pkgs/shells/bash/5.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/shells/bash/5.nix b/pkgs/shells/bash/5.nix index 1e1fe340dcda..9ca6e396e676 100644 --- a/pkgs/shells/bash/5.nix +++ b/pkgs/shells/bash/5.nix @@ -48,6 +48,7 @@ stdenv.mkDerivation rec { '' + lib.optionalString (!forFHSEnv) '' -DDEFAULT_PATH_VALUE="/no-such-path" -DSTANDARD_UTILS_PATH="/no-such-path" + -DDEFAULT_LOADABLE_BUILTINS_PATH="${placeholder "out"}/lib/bash:." '' + '' -DNON_INTERACTIVE_LOGIN_SHELLS -DSSH_SOURCE_BASHRC