From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id +Bt8C1YhXmZGCAEAqHPOHw:P1 (envelope-from ) for ; Mon, 03 Jun 2024 22:02:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id +Bt8C1YhXmZGCAEAqHPOHw (envelope-from ) for ; Mon, 03 Jun 2024 22:02:30 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=TzD3SYaG; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1717444950; a=rsa-sha256; cv=none; b=YMq3TpJnsj+HqXpkrFNGps7Iv+Yi7uPnVYT7HKA7/Q2joXomH4gu3LTh5fqQv7a2rO0mDn BaYOIgySxYAPJP73CoJ/SA1eyv291ia5TBEpxbffLcfImodp1pz7wHvteOqfCTwrL/4Wwq jD/HAxB9KO+Y+Ka312lsKeH5O+2GNsY1cy2NxXRVH8GK9rv/kFKF934xiTicDndQfE4gPI E1+cME7Y1OBxLwGtRD/UA4U6uwvBVkpjvR7pmGnM3eYKq1hh/ITAcgCAfhmKxeCDp8cE09 OI3CCGWlw2CzUgTReN5rW/nKLi+JX7CsuMSDyeX0MwG/cJ314jnt9e/fxeyadg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=TzD3SYaG; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1717444950; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=a8lf91ZobQJGCBhi3NtcCXR2Raw3riE4tptOL6yZY+E=; b=AzeUmWvG5rujAyxWxTME6Gc5U10+9HVo091JPEq8GhETrqPny64/tP0uPVCHdme3lEg1jd s+hqKRFLwuAig2keWtQU10UMOb+rAt95vj1l/gipiGPUoDuEvODPxwa2YdMtRS6UFTrhXI 3Q8FnezMLAmeqxnbbbtyhB0k+XtvTLdW69FUqlHZbGAd3Y6arEU+87dt4vE22tOTisAhfL 1IFCVGdwfXaV9uGZx7al5JnHN1aDLvtUX5FyRmjHxjt098Dwgkg/L+jdZuY8S8YCGQE7PT OovaHtKFWuhUGGVmLA9pRkzoxdQV7Bz6ZCXDgrc+CIYxe3VOkSwmEjsE7d11pA== 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 7577515624 for ; Mon, 3 Jun 2024 22:02:29 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEDsQ-00021c-DT; Mon, 03 Jun 2024 16:01:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEDsO-00020y-0K for guix-patches@gnu.org; Mon, 03 Jun 2024 16:01:52 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEDsN-00078E-Lf for guix-patches@gnu.org; Mon, 03 Jun 2024 16:01:51 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sEDsZ-0000aF-4T; Mon, 03 Jun 2024 16:02:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71348] [PATCH 2/2] gnu: grub: Remove input labels and use gexps. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Mon, 03 Jun 2024 20:02:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71348 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71348@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Efraim Flashner , Vagrant Cascadian X-Debbugs-Original-Xcc: Efraim Flashner , Vagrant Cascadian Received: via spool by 71348-submit@debbugs.gnu.org id=B71348.17174449202218 (code B ref 71348); Mon, 03 Jun 2024 20:02:03 +0000 Received: (at 71348) by debbugs.gnu.org; 3 Jun 2024 20:02:00 +0000 Received: from localhost ([127.0.0.1]:55733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEDsV-0000Zh-3z for submit@debbugs.gnu.org; Mon, 03 Jun 2024 16:02:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEDsQ-0000Z7-Hz for 71348@debbugs.gnu.org; Mon, 03 Jun 2024 16:01:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEDs8-00076v-2I; Mon, 03 Jun 2024 16:01:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=a8lf91ZobQJGCBhi3NtcCXR2Raw3riE4tptOL6yZY+E=; b=TzD3SYaGKHewA923RgV0 zbxO1YIQUM2YbQQ5nw3kVr4GYUh/9V6hXWNd6+FEiTO6knp1bMUMc2LENNN1oggmZa8nLpjWUrtB1 rF0beyqdlh/MDCWYMtVpqzK2j02u6oI9dwf2kpZ7ZH5Gt9XuLhXoPQyt7z9zYyKlqWQkCaPpXXt5S +eSu0jqcKruEJ1ZIK8BzMsQQkW5kqkg62eR5j/ZOYKl58cIIDGKglSCNOKqJ1qV4mGjdsIlqCxsfu psQ0ap0KyYDeDwPnX0jlHOO7to5uP1JdHLpUqZN2RFF60/1TypGPil3HWo5/IbUEAdvNOKZ4yusXc bKKpmfuNMiOuow==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 3 Jun 2024 22:01:23 +0200 Message-ID: <89180e3feee011bc1f3e237aad28465838fc5e61.1717434693.git.ludo@gnu.org> X-Mailer: git-send-email 2.45.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 7577515624 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -6.24 X-Spam-Score: -6.24 X-TUID: XXX17/aVFNaT * gnu/packages/bootloaders.scm (grub)[arguments]: Use gexps. [inputs, native-inputs]: Remove labels. (grub-minimal, grub-coreboot, grub-efi, grub-efi32) (grub-hybrid): Likewise. Change-Id: I2773e6d96d170fae991d9c5db9e10196ea603371 --- gnu/packages/bootloaders.scm | 512 +++++++++++++++++------------------ 1 file changed, 254 insertions(+), 258 deletions(-) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 4e932ee3288..503c7d4a194 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -128,140 +128,140 @@ (define-public grub (("exit 99") "exit 77")))))) (build-system gnu-build-system) (arguments - `(#:configure-flags - ;; Counterintuitively, this *disables* a spurious Python dependency by - ;; calling the ‘true’ binary instead. Python is only needed during - ;; bootstrapping (for genptl.py), not when building from a release. - (list "PYTHON=true") - ;; Grub fails to load modules stripped with --strip-unneeded. - #:strip-flags '("--strip-debug" "--enable-deterministic-archives") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-stuff - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (substitute* "grub-core/Makefile.in" - (("/bin/sh") (which "sh"))) + (list #:configure-flags + ;; Counterintuitively, this *disables* a spurious Python dependency by + ;; calling the ‘true’ binary instead. Python is only needed during + ;; bootstrapping (for genptl.py), not when building from a release. + #~(list "PYTHON=true") - ;; Give the absolute file name of 'mdadm', used to determine the - ;; root file system when it's a RAID device. Failing to do that, - ;; 'grub-probe' silently fails if 'mdadm' is not in $PATH. - (when (assoc-ref inputs "mdadm") - (substitute* "grub-core/osdep/linux/getroot.c" - (("argv\\[0\\] = \"mdadm\"") - (string-append "argv[0] = \"" - (assoc-ref inputs "mdadm") - "/sbin/mdadm\"")))) + ;; GRUB fails to load modules stripped with --strip-unneeded. + #:strip-flags + #~(list "--strip-debug" "--enable-deterministic-archives") - ;; Make the font visible. - (copy-file (assoc-ref (or native-inputs inputs) - "unifont") - "unifont.bdf.gz") - (system* "gunzip" "unifont.bdf.gz") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-stuff + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (substitute* "grub-core/Makefile.in" + (("/bin/sh") (which "sh"))) - ;; Give the absolute file name of 'ckbcomp'. - (substitute* "util/grub-kbdcomp.in" - (("^ckbcomp ") - (string-append - (search-input-file inputs "/bin/ckbcomp") - " "))))) - (add-after 'unpack 'set-freetype-variables - ;; These variables need to be set to the native versions of the - ;; dependencies because they are used to build programs which are - ;; executed during build time. - (lambda* (#:key native-inputs #:allow-other-keys) - (when (assoc-ref native-inputs "freetype") - (let ((freetype (assoc-ref native-inputs "freetype"))) - (setenv "BUILD_FREETYPE_LIBS" - (string-append "-L" freetype - "/lib -lfreetype")) - (setenv "BUILD_FREETYPE_CFLAGS" - (string-append "-I" freetype - "/include/freetype2")))))) - (add-before 'check 'disable-flaky-test - (lambda _ - ;; This test is unreliable. For more information, see: - ;; . - (substitute* "Makefile.in" - (("grub_cmd_date grub_cmd_set_date grub_cmd_sleep") - "grub_cmd_date grub_cmd_sleep")))) - (add-before 'check 'disable-pixel-perfect-test - (lambda _ - ;; This test compares many screenshots rendered with an older - ;; Unifont (9.0.06) than that packaged in Guix. - (substitute* "Makefile.in" - (("test_unset grub_func_test") - "test_unset"))))) - ;; Disable tests on ARM and AARCH64 platforms or when cross-compiling. - #:tests? ,(not (or (any (cute string-prefix? <> (or (%current-target-system) - (%current-system))) - '("arm" "aarch64")) - (%current-target-system))))) + ;; Give the absolute file name of 'mdadm', used to determine the + ;; root file system when it's a RAID device. Failing to do that, + ;; 'grub-probe' silently fails if 'mdadm' is not in $PATH. + (let ((mdadm (false-if-exception + (search-input-file inputs "/sbin/mdadm")))) + (when mdadm + (substitute* "grub-core/osdep/linux/getroot.c" + (("argv\\[0\\] = \"mdadm\"") + (string-append "argv[0] = \"" mdadm "/sbin/mdadm\""))))) + + ;; Make the font visible. + (copy-file #+unifont "unifont.bdf.gz") + (system* "gunzip" "unifont.bdf.gz") + + ;; Give the absolute file name of 'ckbcomp'. + (substitute* "util/grub-kbdcomp.in" + (("^ckbcomp ") + (string-append + (search-input-file inputs "/bin/ckbcomp") + " "))))) + (add-after 'unpack 'set-freetype-variables + ;; These variables need to be set to the native versions of the + ;; dependencies because they are used to build programs which are + ;; executed during build time. + (lambda* (#:key native-inputs #:allow-other-keys) + (when (assoc-ref native-inputs "freetype") + (let ((freetype (assoc-ref native-inputs "freetype"))) + (setenv "BUILD_FREETYPE_LIBS" + (string-append "-L" freetype + "/lib -lfreetype")) + (setenv "BUILD_FREETYPE_CFLAGS" + (string-append "-I" freetype + "/include/freetype2")))))) + (add-before 'check 'disable-flaky-test + (lambda _ + ;; This test is unreliable. For more information, see: + ;; . + (substitute* "Makefile.in" + (("grub_cmd_date grub_cmd_set_date grub_cmd_sleep") + "grub_cmd_date grub_cmd_sleep")))) + (add-before 'check 'disable-pixel-perfect-test + (lambda _ + ;; This test compares many screenshots rendered with an older + ;; Unifont (9.0.06) than that packaged in Guix. + (substitute* "Makefile.in" + (("test_unset grub_func_test") + "test_unset"))))) + + ;; Disable tests on ARM and AARCH64 platforms or when cross-compiling. + #:tests? (not (or (any (cute string-prefix? <> (%current-system)) + '("arm" "aarch64")) + (%current-target-system))))) (inputs - `(("gettext" ,gettext-minimal) + (append (list gettext-minimal freetype ncurses - ;; Depend on LVM2 for libdevmapper, used by 'grub-probe' and - ;; 'grub-install' to recognize mapped devices (LUKS, etc.) - ,@(if (member (or (%current-target-system) - (%current-system)) - (package-supported-systems lvm2)) - `(("lvm2" ,lvm2)) - '()) + ;; Console-setup's ckbcomp is invoked by grub-kbdcomp. It + ;; is required for generating alternative keyboard layouts. + console-setup) - ;; Depend on mdadm, which is invoked by 'grub-probe' and 'grub-install' - ;; to determine whether the root file system is RAID. - ,@(if (member (or (%current-target-system) - (%current-system)) - (package-supported-systems mdadm)) - `(("mdadm" ,mdadm)) - '()) + ;; Depend on LVM2 for libdevmapper, used by 'grub-probe' and + ;; 'grub-install' to recognize mapped devices (LUKS, etc.) + (if (member (or (%current-target-system) + (%current-system)) + (package-supported-systems lvm2)) + (list lvm2) + '()) - ;; Console-setup's ckbcomp is invoked by grub-kbdcomp. It is required - ;; for generating alternative keyboard layouts. - ("console-setup" ,console-setup) + ;; Depend on mdadm, which is invoked by 'grub-probe' and + ;; 'grub-install' to determine whether the root file system is + ;; RAID. + (if (member (or (%current-target-system) + (%current-system)) + (package-supported-systems mdadm)) + (list mdadm) + '()) - ;; Needed for ‘grub-mount’, the only reliable way to tell whether a given - ;; file system will be readable by GRUB without rebooting. - ,@(if (member (or (%current-target-system) - (%current-system)) - (package-supported-systems fuse-2)) - `(("fuse" ,fuse-2)) - '()) - - ("freetype" ,freetype) - ;; ("libusb" ,libusb) - ("ncurses" ,ncurses))) + ;; Needed for ‘grub-mount’, the only reliable way to tell whether + ;; a given file system will be readable by GRUB without + ;; rebooting. + (if (member (or (%current-target-system) + (%current-system)) + (package-supported-systems fuse-2)) + (list fuse-2) + '()))) (native-inputs - `(("pkg-config" ,pkg-config) - ("unifont" ,unifont) - ("bison" ,bison) - ("flex" ,flex) - ("texinfo" ,texinfo) - ("help2man" ,help2man) - ("freetype" ,freetype) ;native version needed for build-grub-mkfont + (append (list pkg-config + bison + flex + texinfo + help2man + freetype ;native version needed for build-grub-mkfont - ;; XXX: When building GRUB 2.02 on 32-bit x86, we need a binutils - ;; capable of assembling 64-bit instructions. However, our default - ;; binutils on 32-bit x86 is not 64-bit capable. - ,@(if (string-match "^i[3456]86-" (%current-system)) - (let ((binutils (package/inherit - binutils - (name "binutils-i386") - (arguments - (substitute-keyword-arguments (package-arguments binutils) - ((#:configure-flags flags ''()) - `(cons "--enable-64-bit-bfd" ,flags))))))) - `(("ld-wrapper" ,(make-ld-wrapper "ld-wrapper-i386" - #:binutils binutils)) - ("binutils" ,binutils))) - '()) + ;; Dependencies of the test suite. + parted + xorriso) - ;; Dependencies for the test suite. The "real" QEMU is needed here, - ;; because several targets are used. - ("parted" ,parted) - ,@(if (member (%current-system) (package-supported-systems qemu-minimal)) - `(("qemu" ,qemu-minimal)) - '()) - ("xorriso" ,xorriso))) + ;; For the test suite, the "real" QEMU is needed because several + ;; targets are used. + (if (member (%current-system) (package-supported-systems qemu-minimal)) + (list qemu-minimal) + '()) + + ;; XXX: When building GRUB 2.02 on 32-bit x86, we need a binutils + ;; capable of assembling 64-bit instructions. However, our default + ;; binutils on 32-bit x86 is not 64-bit capable. + (if (string-match "^i[3456]86-" (%current-system)) + (let ((binutils (package/inherit + binutils + (name "binutils-i386") + (arguments + (substitute-keyword-arguments (package-arguments binutils) + ((#:configure-flags flags ''()) + `(cons "--enable-64-bit-bfd" ,flags))))))) + (list (make-ld-wrapper "ld-wrapper-i386" + #:binutils binutils) + binutils)) + '()))) (home-page "https://www.gnu.org/software/grub/") (synopsis "GRand Unified Boot loader") (description @@ -286,24 +286,21 @@ (define-public grub-minimal (delete "help2man" "texinfo" "parted" "qemu" "xorriso"))) (arguments (substitute-keyword-arguments (package-arguments grub) - ((#:configure-flags _ ''()) - '(list "PYTHON=true")) + ((#:configure-flags _ #~'()) + #~(list "PYTHON=true")) ((#:tests? _ #t) #f) - ((#:phases phases '%standard-phases) - `(modify-phases ,phases - (replace 'patch-stuff - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (substitute* "grub-core/Makefile.in" - (("/bin/sh") (which "sh"))) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (replace 'patch-stuff + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (substitute* "grub-core/Makefile.in" + (("/bin/sh") + (which "sh"))) - ;; Make the font visible. - (copy-file (assoc-ref (or native-inputs inputs) - "unifont") - "unifont.bdf.gz") - (system* "gunzip" "unifont.bdf.gz") - - #t)))))))) + ;; Make the font visible. + (copy-file #+unifont "unifont.bdf.gz") + (system* "gunzip" "unifont.bdf.gz"))))))))) (define-public grub-coreboot (package @@ -311,66 +308,62 @@ (define-public grub-coreboot (name "grub-coreboot") (synopsis "GRand Unified Boot loader (Coreboot payload version)") (arguments - `(,@(substitute-keyword-arguments (package-arguments grub) - ((#:phases phases '%standard-phases) - `(modify-phases ,phases - (add-before 'check 'disable-broken-tests - (lambda _ - (setenv "DISABLE_HARD_ERRORS" "1") - (setenv - "XFAIL_TESTS" - (string-join - ;; TODO: All the tests below use grub shell - ;; (tests/util/grub-shell.in), and here grub-shell uses - ;; QEMU and a Coreboot image to run the tests. Since we - ;; don't have a Coreboot package in Guix yet these tests - ;; are disabled. See the Guix bug #64667 for more details - ;; (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64667). - (list - "pata_test" - "ahci_test" - "uhci_test" - "ehci_test" - "example_grub_script_test" - "ohci_test" - "grub_script_eval" - "grub_script_echo1" - "grub_script_test" - "grub_script_leading_whitespace" - "grub_script_echo_keywords" - "grub_script_vars1" - "grub_script_for1" - "grub_script_while1" - "grub_script_if" - "grub_script_comments" - "grub_script_functions" - "grub_script_continue" - "grub_script_break" - "grub_script_shift" - "grub_script_blockarg" - "grub_script_return" - "grub_script_setparams" - "grub_cmd_date" - "grub_cmd_set_date" - "grub_cmd_sleep" - "grub_cmd_regexp" - "grub_cmd_test" - "grub_script_not" - "grub_cmd_echo" - "grub_script_expansion" - "grub_script_gettext" - "grub_script_escape_comma" - "help_test" - "grub_script_strcmp" - "test_sha512sum" - "grub_cmd_tr" - "test_unset" - "file_filter_test") - " ")))))) - ((#:configure-flags flags - ''()) - `(cons* "--with-platform=coreboot" - ,flags))))))) + (substitute-keyword-arguments (package-arguments grub) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-before 'check 'disable-broken-tests + (lambda _ + (setenv "DISABLE_HARD_ERRORS" "1") + (setenv "XFAIL_TESTS" + (string-join + ;; TODO: All the tests below use grub shell + ;; (tests/util/grub-shell.in), and here grub-shell uses + ;; QEMU and a Coreboot image to run the tests. Since we + ;; don't have a Coreboot package in Guix yet these tests + ;; are disabled. See the Guix bug #64667 for more details + ;; (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64667). + (list "pata_test" + "ahci_test" + "uhci_test" + "ehci_test" + "example_grub_script_test" + "ohci_test" + "grub_script_eval" + "grub_script_echo1" + "grub_script_test" + "grub_script_leading_whitespace" + "grub_script_echo_keywords" + "grub_script_vars1" + "grub_script_for1" + "grub_script_while1" + "grub_script_if" + "grub_script_comments" + "grub_script_functions" + "grub_script_continue" + "grub_script_break" + "grub_script_shift" + "grub_script_blockarg" + "grub_script_return" + "grub_script_setparams" + "grub_cmd_date" + "grub_cmd_set_date" + "grub_cmd_sleep" + "grub_cmd_regexp" + "grub_cmd_test" + "grub_script_not" + "grub_cmd_echo" + "grub_script_expansion" + "grub_script_gettext" + "grub_script_escape_comma" + "help_test" + "grub_script_strcmp" + "test_sha512sum" + "grub_cmd_tr" + "test_unset" + "file_filter_test") + " ")))))) + ((#:configure-flags flags #~'()) + #~(cons* "--with-platform=coreboot" #$flags)))))) (define-public grub-efi (package @@ -385,39 +378,38 @@ (define-public grub-efi (modify-inputs (package-native-inputs grub) (delete "parted" "qemu" "xorriso"))) (arguments - `(;; TODO: Tests need a UEFI firmware for qemu. There is one at - ;; https://github.com/tianocore/edk2/tree/master/OvmfPkg . - ;; Search for 'OVMF' in "tests/util/grub-shell.in". - ,@(substitute-keyword-arguments (package-arguments grub) - ((#:tests? _ #f) #f) - ((#:configure-flags flags ''()) - `(cons* "--with-platform=efi" - ,@(if (string-prefix? "x86_64" - (or (%current-target-system) - (%current-system))) - '("--enable-stack-protector") ; EFI-only for now - '()) - ,flags)) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'patch-stuff 'use-absolute-efibootmgr-path - (lambda* (#:key inputs #:allow-other-keys) - (substitute* "grub-core/osdep/unix/platform.c" - (("efibootmgr") - (search-input-file inputs - "/sbin/efibootmgr"))))) - (add-after 'patch-stuff 'use-absolute-mtools-path - (lambda* (#:key inputs #:allow-other-keys) - (let ((mtools (assoc-ref inputs "mtools"))) - (substitute* "util/grub-mkrescue.c" - (("\"mformat\"") - (string-append "\"" mtools - "/bin/mformat\""))) - (substitute* "util/grub-mkrescue.c" - (("\"mcopy\"") - (string-append "\"" mtools - "/bin/mcopy\""))) - #t)))))))))) + ;; TODO: Tests need a UEFI firmware for qemu. There is one at + ;; https://github.com/tianocore/edk2/tree/master/OvmfPkg . + ;; Search for 'OVMF' in "tests/util/grub-shell.in". + (substitute-keyword-arguments (package-arguments grub) + ((#:tests? _ #f) #f) + ((#:configure-flags flags #~'()) + #~(cons* "--with-platform=efi" + #$@(if (string-prefix? "x86_64" + (or (%current-target-system) + (%current-system))) + #~("--enable-stack-protector") ;EFI-only for now + #~()) + #$flags)) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'patch-stuff 'use-absolute-efibootmgr-path + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "grub-core/osdep/unix/platform.c" + (("efibootmgr") + (search-input-file inputs "/sbin/efibootmgr"))))) + (add-after 'patch-stuff 'use-absolute-mtools-path + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "util/grub-mkrescue.c" + (("\"mformat\"") + (string-append "\"" + (search-input-file inputs "/bin/mformat") + "\""))) + (substitute* "util/grub-mkrescue.c" + (("\"mcopy\"") + (string-append "\"" + (search-input-file inputs "/bin/mcopy") + "\""))))))))))) (define-public grub-efi32 (package @@ -425,17 +417,19 @@ (define-public grub-efi32 (name "grub-efi32") (synopsis "GRand Unified Boot loader (UEFI 32bit version)") (arguments - `(,@(substitute-keyword-arguments (package-arguments grub-efi) - ((#:configure-flags flags ''()) - `(cons* - ,@(cond ((target-x86?) '("--target=i386")) - ((target-aarch64?) - (list "--target=arm" - (string-append "TARGET_CC=" - (cc-for-target "arm-linux-gnueabihf")))) - ((target-arm?) '("--target=arm")) - (else '())) - ,flags))))) + (substitute-keyword-arguments (package-arguments grub-efi) + ((#:configure-flags flags #~'()) + #~(cons* #$@(cond ((target-x86?) + #~("--target=i386")) + ((target-aarch64?) + #~("--target=arm" + (string-append "TARGET_CC=" + #$(cc-for-target + "arm-linux-gnueabihf")))) + ((target-arm?) + #~("--target=arm")) + (else #~())) + #$flags)))) (native-inputs (if (target-aarch64?) (modify-inputs (package-native-inputs grub-efi) @@ -459,24 +453,26 @@ (define-public grub-hybrid (prepend grub))) (arguments (substitute-keyword-arguments (package-arguments grub-efi) - ((#:modules modules `((guix build utils) (guix build gnu-build-system))) + ((#: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 - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((input-dir (search-input-directory inputs - "/lib/grub")) - (output-dir (string-append (assoc-ref outputs "out") - "/lib/grub"))) - (for-each - (lambda (basename) - (if (not (or (string-prefix? "." basename) - (file-exists? (string-append output-dir "/" basename)))) - (symlink (string-append input-dir "/" basename) - (string-append output-dir "/" basename)))) - (scandir input-dir)) - #t))))))))) + #~(modify-phases #$phases + (add-after 'install 'install-non-efi + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((input-dir (search-input-directory inputs "/lib/grub")) + (output-dir (string-append (assoc-ref outputs "out") + "/lib/grub"))) + (for-each (lambda (basename) + (unless (or (string-prefix? "." basename) + (file-exists? (string-append + output-dir "/" + basename))) + (symlink (string-append input-dir "/" + basename) + (string-append output-dir "/" + basename)))) + (scandir input-dir))))))))))) (define-public (make-grub-efi-netboot name subdir) "Make a grub-efi-netboot package named NAME, which will be able to boot over -- 2.45.1