summaryrefslogtreecommitdiff
path: root/pcr/mitsuba/PKGBUILD
blob: f2d7f83b0d5741b0276aaef8da28277589ff312e (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
# Maintainer: Márcio Silva <coadde@lavabit.com>

pkgname=(
  mitsuba
  blender-addon-mitsuba
)
_pkgname=${pkgname[0]}
_bldname=${pkgname[1]::7}
_addname=$_pkgname-$_bldname
pkgver=0.4.4
_bldver=2.67
_addver=0.2.1 # Wed Mar 20 01:30:37 2013 +0100 rev:40 ($srcdir/$_addname/${pkgname[0]}/__init__.py:bl_info>version)
_adddat=20130320
_addrev=40
_bldep=8
_pyver=3.3
pkgrel=3
pkgdesc='A physically based renderer'
arch=(
  i686
  x86_64
  mips64el
)
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
)
install=$_pkgname.install
source=(
  ${url}hg/$_pkgname/archive/v$pkgver.tar.bz2
  hg+${url}hg/$_addname
  ${pkgname[1]}.install
)
sha512sums=(
  66dcab376a44eeb2fbe808a32ead5b554d777fb2f6a73c43883086b7829e0c697aaeccbb6fbbed9fcb221684a64ccce8be81a78ebcd228316ea12b8f6f3e7f6c
  SKIP SKIP
)

prepare() {
  mv $srcdir/${pkgname[1]}.install $startdir

  cd $srcdir/$_pkgname-v$pkgver

  [[ -d build ]] && rm -r build
  mkdir build

  cd $startdir/../srcdest/$_addname

  msg "${pkgname[1]}"
  hg update -c -r $_addrev
  hg log -l 1 -r $_addrev
}

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

  [[ $CARCH != x86_64 ]] && DMTS_SSE='-DMTS_SSE=OFF'

  setarch $CARCH cmake .. -DCMAKE_INSTALL_PREFIX=/usr\
    $DMTS_SSE\
    -DBoost_PYTHON_LIBRARY=/usr/lib/libboost_python${_pyver::1}.so\
    -DPYTHON_INCLUDE_DIR=/usr/include/python${_pyver}m\
    -DPYTHON_LIBRARY=/usr/lib/libpython${_pyver}m.so
  setarch $CARCH make
}

package_mitsuba() {
  cd $srcdir/$_pkgname-v$pkgver/build
  setarch $CARCH make DESTDIR=$pkgdir install

  #fixing files and folders location
  a=$pkgdir/usr
  b=$srcdir/$_pkgname-v$pkgver
  install -d $a/{bin,lib{,/python$_pyver/lib-dynload},share/{applications,{licenses/,}$_pkgname,pixmaps}}
  install -m644 $b/data/linux/$_pkgname.desktop           $a/share/applications
  install -m644 $b/src/mtsgui/resources/${_pkgname}48.png $a/share/pixmaps
  install -m644 $b/doc/license.txt                        $a/share/licenses/$_pkgname/LICENSE
  mv $a/{m{itsuba,ts{gui,import,srv,util}},bin}
  mv $a/lib{${pkgname[0]}-{bidir,core,hw,render}.so,}
  mv $a/{{data,plugins},share/$_pkgname}
  mv $a/{python/mitsuba.so,lib/python$_pyver/lib-dynload}
  mv $a/{sdk/include,}
  rmdir $a/{python,sdk}
}

package_blender-addon-mitsuba() {
  _pkgname=${pkgname:14}
  _pkgver=$pkgver
  pkgver=$_addver.r$_addrev.v$_bldver
  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>=$(($_bldep-1)):$_bldver"
    "$_bldname<$_bldep:${_bldver::2}$((${_bldver:2:4}+1))"
  )
  optdepends=
  install=$pkgname.install

  cd $srcdir/$_addname

  a=$pkgdir/usr/share/$_bldname/$_bldver/scripts/addons
  b=$pkgdir/usr/share/licenses/$pkgname
  c=$srcdir/$_pkgname-v$_pkgver/doc/license.txt

  install -d $a && cp -a $_pkgname $a
  install -d $b && install -m644 $c $b/LICENSE
}

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