summaryrefslogtreecommitdiff
path: root/testing/blender/PKGBUILD
blob: 48cc575e069cdc3d1c9d0f633a5531347148b7a0 (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
# $Id: PKGBUILD 128410 2011-06-23 22:00:17Z eric $
# Contributor: John Sowiak <john@archlinux.org>
# Maintainer: tobias <tobias@archlinux.org>

# 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=true
_svn=false

pkgname=blender
pkgver=2.58
pkgrel=1
epoch=1
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' 'libsamplerate' 'ffmpeg')
makedepends=('cmake') # 'subversion'
install=blender.install
if [ $_svn = false ]; then
  source=(http://download.blender.org/source/$pkgname-$pkgver.tgz blender-ffmpeg.diff)
  md5sums=('04a0d43ff27aa0abf14ca559f6a6bf67' 'ed36bab11bfc87864fe0cadf0de5d98f')
else
  source=(ftp://ftp.archlinux.org/other/${pkgname}/$pkgname-$pkgver.tar.xz)
  md5sums=('59e344d4ec48750a86e4ef079c3acbfc')
fi

# source PKGBUILD && mksource
mksource() {
  _svnver=36339
  _svntrunk="https://svn.blender.org/svnroot/bf-blender/trunk/blender"
  _svnmod="$pkgname-$pkgver"
  mkdir ${pkgname}-$pkgver
  pushd ${pkgname}-$pkgver
  svn co $_svntrunk --config-dir ./ -r $_svnver $_svnmod
  find . -depth -type d -name .svn -exec rm -rf {} \;
  tar -cJf ../${pkgname}-$pkgver.tar.xz ${pkgname}-$pkgver/*
  popd
}

build() {
  cd "$srcdir/$pkgname-$pkgver"
  patch -p0 -i ../blender-ffmpeg.diff
  mkdir build
  cd build

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

  cmake .. \
    -DCMAKE_INSTALL_PREFIX:PATH=/usr \
    -DCMAKE_BUILD_TYPE:STRING=Release \
    -DWITH_INSTALL_PORTABLE:BOOL=OFF \
    -DWITH_PYTHON_INSTALL:BOOL=OFF \
    -DWITH_OPENCOLLADA:BOOL=OFF \
    -DWITH_GAMEENGINE:BOOL=ON \
    -DWITH_PLAYER:BOOL=ON \
    -DWITH_BUILTIN_GLEW:BOOL=OFF \
    -DWITH_CODEC_FFMPEG:BOOL=ON \
    -DWITH_CODEC_SNDFILE:BOOL=ON \
    -DPYTHON_VERSION:STRING=3.2 \
    -DPYTHON_LIBPATH:STRING=/usr/lib \
    -DPYTHON_LIBRARY:STRING=python3.2mu \
    -DPYTHON_INCLUDE_DIRS:STRING=/usr/include/python3.2mu \
    $ENABLESSE2

  make $MAKEFLAGS

  cp -rf "$srcdir"/${pkgname}-$pkgver/release/plugins/* \
    "$srcdir"/${pkgname}-$pkgver/source/blender/blenpluginapi/
  cd "$srcdir"/${pkgname}-$pkgver/source/blender/blenpluginapi
  chmod 755 bmake
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver/build"
  make DESTDIR="${pkgdir}" install
  python -m compileall "${pkgdir}/usr/share/blender"

# install plugins
  install -d -m755 "$pkgdir"/usr/share/blender/${pkgver%[a-z]}/plugins/{sequence,texture}
  cp "$srcdir"/${pkgname}-$pkgver/source/blender/blenpluginapi/sequence/*.so \
    "$pkgdir"/usr/share/blender/${pkgver%[a-z]}/plugins/sequence/
  cp "$srcdir"/${pkgname}-$pkgver/source/blender/blenpluginapi/texture/*.so \
    "$pkgdir"/usr/share/blender/${pkgver%[a-z]}/plugins/texture/
}