git: 275243143128 - main - textproc/fcitx5-configtool: Add qt6 flavor

From: Li-Wen Hsu <lwhsu_at_FreeBSD.org>
Date: Thu, 13 Mar 2025 05:27:54 UTC
The branch main has been updated by lwhsu:

URL: https://cgit.FreeBSD.org/ports/commit/?id=275243143128401c3cc9c6d382a3eeba7031d2ec

commit 275243143128401c3cc9c6d382a3eeba7031d2ec
Author:     Eric Camachat <eric@camachat.org>
AuthorDate: 2025-03-13 05:22:37 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2025-03-13 05:22:37 +0000

    textproc/fcitx5-configtool: Add qt6 flavor
    
    PR:             283406
    Approved by:    khng (implicitly)
    Sponsored by:   The FreeBSD Foundation
---
 textproc/fcitx5-configtool/Makefile  | 34 ++++++++++++++++++++++++------
 textproc/fcitx5-configtool/pkg-plist | 40 ++++++++++++++++++------------------
 2 files changed, 48 insertions(+), 26 deletions(-)

diff --git a/textproc/fcitx5-configtool/Makefile b/textproc/fcitx5-configtool/Makefile
index 701c7326efd4..a236d790a9f1 100644
--- a/textproc/fcitx5-configtool/Makefile
+++ b/textproc/fcitx5-configtool/Makefile
@@ -10,29 +10,51 @@ WWW=		https://github.com/fcitx/fcitx5-configtool
 LICENSE=	GPLv2+
 LICENSE_FILE=	${WRKSRC}/LICENSES/GPL-2.0-or-later.txt
 
-BUILD_DEPENDS=	fcitx5-qt5>=5.0.2:textproc/fcitx5-qt@qt5 \
-		fcitx5>=5.0.10:textproc/fcitx5 \
-		iso-codes>=0:misc/iso-codes
+FLAVORS?=	qt6 qt5
+FLAVOR?=	${FLAVORS:[1]}
+
+qt5_PKGNAMESUFFIX=	-qt5
+qt6_PKGNAMESUFFIX=	-qt6
+
 LIB_DEPENDS=	libFcitx5Core.so:textproc/fcitx5 \
-		libFcitx5Qt5DBusAddons.so:textproc/fcitx5-qt \
+		libFcitx5Qt${FLAVOR:S/qt//}DBusAddons.so:textproc/fcitx5-qt@${FLAVOR} \
 		libxkbcommon.so:x11/libxkbcommon
 RUN_DEPENDS=	iso-codes>=0:misc/iso-codes \
 		xkeyboard-config>=0:x11/xkeyboard-config
 
-USES=		cmake compiler:c++17-lang gettext-tools kde:5 pkgconfig qt:5 \
+USES=		cmake compiler:c++17-lang gettext-tools gl \
+		kde:${FLAVOR:S/qt//} pkgconfig qt:${FLAVOR:S/qt//} \
 		tar:zst xorg
+USE_GL=		opengl
 
 PLIST_SUB=	VER=${PORTVERSION}
 
+.if ${FLAVOR} == qt5
+
 USE_KDE=	config coreaddons ecm i18n iconthemes itemviews \
 		kdeclarative kirigami2 package plasma-framework service \
 		widgetsaddons
 USE_QT=		concurrent core dbus declarative gui widgets \
 		x11extras buildtools:build qmake:build
+CMAKE_OFF=	ENABLE_TEST USE_QT6
+PLIST_SUB+=	QT5=""
+
+.elif ${FLAVOR} == qt6
+
+LIB_DEPENDS+=	libKF6Svg.so:graphics/kf6-ksvg \
+		libKF6KCMUtilsQuick.so:devel/kf6-kcmutils
+USE_KDE=	config coreaddons ecm i18n iconthemes itemviews \
+		kdeclarative kirigami2 libplasma package service \
+		widgetsaddons
+USE_QT=		base declarative
+CMAKE_OFF=	ENABLE_TEST
+PLIST_SUB+=	QT5="@comment "
+
+.endif
+
 USE_XORG=	x11 xkbfile
 USE_LDCONFIG=	yes
 
 CMAKE_ON=	ENABLE_CONFIG_QT ENABLE_KCM
-CMAKE_OFF=	ENABLE_TEST USE_QT6
 
 .include <bsd.port.mk>
diff --git a/textproc/fcitx5-configtool/pkg-plist b/textproc/fcitx5-configtool/pkg-plist
index 2669228b808b..b6e486b67f52 100644
--- a/textproc/fcitx5-configtool/pkg-plist
+++ b/textproc/fcitx5-configtool/pkg-plist
@@ -10,26 +10,26 @@ share/applications/kbd-layout-viewer5.desktop
 share/applications/org.fcitx.fcitx5-config-qt.desktop
 share/applications/org.fcitx.fcitx5-migrator.desktop
 share/applications/kcm_fcitx5.desktop
-share/kpackage/kcms/kcm_fcitx5/contents/ui/AddIMPage.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/AddonPage.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/BoolOption.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/ColorOption.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/ConfigGroup.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/ConfigPage.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/EnumOption.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/ExternalOption.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/FontOption.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/IntegerOption.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/KeyListOption.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/KeyOption.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/ListOption.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/OptionLoader.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/SaveWarningDialog.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/SelectLayoutSheet.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/StringOption.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/main.qml
-share/kpackage/kcms/kcm_fcitx5/contents/ui/utils.js
-share/kpackage/kcms/kcm_fcitx5/metadata.json
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/AddIMPage.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/AddonPage.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/BoolOption.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/ColorOption.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/ConfigGroup.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/ConfigPage.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/EnumOption.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/ExternalOption.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/FontOption.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/IntegerOption.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/KeyListOption.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/KeyOption.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/ListOption.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/OptionLoader.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/SaveWarningDialog.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/SelectLayoutSheet.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/StringOption.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/main.qml
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/contents/ui/utils.js
+%%QT5%%share/kpackage/kcms/kcm_fcitx5/metadata.json
 share/locale/ca/LC_MESSAGES/fcitx5-configtool.mo
 share/locale/ca/LC_MESSAGES/kcm_fcitx5.mo
 share/locale/da/LC_MESSAGES/fcitx5-configtool.mo