git: 30d01a77b1ff - main - emulators/qemu: fix build on powerpc64

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Wed, 27 Apr 2022 13:40:05 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=30d01a77b1ff0377c47919c3982d161e7546d34f

commit 30d01a77b1ff0377c47919c3982d161e7546d34f
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2022-04-27 13:21:01 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2022-04-27 13:21:01 +0000

    emulators/qemu: fix build on powerpc64
    
    bsd-user disabled because of no bsd-user/host/ppc64.
---
 emulators/qemu/Makefile  | 8 ++++++--
 emulators/qemu/pkg-plist | 6 +++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile
index 7a009d772d4e..44097753b44d 100644
--- a/emulators/qemu/Makefile
+++ b/emulators/qemu/Makefile
@@ -13,10 +13,10 @@ COMMENT=	QEMU CPU Emulator ${${FLAVOR}_COMMENT}
 LICENSE=	GPLv2
 
 .if ${FLAVOR:U} != tools
-ONLY_FOR_ARCHS=	amd64
+ONLY_FOR_ARCHS=	amd64 powerpc64
 # We need to check if it build with other ARCHS
 # For i386 we have unknown type name 'vm_page_t'
-# ONLY_FOR_ARCHS=	powerpc powerpc64 powerpc64 powerpc64le
+# ONLY_FOR_ARCHS=	powerpc64le
 .endif
 
 BUILD_DEPENDS=	bash:shells/bash
@@ -211,7 +211,11 @@ USE_GCC=	yes
 .endif
 
 .if ${ARCH} == "powerpc64"
+CONFIGURE_ARGS+=	--disable-bsd-user
 MAKE_ARGS+=	ARCH=ppc64
+PLIST_SUB+=	BSDUSER="@comment "
+.else
+PLIST_SUB+=	BSDUSER=""
 .endif
 
 .if ${ARCH} == "sparc64"
diff --git a/emulators/qemu/pkg-plist b/emulators/qemu/pkg-plist
index c6e08a30d47b..00d0673675ba 100644
--- a/emulators/qemu/pkg-plist
+++ b/emulators/qemu/pkg-plist
@@ -1,7 +1,7 @@
 %%CURL%%bin/elf2dmp
-%%NO_X86_TARGETS%%bin/qemu-arm
+%%BSDUSER%%%%NO_X86_TARGETS%%bin/qemu-arm
 bin/qemu-edid
-bin/qemu-i386
+%%BSDUSER%%bin/qemu-i386
 bin/qemu-img
 bin/qemu-io
 %%GTK3%%bin/qemu-keymap
@@ -37,7 +37,7 @@ bin/qemu-system-i386
 bin/qemu-system-x86_64
 %%NO_X86_TARGETS%%bin/qemu-system-xtensa
 %%NO_X86_TARGETS%%bin/qemu-system-xtensaeb
-bin/qemu-x86_64
+%%BSDUSER%%bin/qemu-x86_64
 include/qemu-plugin.h
 %%PORTDOCS%%man/man1/qemu.1.gz
 %%PORTDOCS%%man/man1/qemu-img.1.gz