commit:     a5711585ca1e99533578410e543a2b3ad30ffb69
Author:     Bernd Waibel <waebbl-gentoo <AT> posteo <DOT> net>
AuthorDate: Sat Sep 17 09:10:14 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sun Sep 25 12:22:52 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5711585

media-gfx/blender: add optix support to live ebuild

Signed-off-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net>
Closes: https://github.com/gentoo/gentoo/pull/27303
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 media-gfx/blender/blender-9999.ebuild | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/media-gfx/blender/blender-9999.ebuild 
b/media-gfx/blender/blender-9999.ebuild
index 48a7c50cf696..0426748b3a70 100644
--- a/media-gfx/blender/blender-9999.ebuild
+++ b/media-gfx/blender/blender-9999.ebuild
@@ -28,7 +28,8 @@ IUSE="+bullet +dds +fluid +openexr +tbb \
        alembic collada +color-management cuda +cycles \
        debug doc +embree +ffmpeg +fftw +gmp headless jack jemalloc jpeg2k \
        man +nanovdb ndof nls openal +oidn +openimageio +openmp +opensubdiv \
-       +openvdb +osl +pdf +potrace +pugixml pulseaudio sdl +sndfile test +tiff 
valgrind"
+       +openvdb optix +osl +pdf +potrace +pugixml pulseaudio sdl +sndfile \
+       test +tiff valgrind"
 RESTRICT="!test? ( test )"
 
 REQUIRED_USE="${PYTHON_REQUIRED_USE}
@@ -37,6 +38,7 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}
        cycles? ( openexr tiff openimageio )
        fluid? ( tbb )
        openvdb? ( tbb )
+       optix? ( cuda )
        osl? ( cycles )
        test? ( color-management )"
 
@@ -93,6 +95,7 @@ RDEPEND="${PYTHON_DEPS}
                >=media-gfx/openvdb-9.0.0:=[nanovdb?]
                dev-libs/c-blosc:=
        )
+       optix? ( <dev-libs/optix-7.5.0 )
        osl? ( >=media-libs/osl-1.11.16.0-r3:= )
        pdf? ( media-libs/libharu )
        potrace? ( media-gfx/potrace )
@@ -217,6 +220,7 @@ src_configure() {
                -DWITH_CXX_GUARDEDALLOC=$(usex debug)
                -DWITH_CYCLES=$(usex cycles)
                -DWITH_CYCLES_DEVICE_CUDA=$(usex cuda TRUE FALSE)
+               -DWITH_CYCLES_DEVICE_OPTIX=$(usex optix)
                -DWITH_CYCLES_EMBREE=$(usex embree)
                -DWITH_CYCLES_OSL=$(usex osl)
                -DWITH_CYCLES_STANDALONE=OFF
@@ -264,6 +268,13 @@ src_configure() {
                -DWITH_XR_OPENXR=OFF
        )
 
+       if use optix; then
+               mycmakeargs+=(
+                       -DCYCLES_RUNTIME_OPTIX_ROOT_DIR="${EPREFIX}"/opt/optix
+                       -DOPTIX_ROOT_DIR="${EPREFIX}"/opt/optix
+               )
+       fi
+
        append-flags $(usex debug '-DDEBUG' '-DNDEBUG')
 
        if tc-is-gcc ; then
@@ -286,8 +297,8 @@ src_test() {
        blender_get_version
        # Define custom blender data/script file paths not be able to find them 
otherwise during testing.
        # (Because the data is in the image directory and it will default to 
look in /usr/share)
-       export BLENDER_SYSTEM_SCRIPTS=${ED}/usr/share/blender/${BV}/scripts
-       export BLENDER_SYSTEM_DATAFILES=${ED}/usr/share/blender/${BV}/datafiles
+       export BLENDER_SYSTEM_SCRIPTS="${ED}"/usr/share/blender/${BV}/scripts
+       export 
BLENDER_SYSTEM_DATAFILES="${ED}"/usr/share/blender/${BV}/datafiles
 
        # Sanity check that the script and datafile path is valid.
        # If they are not vaild, blender will fallback to the default path 
which is not what we want.

Reply via email to