From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:48943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMXKM-0000Df-K8 for guix-patches@gnu.org; Fri, 03 May 2019 08:30:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMXKG-0004bp-Vy for guix-patches@gnu.org; Fri, 03 May 2019 08:30:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34446) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMXKF-0004a9-4d for guix-patches@gnu.org; Fri, 03 May 2019 08:30:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMXKE-00054t-Vs for guix-patches@gnu.org; Fri, 03 May 2019 08:30:03 -0400 Subject: [bug#35394] [PATCH 3/4] gnu: grub: Add locale output for bootloading. Resent-Message-ID: Date: Fri, 3 May 2019 14:27:12 +0200 From: Miguel Message-ID: <20190503142712.5604f83f@gmail.com> In-Reply-To: <20190426125041.4bd524e0@gmail.com> References: <20190426125041.4bd524e0@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/56YE/JKCNmLlV/C4pidWz6o" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 35394@debbugs.gnu.org --MP_/56YE/JKCNmLlV/C4pidWz6o Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Last patches contain a couple of problems, unbound variables are fixed in the attached patch. Commit message has been reworded. ----- gnu: grub: Add locale output. * gnu/packages/bootloaders.scm (grub): Add new phase 'install-locale-folder to generate new output used for bootloader localization. --- gnu/packages/bootloaders.scm | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) --MP_/56YE/JKCNmLlV/C4pidWz6o Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0003-gnu-grub-Add-locale-output.patch >From d8462c2b980eb8fc5eff3d97292bffea63a89ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Fri, 26 Apr 2019 11:56:43 +0200 Subject: [PATCH 3/4] gnu: grub: Add locale output. * gnu/packages/bootloaders.scm (grub): Add new phase 'install-locale-folder to generate new output used for bootloader localization. --- gnu/packages/bootloaders.scm | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 6e6e69ff3b..71411ca954 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -94,7 +94,10 @@ "grub-efi-fat-serial-number.patch")))) (build-system gnu-build-system) (arguments - `(#:phases (modify-phases %standard-phases + `(#:modules ((ice-9 ftw) + (guix build utils) + (guix build gnu-build-system)) + #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-stuff (lambda* (#:key inputs #:allow-other-keys) (substitute* "grub-core/Makefile.in" @@ -127,7 +130,30 @@ (substitute* "Makefile.in" (("grub_cmd_date grub_cmd_set_date grub_cmd_sleep") "grub_cmd_date grub_cmd_sleep")) - #t))) + #t)) + (add-after 'install 'install-locale-folder + (lambda* (#:key outputs #:allow-other-keys) + ;; XXX: Better checks are needed here + (define (lang? file) + (not (or (string=? file ".") (string=? file "..")))) + (define (make-lang-installer to) + (lambda (in-file stat flag) + (if (eq? flag 'regular) + (copy-file in-file to) + #t))) + + (let* ((out (assoc-ref outputs "out")) + (locale (string-append out "/share/locale")) + (langs (scandir locale lang?)) + (locale-out (assoc-ref outputs "locale"))) + (mkdir-p locale-out) + (for-each (lambda (lang) + (let ((from (string-append locale "/" lang)) + (to (string-append locale-out "/" + lang ".mo"))) + (ftw from (make-lang-installer to)))) + langs) + #t)))) ;; Disable tests on ARM and AARCH64 platforms. #:tests? ,(not (any (cute string-prefix? <> (or (%current-target-system) (%current-system))) @@ -183,6 +209,7 @@ ("parted" ,parted) ("qemu" ,qemu-minimal-2.10) ("xorriso" ,xorriso))) + (outputs '("out" "locale")) (home-page "https://www.gnu.org/software/grub/") (synopsis "GRand Unified Boot loader") (description @@ -249,8 +276,6 @@ menu to select one of the installed operating systems.") ,@(package-inputs grub-efi))) (arguments (substitute-keyword-arguments (package-arguments grub-efi) - ((#:modules modules `((guix build utils) (guix build gnu-build-system))) - `((ice-9 ftw) ,@modules)) ((#:phases phases) `(modify-phases ,phases (add-after 'install 'install-non-efi -- 2.21.0 --MP_/56YE/JKCNmLlV/C4pidWz6o--