From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id SEenD9tNlV8xVAAA0tVLHw (envelope-from ) for ; Sun, 25 Oct 2020 10:05:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QBx6C9tNlV+kawAAB5/wlQ (envelope-from ) for ; Sun, 25 Oct 2020 10:05:15 +0000 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 BE47B9403E8 for ; Sun, 25 Oct 2020 10:05:14 +0000 (UTC) Received: from localhost ([::1]:47826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWctl-000762-KU for larch@yhetil.org; Sun, 25 Oct 2020 06:05:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWcta-00075w-57 for bug-guix@gnu.org; Sun, 25 Oct 2020 06:05:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kWctZ-0001xu-S0 for bug-guix@gnu.org; Sun, 25 Oct 2020 06:05:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kWctZ-0000dB-M6 for bug-guix@gnu.org; Sun, 25 Oct 2020 06:05:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#44196: [PATCH 3/3 v2] gnu: grub: Add locale output. Resent-From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 25 Oct 2020 10:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44196 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 44196@debbugs.gnu.org Received: via spool by 44196-submit@debbugs.gnu.org id=B44196.16036202742381 (code B ref 44196); Sun, 25 Oct 2020 10:05:01 +0000 Received: (at 44196) by debbugs.gnu.org; 25 Oct 2020 10:04:34 +0000 Received: from localhost ([127.0.0.1]:35779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWct8-0000cK-BY for submit@debbugs.gnu.org; Sun, 25 Oct 2020 06:04:34 -0400 Received: from mail-wm1-f43.google.com ([209.85.128.43]:52249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWct4-0000c6-Us for 44196@debbugs.gnu.org; Sun, 25 Oct 2020 06:04:34 -0400 Received: by mail-wm1-f43.google.com with SMTP id c194so8370062wme.2 for <44196@debbugs.gnu.org>; Sun, 25 Oct 2020 03:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=Q54umiCpUtiYNK5DKeP5+/9S6UkcKCU0GLuSGkWpfmw=; b=h5HEWqVeZ2g8PX7dFTz0ztco4bfhQult/+QlW1VxksWCzEbyB5OKVUkirRGroRb8Wk J6+ifmIMIat4th2JD+RrMsxmVvlKVEcGd6XGo6uMndhlYZ86wYTWPFZAsOOF96eaPNR+ LrPPMaK78iaeVSTRu6toUnqg/cYAUQTACmRVc3SuMiJ4pkPONYiYx/rwiYfZTOZPJn3V yGGLyURb37XHdEdt8cZYbzokxYLz3ZLw/UfQOptU2/HMJd7omFccmHirBohxe03uN58f GWECcZcpaObN7qOfZWzWCFrrkzzK1e3KOXlmD34PNZVtX0J+OhlfkXXK7jTUQDcOWBIw nAeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Q54umiCpUtiYNK5DKeP5+/9S6UkcKCU0GLuSGkWpfmw=; b=Y4jp2zYIEFNRMyZZkwuSJpM/qBLgRZq3a6MXo49++EqU5Pr6XKjAQsKWNpPzHAFzWO jpjD/xWNLK1r5Ew59WZzv362GMaeqNjWrO1CqeT7deusxv6TMbf+HY3YvWaSxChHhb5X sC2/512EfTMV4w5LaqpHGAWE8j42qrL3AMDd/89xIaDklKZFaJoZBZYP4YANI8dtqdiK 5W+qeG+fjHRke+8Xd4uGwe0ncrDgkveJ10h7KTcphwv6RWQE0Yatp5m7I0Q11ge6Lg16 TTILDDKMHgm1+gb+J39mIC0MbJ9uEQ1f/cqrLrZjxStzFb4ef8kDj6yFoiGfjmMq1FMX 43AA== X-Gm-Message-State: AOAM532nehsv9g1HPZ2LhPeG+yNMERCjQD1EZ/uV6r9+Dlt6Wi+CcaL7 cO3uIWScWgxo2wV38EoMx489k/xwadYEYg== X-Google-Smtp-Source: ABdhPJzf7anH6/QKv40bBaZY4Gqm7UAPisY/ppIdQ1/HPQ+ODtH4pLIhoEzfUsRL/4iawrlLEwZDGQ== X-Received: by 2002:a1c:5f46:: with SMTP id t67mr10578888wmb.173.1603620264890; Sun, 25 Oct 2020 03:04:24 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id z15sm16738402wrq.24.2020.10.25.03.04.23 for <44196@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 03:04:24 -0700 (PDT) From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas References: <878sbvh5j4.fsf@gmail.com> <87tuujfhum.fsf@gmail.com> Date: Sun, 25 Oct 2020 11:04:22 +0100 In-Reply-To: <87tuujfhum.fsf@gmail.com> ("Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas"'s message of "Sat, 24 Oct 2020 23:13:05 +0200") Message-ID: <87imay7hax.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -0.8 (/) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=h5HEWqVe; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: ZngyA4DjX2gC --=-=-= Content-Type: text/plain This v2 doesn't change the other patches, only this one, because it was the one I wasn't happy with. It changes from v1 as the separate output "locale" is not generated, but instead the mo files are placed into share/locale with the expected names. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-gnu-grub-Add-locale-output.patch Content-Description: 0003-gnu-grub-add-locale-output.patch >From c8aff861461b599095d55b9f694e074d433c72bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Sat, 24 Oct 2020 20:36:21 +0200 Subject: [PATCH 3/4] gnu: grub: Add locale output. * gnu/bootloader/grub.scm (define-module): Use (guix packages). (grub-configuration-file)[locale-config]: Use locale output from grub. * gnu/packages/bootloaders.scm (grub)[outputs]: Define output "locale". [arguments]: Populate "locale" output with new phase 'install-locale. --- gnu/bootloader/grub.scm | 35 ++++++++++++++++++++++++----------- gnu/packages/bootloaders.scm | 16 +++++++++++++++- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index f1479024e6..7cce9e1da7 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -25,6 +25,7 @@ (define-module (gnu bootloader grub) #:use-module (guix build union) + #:use-module (guix packages) #:use-module (guix records) #:use-module (guix store) #:use-module (guix utils) @@ -402,18 +403,30 @@ menuentry ~s { #:port #~port))) (define locale-config - #~(let ((locale #$(and locale - (locale-definition-source - (locale-name->definition locale))))) - (when locale - (format port "\ + (let* ((entry (first all-entries)) + (device (menu-entry-device entry)) + (bootloader (bootloader-configuration-bootloader config)) + (grub (bootloader-package bootloader)) + (locale-dir (normalize-file (file-append grub "/share/locale") + (menu-entry-device-mount-point entry) + store-directory-prefix))) + #~(let ((locale #$(and locale + (locale-definition-source + (locale-name->definition locale))))) + (when locale + (format port "\ # Localization configuration. -if search --file --set boot_partition /grub/grub.cfg; then - set locale_dir=(${boot_partition})/grub/locale -else - set locale_dir=/boot/grub/locale -fi -set lang=~a~%" locale)))) +~a +set locale_dir=~a +set lang=~a~%" + #$(grub-root-search device + ;; We search an auto-generated file + ;; because the locale name might not + ;; match the .mo file name. + (file-append locale-dir + "/en@quot.mo")) + #$locale-dir + locale))))) (define keyboard-layout-config (let* ((layout (bootloader-configuration-keyboard-layout config)) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 7034085d67..8057a6dd8a 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -148,7 +148,21 @@ (substitute* "Makefile.in" (("test_unset grub_func_test") "test_unset")) - #t))) + #t)) + (add-after 'install 'install-locale-for-boot + ;; Install mo files with the expected names at boot-time. + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (locale (string-append out "/share/locale"))) + (for-each (lambda (file) + (let ((mo (string-append + (basename file ".gmo") + ".mo"))) + (copy-file file + (string-append locale + "/" mo)))) + (find-files "po" "\\.gmo$")) + #t)))) ;; Disable tests on ARM and AARCH64 platforms. #:tests? ,(not (any (cute string-prefix? <> (or (%current-target-system) (%current-system))) -- 2.28.0 --=-=-=--