OpenEXR 3 fixes from Arch Linux

Due to lack of time, we apply the patch conditionally only on F35+.
This commit is contained in:
Miro Hrončok 2021-08-02 16:59:01 +02:00
parent ff498de501
commit 8d0380f7f3
2 changed files with 93 additions and 2 deletions

View File

@ -0,0 +1,77 @@
diff --git a/cmake/modules/FindOpenVDB.cmake b/cmake/modules/FindOpenVDB.cmake
index 02420fed8..4b93111ab 100644
--- a/cmake/modules/FindOpenVDB.cmake
+++ b/cmake/modules/FindOpenVDB.cmake
@@ -326,28 +326,10 @@ macro(just_fail msg)
return()
endmacro()
-find_package(IlmBase QUIET COMPONENTS Half)
-if(NOT IlmBase_FOUND)
- pkg_check_modules(IlmBase QUIET IlmBase)
-endif()
-if (IlmBase_FOUND AND NOT TARGET IlmBase::Half)
- message(STATUS "Falling back to IlmBase found by pkg-config...")
-
- find_library(IlmHalf_LIBRARY NAMES Half)
- if(IlmHalf_LIBRARY-NOTFOUND OR NOT IlmBase_INCLUDE_DIRS)
- just_fail("IlmBase::Half can not be found!")
- endif()
-
- add_library(IlmBase::Half UNKNOWN IMPORTED)
- set_target_properties(IlmBase::Half PROPERTIES
- IMPORTED_LOCATION "${IlmHalf_LIBRARY}"
- INTERFACE_INCLUDE_DIRECTORIES "${IlmBase_INCLUDE_DIRS}")
-elseif(NOT IlmBase_FOUND)
- just_fail("IlmBase::Half can not be found!")
-endif()
find_package(TBB ${_quiet} ${_required} COMPONENTS tbb)
find_package(ZLIB ${_quiet} ${_required})
find_package(Boost ${_quiet} ${_required} COMPONENTS iostreams system )
+find_package(Imath CONFIG)
# Use GetPrerequisites to see which libraries this OpenVDB lib has linked to
# which we can query for optional deps. This basically runs ldd/otoll/objdump
@@ -398,7 +380,7 @@ foreach(PREREQUISITE ${_OPENVDB_PREREQUISITE_LIST})
set(OpenVDB_USES_LOG4CPLUS ON)
endif()
- string(FIND ${PREREQUISITE} "IlmImf" _HAS_DEP)
+ string(FIND ${PREREQUISITE} "OpenEXR" _HAS_DEP)
if(NOT ${_HAS_DEP} EQUAL -1)
set(OpenVDB_USES_ILM ON)
endif()
@@ -429,11 +411,7 @@ if(OpenVDB_USES_LOG4CPLUS)
find_package(Log4cplus ${_quiet} ${_required})
endif()
-if(OpenVDB_USES_ILM)
- find_package(IlmBase ${_quiet} ${_required})
-endif()
-
-if(OpenVDB_USES_EXR)
+if(OpenVDB_USES_ILM OR OpenVDB_USES_EXR)
find_package(OpenEXR ${_quiet} ${_required})
endif()
@@ -450,7 +428,7 @@ endif()
set(_OPENVDB_VISIBLE_DEPENDENCIES
Boost::iostreams
Boost::system
- IlmBase::Half
+ Imath::Imath
)
set(_OPENVDB_DEFINITIONS)
@@ -460,10 +438,7 @@ endif()
if(OpenVDB_USES_EXR)
list(APPEND _OPENVDB_VISIBLE_DEPENDENCIES
- IlmBase::IlmThread
- IlmBase::Iex
- IlmBase::Imath
- OpenEXR::IlmImf
+ OpenEXR::OpenEXR
)
list(APPEND _OPENVDB_DEFINITIONS "-DOPENVDB_TOOLS_RAYTRACER_USE_EXR")
endif()

View File

@ -8,7 +8,7 @@
Name: prusa-slicer
Version: 2.3.1
Release: 3%{?dist}
Release: 4%{?dist}
Summary: 3D printing slicer optimized for Prusa printers
# The main PrusaSlicer code and resources are AGPLv3, with small parts as
@ -33,6 +33,15 @@ Patch1: optional.patch
# https://github.com/prusa3d/PrusaSlicer/pull/6518
Patch2: 0001-Fix-build-error-with-non-const-MINSIGSTKSZ.patch
# Beware!
# Patches >= 340 are only applied on Fedora 34+
# Patches >= 350 are only applied on Fedora 35+
# ...
# OpenEXR 3 fixes
Patch351: https://github.com/archlinux/svntogit-community/blob/1dea61c0b5/trunk/prusa-slicer-openexr3.patch
# Highly-parallel uild can run out of memory on PPC64le
%ifarch ppc64le
%global _smp_ncpus_max 8
@ -237,7 +246,9 @@ community.
%prep
%autosetup -S git -n PrusaSlicer-version_%version
%autosetup -S git -n PrusaSlicer-version_%version -N
# Apply patches, but only apply 340+ on Fedora 34, 350+ on Fedora 35, etc...
%autopatch -M %[%{?fedora} * 10 + 9]
commit () { git commit -q -a -m "$1" --author "%{__scm_author}"; }
@ -415,6 +426,9 @@ rm -rf %buildroot%_datadir/PrusaSlicer/data/
%endif
%changelog
* Mon Aug 02 2021 Miro Hrončok <mhroncok@redhat.com> - 2.3.1-4
- Rebuilt for OpenEXR 3
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild