about summary refs log tree commit diff
path: root/pkgs/applications/kde
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2024-02-28 15:52:35 +0300
committerK900 <me@0upti.me>2024-02-28 18:49:12 +0300
commit416c9181cd3fc7445f4d334146b0ee460907428b (patch)
tree06b6a89bd7668c45a67ec805774789370260410e /pkgs/applications/kde
parentf922d827149d5d07f0c3cb4ac068f4220200e114 (diff)
gwenview: fix build with versioned kImageAnnotator
Diffstat (limited to 'pkgs/applications/kde')
-rw-r--r--pkgs/applications/kde/default.nix4
-rw-r--r--pkgs/applications/kde/gwenview/default.nix (renamed from pkgs/applications/kde/gwenview.nix)4
-rw-r--r--pkgs/applications/kde/gwenview/kimageannotator.patch56
3 files changed, 62 insertions, 2 deletions
diff --git a/pkgs/applications/kde/default.nix b/pkgs/applications/kde/default.nix
index 3fd3894719759..8e04700b83fdd 100644
--- a/pkgs/applications/kde/default.nix
+++ b/pkgs/applications/kde/default.nix
@@ -13,7 +13,7 @@ IF YOUR PACKAGE IS NOT LISTED IN `./srcs.nix`, IT DOES NOT GO HERE.
 Many of the packages released upstream are not yet built in Nixpkgs due to lack
 of demand. To add a Nixpkgs build for an upstream package, copy one of the
 existing packages here and modify it as necessary. A simple example package that
-still shows most of the available features is in `./gwenview.nix`.
+still shows most of the available features is in `./gwenview`.
 
 # Updates
 
@@ -92,7 +92,7 @@ let
       ghostwriter = callPackage ./ghostwriter.nix {};
       granatier = callPackage ./granatier.nix {};
       grantleetheme = callPackage ./grantleetheme {};
-      gwenview = callPackage ./gwenview.nix {};
+      gwenview = callPackage ./gwenview {};
       incidenceeditor = callPackage ./incidenceeditor.nix {};
       itinerary = callPackage ./itinerary.nix {};
       juk = callPackage ./juk.nix {};
diff --git a/pkgs/applications/kde/gwenview.nix b/pkgs/applications/kde/gwenview/default.nix
index 2913f7a464558..d697778f47267 100644
--- a/pkgs/applications/kde/gwenview.nix
+++ b/pkgs/applications/kde/gwenview/default.nix
@@ -16,6 +16,10 @@ mkDerivation {
     maintainers = [ lib.maintainers.ttuegel ];
     mainProgram = "gwenview";
   };
+
+  # Fix build with versioned kImageAnnotator
+  patches = [./kimageannotator.patch];
+
   nativeBuildInputs = [ extra-cmake-modules kdoctools ];
   buildInputs = [
     baloo kactivities kio kitemmodels kparts libkdcraw libkipi phonon
diff --git a/pkgs/applications/kde/gwenview/kimageannotator.patch b/pkgs/applications/kde/gwenview/kimageannotator.patch
new file mode 100644
index 0000000000000..83cba93e49c15
--- /dev/null
+++ b/pkgs/applications/kde/gwenview/kimageannotator.patch
@@ -0,0 +1,56 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 01db0fb1..06319c54 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -166,12 +166,12 @@ if(NOT WITHOUT_X11)
+ endif()
+ 
+ if (QT_MAJOR_VERSION STREQUAL "5")
+-    find_package(kImageAnnotator)
+-    set_package_properties(kImageAnnotator PROPERTIES URL "https://github.com/ksnip/kImageAnnotator" DESCRIPTION "The kImageAnnotator library provides tools to annotate" TYPE REQUIRED)
+-    if(kImageAnnotator_FOUND)
++    find_package(kImageAnnotator-Qt5)
++    set_package_properties(kImageAnnotator-Qt5 PROPERTIES URL "https://github.com/ksnip/kImageAnnotator" DESCRIPTION "The kImageAnnotator library provides tools to annotate" TYPE REQUIRED)
++    if(kImageAnnotator-Qt5_FOUND)
+         set(KIMAGEANNOTATOR_FOUND 1)
+-        find_package(kColorPicker REQUIRED)
+-        if(NOT kImageAnnotator_VERSION VERSION_LESS 0.5.0)
++        find_package(kColorPicker-Qt5 REQUIRED)
++        if(NOT kImageAnnotator-Qt5_VERSION VERSION_LESS 0.5.0)
+             set(KIMAGEANNOTATOR_CAN_LOAD_TRANSLATIONS 1)
+         endif()
+     endif()
+diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
+index 8c136835..ef4cff74 100644
+--- a/app/CMakeLists.txt
++++ b/app/CMakeLists.txt
+@@ -157,6 +157,6 @@ target_link_libraries(slideshowfileitemaction
+     KF${QT_MAJOR_VERSION}::KIOWidgets
+     KF${QT_MAJOR_VERSION}::Notifications)
+ 
+-if(kImageAnnotator_FOUND)
++if(kImageAnnotator-Qt5_FOUND)
+     target_link_libraries(gwenview kImageAnnotator::kImageAnnotator)
+ endif()
+diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
+index 05a2ea67..4167a1bb 100644
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -157,7 +157,7 @@ set(gwenviewlib_SRCS
+     touch/touch_helper.cpp
+     ${GV_JPEG_DIR}/transupp.c
+     )
+-if (kImageAnnotator_FOUND)
++if (kImageAnnotator-Qt5_FOUND)
+     set(gwenviewlib_SRCS ${gwenviewlib_SRCS}
+         annotate/annotatedialog.cpp
+         annotate/annotateoperation.cpp
+@@ -338,7 +338,7 @@ if (GWENVIEW_SEMANTICINFO_BACKEND_BALOO)
+         )
+ endif()
+ 
+-if(kImageAnnotator_FOUND)
++if(kImageAnnotator-Qt5_FOUND)
+     target_link_libraries(gwenviewlib kImageAnnotator::kImageAnnotator)
+ endif()
+