aboutsummaryrefslogtreecommitdiffstats
path: root/testing/blender/APKBUILD
blob: deaec0e54e19721cdb8bbfb8c456ea472aee9606 (plain) (blame)
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
# Contributor: Mark Riedesel <mark@klowner.com>
# Contributor: Leon Marz <lmarz@cs.uni-frankfurt.de>
# Maintainer: Mark Riedesel <mark@klowner.com>
pkgname=blender
pkgver=2.92.0
_pkgver=${pkgver%.[0-9]}
pkgrel=3
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
	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
	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="a2116a2b9d86d938c00b50ffdd93e561a29462e589db73361e7e0d43468ae0eb7c09337b832d70e29e0146d5a4ac40a9a20b0c7ca944faddb4187007ccca853f  blender-2.92.0.tar.xz
5c3c46c301cfbf9ba50ce8e2c6d1a96e85389db3fe74ddccf4150a6247312ca4b483c2bc46e540fb84b56c4cc529c4bec12ceb03ed163fd76cfa04c5fd1c748b  0001-musl-fixes.patch
62dad98f6750d4f145a6b9f15c60d44e571d0b5a09f4ab71e5087b2ce546ba948195d3bdbd322f5da2222b0a89c81418d1ce3f0073aaf4da1e643ffc668b5b2f  0002-fix-linking-issue.patch
43b793ef26e0ea066c39020762439ad31aaf3d9ccb9e7836dc6f46c6a1ca89f9ba0eefeaa458a7eec5ebd9702170b1682fa1343ad7bd5cf1cc49cc921a297888  0003-increase-thread-stack-size-for-musl.patch"