aboutsummaryrefslogblamecommitdiffstats
path: root/testing/osl/APKBUILD
blob: d71d7a02a94c52c5eba0610b685c43a27474f958 (plain) (tree)
1
2
3
4
5
6
7
8
9


                                                     
                
        
                                                               

                                                
                                                     
                      
           


                                                                                   












                                                                                                                 
                                                                                             





                                                                                          
                        





                                             
                                          
























                                                              

                                                   







                                                       
            
                                                                                                                                                      
 
# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=osl
pkgver=1.11.14.1
pkgrel=0
pkgdesc="Advanced shading language for production GI renderers"
options="!check" # All tests fail
url="https://opensource.imageworks.com/osl.html"
arch="all !armv7 !armhf !s390x !mips64" # openimageio
license="BSD-3-Clause"
_llvmver=11
makedepends="openexr-dev zlib-dev cmake boost-dev openimageio-dev openimageio-tools
	pugixml-dev llvm$_llvmver-dev bison flex-dev py3-pybind11-dev clang-dev
	qt5-qtbase-dev python3-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/Release-$pkgver.tar.gz
	"
builddir="$srcdir/OpenShadingLanguage-Release-$pkgver"

prepare() {
	default_prepare
	find . -iname CMakeLists.txt -exec sed -i -e "s/COMMAND python/COMMAND python3/" {} +
}

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_CXX_STANDARD=14 \
		-DLLVM_STATIC=OFF \
		-DPYTHON_VERSION=3 \
		-DOSL_BUILD_MATERIALX=ON \
		$CMAKE_CROSSOPTS
	cmake --build build
}

check() {
	cd build
	# Broken tests
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

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
	amove usr/share/OSL/shaders/MaterialX/*.osl
	amove usr/share/OSL/shaders/MaterialX/*.oso
}

_osl() {
	pkgdesc="Plugin to access OSL from OpenImageIO"
	depends=""
	amove usr/lib/osl.imageio.so
}

sha512sums="
633294543a055630a307abc45c9f83c65a5a7b347469e95c881e8599ccd15c3ce0f6e316e850a5305afbe3da27e1f05ec486f91b1def26f4c4b053cdde83d85f  osl-1.11.14.1.tar.gz
"