Christophe Giboudeaux 2021-08-11 13:39:44 +00:00 committed by Git OBS Bridge
parent 692f34f41a
commit 2092968cdd
3 changed files with 164 additions and 0 deletions

View File

@ -0,0 +1,156 @@
From 5a720e94e62b8ae4a17dc8bee844f0baee923a9b Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Fri, 23 Apr 2021 23:42:14 +0200
Subject: [PATCH] Support building with OpenEXR 3
Try to find OpenEXR 3 first via the upstream cmake config and fallback to using our FindOpenEXR
---
CMakeLists.txt | 11 ++++++++---
libs/image/CMakeLists.txt | 2 +-
libs/pigment/CMakeLists.txt | 2 +-
plugins/color/lcms2engine/CMakeLists.txt | 6 +++---
plugins/color/lcms2engine/tests/CMakeLists.txt | 2 +-
plugins/impex/CMakeLists.txt | 2 +-
plugins/impex/exr/exr_converter.cc | 2 ++
plugins/impex/raw/CMakeLists.txt | 2 +-
8 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2aaadf6fe..bc6a0207e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -628,15 +628,20 @@ set_package_properties(ZLIB PROPERTIES
PURPOSE "Optionally used by the G'Mic and the PSD plugins")
macro_bool_to_01(ZLIB_FOUND HAVE_ZLIB)
-find_package(OpenEXR)
+find_package(OpenEXR 3.0 CONFIG QUIET)
+if(TARGET OpenEXR::OpenEXR)
+ set(OPENEXR_LIBRARIES OpenEXR::OpenEXR)
+else()
+ find_package(OpenEXR)
+endif()
set_package_properties(OpenEXR PROPERTIES
DESCRIPTION "High dynamic-range (HDR) image file format"
URL "https://www.openexr.com"
TYPE OPTIONAL
PURPOSE "Required by the Krita OpenEXR filter")
-macro_bool_to_01(OPENEXR_FOUND HAVE_OPENEXR)
+macro_bool_to_01(OpenEXR_FOUND HAVE_OPENEXR)
set(LINK_OPENEXR_LIB)
-if(OPENEXR_FOUND)
+if(OpenEXR_FOUND)
include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS})
set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
add_definitions(${OPENEXR_DEFINITIONS})
diff --git a/libs/image/CMakeLists.txt b/libs/image/CMakeLists.txt
index 79e5b55059..4841ab139d 100644
--- a/libs/image/CMakeLists.txt
+++ b/libs/image/CMakeLists.txt
@@ -360,7 +360,7 @@ if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
endif()
endif()
-if(OPENEXR_FOUND)
+if(OpenEXR_FOUND)
target_link_libraries(kritaimage PUBLIC ${OPENEXR_LIBRARIES})
endif()
diff --git a/libs/pigment/CMakeLists.txt b/libs/pigment/CMakeLists.txt
index 2da577f043..8c1a70f4c7 100644
--- a/libs/pigment/CMakeLists.txt
+++ b/libs/pigment/CMakeLists.txt
@@ -14,7 +14,7 @@ include_directories(
set(FILE_OPENEXR_SOURCES)
set(LINK_OPENEXR_LIB)
-if(OPENEXR_FOUND)
+if(OpenEXR_FOUND)
include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS})
set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
add_definitions(${OPENEXR_DEFINITIONS})
diff --git a/plugins/color/lcms2engine/CMakeLists.txt b/plugins/color/lcms2engine/CMakeLists.txt
index e14de2ba7c..04d0841953 100644
--- a/plugins/color/lcms2engine/CMakeLists.txt
+++ b/plugins/color/lcms2engine/CMakeLists.txt
@@ -28,7 +28,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/colorprofiles
)
-if (HAVE_LCMS24 AND OPENEXR_FOUND)
+if (HAVE_LCMS24 AND OpenEXR_FOUND)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/colorspaces/gray_f16
${CMAKE_CURRENT_SOURCE_DIR}/colorspaces/rgb_f16
@@ -38,7 +38,7 @@ endif ()
set(FILE_OPENEXR_SOURCES)
set(LINK_OPENEXR_LIB)
-if(OPENEXR_FOUND)
+if(OpenEXR_FOUND)
include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS})
set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
add_definitions(${OPENEXR_DEFINITIONS})
@@ -77,7 +77,7 @@ set ( lcmsengine_SRCS
LcmsEnginePlugin.cpp
)
-if (HAVE_LCMS24 AND OPENEXR_FOUND)
+if (HAVE_LCMS24 AND OpenEXR_FOUND)
set ( lcmsengine_SRCS
${lcmsengine_SRCS}
colorspaces/gray_f16/GrayF16ColorSpace.cpp
diff --git a/plugins/color/lcms2engine/tests/CMakeLists.txt b/plugins/color/lcms2engine/tests/CMakeLists.txt
index b548dfa19f..2bcddec635 100644
--- a/plugins/color/lcms2engine/tests/CMakeLists.txt
+++ b/plugins/color/lcms2engine/tests/CMakeLists.txt
@@ -12,7 +12,7 @@ include_directories( ../colorspaces/cmyk_u16
../colorprofiles
..
)
-if(OPENEXR_FOUND)
+if(OpenEXR_FOUND)
include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS})
endif()
include_directories( ${LCMS2_INCLUDE_DIR} )
diff --git a/plugins/impex/CMakeLists.txt b/plugins/impex/CMakeLists.txt
index 499b1c97d0..82d936575b 100644
--- a/plugins/impex/CMakeLists.txt
+++ b/plugins/impex/CMakeLists.txt
@@ -19,7 +19,7 @@ if(PNG_FOUND)
add_subdirectory(csv)
endif()
-if(OPENEXR_FOUND)
+if(OpenEXR_FOUND)
add_subdirectory(exr)
endif()
diff --git a/plugins/impex/exr/exr_converter.cc b/plugins/impex/exr/exr_converter.cc
index bde4784379..4f90c25a1f 100644
--- a/plugins/impex/exr/exr_converter.cc
+++ b/plugins/impex/exr/exr_converter.cc
@@ -24,6 +24,8 @@
#include <ImfAttribute.h>
#include <ImfChannelList.h>
+#include <ImfFrameBuffer.h>
+#include <ImfHeader.h>
#include <ImfInputFile.h>
#include <ImfOutputFile.h>
diff --git a/plugins/impex/raw/CMakeLists.txt b/plugins/impex/raw/CMakeLists.txt
index 71cb5b355c..f65bc770a5 100644
--- a/plugins/impex/raw/CMakeLists.txt
+++ b/plugins/impex/raw/CMakeLists.txt
@@ -1,6 +1,6 @@
add_subdirectory(tests)
-if(OPENEXR_FOUND)
+if(OpenEXR_FOUND)
include_directories(${OPENEXR_INCLUDE_DIRS})
endif()
include_directories(${LibRaw_INCLUDE_DIR})
--
2.32.0

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Aug 11 13:38:26 UTC 2021 - Christophe Giboudeaux <christophe@krop.fr>
- Add patch to allow building krita with OpenEXR 3 (boo#1189327):
* 0001-Support-building-with-OpenEXR-3.patch
-------------------------------------------------------------------
Sun Aug 8 13:01:02 UTC 2021 - Wolfgang Bauer <wbauer@tmo.at>

View File

@ -31,6 +31,8 @@ License: GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND
Group: Productivity/Graphics/Bitmap Editors
URL: https://www.krita.org/
Source0: https://download.kde.org/stable/krita/%{version}/krita-%{version}.tar.xz
# PATCH-FIX-UPSTREAM
Patch0: 0001-Support-building-with-OpenEXR-3.patch
%ifnarch %{arm} aarch64
# Causes build failure on ARM currently
# 2021-07-24: Disabled for Tumbleweed (kde#435474)