From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:46280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJyRb-0003Gy-Ip for guix-patches@gnu.org; Fri, 26 Apr 2019 06:51:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJyRa-0001WV-D9 for guix-patches@gnu.org; Fri, 26 Apr 2019 06:51:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46594) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJyRa-0001WG-0m for guix-patches@gnu.org; Fri, 26 Apr 2019 06:51:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hJyRZ-0004Yv-Tc for guix-patches@gnu.org; Fri, 26 Apr 2019 06:51:01 -0400 Subject: [bug#35394] [PATCH 3/4] gnu: grub: Add locale output for bootloading. References: <20190423151702.05258473@gmail.com> In-Reply-To: <20190423151702.05258473@gmail.com> Resent-Message-ID: Date: Fri, 26 Apr 2019 12:50:41 +0200 From: Miguel Message-ID: <20190426125041.4bd524e0@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/FCQAfb.sL_W8crdivlyfDtL" 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_/FCQAfb.sL_W8crdivlyfDtL Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline gnu: grub: Add locale output for bootloading. * gnu/packages/bootloaders.scm (grub): Add needed modules and new output generated with new phase 'install-locale-folder. --- gnu/packages/bootloaders.scm | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) --MP_/FCQAfb.sL_W8crdivlyfDtL Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0003-gnu-grub-Add-locale-output-for-bootloading.patch >From bc6e8168155ea017aece23b3a6f099de4a2d2d47 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 for bootloading. * gnu/packages/bootloaders.scm (grub): Add needed modules and new output generated with new phase 'install-locale-folder. --- 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 b4eabaea48..e3baff267d 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-dir lang?)) + (locale-out (assoc-ref outputs "locale"))) + (mkdir-p locale-out) + (for-each (lambda (lang) + (let ((from (string-append locale "/" lang)) + (to (string-append out-path "/" + 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_/FCQAfb.sL_W8crdivlyfDtL--