summaryrefslogtreecommitdiff
path: root/community/blender/PKGBUILD
blob: 85a4b3c03718abf16ad7230a5db073704fb89a7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# $Id: PKGBUILD 81415 2012-12-20 13:35:35Z svenstaro $
# Contributor: John Sowiak <john@archlinux.org>
# Contributor: tobias <tobias@archlinux.org>
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>

# Apparently, the blender guys refuse to release source tarballs for
# intermediate releases that deal mainly with binaries but incorporate tiny
# minor changes from svn. Since I'm sick and tired of the urges of users that
# look for release numbers only, we make a messy PKGBUILD that can checkout svn
# release if necessary.

_svn=false

pkgname=blender
true && pkgver=2.65a # Hack for svn
true && pkgrel=2
epoch=6
# We will have to keep increasing the epoch because the idiots at blender.org keep releasing
# versions that use letter suffixes that are normally used in alpha releases but are actually
# more recent than those without the suffix.
pkgdesc="A fully integrated 3D graphics creation suite"
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.blender.org"
depends=('libpng' 'libtiff' 'openexr' 'python' 'desktop-file-utils'
         'shared-mime-info' 'hicolor-icon-theme' 'xdg-utils' 'glew'
         'freetype2' 'openal' 'ffmpeg' 'fftw' 'boost-libs' 'opencollada'
         'openimageio' 'libsndfile' 'jack' 'opencolorio')
makedepends=('cmake' 'boost' 'cuda' 'subversion' 'mesa')
optdepends=('cuda: cycles renderer cuda support')
options=(!strip)
install=blender.install
if [[ $_svn = false ]]; then
  source=(http://download.blender.org/source/$pkgname-$pkgver.tar.gz)
  md5sums=('3bbe18060c5c9c2ad600c8bfe8ee4786')
else
  source=()
  md5sums=()
fi

_svntrunk="https://svn.blender.org/svnroot/bf-blender/trunk/blender"
_svnmod="blender"

build() {
if [[ $_svn = true ]]; then
  cd "$srcdir"
  msg "Connecting to SVN server...."

  if [[ -d "$_svnmod/.svn" ]]; then
    (cd "$_svnmod" && svn up )
  else
    svn co "$_svntrunk" --config-dir ./ "$_svnmod"
  fi

  msg "SVN checkout done or server timeout"
  msg "Starting build..."

  rm -rf "$srcdir/$_svnmod-build"
  cp -r "$srcdir/$_svnmod" "$srcdir/$_svnmod-build"
  cd "$srcdir/$_svnmod-build"
else
  cd "$srcdir/$pkgname-$pkgver"
fi

  mkdir build
  cd build

  [[ $CARCH == i686 ]] && ENABLESSE2="-DSUPPORT_SSE2_BUILD=OFF"

  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DWITH_INSTALL_PORTABLE=OFF \
    -DWITH_PYTHON_INSTALL=OFF \
    -DWITH_OPENCOLLADA=ON \
    -DOPENIMAGEIO_ROOT_DIR=/usr \
    -DWITH_GAMEENGINE=ON \
    -DWITH_JACK=ON \
    -DWITH_PLAYER=ON \
    -DWITH_CODEC_FFMPEG=ON \
    -DWITH_CODEC_SNDFILE=ON \
    -DWITH_CYCLES=ON \
    -DWITH_CYCLES_CUDA_BINARIES=ON \
    -DCUDA_TOOLKIT_ROOT_DIR=/opt/cuda-toolkit/ \
    -DWITH_FFTW3=ON \
    -DWITH_MOD_OCEANSIM=ON \
    -DPYTHON_VERSION=3.3 \
    -DPYTHON_LIBPATH=/usr/lib \
    -DPYTHON_LIBRARY=python3.3m \
    -DPYTHON_INCLUDE_DIRS=/usr/include/python3.3m \
    $ENABLESSE2

  make $MAKEFLAGS

  make
}

package() {
  if [[ $_svn = true ]]; then
    cd "$srcdir/$_svnmod-build/build"
  else
    cd "$srcdir/$pkgname-$pkgver/build"
  fi
  make DESTDIR="${pkgdir}" install
  python -m compileall "${pkgdir}/usr/share/blender"
}