git: b82c5afad0fe - main - graphics/kolourpaint: Move palattes to app-specific dir

From: Jason E. Hale <jhale_at_FreeBSD.org>
Date: Sun, 17 Aug 2025 13:30:20 UTC
The branch main has been updated by jhale:

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

commit b82c5afad0fe585308d8b35bef32b0dea9832aab
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2025-08-17 11:53:29 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2025-08-17 13:29:22 +0000

    graphics/kolourpaint: Move palattes to app-specific dir
    
    In kolourpaint 25.8.0, the color palatte files originally shipped with
    devel/kf5-kdelibs4support were added to the source to fix [1], but were
    erroneously installed into a global location [2].
    
    While [1] has been crudely resoloved, [2] has not yet been addressed.
    The kde@ team has determined [2] to be the most sensible way to move
    forward to mitigate conflicts between graphics/kolorpaint and
    devel/kf5-kdelibs4support.
    
    While here:
    Pet portclippy(1)
    Remove unneeded deps
    
    [1] https://bugs.kde.org/show_bug.cgi?id=501341
    [2] https://bugs.kde.org/show_bug.cgi?id=507007
---
 graphics/kolourpaint/Makefile                      | 16 +++++++--------
 graphics/kolourpaint/files/patch-CMakeLists.txt    | 24 ++++++++++++++++++++++
 .../files/patch-lgpl_generic_kpColorCollection.cpp | 24 ++++++++++++++++++++++
 graphics/kolourpaint/pkg-plist                     | 10 ++++-----
 4 files changed, 61 insertions(+), 13 deletions(-)

diff --git a/graphics/kolourpaint/Makefile b/graphics/kolourpaint/Makefile
index 30f06b00a03e..5650ceaffbc8 100644
--- a/graphics/kolourpaint/Makefile
+++ b/graphics/kolourpaint/Makefile
@@ -1,22 +1,22 @@
 PORTNAME=	kolourpaint
 DISTVERSION=	${KDE_APPLICATIONS_VERSION}
+PORTREVISION=	1
 CATEGORIES=	graphics kde kde-applications
 
 MAINTAINER=	kde@FreeBSD.org
 COMMENT=	KDE paint program
 WWW=		http://www.kolourpaint.org
 
-USES=		cmake compiler:c++11-lang desktop-file-utils gettext kde:6 \
-		qt:6 tar:xz xorg
-USE_KDE=	auth bookmarks codecs completion config configwidgets \
-		coreaddons crash guiaddons i18n iconthemes itemmodels \
-		itemviews jobwidgets kio libkexiv2 libksane notifications \
-		parts service solid sonnet textwidgets unitconversion \
-		widgetsaddons windowsystem xmlgui \
+USES=		cmake compiler:c++17-lang desktop-file-utils gettext-tools gl \
+		kde:6 qt:6 tar:xz xorg
+USE_GL=		opengl
+USE_KDE=	bookmarks colorscheme completion config configwidgets \
+		coreaddons crash guiaddons i18n itemviews jobwidgets kio \
+		libksane service solid widgetsaddons xmlgui \
 		ecm:build
+USE_LDCONFIG=	yes
 USE_QT=		base
 USE_XORG=	x11
-USE_LDCONFIG=	yes
 
 OPTIONS_DEFINE=	DOCS
 
diff --git a/graphics/kolourpaint/files/patch-CMakeLists.txt b/graphics/kolourpaint/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..2e6df0d40d0d
--- /dev/null
+++ b/graphics/kolourpaint/files/patch-CMakeLists.txt
@@ -0,0 +1,24 @@
+Remove unused TextWidgets.
+Don't globally install color palettes only used by this application.
+
+Ref: https://invent.kde.org/graphics/kolourpaint/-/merge_requests/79
+
+--- CMakeLists.txt.orig	2025-08-07 03:21:56 UTC
++++ CMakeLists.txt
+@@ -39,7 +39,6 @@ find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS
+     WidgetsAddons
+     KIO
+     XmlGui
+-    TextWidgets
+     JobWidgets
+     Crash
+ )
+@@ -368,7 +367,7 @@ install(FILES org.kde.kolourpaint.appdata.xml DESTINAT
+ 
+ install(PROGRAMS org.kde.kolourpaint.desktop DESTINATION ${KDE_INSTALL_APPDIR})
+ install(FILES org.kde.kolourpaint.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
+-install(DIRECTORY colors DESTINATION ${KDE_INSTALL_CONFDIR})
++install(DIRECTORY colors DESTINATION ${KDE_INSTALL_DATADIR}/kolourpaint)
+ 
+ if(BUILD_DOC)
+     add_subdirectory(doc)
diff --git a/graphics/kolourpaint/files/patch-lgpl_generic_kpColorCollection.cpp b/graphics/kolourpaint/files/patch-lgpl_generic_kpColorCollection.cpp
new file mode 100644
index 000000000000..8c471bb27858
--- /dev/null
+++ b/graphics/kolourpaint/files/patch-lgpl_generic_kpColorCollection.cpp
@@ -0,0 +1,24 @@
+Don't globally install color palettes only used by this application.
+
+Ref: https://invent.kde.org/graphics/kolourpaint/-/merge_requests/79
+
+--- lgpl/generic/kpColorCollection.cpp.orig	2025-08-07 03:21:56 UTC
++++ lgpl/generic/kpColorCollection.cpp
+@@ -80,7 +80,7 @@ QStringList kpColorCollection::installedCollections()
+ {
+     QStringList paletteList;
+ 
+-    QStringList paths = QStandardPaths::locateAll(QStandardPaths::GenericConfigLocation, QStringLiteral("colors"), QStandardPaths::LocateDirectory);
++    QStringList paths = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("colors"), QStandardPaths::LocateDirectory);
+     for (const auto &path : paths) {
+         paletteList.append(QDir(path).entryList(QStringList(), QDir::Files));
+     }
+@@ -206,7 +206,7 @@ bool kpColorCollection::openKDE(const QString &name, Q
+         return false;
+     }
+ 
+-    QString filename = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, QStringLiteral("colors/") + name);
++    QString filename = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("colors/") + name);
+     if (filename.isEmpty()) {
+ #if DEBUG_KP_COLOR_COLLECTION
+         qCDebug(kpLogColorCollection) << "could not find file";
diff --git a/graphics/kolourpaint/pkg-plist b/graphics/kolourpaint/pkg-plist
index 8279feb849b1..c0aab3952d85 100644
--- a/graphics/kolourpaint/pkg-plist
+++ b/graphics/kolourpaint/pkg-plist
@@ -1,9 +1,4 @@
 bin/kolourpaint
-etc/xdg/colors/40.colors
-etc/xdg/colors/Oxygen.colors
-etc/xdg/colors/Rainbow.colors
-etc/xdg/colors/Royal.colors
-etc/xdg/colors/Web.colors
 lib/libkolourpaint_lgpl.so
 lib/libkolourpaint_lgpl.so.5
 share/applications/org.kde.kolourpaint.desktop
@@ -13,6 +8,11 @@ share/icons/hicolor/22x22/apps/kolourpaint.png
 share/icons/hicolor/32x32/apps/kolourpaint.png
 share/icons/hicolor/48x48/apps/kolourpaint.png
 share/icons/hicolor/scalable/apps/kolourpaint.svgz
+%%DATADIR%%/colors/40.colors
+%%DATADIR%%/colors/Oxygen.colors
+%%DATADIR%%/colors/Rainbow.colors
+%%DATADIR%%/colors/Royal.colors
+%%DATADIR%%/colors/Web.colors
 %%DATADIR%%/icons/hicolor/16x16/actions/tool_brush.png
 %%DATADIR%%/icons/hicolor/16x16/actions/tool_color_eraser.png
 %%DATADIR%%/icons/hicolor/16x16/actions/tool_color_picker.png