aboutsummaryrefslogtreecommitdiffstats
path: root/testing/anbox/APKBUILD
blob: 10fbc8cfc80452ff4da30c396b87155295cf7471 (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
115
116
117
118
119
120
121
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Contributor: Grant Miller <GrantM11235@gmail.com>
# Contributor: Antoine Fontaine <antoine.fontaine@epfl.ch>
# Maintainer:
pkgname=anbox
pkgver=0_git20200408
pkgrel=0
_commit="6d9ada9d10348589a03d8101e7cb9f50d6d0b5fb"
_cpu_features_commit="b5c271c53759b2b15ff91df19bd0b32f2966e275"
pkgdesc="Android in a box"
url="https://github.com/anbox/anbox"
arch="x86_64 armv7 aarch64"
license="GPL-3.0-or-later"
subpackages="$pkgname-openrc"
install="$pkgname.post-install"
depends="
	dbus
	dbus-libs
	mesa-gles
	mesa-egl
	fuse3
	"
makedepends="
	mesa-dev
	python2
	cmake
	cmake-extras
	lxc-dev
	sdl2-dev
	sdl2_image-dev
	boost-dev
	dbus-dev
	libcap-dev
	libdwarf-dev
	protobuf-dev
	elogind-dev
	properties-cpp-dev
	libexecinfo-dev
	gtest-dev
	"
source="
	$pkgname-$_commit.tar.gz::https://github.com/anbox/anbox/archive/$_commit.tar.gz
	cpu_features-$_cpu_features_commit.tar.gz::https://github.com/google/cpu_features/archive/$_cpu_features_commit.tar.gz
	anbox-container-manager.initd
	anbox.confd
	musl-fixes.patch
	input-chmod.patch
	fix-gtest-use.patch
	give-more-time-to-start.patch
	anbox-launch.sh
	anbox.desktop
	"
builddir="$srcdir/$pkgname-$_commit"

prepare() {
	# the bundled cpu_features is outdated and breaks build on arm.
	rm -r external/cpu_features
	cp -r $srcdir/cpu_features-*/ external/cpu_features

	default_prepare

	mkdir -p "$builddir"/build
}

build() {
	cd "$builddir"/build
	cmake "$builddir" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DWerror=OFF

	make
}

check() {
	cd "$builddir"/build
	make test
}

package() {
	cd "$builddir"/build
	DESTDIR="$pkgdir" make install

	# CPU Feature install itself. That's bad.
	rm "$pkgdir"/usr/bin/list_cpu_features
	rm "$pkgdir"/usr/lib/backward/BackwardConfig.cmake
	rm -r "$pkgdir"/usr/lib/cmake/CpuFeatures
	rm -r "$pkgdir"/usr/include

	install -m755 -D "$srcdir"/anbox-container-manager.initd \
		"$pkgdir"/etc/init.d/anbox-container-manager
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
	install -m755 -D "$srcdir"/$pkgname-launch.sh \
		"$pkgdir"/usr/bin/$pkgname-launch

	install -m644 -D "$srcdir"/$pkgname.desktop \
		"$pkgdir"/usr/share/applications/$pkgname.desktop
	install -m644 -D "$builddir"/snap/gui/icon.png \
		"$pkgdir"/usr/share/icons/hicolor/512x512/anbox.png

	# this is a dependency of the init script
	install -m755 -D "$builddir"/scripts/anbox-bridge.sh \
		"$pkgdir"/usr/share/anbox/anbox-bridge.sh
	# this is for convinience, to allow someone to get root access
	install -m755 -D "$builddir"/scripts/anbox-shell.sh \
		"$pkgdir"/usr/share/anbox/anbox-shell.sh
}

sha512sums="5fe3644358f84ba2253932ea4400f48ab48fdbe4655eeb006dd6f0cdf3f3e02f2d528974737cf27aa0248cc2ab87710dd5181371ce46fc9cc6c94c7b38b84590  anbox-6d9ada9d10348589a03d8101e7cb9f50d6d0b5fb.tar.gz
c0ec9b603cec2cc9049923e15ef50c85806bc0a0ffe57b63348631061aeddb73c1eca910b25696cf5eac2606aec3f86db29e8a01e01cf438bfee86edfe909e4a  cpu_features-b5c271c53759b2b15ff91df19bd0b32f2966e275.tar.gz
959058eb1c1e3eb0d1593695ee57fbc0cc567f260235e81d7b56da62b0b80fca9112d5f16a1e1c5c0e6223c8a1899f97f906c7cc763dc015e094aacded818a2f  anbox-container-manager.initd
6a3bc88142c5287ec54d481a4788eceb7772d9974af950b5286ce63a49d05d9d49fce5ba1d02b4b1c9893896fd4ba218fd4d39b8e640bdd61ad196b5d5c9a021  anbox.confd
401669509e05eb586ad40fc9e8f4284b52183f06c60e87bf4e923be165a72f10263daf226db7fd610ef6ff25d09abd140ca2d59187e2d1b85a0bd6ae887dd944  musl-fixes.patch
bc7fc34cd2cfde57e674c8bce5b1f7fd297bd54ed32e16a7ac197fc36a23993ea468d5e0508fde9be4c1b72e04557b988b6b54e34cc2a52d96bbdf27af777ee7  input-chmod.patch
cb9e11cff5cbc03dbb9f69e3600f1cb8cbff0ef896ea5fc665e41a0556a9c57164cf3cf7b422e229c515af10894817e5b797aba5be7ead6aa05d6a024e7c2e50  fix-gtest-use.patch
67fc97d5274dec6240937981dbd41ae307bc0a77b54ad7200b187423a8184e848a1b8f983cf4b8f17d88b9d77213b06a8e17ba0c80f226f6755a1ae4acbd53ae  give-more-time-to-start.patch
921d69e28a2f63a6eaccdfbd6f53173d2e0c59dd650dd83c0d8f816b5f23f1ba61abb393b0cf5e48d80ce363df4f3e609de34a4e5a73c2b520dba96b76eda0c9  anbox-launch.sh
3e458e6215ecf0ac94d749f4d78e464850dcf2cc2b616b2f7ddf26e9617d63a90bd0c8be59e4540141a813af4bad84d0f84874105f7ef9de8149666fc3828da7  anbox.desktop"