blob: dc834058defa6848e361a0362c939d9620fbcdf9 (
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
#!/bin/hint/bash
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>
# Configuration.
_fragment=${FRAGMENT:-#branch=main}
# Use CMAKE_FLAGS=xxx:yyy:zzz to define extra CMake flags
[[ -v CMAKE_FLAGS ]] && mapfile -t -d: CMAKE_FLAGS < <(echo -n "$CMAKE_FLAGS")
# shellcheck disable=SC2206
[[ -v CUDA_ARCH ]] && _cuda_capability=(${CUDA_ARCH})
[[ -v HIP_ARCH ]] && _CMAKE_FLAGS+=("-DCYCLES_HIP_BINARIES_ARCH=${HIP_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_USD)) && {
_CMAKE_FLAGS+=( -DWITH_USD=OFF )
} || {
_CMAKE_FLAGS+=( -DWITH_USD=ON
-DUSD_ROOT=/usr )
depends+=( "usd>=23.11" )
}
((DISABLE_MATERIALX)) && {
_CMAKE_FLAGS+=( -DWITH_MATERIALX=OFF )
} || {
_CMAKE_FLAGS+=( -DWITH_MATERIALX=ON )
depends+=( materialx )
}
((DISABLE_NINJA)) || { makedepends+=('ninja'); : ${MAKEFLAGS:--j1}; }
#shellcheck disable=SC2015
((DISABLE_CUDA)) && optdepends+=('cuda: CUDA support in Cycles') || { makedepends+=('cuda') ; ((DISABLE_OPTIX)) || makedepends+=('optix>=7.4'); }
((DISABLE_HIP)) || {
makedepends+=('hip-runtime-amd')
_CMAKE_FLAGS+=( -DHIP_ROOT_DIR=/opt/rocm )
}
((ENABLE_PYTHON_INSTALL)) && \
_CMAKE_FLAGS+=( -DWITH_PYTHON_INSTALL=ON ) || \
_CMAKE_FLAGS+=( -DWITH_PYTHON_INSTALL=OFF )
pkgname=blender-develop-git
pkgver=4.4.r144211.g59266547561
pkgrel=1
pkgdesc="Development version of Blender (non-conflicting version)"
changelog=blender.changelog
arch=('i686' 'x86_64')
url="https://blender.org/"
depends+=('alembic' 'embree' 'libgl' 'python' python-{numpy,requests} 'openjpeg2' 'libharu' 'potrace' 'openxr'
'ffmpeg' 'fftw' 'openal' 'freetype2' 'libxi' 'openimageio' 'opencolorio'
'openvdb' 'opensubdiv' 'openshadinglanguage' 'libtiff' 'libpng')
depends+=('openimagedenoise')
depends+=('libdecor' 'libepoxy')
depends+=('openpgl')
depends+=('shaderc')
makedepends+=('git' 'git-lfs' 'cmake' 'clang' 'boost' 'mesa' 'llvm' wayland{,-protocols} 'vulkan-headers' 'libxkbcommon')
makedepends+=('wayland-protocols')
makedepends+=('cython')
provides=("blender=${pkgver%%.r*}")
conflicts=("blender=${pkgver%%.r*}")
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=("blender::git+https://github.com/blender/blender${_fragment}"
'blender-addons::git+https://github.com/blender/blender-addons'
'blender-addons-contrib::git+https://github.com/blender/blender-addons-contrib'
'blender-translations::git+https://github.com/blender/blender-translations'
'blender-dev-tools::git+https://github.com/blender/blender-dev-tools'
SelectCudaComputeArch.patch
)
sha256sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'60ac315c873a3842dd46393ed351c008255911a8fa352d39587a5eede3983e3a')
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() {
# update the submodules
make V=1 -C "$srcdir/blender" update
if [ ! -v _cuda_capability ] && grep -q nvidia <(lsmod); then
git -C "$srcdir/blender" apply -v "${srcdir}"/SelectCudaComputeArch.patch
fi
}
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
_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" ] && export CUDA_NVCC_EXECUTABLE=/usr/lib/ccache/bin/nvcc-ccache
if _cuda_gcc=$(basename "${NVCC_CCBIN}") ; then
if [ -L "/usr/lib/ccache/bin/$_cuda_gcc" ]
then export CUDAHOSTCXX=/usr/lib/ccache/bin/"$_cuda_gcc"
else export CUDAHOSTCXX="$_cuda_gcc"
fi
fi
fi
((DISABLE_NINJA)) && generator="Unix Makefiles" || generator="Ninja"
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 \
-DXR_OPENXR_SDK_ROOT_DIR=/usr \
-DPYTHON_VERSION="${_pyver}" \
"${_CMAKE_FLAGS[@]}"
export NINJA_STATUS="[%p | %f<%r<%u | %cbps ] "
# shellcheck disable=SC2086 # allow MAKEFLAGS to split when multiple flags provided.
cmake --build build ${MAKEFLAGS}
}
package() {
_suffix=${pkgver%%.r*}
_pyver=$(python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))')
sed -i "/BLENDER_BIN/s|\(/usr/bin/blender\)|${pkgdir}\1|" "${srcdir}"/build/source/creator/cmake_install.cmake
cmake --install build --prefix "${pkgdir}/usr" -v
python -m compileall "${pkgdir}/usr/share/blender"
python -O -m compileall "${pkgdir}/usr/share/blender"
# Move OneAPI AOT lib to proper place
# mv "${pkgdir}"/usr/share/blender/lib/libcycles_kernel_oneapi_aot.so "${pkgdir}"/usr/lib/
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" "${pkgdir}/usr/bin/blender-${_suffix}-thumbnailer"
msg "mv doc/blender to doc/blender-${_suffix}"
mv "${pkgdir}/usr/share/doc/blender" "${pkgdir}/usr/share/doc/blender-${_suffix}" || true
msg "add -${_suffix} suffix to man page"
mv "${pkgdir}/usr/share/man/man1/blender.1" "${pkgdir}/usr/share/man/man1/blender-${_suffix}.1" || true
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)
msg "add -${suffix} suffix to metainfo"
mv "${pkgdir}/usr/share/metainfo/org.blender.Blender.metainfo.xml" "${pkgdir}/usr/share/metainfo/org.blender-${_suffix}.Blender.metainfo.xml" || true
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:
|