From patchwork Thu Dec 7 10:22:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 57349 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 5B53E27BBEA; Thu, 7 Dec 2023 10:24:21 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7935027BBE2 for ; Thu, 7 Dec 2023 10:24:20 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBBXz-0003KU-B3; Thu, 07 Dec 2023 05:23:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBBXq-0003IT-Jn for guix-patches@gnu.org; Thu, 07 Dec 2023 05:23:50 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBBXq-0000qf-Bv for guix-patches@gnu.org; Thu, 07 Dec 2023 05:23:50 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rBBY2-0005XB-JM for guix-patches@gnu.org; Thu, 07 Dec 2023 05:24:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67686] [PATCH core-updates 2/5] gnu: glibc-utf8-locales: Generalize and use gexps. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 07 Dec 2023 10:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67686 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67686@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 67686-submit@debbugs.gnu.org id=B67686.170194460521191 (code B ref 67686); Thu, 07 Dec 2023 10:24:02 +0000 Received: (at 67686) by debbugs.gnu.org; 7 Dec 2023 10:23:25 +0000 Received: from localhost ([127.0.0.1]:41136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBBXR-0005VY-4K for submit@debbugs.gnu.org; Thu, 07 Dec 2023 05:23:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBBXO-0005Uu-HH for 67686@debbugs.gnu.org; Thu, 07 Dec 2023 05:23:22 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBBX6-0000jD-VC; Thu, 07 Dec 2023 05:23:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=f2+/BbyoT/DtobZNx3pL0z1LDDF2Y7AMEH40nL5ySkw=; b=EsmhjB/n3MIbyjSfUhjc LoPnGAAtK5oDiPo6hhFvh702nukJjUlwmvdJ7UxPgWLEGcNCTehIAzGrQlHyfbIr/TFGhIAdY3/7j YyR+CoDuPLaFosbYTtfwekIy5bN0YqW3tau65q8chFttYJARHPVh31OprdI8OFK+v0RzQ8CS/edan nv/jXs2EPFgAlJ5BoitIFhcMERZA2Zd35bUthPpNovWyX79GRiFHf687tPHRinINaT18qa0SrNcUc O8KMgHrFF3A+Mlj1DyM7ekv+sAHF6vZgXqjncC892vEZmwABG+1l6glqw28+2lyhE3MPoYoDm83RM V1JwQoUQ7WXpVw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 7 Dec 2023 11:22:45 +0100 Message-ID: <614bd1b35c61d23a3de82c292cf3f55d52b56b29.1701943221.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Previously code was dependent on the ‘name’ field of the GLIBC package. * gnu/packages/base.scm (make-glibc-utf8-locales): Use gexps. Replace references to ‘%build-inputs’ by calls to ‘which’. Replace reference to ‘version’ by (package-version this-package). Change-Id: I1e7003047aa85df74069b233191ab331b5f887b6 --- gnu/packages/base.scm | 67 +++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index b4982107b2..f95ae1b679 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -1348,47 +1348,52 @@ (define %default-utf8-locales (define*-public (make-glibc-utf8-locales glibc #:key (locales %default-utf8-locales) (name "glibc-utf8-locales")) - (define default-locales? (equal? locales %default-utf8-locales)) + (define default-locales? + (equal? locales %default-utf8-locales)) + (package (name name) (version (package-version glibc)) (source #f) (build-system trivial-build-system) (arguments - `(#:modules ((guix build utils)) - #:builder (begin - (use-modules (guix build utils)) + (list #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) - (let* ((libc (assoc-ref %build-inputs "glibc")) - (gzip (assoc-ref %build-inputs "gzip")) - (out (assoc-ref %outputs "out")) - (localedir (string-append out "/lib/locale/" - ,(version-major+minor version)))) - ;; 'localedef' needs 'gzip'. - (setenv "PATH" (string-append libc "/bin:" gzip "/bin")) + (let* ((libc (dirname + (search-input-file %build-inputs + "/bin/localedef"))) + (gzip (dirname + (search-input-file %build-inputs + "/bin/gzip"))) + (out #$output) + (localedir (string-append out "/lib/locale/" + #$(version-major+minor + (package-version this-package))))) + ;; 'localedef' needs 'gzip'. + (setenv "PATH" (string-append libc ":" gzip "")) - (mkdir-p localedir) - (for-each (lambda (locale) - (define file - ;; Use the "normalized codeset" by - ;; default--e.g., "en_US.utf8". - (string-append localedir "/" locale ".utf8")) + (mkdir-p localedir) + (for-each (lambda (locale) + (define file + ;; Use the "normalized codeset" by + ;; default--e.g., "en_US.utf8". + (string-append localedir "/" locale ".utf8")) - (invoke "localedef" "--no-archive" - "--prefix" localedir - "-i" locale - "-f" "UTF-8" file) + (invoke "localedef" "--no-archive" + "--prefix" localedir + "-i" locale + "-f" "UTF-8" file) - ;; For backward compatibility with Guix - ;; <= 0.8.3, add "xx_YY.UTF-8". - (symlink (string-append locale ".utf8") - (string-append localedir "/" - locale ".UTF-8"))) - ',locales) - #t)))) - (native-inputs - `(("glibc" ,glibc) - ("gzip" ,gzip))) + ;; For backward compatibility with Guix + ;; <= 0.8.3, add "xx_YY.UTF-8". + (symlink (string-append locale ".utf8") + (string-append localedir "/" + locale ".UTF-8"))) + '#$locales))))) + (native-inputs (list glibc gzip)) (synopsis (if default-locales? (P_ "Small sample of UTF-8 locales") (P_ "Customized sample of UTF-8 locales")))