summaryrefslogtreecommitdiff
path: root/libre/luxrays-parabola/PKGBUILD
blob: 8edc9ff1777c785b17fcc0b7a1ce4b4c24825f22 (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
# Maintainer (Arch): Lukas Jirkovsky <l.jirkovsky@gmail.com>
# Maintainer: Márcio Silva <ecoadde@parabola.nu>
_pkgname=('luxrays' 'luxmark')
#pkgname=('luxrays-parabola' 'luxmark-parabola')
pkgname=('luxrays-parabola')
pkgver=1.3.1
_pkgver=7459cd8a9583
pkgrel=5
pkgdesc="Accelerate the ray intersection process by using CPUs"
arch=('i686' 'x86_64' 'mips64el')
url="http://www.luxrender.net/"
license=('GPL')
#depends=('freeimage' 'libcl' 'libgl')
depends=('freeimage' 'libgl')
#makedepends=('cmake' 'boost' 'mesa' 'opencl-headers' 'glew' 'freeglut' 'qt4')
makedepends=('cmake' 'boost' 'mesa' 'glew' 'freeglut' 'qt4')
options=('staticlibs')
source=(https://bitbucket.org/luxrender/luxrays/get/$_pkgver.tar.bz2 \
        luxmark_scenes_path.diff QTBUG-22829.diff)
md5sums=('859999e5e07550553fb310a7f48530a4'
         '1fd2a6f32e2822b5e0f147304292a1b9'
         '6e20ee7ea64c578431d51065d0871abc')

prepare() {
  cd "$srcdir/luxrender-luxrays-$_pkgver"

  # change the path to luxmark scenes
  patch -Np1 < "$srcdir/luxmark_scenes_path.diff" || true

  # workaround QTBUG-22829 (moc doesn't work with boost headers)
  patch -Np1 < "$srcdir/QTBUG-22829.diff" || true
}

build() {
  cd "$srcdir/luxrender-luxrays-$_pkgver"

  export CXXFLAGS="$CXXFLAGS -lpthread"
  cmake -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_SKIP_RPATH=ON \
    -DLUXRAYS_DISABLE_OPENCL=ON \
    -DBUILD_LUXMARK=ON \
    .
  make
}

package_luxrays-parabola() {
  provides=("${_pkgname[0]}=${pkgver}")
  conflicts=("${_pkgname[0]}")
  replaces=("${_pkgname[0]}")
  optdepends=('glew: demos (SmallLuxGPU etc.)' 'freeglut: demos (SmallLuxGPU etc.)'
              'boost-libs: demos (SmallLuxGPU etc.)')

  cd "$srcdir/luxrender-luxrays-$_pkgver"

  install -d -m755 "$pkgdir"/usr/{bin,include,lib}
  install -m755 bin/* "$pkgdir"/usr/bin
  install -m644 lib/* "$pkgdir"/usr/lib
  cp -a include "$pkgdir"/usr

  # remove luxmark (packaged separately)
  #rm "$pkgdir"/usr/bin/luxmark
}

package_luxmark-parabola() {
  pkgdesc="OpenCL benchmark tool"
  depends+=("${depends[@]}" 'boost-libs' 'qt4')
  provides=("${_pkgname[1]}=${pkgver}")
  conflicts=("${_pkgname[1]}")
  replaces=("${_pkgname[1]}")

  cd "$srcdir/luxrender-luxrays-$_pkgver"
  install -d -m755 "$pkgdir"/usr/{bin,share/luxmark}
  #install -m755 bin/luxmark "$pkgdir"/usr/bin

  # install scenes (only luxball is working ATM)
  cp -a samples/luxmark/scenes/luxball  "$pkgdir"/usr/share/luxmark
  # fix the paths
  sed -i 's|scenes/|/usr/share/luxmark/|' "$pkgdir"/usr/share/luxmark/*/*.cfg "$pkgdir"/usr/share/luxmark/*/*.scn
}

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