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

pkgname=(
  yafaray-git
  blender-addon-yafaray-git
)
_pkgflag=git
_pkgname=${pkgname[0]%-$_pkgflag}
_bldname=${pkgname[1]::7}
_gitname=Core
_addname=${_bldname^}-Exporter
pkgver=$(LC_ALL=C date -u +%Y%m%d)
_pkgver=1.2
_bldver=2.66
_bldep=7
_pyver=3.3
pkgrel=1
pkgdesc='A libre software raytracing engine'
arch=(
  i686
  x86_64
  mips64el
)
url="http://www.$_pkgname.org"
license=LGPL2.1
depends=(
  freetype2
  libjpeg
  libxml2
  'openexr=2.0.0'
)
optdepends=(
  'python: Python bindings'
  'qt4: QT GUI'
  "${pkgname[1]}: ${_bldname^} addon renderer"
)
makedepends=(
  cmake
  git
  python
  qt4
  swig
)
provides=($_pkgname=$_pkgver)
conflicts=$_pkgname
source=(
  git://github.com/YafaRay/$_gitname.$_pkgflag
  git://github.com/YafaRay/$_addname.$_pkgflag
)
sha512sums=(SKIP SKIP)

prepare() {
  cd $srcdir/$_gitname

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

build() {
  cd $srcdir/$_gitname/build

  setarch $CARCH cmake .. -DCMAKE_INSTALL_PREFIX=/usr\
    -DYAF_PY_VERSION=$_pyver\
    -DYAF_BINDINGS_PY_DIR=/usr/lib/python$_pyver

  setarch $CARCH make
}

package_yafaray-git() {
  cd $srcdir/$_gitname/build
  setarch $CARCH make DESTDIR=$pkgdir install
}

package_blender-addon-yafaray-git() {
  pkgver=$pkgver.v$_bldver
  pkgdesc="A addon for the ${_bldname^} which allows render with YafaRay (built for the $_bldname-libre package)"
  arch=any
  depends=(
    ${pkgname:14}=${pkgver%.v$_bldver}
    "$_bldname>=$(($_bldep-1)):$_bldver"
    "$_bldname<$_bldep:${_bldver::2}$((${_bldver:2:4}+1))"
  )
  optdepends=''
  provides=(
    ${pkgname%-$_pkgflag}=$_pkgver.v$_bldver
    $_pkgname-$_bldname-exporter=$_pkgver.v$_bldver
    $_pkgname-$_bldname-exporter-$_pkgflag=$pkgver
  )
  conflicts=(
    ${pkgname%-$_pkgflag}
    $_pkgname-$_bldname-exporter
    $_pkgname-$_bldname-exporter-$_pkgflag
  )
  replaces=$_pkgname-$_bldname-exporter-$_pkgflag

  cd $srcdir/$_addname

  a=/usr/lib
  b=$pkgdir/usr/share/$_bldname/$_bldver/scripts/addons/$_pkgname/bin

  git checkout-index -a -f --prefix=${b%bin}

  install -d $b
  ln -sf $a/lib${_pkgname}core.so   $b/lib${_pkgname}core.so
  ln -sf $a/lib${_pkgname}plugin.so $b/lib${_pkgname}plugin.so
  ln -sf $a/$_pkgname               $b/plugins
}

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