diff options
author | Josselin Poiret <dev@jpoiret.xyz> | 2024-05-26 16:07:33 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-08-31 10:45:04 +0200 |
commit | 56402ca868d1a1cfda402a743e59972bb4822f54 (patch) | |
tree | 8887f421715e8d3db26e1d96e58ddc7be80f67d4 /gnu/packages | |
parent | 04af0fff52fbc433e00dc392f74030a0cc6cf362 (diff) | |
download | guix-56402ca868d1a1cfda402a743e59972bb4822f54.tar.gz guix-56402ca868d1a1cfda402a743e59972bb4822f54.zip |
gnu: make-glibc-locales: Modernize.
* gnu/packages/base.scm (make-glibc-locales): Switch to G-Expressions.
Change-Id: I10efbded72c3e01261a8651fec0a7d9ea29fadad
Diffstat (limited to 'gnu/packages')
-rw-r--r-- | gnu/packages/base.scm | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index eefff3d241..e0b1687a9a 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -1385,48 +1385,47 @@ to the @code{share/locale} sub-directory of this package.") `((gnu build locale) ,@%default-gnu-imported-modules)) ((#:phases phases) - `(modify-phases ,phases - (replace 'build - (lambda _ - (invoke "make" "localedata/install-locales" - "-j" (number->string (parallel-job-count))))) - (add-after 'build 'symlink-normalized-codesets - (lambda* (#:key outputs #:allow-other-keys) - ;; The above phase does not install locales with names using - ;; the "normalized codeset." Thus, create symlinks like: - ;; en_US.utf8 -> en_US.UTF-8 - (define (locale-directory? file stat) - (and (file-is-directory? file) - (string-index (basename file) #\_) - (string-rindex (basename file) #\.))) - - (let* ((out (assoc-ref outputs "out")) - (locales (find-files out locale-directory? - #:directories? #t))) - (for-each (lambda (directory) - (let*-values (((base) - (basename directory)) - ((name codeset) - (locale->name+codeset base)) - ((normalized) - (normalize-codeset codeset))) - (unless (string=? codeset normalized) - (symlink base - (string-append (dirname directory) - "/" name "." - normalized))))) - locales)))) - (delete 'install) - (delete 'install-utf8-c-locale) - (delete 'move-static-libs))) + #~(modify-phases #$phases + (replace 'build + (lambda _ + (invoke "make" "localedata/install-locales" + "-j" (number->string (parallel-job-count))))) + (add-after 'build 'symlink-normalized-codesets + (lambda* (#:key outputs #:allow-other-keys) + ;; The above phase does not install locales with names using + ;; the "normalized codeset." Thus, create symlinks like: + ;; en_US.utf8 -> en_US.UTF-8 + (define (locale-directory? file stat) + (and (file-is-directory? file) + (string-index (basename file) #\_) + (string-rindex (basename file) #\.))) + + (let* ((locales (find-files #$output locale-directory? + #:directories? #t))) + (for-each (lambda (directory) + (let*-values (((base) + (basename directory)) + ((name codeset) + (locale->name+codeset base)) + ((normalized) + (normalize-codeset codeset))) + (unless (string=? codeset normalized) + (symlink base + (string-append (dirname directory) + "/" name "." + normalized))))) + locales)))) + (delete 'install) + (delete 'install-utf8-c-locale) + (delete 'move-static-libs))) ((#:configure-flags flags) - `(append ,flags - ;; Use $(libdir)/locale/X.Y as is the case by default. - (list (string-append "libc_cv_complocaledir=" - (assoc-ref %outputs "out") - "/lib/locale/" - ,(version-major+minor - (package-version glibc))))))))) + #~(append #$flags + ;; Use $(libdir)/locale/X.Y as is the case by default. + (list (string-append "libc_cv_complocaledir=" + #$output + "/lib/locale/" + #$(version-major+minor + (package-version glibc))))))))) (properties `((upstream-name . "glibc"))))) (define %default-utf8-locales |