From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uAAnICrkmV/ZGwAA0tVLHw (envelope-from ) for ; Wed, 28 Oct 2020 21:35:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id mMf8GyrkmV+BBgAAbx9fmQ (envelope-from ) for ; Wed, 28 Oct 2020 21:35:38 +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 ED72B9401BE for ; Wed, 28 Oct 2020 21:35:37 +0000 (UTC) Received: from localhost ([::1]:32894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXt6V-0000N0-9J for larch@yhetil.org; Wed, 28 Oct 2020 17:35:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXt5y-0000Ii-W4 for bug-guix@gnu.org; Wed, 28 Oct 2020 17:35:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39396) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXt5y-0001El-Hy for bug-guix@gnu.org; Wed, 28 Oct 2020 17:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kXt5y-0001jC-AS for bug-guix@gnu.org; Wed, 28 Oct 2020 17:35:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#44196: [PATCH v4 3/4] system: Do not depend on locale folder generated by Resent-From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 28 Oct 2020 21:35:02 +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: patch To: 44196@debbugs.gnu.org Received: via spool by 44196-submit@debbugs.gnu.org id=B44196.16039208566579 (code B ref 44196); Wed, 28 Oct 2020 21:35:02 +0000 Received: (at 44196) by debbugs.gnu.org; 28 Oct 2020 21:34:16 +0000 Received: from localhost ([127.0.0.1]:50942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXt5D-0001i3-NA for submit@debbugs.gnu.org; Wed, 28 Oct 2020 17:34:15 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:36302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXt5C-0001hq-5z for 44196@debbugs.gnu.org; Wed, 28 Oct 2020 17:34:14 -0400 Received: by mail-wr1-f47.google.com with SMTP id x7so631738wrl.3 for <44196@debbugs.gnu.org>; Wed, 28 Oct 2020 14:34:14 -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=3YhjsL3wjKMVjmRAT9dEtuxyrH/UPSEUMNTaci/wHOk=; b=cvYvJzHax/cSDNUHpA3VTiwseQpwGaTI8R1frr3V8LLD9FQlVm3+ZTMOhhy7+n+p9c poPRRza0V7YbMRWMia/GqRyuCnNzH7H+UU9GXCaHLx8Uw9yIrZItyC0nIaxxylwCkOgp zK2yswTDtY2c9TDr3MOF5WXOwLmTayWWa6Xq3uzt4qh/cuxamKlIEok8VqtpcXa6QcJa iYDyummts70zrtzDq3C/RNr25zuY8ebY4+7xghoBUPYnl1skFFEUQqPg4Hxx1uxnJxzF tdKMVVAfroyxQ84gmbcLEKn2posa2cVX75YUh8A/zcRICrh4eXL8weDEqGYuf3U7iwKs PROg== 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=3YhjsL3wjKMVjmRAT9dEtuxyrH/UPSEUMNTaci/wHOk=; b=MwZW8lzf6e1WTA8ub9GUXmHI7QgeX7EZ69aPmU11py3wNzeSd8FjUW0sC8q6x5BhL7 hzsyTIrKs0zBRWKf4kEqYg73wQBE3VPgmXnWjwu0ctWJ0p78FXL9+G1NWzwaGWvyUsjv z6jz+lD+PBHZlUkZHTVSVPvC0tC1gDE32pGuvEbOnGA474FSkcshhBJjzYHHYMI+IupJ Hm1qFx2XmCRcMm134HySlB2dVdO8UF+4XW+TtWw5FBDm4Kwsfp1Og0ao3RwI/nRm2hD3 oLatDYXU/j3m1JUN5UiKNQ8O5tk5/XjP1NIwEMPM14F+vuawe59TTJKX3+M8I9r2Y+qT TXZQ== X-Gm-Message-State: AOAM533+86wd3f/cXoEaundetG+6rFqUXiDtpXK0LeRc6VMfYL/6gWks 7CmUDmckUiUjynf3/D/cD/VvhpDXYiabvQ== X-Google-Smtp-Source: ABdhPJyXfw2FvV59wE+64MPqxU7yHUV2dxpODDRfj0IiwX1pIoWC4Nnlx3irqyJF3IQUWGxLWjBvPg== X-Received: by 2002:adf:edcf:: with SMTP id v15mr1406139wro.291.1603920847951; Wed, 28 Oct 2020 14:34:07 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id z14sm988378wmc.15.2020.10.28.14.34.06 for <44196@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 14:34:06 -0700 (PDT) From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas References: <878sbvh5j4.fsf@gmail.com> <87tuujfhum.fsf@gmail.com> <87imay7hax.fsf_-_@gmail.com> <87y2jsod97.fsf_-_@gmail.com> Date: Wed, 28 Oct 2020 22:34:05 +0100 In-Reply-To: <87y2jsod97.fsf_-_@gmail.com> ("Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas"'s message of "Mon, 26 Oct 2020 23:04:20 +0100") Message-ID: <87v9eum3w2.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=cvYvJzHa; 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: Q2SJWhOmO8tJ --=-=-= Content-Type: text/plain Sorry, the last one didn't generate correctly the locale folder for two reasons: wrong name for the .mo name, and incomplete path. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v4-0003-system-Do-not-depend-on-locale-folder-generated-b.patch Content-Description: v4-0003-system-do-not-depend-on-locale-folder.patch >From 37ef6594c6db00595b4e3aec6bcaec3eb9b4e1cf 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 v4 3/5] system: Do not depend on locale folder generated by grub-install. * gnu/bootloader/grub.scm (define-module): Use (guix packages). (grub-locale-folder): New computed folder. (grub-configuration-file)[locale-config]: Use grub-locale-folder only when a locale is needed. --- gnu/bootloader/grub.scm | 49 ++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index f1479024e6..1fe09d01c1 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) @@ -142,6 +143,24 @@ file with the resolution provided in CONFIG." (image->png image #:width width #:height height)) (_ #f))))) +(define (grub-locale-folder grub) + "Generate a folder with the locales from GRUB." + (define builder + #~(begin + (use-modules (ice-9 ftw)) + (let ((locale (string-append #$grub "/share/locale")) + (out #$output)) + (mkdir out) + (chdir out) + (for-each (lambda (lang) + (let ((file (string-append locale "/" lang + "/LC_MESSAGES/grub.mo")) + (dest (string-append lang ".mo"))) + (when (file-exists? file) + (copy-file file dest)))) + (scandir locale))))) + (computed-file "grub-boot-locale" builder)) + (define* (eye-candy config store-device store-mount-point #:key store-directory-prefix port) "Return a gexp that writes to PORT (a port-valued gexp) the 'grub.cfg' part @@ -402,18 +421,26 @@ 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)) + (mount-point (menu-entry-device-mount-point entry)) + (bootloader (bootloader-configuration-bootloader config)) + (grub (bootloader-package bootloader)) + (locale-dir (grub-locale-folder grub))) + + #~(let ((locale #$(and locale + (locale-definition-source + (locale-name->definition locale)))) + (locale-dir #$(and locale (grub-locale-folder grub)))) + (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)))) +search --file --set ~a +set locale_dir=~a +set lang=~a~%" + (string-append locale-dir "/es@quot.mo") + locale-dir + locale))))) (define keyboard-layout-config (let* ((layout (bootloader-configuration-keyboard-layout config)) -- 2.28.0 --=-=-=--