git » kio-extras.git » commit 3d5944e

openexr 3.0 rebuild

author Antonio Rojas
2021-04-23 19:41:42 UTC
committer Antonio Rojas
2021-04-23 19:41:42 UTC
parent 8426fc055a7a8b9fc98b5ea818e07df4a086d380

openexr 3.0 rebuild

PKGBUILD +9 -3
kio-extras-openexr3.patch +43 -0

diff --git a/PKGBUILD b/PKGBUILD
index e3802f3..2798456 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
 
 pkgname=kio-extras
 pkgver=21.04.0
-pkgrel=1
+pkgrel=2
 pkgdesc="Additional components to increase the functionality of KIO"
 arch=(x86_64)
 url='https://www.kde.org/'
@@ -16,13 +16,19 @@ optdepends=('qt5-imageformats: thumbnails for additional image formats' 'perl: i
             'libappimage: AppImage thumbnails' 'icoutils: Windows executable thumbnails'
             'openexr: EXR format thumbnails' 'kactivities-stats: recently used kioslave')
 groups=(kde-applications kde-network)
-source=(https://download.kde.org/stable/release-service/$pkgver/src/$pkgname-$pkgver.tar.xz{,.sig})
+source=(https://download.kde.org/stable/release-service/$pkgver/src/$pkgname-$pkgver.tar.xz{,.sig}
+        kio-extras-openexr3.patch)
 sha256sums=('4f4a6f127a29d68e7c8185ff9f67a2c1ceb2df8edaa87bab4bcc974b5869b3dc'
-            'SKIP')
+            'SKIP'
+            '7d1c0e37f23a86d74e9f84077494cd751736041cdae7669a8e98d32bffbb9a64')
 validpgpkeys=(CA262C6C83DE4D2FB28A332A3A6A4DB839EAA6D7  # Albert Astals Cid <aacid@kde.org>
               F23275E4BF10AFC1DF6914A6DBD2CE893E2D1C87  # Christoph Feck <cfeck@kde.org>
               D81C0CB38EB725EF6691C385BB463350D6EF31EF) # Heiko Becker <heiko.becker@kde.org>
 
+prepare() {
+  patch -d $pkgname-$pkgver -p1 < kio-extras-openexr3.patch # Fix build with openexr 3
+}
+
 build() {
   cmake -B build -S $pkgname-$pkgver \
     -DLIBAPPIMAGE_LIBRARIES=libappimage.so \
diff --git a/kio-extras-openexr3.patch b/kio-extras-openexr3.patch
new file mode 100644
index 0000000..1f20ef8
--- /dev/null
+++ b/kio-extras-openexr3.patch
@@ -0,0 +1,43 @@
+diff --git a/thumbnail/CMakeLists.txt b/thumbnail/CMakeLists.txt
+index a26f4e3f..d3c7569e 100644
+--- a/thumbnail/CMakeLists.txt
++++ b/thumbnail/CMakeLists.txt
+@@ -1,6 +1,9 @@
+ add_definitions(-DTRANSLATION_DOMAIN=\"kio5_thumbnail\")
+ 
+-find_package(OpenEXR)
++find_package(OpenEXR 3.0 CONFIG)
++if(NOT OpenEXR_FOUND)
++    find_package(OpenEXR)
++endif()
+ set_package_properties(OpenEXR PROPERTIES DESCRIPTION "API for accessing OpenEXR formatted images"
+                        URL "https://www.openexr.com"
+                        TYPE OPTIONAL
+@@ -142,9 +145,13 @@ if(OpenEXR_FOUND)
+     target_link_libraries(exrthumbnail
+             KF5::KIOCore
+             KF5::KIOWidgets
+-            ${OpenEXR_LIBRARIES}
+     )
+-    target_include_directories(exrthumbnail SYSTEM PRIVATE ${OpenEXR_INCLUDE_DIRS})
++    if(TARGET OpenEXR::OpenEXR)
++        target_link_libraries(exrthumbnail OpenEXR::OpenEXR)
++    else()
++        target_include_directories(exrthumbnail SYSTEM PRIVATE ${OpenEXR_INCLUDE_DIRS})
++        target_link_libraries(exrthumbnail OpenEXR::OpenEXR)
++    endif()
+ 
+     # OpenEXR headers use exceptions; at least clang refuses to build the target
+     # when exceptions are not enabled.
+diff --git a/thumbnail/exrcreator.cpp b/thumbnail/exrcreator.cpp
+index d4c490d7..dd2dae65 100644
+--- a/thumbnail/exrcreator.cpp
++++ b/thumbnail/exrcreator.cpp
+@@ -23,6 +23,7 @@
+ #include <QImage>
+ #include <QFile>
+ 
++#include <ImfHeader.h>
+ #include <ImfInputFile.h>
+ #include <ImfPreviewImage.h>
+