Hello, > We could use a thunk field to write something like: > > --8<---------------cut here---------------start------------->8--- > (define (default-locale-libcs ...) > (if target glibc (canonical-package glibc)) > --8<---------------cut here---------------end--------------->8--- > > But I'd like to avoid that. I'll see if I can figure out something > better after a good night.
Couldn't find much better, here's a patch, tell my what you think! Thanks, Mathieu
>From e1728d6c79f63ad72bcfb4e45111ccb9f43f1251 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe <m.othac...@gmail.com> Date: Fri, 3 Jan 2020 09:23:51 +0100 Subject: [PATCH] defaut locale libc. --- gnu/system.scm | 3 ++- gnu/system/locale.scm | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index 0842bd47c7..faff0320d3 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -211,7 +211,8 @@ (locale-definitions operating-system-locale-definitions ; list of <locale-definition> (default %default-locale-definitions)) (locale-libcs operating-system-locale-libcs ; list of <packages> - (default %default-locale-libcs)) + (thunked) + (default (default-locale-libcs))) (name-service-switch operating-system-name-service-switch ; <name-service-switch> (default %default-nss)) diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm index c7a371e9bf..361c024eeb 100644 --- a/gnu/system/locale.scm +++ b/gnu/system/locale.scm @@ -37,7 +37,7 @@ locale-name->definition locale-directory - %default-locale-libcs + default-locale-libcs %default-locale-definitions glibc-supported-locales)) @@ -123,7 +123,7 @@ of LIBC." (computed-file (string-append "locale-" version) build)) (define* (locale-directory locales - #:key (libcs %default-locale-libcs)) + #:key (libcs (default-locale-libcs))) "Return a locale directory containing all of LOCALES for each libc package listed in LIBCS. @@ -145,9 +145,9 @@ data format changes between libc versions." #:options '(#:local-build? #t #:substitutable? #f)))))) -(define %default-locale-libcs - ;; The libcs for which we build locales by default. - (list glibc)) +(define* (default-locale-libcs + #:key (target (%current-target-system))) + (if target (list glibc) (list (canonical-package glibc)))) (define %default-locale-definitions ;; Arbitrary set of locales that are built by default. They are here mostly -- 2.24.1