git: 25fe350e4e5d - main - devel/heaptrack: Port to Qt6/KF6

From: Jason E. Hale <jhale_at_FreeBSD.org>
Date: Fri, 14 Mar 2025 01:24:23 UTC
The branch main has been updated by jhale:

URL: https://cgit.FreeBSD.org/ports/commit/?id=25fe350e4e5d83b355f7dbf789ef90e8150046d7

commit 25fe350e4e5d83b355f7dbf789ef90e8150046d7
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2025-03-14 01:17:23 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2025-03-14 01:24:17 +0000

    devel/heaptrack: Port to Qt6/KF6
---
 devel/heaptrack/Makefile                           | 24 ++++++++++++++--------
 devel/heaptrack/distinfo                           |  6 +++++-
 .../heaptrack/files/patch-src_analyze_gui_gui.cpp  | 24 ++++++++++++++++++++++
 3 files changed, 44 insertions(+), 10 deletions(-)

diff --git a/devel/heaptrack/Makefile b/devel/heaptrack/Makefile
index 6e73fac586b7..a10bd3013c79 100644
--- a/devel/heaptrack/Makefile
+++ b/devel/heaptrack/Makefile
@@ -1,9 +1,13 @@
 PORTNAME=	heaptrack
 DISTVERSION=	1.5.0
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	devel kde
 MASTER_SITES=	KDE/stable/${PORTNAME}/
 
+PATCH_SITES=	https://invent.kde.org/sdk/heaptrack/-/commit/
+PATCHFILES+=	2de688e02fbc5ff96fcf29ad3af962e8035824eb.patch:-p1 # Support KChart6
+PATCHFILES+=	38fd1d7b0ff53a35ed7c4ef241c21c8c06e1efb2.patch:-p1 # Use QString for KConfigGroup names
+
 MAINTAINER=	kde@FreeBSD.org
 COMMENT=	Heap memory profiler
 WWW=		https://github.com/KDE/heaptrack
@@ -11,20 +15,22 @@ WWW=		https://github.com/KDE/heaptrack
 LICENSE=	GPLv2+
 LICENSE_FILE=	${WRKSRC}/LICENSES/GPL-2.0-or-later.txt
 
-LIB_DEPENDS=	libboost_regex.so:devel/boost-libs \
+LIB_DEPENDS=	libKChart6.so:graphics/kdiagram-qt6 \
+		libboost_regex.so:devel/boost-libs \
 		libdw.so:devel/elfutils \
 		libunwind.so:devel/libunwind \
-		libKChart.so:graphics/kdiagram \
 		libzstd.so:archivers/zstd
 
-USES=		cmake compiler:c++11-lang desktop-file-utils kde:5 localbase \
-		qt:5 tar:xz xorg
-USE_KDE=	auth codecs completion config configwidgets coreaddons i18n \
+USES=		cmake compiler:c++17-lang desktop-file-utils gl gettext-tools \
+		kde:6 localbase qt:6 tar:xz xorg
+USE_GL=		gl opengl # GLX
+USE_KDE=	colorscheme completion config configwidgets coreaddons i18n \
 		iconthemes itemmodels jobwidgets kio service solid \
-		threadweaver widgetsaddons windowsystem \
+		threadweaver widgetsaddons \
 		ecm:build
-USE_QT=		concurrent core dbus gui network svg widgets xml \
-		buildtools:build qmake:build
+USE_QT=		base svg
 USE_XORG=	x11
 
+CMAKE_ON=	HEAPTRACK_USE_QT6
+
 .include <bsd.port.mk>
diff --git a/devel/heaptrack/distinfo b/devel/heaptrack/distinfo
index 37c3c087b47f..f2a077972c2e 100644
--- a/devel/heaptrack/distinfo
+++ b/devel/heaptrack/distinfo
@@ -1,3 +1,7 @@
-TIMESTAMP = 1696092144
+TIMESTAMP = 1741909645
 SHA256 (heaptrack-1.5.0.tar.xz) = a278d9d8f91e8bfb8a1c2f5b73eecab47fd45d0693f5dbea637536413cec2ea5
 SIZE (heaptrack-1.5.0.tar.xz) = 5447668
+SHA256 (2de688e02fbc5ff96fcf29ad3af962e8035824eb.patch) = e472792c6c4966debb0a50ddc1ae564c9dc52a71603cbe98fc5c40266e3b978a
+SIZE (2de688e02fbc5ff96fcf29ad3af962e8035824eb.patch) = 2493
+SHA256 (38fd1d7b0ff53a35ed7c4ef241c21c8c06e1efb2.patch) = 4108dce8193e031b8f90ab6f70e33d0fdc1b9ffd837ccf4871cd9a06392cbb1c
+SIZE (38fd1d7b0ff53a35ed7c4ef241c21c8c06e1efb2.patch) = 2772
diff --git a/devel/heaptrack/files/patch-src_analyze_gui_gui.cpp b/devel/heaptrack/files/patch-src_analyze_gui_gui.cpp
new file mode 100644
index 000000000000..f0f539d33976
--- /dev/null
+++ b/devel/heaptrack/files/patch-src_analyze_gui_gui.cpp
@@ -0,0 +1,24 @@
+Fix build with Qt6/C++17. Follow KDE upstream trend and replace Q_DECL_UNUSED
+with the C++17 [[maybe_unused]] attribute. Heaptrack still supports Qt5, so
+keeping this local.
+
+/usr/ports/devel/heaptrack/work/heaptrack-1.5.0/src/analyze/gui/gui.cpp:26:6:
+error: 'maybe_unused' attribute cannot be applied to types
+   26 | void Q_DECL_UNUSED initRCCIconTheme()
+      |      ^
+/usr/local/include/qt6/QtCore/qcompilerdetection.h:978:27: note: expanded from macro 'Q_DECL_UNUSED'
+  978 | #  define Q_DECL_UNUSED [[maybe_unused]]
+      |                           ^
+1 error generated.
+
+--- src/analyze/gui/gui.cpp.orig	2023-09-29 17:02:09 UTC
++++ src/analyze/gui/gui.cpp
+@@ -23,7 +23,7 @@
+ #include <QResource>
+ 
+ // FIXME: patch KIconTheme so that this isn't needed here
+-void Q_DECL_UNUSED initRCCIconTheme()
++[[maybe_unused]] void initRCCIconTheme()
+ {
+     const QString iconThemeRcc = qApp->applicationDirPath() + QStringLiteral("/../share/icons/breeze/breeze-icons.rcc");
+     if (!QFile::exists(iconThemeRcc)) {