summaryrefslogtreecommitdiff
path: root/libre/blender-addon-luxrender/PKGBUILD
blob: 3d36463fbb00b262ee44e83e41322c47ccac8a86 (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
# Maintainer: Márcio Silva <coadde@parabola.nu>

_pkgname=luxrender
_pkgver=1.5.1
_pkgverM=${_pkgver%.*}
_bldname=blender
_bldver=2.77
_bldep=17
_srcname=${_pkgname::3}${_bldname::5}25
_srcver=63e44ef60fb4

pkgname=$_bldname-addon-$_pkgname
if [[ ${_pkgver/*./} == 0 ]]; then
  pkgver=${_pkgver/.*/}.${_pkgverM#*.}.v$_bldver
  provides=("$_srcname=${_pkgver/.*/}.${_pkgverM#*.}")
else
  pkgver=$_pkgver.v$_bldver
  provides=("$_srcname=$_pkgver")
fi
pkgrel=1
pkgdesc="$_srcname: A addon for the ${_bldname^} which allows render and export with LuxRender (built for the $_bldname package)"
arch=('any')
url="http://www.$_pkgname.net/"
license=('GPL2')
conflicts=("$_srcname")
replaces=("$_srcname")
if [[ ${_pkgver/*./} == 0 ]]; then
  source=("$pkgname-$pkgver.tar.bz2::https://bitbucket.org/$_pkgname/$_srcname/get/v${_pkgver/.*/}${_pkgverM#*.}.tar.bz2")
else
  source=("$pkgname-$pkgver.tar.bz2::https://bitbucket.org/$_pkgname/$_srcname/get/v${_pkgver/.*/}${_pkgverM#*.}${_pkgver/*./}.tar.bz2")
fi
source+=('system_config.diff' "$_pkgname.cfg"
         'http://www.gnu.org/licenses/gpl-2.0.txt')
sha512sums=('5d78c880a37418fada0b45c875e14aaf0114f5e9e41ae7900a4acb527d7c12e67a5afbc55d825c8b8244e5de6beb5d15ddb9bb5717a235c824d1f0f5b5c65f0c'
            'd34aeff49c1ca5406b5a3176efc2b31a319109dcb193248aec792f8b12755b6e76fb864394d0d459408135c67033e06d365a516171f56b4f874a7ee0c576fbc3'
            '9d27216c8fe2457a36e6d23537cb46a6d1eb2981c2413980aa0a06c4017fc6eee9fa008266457f13d4119d77607b5d07c238c2e794e24b1c00f9da4577dcc4c5'
            'aee80b1f9f7f4a8a00dcf6e6ce6c41988dcaedc4de19d9d04460cbfb05d99829ffe8f9d038468eabbfba4d65b38e8dbef5ecf5eb8a1b891d9839cda6c48ee957')

prepare() {
  cd "$srcdir"/$_pkgname-$_srcname-$_srcver

  # enables loading of the configuration from a system-wide config file
  patch -Np1 < "$srcdir/system_config.diff" || true
}

package() {
  _relver="${_bldver%%[.r][a-z]*}"
  _minver="${_relver#*.}"
  depends=("$_bldname>=$_bldep:${_bldver%%[.r][a-z]*}rc1" "$_bldname<$_bldep:${_bldver%%[.r]*}.$(($_minver+1))rc1" "$_pkgname")

  a=$srcdir/$_pkgname-$_srcname-$_srcver/src/$_pkgname
  b=$pkgdir/usr/share/$_bldname/$_bldver/scripts/addons
  c=$pkgdir/usr/share/licenses/$pkgname

  # install luxblend25 addon
  install -vd $b && cp -va $a $b
  # install luxblend25 license file
  install -vd $c && install -vm644 $startdir/gpl-2.0.txt $c/GPL-v2.0

  # install luxrender config file so the luxblend find luxrender automatically
  install -Dm644 $_pkgname.cfg $b/../$_pkgname.cfg

  # change the search path for pylux* so the pylux* can be found in its new location
  find "$b/$_pkgname" -name "*.py" \
    -exec sed -i 's|from.*import pylux|import pylux|' '{}' ';'
}

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