# Maintainer (Arch): Sven-Hendrik Haase # Contributor (Arch): John Sowiak # Contributor (Arch): tobias # Contributor: Andreas Grapentin # Contributor: Márcio Silva # Contributor: bill-auger # parabola changes and rationale: # - removed support for non-free CUDA and optix # - set OS type string to GNU/Linux-libre # - pin to tightly-coupled dependency versions pkgname=blender pkgver=2.91.0 pkgrel=4 pkgrel+=.parabola2 epoch=17 _pythonver_x86_64=3.9 _pythonver_i686=3.8 _pythonver_armv7h=3.9 eval "_python_ver=\$_pythonver_${CARCH}" pkgdesc="A fully integrated 3D graphics creation suite" pkgdesc+=", without non-free CUDA or optix support" arch=('x86_64') arch+=('i686' 'armv7h') license=('GPL') url="http://www.blender.org" depends=('libpng' 'libtiff' 'openexr' 'python' 'desktop-file-utils' 'python-requests' 'potrace' 'shared-mime-info' 'hicolor-icon-theme' 'xdg-utils' 'glew' 'openjpeg2' 'python-numpy' 'freetype2' 'openal' 'ffmpeg' 'fftw' 'boost-libs' 'opencollada' 'alembic' 'openxr' 'openimageio' 'libsndfile' 'jack' 'opencolorio' 'openshadinglanguage' 'jemalloc' 'libspnav' 'ptex' 'opensubdiv' 'openvdb' 'log4cplus' 'sdl2') depends_x86_64=('embree' 'openimagedenoise') depends_i686=('embree') makedepends=('cmake' 'boost' 'mesa' 'git' 'llvm' 'ninja') if [[ "${CARCH}" == 'i686' ]] then # FIXME: special case deps - presently, 'openxr' is only in [community-testing] depends[21]='openimageio=2.1.16.0' # but 'community-testing/openimageio' is incompatible with 'openshadinglanguage', so we must specify the one in [community] depends+=('jsoncpp=1.9.4') # also 'extra/jsoncpp' is incompatible with 'openxr', so we must specify the one in [testing] makedepends[0]='cmake=3.18.1' # and 'extra/cmake' is incompatible with 'testing/jsoncpp', so we must specify the one in [testing] fi options=(!strip) source=("git://git.blender.org/blender.git#tag=v$pkgver" "git://git.blender.org/blender-addons.git" "git://git.blender.org/blender-addons-contrib.git" "git://git.blender.org/blender-translations.git" "git://git.blender.org/blender-dev-tools.git") sha512sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP') _version_constraint() # (dep_pkgname [precision]) { local dep_pkgname=$1 local full_version=$(pacman -S --print-format='%v' ${dep_pkgname} | tail -n 1) local n_dots=$(tmp=${full_version%-*} ; tmp=${tmp//[^\.]} ; echo "${#tmp}" ;) local def_precision=$(( n_dots + 1 )) local precision=$( [[ "$2" =~ ^[1-${def_precision}]$ ]] && echo $2 || echo ${def_precision} ) local pkgver_rx='[^-\.\ ]+' local subver_rx='\.'${pkgver_rx} local pkgrel_rx='[^-\ ]+' local capture_rx=${pkgver_rx} for (( n_dots=1 ; n_dots < precision ; n_dots++ )) ; do capture_rx+=${subver_rx} ; done ; if [[ "${full_version}" =~ ^(${capture_rx})(${subver_rx})*-${pkgrel_rx}$ ]] then local version=${BASH_REMATCH[1]} local subver_inc=$(( ${version##*.} + 1 )) local version_inc=$( [[ "${version}" =~ \. ]] && echo ${version%.*}.${subver_inc} || \ echo ${subver_inc} ) local constraint_string="${dep_pkgname}>=${version} ${dep_pkgname}<${version_inc}" echo "applied version constraint: ${constraint_string}" >&2 echo -n "${constraint_string}" else echo "ERROR: _version_constraint() error parsing: dep_pkgname='${dep_pkgname}' full_version='${full_version}'" >&2 exit 1 fi } prepare() { cd "$pkgname" git submodule init git config submodule."release/scripts/addons".url "${srcdir}/blender-addons" git config submodule."release/scripts/addons_contrib".url "${srcdir}/blender-addons-contrib" git config submodule."release/datafiles/locale".url "${srcdir}/blender-translations" git config submodule."source/tools".url "${srcdir}/blender-dev-tools" git submodule update git submodule foreach git checkout v${pkgver} # set OS type string sed -i 's|BUILD_PLATFORM;|"GNU/Linux-libre";|' 'source/creator/buildinfo.c' # FIXME: error: implicit declaration of function ‘atomic_add_and_fetch_uint64’; # did you mean ‘atomic_add_and_fetch_uint32’? [-Werror=implicit-function-declaration] if [[ "${CARCH}" == 'armv7h' ]] || [[ "${CARCH}" == 'i686' ]] then local sed_cmd='s| atomic_add_and_fetch_uint64(| atomic_add_and_fetch_uint32(|' sed -i "${sed_cmd}" source/blender/blenlib/intern/session_uuid.c fi } build() { cd "$pkgname" # libre changes local _extra_opts=( -DWITH_CYCLES_CUDA_BINARIES=OFF \ -DWITH_CYCLES_DEVICE_CUDA=OFF \ -DWITH_CYCLES_DEVICE_OPTIX=OFF ) # arch-specific options case "${CARCH}" in 'i686' ) _extra_opts+=( -DWITH_RAYOPTIMIZATION=OFF \ -DWITH_CYCLES_EMBREE=ON ) ;; 'x86_64') _extra_opts+=( -DWITH_CYCLES_EMBREE=ON ) ;; esac cmake . \ -Bbuild \ -GNinja \ -Cbuild_files/cmake/config/blender_release.cmake \ ${_extra_opts[@]} \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_INSTALL_PORTABLE=OFF \ -DWITH_PYTHON_INSTALL=OFF \ -DPYTHON_VERSION=${_python_ver} \ -DPYTHON_LIBPATH=/usr/lib \ -DPYTHON_LIBRARY=python${_python_ver} \ -DPYTHON_INCLUDE_DIRS=/usr/include/python${_python_ver} \ -DCMAKE_CXX_FLAGS="-I /usr/include/python${_python_ver}" ninja -C build } package() { cd "$pkgname" # pin to tightly-coupled dependency versions # NOTE: indirect sodeps may still be unsatisfyable: # libboost_filesystem.so <- openimageio, # libboost_thread.so <- openshadinglanguage depends+=( libboost_locale.so $(_version_constraint openexr 2) # eg: libHalf.so.12 $( [[ "${CARCH}" == 'i686' ]] && echo 'openimageio=2.1.16.0' || echo \ $(_version_constraint openimageio 2) # eg: libOpenImageIO.so.2.0 ) # FIXME: special case dep $(_version_constraint openshadinglanguage 2) # eg: liboslcomp.so.1.10 $(_version_constraint opensubdiv 3) # eg: libosdGPU.so.3.3.3 $(_version_constraint openvdb 2) # eg: libopenvdb.so.6.2 $(_version_constraint python 2) ) # eg: libpython3.6.so.1.0 DESTDIR="${pkgdir}" ninja -C build install 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.appdata.xml "${pkgdir}/usr/share/metainfo/org.blender.Blender.appdata.xml" }