# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org> # Contributor: Hurricane Pootis <hurricanepootis@protonmail.com> # Contributor: John Sowiak <john@archlinux.org> # Contributor: tobias <tobias@archlinux.org> # ALARM: Kevin Mihelich <kevin@archlinuxarm.org> # - remove makedepend, optdepend on cuda # - remove depend on openimagedenoise, embree, openpgl # - set -DWITH_CYCLES_EMBREE=OFF # - remove makedepend on hip-runtime-amd # - removed Intel OneAPI support buildarch=8 # For legal reasons, we can't separately package the Optix headers so we'll # just build the package against them. I checked with NVIDIA and this way is # fine with them. pkgname=blender pkgver=4.4.0 pkgrel=1 epoch=17 pkgdesc="A fully integrated 3D graphics creation suite" arch=('x86_64') license=( Apache-2.0 BSD-2-Clause BSD-3-Clause GPL-2.0-or-later GPL-3.0-or-later LGPL-2.1-or-later MIT MPL-2.0 Zlib ) url="https://www.blender.org" depends=( 'alembic' 'bash' 'boost-libs' 'draco' # seems to use static lib and should probably only be makedepends 'expat' 'ffmpeg' 'fftw' 'freetype2' 'gcc-libs' 'glew' 'glibc' 'gmp' 'hicolor-icon-theme' 'imath' 'jack' # dlopen'ed 'jemalloc' 'level-zero-loader' # dlopen'ed 'libepoxy' 'libharu' 'libjpeg-turbo' 'libpng' 'libsndfile' 'libspnav' 'libtiff' 'libwebp' 'libx11' 'libxfixes' 'libxi' 'libxkbcommon' 'libxml2' 'libxrender' 'libxxf86vm' 'llvm-libs' 'materialx' 'onetbb' 'openal' 'opencolorio' 'openexr' 'openimageio' 'openjpeg2' 'openshadinglanguage' 'opensubdiv' 'openvdb' 'openxr' 'potrace' 'pugixml' 'pystring' 'python' 'python-numpy' 'python-requests' 'sdl2' # dlopen'ed 'shared-mime-info' 'usd' 'xdg-utils' 'yaml-cpp' 'zlib' 'zstd' ) makedepends=( 'boost' 'cmake' 'git' 'level-zero-headers' 'libdecor' 'mold' 'llvm' 'mesa' 'ninja' 'git-lfs' 'subversion' 'wayland-protocols' ) optdepends=('libdecor: wayland support') # We're using !lto here as otherwise we get stuff such as FS#77557 options=('!lto') source=("git+https://projects.blender.org/blender/blender.git#tag=v$pkgver" "git+https://projects.blender.org/blender/blender-assets#tag=v$pkgver" https://developer.download.nvidia.com/redist/optix/v8.0/OptiX-8.0-Include.zip hiprt-lib-path.patch) sha512sums=('22c1664a45b1c0f5f5599a065883c19563197c5db7df8ce758465b7bcfb41ab5865494803e27c7ba265c54f5e32a45d2e83dbe00bd927a98a00ddd38c11d06fc' '43cc5f388581698a68ad611222fcf48445441fc58685259beacb4e6de62c86db6adb7d255f1781bbb1cacf3eade4a6745ddcc519dfed3f776bddcbe1e3ee82d9' '5502d9df847de12badc702c0444bd4f1f7620460b2235026df2c3133da1e04c148af0f1fc7f345e9a0c009c32f905f66c8d427743445e8864d3a797cdce6a483' '52dd6c4496af38505761e559adee556176aa2ad023f073618af77f6c9bc5e3a8faa59c8f259dc92302f7e650740afd2060951129408f1939d29c0901e8ccccae') prepare() { cd "$pkgname" git submodule init git config submodule.release/datafiles/assets.url "$srcdir/blender-assets" git -c protocol.file.allow=always submodule update # Fetch assets from git-lfs git -C release/datafiles/assets lfs install --local git -C release/datafiles/assets remote add network-origin https://projects.blender.org/blender/blender-assets git -C release/datafiles/assets lfs fetch network-origin git -C release/datafiles/assets lfs checkout patch -p1 -i "$srcdir"/hiprt-lib-path.patch } _get_pyver() { python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))' } build() { # This should fix #13. export CXXFLAGS=${CXXFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS/} CXXFLAGS+=' --param=max-vartrack-size=640000000' local cmake_options=( -B build -C "$pkgname/build_files/cmake/config/blender_release.cmake" -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr -D OPTIX_ROOT_DIR="$srcdir" -D PYTHON_VERSION="$(_get_pyver)" -D SYCL_CPP_FLAGS="--verbose" # for debugging -D SYCL_OFFLINE_COMPILER_PARALLEL_JOBS=8 -D USD_ROOT_DIR=/usr -D WITH_CYCLES_EMBREE=OFF -D WITH_INSTALL_PORTABLE=OFF -D WITH_PYTHON_INSTALL=OFF -G Ninja -S "$pkgname" -W no-dev ) cmake "${cmake_options[@]}" cmake --build build } package() { DESTDIR="${pkgdir}" cmake --install build cd "$pkgname" install -Dm755 release/bin/blender-softwaregl "${pkgdir}/usr/bin/blender-softwaregl" python -m compileall "${pkgdir}/usr/share/blender" python -O -m compileall "${pkgdir}/usr/share/blender" install -Dm644 release/freedesktop/org.blender.Blender.metainfo.xml "${pkgdir}/usr/share/metainfo/org.blender.Blender.metainfo.xml" # Manually install draco bindings (See FS#73415) mkdir -p "${pkgdir}/usr/lib/python$(_get_pyver)"/ mv "${pkgdir}"/usr/share/blender/4*/python/lib/* "${pkgdir}"/usr/lib/ rm -r "${pkgdir}"/usr/share/blender/4*/python install -vDm 644 doc/license/{BSD-{2,3}-Clause,MIT,Zlib}-license.txt -t "$pkgdir/usr/share/licenses/$pkgname/" }