aboutsummaryrefslogtreecommitdiffstats
path: root/community/kodi/APKBUILD
blob: 8f410192d2c9985f99a3eb40fdd778d1fef92736 (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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=kodi
pkgver=19.1
_realname=Matrix
pkgrel=3
_crossguid_hash="8f399e8bd4"
pkgdesc="software media player and entertainment hub for digital media"
url="https://kodi.tv/"
# kodi does not know of other archs
arch="x86 x86_64 aarch64 armv7" # flatbuffers missing on armhf
license="GPL-2.0-only"
depends="
	curl
	hicolor-icon-theme
	py3-bluez
	py3-pillow
	py3-simplejson
	python3
	xdpyinfo
	"
# Required dependencies
depends_dev="
	curl-dev
	ffmpeg-dev
	flatbuffers-dev
	fmt-dev
	freetype-dev
	fribidi-dev
	fstrcmp-dev
	giflib-dev
	glu-dev
	gtest-dev
	libass-dev
	libcdio-dev
	libdrm-dev
	libdvdcss-dev
	libdvdnav-dev
	libdvdread-dev
	libjpeg-turbo-dev
	lzo-dev
	mesa-dev
	openssl-dev
	pcre-dev
	rapidjson-dev
	spdlog-dev
	sqlite-dev
	taglib-dev
	tinyxml-dev
	zlib-dev
	"

# Required for Wayland
depends_dev="$depends_dev
	libxkbcommon-dev
	waylandpp-dev
	"

# Required for gbm
depends_dev="$depends_dev
	libinput-dev
	"

# Optional for extra features
depends_dev="$depends_dev
	alsa-lib-dev
	avahi-dev
	bluez-dev
	dav1d-dev
	dbus-dev
	eudev-dev
	libbluray-dev
	libcap-dev
	libcec4-dev
	libmicrohttpd-dev
	libnfs-dev
	libplist-dev
	libshairport-dev
	libva-glx-dev
	libxslt-dev
	mariadb-connector-c-dev
	pulseaudio-dev
	python3-dev
	samba-dev
	"
makedepends="$depends_dev
	autoconf
	automake
	cmake
	doxygen
	graphviz
	libtool
	java-jre-headless
	swig
	tar
	wayland-protocols
	xz
	"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-openrc
	$pkgname-x11
	$pkgname-wayland
	$pkgname-gbm
	$pkgname-polkit::noarch
	"
replaces="xbmc"
options="ldpath-recursive !check" # No testsuite
source="https://github.com/xbmc/xbmc/archive/$pkgver-$_realname.tar.gz
	crossguid-$_crossguid_hash.tar.gz::https://mirrors.kodi.tv/build-deps/sources/crossguid-$_crossguid_hash.tar.gz
	fix-musl-incompability.patch
	sse-build.patch
	PR_19904.patch
	kodi.initd
	60-kodi.rules
	"

builddir="$srcdir/xbmc-$pkgver-$_realname"

# secfixes:
#   18.2-r0:
#     - CVE-2018-8831

prepare() {
	default_prepare

	mkdir "$builddir"/build-x11
	mkdir "$builddir"/build-wayland
	mkdir "$builddir"/build-gbm
}

build() {
	export LDFLAGS="$LDFLAGS -Wl,-z,stack-size=1048576"

	make -C tools/depends/target/crossguid PREFIX="$PWD"/usr

	# X11
	cd "$builddir"/build-x11
	cmake "$builddir" \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_INTERNAL_CROSSGUID=ON \
		-DENABLE_TESTING=OFF \
		-DCROSSGUID_URL="$srcdir"/crossguid-$_crossguid_hash.tar.gz \
		-DCORE_PLATFORM_NAME=x11 \
		-DAPP_RENDER_SYSTEM=gl
	make
	make preinstall

	# Wayland
	cd "$builddir"/build-wayland
	cmake "$builddir" \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_INTERNAL_CROSSGUID=ON \
		-DENABLE_TESTING=OFF \
		-DCROSSGUID_URL="$srcdir"/crossguid-$_crossguid_hash.tar.gz \
		-DCORE_PLATFORM_NAME=wayland \
		-DAPP_RENDER_SYSTEM=gl
	make
	make preinstall

	# GBM
	cd "$builddir"/build-gbm
	cmake "$builddir" \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_INTERNAL_CROSSGUID=ON \
		-DENABLE_TESTING=OFF \
		-DCROSSGUID_URL="$srcdir"/crossguid-$_crossguid_hash.tar.gz \
		-DCORE_PLATFORM_NAME=gbm \
		-DAPP_RENDER_SYSTEM=gles
	make
	make preinstall
}

package() {
	depends="$pkgname-bin"

	cd "$builddir"/build-x11
	make DESTDIR="$pkgdir" install

	install -Dm755 "$srcdir"/kodi.initd "$pkgdir"/etc/init.d/kodi

	rm \
		"$pkgdir"/usr/lib/kodi/kodi-x11 \
		"$pkgdir"/usr/lib/kodi/kodi-xrandr

	# Cmake files are by default installed in the wrong location
	# should be in /usr/lib/cmake/kodi/
	# not /usr/share/kodi/cmake/
	mkdir -p "$pkgdir"/usr/lib/cmake/kodi
	mv "$pkgdir"/usr/share/kodi/cmake/*.cmake \
		"$pkgdir"/usr/lib/cmake/kodi/
}

x11() {
	pkgdesc="X11 Kodi binary"
	provides="$pkgname-bin=$pkgver-r$pkgrel"

	cd "$builddir"/build-x11
	install -Dm755 kodi-x11 "$subpkgdir"/usr/lib/kodi/kodi-x11
	install -Dm755 kodi-xrandr "$subpkgdir"/usr/lib/kodi/kodi-xrandr
}

wayland() {
	pkgdesc="Wayland Kodi binary"
	provides="$pkgname-bin"

	cd "$builddir"/build-wayland
	install -Dm755 kodi-wayland "$subpkgdir"/usr/lib/kodi/kodi-wayland
}

gbm() {
	pkgdesc="GBM Kodi binary"
	provides="$pkgname-bin"
	depends="$pkgname-openrc"
	install="$subpkgname.pre-install"

	cd "$builddir"/build-gbm
	install -Dm755 kodi-gbm "$subpkgdir"/usr/lib/kodi/kodi-gbm
}

polkit() {
	pkgdesc="Polkit rules for Kodi in combination with GBM"
	install_if="$pkgname-gbm polkit"

	install -Dm644 "$srcdir"/60-kodi.rules "$subpkgdir"/usr/share/polkit-1/rules.d/60-kodi.rules
}

sha512sums="
e9725a61828fa59502fdbb42d689c4948af792522049dadae136b5e90f53ee6fff570e6adb818dcce2ce54e957b0a31796b59aefd87fc55356531e2379ac6289  19.1-Matrix.tar.gz
2682d63609d3dcdfcd8136be632e45df26ad88ce93b9c49745cf728bbd2e6254a7b05c8b059ab581d532372e504206a525a52564b64d076dfdae9c965a09fd16  crossguid-8f399e8bd4.tar.gz
d3445c7f96eeab7cd2a2a67319fab09300ee2e8c03912d474e885d7e8a770b501abc59352972abb4dab6fab7f138b42fdb31b0113b9bb1a71b4f000fe1cdcbbb  fix-musl-incompability.patch
cf8e55505f45898b15d8db356f7f43e215f07f9e2ed8215d726f3be37d78b328e08763f4c678f7223d185df72821b2a863958a1c279edd26ac8dc9f99ab92791  sse-build.patch
b4f5a6e486c7b6fd57d726753e3936060b9eda8bf2ff9953758974760ae436c03ab419b56fdb093304b1bbfc1be6b64d6e924d022bee3db8de629baad6a4d72b  PR_19904.patch
7e2a2289da3098e0007e461ad538dcd6435e908283caf1719788248fe736615890175e11392ca0cd68002872217bbf7b70cf909f228307828aa82467d5502ed4  kodi.initd
465a2079d598bf909a458d8e9d0ddd2b2a41dff83ba736542cffec7811c044295d5af092928f20aaa6cd3bc8b13bb03ede5c7ded1783680f890464e103392787  60-kodi.rules
"