git: 5195f55b0806 - main - devel/iaito: add flavors qt5 and qt6, default qt6

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Sun, 11 Aug 2024 12:31:42 UTC
The branch main has been updated by vvd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5195f55b0806ef5d0775e3ff93a6782a6c0b469c

commit 5195f55b0806ef5d0775e3ff93a6782a6c0b469c
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2024-08-11 12:27:12 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-08-11 12:27:12 +0000

    devel/iaito: add flavors qt5 and qt6, default qt6
    
    Add patch build flavor qt6 if qt5 is installed too.
    Upstream issue: https://github.com/radareorg/iaito/issues/173
    
    PR:             278339
    Approved by:    Martin Filla <freebsd@sysctl.cz> (maintainer)
---
 devel/iaito/Makefile              | 23 ++++++++++++++++++++---
 devel/iaito/files/patch-configure | 11 +++++++++++
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/devel/iaito/Makefile b/devel/iaito/Makefile
index eef31254152c..2ef3c90f5acd 100644
--- a/devel/iaito/Makefile
+++ b/devel/iaito/Makefile
@@ -11,12 +11,29 @@ LICENSE=	GPLv3
 LIB_DEPENDS=	libcapstone.so:devel/capstone \
 		libr_core.so:devel/radare2
 
-USES=		desktop-file-utils gl gmake pkgconfig qmake:no_configure qt:5
+FLAVORS=		qt5 qt6
+FLAVOR?=		${FLAVORS:[2]}
+qt5_PKGNAMESUFFIX=	-qt5
+qt6_PKGNAMESUFFIX=	-qt6
+
+USES=		compiler:c++17-lang desktop-file-utils gl gmake pkgconfig \
+		qmake:no_configure
 USE_GITHUB=	yes
 GH_ACCOUNT=	radareorg
-USE_GL=		gl
-USE_QT=		buildtools core gui linguisttools:build network svg widgets
 GNU_CONFIGURE=	yes
+
+.if ${FLAVOR} == qt5
+USES+=		qt:5
+USE_GL=		gl
+USE_QT=		core gui network svg widgets \
+		buildtools:build linguisttools:build qmake:build
+.else
+USES+=		qt:6
+USE_GL=		opengl
+USE_QT=		base svg
+CONFIGURE_ARGS=	--with-qmake6
+.endif
+
 MAKE_ENV=	DESTDIR=${STAGEDIR}${PREFIX} \
 		QMAKE_FLAGS="PREFIX=${STAGEDIR}${PREFIX}"
 
diff --git a/devel/iaito/files/patch-configure b/devel/iaito/files/patch-configure
new file mode 100644
index 000000000000..8b0ba0dce3f1
--- /dev/null
+++ b/devel/iaito/files/patch-configure
@@ -0,0 +1,11 @@
+--- configure.orig	2024-05-24 00:09:14 UTC
++++ configure
+@@ -470,7 +470,7 @@ QMAKE=""; fi
+ fi ; fi
+ if [ "$WANT_QMAKE6" = "1" ]; then
+ QMAKE=""; fi
+-if [ "$HAVE_QMAKE" = "1" ]; then
++if [ "$HAVE_QMAKE" = "1" -a "$WANT_QMAKE6" != "1" ]; then
+ QMAKE_BIN="${QMAKE}"
+ else
+ if [ "$HAVE_QMAKE6" = "1" ]; then