me
/
guix
Archived
1
0
Fork 0

gnu: Use ‘libc-utf8-locales-for-target’.

* guix/packages.scm (%standard-patch-inputs): Use
‘libc-utf8-locales-for-target’ instead of ‘glibc-utf8-locales’.
* guix/self.scm (%packages): Likewise.
* gnu/home/services/ssh.scm (file-join): Likewise
* gnu/installer.scm (build-compiled-file): Likewise.
* gnu/packages/chromium.scm (ungoogled-chromium/wayland): Likewise.
* gnu/packages/gnome.scm (libgweather4, tracker): Likewise.
* gnu/packages/javascript.scm (js-mathjax): Likewise.
* gnu/packages/package-management.scm (guix, flatpak): Likewise.
* gnu/packages/raspberry-pi.scm (raspi-arm64-chainloader): Likewise.
* gnu/packages/suckless.scm (svkbd): Likewise.
* gnu/services.scm (cleanup-gexp): Likewise.
* gnu/services/base.scm (guix-publish-shepherd-service): Likewise.
* gnu/services/guix.scm (guix-build-coordinator-shepherd-services)
(guix-build-coordinator-agent-shepherd-services): Likewise.
* gnu/services/guix.scm (guix-build-coordinator-queue-builds-shepherd-services):
(guix-data-service-shepherd-services)
(nar-herder-shepherd-services)
(bffe-shepherd-services): Likewise.
* gnu/services/web.scm (anonip-shepherd-service)
(mumi-shepherd-services): Likewise.
* gnu/system/image.scm (system-disk-image, system-iso9660-image)
(system-docker-image, system-tarball-image): Likewise.
* gnu/system/install.scm (%installation-services): Likewise.
* guix/profiles.scm (info-dir-file): Likewise.
(ca-certificate-bundle, profile-derivation): Likewise.
* guix/scripts/pack.scm (store-database, set-utf8-locale): Likewise.
* tests/pack.scm: Likewise.
* tests/profiles.scm ("profile-derivation, cross-compilation"):
Likewise.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Co-authored-by: Christopher Baines <mail@cbaines.net>
Change-Id: I24239f427bcc930c29d2ba5d00dc615960a6c374
master
Janneke Nieuwenhuizen 2023-10-22 10:23:19 +02:00 committed by Ludovic Courtès
parent 9442b53c6b
commit b0715d7cd2
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
20 changed files with 97 additions and 56 deletions

View File

@ -25,6 +25,7 @@
#:use-module (guix deprecation) #:use-module (guix deprecation)
#:use-module (guix diagnostics) #:use-module (guix diagnostics)
#:use-module (guix i18n) #:use-module (guix i18n)
#:use-module ((guix utils) #:select (%current-system))
#:use-module (gnu services) #:use-module (gnu services)
#:use-module (gnu services configuration) #:use-module (gnu services configuration)
#:use-module (guix modules) #:use-module (guix modules)
@ -32,7 +33,7 @@
#:use-module (gnu home services shepherd) #:use-module (gnu home services shepherd)
#:use-module ((gnu home services utils) #:use-module ((gnu home services utils)
#:select (object->camel-case-string)) #:select (object->camel-case-string))
#:autoload (gnu packages base) (glibc-utf8-locales) #:autoload (gnu packages base) (libc-utf8-locales-for-target)
#:use-module (gnu packages ssh) #:use-module (gnu packages ssh)
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
#:use-module (srfi srfi-9) #:use-module (srfi srfi-9)
@ -357,7 +358,8 @@ inserted after each of them."
;; Support non-ASCII file names. ;; Support non-ASCII file names.
(setenv "GUIX_LOCPATH" (setenv "GUIX_LOCPATH"
#+(file-append glibc-utf8-locales #+(file-append
(libc-utf8-locales-for-target (%current-system))
"/lib/locale")) "/lib/locale"))
(setlocale LC_ALL "en_US.utf8") (setlocale LC_ALL "en_US.utf8")

View File

@ -85,9 +85,10 @@ version of this file."
(define set-utf8-locale (define set-utf8-locale
#~(begin #~(begin
(setenv "LOCPATH" (setenv "LOCPATH"
#$(file-append glibc-utf8-locales "/lib/locale/" #$(file-append
(libc-utf8-locales-for-target) "/lib/locale/"
(version-major+minor (version-major+minor
(package-version glibc-utf8-locales)))) (package-version (libc-utf8-locales-for-target)))))
(setlocale LC_ALL "en_US.utf8"))) (setlocale LC_ALL "en_US.utf8")))
(define builder (define builder

View File

@ -967,7 +967,7 @@ testing.")
(name "ungoogled-chromium-wayland") (name "ungoogled-chromium-wayland")
(native-inputs '()) (native-inputs '())
(inputs (inputs
(list bash-minimal glibc-utf8-locales ungoogled-chromium)) (list bash-minimal (libc-utf8-locales-for-target) ungoogled-chromium))
(build-system trivial-build-system) (build-system trivial-build-system)
(arguments (arguments
(list (list

View File

@ -5917,7 +5917,7 @@ services for numerous locations.")
gi-docgen gi-docgen
`(,glib "bin") ;for glib-mkenums `(,glib "bin") ;for glib-mkenums
gobject-introspection gobject-introspection
glibc-utf8-locales (libc-utf8-locales-for-target)
gsettings-desktop-schemas gsettings-desktop-schemas
pkg-config pkg-config
python python
@ -9471,7 +9471,7 @@ easy, safe, and automatic.")
(native-inputs (native-inputs
(list gettext-minimal (list gettext-minimal
`(,glib "bin") `(,glib "bin")
glibc-utf8-locales (libc-utf8-locales-for-target)
gobject-introspection gobject-introspection
docbook-xsl docbook-xsl
docbook-xml docbook-xml

View File

@ -184,7 +184,7 @@ context menu in TypeScript.")
#t)))) #t))))
(native-inputs (native-inputs
`(("font-mathjax" ,font-mathjax) `(("font-mathjax" ,font-mathjax)
("glibc-utf8-locales" ,glibc-utf8-locales) ("glibc-utf8-locales" ,(libc-utf8-locales-for-target))
("uglifyjs" ,node-uglify-js) ("uglifyjs" ,node-uglify-js)
,@(package-native-inputs font-mathjax))) ,@(package-native-inputs font-mathjax)))
(synopsis "JavaScript display engine for LaTeX, MathML, and AsciiMath") (synopsis "JavaScript display engine for LaTeX, MathML, and AsciiMath")

View File

@ -524,7 +524,7 @@ $(prefix)/etc/openrc\n")))
("git-minimal" ,git-minimal) ;for 'guix perform-download' ("git-minimal" ,git-minimal) ;for 'guix perform-download'
("glibc-utf8-locales" ,glibc-utf8-locales))) ("glibc-utf8-locales" ,(libc-utf8-locales-for-target))))
(propagated-inputs (propagated-inputs
`(("guile-gnutls" ,guile-gnutls) `(("guile-gnutls" ,guile-gnutls)
;; Avahi requires "glib" which doesn't cross-compile yet. ;; Avahi requires "glib" which doesn't cross-compile yet.
@ -2052,7 +2052,7 @@ cp -r /tmp/locale/*/en_US.*")))
dbus ; for dbus-daemon dbus ; for dbus-daemon
gettext-minimal gettext-minimal
`(,glib "bin") ; for glib-mkenums + gdbus-codegen `(,glib "bin") ; for glib-mkenums + gdbus-codegen
glibc-utf8-locales (libc-utf8-locales-for-target)
gobject-introspection gobject-introspection
libcap libcap
pkg-config pkg-config

View File

@ -199,7 +199,7 @@ Raspberry Pi. Note: It does not work on Raspberry Pi 1.")
("ld-wrapper" ,ld-wrapper) ("ld-wrapper" ,ld-wrapper)
("make" ,gnu-make) ("make" ,gnu-make)
("gcc" ,gcc-6) ("gcc" ,gcc-6)
("locales" ,glibc-utf8-locales))) ("locales" ,(libc-utf8-locales-for-target))))
(inputs (inputs
`()) `())
(arguments (arguments

View File

@ -1247,7 +1247,7 @@ a nice format.")
(delete 'configure)))) ;no configure script (delete 'configure)))) ;no configure script
(native-inputs (list pkg-config)) (native-inputs (list pkg-config))
(inputs (list freetype libx11 libxft libxtst libxinerama)) (inputs (list freetype libx11 libxft libxtst libxinerama))
(propagated-inputs (list glibc-utf8-locales)) (propagated-inputs (list (libc-utf8-locales-for-target)))
(home-page "https://tools.suckless.org/x/svkbd/") (home-page "https://tools.suckless.org/x/svkbd/")
(synopsis "Virtual on-screen keyboard") (synopsis "Virtual on-screen keyboard")
(description "svkbd is a simple virtual keyboard, intended to be used in (description "svkbd is a simple virtual keyboard, intended to be used in

View File

@ -651,7 +651,9 @@ information is missing, return the empty list (for channels) and possibly
;; Force file names to be decoded as UTF-8. See ;; Force file names to be decoded as UTF-8. See
;; <https://bugs.gnu.org/26353>. ;; <https://bugs.gnu.org/26353>.
(setenv "GUIX_LOCPATH" (setenv "GUIX_LOCPATH"
#+(file-append glibc-utf8-locales "/lib/locale")) #+(file-append
(libc-utf8-locales-for-target (%current-system))
"/lib/locale"))
(setlocale LC_CTYPE "en_US.utf8") (setlocale LC_CTYPE "en_US.utf8")
(delete-file-recursively "/tmp") (delete-file-recursively "/tmp")
(delete-file-recursively "/var/run") (delete-file-recursively "/var/run")

View File

@ -63,7 +63,9 @@
#:use-module (gnu packages bash) #:use-module (gnu packages bash)
#:use-module ((gnu packages base) #:use-module ((gnu packages base)
#:select (coreutils glibc glibc/hurd #:select (coreutils glibc glibc/hurd
glibc-utf8-locales make-glibc-utf8-locales glibc-utf8-locales
libc-utf8-locales-for-target
make-glibc-utf8-locales
tar canonical-package)) tar canonical-package))
#:use-module ((gnu packages compression) #:select (gzip)) #:use-module ((gnu packages compression) #:select (gzip))
#:use-module (gnu packages fonts) #:use-module (gnu packages fonts)
@ -2147,7 +2149,8 @@ raise a deprecation warning if the 'compression-level' field was used."
;; nars for packages that contain UTF-8 file names such ;; nars for packages that contain UTF-8 file names such
;; as 'nss-certs'. See <https://bugs.gnu.org/26948>. ;; as 'nss-certs'. See <https://bugs.gnu.org/26948>.
(list (string-append "GUIX_LOCPATH=" (list (string-append "GUIX_LOCPATH="
#$glibc-utf8-locales "/lib/locale") #$(libc-utf8-locales-for-target)
"/lib/locale")
"LC_ALL=en_US.utf8") "LC_ALL=en_US.utf8")
#:log-file "/var/log/guix-publish.log")) #:log-file "/var/log/guix-publish.log"))
(endpoints #~(let ((ai (false-if-exception (endpoints #~(let ((ai (false-if-exception

View File

@ -23,7 +23,7 @@
#:use-module (guix records) #:use-module (guix records)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module ((gnu packages base) #:use-module ((gnu packages base)
#:select (glibc-utf8-locales)) #:select (libc-utf8-locales-for-target))
#:use-module (gnu packages admin) #:use-module (gnu packages admin)
#:use-module (gnu packages databases) #:use-module (gnu packages databases)
#:use-module (gnu packages web) #:use-module (gnu packages web)
@ -381,7 +381,8 @@
#:pid-file-timeout 60 #:pid-file-timeout 60
#:environment-variables #:environment-variables
`(,(string-append `(,(string-append
"GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale") "GUIX_LOCPATH="
#$(libc-utf8-locales-for-target) "/lib/locale")
"LC_ALL=en_US.utf8" "LC_ALL=en_US.utf8"
"PATH=/run/current-system/profile/bin" ; for hooks "PATH=/run/current-system/profile/bin" ; for hooks
#$@extra-environment-variables) #$@extra-environment-variables)
@ -508,7 +509,8 @@
#:user #$user #:user #$user
#:environment-variables #:environment-variables
`(,(string-append `(,(string-append
"GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale") "GUIX_LOCPATH="
#$(libc-utf8-locales-for-target) "/lib/locale")
;; XDG_CACHE_HOME is used by Guix when caching narinfo files ;; XDG_CACHE_HOME is used by Guix when caching narinfo files
"XDG_CACHE_HOME=/var/cache/guix-build-coordinator-agent" "XDG_CACHE_HOME=/var/cache/guix-build-coordinator-agent"
"LC_ALL=en_US.utf8") "LC_ALL=en_US.utf8")
@ -600,7 +602,8 @@
#:user #$user #:user #$user
#:environment-variables #:environment-variables
`(,(string-append `(,(string-append
"GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale") "GUIX_LOCPATH="
#$(libc-utf8-locales-for-target) "/lib/locale")
"LC_ALL=en_US.utf8") "LC_ALL=en_US.utf8")
#:log-file "/var/log/guix-build-coordinator/queue-builds.log")))) #:log-file "/var/log/guix-build-coordinator/queue-builds.log"))))
(stop #~(make-kill-destructor)) (stop #~(make-kill-destructor))
@ -712,7 +715,8 @@ ca-certificates.crt file in the system profile."
#:pid-file "/var/run/guix-data-service/pid" #:pid-file "/var/run/guix-data-service/pid"
#:environment-variables #:environment-variables
`(,(string-append `(,(string-append
"GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale") "GUIX_LOCPATH="
#$(libc-utf8-locales-for-target) "/lib/locale")
"LC_ALL=en_US.UTF-8") "LC_ALL=en_US.UTF-8")
#:log-file "/var/log/guix-data-service/web.log")) #:log-file "/var/log/guix-data-service/web.log"))
(stop #~(make-kill-destructor))) (stop #~(make-kill-destructor)))
@ -733,7 +737,8 @@ ca-certificates.crt file in the system profile."
`("HOME=/var/lib/guix-data-service" `("HOME=/var/lib/guix-data-service"
"GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt" "GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt"
,(string-append ,(string-append
"GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale") "GUIX_LOCPATH="
#$(libc-utf8-locales-for-target) "/lib/locale")
"LC_ALL=en_US.UTF-8") "LC_ALL=en_US.UTF-8")
#:log-file "/var/log/guix-data-service/process-jobs.log")) #:log-file "/var/log/guix-data-service/process-jobs.log"))
(stop #~(make-kill-destructor)))))) (stop #~(make-kill-destructor))))))
@ -989,7 +994,8 @@ ca-certificates.crt file in the system profile."
#:pid-file "/var/run/nar-herder/pid" #:pid-file "/var/run/nar-herder/pid"
#:environment-variables #:environment-variables
`(,(string-append `(,(string-append
"GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale") "GUIX_LOCPATH="
#$(libc-utf8-locales-for-target) "/lib/locale")
"LC_ALL=en_US.utf8" "LC_ALL=en_US.utf8"
#$@extra-environment-variables) #$@extra-environment-variables)
#:log-file "/var/log/nar-herder/server.log")) #:log-file "/var/log/nar-herder/server.log"))
@ -1108,7 +1114,8 @@ ca-certificates.crt file in the system profile."
#:directory "/var/lib/bffe" #:directory "/var/lib/bffe"
#:environment-variables #:environment-variables
`(,(string-append `(,(string-append
"GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale") "GUIX_LOCPATH="
#$(libc-utf8-locales-for-target) "/lib/locale")
"LC_ALL=en_US.utf8" "LC_ALL=en_US.utf8"
#$@extra-environment-variables) #$@extra-environment-variables)
#:log-file "/var/log/bffe/server.log")) #:log-file "/var/log/bffe/server.log"))

View File

@ -1498,7 +1498,8 @@ files.")
'#$(optional anonip-configuration-regex "--regex")) '#$(optional anonip-configuration-regex "--regex"))
;; Run in a UTF-8 locale ;; Run in a UTF-8 locale
#:environment-variables #:environment-variables
(list (string-append "GUIX_LOCPATH=" #$glibc-utf8-locales (list (string-append "GUIX_LOCPATH="
#$(libc-utf8-locales-for-target)
"/lib/locale") "/lib/locale")
"LC_ALL=en_US.utf8"))) "LC_ALL=en_US.utf8")))
@ -1976,7 +1977,8 @@ WSGIPassAuthorization On
(define (mumi-shepherd-services config) (define (mumi-shepherd-services config)
(define environment (define environment
#~(list "LC_ALL=en_US.utf8" #~(list "LC_ALL=en_US.utf8"
(string-append "GUIX_LOCPATH=" #$glibc-utf8-locales (string-append "GUIX_LOCPATH="
#$(libc-utf8-locales-for-target)
"/lib/locale"))) "/lib/locale")))
(match config (match config

View File

@ -466,7 +466,9 @@ used in the image."
;; Allow non-ASCII file names--e.g., 'nss-certs'--to be ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be
;; decoded. ;; decoded.
(setenv "GUIX_LOCPATH" (setenv "GUIX_LOCPATH"
#+(file-append glibc-utf8-locales "/lib/locale")) #+(file-append (libc-utf8-locales-for-target
(%current-system))
"/lib/locale"))
(setlocale LC_ALL "en_US.utf8") (setlocale LC_ALL "en_US.utf8")
(initializer image-root (initializer image-root
@ -633,7 +635,8 @@ used in the image. "
;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded. ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded.
(setenv "GUIX_LOCPATH" (setenv "GUIX_LOCPATH"
#+(file-append glibc-utf8-locales "/lib/locale")) #+(file-append (libc-utf8-locales-for-target (%current-system))
"/lib/locale"))
(setlocale LC_ALL "en_US.utf8") (setlocale LC_ALL "en_US.utf8")
@ -737,7 +740,8 @@ output file."
;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded. ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded.
(setenv "GUIX_LOCPATH" (setenv "GUIX_LOCPATH"
#+(file-append glibc-utf8-locales "/lib/locale")) #+(file-append (libc-utf8-locales-for-target (%current-system))
"/lib/locale"))
(setlocale LC_ALL "en_US.utf8") (setlocale LC_ALL "en_US.utf8")
(set-path-environment-variable "PATH" '("bin" "sbin") '(#+tar)) (set-path-environment-variable "PATH" '("bin" "sbin") '(#+tar))
@ -816,7 +820,8 @@ output file."
;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded. ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded.
(setenv "GUIX_LOCPATH" (setenv "GUIX_LOCPATH"
#+(file-append glibc-utf8-locales "/lib/locale")) #+(file-append (libc-utf8-locales-for-target (%current-system))
"/lib/locale"))
(setlocale LC_ALL "en_US.utf8") (setlocale LC_ALL "en_US.utf8")
(let ((image-root (string-append (getcwd) "/tmp-root")) (let ((image-root (string-append (getcwd) "/tmp-root"))

View File

@ -454,7 +454,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
(service gc-root-service-type (service gc-root-service-type
(append (append
(list bare-bones-os (list bare-bones-os
glibc-utf8-locales (libc-utf8-locales-for-target system)
texinfo texinfo
guile-3.0) guile-3.0)
%default-locale-libcs))) %default-locale-libcs)))

View File

@ -866,7 +866,11 @@ identifiers. The result is inferred from the file names of patches."
("lzip" ,(ref '(gnu packages compression) 'lzip)) ("lzip" ,(ref '(gnu packages compression) 'lzip))
("unzip" ,(ref '(gnu packages compression) 'unzip)) ("unzip" ,(ref '(gnu packages compression) 'unzip))
("patch" ,(ref '(gnu packages base) 'patch)) ("patch" ,(ref '(gnu packages base) 'patch))
("locales" ,(ref '(gnu packages base) 'glibc-utf8-locales))))) ("locales"
,(parameterize ((%current-target-system #f))
(canonical
((module-ref (resolve-interface '(gnu packages base))
'libc-utf8-locales-for-target))))))))
(define (default-guile) (define (default-guile)
"Return the default Guile package used to run the build code of "Return the default Guile package used to run the build code of

View File

@ -1000,8 +1000,9 @@ MANIFEST."
(module-ref (resolve-interface '(gnu packages texinfo)) 'texinfo)) (module-ref (resolve-interface '(gnu packages texinfo)) 'texinfo))
(define gzip ;lazy reference (define gzip ;lazy reference
(module-ref (resolve-interface '(gnu packages compression)) 'gzip)) (module-ref (resolve-interface '(gnu packages compression)) 'gzip))
(define glibc-utf8-locales ;lazy reference (define libc-utf8-locales-for-target ;lazy reference
(module-ref (resolve-interface '(gnu packages base)) 'glibc-utf8-locales)) (module-ref (resolve-interface '(gnu packages base))
'libc-utf8-locales-for-target))
(define build (define build
(with-imported-modules '((guix build utils)) (with-imported-modules '((guix build utils))
@ -1043,7 +1044,8 @@ MANIFEST."
(setenv "PATH" (string-append #+gzip "/bin")) ;for info.gz files (setenv "PATH" (string-append #+gzip "/bin")) ;for info.gz files
(setenv "GUIX_LOCPATH" (setenv "GUIX_LOCPATH"
#+(file-append glibc-utf8-locales "/lib/locale")) #+(file-append (libc-utf8-locales-for-target system)
"/lib/locale"))
(mkdir-p (string-append #$output "/share/info")) (mkdir-p (string-append #$output "/share/info"))
(exit (every install-info (exit (every install-info
@ -1124,8 +1126,9 @@ MANIFEST. Single-file bundles are required by programs such as Git and Lynx."
;; See <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00429.html> ;; See <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00429.html>
;; for a discussion. ;; for a discussion.
(define glibc-utf8-locales ;lazy reference (define libc-utf8-locales-for-target ;lazy reference
(module-ref (resolve-interface '(gnu packages base)) 'glibc-utf8-locales)) (module-ref (resolve-interface '(gnu packages base))
'libc-utf8-locales-for-target))
(define build (define build
(with-imported-modules '((guix build utils)) (with-imported-modules '((guix build utils))
@ -1159,9 +1162,11 @@ MANIFEST. Single-file bundles are required by programs such as Git and Lynx."
;; Some file names in the NSS certificates are UTF-8 encoded so ;; Some file names in the NSS certificates are UTF-8 encoded so
;; install a UTF-8 locale. ;; install a UTF-8 locale.
(setenv "LOCPATH" (setenv "LOCPATH"
(string-append #+glibc-utf8-locales "/lib/locale/" (string-append #+(libc-utf8-locales-for-target system)
"/lib/locale/"
#+(version-major+minor #+(version-major+minor
(package-version glibc-utf8-locales)))) (package-version
(libc-utf8-locales-for-target system)))))
(setlocale LC_ALL "en_US.utf8") (setlocale LC_ALL "en_US.utf8")
(match (append-map ca-files '#$(manifest-inputs manifest)) (match (append-map ca-files '#$(manifest-inputs manifest))
@ -1999,19 +2004,21 @@ are cross-built for TARGET."
(and (derivation? drv) (gexp-input drv))) (and (derivation? drv) (gexp-input drv)))
extras)) extras))
(define glibc-utf8-locales ;lazy reference (define libc-utf8-locales-for-target ;lazy reference
(module-ref (resolve-interface '(gnu packages base)) (module-ref (resolve-interface '(gnu packages base))
'glibc-utf8-locales)) 'libc-utf8-locales-for-target))
(define set-utf8-locale (define set-utf8-locale
;; Some file names (e.g., in 'nss-certs') are UTF-8 encoded so ;; Some file names (e.g., in 'nss-certs') are UTF-8 encoded so
;; install a UTF-8 locale. ;; install a UTF-8 locale.
(let ((locales (libc-utf8-locales-for-target
(or system (%current-system)))))
#~(begin #~(begin
(setenv "LOCPATH" (setenv "LOCPATH"
#$(file-append glibc-utf8-locales "/lib/locale/" #$(file-append locales "/lib/locale/"
(version-major+minor (version-major+minor
(package-version glibc-utf8-locales)))) (package-version locales))))
(setlocale LC_ALL "en_US.utf8"))) (setlocale LC_ALL "en_US.utf8"))))
(define builder (define builder
(with-imported-modules '((guix build profiles) (with-imported-modules '((guix build profiles)

View File

@ -137,7 +137,8 @@ dependencies are registered."
;; Make sure non-ASCII file names are properly handled. ;; Make sure non-ASCII file names are properly handled.
(setenv "GUIX_LOCPATH" (setenv "GUIX_LOCPATH"
#+(file-append glibc-utf8-locales "/lib/locale")) #+(file-append (libc-utf8-locales-for-target (%current-system))
"/lib/locale"))
(setlocale LC_ALL "en_US.utf8") (setlocale LC_ALL "en_US.utf8")
(sql-schema #$schema) (sql-schema #$schema)
@ -209,7 +210,10 @@ GLIBC-UT8-LOCALES package."
(profile-locales? profile)) (profile-locales? profile))
#~(begin #~(begin
(setenv "GUIX_LOCPATH" (setenv "GUIX_LOCPATH"
#+(file-append glibc-utf8-locales "/lib/locale")) #+(file-append (let-system (system target)
(libc-utf8-locales-for-target
(or target system)))
"/lib/locale"))
(setlocale LC_ALL "en_US.utf8")) (setlocale LC_ALL "en_US.utf8"))
#~(setenv "GUIX_LOCPATH" "unset for tests"))) #~(setenv "GUIX_LOCPATH" "unset for tests")))

View File

@ -73,7 +73,10 @@
("po4a" . ,(ref 'gettext 'po4a)) ("po4a" . ,(ref 'gettext 'po4a))
("gettext-minimal" . ,(ref 'gettext 'gettext-minimal)) ("gettext-minimal" . ,(ref 'gettext 'gettext-minimal))
("gcc-toolchain" . ,(ref 'commencement 'gcc-toolchain)) ("gcc-toolchain" . ,(ref 'commencement 'gcc-toolchain))
("glibc-utf8-locales" . ,(ref 'base 'glibc-utf8-locales)) ("glibc-utf8-locales" . ,(delay
((module-ref (resolve-interface
'(gnu packages base))
'libc-utf8-locales-for-target))))
("graphviz" . ,(ref 'graphviz 'graphviz-minimal)) ("graphviz" . ,(ref 'graphviz 'graphviz-minimal))
("font-ghostscript" . ,(ref 'ghostscript 'font-ghostscript)) ("font-ghostscript" . ,(ref 'ghostscript 'font-ghostscript))
("texinfo" . ,(ref 'texinfo 'texinfo))))) ("texinfo" . ,(ref 'texinfo 'texinfo)))))

View File

@ -30,7 +30,7 @@
#:use-module (guix modules) #:use-module (guix modules)
#:use-module (guix utils) #:use-module (guix utils)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module ((gnu packages base) #:select (glibc-utf8-locales)) #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target))
#:use-module (gnu packages bootstrap) #:use-module (gnu packages bootstrap)
#:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages package-management) #:select (rpm))
#:use-module ((gnu packages compression) #:select (squashfs-tools)) #:use-module ((gnu packages compression) #:select (squashfs-tools))
@ -197,7 +197,8 @@
;; Make sure non-ASCII file names are properly ;; Make sure non-ASCII file names are properly
;; handled. ;; handled.
(setenv "GUIX_LOCPATH" (setenv "GUIX_LOCPATH"
#+(file-append glibc-utf8-locales #+(file-append
(libc-utf8-locales-for-target)
"/lib/locale")) "/lib/locale"))
(setlocale LC_ALL "en_US.utf8") (setlocale LC_ALL "en_US.utf8")

View File

@ -463,7 +463,7 @@
(target -> "arm-linux-gnueabihf") (target -> "arm-linux-gnueabihf")
(grep (package->cross-derivation packages:grep target)) (grep (package->cross-derivation packages:grep target))
(sed (package->cross-derivation packages:sed target)) (sed (package->cross-derivation packages:sed target))
(locales (package->derivation packages:glibc-utf8-locales)) (locales (package->derivation (packages:libc-utf8-locales-for-target)))
(drv (profile-derivation manifest (drv (profile-derivation manifest
#:hooks '() #:hooks '()
#:locales? #t #:locales? #t
@ -482,7 +482,7 @@
(derivation-file-name grep)) (derivation-file-name grep))
(string=? (find-input packages:sed) (string=? (find-input packages:sed)
(derivation-file-name sed)) (derivation-file-name sed))
(string=? (find-input packages:glibc-utf8-locales) (string=? (find-input (packages:libc-utf8-locales-for-target))
(derivation-file-name locales)))))) (derivation-file-name locales))))))
(test-assert "package->manifest-entry defaults to \"out\"" (test-assert "package->manifest-entry defaults to \"out\""