From 994d8ce394e88b55985241b7b14f6a8459bcf9e8 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sun, 29 Aug 2021 18:54:47 +0200 Subject: gnu: shadow: Use the cross-compiled shell at runtime. Make sure that the executed shell at runtime is the cross-compiled shell and not the native shell. * gnu/packages/admin.scm (shadow)[arguments]: Add a set-runtime-shell phase. [inputs]: Add bash-minimal when cross-compiling. --- gnu/packages/admin.scm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index f9b0abac34..7910bb16a7 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -29,7 +29,7 @@ ;;; Copyright © 2019 Hartmut Goebel ;;; Copyright © 2019 Alex Griffin ;;; Copyright © 2019, 2021 Guillaume Le Vaillant -;;; Copyright © 2019, 2020 Mathieu Othacehe +;;; Copyright © 2019, 2020, 2021 Mathieu Othacehe ;;; Copyright © 2020 Oleg Pykhalov ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2020, 2021 Michael Rohleder @@ -824,6 +824,17 @@ hostname.") #:phases (modify-phases %standard-phases + ,@(if (%current-target-system) + '((add-before 'configure 'set-runtime-shell + (lambda* (#:key inputs #:allow-other-keys) + (let ((shell (string-append + (assoc-ref inputs "bash") + "/bin/bash"))) + (setenv "RUNTIME_SHELL" shell) + (substitute* "configure.ac" + (("\\$SHELL") + "$RUNTIME_SHELL")))))) + '()) (add-before 'build 'set-nscd-file-name (lambda* (#:key inputs #:allow-other-keys) ;; Use the right file name for nscd. @@ -848,7 +859,10 @@ hostname.") (inputs `(,@(if (hurd-target?) '() - `(("linux-pam" ,linux-pam))))) + `(("linux-pam" ,linux-pam))) + ,@(if (%current-target-system) + `(("bash" ,bash-minimal)) + '()))) (home-page "https://github.com/shadow-maint/shadow") (synopsis "Authentication-related tools such as passwd, su, and login") (description -- cgit 1.4.1