From patchwork Thu Feb 14 22:21:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 1090 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 6F26016C42; Thu, 14 Feb 2019 22:22:15 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 34C2116C2C for ; Thu, 14 Feb 2019 22:22:15 +0000 (GMT) Received: from localhost ([127.0.0.1]:56035 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guPOY-0004rO-R3 for patchwork@mira.cbaines.net; Thu, 14 Feb 2019 17:22:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guPOQ-0004oC-BZ for guix-patches@gnu.org; Thu, 14 Feb 2019 17:22:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guPOM-0007bj-K7 for guix-patches@gnu.org; Thu, 14 Feb 2019 17:22:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49176) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guPOL-0007b9-Tr for guix-patches@gnu.org; Thu, 14 Feb 2019 17:22:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1guPOL-00076J-Nr for guix-patches@gnu.org; Thu, 14 Feb 2019 17:22:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34480] [PATCH 1/2] self: Bundle 'glibc-utf8-locales'. References: <20190214221715.10714-1-ludo@gnu.org> In-Reply-To: <20190214221715.10714-1-ludo@gnu.org> Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 14 Feb 2019 22:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34480 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34480@debbugs.gnu.org Received: via spool by 34480-submit@debbugs.gnu.org id=B34480.155018289627258 (code B ref 34480); Thu, 14 Feb 2019 22:22:01 +0000 Received: (at 34480) by debbugs.gnu.org; 14 Feb 2019 22:21:36 +0000 Received: from localhost ([127.0.0.1]:48455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1guPNw-00075Z-GP for submit@debbugs.gnu.org; Thu, 14 Feb 2019 17:21:36 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:59488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1guPNu-00075L-QM for 34480@debbugs.gnu.org; Thu, 14 Feb 2019 17:21:35 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 6B033FCEA; Thu, 14 Feb 2019 23:21:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z5c9KYFbMEg2; Thu, 14 Feb 2019 23:21:32 +0100 (CET) Received: from gnu.org (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 26135FCC7; Thu, 14 Feb 2019 23:21:32 +0100 (CET) From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 14 Feb 2019 23:21:19 +0100 Message-Id: <20190214222120.10914-1-ludo@gnu.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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 This minimizes the risk of locale-related warnings, at least for those who use one of the bundled UTF-8 locales. * guix/self.scm (guix-command)[glibc-utf8-locales]: New variable. In program body, set GUIX_LOCPATH. --- guix/self.scm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/guix/self.scm b/guix/self.scm index a45470a0a6..bcf04a1b28 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -390,6 +390,10 @@ that provide Guile modules." guile (guile-version (effective-version))) "Return the 'guix' command such that it adds MODULES and DEPENDENCIES in its load path." + (define glibc-utf8-locales + (module-ref (resolve-interface '(gnu packages base)) + 'glibc-utf8-locales)) + (define module-directory ;; To minimize the number of 'stat' calls needed to locate a module, ;; create the union of all the module directories. @@ -410,6 +414,16 @@ load path." "/site-ccache") %load-compiled-path)) + ;; To maximize the chances that locales are set up right + ;; out-of-the-box, bundle "common" UTF-8 locales. + (let ((locpath (getenv "GUIX_LOCPATH"))) + (setenv "GUIX_LOCPATH" + (string-append (if locpath + (string-append locpath ":") + "") + #$(file-append glibc-utf8-locales + "/lib/locale")))) + (let ((guix-main (module-ref (resolve-interface '(guix ui)) 'guix-main))) #$(if source From patchwork Thu Feb 14 22:21:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 1089 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 7DDF316C42; Thu, 14 Feb 2019 22:22:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 456AF16C2C for ; Thu, 14 Feb 2019 22:22:10 +0000 (GMT) Received: from localhost ([127.0.0.1]:56029 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guPOT-0004oB-LN for patchwork@mira.cbaines.net; Thu, 14 Feb 2019 17:22:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guPOO-0004o5-KH for guix-patches@gnu.org; Thu, 14 Feb 2019 17:22:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guPOM-0007bd-Ji for guix-patches@gnu.org; Thu, 14 Feb 2019 17:22:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49177) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guPOM-0007bU-Cr for guix-patches@gnu.org; Thu, 14 Feb 2019 17:22:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1guPOM-00076Q-79 for guix-patches@gnu.org; Thu, 14 Feb 2019 17:22:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34480] [PATCH 2/2] gnu: guix: Embed 'glibc-utf8-locales'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 14 Feb 2019 22:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34480 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34480@debbugs.gnu.org Received: via spool by 34480-submit@debbugs.gnu.org id=B34480.155018289727265 (code B ref 34480); Thu, 14 Feb 2019 22:22:02 +0000 Received: (at 34480) by debbugs.gnu.org; 14 Feb 2019 22:21:37 +0000 Received: from localhost ([127.0.0.1]:48457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1guPNw-00075b-RQ for submit@debbugs.gnu.org; Thu, 14 Feb 2019 17:21:37 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:59492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1guPNu-00075M-Mn for 34480@debbugs.gnu.org; Thu, 14 Feb 2019 17:21:35 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id AF283FCC7; Thu, 14 Feb 2019 23:21:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1Erh1cnxaWVZ; Thu, 14 Feb 2019 23:21:32 +0100 (CET) Received: from gnu.org (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 80ADAFCC8; Thu, 14 Feb 2019 23:21:32 +0100 (CET) From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 14 Feb 2019 23:21:20 +0100 Message-Id: <20190214222120.10914-2-ludo@gnu.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190214222120.10914-1-ludo@gnu.org> References: <20190214222120.10914-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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 This will ensure people who download the binary installation tarball do not get locale-related warnings, provided they use one of the selected UTF-8 locales. * gnu/packages/package-management.scm (guix)[arguments]: In 'wrap-program' phase, set GUIX_LOCPATH. [inputs]: Add GLIBC-UTF8-LOCALES. --- gnu/packages/package-management.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index af9667cd91..e283df65f8 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -33,6 +33,7 @@ #:use-module (gnu packages avahi) #:use-module (gnu packages autotools) #:use-module (gnu packages backup) + #:use-module (gnu packages base) #:use-module (gnu packages bdw-gc) #:use-module (gnu packages bison) #:use-module (gnu packages bootstrap) ;for 'bootstrap-guile-origin' @@ -227,6 +228,7 @@ "guile-bytestructures")) (ssh (assoc-ref inputs "guile-ssh")) (gnutls (assoc-ref inputs "gnutls")) + (locales (assoc-ref inputs "glibc-utf8-locales")) (deps (list gcrypt json sqlite gnutls git bs ssh)) (effective @@ -245,11 +247,13 @@ "/lib/guile/" effective "/site-ccache") (delete #f deps)) - ":"))) + ":")) + (locpath (string-append locales "/lib/locale"))) (wrap-program (string-append out "/bin/guix") `("GUILE_LOAD_PATH" ":" prefix (,path)) - `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath))) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath)) + `("GUIX_LOCPATH" ":" suffix (,locpath))) #t)))))) (native-inputs `(("pkg-config" ,pkg-config) @@ -282,7 +286,9 @@ ,@(if (and (not (%current-target-system)) (string=? (%current-system) "x86_64-linux")) `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux"))) - '()))) + '()) + + ("glibc-utf8-locales" ,glibc-utf8-locales))) (propagated-inputs `(("gnutls" ,gnutls) ("guile-gcrypt" ,guile-gcrypt)