summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-02-12 02:13:20 +0000
committerSam James <sam@gentoo.org>2022-02-12 03:55:32 +0000
commitf5792b47accb449ecb4a2aafe3b0d8a720b63e94 (patch)
tree820a4cc5a6a5278ccf63d65387308ca6583bb9b8 /media-libs/opencolorio
parentmedia-libs/openimageio: flip over to OpenEXR 3 (diff)
downloadgentoo-f5792b47accb449ecb4a2aafe3b0d8a720b63e94.tar.gz
gentoo-f5792b47accb449ecb4a2aafe3b0d8a720b63e94.tar.bz2
gentoo-f5792b47accb449ecb4a2aafe3b0d8a720b63e94.zip
media-libs/opencolorio: flip over to OpenEXR 3
Things are getting complicated with trying to keep Blender on OpenEXR 2. Blender needs to switch as a result, but so do its dependencies. Bug: https://bugs.gentoo.org/831357 Bug: https://bugs.gentoo.org/832862 Bug: https://bugs.gentoo.org/821247 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/opencolorio')
-rw-r--r--media-libs/opencolorio/files/opencolorio-2.1.1-imath-openexr-3.patch75
-rw-r--r--media-libs/opencolorio/opencolorio-2.1.1-r3.ebuild106
2 files changed, 181 insertions, 0 deletions
diff --git a/media-libs/opencolorio/files/opencolorio-2.1.1-imath-openexr-3.patch b/media-libs/opencolorio/files/opencolorio-2.1.1-imath-openexr-3.patch
new file mode 100644
index 000000000000..bf606889865d
--- /dev/null
+++ b/media-libs/opencolorio/files/opencolorio-2.1.1-imath-openexr-3.patch
@@ -0,0 +1,75 @@
+diff --git a/share/cmake/modules/FindImath.cmake b/share/cmake/modules/FindImath.cmake
+index 44a55e8..8a2d7ca 100644
+--- a/share/cmake/modules/FindImath.cmake
++++ b/share/cmake/modules/FindImath.cmake
+@@ -49,6 +49,7 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
+ find_path(Imath_INCLUDE_DIR
+ NAMES
+ Imath/ImathConfig.h
++ Imath-3/IMathConfig.h
+ HINTS
+ ${Imath_ROOT}
+ ${PC_Imath_INCLUDE_DIRS}
+@@ -90,8 +91,8 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
+
+ # Get version from config header file
+ if(Imath_INCLUDE_DIR)
+- if(EXISTS "${Imath_INCLUDE_DIR}/Imath/ImathConfig.h")
+- set(_Imath_CONFIG "${Imath_INCLUDE_DIR}/Imath/ImathConfig.h")
++ if(EXISTS "${Imath_INCLUDE_DIR}/Imath-3/ImathConfig.h")
++ set(_Imath_CONFIG "${Imath_INCLUDE_DIR}/Imath-3/ImathConfig.h")
+ endif()
+ endif()
+
+diff --git a/src/utils/Half.h.in b/src/utils/Half.h.in
+index 3784341..237f3ed 100644
+--- a/src/utils/Half.h.in
++++ b/src/utils/Half.h.in
+@@ -8,7 +8,7 @@
+ #define OCIO_USE_IMATH_HALF @OCIO_USE_IMATH_HALF@
+
+ #if OCIO_USE_IMATH_HALF
+-# include <Imath/half.h>
++# include <Imath-3/half.h>
+ #else
+ # include <OpenEXR/half.h>
+ #endif
+diff --git a/vendor/aftereffects/vc/vc15/utils/Half.h b/vendor/aftereffects/vc/vc15/utils/Half.h
+index 5035750..5144e72 100644
+--- a/vendor/aftereffects/vc/vc15/utils/Half.h
++++ b/vendor/aftereffects/vc/vc15/utils/Half.h
+@@ -8,7 +8,7 @@
+ #define OCIO_USE_IMATH_HALF 0
+
+ #if OCIO_USE_IMATH_HALF
+-# include <Imath/half.h>
++# include <Imath-3/half.h>
+ #else
+ # include <OpenEXR/half.h>
+ #endif
+diff --git a/vendor/aftereffects/xcode/xcode12/utils/Half.h b/vendor/aftereffects/xcode/xcode12/utils/Half.h
+index 5035750..5144e72 100644
+--- a/vendor/aftereffects/xcode/xcode12/utils/Half.h
++++ b/vendor/aftereffects/xcode/xcode12/utils/Half.h
+@@ -8,7 +8,7 @@
+ #define OCIO_USE_IMATH_HALF 0
+
+ #if OCIO_USE_IMATH_HALF
+-# include <Imath/half.h>
++# include <Imath-3/half.h>
+ #else
+ # include <OpenEXR/half.h>
+ #endif
+diff --git a/vendor/aftereffects/xcode/xcode9/utils/Half.h b/vendor/aftereffects/xcode/xcode9/utils/Half.h
+index 5035750..5144e72 100644
+--- a/vendor/aftereffects/xcode/xcode9/utils/Half.h
++++ b/vendor/aftereffects/xcode/xcode9/utils/Half.h
+@@ -8,7 +8,7 @@
+ #define OCIO_USE_IMATH_HALF 0
+
+ #if OCIO_USE_IMATH_HALF
+-# include <Imath/half.h>
++# include <Imath-3/half.h>
+ #else
+ # include <OpenEXR/half.h>
+ #endif
diff --git a/media-libs/opencolorio/opencolorio-2.1.1-r3.ebuild b/media-libs/opencolorio/opencolorio-2.1.1-r3.ebuild
new file mode 100644
index 000000000000..65a48f36c3c7
--- /dev/null
+++ b/media-libs/opencolorio/opencolorio-2.1.1-r3.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit cmake flag-o-matic python-single-r1
+
+DESCRIPTION="A color management framework for visual effects and animation"
+HOMEPAGE="https://opencolorio.org https://github.com/AcademySoftwareFoundation/OpenColorIO"
+SRC_URI="https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/OpenColorIO-${PV}"
+
+LICENSE="BSD"
+# TODO: drop .1 on next SONAME bump (2.1 -> 2.2?) as we needed to nudge it
+# to force rebuild of consumers due to changing to openexr 3 changing API.
+SLOT="0/$(ver_cut 1-2).1"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+IUSE="cpu_flags_x86_sse2 doc opengl python static-libs test"
+REQUIRED_USE="
+ doc? ( python )
+ python? ( ${PYTHON_REQUIRED_USE} )
+"
+
+# Not compatible with oiio 2.3
+# https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/1509
+# bug #821073
+# 2.1.1 should be?
+RDEPEND="
+ dev-cpp/pystring
+ dev-python/pybind11
+ >=dev-cpp/yaml-cpp-0.7.0:=
+ dev-libs/imath:=
+ dev-libs/tinyxml
+ opengl? (
+ media-libs/lcms:2
+ media-libs/openimageio:=
+ media-libs/glew:=
+ media-libs/freeglut
+ virtual/opengl
+ )
+ python? ( ${PYTHON_DEPS} )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ >=dev-util/cmake-3.16.2-r1
+ virtual/pkgconfig
+ doc? (
+ $(python_gen_cond_dep '
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/testresources[${PYTHON_USEDEP}]
+ ')
+ )
+"
+
+# Restricting tests, bugs #439790 and #447908
+RESTRICT="test"
+
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.1.1-imath-openexr-3.patch
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ cmake_src_prepare
+
+ sed -i -e "s|LIBRARY DESTINATION lib|LIBRARY DESTINATION $(get_libdir)|g" {,src/bindings/python/,src/OpenColorIO/,src/libutils/oiiohelpers/,src/libutils/oglapphelpers/}CMakeLists.txt || die
+ sed -i -e "s|ARCHIVE DESTINATION lib|ARCHIVE DESTINATION $(get_libdir)|g" {,src/bindings/python/,src/OpenColorIO/,src/libutils/oiiohelpers/,src/libutils/oglapphelpers/}CMakeLists.txt || die
+}
+
+src_configure() {
+ # Missing features:
+ # - Truelight and Nuke are not in portage for now, so their support are disabled
+ # - Java bindings was not tested, so disabled
+ # Notes:
+ # - OpenImageIO is required for building ociodisplay and ocioconvert (USE opengl)
+ # - OpenGL, GLUT and GLEW is required for building ociodisplay (USE opengl)
+ local mycmakeargs=(
+ -DOCIO_USE_OPENEXR_HALF=OFF
+
+ -DBUILD_SHARED_LIBS=ON
+ -DOCIO_BUILD_STATIC=$(usex static-libs)
+ -DOCIO_BUILD_DOCS=$(usex doc)
+ -DOCIO_BUILD_APPS=$(usex opengl)
+ -DOCIO_BUILD_PYTHON=$(usex python)
+ -DOCIO_PYTHON_VERSION="${EPYTHON/python/}"
+ -DOCIO_BUILD_JAVA=OFF
+ -DOCIO_USE_SSE=$(usex cpu_flags_x86_sse2)
+ -DOCIO_BUILD_TESTS=$(usex test)
+ -DOCIO_BUILD_GPU_TESTS=$(usex test)
+ -DOCIO_BUILD_FROZEN_DOCS=$(usex doc)
+ -DOCIO_INSTALL_EXT_PACKAGES=NONE
+ )
+
+ # We need this to work around asserts that can trigger even in proper use cases.
+ # See https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/1235
+ append-flags -DNDEBUG
+
+ cmake_src_configure
+}