commit:     07611b62174bab556022d7fe24fc6a204647afbf
Author:     WANG Xuerui <xen0n <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 25 04:13:41 2022 +0000
Commit:     WANG Xuerui <xen0n <AT> gentoo <DOT> org>
CommitDate: Mon Apr 25 10:11:12 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07611b62

sys-apps/grep: fix build on loong

Upstream has updated gnulib but hasn't tagged a new release yet, so only
add the bare minimum to fix build on loong.

This has been inside loongson-overlay for a while, and is tested on real
loong hardware.

See: https://github.com/gentoo/gentoo/pull/25189
Acked-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
Signed-off-by: WANG Xuerui <xen0n <AT> gentoo.org>

 sys-apps/grep/files/loong-fix-build.patch | 26 ++++++++++++++++++++++++++
 sys-apps/grep/grep-3.7.ebuild             |  5 ++++-
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/sys-apps/grep/files/loong-fix-build.patch 
b/sys-apps/grep/files/loong-fix-build.patch
new file mode 100644
index 000000000000..cd06fa8df5e4
--- /dev/null
+++ b/sys-apps/grep/files/loong-fix-build.patch
@@ -0,0 +1,26 @@
+From 34add045fd2ec3f1031dee961c4d9cc4285486a7 Mon Sep 17 00:00:00 2001
+From: Sun Haiyong <[email protected]>
+Date: Tue, 31 Aug 2021 11:11:52 +0800
+Subject: [PATCH] stack-direction: Add support for loongarch CPU
+
+* m4/stack-direction.m4 (SV_STACK_DIRECTION): When the CPU is loongarch,
+set "sv_cv_stack_direction" to "-1" .
+---
+ m4/stack-direction.m4 | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/m4/stack-direction.m4 b/m4/stack-direction.m4
+index 93287254b..e6c3284ce 100644
+--- a/m4/stack-direction.m4
++++ b/m4/stack-direction.m4
+@@ -32,6 +32,7 @@ AC_DEFUN([SV_STACK_DIRECTION],
+       i?86 | x86_64 | \
+       i860 | \
+       ia64 | \
++      loongarch* | \
+       m32r | \
+       m68* | \
+       m88k | \
+-- 
+2.17.2
+

diff --git a/sys-apps/grep/grep-3.7.ebuild b/sys-apps/grep/grep-3.7.ebuild
index 4f07cae885f9..b8ca4022782f 100644
--- a/sys-apps/grep/grep-3.7.ebuild
+++ b/sys-apps/grep/grep-3.7.ebuild
@@ -31,7 +31,10 @@ BDEPEND="
        nls? ( sys-devel/gettext )
        verify-sig? ( sec-keys/openpgp-keys-grep )"
 
-PATCHES=( "${FILESDIR}/ppc-musl.patch" )
+PATCHES=(
+       "${FILESDIR}/ppc-musl.patch"
+       "${FILESDIR}/loong-fix-build.patch"
+)
 
 DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO )
 

Reply via email to