summaryrefslogtreecommitdiff
path: root/libre/openshadinglanguage/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'libre/openshadinglanguage/PKGBUILD')
-rw-r--r--libre/openshadinglanguage/PKGBUILD95
1 files changed, 95 insertions, 0 deletions
diff --git a/libre/openshadinglanguage/PKGBUILD b/libre/openshadinglanguage/PKGBUILD
new file mode 100644
index 000000000..ec2e732be
--- /dev/null
+++ b/libre/openshadinglanguage/PKGBUILD
@@ -0,0 +1,95 @@
+# Maintainer (Arch): Sven-Hendrik Haase <sh@lutzhaase.com>
+# Maintainer: Márcio Silva <coadde@parabola.nu>
+
+pkgname=openshadinglanguage
+pkgver=1.4.2 # 1.5.10 for blender 2.72
+pkgrel=1.parabola1
+pkgdesc='Advanced shading language for production GI renderers (built for the blender package)'
+arch=('i686' 'x86_64' 'mips64el')
+url='https://github.com/imageworks/OpenShadingLanguage'
+license=('custom')
+depends=('boost-libs' 'freetype2' 'libpng' 'libtiff' 'llvm-libs' 'openexr' 'openimageio')
+makedepends=('boost' 'clang' 'cmake')
+conflicts=("$pkgname-parabola")
+replaces=("$pkgname-parabola")
+source=("https://github.com/imageworks/OpenShadingLanguage/archive/Release-$pkgver.tar.gz"
+ 'llvm-141.patch')
+md5sums=('5aeb3c9502aedf62d0120b3523957e92'
+ 'b948e5df8710366b65027d1d8450f340')
+
+prepare() {
+ cd OpenShadingLanguage-Release-$pkgver
+
+ msg 'renaming wrong OS name'
+ _OS=$(uname -o)
+ [[ $_OS == GNU ]] &&\
+ sed -i 's|linux|GNU|i;
+ ' src/{cmake/platform.cmake,make/detectplatform.mk}
+ [[ $_OS == GNU/Linux ]] &&\
+ sed -i 's|[{]uname[}][,]linux]|{uname -o},GNU/Linux|;\|platform| s|linux|GNU/Linux|i
+ ' src/{cmake/platform.cmake,make/detectplatform.mk}
+ [[ $_OS == GNU/kFreeBSD ]] &&\
+ sed -i '\|STREQUAL| s|FreeBSD|kFreeBSD|;\|platform| s|freebsd|GNU/kFreeBSD|i
+ ' src/cmake/platform.cmake
+ sed -i 's|[{]uname[}][,]linux]|{uname -o},GNU/kFreeBSD|;\|platform| s|linux|GNU/kFreeBSD|i
+ ' src/make/detectplatform.mk
+
+ if [[ ${pkgver::3} == 1.4 ]]; then
+ # renaming wrong OS name
+ sed -i 's|Linux/OSX|GNU/BSD|' src/include/export.h
+
+ # LLVM 3.4 build fix
+ # based of "https://github.com/imageworks/OpenShadingLanguage/pull/320.patch"
+ patch -Np1 < $srcdir/llvm-141.patch
+
+ # fix include paths
+ sed -i 's|oslconfig.h|../include/oslconfig.h|
+ s|dual.h|../include/dual.h|
+ s|dual_vec.h|../include/dual_vec.h|
+ ' src/liboslexec/llvm_ops.cpp
+ sed -i 's|oslexec.h|../include/oslexec.h|
+ s|oslclosure.h|../include/oslclosure.h|
+ s|osl_pvt.h|../include/osl_pvt.h|
+ ' src/liboslexec/oslexec_pvt.h
+ else
+ # renaming wrong OS name
+ sed -i 's|Linux/OSX|GNU/BSD|' src/include/OSL/export.h
+ fi
+}
+
+build() {
+ cd OpenShadingLanguage-Release-$pkgver
+
+ if [[ ${pkgver::3} == 1.5 ]]; then
+ # Fails building this file on i686
+ if [[ $CARCH == i686 ]]; then
+ sed -i "/src\/testshade/d" CMakeLists.txt
+ fi
+ fi
+
+ cd src
+
+ [[ -d build ]] && rm -r build
+ mkdir build && cd build
+
+ cmake ../.. \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_STATIC=OFF
+ make
+}
+
+package() {
+ cd OpenShadingLanguage-Release-$pkgver/src/build
+
+ make DESTDIR=$pkgdir install
+
+ mkdir -p $pkgdir/usr/share/OSL/
+ mkdir -p $pkgdir/usr/share/licenses/$pkgname
+ mv $pkgdir/usr/{CHANGES,README.md,INSTALL} $pkgdir/usr/share/OSL
+ mv $pkgdir/usr/doc $pkgdir/usr/share/OSL/doc
+ mv $pkgdir/usr/shaders $pkgdir/usr/share/OSL/shaders
+ mv $pkgdir/usr/LICENSE $pkgdir/usr/share/licenses/$pkgname
+}
+
+# vim:set ts=2 sw=2 et: