summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartus2020-05-04 14:00:57 +0200
committerbartus2020-05-04 14:02:38 +0200
commit61b8b5c502613b7a50e58176f59d751151a05341 (patch)
treeb123f767a2cab6b3f02eba7ca410ceec36e85331
parent602f8c8c5e0876e118dc1da1c71654c250ad0b6c (diff)
downloadaur-61b8b5c502613b7a50e58176f59d751151a05341.tar.gz
Refactor:
* fix dependencies * drop old desktop and install file * add nvcc-ccache logic * add configuration section
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD128
-rw-r--r--blender-2.7.desktop14
-rw-r--r--blender.install14
4 files changed, 67 insertions, 102 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 300f2fbe86a..03258a692dd 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,25 +1,22 @@
pkgbase = blender-2.7
pkgdesc = Blender 2.7 branch
pkgver = 2.79b.r71421.e045fe53f1b
- pkgrel = 2
+ pkgrel = 3
url = https://blender.org/
- install = blender.install
arch = i686
arch = x86_64
license = GPL
+ makedepends = ninja
makedepends = git
makedepends = cmake
makedepends = boost
makedepends = mesa
makedepends = llvm
- makedepends = ninja
depends = alembic
depends = libgl
depends = python
depends = python-numpy
- depends = openjpeg
- depends = desktop-file-utils
- depends = hicolor-icon-theme
+ depends = openjpeg2
depends = ffmpeg
depends = fftw
depends = openal
@@ -33,14 +30,13 @@ pkgbase = blender-2.7
depends = openshadinglanguage
depends = libtiff
depends = libpng
+ optdepends = cuda: CUDA support in Cycles
provides = blender-2.7
- options = !strip
source = git://git.blender.org/blender.git#branch=blender2.7
source = blender-addons.git::git://git.blender.org/blender-addons.git
source = blender-addons-contrib.git::git://git.blender.org/blender-addons-contrib.git
source = blender-translations.git::git://git.blender.org/blender-translations.git
source = blender-dev-tools.git::git://git.blender.org/blender-dev-tools.git
- source = blender-2.7.desktop
source = SelectCudaComputeArch.patch
source = stl_export_iter.patch
source = python3.7.patch
@@ -50,7 +46,6 @@ pkgbase = blender-2.7
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
- sha256sums = 5d489f24c7401574e79b755aead07c779449ae50a1c3299ad182588127697de1
sha256sums = 28e407e3aefdd9bd76805b6033ada0b5b41dd6183bcf4f58a642c109f10c1876
sha256sums = 649c21a12a1bfc0207078e1e58b4813a3e898c6dbbbb35d21e1de7c9e8f1985a
sha256sums = 47811284f080e38bcfbfb1f7346279245815a064df092989336b0bf3fe4530e9
diff --git a/PKGBUILD b/PKGBUILD
index 850c8eeb576..245bf84b2b0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,29 +1,30 @@
+#!/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
-#_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.
+# Configuration.
+_fragment=${FRAGMENT:-#branch=blender2.7}
+[[ -v CUDA_ARCH ]] && _cuda_capability=${CUDA_ARCH}
+
+#some extra, unofficially supported stuff goes here:
+((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.
+((DISABLE_NINJA)) || makedepends+=('ninja')
+#shellcheck disable=SC2015
+((DISABLE_CUDA)) && optdepends+=('cuda: CUDA support in Cycles') || makedepends+=('cuda')
pkgname=blender-2.7
-_fragment="#branch=blender2.7"
pkgver=2.79b.r71421.e045fe53f1b
-pkgrel=2
+pkgrel=3
pkgdesc="Blender 2.7 branch"
arch=('i686' 'x86_64')
url="https://blender.org/"
-depends=('alembic' 'libgl' 'python' 'python-numpy' 'openjpeg' 'desktop-file-utils' 'hicolor-icon-theme'
+depends+=('alembic' 'libgl' 'python' 'python-numpy' 'openjpeg2'
'ffmpeg' 'fftw' 'openal' 'freetype2' 'libxi' 'openimageio' 'opencolorio'
'openvdb' 'opencollada' 'opensubdiv' 'openshadinglanguage' 'libtiff' 'libpng')
-makedepends=('git' 'cmake' 'boost' 'mesa' 'llvm')
-((DISABLE_NINJA)) || makedepends+=('ninja')
-((DISABLE_CUDA)) && optdepends=('cuda: CUDA support in Cycles') || makedepends+=('cuda')
-
-options=(!strip)
+makedepends+=('git' 'cmake' 'boost' 'mesa' 'llvm')
provides=('blender-2.7')
license=('GPL')
-install=blender.install
# NOTE: the source array has to be kept in sync with .gitmodules
# the submodules has to be stored in path ending with git to match
# the path in .gitmodules.
@@ -34,7 +35,6 @@ source=("git://git.blender.org/blender.git${_fragment}"
'blender-addons-contrib.git::git://git.blender.org/blender-addons-contrib.git'
'blender-translations.git::git://git.blender.org/blender-translations.git'
'blender-dev-tools.git::git://git.blender.org/blender-dev-tools.git'
- blender-2.7.desktop
SelectCudaComputeArch.patch
stl_export_iter.patch
python3.7.patch
@@ -45,49 +45,47 @@ sha256sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
- '5d489f24c7401574e79b755aead07c779449ae50a1c3299ad182588127697de1'
'28e407e3aefdd9bd76805b6033ada0b5b41dd6183bcf4f58a642c109f10c1876'
'649c21a12a1bfc0207078e1e58b4813a3e898c6dbbbb35d21e1de7c9e8f1985a'
'47811284f080e38bcfbfb1f7346279245815a064df092989336b0bf3fe4530e9'
'229853b98bb62e1dec835aea6b2eab4c3dabbc8be591206573a3c1b85f10be59')
pkgver() {
+# shellcheck disable=SC2164
cd "$srcdir/blender"
printf "2.79b.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
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}/{python3.7,stl_export_iter,python3.8}.patch
+ git -C "$srcdir/blender" apply -v "${srcdir}"/{python3.7,stl_export_iter,python3.8}.patch
}
build() {
-
- mkdir -p "$srcdir/blender-build"
- cd "$srcdir/blender-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
+ _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)
- ((TRAVIS)) && _EXTRAOPTS+=(-DCUDA_NVCC_FLAGS="--ptxas-options=-w") # suppress all ptxas warnings in Travis build
- if [ "$_cuda_capability" != "" ]; then
- _EXTRAOPTS+=(-DCYCLES_CUDA_BINARIES_ARCH=$(IFS=';'; echo "${_cuda_capability[*]}";))
- fi
+ _CMAKE_FLAGS+=( -DWITH_CYCLES_CUDA_BINARIES=ON
+ -DCUDA_TOOLKIT_ROOT_DIR=/opt/cuda )
+ 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 \
@@ -95,46 +93,46 @@ build() {
-DWITH_GL_PROFILE_ES20=OFF \
-DWITH_SYSTEM_GLEW=ON \
-DWITH_PYTHON_INSTALL=OFF \
- -DPYTHON_VERSION=${_pyver} \
+ -DPYTHON_VERSION="${_pyver}" \
-DWITH_LLVM=ON \
- ${_EXTRAOPTS[@]}
+ "${_CMAKE_FLAGS[@]}"
export NINJA_STATUS="[%p | %f<%r<%u | %cbps ] "
- ((DISABLE_NINJA)) && make -j$(nproc) || ninja -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 -2.7 sufix to desktop shortcut"
- sed -i 's/=blender/=blender-2.7/g' ${pkgdir}/usr/share/applications/blender.desktop
- sed -i 's/=Blender/=Blender-2.7/g' ${pkgdir}/usr/share/applications/blender.desktop
- mv ${pkgdir}/usr/share/applications/blender.desktop ${pkgdir}/usr/share/applications/blender-2.7.desktop
+ _suffix=${pkgname##*-}
+ 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 -2.7 sufix to binaries"
- mv ${pkgdir}/usr/bin/blender ${pkgdir}/usr/bin/blender-2.7
- mv ${pkgdir}/usr/bin/blender-thumbnailer.py ${pkgdir}/usr/bin/blender-2.7-thumbnailer.py
-# mv ${pkgdir}/usr/bin/blenderplayer ${pkgdir}/usr/bin/blenderplayer-2.7
+ 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-2.7"
- mv ${pkgdir}/usr/share/doc/blender ${pkgdir}/usr/share/doc/blender-2.7
+ msg "mv doc/blender to doc/blender-${_suffix}"
+ mv "${pkgdir}/usr/share/doc/blender" "${pkgdir}/usr/share/doc/blender-${_suffix}"
- msg "add -2.7 sufix to man page"
- mv ${pkgdir}/usr/share/man/man1/blender.1 ${pkgdir}/usr/share/man/man1/blender-2.7.1
+ 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 -2.7 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%.*}-2.7.${icon##/*.}
- done
+ 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)
- ## not needed when using options=(!strip)?
- #if [ -e "$pkgdir"/usr/share/blender/*/scripts/addons/cycles/lib/ ] ; then
- # # make sure the cuda kernels are not stripped
- # chmod 444 "$pkgdir"/usr/share/blender/*/scripts/addons/cycles/lib/*
- #fi
+ 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/${_suffix}/scripts/addons/cycles/lib/*
+ fi
}
# vim:set sw=2 ts=2 et:
diff --git a/blender-2.7.desktop b/blender-2.7.desktop
deleted file mode 100644
index 3d11ba8ae4c..00000000000
--- a/blender-2.7.desktop
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-Name=Blender-2.7
-Comment=A 3D program
-Comment[cs]=Program pro 3D modeling a animaci
-Comment[es]=Un programa de 3D
-Comment[no]=Et 3d-program
-Comment[da]=Et program til 3d-modelering
-Exec=blender-2.7
-Icon=blender-2.7
-Terminal=false
-X-MultipleArgs=false
-Type=Application
-Categories=Graphics;3DGraphics;
-MimeType=application/blender;application/x-blender;
diff --git a/blender.install b/blender.install
deleted file mode 100644
index d061748130f..00000000000
--- a/blender.install
+++ /dev/null
@@ -1,14 +0,0 @@
-
-post_install() {
- update-desktop-database -q
- gtk-update-icon-cache -qf /usr/share/icons/hicolor/
-}
-
-post_upgrade() {
- post_install $1
-}
-
-post_remove() {
- post_install $1
-}
-