summaryrefslogtreecommitdiff
path: root/testing/spotifyd/APKBUILD
blob: 26c13dbdd08f8706473eec991d89365ff00937af (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
# Contributor: Thomas Kienlen <kommander@laposte.net>
# Maintainer: Thomas Kienlen <kommander@laposte.net>
pkgname=spotifyd
pkgver=0.3.3
pkgrel=1
pkgdesc="Open source Spotify client running as a UNIX daemon"
url="https://github.com/Spotifyd/spotifyd"
arch="all !riscv64 !s390x"
license="GPL-3.0-or-later"
makedepends="
	alsa-lib-dev
	cargo
	dbus-dev
	libogg-dev
	openssl-dev
	pulseaudio-dev
	"
pkgusers="spotifyd"
pkggroups="spotifyd"
install="spotifyd.pre-install"
subpackages="$pkgname-openrc"

source="https://github.com/Spotifyd/spotifyd/archive/v$pkgver/spotifyd-$pkgver.tar.gz
	spotifyd.initd
	spotifyd.conf
	"

prepare() {
	default_prepare

	# Optimize binary for size (10.7 MiB -> 4.8 MiB).
	cat >> Cargo.toml <<-EOF

		[profile.release]
		codegen-units = 1
		lto = true
		opt-level = "z"
		panic = "abort"
	EOF
}

build() {
	cargo build --release --locked --features pulseaudio_backend,dbus_mpris,dbus_keyring,rodio_backend
}

check() {
	cargo test --locked --target-dir=target
}

package() {
	install -D -m 755 target/release/spotifyd "$pkgdir/usr/bin/spotifyd"
	install -D -m 755 "$srcdir/spotifyd.initd" "$pkgdir/etc/init.d/spotifyd"
	install -D -m 660 -o spotifyd -g spotifyd "$srcdir/spotifyd.conf" "$pkgdir/etc/spotifyd.conf"
}

sha512sums="
bb8522a022ce1a4cd6a075b865f274ef4a6a5c6b37c44cb909637183cda1299d2218091ebec0f58b68233a74c17041d002557cad0137ee58ad123ec1587a921d  spotifyd-0.3.3.tar.gz
dd4664c5818af8de3439deedfecb2a9d6bd70ab41c3db57cf659d42d4071ffe47d137fa55d94009022472d5927668978df2e6236c574bbe35596fb386ef274a2  spotifyd.initd
3b431114226af7c67838bf860d07c4f4f661808142caadc9920d4268c1c3a89d61d99c310c13b3b4568dc6c10a5c95dfcb05a52f8551884a836a17b20b3ec06c  spotifyd.conf
"