# Contributor: Damian Kurek # Maintainer: Leon Marz pkgname=osl pkgver=1.12.13.0 pkgrel=0 pkgdesc="Advanced shading language for production GI renderers" options="!check" # All tests fail url="https://opensource.imageworks.com/osl.html" # riscv64 and s390x blocked by openimageio arch="all !riscv64 !s390x" license="BSD-3-Clause" _llvmver=15 makedepends="cmake bison boost-dev clang$_llvmver-dev flex-dev fmt-dev lld llvm$_llvmver-dev llvm$_llvmver-libs openexr-dev openimageio-dev openimageio-tools pugixml-dev python3-dev py3-pybind11-dev qt6-qtbase-dev samurai zlib-dev " subpackages=" $pkgname-libs $pkgname-dev $pkgname-doc $pkgname-python openimageio-plugin-osl:_osl " source="$pkgname-$pkgver.tar.gz::https://github.com/imageworks/OpenShadingLanguage/archive/v$pkgver.tar.gz armv7-neon.patch.noauto " builddir="$srcdir/OpenShadingLanguage-$pkgver" prepare() { default_prepare case "$CARCH" in armv7) patch -Np1 < "$srcdir"/armv7-neon.patch.noauto ;; esac } build() { if [ "$CBUILD" != "$CHOST" ]; then CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi export CC="clang-$_llvmver" export CXX="clang++-$_llvmver" export CFLAGS="$CFLAGS -flto=thin" export CXXFLAGS="$CXXFLAGS -flto=thin" export LDFLAGS="$LDFLAGS -fuse-ld=lld" case "$CARCH" in armv7) export CXXFLAGS="$CXXFLAGS -DOIIO_NO_NEON" ;; esac cmake -B build -G Ninja -Wno-dev \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_STANDARD=14 \ -DCMAKE_SKIP_RPATH=ON \ -DLLVM_ROOT="/usr/lib/llvm$_llvmver" \ -DLLVM_BC_GENERATOR="/usr/bin/clang++-$_llvmver" \ -DLLVM_AS_TOOL="/usr/lib/llvm$_llvmver/bin/llvm-as" \ -DLLVM_LINK_TOOL="/usr/lib/llvm$_llvmver/bin/llvm-link" \ -DLLVM_STATIC=OFF \ -DOSL_BUILD_TESTS="$(want_check && echo ON || echo OFF)" \ $CMAKE_CROSSOPTS cmake --build build } check() { cd build # Broken tests CTEST_OUTPUT_ON_FAILURE=TRUE ctest } package() { DESTDIR="$pkgdir" cmake --install build } python() { pkgdesc="Python3 bindings for OSL" depends="" amove usr/lib/python3* } doc() { default_doc # Example shaders amove usr/share/OSL/shaders/*.osl amove usr/share/OSL/shaders/*.oso } _osl() { pkgdesc="Plugin to access OSL from OpenImageIO" depends="" amove usr/lib/osl.imageio.so } sha512sums=" d7e6ab79f77f2854cbb4fa2fbe5fc92659bb015b1bbffcee2ef86185cf20235990fa3b20308601aa298fedc85d3fcd4451b7b7ff0df7def97027efe4fb8a02bc osl-1.12.13.0.tar.gz 6083b35af111ae357cf73d364df3043bcd67430481961cc4ceed2d0055691b4dddc58bc945dd0d122ed0bf54b4577a9d1dad58da41af0472befec3a12606b11d armv7-neon.patch.noauto "