summaryrefslogtreecommitdiff
path: root/libre/blender-libre/PKGBUILD
blob: f386e5e6c5d2b477cb87011c525734e483057939 (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Maintainer: Márcio Silva <coadde@lavabit.com>

_pkgname=blender
epoch=10
_pkgver=2.68a
pkgrel=2
_jpgver=1.5
_pyver=3.3

_spn=false
[[ $_spn == true ]] && {
  _spnname=-spacenav
  _spndesc=' (with spacenav support)'
}

pkgname=$_pkgname$_spnname-libre
pkgver=$_pkgver
pkgdesc='Fully integrated 3D graphics creation suite, without nonfree povray and cuda support'$_spndesc
arch=(
  mips64el
  x86_64
  i686
)
license=GPL
url=http://www.$_pkgname.org
depends=(
  desktop-file-utils
  ffmpeg
  fftw
  freetype2
  hicolor-icon-theme
  jack
  #jemalloc
  libpng
  libtiff
  openal
  openexr
  openimageio
  'opencollada=20130413'
  opencolorio
  openshadinglanguage
  shared-mime-info
  xdg-utils
)
[[ $_spn == true ]] && depends+=(libspnav)
optdepends=(
  'bullet: for Rigid Bodies and Physics Simulation'
  'xcftools: for import GIMP images to scene (pcr repo)'
)
makedepends=(
  boost
  cmake
  mesa
)
provides=($_pkgname)
[[ $_spn == true ]] && provides+=($_pkgname-libre)
conflicts=($_pkgname)
[[ $_spn == true ]] && conflicts+=($_pkgname-libre)
replaces=$_pkgname
install=$_pkgname.install
source=http://download.$_pkgname.org/source/$_pkgname-$pkgver.tar.gz
sha512sums=ce93779c5cbadf361f08ad0f9d5370d52878f94edc0b113d73711b842169d0e000e1500ece8e534439d94c5983e6ff3f15ca4ccd74db5f21447274c475090019

prepare() {
  cd $srcdir/$_pkgname-$pkgver

  msg 'renaming wrong OS name'
  _OS=$(uname -o)
  [[ $_OS == GNU ]] && sed -i 's|BUILD_PLATFORM;|"GNU";|' source/creator/buildinfo.c
  [[ $_OS == GNU/Linux ]] && sed -i 's|BUILD_PLATFORM;|"GNU/Linux-libre";|' source/creator/buildinfo.c
  sed -i 's|Linux, Mac OS X, Windows and FreeBSD|GNU and GNU/Linux-libre|
          s|Linux, FreeBSD|GNU, GNU/Linux-libre|
         ' release/text/readme.html

  msg 'removing Open Source term'
  sed -i 's|free, open source|free|' release/text/readme.html

  mkdir -v build

  msg 'Remove nonfree povray render support'
  rm -vr release/scripts/addons/render_povray
}

build() {
  cd $srcdir/$_pkgname-$pkgver/build

  [[ $CARCH == x86_64 || $CARCH == i686 ]] && _SSE=ON _SSE2=ON || _SSE=OFF _SSE2=OFF
  [[ $_spn == true ]] && _NDOF=ON || _NDOF=OFF
  cmake ..\
    -DCMAKE_BUILD_TYPE=Release\
    -DCMAKE_INSTALL_PREFIX=/usr\
    -DOPENIMAGEIO_ROOT_DIR=/usr\
    -DOPENJPEG_INCLUDE_DIR=/usr/include/openjpeg-$_jpgver\
    -DPYTHON_INCLUDE_DIRS=/usr/include/python${_pyver}m\
    -DPYTHON_LIBPATH=/usr/lib\
    -DPYTHON_LIBRARY=python${_pyver}m\
    -DPYTHON_VERSION=$_pyver\
    -DSUPPORT_SSE_BUILD=$_SSE\
    -DSUPPORT_SSE2_BUILD=$_SSE2\
    -DWITH_BULLET=ON\
    -DWITH_CODEC_FFMPEG=ON\
    -DWITH_CODEC_SNDFILE=ON\
    -DWITH_CYCLES=ON\
    -DWITH_CYCLES_CUDA_BINARIES=OFF\
    -DWITH_CYCLES_OSL=ON\
    -DWITH_FFTW3=ON\
    -DWITH_GAMEENGINE=ON\
    -DWITH_IMAGE_REDCODE=ON\
    -DWITH_INPUT_NDOF=$_NDOF\
    -DWITH_INSTALL_PORTABLE=OFF\
    -DWITH_JACK=ON\
    -DWITH_JACK_DYNLOAD=OFF\
    -DWITH_MEM_JEMALLOC=OFF\
    -DWITH_MOD_OCEANSIM=ON\
    -DWITH_OPENCOLLADA=ON\
    -DWITH_PLAYER=ON\
    -DWITH_PYTHON_INSTALL=OFF\
    -DWITH_SYSTEM_GLEW=ON
  make $MAKEFLAGS
  make
}

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

# vim:set ts=2 sw=2 et: