Skip to content

Commit b59b2e0

Browse files
committed
[blender] update
1 parent b2c3740 commit b59b2e0

3 files changed

Lines changed: 156 additions & 10 deletions

File tree

alarmcn/blender/PKGBUILD

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# fine with them.
99

1010
pkgname=blender
11-
pkgver=5.0.1
12-
pkgrel=3
11+
pkgver=5.2.0
12+
pkgrel=0
1313
epoch=17
1414
pkgdesc="A fully integrated 3D graphics creation suite"
1515
arch=(aarch64 x86_64)
@@ -29,13 +29,14 @@ depends=(
2929
'alembic'
3030
'bash'
3131
'boost-libs'
32+
'ceres-solver'
3233
'draco' # seems to use static lib and should probably only be makedepends
3334
'embree'
3435
'expat'
3536
'ffmpeg'
3637
'fftw'
38+
'fmt'
3739
'freetype2'
38-
'gcc-libs'
3940
'glew'
4041
'glibc'
4142
'gmp'
@@ -45,11 +46,13 @@ depends=(
4546
'jemalloc'
4647
'level-zero-loader' # dlopen'ed
4748
'libepoxy'
49+
'libgcc'
4850
'libharu'
4951
'libjpeg-turbo'
5052
'libpng'
5153
'libsndfile'
5254
'libspnav'
55+
'libstdc++'
5356
'libtiff'
5457
'libwebp'
5558
'libx11'
@@ -99,22 +102,33 @@ makedepends=(
99102
'llvm'
100103
'mesa'
101104
'ninja'
102-
'sse2neon'
103105
'subversion'
104106
'wayland-protocols'
105107
'vulkan-headers'
106108
)
109+
110+
makedepends_aarch64=(
111+
'sse2neon'
112+
)
113+
107114
optdepends=('cuda: Cycles renderer CUDA support'
108115
'intel-compute-runtime: Cycles renderer Intel OneAPI support'
116+
'intel-level-zero-raytracing-support: Cycles renderer Intel OneAPI Raytracing Support'
109117
'hip-runtime-amd: Cycles renderer AMD ROCm support'
110118
'hiprt: Ray tracing AMD ROCm support'
111119
'libdecor: wayland support')
112120
# We're using !lto here as otherwise we get stuff such as FS#77557
113121
options=('!lto')
114122
source=("git+https://projects.blender.org/blender/blender.git#tag=v$pkgver"
115-
https://developer.download.nvidia.com/redist/optix/v8.0/OptiX-8.0-Include.zip)
116-
sha512sums=('9b85c75440a64e10a5d3acb35eeb0b82c7cf6ac4dc0a1b80f5ca3a4d400636c0bdf6285e398b0fec222c6fa72103ab893b0f751554f09ad222cb463edbd20bbf'
117-
'5502d9df847de12badc702c0444bd4f1f7620460b2235026df2c3133da1e04c148af0f1fc7f345e9a0c009c32f905f66c8d427743445e8864d3a797cdce6a483')
123+
blender-hip-update.patch
124+
blender-fix-oneapi-2026-atomic-address-space.patch::https://raw.githubusercontent.com/intel/llvm/20a7095cba72ace59f7c8a64711ec4b51f01f030/devops/actions/blender/blender-build/patches/Fix-build.patch
125+
https://developer.download.nvidia.com/redist/optix/v8.0/OptiX-8.0-Include.zip
126+
ffmpeg-9.patch)
127+
sha512sums=('e113ddf9deb48ff1d53ddd7137677f6fd661b8315363fd55189a5b4fc44fe5a0f1cb46ba24a733939f97836edaec09900acc4486893e455bc526057c3a0bd31b'
128+
'77d202e2033a2e5c26adcc5340da6fbd7f859a8b237b37f9be7f08fbbb99173a67462f1b0aa0dce31967cd8c465b6341628567ace1e477b81a1b75c2383357ca'
129+
'17b15a7e2ea7e89e22a35325104e6a047253242f820815fa499a1010a0caa90b5a7c0a67b4434e24d472d09c767d34a6524e769ca8f1da13728dec89ed9267c0'
130+
'5502d9df847de12badc702c0444bd4f1f7620460b2235026df2c3133da1e04c148af0f1fc7f345e9a0c009c32f905f66c8d427743445e8864d3a797cdce6a483'
131+
'ee67438e0c868eda0616ae444631ccbbce4484c37097875df037fb5db5341be13f1a9e886ba5a1cb514ef2764080542b90cf8d30942a4bf138a9b15e42b378a1')
118132

119133
prepare() {
120134
cd "$pkgname"
@@ -123,6 +137,15 @@ prepare() {
123137
git remote add network-origin https://projects.blender.org/blender/blender
124138
git lfs fetch network-origin
125139
git lfs checkout
140+
141+
patch -Np1 -i "$srcdir"/blender-hip-update.patch
142+
patch -Np1 -i "$srcdir"/blender-fix-oneapi-2026-atomic-address-space.patch
143+
patch -Np1 -i ../ffmpeg-9.patch
144+
145+
# TODO Dirty hack / workaround to fix faulty manpage generation.. arguably an upstream issue.
146+
# https://gitlab.archlinux.org/archlinux/packaging/packages/blender/-/issues/19
147+
sed -i "/blender_help = subprocess/i\ blender_env = {\"LD_LIBRARY_PATH\": \"${pkgdir}/usr/share/blender/lib\"}" \
148+
doc/manpage/blender.1.py
126149
}
127150

128151
_get_pyver() {
@@ -135,19 +158,27 @@ build() {
135158
CXXFLAGS+=' --param=max-vartrack-size=640000000'
136159
CXXFLAGS+=' -Wno-error=format-security'
137160

161+
# In general, we want to list all real archs (sm_XX) and the latest virtual arch (compute_XX) for future PTX compatibility.
162+
# Valid values can be discovered from nvcc --help
163+
local cuda_archs="sm_75;sm_80;sm_86;sm_87;sm_88;sm_89;sm_90;sm_100;sm_103;sm_110;sm_120;sm_121;compute_121"
164+
138165
local cmake_options=(
139166
-B build
140167
-C "$pkgname/build_files/cmake/config/blender_release.cmake"
141168
-D CMAKE_BUILD_TYPE=Release
142169
-D CMAKE_INSTALL_PREFIX=/usr
143170
-D WITH_LINKER_MOLD=ON
171+
-D CUDA_HOST_COMPILER="$NVCC_CCBIN"
172+
-D CYCLES_CUDA_BINARIES_ARCH="$cuda_archs"
173+
-D HIP_ROOT_DIR=/opt/rocm
174+
-D HIPRT_INCLUDE_DIR=/opt/rocm/include
175+
-D HIPRT_COMPILER_PARALLEL_JOBS=8
144176
-D OCLOC_INSTALL_DIR=/usr
145177
-D OPTIX_ROOT_DIR="$srcdir"
146178
-D PYTHON_VERSION="$(_get_pyver)"
147-
# -D SYCL_CPP_FLAGS=--verbose # for debugging
148-
-D SYCL_OFFLINE_COMPILER_PARALLEL_JOBS=8
149179
-D USD_ROOT_DIR=/usr
150180
-D WITH_CYCLES_OSL=ON
181+
-D WITH_CYCLES_PARALLEL_DEVICE_KERNEL_BUILD=ON
151182
-D WITH_INSTALL_PORTABLE=OFF
152183
-D WITH_PYTHON_INSTALL=OFF
153184
-D WITH_SYSTEM_GFLAGS=ON
@@ -157,6 +188,22 @@ build() {
157188
-W no-dev
158189
)
159190

191+
if [[ $CARCH == "x86_64" ]]; then
192+
cmake_options+=(
193+
-D SYCL_ROOT_DIR=/opt/intel/oneapi/compiler/latest
194+
-D SYCL_CPP_FLAGS="--verbose" # for debugging
195+
-D SYCL_OFFLINE_COMPILER_PARALLEL_JOBS=8
196+
)
197+
fi
198+
199+
if [[ $CARCH == "aarch64" ]]; then
200+
cmake_options+=(
201+
-D WITH_CYCLES_HIP_BINARIES=OFF
202+
-D WITH_CYCLES_HIPRT_BINARIES=OFF
203+
-D WITH_CYCLES_ONEAPI_BINARIES=OFF
204+
)
205+
fi
206+
160207
cmake "${cmake_options[@]}"
161208
cmake --build build
162209
}
@@ -165,11 +212,16 @@ package() {
165212
DESTDIR="${pkgdir}" cmake --install build
166213
cd "$pkgname"
167214

168-
install -Dm755 release/bin/blender-softwaregl "${pkgdir}/usr/bin/blender-softwaregl"
169215
python -m compileall "${pkgdir}/usr/share/blender"
170216
python -O -m compileall "${pkgdir}/usr/share/blender"
171217

172218
install -Dm644 release/freedesktop/org.blender.Blender.metainfo.xml "${pkgdir}/usr/share/metainfo/org.blender.Blender.metainfo.xml"
173219

220+
# Move OneAPI AOT lib to proper place
221+
mkdir -p "${pkgdir}"/usr/lib/
222+
if [[ -f "${pkgdir}"/usr/share/blender/lib/libcycles_kernel_oneapi_aot.so ]]; then
223+
mv "${pkgdir}"/usr/share/blender/lib/libcycles_kernel_oneapi_aot.so "${pkgdir}"/usr/lib/
224+
fi
225+
174226
install -vDm 644 doc/license/{BSD-{2,3}-Clause,MIT,Zlib}-license.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
175227
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/intern/cycles/kernel/device/hiprt/CMakeLists.txt b/intern/cycles/kernel/device/hiprt/CMakeLists.txt
2+
index 9f48fb9be3f..163328abebe 100644
3+
--- a/intern/cycles/kernel/device/hiprt/CMakeLists.txt
4+
+++ b/intern/cycles/kernel/device/hiprt/CMakeLists.txt
5+
@@ -30,13 +30,12 @@ set(SRC_KERNEL_DEVICE_HIPRT_SDK_HEADERS
6+
set(SRC_KERNEL_DEVICE_HIPRT_SDK
7+
hiprt/impl/Aabb.h
8+
hiprt/impl/BvhNode.h
9+
- hiprt/impl/Geometry.h
10+
+ hiprt/impl/Header.h
11+
hiprt/impl/hiprt_device_impl.h
12+
hiprt/impl/hiprt_kernels_bitcode.h
13+
hiprt/impl/Instance.h
14+
hiprt/impl/QrDecomposition.h
15+
hiprt/impl/Quaternion.h
16+
- hiprt/impl/Scene.h
17+
hiprt/impl/Transform.h
18+
hiprt/impl/Triangle.h
19+
)

alarmcn/blender/ffmpeg-9.patch

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
diff --git a/extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp b/extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp
2+
index 10a80bc6f9bd..74e6c3339892 100644
3+
--- a/extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp
4+
+++ b/extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp
5+
@@ -332,12 +332,14 @@ FFMPEGWriter::FFMPEGWriter(const std::string &filename, DeviceSpecs specs, Conta
6+
7+
bool format_supported = false;
8+
9+
- for(int i = 0; codec->sample_fmts[i] != -1; i++)
10+
+ const AVSampleFormat *codec_sample_fmts = nullptr;
11+
+ avcodec_get_supported_config(nullptr, codec, AV_CODEC_CONFIG_SAMPLE_FORMAT, 0, (const void**)&codec_sample_fmts, nullptr);
12+
+ for(int i = 0; codec_sample_fmts[i] != -1; i++)
13+
{
14+
- if(av_get_alt_sample_fmt(codec->sample_fmts[i], false) == m_codecCtx->sample_fmt)
15+
+ if(av_get_alt_sample_fmt(codec_sample_fmts[i], false) == m_codecCtx->sample_fmt)
16+
{
17+
- m_deinterleave = av_sample_fmt_is_planar(codec->sample_fmts[i]);
18+
- m_codecCtx->sample_fmt = codec->sample_fmts[i];
19+
+ m_deinterleave = av_sample_fmt_is_planar(codec_sample_fmts[i]);
20+
+ m_codecCtx->sample_fmt = codec_sample_fmts[i];
21+
format_supported = true;
22+
}
23+
}
24+
@@ -345,10 +347,10 @@ FFMPEGWriter::FFMPEGWriter(const std::string &filename, DeviceSpecs specs, Conta
25+
if(!format_supported)
26+
{
27+
int chosen_index = 0;
28+
- auto chosen = av_get_alt_sample_fmt(codec->sample_fmts[chosen_index], false);
29+
- for(int i = 1; codec->sample_fmts[i] != -1; i++)
30+
+ auto chosen = av_get_alt_sample_fmt(codec_sample_fmts[chosen_index], false);
31+
+ for(int i = 1; codec_sample_fmts[i] != -1; i++)
32+
{
33+
- auto fmt = av_get_alt_sample_fmt(codec->sample_fmts[i], false);
34+
+ auto fmt = av_get_alt_sample_fmt(codec_sample_fmts[i], false);
35+
if((fmt > chosen && chosen < m_codecCtx->sample_fmt) || (fmt > m_codecCtx->sample_fmt && fmt < chosen))
36+
{
37+
chosen = fmt;
38+
@@ -356,7 +358,7 @@ FFMPEGWriter::FFMPEGWriter(const std::string &filename, DeviceSpecs specs, Conta
39+
}
40+
}
41+
42+
- m_codecCtx->sample_fmt = codec->sample_fmts[chosen_index];
43+
+ m_codecCtx->sample_fmt = codec_sample_fmts[chosen_index];
44+
m_deinterleave = av_sample_fmt_is_planar(m_codecCtx->sample_fmt);
45+
switch(av_get_alt_sample_fmt(m_codecCtx->sample_fmt, false))
46+
{
47+
@@ -387,19 +389,21 @@ FFMPEGWriter::FFMPEGWriter(const std::string &filename, DeviceSpecs specs, Conta
48+
49+
m_codecCtx->sample_rate = 0;
50+
51+
- if(codec->supported_samplerates)
52+
+ const int *codec_supported_samplerates = nullptr;
53+
+ avcodec_get_supported_config(nullptr, codec, AV_CODEC_CONFIG_FRAME_RATE, 0, (const void **)&codec_supported_samplerates, nullptr);
54+
+ if(codec_supported_samplerates)
55+
{
56+
- for(int i = 0; codec->supported_samplerates[i]; i++)
57+
+ for(int i = 0; codec_supported_samplerates[i]; i++)
58+
{
59+
- if(codec->supported_samplerates[i] == m_specs.rate)
60+
+ if(codec_supported_samplerates[i] == m_specs.rate)
61+
{
62+
- m_codecCtx->sample_rate = codec->supported_samplerates[i];
63+
+ m_codecCtx->sample_rate = codec_supported_samplerates[i];
64+
break;
65+
}
66+
- else if((codec->supported_samplerates[i] > m_codecCtx->sample_rate && m_specs.rate > m_codecCtx->sample_rate) ||
67+
- (codec->supported_samplerates[i] < m_codecCtx->sample_rate && m_specs.rate < codec->supported_samplerates[i]))
68+
+ else if((codec_supported_samplerates[i] > m_codecCtx->sample_rate && m_specs.rate > m_codecCtx->sample_rate) ||
69+
+ (codec_supported_samplerates[i] < m_codecCtx->sample_rate && m_specs.rate < codec_supported_samplerates[i]))
70+
{
71+
- m_codecCtx->sample_rate = codec->supported_samplerates[i];
72+
+ m_codecCtx->sample_rate = codec_supported_samplerates[i];
73+
}
74+
}
75+
}

0 commit comments

Comments
 (0)