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

pkgbase=yafaray
pkgname=(
  yafaray-git
  yafaray-blender-exporter-git
)
_pkgflag=git
pkgver=$(LC_ALL=C date -u +%Y%m%d)
_pkgver=1.2
_bldver=2.66
_bldepoch=6
_pyver=3.3
pkgrel=1
pkgdesc='A libre software raytracing engine'
arch=(
  i686
  x86_64
  mips64el
)
url="http://www.$pkgbase.org"
license=LGPL2.1
depends=(
  freetype2
  libjpeg
  libxml2
  openexr
)
optdepends=(
  'python: Python bindings'
  'qt4: QT GUI'
  #'ruby: Ruby bindings'
  'yafaray-blender-exporter-git: Blender exporter'
)
makedepends=(
  cmake
  git
  python
  qt4
  #ruby-headers
  swig
)
provides=(
  $pkgbase=$_pkgver
)
conflicts=$pkgbase

_gitroot="https://github.com/YafaRay/Core.git"
_gitname=$pkgbase
_gitrootexport="https://github.com/YafaRay/Blender-Exporter.git"
_gitnameexport=exporter

build() {
  cd $srcdir
  msg 'Connecting to GIT server....'

  # core
  if [[ -d $_gitname ]]; then
    cd $_gitname && git pull origin
    cd ..
    msg 'The local files are updated.'
  else
    git clone $_gitroot $_gitname
  fi
  # exporter
  if [[ -d $_gitnameexport ]]; then
    cd $_gitnameexport && git pull origin
    cd ..
    msg 'The local files are updated.'
  else
    git clone $_gitrootexport $_gitnameexport
  fi

  msg 'GIT checkout done or server timeout'
  msg 'Starting build...'

  if [ -e $srcdir/$_gitname-build ]; then
      rm -rf $srcdir/$_gitname-build
  fi
  mkdir $srcdir/$_gitname-build
  cd $srcdir/$_gitname-build

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

    #-DWITH_YAF_PY_BINDINGS=ON\
    #-DBLENDER_ADDON=ON\
    #-DBLENDER_EXPORTER_BRANCH=master\
    #-DWITH_YAF_RUBY_BINDINGS=ON\
    #-DYAF_USER_INCLUDE_DIRS=/usr/include/ruby-1.9.1/$CARCH-linux\

  setarch $CARCH make
}

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

package_yafaray-blender-exporter-git() {
  pkgver=$pkgver.v$_bldver
  pkgdesc='YafaRay exporter for Blender'
  arch=any
  depends=(
    $pkgbase=$pkgver
    "blender>=$_bldepoch:$_bldver"
  )
  provides=(
    ${pkgname[1]%-$_pkgflag}=$_pkgver.v$_bldver
  )
  conflicts=${pkgname[1]%-$_pkgflag}

  cd $srcdir/$_gitnameexport

  a=/usr/lib
  b=usr/share/blender/$bldver/scripts/addon/$pkgbase/bin

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

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

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