commit:     7883e603e80dde477736b5ccc16db0eea2f9655c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 12 02:34:25 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb 12 03:55:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7883e603

media-libs/osl: 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/831425
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../osl/files/osl-1.11.16.0-openexr-3-imath.patch  | 126 +++++++++++++++++++++
 media-libs/osl/osl-1.11.16.0-r3.ebuild             | 113 ++++++++++++++++++
 2 files changed, 239 insertions(+)

diff --git a/media-libs/osl/files/osl-1.11.16.0-openexr-3-imath.patch 
b/media-libs/osl/files/osl-1.11.16.0-openexr-3-imath.patch
new file mode 100644
index 000000000000..10bb23fffa0e
--- /dev/null
+++ b/media-libs/osl/files/osl-1.11.16.0-openexr-3-imath.patch
@@ -0,0 +1,126 @@
+diff --git a/src/include/OSL/oslconfig.h.in b/src/include/OSL/oslconfig.h.in
+index f735b0f..8063f68 100644
+--- a/src/include/OSL/oslconfig.h.in
++++ b/src/include/OSL/oslconfig.h.in
+@@ -13,9 +13,9 @@
+ // All the things we need from Imath.
+ #define OSL_USING_IMATH @OSL_USING_IMATH@
+ #if OSL_USING_IMATH >= 3
+-#   include <Imath/ImathVec.h>
+-#   include <Imath/ImathMatrix.h>
+-#   include <Imath/ImathColor.h>
++#   include <Imath-3/ImathVec.h>
++#   include <Imath-3/ImathMatrix.h>
++#   include <Imath-3/ImathColor.h>
+ #else
+     // OpenEXR 2.x lacks the Cuda decorators we need, so we replicated some
+     // Imath files in OSL/Imathx, adding the decorations needed for them to
+diff --git a/src/liboslquery/py_osl.h b/src/liboslquery/py_osl.h
+index ee8284f..4988b44 100644
+--- a/src/liboslquery/py_osl.h
++++ b/src/liboslquery/py_osl.h
+@@ -26,7 +26,7 @@
+ #include <OSL/oslquery.h>
+ 
+ #if OSL_USING_IMATH >= 3
+-#    include <Imath/half.h>
++#    include <Imath-3/half.h>
+ #else
+ #    include <OpenEXR/half.h>
+ #endif
+diff --git a/src/include/OSL/Imathx/ImathColor.h 
b/src/include/OSL/Imathx/ImathColor.h
+index d0b035f..1cbb28f 100644
+--- a/src/include/OSL/Imathx/ImathColor.h
++++ b/src/include/OSL/Imathx/ImathColor.h
+@@ -44,7 +44,7 @@
+ //----------------------------------------------------
+ 
+ #include "ImathVec.h"
+-#include <OpenEXR/ImathNamespace.h>
++#include <OpenEXR-3/ImathNamespace.h>
+ // #include "half.h"
+ 
+ #ifndef IMATH_HOSTDEVICE
+diff --git a/src/include/OSL/Imathx/ImathFun.h 
b/src/include/OSL/Imathx/ImathFun.h
+index 1413c48..576b588 100644
+--- a/src/include/OSL/Imathx/ImathFun.h
++++ b/src/include/OSL/Imathx/ImathFun.h
+@@ -43,10 +43,10 @@
+ //
+ 
//-----------------------------------------------------------------------------
+ 
+-#include <OpenEXR/ImathExport.h>
++#include <OpenEXR-3/ImathExport.h>
+ #include "ImathLimits.h"
+-#include <OpenEXR/ImathInt64.h>
+-#include <OpenEXR/ImathNamespace.h>
++#include <OpenEXR-3/ImathInt64.h>
++#include <OpenEXR-3/ImathNamespace.h>
+ 
+ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER
+ 
+diff --git a/src/include/OSL/Imathx/ImathLimits.h 
b/src/include/OSL/Imathx/ImathLimits.h
+index 09fa419..ed19eaa 100644
+--- a/src/include/OSL/Imathx/ImathLimits.h
++++ b/src/include/OSL/Imathx/ImathLimits.h
+@@ -43,7 +43,7 @@
+ //
+ //----------------------------------------------------------------
+ 
+-#include <OpenEXR/ImathNamespace.h>
++#include <OpenEXR-3/ImathNamespace.h>
+ #include <float.h>
+ #include <limits.h>
+ 
+diff --git a/src/include/OSL/Imathx/ImathMatrix.h 
b/src/include/OSL/Imathx/ImathMatrix.h
+index 65f386b..f2b10cc 100644
+--- a/src/include/OSL/Imathx/ImathMatrix.h
++++ b/src/include/OSL/Imathx/ImathMatrix.h
+@@ -43,12 +43,12 @@
+ //
+ //----------------------------------------------------------------
+ 
+-#include <OpenEXR/ImathPlatform.h>
++#include <OpenEXR-3/ImathPlatform.h>
+ #include "ImathFun.h"
+-#include <OpenEXR/ImathExc.h>
++#include <OpenEXR-3/ImathExc.h>
+ #include "ImathVec.h"
+-#include <OpenEXR/ImathShear.h>
+-#include <OpenEXR/ImathNamespace.h>
++#include <OpenEXR-3/ImathShear.h>
++#include <OpenEXR-3/ImathNamespace.h>
+ 
+ #include <cstring>
+ #include <iostream>
+diff --git a/src/include/OSL/Imathx/ImathVec.h 
b/src/include/OSL/Imathx/ImathVec.h
+index e52af61..4cd696b 100644
+--- a/src/include/OSL/Imathx/ImathVec.h
++++ b/src/include/OSL/Imathx/ImathVec.h
+@@ -43,10 +43,10 @@
+ //
+ //----------------------------------------------------
+ 
+-#include <OpenEXR/ImathExc.h>
++#include <OpenEXR-3/ImathExc.h>
+ #include "ImathLimits.h"
+-#include <OpenEXR/ImathMath.h>
+-#include <OpenEXR/ImathNamespace.h>
++#include <OpenEXR-3/ImathMath.h>
++#include <OpenEXR-3/ImathNamespace.h>
+ 
+ #include <iostream>
+ #include <limits>
+diff --git a/src/liboslexec/shadingsys.cpp b/src/liboslexec/shadingsys.cpp
+index 1d36ff1..6fc9d38 100644
+--- a/src/liboslexec/shadingsys.cpp
++++ b/src/liboslexec/shadingsys.cpp
+@@ -27,7 +27,7 @@
+ using namespace OSL;
+ using namespace OSL::pvt;
+ 
+-#include <OpenEXR/ImfChannelList.h>  // Just for OPENEXR_VERSION_STRING
++#include <OpenEXR-3/ImfChannelList.h>  // Just for OPENEXR_VERSION_STRING
+ 
+ // avoid naming conflicts with MSVC macros
+ #ifdef _MSC_VER

diff --git a/media-libs/osl/osl-1.11.16.0-r3.ebuild 
b/media-libs/osl/osl-1.11.16.0-r3.ebuild
new file mode 100644
index 000000000000..58e331049861
--- /dev/null
+++ b/media-libs/osl/osl-1.11.16.0-r3.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8,9,10} )
+
+# check this on updates
+LLVM_MAX_SLOT=13
+
+CMAKE_REMOVE_MODULES_LIST=()
+
+inherit cmake llvm toolchain-funcs python-single-r1
+
+DESCRIPTION="Advanced shading language for production GI renderers"
+HOMEPAGE="http://opensource.imageworks.com/?p=osl 
https://github.com/imageworks/OpenShadingLanguage";
+SRC_URI="https://github.com/imageworks/OpenShadingLanguage/archive/Release-${PV}.tar.gz
 -> ${P}.tar.gz"
+
+LICENSE="BSD"
+# TODO: drop .1 on next SONAME change (probably 1.11 -> 1.12), we needed
+# a nudge to force rebuilds due to openexr 2 -> openexr 3 change.
+SLOT="0/$(ver_cut 2).1"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+X86_CPU_FEATURES=(
+       sse2:sse2 sse3:sse3 ssse3:ssse3 sse4_1:sse4.1 sse4_2:sse4.2
+       avx:avx avx2:avx2 avx512f:avx512f f16c:f16c
+)
+CPU_FEATURES=( ${X86_CPU_FEATURES[@]/#/cpu_flags_x86_} )
+
+IUSE="doc partio qt5 test ${CPU_FEATURES[@]%:*} python"
+
+# See bug #821202 for openimageio < dep
+RDEPEND="
+       dev-libs/boost:=
+       dev-libs/pugixml
+       media-libs/openexr:3=
+       dev-libs/imath:=
+       <media-libs/openimageio-2.3:=
+       <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=
+       sys-libs/zlib
+       partio? ( media-libs/partio )
+       python? (
+               ${PYTHON_DEPS}
+               $(python_gen_cond_dep '
+                       dev-python/pybind11[${PYTHON_USEDEP}]
+               ')
+       )
+       qt5? (
+               dev-qt/qtcore:5
+               dev-qt/qtgui:5
+               dev-qt/qtwidgets:5
+       )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       sys-devel/bison
+       sys-devel/flex
+       virtual/pkgconfig
+"
+
+# Restricting tests as Makefile handles them differently
+RESTRICT="test"
+
+S="${WORKDIR}/OpenShadingLanguage-Release-${PV}"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.11.16.0-openexr-3-imath.patch
+)
+
+llvm_check_deps() {
+       has_version -r "sys-devel/clang:${LLVM_SLOT}"
+}
+
+pkg_setup() {
+       use python && python-single-r1_pkg_setup
+       llvm_pkg_setup
+}
+
+src_configure() {
+       local cpufeature
+       local mysimd=()
+       for cpufeature in "${CPU_FEATURES[@]}"; do
+               use "${cpufeature%:*}" && mysimd+=("${cpufeature#*:}")
+       done
+
+       # If no CPU SIMDs were used, completely disable them
+       [[ -z ${mysimd} ]] && mysimd=("0")
+
+       local gcc="$(tc-getCC)"
+
+       local mycmakeargs=(
+               # LLVM 10+ needs C++14
+               -DCMAKE_CXX_STANDARD=14
+               -DCMAKE_INSTALL_DOCDIR="share/doc/${PF}"
+               -DINSTALL_DOCS=$(usex doc)
+               -DUSE_CCACHE=OFF
+               -DLLVM_STATIC=OFF
+               -DLLVM_ROOT="$(get_llvm_prefix ${LLVM_MAX_SLOT})"
+               # Breaks build for now: bug #827949
+               #-DOSL_BUILD_TESTS=$(usex test)
+               
-DOSL_SHADER_INSTALL_DIR="${EPREFIX}/usr/include/${PN^^}/shaders"
+               -DOSL_PTX_INSTALL_DIR="${EPREFIX}/usr/include/${PN^^}/ptx"
+               -DSTOP_ON_WARNING=OFF
+               -DUSE_PARTIO=$(usex partio)
+               -DUSE_QT=$(usex qt5)
+               -DUSE_PYTHON=$(usex python)
+               -DUSE_SIMD="$(IFS=","; echo "${mysimd[*]}")"
+       )
+
+       cmake_src_configure
+}

Reply via email to