summaryrefslogtreecommitdiff
path: root/testing/blender/APKBUILD
blob: 4f9e004a349fc2a199234d3abac779638b0a0754 (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
113
114
# Contributor: Mark Riedesel <mark@klowner.com>
# Maintainer: Mark Riedesel <mark@klowner.com>
pkgname=blender
pkgver=2.78c
_pkgver=${pkgver/[a-z]}
pkgrel=0
pkgdesc="3D Creation/Animation/Publishing System"
url="http://www.blender.org/"
arch=""
license="GPL2"
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"
install=""
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 \
		|| return 1
	make || return 1
}


package() {
	# Install headless files
	cd "$builddir"/build-headless
	make DESTDIR="$pkgdir"/headless install || return 1

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

	# Install python module
	cd "$builddir"/build-py
	make DESTDIR="$pkgdir" install || return 1

	# Install the full package
	cd "$builddir"/build-full
	make DESTDIR="$pkgdir" install || return 1
}

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="dee09e6ac19c4eeab71d64ad9581df1bb043a3de97586206b07aeb9aa55e68ecfc3a96d39835bcec20c72fb73a5eb418b349af7abe66d906a1e660caa1e4d267  blender-2.78c.tar.gz
47e8a6a017cea8c004d7e4205f201f167dd81ba95a4aadf9e55d01e81cc4a23e4d7f1d6aa7a6d1300fe3a5f5c98c664f584e7551fcde7fb1137147e2438f7ed5  blender-2.78a-musl.patch"