commit:     479e28d16934ab9bd9514bf2457be775473bfe79
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 30 18:32:21 2025 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Oct 30 18:34:14 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=479e28d1

sys-boot/grub: fix build with dash as /bin/sh

Closes: https://bugs.gentoo.org/965315
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 ...grub-2.14_rc1-configure.ac-avoid-bashisms.patch | 46 ++++++++++++++++++++++
 sys-boot/grub/grub-2.14_rc1.ebuild                 |  3 +-
 2 files changed, 48 insertions(+), 1 deletion(-)

diff --git 
a/sys-boot/grub/files/grub-2.14_rc1-configure.ac-avoid-bashisms.patch 
b/sys-boot/grub/files/grub-2.14_rc1-configure.ac-avoid-bashisms.patch
new file mode 100644
index 000000000000..f25b94c99ed2
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.14_rc1-configure.ac-avoid-bashisms.patch
@@ -0,0 +1,46 @@
+https://bugs.gentoo.org/965315
+
+From 5196d40b6ec6ad75e84ab98e9f4a3d71211f0d56 Mon Sep 17 00:00:00 2001
+From: Lars Wendler <[email protected]>
+Date: Thu, 30 Oct 2025 07:31:59 +0100
+Subject: [PATCH] configure.ac: avoid bashisms
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+or else configure check doesn't succeed with non-bash shell (e.g. dash):
+
+  checking whether to enable AMD64 as(1) feature detection... 
/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/configure: 39176: 
test: xx86_64: unexpected operator
+  no
+
+and later build fails with
+
+  
/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/grub-core/lib/libgcrypt-grub/src/hwf-x86.c:
 In function ‘detect_x86_gnuc’:
+  
/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/grub-core/lib/libgcrypt-grub/src/hwf-x86.c:252:17:
 error: ‘HWF_INTEL_CPU’ undeclared (first use in this function)
+    252 |       result |= HWF_INTEL_CPU;
+        |                 ^~~~~~~~~~~~~
+
+and other corresponding HWF_INTEL_* definitions because HAVE_CPU_ARCH_X86 was
+erroneously not defined by configure script.
+
+Signed-off-by: Lars Wendler <[email protected]>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8a72c078e..17937baf4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1150,7 +1150,7 @@ fi
+ 
+ # Implementation of the --disable-amd64-as-feature-detection switch.
+ AC_MSG_CHECKING([whether to enable AMD64 as(1) feature detection])
+-if test x$target_cpu == xx86_64 -a x$platform == xefi; then
++if test x$target_cpu = xx86_64 -a x$platform = xefi; then
+   CPPFLAGS_GCRY_ASM="-D__x86_64 -DHAVE_CPU_ARCH_X86"
+   AC_ARG_ENABLE(amd64-as-feature-detection,
+     AS_HELP_STRING([--disable-amd64-as-feature-detection],
+-- 
+2.51.1
+

diff --git a/sys-boot/grub/grub-2.14_rc1.ebuild 
b/sys-boot/grub/grub-2.14_rc1.ebuild
index 4ff9024e4726..0ba443e62ba1 100644
--- a/sys-boot/grub/grub-2.14_rc1.ebuild
+++ b/sys-boot/grub/grub-2.14_rc1.ebuild
@@ -16,8 +16,8 @@ EAPI=8
 # If any of the above applies to a user patch, the user should set the
 # corresponding variable in make.conf or the environment.
 
+GRUB_AUTORECONF=1
 if [[ ${PV} == 9999  ]]; then
-       GRUB_AUTORECONF=1
        GRUB_BOOTSTRAP=1
 fi
 
@@ -67,6 +67,7 @@ PATCHES=(
        "${FILESDIR}"/gfxpayload.patch
        "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
        "${FILESDIR}"/grub-2.06-test-words.patch
+       "${FILESDIR}"/grub-2.14_rc1-configure.ac-avoid-bashisms.patch
 )
 
 DEJAVU_VER=2.37

Reply via email to