gwenview: fix build with versioned kImageAnnotator

K900 416c9181 f922d827

+62 -2
+2 -2
pkgs/applications/kde/default.nix
··· 13 Many of the packages released upstream are not yet built in Nixpkgs due to lack 14 of demand. To add a Nixpkgs build for an upstream package, copy one of the 15 existing packages here and modify it as necessary. A simple example package that 16 - still shows most of the available features is in `./gwenview.nix`. 17 18 # Updates 19 ··· 92 ghostwriter = callPackage ./ghostwriter.nix {}; 93 granatier = callPackage ./granatier.nix {}; 94 grantleetheme = callPackage ./grantleetheme {}; 95 - gwenview = callPackage ./gwenview.nix {}; 96 incidenceeditor = callPackage ./incidenceeditor.nix {}; 97 itinerary = callPackage ./itinerary.nix {}; 98 juk = callPackage ./juk.nix {};
··· 13 Many of the packages released upstream are not yet built in Nixpkgs due to lack 14 of demand. To add a Nixpkgs build for an upstream package, copy one of the 15 existing packages here and modify it as necessary. A simple example package that 16 + still shows most of the available features is in `./gwenview`. 17 18 # Updates 19 ··· 92 ghostwriter = callPackage ./ghostwriter.nix {}; 93 granatier = callPackage ./granatier.nix {}; 94 grantleetheme = callPackage ./grantleetheme {}; 95 + gwenview = callPackage ./gwenview {}; 96 incidenceeditor = callPackage ./incidenceeditor.nix {}; 97 itinerary = callPackage ./itinerary.nix {}; 98 juk = callPackage ./juk.nix {};
+4
pkgs/applications/kde/gwenview.nix pkgs/applications/kde/gwenview/default.nix
··· 16 maintainers = [ lib.maintainers.ttuegel ]; 17 mainProgram = "gwenview"; 18 }; 19 nativeBuildInputs = [ extra-cmake-modules kdoctools ]; 20 buildInputs = [ 21 baloo kactivities kio kitemmodels kparts libkdcraw libkipi phonon
··· 16 maintainers = [ lib.maintainers.ttuegel ]; 17 mainProgram = "gwenview"; 18 }; 19 + 20 + # Fix build with versioned kImageAnnotator 21 + patches = [./kimageannotator.patch]; 22 + 23 nativeBuildInputs = [ extra-cmake-modules kdoctools ]; 24 buildInputs = [ 25 baloo kactivities kio kitemmodels kparts libkdcraw libkipi phonon
+56
pkgs/applications/kde/gwenview/kimageannotator.patch
···
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index 01db0fb1..06319c54 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -166,12 +166,12 @@ if(NOT WITHOUT_X11) 6 + endif() 7 + 8 + if (QT_MAJOR_VERSION STREQUAL "5") 9 + - find_package(kImageAnnotator) 10 + - set_package_properties(kImageAnnotator PROPERTIES URL "https://github.com/ksnip/kImageAnnotator" DESCRIPTION "The kImageAnnotator library provides tools to annotate" TYPE REQUIRED) 11 + - if(kImageAnnotator_FOUND) 12 + + find_package(kImageAnnotator-Qt5) 13 + + set_package_properties(kImageAnnotator-Qt5 PROPERTIES URL "https://github.com/ksnip/kImageAnnotator" DESCRIPTION "The kImageAnnotator library provides tools to annotate" TYPE REQUIRED) 14 + + if(kImageAnnotator-Qt5_FOUND) 15 + set(KIMAGEANNOTATOR_FOUND 1) 16 + - find_package(kColorPicker REQUIRED) 17 + - if(NOT kImageAnnotator_VERSION VERSION_LESS 0.5.0) 18 + + find_package(kColorPicker-Qt5 REQUIRED) 19 + + if(NOT kImageAnnotator-Qt5_VERSION VERSION_LESS 0.5.0) 20 + set(KIMAGEANNOTATOR_CAN_LOAD_TRANSLATIONS 1) 21 + endif() 22 + endif() 23 + diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt 24 + index 8c136835..ef4cff74 100644 25 + --- a/app/CMakeLists.txt 26 + +++ b/app/CMakeLists.txt 27 + @@ -157,6 +157,6 @@ target_link_libraries(slideshowfileitemaction 28 + KF${QT_MAJOR_VERSION}::KIOWidgets 29 + KF${QT_MAJOR_VERSION}::Notifications) 30 + 31 + -if(kImageAnnotator_FOUND) 32 + +if(kImageAnnotator-Qt5_FOUND) 33 + target_link_libraries(gwenview kImageAnnotator::kImageAnnotator) 34 + endif() 35 + diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt 36 + index 05a2ea67..4167a1bb 100644 37 + --- a/lib/CMakeLists.txt 38 + +++ b/lib/CMakeLists.txt 39 + @@ -157,7 +157,7 @@ set(gwenviewlib_SRCS 40 + touch/touch_helper.cpp 41 + ${GV_JPEG_DIR}/transupp.c 42 + ) 43 + -if (kImageAnnotator_FOUND) 44 + +if (kImageAnnotator-Qt5_FOUND) 45 + set(gwenviewlib_SRCS ${gwenviewlib_SRCS} 46 + annotate/annotatedialog.cpp 47 + annotate/annotateoperation.cpp 48 + @@ -338,7 +338,7 @@ if (GWENVIEW_SEMANTICINFO_BACKEND_BALOO) 49 + ) 50 + endif() 51 + 52 + -if(kImageAnnotator_FOUND) 53 + +if(kImageAnnotator-Qt5_FOUND) 54 + target_link_libraries(gwenviewlib kImageAnnotator::kImageAnnotator) 55 + endif() 56 +