aboutsummaryrefslogblamecommitdiffstats
path: root/testing/blender/APKBUILD
blob: 8b39f44b5bdfb74c5060aa45cc41c44f73edd748 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                               

                                         
               
             
                        
        
                                                 
                              
                                                         
                          
                                         












                     
                   






                         
                  












                       
                      




                     



                                                                                        
                                                      
         
 


                  
                                           



                                                                   
                                       



                                                               
                                     

                                                             


          
                                                                                                                       
 


                                              
                       
                                             
                                         

                                             
                                      



                                             

 
           

                                     
                                                    


                                                         
                                                                                



                                 
                                           


                                  
                                           



                                                                










                                                                   
          
                                                                                                                       

                                              

                                                                                                                               


                                             
                                                                                                              

 





                                                                                                                                                                                
# Contributor: Mark Riedesel <mark@klowner.com>
# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=blender
pkgver=2.93.0
_pkgver=${pkgver%.[0-9]}
pkgrel=2
pkgdesc="3D Creation/Animation/Publishing System"
url="https://www.blender.org/"
arch="x86_64" # only on x86_64, mainly because of openvdb
license="GPL-2.0-or-later"
depends="blender-shared=$pkgver-r$pkgrel"
makedepends="cmake
	alembic-dev
	blosc-dev
	boost-dev
	eigen-dev
	embree-dev
	embree-static
	ffmpeg-dev
	fftw-dev
	freetype-dev
	glew-dev
	gmp-dev
	jack-dev
	libharu-dev
	libjpeg-turbo-dev
	libpng-dev
	libsndfile-dev
	libtbb-dev
	libx11-dev
	libxi-dev
	libxrender-dev
	llvm11-dev
	lzo-dev
	openal-soft-dev
	opencolorio-dev
	openexr-dev
	openimageio-dev
	openjpeg-dev
	opensubdiv-dev
	openvdb-dev
	openxr-dev
	osl
	osl-dev
	potrace-dev
	pugixml-dev
	pulseaudio-dev
	py3-numpy-dev
	python3-dev
	sdl2-dev
	tiff-dev
	"
subpackages="$pkgname-doc $pkgname-shared::noarch $pkgname-headless py3-$pkgname:python"
source="https://download.blender.org/source/blender-$pkgver.tar.xz
	0001-musl-fixes.patch
	0002-fix-linking-issue.patch
	0003-increase-thread-stack-size-for-musl.patch
	"


build() {
	# Headless
	mkdir -p "$builddir"/build-headless
	cd "$builddir"/build-headless
	_build -C../build_files/cmake/config/blender_headless.cmake

	# Full
	mkdir -p "$builddir"/build-full
	cd "$builddir"/build-full
	_build -C../build_files/cmake/config/blender_full.cmake

	# Python module
	mkdir -p "$builddir"/build-py
	cd "$builddir"/build-py
	_build -C../build_files/cmake/config/bpy_module.cmake
}

_build() {
	local _py_version=$(python3 -c 'import sys; print("%i.%i" % (sys.version_info.major, sys.version_info.minor))')

	export CFLAGS="$CFLAGS -D__MUSL__"
	export CXXFLAGS="$CXXFLAGS -D__MUSL__"

	cmake .. "$@" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=None \
		-DWITH_PYTHON_INSTALL=OFF \
		-DWITH_INSTALL_PORTABLE=OFF \
		-DWITH_SYSTEM_LZO=ON \
		-DWITH_SYSTEM_EIGEN3=ON \
		-DWITH_SYSTEM_GLEW=ON \
		-DPYTHON_VERSION=$_py_version
	cmake --build .
}

package() {
	# Install headless files
	cd "$builddir"/build-headless
	DESTDIR="$pkgdir"/headless cmake --install .

	# Rename the headless blender to blender-headless
	mkdir -p "$pkgdir"/usr/bin
	mv "$pkgdir"/headless/usr/bin/blender "$pkgdir"/usr/bin/blender-headless
	rm -rf "$pkgdir"/headless

	# Install python module
	cd "$builddir"/build-py
	DESTDIR="$pkgdir" cmake --install .

	# Install the full package
	cd "$builddir"/build-full
	DESTDIR="$pkgdir" cmake --install .
}

shared() {
	pkgdesc="Blender shared runtime data and add-on scripts"
	mkdir -p "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/share/blender "$subpkgdir"/usr/share/
}

headless() {
	pkgdesc="$pkgdesc (headless build)"
	depends="blender-shared=$pkgver-r$pkgrel"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/blender-headless "$subpkgdir"/usr/bin/
}

python() {
	local _py_version=$(python3 -c 'import sys; print("%i.%i" % (sys.version_info.major, sys.version_info.minor))')

	pkgdesc="Blender modules for Python 3"
	mkdir -p "$subpkgdir"/usr/lib/python"$_py_version"/site-packages
	mv "$pkgdir"/usr/lib/python"$_py_version"/site-packages/bpy.so "$subpkgdir"/usr/lib/python"$_py_version"/site-packages/
	rm -rf "$pkgdir"/usr/lib

	# Symlink to the blender-shared files
	ln -s /usr/share/blender/"$_pkgver" "$subpkgdir"/usr/lib/python"$_py_version"/site-packages/"$_pkgver"
}

sha512sums="
660962e5368c8ff52ed095aba97d63c22aa8e2fdcb2042b1299b6d6edeb7eb1f702a9ee95ee7e47824681f9f48b971d2e32ec32cc6264165a4196b5f36c4a66d  blender-2.93.0.tar.xz
9a26ddc83d03fb24a03d567d134a30425b84d290e2d36f7bf4d5644b1d0a78a46f44c512550c1663d4c5ed5a316763446ff2da4cae2c63822f33f354fb7e6a05  0001-musl-fixes.patch
aa3ac2d938e7182fde2ee9219f55c02f1447781f679a28b651f377f0b27f885a063b5bcbe6f8bafd80e4259b0f1e8e21c08cef05d54930b4aa828b818e1d1cee  0002-fix-linking-issue.patch
8b305ad69ead11b12f08bfd55796cdb4560d04953ac2817d687c599a2179f7525a74a86f7b3d292832b002cf4075c7e1e7e2c164bb71ad977b917ec850e756f7  0003-increase-thread-stack-size-for-musl.patch
"