git: 4851d9b21a5a - main - devel/cmake-gui: flavorize for Qt5 and Qt6

From: Tobias C. Berner <tcberner_at_FreeBSD.org>
Date: Tue, 23 Aug 2022 08:16:09 UTC
The branch main has been updated by tcberner:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4851d9b21a5a10449dbb725dd475fd10721f291d

commit 4851d9b21a5a10449dbb725dd475fd10721f291d
Author:     Tobias C. Berner <tcberner@FreeBSD.org>
AuthorDate: 2022-08-23 08:14:27 +0000
Commit:     Tobias C. Berner <tcberner@FreeBSD.org>
CommitDate: 2022-08-23 08:14:27 +0000

    devel/cmake-gui: flavorize for Qt5 and Qt6
---
 devel/cmake-gui/Makefile | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/devel/cmake-gui/Makefile b/devel/cmake-gui/Makefile
index 0bd548ae8df9..579c9d1fbc9f 100644
--- a/devel/cmake-gui/Makefile
+++ b/devel/cmake-gui/Makefile
@@ -1,8 +1,9 @@
 PORTNAME=	cmake
 DISTVERSION=	3.23.3
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	https://www.cmake.org/files/v${PORTVERSION:R}/
-PKGNAMESUFFIX=	-gui
+PKGNAMESUFFIX=	-gui-${FLAVOR}
 
 MAINTAINER=	kde@FreeBSD.org
 COMMENT=	Qt-based GUI for CMake
@@ -17,24 +18,34 @@ LIB_DEPENDS=	libcurl.so:ftp/curl \
 		libuv.so:devel/libuv \
 		librhash.so:security/rhash
 
+FLAVORS=	qt5 qt6
+FLAVOR?=	qt5
+
+qt5_CONFLICTS_INSTALL=	cmake-gui-qt6
+qt6_CONFLICTS_INSTALL=	cmake-gui-qt5
+
 USES=		cmake:run,insource compiler:c++11-lang desktop-file-utils libarchive \
-		shared-mime-info qt:5
-USE_QT=		core gui widgets buildtools_build qmake_build
-CMAKE_OFF=	BUILD_CursesDialog \
-		CMake_SPHINX_DEPEND_ON_EXECUTABLES
+		shared-mime-info qt:${FLAVOR:S/qt//}
+_USE_QT5=	core gui widgets buildtools_build qmake_build
+_USE_QT6=	base
+USE_QT=		${_USE_QT${FLAVOR:S/qt//}}
+CMAKE_ARGS=	-DCMAKE_DATA_DIR:STRING="/${DATADIR_REL}" \
+		-DCMAKE_DOC_DIR:STRING="/${DOCSDIR_REL}" \
+		-DCMake_QT_MAJOR_VERSION=${FLAVOR:S/qt//}
 CMAKE_ON=	BUILD_QtDialog \
 		CMAKE_USE_SYSTEM_LIBRARIES \
 		SPHINX_MAN
-CMAKE_ARGS=	-DCMAKE_DATA_DIR:STRING="/${DATADIR_REL}" \
-		-DCMAKE_DOC_DIR:STRING="/${DOCSDIR_REL}" \
+CMAKE_OFF=	BUILD_CursesDialog \
+		CMake_SPHINX_DEPEND_ON_EXECUTABLES
 
 ALL_TARGET=	cmake-gui documentation
+
+CXXFLAGS+=	-D__BSD_VISIBLE
+
 INSTALL_WRKSRC=	${WRKSRC}/Source/QtDialog
 
 DISTINFO_FILE=	${.CURDIR}/../cmake/distinfo
 
-CXXFLAGS+=	-D__BSD_VISIBLE
-
 post-patch:
 	@(${FIND} ${WRKSRC}/Modules -name "*.cmake" -print0; \
 		${FIND} ${WRKSRC}/Tests -name "CMakeLists.txt" -print0 ) | \