blob: 03cd5ba461a8001a42c2a3b90b4dc6b09822be1d (
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
#!/bin/hint/bash
# Maintainer: Fredrick Brennan <copypaste@kittens.ph>
# Submitter: Lukas Jirkovsky <l.jirkovsky@gmail.com>
# Co-maintainer : bartus <arch-user-repoᘓbartus.33mail.com>
#Configuration:
#Use: makepkg VAR1=0 VAR2=1 to enable(1) disable(0) a feature
#Use: {yay,paru} --mflags=VAR1=0,VAR2=1
#Use: aurutils --margs=VAR1=0,VAR2=1
#Use: VAR1=0 VAR2=1 pamac
# Use FRAGMENT=#{commit,tag,brach}=xxx for bisect build
_fragment="${FRAGMENT:-#branch=main}"
# Use CUDA_ARCH to build for specific GPU architecture
# Supports: single arch (sm_52) and list of archs (sm_52;sm_60)
[[ -v CUDA_ARCH ]] && _CMAKE_FLAGS+=(-DCYCLES_CUDA_BINARIES_ARCH="${CUDA_ARCH}")
#some extra, unofficially supported stuff goes here:
_CMAKE_FLAGS+=( -DWITH_CYCLES_NETWORK=OFF )
__check_git_depth_blender_git_aur() {
for f in "${VCSCLIENTS[@]}"; do
if [[ "$(echo $f | grep -e '^git::' | grep -e 'depth.*1' | wc -l)" = "1" ]]; then
VCSCLIENTS_CONFIRMED=1 && export GITFLAGS="$GITFLAGS --depth 1" && break;
else
VCSCLIENTS_CONFIRMED=0
fi
done
if [[ "$VCSCLIENTS_CONFIRMED" != 1 && "$VCSCLIENTS_IGNORE_BLENDER_GIT_AUR" != "y" ]]; then
read -p "Warning: blender-git takes a lot of space to download. If you're using an AUR helper, or installing not to develop Blender, almost all of this is wasted. Consider temporarily modifying /etc/makepkg.conf such that \$VCSCLIENTS reads 'git::git --depth 1'. Ignore this warning? (You can export VCSCLIENTS_IGNORE_BLENDER_GIT_AUR=y to make this choice permanent.) [y/N]" BLENDER_GIT_VCSCLIENTS_ANSWER
if [[ "$BLENDER_GIT_VCSCLIENTS_ANSWER" != "y" ]]; then
exit 1
else
export GITFLAGS='--depth 1'
fi
fi
}
__check_git_depth_blender_git_aur
pkgname=blender-git
pkgver=3.6.r122558.g45c4a0b1ef1
pkgrel=1
pkgdesc="A fully integrated 3D graphics creation suite (development)"
arch=('i686' 'x86_64')
url="https://blender.org/"
depends+=('alembic' 'embree' 'libgl' 'python' 'python-numpy' 'openjpeg2' 'libharu' 'potrace' 'openxr'
'ffmpeg' 'fftw' 'openal' 'freetype2' 'libxi' 'openimageio' 'opencolorio'
'openvdb' 'opencollada' 'opensubdiv' 'openshadinglanguage' 'libtiff' 'libpng')
depends+=('libdecor' 'libepoxy')
optdepends=('cuda: CUDA support in Cycles'
'optix>=7.4.0: OptiX support in Cycles'
'usd=21.05: USD export Scene'
'openimagedenoise: Intel Open Image Denoise support in compositing')
makedepends=('git' 'cmake' 'boost' 'mesa' 'ninja' 'llvm')
makedepends+=('wayland-protocols')
provides=('blender')
conflicts=('blender')
license=('GPL')
# 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.
# More info:
# http://wiki.blender.org/index.php/Dev:Doc/Tools/Git
source=("git+https://projects.blender.org/blender/blender.git${_fragment}"
'git+https://projects.blender.org/blender/blender-addons.git'
'git+https://projects.blender.org/blender/blender-addons-contrib.git'
'git+https://projects.blender.org/blender/blender-translations.git'
'git+https://projects.blender.org/blender/blender-dev-tools.git'
usd_python.patch #add missing python headers when building against python enabled usd.
embree.patch #add missing embree link.
)
sha256sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'c2db51a83a8d573aa76c760f10e541c84b108d64d05c9647681c4e633b3d0397'
'd587135fd9b815d60e8b7f48976aa835472922fc8f64c256dc397bfcd3c2642a')
pkgver() {
blender_version=$(grep -Po "BLENDER_VERSION \K[0-9]{3}" "$srcdir"/blender/source/blender/blenkernel/BKE_blender_version.h)
printf "%d.%d.r%s.g%s" \
$((blender_version/100)) \
$((blender_version%100)) \
"$(git -C "$srcdir/blender" rev-list --count HEAD)" \
"$(git -C "$srcdir/blender" rev-parse --short HEAD)"
}
prepare() {
cd "$srcdir/blender"
# update the submodules
git -c protocol.file.allow=always submodule update --init --recursive --remote $GITFLAGS
git apply -v "${srcdir}"/{embree,usd_python}.patch
}
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" != "" ]; then
_CMAKE_FLAGS+=( -DWITH_CYCLES_CUDA_BINARIES=ON
-DCUDA_TOOLKIT_ROOT_DIR=/opt/cuda )
fi
# check for optix
_OPTIX_PKG=$(pacman -Qq optix 2>/dev/null) || true
if [ "$_OPTIX_PKG" != "" ]; then
_CMAKE_FLAGS+=( -DWITH_CYCLES_DEVICE_OPTIX=ON
-DOPTIX_ROOT_DIR=/opt/optix )
fi
# check for open image denoise
_OIDN_PKG=$(pacman -Qq openimagedenoise 2>/dev/null) || true
if [ "$_OIDN_PKG" != "" ]; then
_CMAKE_FLAGS+=( -DWITH_OPENIMAGEDENOISE=ON )
fi
# check for universal scene descriptor
_USD_PKG=$(pacman -Qq usd=21.02 2>/dev/null) || true
if [ "$_USD_PKG" != "" ]; then
_CMAKE_FLAGS+=( -DWITH_USD=ON
-DUSD_ROOT=/usr )
fi
cmake -G Ninja -S "$srcdir/blender" -B 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=OFF \
-DWITH_PYTHON_INSTALL=OFF \
-DXR_OPENXR_SDK_ROOT_DIR=/usr \
-DPYTHON_VERSION="${_pyver}" \
"${_CMAKE_FLAGS[@]}"
ninja -C "$srcdir/build" ${MAKEFLAGS:--j1}
}
package() {
_suffix=${pkgver%%.r*}
DESTDIR="$pkgdir" ninja -C "$srcdir/build" install
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
}
|