From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id OOe/ApJNcmVfXQEAauVa8A:P1 (envelope-from ) for ; Thu, 07 Dec 2023 23:56:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id OOe/ApJNcmVfXQEAauVa8A (envelope-from ) for ; Thu, 07 Dec 2023 23:56:18 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D318664F35 for ; Thu, 7 Dec 2023 23:56:17 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=KmSGZ4f4; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701989778; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=f2+/BbyoT/DtobZNx3pL0z1LDDF2Y7AMEH40nL5ySkw=; b=oivL0q/YzlNzULSrNVL1z57pZuSUClPGyGDQkXKhOc9YUArrYqV29hRqMzyoj0cMSLexsL z9+eb5ZX47qqII9fO7ZxgGNWiDjxEnDo2WVvFly0kt1G/n657UMeXsYSdJJXvEdjzmWSyC xGGFke0r4wcR6g+vLB7Z7SqccF0RYzZ/Sg1qe5g7nXVf5728/fql7ltPemt/yaIPU6yqVr p8QzLmhU5XhPLvuPv0zXUYTMzp2DwRdDugeI9AQ4NQpdGnfl8UU/PYJMahwdX6d/spiEq/ z3W7L16iiN+mEFThIGCL0wgenrJpAo9GFe5MB72LpGO5OQW8qouGewKb0HCqUw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=KmSGZ4f4; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701989778; a=rsa-sha256; cv=none; b=NXHKVvaEt1HwxvTlglKORqzy0FnZCdS4Z63HfNkwXcin3xwklKuY8fJ7ERoddzFbFg4PzJ th/V8IpmuZx8sP6xGqZVUzpxA+R5c3JqNBd1fxmga9N5iWnZ9XZrFmgUAlV1WzAjH2N5wR 8RivqFZmcgm0AkXcBW4eo6h0Us8cllEnlu12sAXFXf2VKeoNXoq0LvlgZBIcrY8uilvaIE FK6bQoYT8OzB2DtClkYL4CSu48qNhm6DWmcpCZ2bHHL24rHv4ZaaqQe0Xc3i3ODAt19l7d CVSwi43slVa101tM5pDKOTRhy2yi6Vlo2HUYapFRb1v9Cnw1C5RRM4xju3+BLg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBNHg-0000UT-JY; Thu, 07 Dec 2023 17:55:56 -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 1rBNHa-0000MP-Lj for guix-patches@gnu.org; Thu, 07 Dec 2023 17:55:52 -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 1rBNHZ-0002fL-RV for guix-patches@gnu.org; Thu, 07 Dec 2023 17:55:50 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rBNHm-0006sg-3H for guix-patches@gnu.org; Thu, 07 Dec 2023 17:56:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67686] [PATCH core-updates v2 2/7] 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 22:56: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.170198971126281 (code B ref 67686); Thu, 07 Dec 2023 22:56:02 +0000 Received: (at 67686) by debbugs.gnu.org; 7 Dec 2023 22:55:11 +0000 Received: from localhost ([127.0.0.1]:43337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBNGw-0006pe-7g for submit@debbugs.gnu.org; Thu, 07 Dec 2023 17:55:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBNGt-0006ol-3N for 67686@debbugs.gnu.org; Thu, 07 Dec 2023 17:55:08 -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 1rBNGb-0002J7-6g; Thu, 07 Dec 2023 17:54:49 -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=KmSGZ4f4leMdCSznqLJi 5XLxvhI9QjS4/+7ZAm/6jFpP7453IbOptjYeV4sy64t/awbzYXZ/nQUGFfNKKjh/1oPq2c2JrrYIF ulmyGiuGyZrGIRt5MRqC5MWkUNnI46LdznM0IMCPP3u619ARR5pKLIT6lZFOQtWUQWs2OYzVMUNfp JWo5J8zbcUzjY8by+/lAvCnIC2QLP6j2w8PqFxQi62e7gYjcXnJVST0QPOuVY1axBNj0oN6IxkNc9 aImWq2Wk3ixgtIyPY9/KYRXVMxPB1WW3/XSV55yma75wRLJXiE7eMlKryqAlIaNrLLTNiiiBcCNkE yMCGliPHzqe2JQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 7 Dec 2023 23:54:05 +0100 Message-ID: <3ea04038b5842fc20281fa70288d3f94753d2174.1701989279.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: D318664F35 X-Spam-Score: -5.85 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -5.85 X-TUID: UpdXVi8RzXfK 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"))) -- 2.41.0