diff options
| author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-05-06 15:59:01 +0900 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-05-26 13:43:03 +0900 |
| commit | 2345e87c35d476bc5624ccf4d8bc9e2e25fc856f (patch) | |
| tree | 07a1e65a5fb392f4f1c19a1449cb32cb1f4f38a2 /gnu/packages/bash.scm | |
| parent | 279adf431bbdb41921e6a72d401a7c55f3bc1947 (diff) | |
gnu: bash: Define the SYS_BASHRC macro.
This causes Bash to treat /etc/bashrc as a startup file, removing the need to
source /etc/bashrc from ~/.bashrc.
* gnu/packages/bash.scm (bash-fixed): New package, with added SYS_BASHRC
define.
(bash) [replacement]: Use it.
* gnu/system/shadow.scm (%default-bashrc): Do not source /etc/bashrc, now done
implicitly.
Change-Id: I5b0afd7d81653ef19c482e5501efdf7e50ef37c0
Diffstat (limited to 'gnu/packages/bash.scm')
| -rw-r--r-- | gnu/packages/bash.scm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm index c88f38f5376..bcd78d7d2a9 100644 --- a/gnu/packages/bash.scm +++ b/gnu/packages/bash.scm | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | ;;; Copyright © 2024 Oleg Pykhalov <go.wigust@gmail.com> | 10 | ;;; Copyright © 2024 Oleg Pykhalov <go.wigust@gmail.com> |
| 11 | ;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org> | 11 | ;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org> |
| 12 | ;;; Copyright © 2024 chris <chris@bumblehead.com> | 12 | ;;; Copyright © 2024 chris <chris@bumblehead.com> |
| 13 | ;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer@gmail.com> | ||
| 13 | ;;; | 14 | ;;; |
| 14 | ;;; This file is part of GNU Guix. | 15 | ;;; This file is part of GNU Guix. |
| 15 | ;;; | 16 | ;;; |
| @@ -137,6 +138,7 @@ number/base32-hash tuples, directly usable in the 'patch-series' form." | |||
| 137 | (version "5.1")) | 138 | (version "5.1")) |
| 138 | (package | 139 | (package |
| 139 | (name "bash") | 140 | (name "bash") |
| 141 | (replacement bash-fixed) | ||
| 140 | (source (origin | 142 | (source (origin |
| 141 | (method url-fetch) | 143 | (method url-fetch) |
| 142 | (uri (string-append | 144 | (uri (string-append |
| @@ -254,6 +256,24 @@ without modification.") | |||
| 254 | (license license:gpl3+) | 256 | (license license:gpl3+) |
| 255 | (home-page "https://www.gnu.org/software/bash/")))) | 257 | (home-page "https://www.gnu.org/software/bash/")))) |
| 256 | 258 | ||
| 259 | (define bash-fixed | ||
| 260 | (package | ||
| 261 | (inherit bash) | ||
| 262 | (arguments | ||
| 263 | (substitute-keyword-arguments (package-arguments bash) | ||
| 264 | ((#:modules modules '%default-gnu-modules) | ||
| 265 | (append '((ice-9 receive) | ||
| 266 | (srfi srfi-1) | ||
| 267 | (srfi srfi-26)) | ||
| 268 | modules)) | ||
| 269 | ((#:configure-flags flags) | ||
| 270 | #~(receive (cppflags flags) | ||
| 271 | (partition (cut string-prefix? "CPPFLAGS" <>) | ||
| 272 | #$flags) | ||
| 273 | (cons (string-append (first cppflags) | ||
| 274 | " -DSYS_BASHRC='\"/etc/bashrc\"'") | ||
| 275 | flags))))))) | ||
| 276 | |||
| 257 | (define-public bash-minimal | 277 | (define-public bash-minimal |
| 258 | ;; A stripped-down Bash for non-interactive use. | 278 | ;; A stripped-down Bash for non-interactive use. |
| 259 | (package/inherit bash | 279 | (package/inherit bash |
