updated on Fri Jan 13 20:02:10 UTC 2012
[aur-mirror.git] / blender-svn / PKGBUILD
bloba0dfb1b49728c0d4416ca4ec8768d274545021b4
1 # Maintainer: Lukas Jirkovsky <l.jirkovsky@gmail.com>
2 # Contributor: XercesBlue (nullfied)
3 # Contributor: Mikael Eriksson (miffe)
4 pkgname=blender-svn
5 pkgver=42876
6 pkgrel=1
7 pkgdesc="SVN version of Blender (called bf-blender)"
8 arch=('i686' 'x86_64')
9 url="http://blender.org/"
10 depends=('libgl' 'mesa' 'python' 'desktop-file-utils' 'hicolor-icon-theme'
11          'ffmpeg' 'fftw' 'openal' 'freetype2' 'libxi' 'openimageio-git')
12 optdepends=('cuda-toolkit: CUDA support in Cycles')
13 makedepends=('subversion' 'cmake' 'boost')
14 provides=('blender')
15 conflicts=('blender')
16 license=('GPL')
17 install=blender.install
18 source=(blender.desktop)
19 md5sums=('e9c26e370839fd902eb76c98fe3b9589')
21 _svntrunk="https://svn.blender.org/svnroot/bf-blender/trunk/blender"
22 _svnmod="blender"
24 # determine whether we can precompile CUDA kernels
25 _CUDA_PKG=`pacman -Qsq cuda-toolkit` || true
26 if [ "$_CUDA_PKG" != "" ]; then
27     _EXTRAOPTS="-DWITH_CYCLES_CUDA_BINARIES=ON \
28                 -DCUDA_TOOLKIT_INCLUDE=/usr/include/cuda"
31 build() {
32   # get the sources
33   cd "$srcdir"
34   msg "Connecting to Blender SVN server......."
35   if [ -d $_svnmod/.svn ]; then
36         cd $_svnmod && svn up -r $pkgver
37   else
38         svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
39   fi
40   msg "SVN checkout done or server timeout"
42   msg "Starting make..."
43   cd "$srcdir"/$_svnmod
45   ##########
46   [ -e "$srcdir"/$_svnmod-build ] || mkdir -p "$srcdir"/$_svnmod-build
47   cd "$srcdir"/$_svnmod-build
48   cmake "$srcdir"/$_svnmod \
49         -DCMAKE_INSTALL_PREFIX=/usr \
50         -DWITH_INSTALL_PORTABLE=OFF \
51         -DWITH_PLAYER=ON \
52         -DWITH_FFTW3=ON \
53         -DWITH_BUILTIN_GLEW=OFF \
54         -DWITH_CODEC_FFMPEG=ON \
55         -DWITH_PYTHON_INSTALL=OFF \
56         -DPYTHON_VERSION=3.2mu \
57         -DWITH_MOD_OCEANSIM=ON \
58         $_EXTRAOPTS
59   make
60   ##########
61   # now compile some plugins
62   cp -rf "$srcdir"/$_svnmod/release/plugins/* \
63     "$srcdir"/$_svnmod/source/blender/blenpluginapi/
64   cd "$srcdir"/$_svnmod/source/blender/blenpluginapi
65   chmod 755 bmake
66   make
69 package() {
70   cd "$srcdir"/$_svnmod-build
71   make DESTDIR="$pkgdir" install
72   install -D -m644 "$srcdir"/blender.desktop \
73     "$pkgdir"/usr/share/applications/blender.desktop
75   # install plugins
76   install -d -m755 "$pkgdir"/usr/share/blender/`ls "$pkgdir"/usr/share/blender`/plugins/{sequence,texture}
77   cp "$srcdir"/$_svnmod/source/blender/blenpluginapi/sequence/*.so \
78     "$pkgdir"/usr/share/blender/*/plugins/sequence/
79   cp "$srcdir"/$_svnmod/source/blender/blenpluginapi/texture/*.so \
80     "$pkgdir"/usr/share/blender/*/plugins/texture/
82   if [ -e "$pkgdir"/usr/share/blender/2.61/scripts/addons/cycles/lib/ ] ; then
83     # make sure the cuda kernels are not stripped
84     chmod 444 "$pkgdir"/usr/share/blender/2.61/scripts/addons/cycles/lib/*
85   fi