summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartus2020-03-03 18:26:57 +0100
committerbartus2020-03-03 18:33:19 +0100
commit9fae1450dbba06d37269f06e63e1db6a256ec330 (patch)
treeaac90d92ef5f834ab4dae9f80996d5cdba7b9d15
parenta6b4739948cdc5f5162055d4acac06799301e887 (diff)
downloadaur-9fae1450dbba.tar.gz
Refactor.
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD152
2 files changed, 84 insertions, 77 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6d5da073a56..149a2c34176 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,18 @@
pkgbase = blender-2.8-git
pkgdesc = Development version of Blender 2.8 branch
- pkgver = 2.83.r93807.g78383f7a9f9
+ pkgver = 2.83.r93810.g2841b2be394
pkgrel = 1
url = https://blender.org/
arch = i686
arch = x86_64
license = GPL
+ makedepends = ninja
makedepends = git
makedepends = cmake
makedepends = boost
makedepends = mesa
makedepends = llvm
- makedepends = ninja
+ depends = embree
depends = alembic
depends = libgl
depends = python
@@ -24,15 +25,13 @@ pkgbase = blender-2.8-git
depends = libxi
depends = openimageio
depends = opencolorio
- depends = openimagedenoise
depends = openvdb
depends = opencollada
depends = opensubdiv
depends = openshadinglanguage
depends = libtiff
depends = libpng
- depends = embree
- depends = usd=19.11
+ depends = openimagedenoise
optdepends = cuda: CUDA support in Cycles
provides = blender-2.83
conflicts = blender-2.83
diff --git a/PKGBUILD b/PKGBUILD
index a31bd8b9991..cfbd52547f0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,31 +1,41 @@
+#!/bin/hint/bash
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>
-# shellcheck disable=SC2034
+# shellcheck disable=SC2034,SC2154 # allow unused/unset variables
+# shellcheck disable=SC2191 # preserve current _CMAKE_FLAGS initialization.
-#to enforce cuda verison uncomment this line and update value of sm_xx model accordingly
+# To force cuda compute arch uncomment this line and update value of sm_xx model accordingly
#_cuda_capability+=(sm_30 sm_35 sm_37)
#_cuda_capability+=(sm_50 sm_52 sm_60 sm_61 sm_70 sm_75)
-((TRAVIS)) && _cuda_capability+=(sm_50 sm_52 sm_60 sm_61 sm_70 sm_75) # suppress 3.x to prevent Travis build exceed time limit.
+((TRAVIS)) && _cuda_capability+=(sm_50 sm_52 sm_60 sm_61 sm_70 sm_75) # Travis memory limit is not enough to build for arch 3.x.
-#some extra, not officially supported stuff goes here:
-_EXTRAOPTS+=( -DWITH_ALEMBIC_HDF5=ON
- -DWITH_CYCLES_EMBREE=ON
- -DWITH_USD=ON
- -DUSD_ROOT=/usr
- )
+# Configuration.
+_fragment="#branch=master"
+#some extra, unofficially supported stuff goes here:
+_CMAKE_FLAGS+=( -DWITH_ALEMBIC_HDF5=ON )
+((DISABLE_EMBREE)) || {
+ _CMAKE_FLAGS+=( -DWITH_CYCLES_EMBREE=ON )
+ depends+=(embree)
+}
+((DISABLE_USD)) || {
+ _CMAKE_FLAGS+=( -DWITH_USD=ON
+ -DUSD_ROOT=/usr )
+ depends+=( usd=19.11 )
+}
+((DISABLE_NINJA)) || makedepends+=('ninja')
+#shellcheck disable=SC2015
+((DISABLE_CUDA)) && optdepends+=('cuda: CUDA support in Cycles') || { makedepends+=('cuda') ; ((DISABLE_OPTIX)) || makedepends+=('optix>=7.0'); }
pkgname=blender-2.8-git
-_fragment="#branch=master"
-pkgver=2.83.r93807.g78383f7a9f9
+pkgver=2.83.r93810.g2841b2be394
pkgrel=1
pkgdesc="Development version of Blender 2.8 branch"
arch=('i686' 'x86_64')
url="https://blender.org/"
depends+=('alembic' 'libgl' 'python' 'python-numpy' 'openjpeg'
- 'ffmpeg' 'fftw' 'openal' 'freetype2' 'libxi' 'openimageio' 'opencolorio' 'openimagedenoise'
- 'openvdb' 'opencollada' 'opensubdiv' 'openshadinglanguage' 'libtiff' 'libpng' 'embree' 'usd=19.11')
-makedepends=('git' 'cmake' 'boost' 'mesa' 'llvm')
-((DISABLE_NINJA)) || makedepends+=('ninja')
-((DISABLE_CUDA)) && optdepends=('cuda: CUDA support in Cycles') || { makedepends+=('cuda') ; ((DISABLE_OPTIX)) || makedepends+=('optix>=7.0'); }
+ 'ffmpeg' 'fftw' 'openal' 'freetype2' 'libxi' 'openimageio' 'opencolorio'
+ 'openvdb' 'opencollada' 'opensubdiv' 'openshadinglanguage' 'libtiff' 'libpng')
+depends+=('openimagedenoise')
+makedepends+=('git' 'cmake' 'boost' 'mesa' 'llvm')
provides=("blender-${pkgver%%.r*}")
conflicts=("blender-${pkgver%%.r*}")
license=('GPL')
@@ -62,84 +72,82 @@ pkgver() {
}
prepare() {
- cd "$srcdir/blender"
# update the submodules
- git submodule update --init --recursive --remote
- if [ -z "$_cuda_capability" ] && grep -q nvidia <(lsmod); then
- git apply -v ${srcdir}/SelectCudaComputeArch.patch
+ git -C "$srcdir/blender" submodule update --init --recursive --remote
+ if [ -v _cuda_capability ] && grep -q nvidia <(lsmod); then
+ git -C "$srcdir/blender" apply -v "${srcdir}"/SelectCudaComputeArch.patch
fi
- git apply -v ${srcdir}/usd_python.patch
- git apply -v ${srcdir}/embree.patch
+ ((DISABLE_USD)) || git -C "$srcdir/blender" apply -v "${srcdir}"/usd_python.patch
+ ((DISABLE_EMBREE)) || git -C "$srcdir/blender" apply -v "${srcdir}"/embree.patch
}
build() {
- mkdir -p "$srcdir/blender-build"
- cd "$srcdir/blender-build"
-
+ mkdir -p "$srcdir/build"
+
_pyver=$(python -c "from sys import version_info; print(\"%d.%d\" % (version_info[0],version_info[1]))")
msg "python version detected: ${_pyver}"
# determine whether we can precompile CUDA kernels
- _CUDA_PKG=`pacman -Qq cuda 2>/dev/null` || true
- if [ "$_CUDA_PKG" != "" ] && ! ((DISABLE_CUDA)) ; then
- _EXTRAOPTS+=( -DWITH_CYCLES_CUDA_BINARIES=ON
- -DCUDA_TOOLKIT_ROOT_DIR=/opt/cuda
- -DOPTIX_ROOT_DIR=/opt/optix )
- if [ -v _cuda_capability ]; then
- _EXTRAOPTS+=(-DCYCLES_CUDA_BINARIES_ARCH=$(IFS=';'; echo "${_cuda_capability[*]}";))
- fi
- [ -f "/usr/lib/ccache/bin/nvcc-ccache" ] && _CMAKE_FLAGS+=( -DCUDA_NVCC_EXECUTABLE=/usr/lib/ccache/bin/nvcc-ccache )
- if _cuda_gcc=$(basename $(readlink /opt/cuda/bin/gcc)) ; then
- [ -L "/usr/lib/ccache/bin/$_cuda_gcc" ] && _CMAKE_FLAGS+=( -DCUDA_HOST_COMPILER=/usr/lib/ccache/bin/$_cuda_gcc )
- fi
+ if pacman -Qq cuda 2>&- ; then
+ _CMAKE_FLAGS+=( -DWITH_CYCLES_CUDA_BINARIES=ON
+ -DCUDA_TOOLKIT_ROOT_DIR=/opt/cuda )
+ ((DISABLE_OPTIX)) || _CMAKE_FLAGS+=( -DOPTIX_ROOT_DIR=/opt/optix )
+ if [[ -v _cuda_capability ]]; then
+ _CMAKE_FLAGS+=( -DCYCLES_CUDA_BINARIES_ARCH="$(IFS=';'; echo "${_cuda_capability[*]}";)" )
+ fi
+ [ -f "/usr/lib/ccache/bin/nvcc-ccache" ] && _CMAKE_FLAGS+=( -DCUDA_NVCC_EXECUTABLE=/usr/lib/ccache/bin/nvcc-ccache )
+ if _cuda_gcc=$(basename "$(readlink /opt/cuda/bin/gcc)") ; then
+ [ -L "/usr/lib/ccache/bin/$_cuda_gcc" ] && _CMAKE_FLAGS+=( -DCUDA_HOST_COMPILER=/usr/lib/ccache/bin/"$_cuda_gcc" )
+ fi
fi
((DISABLE_NINJA)) && generator="Unix Makefiles" || generator="Ninja"
- cmake -G "$generator" "$srcdir/blender" \
- -C${srcdir}/blender/build_files/cmake/config/blender_release.cmake \
+ cmake -G "$generator" -S "$srcdir/blender" -B "$srcdir/build" \
+ -C "${srcdir}/blender/build_files/cmake/config/blender_release.cmake" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_INSTALL_PORTABLE=OFF \
-DWITH_SYSTEM_GLEW=ON \
-DWITH_PYTHON_INSTALL=OFF \
- -DPYTHON_VERSION=${_pyver} \
- ${_EXTRAOPTS[@]}
+ -DPYTHON_VERSION="${_pyver}" \
+ "${_CMAKE_FLAGS[@]}"
export NINJA_STATUS="[%p | %f<%r<%u | %cbps ] "
- ((DISABLE_NINJA)) && make || ninja $([ -v MAKEFLAGS ] || echo -j1) -d stats
+# shellcheck disable=SC2086 # allow MAKEFLAGS to split when multiple flags provided.
+ if ((DISABLE_NINJA)); then make -C "$srcdir/build" ; else ninja -C "$srcdir/build" ${MAKEFLAGS:--j1}; fi
}
package() {
- cd "$srcdir/blender-build"
- ((DISABLE_NINJA)) && make install DESTDIR="$pkgdir" || DESTDIR="$pkgdir" ninja install
-
- msg "add -${pkgver%%.r*} sufix to desktop shortcut"
- sed -i "s/=blender/=blender-${pkgver%%.r*}/g" ${pkgdir}/usr/share/applications/blender.desktop
- sed -i "s/=Blender/=Blender-${pkgver%%.r*}/g" ${pkgdir}/usr/share/applications/blender.desktop
- mv ${pkgdir}/usr/share/applications/blender.desktop ${pkgdir}/usr/share/applications/blender-${pkgver%%.r*}.desktop
-
- msg "add -${pkgver%%.r*} sufix to binaries"
- mv ${pkgdir}/usr/bin/blender ${pkgdir}/usr/bin/blender-${pkgver%%.r*}
- mv ${pkgdir}/usr/bin/blender-thumbnailer.py ${pkgdir}/usr/bin/blender-${pkgver%%.r*}-thumbnailer.py
-# mv ${pkgdir}/usr/bin/blenderplayer ${pkgdir}/usr/bin/blenderplayer-${pkgver%%.r*}
-
- msg "mv doc/blender to doc/blender-${pkgver%%.r*}"
- mv ${pkgdir}/usr/share/doc/blender ${pkgdir}/usr/share/doc/blender-${pkgver%%.r*}
-
- msg "add -${pkgver%%.r*} sufix to man page"
- mv ${pkgdir}/usr/share/man/man1/blender.1 ${pkgdir}/usr/share/man/man1/blender-${pkgver%%.r*}
-
- msg "add -${pkgver%%.r*} sufix to all icons"
- for icon in `find ${pkgdir}/usr/share/icons -type f`
- do
- # ${filename##/*.} extra extenssion from path
- # ${filename%.*} extract filename form path
- # look at bash "manipulatin string"
- mv $icon ${icon%.*}-${pkgver%%.r*}.${icon##/*.}
- done
-
- if [ -e "$pkgdir"/usr/share/blender/*/scripts/addons/cycles/lib/ ] ; then
+ _suffix=${pkgver%%.r*}
+ export DESTDIR="$pkgdir"
+ if ((DISABLE_NINJA)); then make -C "$srcdir/build" install; else ninja -C "$srcdir/build" install; fi
+
+ msg "add -${_suffix} suffix to desktop shortcut"
+ sed -i "s/=blender/=blender-${_suffix}/g" "${pkgdir}/usr/share/applications/blender.desktop"
+ sed -i "s/=Blender/=Blender-${_suffix}/g" "${pkgdir}/usr/share/applications/blender.desktop"
+ mv "${pkgdir}/usr/share/applications/blender.desktop" "${pkgdir}/usr/share/applications/blender-${_suffix}.desktop"
+
+ msg "add -${_suffix} suffix to binaries"
+ mv "${pkgdir}/usr/bin/blender" "${pkgdir}/usr/bin/blender-${_suffix}"
+ mv "${pkgdir}/usr/bin/blender-thumbnailer.py" "${pkgdir}/usr/bin/blender-${_suffix}-thumbnailer.py"
+
+ msg "mv doc/blender to doc/blender-${_suffix}"
+ mv "${pkgdir}/usr/share/doc/blender" "${pkgdir}/usr/share/doc/blender-${_suffix}"
+
+ msg "add -${_suffix} suffix to man page"
+ mv "${pkgdir}/usr/share/man/man1/blender.1" "${pkgdir}/usr/share/man/man1/blender-${_suffix}.1"
+
+ msg "add -${_suffix} suffix to all icons"
+ while read -r icon
+ do
+ # ${filename##/*.} extra extenssion from path
+ # ${filename%.*} extract filename form path
+ # look at bash "manipulatin string"
+ mv "$icon" "${icon%.*}-${_suffix}.${icon##/*.}"
+ done < <(find "${pkgdir}/usr/share/icons" -type f)
+
+ if [[ -e "$pkgdir/usr/share/blender/${_suffix}/scripts/addons/cycles/lib/" ]] ; then
# make sure the cuda kernels are not stripped
- chmod 444 "$pkgdir"/usr/share/blender/*/scripts/addons/cycles/lib/*
+ chmod 444 "$pkgdir/usr/share/blender/${_suffix}/scripts/addons/cycles/lib/*"
fi
}
# vim:set sw=2 ts=2 et: