summaryrefslogtreecommitdiff
path: root/pcr/mitsuba
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@endefensadelsl.org>2014-02-18 01:56:34 +0000
committerNicolás Reynolds <fauno@endefensadelsl.org>2014-02-18 01:56:34 +0000
commit8185891e28635bdb83fdf4ba4391030912dae596 (patch)
tree66a946535bdd228514750233b2cc99dd1866ff64 /pcr/mitsuba
parent60a11f87366fdfbd114cdc91ff813518858e5f8d (diff)
Tue Feb 18 01:56:27 UTC 2014
Diffstat (limited to 'pcr/mitsuba')
-rw-r--r--pcr/mitsuba/PKGBUILD145
-rw-r--r--pcr/mitsuba/mitsuba.install13
2 files changed, 158 insertions, 0 deletions
diff --git a/pcr/mitsuba/PKGBUILD b/pcr/mitsuba/PKGBUILD
new file mode 100644
index 000000000..01fb7a47f
--- /dev/null
+++ b/pcr/mitsuba/PKGBUILD
@@ -0,0 +1,145 @@
+# Maintainer: Márcio Silva <coadde@lavabit.com>
+
+_pkgname=mitsuba
+_pkgver=0.4.4
+_pkgrel=5.1
+_bldname=blender
+_bldver=2.69
+_bldep=10
+_addname=$_pkgname-$_bldname
+_adddat=20130320
+_addrev=47
+_addrel=1
+_pyver=3.3
+
+# Thu May 09 22:07:37 2013 +0200 - rev:47:8689e0896cf6 ($srcdir/$_addname/$_pkgname/__init__.py:bl_info>version)
+_addver=0.2.1
+
+pkgname=(
+ $_pkgname
+ $_bldname-addon-$_pkgname
+)
+pkgver=$_pkgver
+pkgrel=$_pkgrel
+pkgdesc='A physically based renderer'
+arch=(
+ mips64el
+ x86_64
+ i686
+)
+url=https://www.$_pkgname-renderer.org/
+license=GPL3
+depends=(
+ boost-libs
+ collada-dom
+ glew
+ libxxf86vm
+ openexr
+ qt4
+ xerces-c
+)
+optdepends=(
+ 'python: Python bindings'
+ "${pkgname[1]}: ${_bldname^} addon exporter and renderer"
+)
+makedepends=(
+ boost
+ cmake
+ eigen3
+ mercurial
+ python
+)
+source=(
+ $_pkgname-$pkgver.tar.bz2::${url}repos/$_pkgname/archive/v$pkgver.tar.bz2
+ $_addname-$_addver-$_addrev.tar.bz2::${url}repos/exporters/$_addname/archive/$_addrev.tar.bz2
+)
+sha512sums=(
+ 01967fb84884fbab0ada3775c8f8c54b5523a97ebc9dedd559da3cb54543ecc919d3251c09718358405c19133218048fdb1c64f83d0637cf7b98acccb7564a1c
+ 514cbb1300229599c536183ec300c3074aca349e0ddaa36ae7ae868a2c6b466116d9373a8d9ea89dcd1d09685e9a97bbd5c11121860da1a1bf45b921bcd21ca7
+)
+
+prepare() {
+ mv -v $srcdir/$_pkgname-???????????? $srcdir/$_pkgname-v$pkgver
+ mv -v $srcdir/$_addname-???????????? $srcdir/$_addname-$_addrev
+
+ cd $srcdir/$_pkgname-v$pkgver
+
+ msg 'renaming wrong OS name'
+ _OS=$(uname -o)
+ [[ $_OS == GNU ]] && sed -i 's|Linux|GNU|I' src/libcore/plugin.cpp
+ [[ $_OS == GNU/Linux ]] && sed -i 's|Linux,|GNU/Linux,|' src/libcore/plugin.cpp
+ [[ $_OS == GNU/kFreeBSD ]] && sed -i 's|Linux,|GNU/kFreeBSD,|' src/libcore/plugin.cpp
+ sed -i 's|Linux/|Linux,|
+ s|Linux|GNU/Linux|
+ ' include/$_pkgname/core/{atomic,fstream,random,thread}.h
+
+ msg 'removing Open Source term'
+ sed -i 's|free-software/open-source|free-software|
+ ' include/$_pkgname/core/quad.h
+
+ [[ -d build ]] && rm -vr build
+ mkdir -v build
+}
+
+build() {
+ cd $srcdir/$_pkgname-v$pkgver/build
+
+ [[ $CARCH == x86_64 ]] && _SSE=ON || _SSE=OFF
+ # i686: MTS_SSE disabled
+
+ cmake .. -DCMAKE_INSTALL_PREFIX=/usr\
+ -DBoost_PYTHON_LIBRARY=/usr/lib/libboost_python${_pyver::1}.so\
+ -DMTS_SSE=$_SSE\
+ -DPYTHON_INCLUDE_DIR=/usr/include/python${_pyver}m\
+ -DPYTHON_LIBRARY=/usr/lib/libpython${_pyver}m.so
+ make
+}
+
+package_mitsuba() {
+ cd $srcdir/$_pkgname-v$pkgver/build
+ make DESTDIR=$pkgdir install
+ install=$_pkgname.install
+
+ msg 'fixing files and folders location'
+ a=$pkgdir/usr
+ b=$srcdir/$_pkgname-v$pkgver
+ install -vd $a/{bin,lib{,/python$_pyver/lib-dynload},share/{applications,{licenses/,}$_pkgname,pixmaps}}
+ install -vm644 $b/data/linux/$_pkgname.desktop $a/share/applications
+ install -vm644 $b/src/mtsgui/resources/${_pkgname}48.png $a/share/pixmaps
+ install -vm644 $b/doc/license.txt $a/share/licenses/$_pkgname/LICENSE
+ mv -v $a/{m{itsuba,ts{gui,import,srv,util}},bin}
+ mv -v $a/lib{$pkgname-{bidir,core,hw,render}.so,}
+ mv -v $a/{{data,plugins},share/$_pkgname}
+ mv -v $a/{python/mitsuba.so,lib/python$_pyver/lib-dynload}
+ mv -v $a/{sdk/include,}
+ rmdir -v $a/{python,sdk}
+}
+
+package_blender-addon-mitsuba() {
+ pkgdesc="A addon for the ${_bldname^} which allows render and export with Mitsuba (built for the $_bldname-libre package)"
+ arch=any
+ depends=(
+ $_pkgname=$pkgver
+ "$_bldname-libre>=$_bldep:$_bldver"
+ "$_bldname-libre<$(($_bldep+1)):${_bldver::2}$((${_bldver:2:4}+1))"
+ )
+ _pkgver=$pkgver
+ pkgver=$_addver.r$_addrev.v$_bldver
+ pkgrel=$_addrel
+ optdepends=
+
+ cd $srcdir/$_addname-$_addrev
+
+ msg 'fixing binary path'
+ sed -i 's|'"'default'"': efutil.find_config_value('"'mitsuba', 'defaults', 'binary_path', ''"')|'"'default'"': '"'/usr/bin'"'|
+ ' $_pkgname/properties/engine.py
+
+ a=$pkgdir/usr/share/$_bldname/$_bldver/scripts/addons
+ b=$pkgdir/usr/share/licenses/$pkgname
+ c=$srcdir/$_pkgname-v$_pkgver/doc/license.txt
+
+ install -vd $a && cp -a $_pkgname $a
+ install -vd $b && install -m644 $c $b/LICENSE
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/pcr/mitsuba/mitsuba.install b/pcr/mitsuba/mitsuba.install
new file mode 100644
index 000000000..724bfce00
--- /dev/null
+++ b/pcr/mitsuba/mitsuba.install
@@ -0,0 +1,13 @@
+post_install() {
+ update-desktop-database -q
+ update-mime-database usr/share/mime &> /dev/null
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}