From f2c5b6980b53f43a90ff0fa2a08a2265a0b328b6 Mon Sep 17 00:00:00 2001 From: Noah Evans Date: Mon, 11 Aug 2025 07:45:25 -0400 Subject: multiarch-container: Try to install locale after symlinking. * nonguix/multiarch-container.scm (make-container-internal) [inputs]: Add bash-minimal. [arguments] <#:builder>: Wrap fhs-internal-script with GUILE_INSTALL_LOCALE=0. (make-internal-script): Try to install the locale after creating symlinks. Fixes: #407 Signed-off-by: Hilton Chain --- nonguix/multiarch-container.scm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'nonguix/multiarch-container.scm') diff --git a/nonguix/multiarch-container.scm b/nonguix/multiarch-container.scm index e6c512a..b637d06 100644 --- a/nonguix/multiarch-container.scm +++ b/nonguix/multiarch-container.scm @@ -43,6 +43,7 @@ (define-module (nonguix multiarch-container) #:use-module (gnu packages) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (guix build-system trivial) #:use-module (guix gexp) #:use-module (guix records) @@ -451,7 +452,9 @@ the exact path for the fhs-internal package." (package-version (ngc-wrap-package container)))) (source #f) (inputs `(("fhs-internal-script" - ,(make-internal-script container)))) + ,(make-internal-script container)) + ;; For ‘wrap-program’. + ("bash-minimal" ,bash-minimal))) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) @@ -462,7 +465,13 @@ the exact path for the fhs-internal package." (internal-target (assoc-ref %build-inputs "fhs-internal-script")) (internal-dest (string-append bin "/" ,(ngc-internal-name container)))) (mkdir-p bin) - (symlink internal-target internal-dest))))) + (symlink internal-target internal-dest) + + ;; We want to install the locale manually after symlinking it. + ;; See + (wrap-program internal-dest + #:sh (search-input-file %build-inputs "/bin/bash") + '("GUILE_INSTALL_LOCALE" = ("0"))))))) (home-page #f) (synopsis "Script used to set up sandbox") (description "Script used inside the FHS Guix container to set up the @@ -613,6 +622,15 @@ application." ;; inside the container. Needed for GStreamer plugins to load in container. (setenv "GST_PLUGIN_SYSTEM_PATH" "/lib64/gstreamer-1.0:/lib/gstreamer-1.0") + ;; Try to install the locale after symlinking it. + ;; See + (with-exception-handler + (lambda () + (format #t "~%~%Failed to install locale. Is glibc-locales available in the container?~%")) + (lambda () + (setlocale LC_ALL "")) + #:unwind? #t) + ;; Process FHS-specific command line options. (let* ((options (getopt-long (or fhs-args '("")) fhs-option-spec)) (asound32-opt (option-ref options 'asound32 #f)) -- cgit v1.3