From patchwork Wed Nov 4 16:12:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miguel Arruga Vivas X-Patchwork-Id: 24992 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8063327BBF4; Wed, 4 Nov 2020 16:18:54 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 05E3627BBF3 for ; Wed, 4 Nov 2020 16:18:54 +0000 (GMT) Received: from localhost ([::1]:55080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaLUr-0002W1-3w for patchwork@mira.cbaines.net; Wed, 04 Nov 2020 11:18:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaLQA-0002Ob-Hr for guix-patches@gnu.org; Wed, 04 Nov 2020 11:14:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:38817) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kaLQA-0006tG-5I for guix-patches@gnu.org; Wed, 04 Nov 2020 11:14:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kaLQ9-0006RZ-W6 for guix-patches@gnu.org; Wed, 04 Nov 2020 11:14:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44075] [PATCH] gnu: Add make-glibc-locales-collection. Resent-From: Miguel =?utf-8?b?w4FuZ2Vs?= Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 04 Nov 2020 16:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44075 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: Efraim Flashner , 44075@debbugs.gnu.org Received: via spool by 44075-submit@debbugs.gnu.org id=B44075.160450638424685 (code B ref 44075); Wed, 04 Nov 2020 16:14:01 +0000 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: Miguel =?utf-8?b?w4FuZ2Vs?= Arruga Vivas 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?= "'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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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. From b0d2bfbe20a0a48a23a8dd4f14c0acce4ef5842f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= 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=UTF-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ès --- 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 --- 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 package.") ,(version-major+minor (package-version glibc))))))))))) -(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 - (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 package.") (symlink (string-append locale ".utf8") (string-append localedir "/" locale ".UTF-8"))) - - ;; 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")) + ',locales) #t)))) (native-inputs `(("glibc" ,glibc) ("gzip" ,gzip))) - (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 - "This package provides a small sample of UTF-8 locales mostly useful 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)))) -- 2.28.0