git: 52b7582fa6f9 - main - devel/appstream-qt: flavorize for Qt5 and Qt6

From: Tobias C. Berner <tcberner_at_FreeBSD.org>
Date: Mon, 01 Jan 2024 14:43:38 UTC
The branch main has been updated by tcberner:

URL: https://cgit.FreeBSD.org/ports/commit/?id=52b7582fa6f987cb9a4edb22c9821e0c64b61665

commit 52b7582fa6f987cb9a4edb22c9821e0c64b61665
Author:     Tobias C. Berner <tcberner@FreeBSD.org>
AuthorDate: 2024-01-01 09:06:58 +0000
Commit:     Tobias C. Berner <tcberner@FreeBSD.org>
CommitDate: 2024-01-01 14:43:11 +0000

    devel/appstream-qt: flavorize for Qt5 and Qt6
    
    Approved by:    arrowd (maintainer)
---
 devel/appstream-qt/Makefile        | 21 +++++++++----
 devel/appstream-qt/pkg-plist       | 60 +++++++++++++++++++-------------------
 sysutils/plasma5-discover/Makefile |  2 +-
 3 files changed, 47 insertions(+), 36 deletions(-)

diff --git a/devel/appstream-qt/Makefile b/devel/appstream-qt/Makefile
index 427cbbff9653..c1b13a1a9902 100644
--- a/devel/appstream-qt/Makefile
+++ b/devel/appstream-qt/Makefile
@@ -1,15 +1,26 @@
-PORTREVISION=	1
-PKGNAMESUFFIX=	Qt
+PORTREVISION=	2
+PKGNAMESUFFIX=	Qt${FLAVOR:S/qt//}
 
 COMMENT?=	Qt bindings to AppStream
 
 LIB_DEPENDS=	libappstream.so:devel/appstream
 
-USES=		qt:5
+FLAVORS=	qt5 qt6
+FLAVOR?=	qt5
 
-USE_QT=		core buildtools:build qmake:build testlib:build
+USES=		qt:${FLAVOR:S/qt//}
 
-MESON_ARGS=	-Dqt5=true
+_USE_QT_qt5=	core buildtools:build qmake:build testlib:build
+_USE_QT_qt6=	base
+USE_QT=		${_USE_QT_${FLAVOR}}
+
+_MESON_ARGS_qt5=	-Dqt5=true
+_MESON_ARGS_qt6=	-Dqt=true
+MESON_ARGS=		${_MESON_ARGS_${FLAVOR}}
+
+_QT_VER_SUFFIX_qt5=	5
+_QT_VER_SUFFIX_qt6=	#
+PLIST_SUB=	QT_VER_SUFFIX=${_QT_VER_SUFFIX_${FLAVOR}}
 
 MASTERDIR=	${.CURDIR}/../appstream
 PLIST=		${.CURDIR}/pkg-plist
diff --git a/devel/appstream-qt/pkg-plist b/devel/appstream-qt/pkg-plist
index 351a20882ac7..aebf9b977979 100644
--- a/devel/appstream-qt/pkg-plist
+++ b/devel/appstream-qt/pkg-plist
@@ -1,30 +1,30 @@
-include/AppStreamQt5/appstreamqt_export.h
-include/AppStreamQt5/bundle.h
-include/AppStreamQt5/category.h
-include/AppStreamQt5/component-box.h
-include/AppStreamQt5/component.h
-include/AppStreamQt5/contentrating.h
-include/AppStreamQt5/developer.h
-include/AppStreamQt5/icon.h
-include/AppStreamQt5/image.h
-include/AppStreamQt5/launchable.h
-include/AppStreamQt5/metadata.h
-include/AppStreamQt5/pool.h
-include/AppStreamQt5/provided.h
-include/AppStreamQt5/relation-check-result.h
-include/AppStreamQt5/relation.h
-include/AppStreamQt5/release-list.h
-include/AppStreamQt5/release.h
-include/AppStreamQt5/screenshot.h
-include/AppStreamQt5/spdx.h
-include/AppStreamQt5/suggested.h
-include/AppStreamQt5/systeminfo.h
-include/AppStreamQt5/translation.h
-include/AppStreamQt5/utils.h
-include/AppStreamQt5/version.h
-include/AppStreamQt5/video.h
-lib/cmake/AppStreamQt5/AppStreamQt5Config.cmake
-lib/cmake/AppStreamQt5/AppStreamQt5ConfigVersion.cmake
-lib/libAppStreamQt5.so
-lib/libAppStreamQt5.so.1.0.0
-lib/libAppStreamQt5.so.3
+include/AppStreamQt%%QT_VER_SUFFIX%%/appstreamqt_export.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/bundle.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/category.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/component-box.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/component.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/contentrating.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/developer.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/icon.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/image.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/launchable.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/metadata.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/pool.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/provided.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/relation-check-result.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/relation.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/release-list.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/release.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/screenshot.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/spdx.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/suggested.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/systeminfo.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/translation.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/utils.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/version.h
+include/AppStreamQt%%QT_VER_SUFFIX%%/video.h
+lib/cmake/AppStreamQt%%QT_VER_SUFFIX%%/AppStreamQt%%QT_VER_SUFFIX%%Config.cmake
+lib/cmake/AppStreamQt%%QT_VER_SUFFIX%%/AppStreamQt%%QT_VER_SUFFIX%%ConfigVersion.cmake
+lib/libAppStreamQt%%QT_VER_SUFFIX%%.so
+lib/libAppStreamQt%%QT_VER_SUFFIX%%.so.1.0.0
+lib/libAppStreamQt%%QT_VER_SUFFIX%%.so.3
diff --git a/sysutils/plasma5-discover/Makefile b/sysutils/plasma5-discover/Makefile
index 6adf984da5b8..28141a51073a 100644
--- a/sysutils/plasma5-discover/Makefile
+++ b/sysutils/plasma5-discover/Makefile
@@ -9,7 +9,7 @@ WWW=		https://www.kde.org/plasma-desktop
 
 # TODO: update packagekit-qt5
 #LIB_DEPENDS=	libpackagekit-qt.so:ports-mgmt/packagekit-qt5
-LIB_DEPENDS=	libAppStreamQt5.so:devel/appstream-qt
+LIB_DEPENDS=	libAppStreamQt5.so:devel/appstream-qt@qt5
 
 USES=		cmake compiler:c++11-lib cpe desktop-file-utils gettext kde:5 \
 		pkgconfig qt:5 tar:xz xorg