summaryrefslogtreecommitdiff
path: root/pcr/yafaray
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/yafaray')
-rw-r--r--pcr/yafaray/PKGBUILD132
-rw-r--r--pcr/yafaray/std_namespace_usage.patch14
2 files changed, 46 insertions, 100 deletions
diff --git a/pcr/yafaray/PKGBUILD b/pcr/yafaray/PKGBUILD
index 73a0d8975..fe09f7343 100644
--- a/pcr/yafaray/PKGBUILD
+++ b/pcr/yafaray/PKGBUILD
@@ -1,114 +1,46 @@
-# Maintainer: Márcio Silva <coadde@hyperbola.info>
+# Maintainer (AUR): Jakob Gahde <j5lx@fmail.co.uk>
+# Contributor (AUR): Thomas Ascher <thomas.ascher@gmx.at>
+# Contributor: Márcio Silva <coadde@hyperbola.info>
-_build_pkg=yes
-_build_add=yes
+# parabola changes and rationale:
+# - removed "open source" term from pkgdesc
-[[ $_build_pkg != yes && $_build_pkg != no ]] && _build_pkg=yes
-[[ $_build_add != yes && $_build_add != no ]] && _build_add=yes
-[[ $_build_pkg == no && $_build_add == no ]] && _build_add=yes
-
-_pkgname=yafaray
-_pkgver=0.1.5
-_pkgverM=${_pkgver%.*}
-_pkgdat=20140508
-_pkgrev=ff262af4b50a90dcf39da04040b53509d7dc789d
-_pkgrel=1
-_bldname=blender
-_bldver=2.71
-_bldep=14
-_addname=$_bldname-addon-$_pkgname
-_addver=$_pkgver # __init__.py:bl_info>version
-_adddat=20140425
-_addrev=c3d4ff74593d5bd9552306f597f6b36e342687da
-_addrel=3
-_pyver=3.4
-
-pkgbase=$_pkgname
-[[ $_build_pkg == yes ]] && pkgname+=("$_pkgname")
-[[ $_build_add == yes ]] && pkgname+=("$_bldname-addon-$_pkgname")
-pkgver=$_pkgver.$_pkgdat
-pkgrel=$_pkgrel
+pkgname=yafaray
+pkgver=0.1.5
+pkgrel=2
+pkgdesc="A free montecarlo raytracing engine"
arch=('i686' 'x86_64')
-url="http://www.$_pkgname.org"
-[[ $_build_pkg == yes ]] && depends=('freetype2' 'libjpeg' 'libxml2' 'openexr')
-[[ $_build_pkg == yes ]] && makedepends=('cmake' 'python' 'qt4' 'swig')
-[[ $_build_pkg == yes ]] && source+=("$_pkgname-$_pkgver.$_pkgrev.tar.gz::https://github.com/YafaRay/Core/archive/$_pkgrev.tar.gz")
-[[ $_build_add == yes ]] && source+=("$_addname-$_addver.$_addrev.tar.gz::https://github.com/YafaRay/${_bldname^}-Exporter/archive/$_addrev.tar.gz")
-[[ $_build_pkg == yes ]] && sha512sums+=('089373ebe702361ccd5a8b8ee789188bdb569338f0f406f2fe5e355ef69d2de5f793a5b9e5f85e998fd0b5a42500124d0d35bffee00d177e710347a1a107228e')
-[[ $_build_add == yes ]] && sha512sums+=('38b85b14ccf0042012de0e8791ed9264ff389b223ef033f2c9daeccb0388a483c38f9a8aa178819183795ff5dd37c5cdd201f2af23d5e28231bffad7deecd523')
-
-_prepare_yafaray() {
- msg 'Renaming source dir'
- mv -v $srcdir/Core-$_pkgrev $srcdir/$_pkgname-$_pkgver.$_pkgrev
-
- cd $srcdir/$_pkgname-$_pkgver.$_pkgrev
-
- [[ -d build ]] && rm -vr build
- mkdir -v build
-}
-
-_prepare_blender-addon-yafaray() {
- msg 'Renaming addon dir'
- mv -v $srcdir/${_bldname^}-Exporter-$_addrev $srcdir/$_addname-$_addver.$_addrev
-
- cd $srcdir/$_addname-$_addver.$_addrev
-
- msg 'renaming wrong OS name'
- sed -i 's|Linux|GNU/Linux|
- ' prop/yaf_scene.py
-}
+url="http://yafaray.org/"
+license=('LGPL2.1')
+depends=('openexr' 'qt4')
+optdepends=('python: Python bindings')
+makedepends=('cmake' 'swig' 'python')
+source=("https://github.com/YafaRay/Core/archive/${pkgver}.tar.gz"
+ "std_namespace_usage.patch")
+md5sums=('31202a7bee930b2698c665ef6513bd7b'
+ 'a98b23496e975bf91f9d97092d794d0c')
prepare() {
- [[ $_build_pkg == yes ]] && _prepare_yafaray
- [[ $_build_add == yes ]] && _prepare_blender-addon-yafaray
-}
-
-_build_yafaray() {
- cd $srcdir/$_pkgname-$_pkgver.$_pkgrev/build
+ cd "${srcdir}/Core-${pkgver}"
- cmake .. -DCMAKE_INSTALL_PREFIX=/usr\
- -DYAF_PY_VERSION=$_pyver\
- -DYAF_BINDINGS_PY_DIR=/usr/lib/python$_pyver
- make
+ patch -Np1 < "${srcdir}/std_namespace_usage.patch"
}
-[[ $_build_pkg == yes ]] && build() { _build_yafaray; }
-
-package_yafaray() {
- pkgdesc='A free software raytracing engine'
- license=('LGPL2.1')
- optdepends=('python: Python bindings'
- 'qt4: QT GUI'
- "$_addname: ${_bldname^} addon renderer")
-
- cd $srcdir/$_pkgname-$_pkgver.$_pkgrev/build
- make DESTDIR=$pkgdir install
- b=$pkgdir/usr/share/licenses/$pkgname
+build() {
+ cd "${srcdir}/Core-${pkgver}"
- install -vd $b && install -vm644 ../LICENSE $b/LGPL-v2.1
+ # Delete the build directory if it exists to avoid confusion caused by CMake's caches
+ test -d build && rm -rf build
+ mkdir build && cd build
+ cmake -DCMAKE_INSTALL_PREFIX=/usr \
+ -DYAF_PY_VERSION=3.5 \
+ -DYAF_BINDINGS_PY_DIR=/usr/lib/python3.4 ..
+ make
}
-package_blender-addon-yafaray() {
- pkgver=$_addver.$_adddat.v$_bldver
- pkgrel=$_addrel
- pkgdesc="A addon for the ${_bldname^} which allows render with YafaRay (built for the $_bldname package)"
- arch=('any')
- license=('GPL2')
- depends=("$_pkgname>=$_pkgver" "$_pkgname<${_pkgver/.*/}.$((${_pkgverM#*.}+1)).$((${_pkgver/*./}==0))" "$_bldname>=$_bldep:$_bldver" "$_bldname<$(($_bldep+1)):${_bldver/.*/}.$((${_bldver/*./}+1))")
- makedepends=()
-
- cd $srcdir/$_addname-$_addver.$_addrev
-
- a=$pkgdir/usr/share/$_bldname/$_bldver/scripts/addons
- b=$pkgdir/usr/share/licenses/$pkgname
-
- install -vd $a && cp -va ../$_addname-$_addver.$_addrev $a/$_pkgname
- install -vd $b && install -vm644 GPL-license.txt $b/GPL-v2.0
+package() {
+ cd "${srcdir}/Core-${pkgver}/build"
- install -vd $a/$_pkgname/bin
- ln -vsf /usr/lib/lib${_pkgname}core.so $a/$_pkgname/bin/lib${_pkgname}core.so
- ln -vsf /usr/lib/lib${_pkgname}plugin.so $a/$_pkgname/bin/lib${_pkgname}plugin.so
- ln -vsf /usr/lib/$_pkgname $a/$_pkgname/bin/plugins
+ make DESTDIR="${pkgdir}" install
}
-# vim:set ts=2 sw=2 et:
diff --git a/pcr/yafaray/std_namespace_usage.patch b/pcr/yafaray/std_namespace_usage.patch
new file mode 100644
index 000000000..b6e580674
--- /dev/null
+++ b/pcr/yafaray/std_namespace_usage.patch
@@ -0,0 +1,14 @@
+diff -aur package.pristine/include/core_api/color.h package.new/include/core_api/color.h
+--- package.pristine/include/core_api/color.h 2016-09-17 09:48:53.039092315 +0200
++++ package.new/include/core_api/color.h 2016-09-17 09:52:04.724350559 +0200
+@@ -53,8 +53,8 @@
+ color_t(CFLOAT g) { R=G=B=g; }
+ color_t(CFLOAT af[3]) { R=af[0]; G=af[1]; B=af[2]; }
+ bool isBlack() const { return ((R==0) && (G==0) && (B==0)); }
+- bool isNaN() const { return (isnan(R) || isnan(G) || isnan(B)); }
+- bool isInf() const { return (isinf(R) || isinf(G) || isinf(B)); }
++ bool isNaN() const { return (std::isnan(R) || std::isnan(G) || std::isnan(B)); }
++ bool isInf() const { return (std::isinf(R) || std::isinf(G) || std::isinf(B)); }
+ ~color_t() {}
+ void set(CFLOAT r, CFLOAT g, CFLOAT b) { R=r; G=g; B=b; }
+