From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 04 11:13:04 2020 Received: (at 44075) by debbugs.gnu.org; 4 Nov 2020 16:13:04 +0000 Received: from localhost ([127.0.0.1]:50362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaLPD-0006Q4-Ml for submit@debbugs.gnu.org; Wed, 04 Nov 2020 11:13:04 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaLPB-0006PS-NB for 44075@debbugs.gnu.org; Wed, 04 Nov 2020 11:13:02 -0500 Received: by mail-wr1-f65.google.com with SMTP id s9so22638728wro.8 for <44075@debbugs.gnu.org>; Wed, 04 Nov 2020 08:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=I/I0OBAld0nSsYgRyrsRgPkfVrcFgrbPfCUWxaL4L7w=; b=XZNxssHBuNdMdf5ayECSObZC0tJjh7tn04/udsyuZM8334Klfuk8mDioAf3Pz+pp1f L9b5XfqIzqQoAmyUBbfX8re8KM3kWX7GG3RaDU/oVXRpYbMf1Uen7crFErIbM4cPgTzp iQObrpdauNUfaTwnI3yBBFl4QpO8/QZTv5z1NXiYv7lIj7FX4oPhGXCV/d6ItQmQw2pL Iz2O9Xy5aYIzHAKJ2r5toJWRcJCoGJqqzSH8CioRvkzwYu1HzCjdYLADStrm58F2kCrt D/yptUTrdd8mdJRyTUNlSs4MB7QSfBhd9kVvsuQ4aiuEZmaPExkcVOLshQusixJIncSf v8Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=I/I0OBAld0nSsYgRyrsRgPkfVrcFgrbPfCUWxaL4L7w=; b=H059paWAPb/LYLkxwLXjyAjCLEGssNmSWFZN9qHJF0FHilsBrVdjbj2ijtLWRJP9QN xVAC8uWGyM6lDvqwfzvEeU5dnrx5hatEay79UYDWsPA7Hql5gSoRL9n3PxfHgbR3yBa0 yeEceiH8F0G5lWcdhlQTkNew+LMWo87h1stdZd2A/bxXm1OWQiipxf3yy+rQ7dqpU1y1 /QK+U67ov9oTtl63hcRovaDRlyfQscYv1dvwnRqrqzkHRbDo3LA7IBXUaiJLXYfwTpPm 8nzz6xjnf59AgY49rmketWLo7qLJEwK1XGq8J5i+9EPkdagAcrC6eXs7WxFHd2hMYWoI WkQw== X-Gm-Message-State: AOAM531LpKvrPYMXgBltdENki7eFoOUeXvc8PrplmGqSTmpeIMzu83g3 weWIBTPpqF1uHUIS15rOjFiLJI3P6YwDIA== X-Google-Smtp-Source: ABdhPJx7t7mMUcZ3fKu3OOxxwr52hmwUvHMOSsL+9IArFwOe4l8P5lxLMw7EOhBoBDxIWtTw2+1LrQ== X-Received: by 2002:adf:a554:: with SMTP id j20mr7840630wrb.182.1604506375406; Wed, 04 Nov 2020 08:12:55 -0800 (PST) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id i11sm1337276wro.85.2020.11.04.08.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 08:12:53 -0800 (PST) From: =?utf-8?Q?Miguel_=C3=81ngel_Arruga_Vivas?= To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#44075] [PATCH] gnu: Add make-glibc-locales-collection. References: <20201019064739.4736-1-efraim@flashner.co.il> <878sbz1p71.fsf@gnu.org> Date: Wed, 04 Nov 2020 17:12:47 +0100 In-Reply-To: <878sbz1p71.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Wed, 21 Oct 2020 19:09:06 +0200") Message-ID: <87a6vx85j4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 44075 Cc: Efraim Flashner , 44075@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hi Efraim and Ludo! This patch could be an starting point to even master, it allows to extend easily glibc-utf8-locales to the desired ones. I've used the following steps to test it[1]: ------------------------------>8---------------------------------- $ echo '(define-module (t) #:use-module (gnu packages base)) (define-public glibc-utf8-test (make-glibc-utf8-locales glibc #:locales (list "es_ES") #:name "glibc-utf8-test")) glibc-utf8-test' > tmp/t.scm $ ./pre-inst-env guix build -f tmp/t.scm $ ./pre-inst-env guix package -L tmp --show=glibc-utf8-test ------------------------------8<---------------------------------- Something like glibc-utf8--locales could be easily implemented on top of this, and I think it could be helpful for the end user too. WDYT? Happy hacking! Miguel [1] After checking that ./pre-inst-env guix build glibc-utf8-locales didn't rebuild anything at all, of course. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-base-Add-optional-locales-keyword-to-make-glibc-.patch Content-Transfer-Encoding: quoted-printable Content-Description: utf8-locales.patch From=20b0d2bfbe20a0a48a23a8dd4f14c0acce4ef5842f Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miguel=3D20=3DC3=3D81ngel=3D20Arruga=3D20Vivas?=3D Date: Wed, 4 Nov 2020 15:48:45 +0100 Subject: [PATCH] gnu: base: Add optional locales keyword to make-glibc-utf8-locales. MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/base.scm (make-glibc-utf8-locales): Add keyword parameter locales with the old value as default. [arguments]: Use locales value. Co-authored-by: Efraim Flashner Co-authored-by: Ludovic Court=C3=A8s =2D-- gnu/packages/base.scm | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index c83775d8ee..5170a77270 100644 =2D-- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -52,13 +52,16 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages gettext) + #:use-module (guix i18n) #:use-module (guix utils) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) + #:use-module (ice-9 format) #:use-module (ice-9 match) + #:use-module (ice-9 optargs) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (glibc @@ -1106,9 +1109,16 @@ to the @code{share/locale} sub-directory of this pac= kage.") ,(version-major+minor (package-version glibc))))))))))) =20 =2D(define-public (make-glibc-utf8-locales glibc) +(define %default-utf8-locales + ;; These are the locales commonly used for tests---e.g., in Guile's i18n + ;; tests. + '("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR")) +(define*-public (make-glibc-utf8-locales glibc #:key + (locales %default-utf8-locales) + (name "glibc-utf8-locales")) + (define default-locales? (equal? locales %default-utf8-locales)) (package =2D (name "glibc-utf8-locales") + (name name) (version (package-version glibc)) (source #f) (build-system trivial-build-system) @@ -1142,17 +1152,22 @@ to the @code{share/locale} sub-directory of this pa= ckage.") (symlink (string-append locale ".utf8") (string-append localedir "/" locale ".UTF-8"))) =2D =2D ;; These are the locales commonly used for =2D ;; tests---e.g., in Guile's i18n tests. =2D '("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR"= )) + ',locales) #t)))) (native-inputs `(("glibc" ,glibc) ("gzip" ,gzip))) =2D (synopsis "Small sample of UTF-8 locales") + (synopsis (if default-locales? + (P_ "Small sample of UTF-8 locales") + (P_ "Customized sample of UTF-8 locales"))) (description =2D "This package provides a small sample of UTF-8 locales mostly usefu= l in + (if default-locales? + (P_ "This package provides a small sample of UTF-8 locales mostly= useful in test environments.") + (format #f (P_ "This package provides the following UTF-8 locales: +@itemize +~{@item ~a~%~} +@end itemize~%") + locales))) (home-page (package-home-page glibc)) (license (package-license glibc)))) =20 =2D-=20 2.28.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEEiIeExBRZrMuD5+hMY0xuiXn6vsIFAl+i0v8ACgkQY0xuiXn6 vsLvVgwAlFel35w8Arwy7EwqBEGzfory3AfNvrAPaZxXsODZISybpTpyhe0ts8U5 sBXqCJddyGdNoemqXD5YStAOyCT2SgaK4XnXTX61g0Gmm/n5izcw16TusjG1dSpg MfjIqRZfsVjbe4WEjepfb1n0T6GAfU0tleqaXeiBQbcTjG8mOy1mNKS373LTR8LW Vuwhhe9vyk4n5R5RRqQqpZ0QkciY9aKVSe4kkVlOMa3utFxZhb9CMcJ2W3sZ6PWY QDD5sxgNdGle23wsp0RD0Vc2t9Akg/ERfKK5vbbqF5cFK9TzpSmzx/MUfz4vNw5L ZDYtizs//JkKupgQxLA/8gH//0CCX0TndktDNH+kM71SR3tNfVY4uVv5pKVO4+oX evu7CqDPx9hRtqzMo0D15Y8qUfuDjVqlm7CuJJjDVEwiDJW4hqoqFCtj8KwsRvIp mG/fC5fInwJn3W2wZh7jkkbwTs27LK9enAHQ6y3NEFLFvIeDNvlSP7p/Fl/ayljB TBn3+Nqa =Oa2h -----END PGP SIGNATURE----- --==-=-=--