aboutsummaryrefslogtreecommitdiffstats
path: root/testing/blender/APKBUILD
blob: 0626a87ec3aa69a5cc6112da29f7efd7ec901215 (plain)
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
# Contributor: Mark Riedesel <mark@klowner.com>
# Maintainer: Mark Riedesel <mark@klowner.com>
pkgname=blender
pkgver=2.79b
_pkgver=${pkgver/[a-z]}
pkgrel=1
pkgdesc="3D Creation/Animation/Publishing System"
url="http://www.blender.org/"
arch="x86_64"
license="GPL-2.0-or-later"
depends="blender-shared=$pkgver-r$pkgrel"
makedepends="cmake libx11-dev jpeg-dev zlib-dev libpng-dev freetype-dev python3-dev
	openimageio-dev opencolorio-dev glew-dev openal-soft-dev ffmpeg-dev
	fftw-dev tiff-dev mesa-dev libxi-dev libsndfile-dev libxmu-dev boost-dev
	openexr-dev py-numpy-dev opensubdiv-dev"
subpackages="$pkgname-doc $pkgname-shared::noarch $pkgname-headless $pkgname-player py3-$pkgname:python"
source="http://download.blender.org/source/${pkgname}-${pkgver}.tar.gz
	blender-2.78a-musl.patch"

builddir="$srcdir"/$pkgname-$pkgver

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

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

	# Python module
	cd "$builddir"
	mkdir "$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))')

	cmake .. $@ \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release \
		-DWITH_PYTHON_INSTALL:BOOL=OFF \
		-DWITH_INSTALL_PORTABLE:BOOL=OFF \
		-DWITH_OPENCOLORIO:BOOL=ON \
		-DPYTHON_VERSION=$PY_VERSION \
		-DPYTHON_LIBPATH=/usr/lib \
		-DPYTHON_LIBRARY=python${PY_VERSION}m \
		-DPYTHON_INCLUDE_DIRS=/usr/include/python${PY_VERSION}m \
		-DNO_EXECINFO:BOOL=ON
	make
}


package() {
	# Install headless files
	cd "$builddir"/build-headless
	make DESTDIR="$pkgdir"/headless 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
	make DESTDIR="$pkgdir" install

	# Install the full package
	cd "$builddir"/build-full
	make DESTDIR="$pkgdir" 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/
}

player() {
	pkgdesc="Blender player runtime"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/blenderplayer "$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="2db21ace446168dd683cdb5aad9dec001f8888ae4e9603a04ddb44fb78489ded827deb07e83712b0f1118a0e7bf66f2a5d935dc4ebb3a6703d72672ff414367f  blender-2.79b.tar.gz
47e8a6a017cea8c004d7e4205f201f167dd81ba95a4aadf9e55d01e81cc4a23e4d7f1d6aa7a6d1300fe3a5f5c98c664f584e7551fcde7fb1137147e2438f7ed5  blender-2.78a-musl.patch"