summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e5b1ded5adb41ec17123f96f3884e8f860dd36e6 (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
# Maintainer: William Whittaker <william@mailliw.org>

pkgname=hummingbird-player
_pkgname=hummingbird
pkgver=0.3.0
pkgrel=1
pkgdesc="Modern music player written in Rust using GPUI with a focus on design and performance"
arch=(x86_64 aarch64)
url="https://github.com/hummingbird-player/hummingbird"
license=(Apache-2.0)
groups=()
depends=(alsa-lib libasound.so
         curl libcurl.so
         fontconfig
         gcc-libs # libgcc_s.so libstdc++.so
         glibc # libc.so libm.so
         libxcb # libxcb.so libxcb-xkb.so
         libxkbcommon # libxkbcommon.so
         libxkbcommon-x11 # libxkbcommon-x11.so
         openssl libcrypto.so libssl.so
         vulkan-driver
         vulkan-icd-loader
         vulkan-tools
         wayland
         zlib libz.so
         zstd libzstd.so)
makedepends=(cargo
             rust
             cmake
             vulkan-headers
             vulkan-validation-layers
             cargo-cntp-bundle-git
             base-devel
             clang)
options=(!debug)
source=("$_pkgname-$pkgver.tar.gz::https://github.com/hummingbird-player/hummingbird/archive/refs/tags/${pkgver}.tar.gz")
sha256sums=(80dece173bce4220eb282c049aa9232ecdb8290bfeae9bc6bad2bcfaafbc4fe0)

prepare() {
	cd "$_pkgname-$pkgver"
	cargo fetch --locked
}

build() {
	cd "$_pkgname-$pkgver"
	CFLAGS+=' -ffat-lto-objects'
	CXXFLAGS+=' -ffat-lto-objects'
	# no real better way to do this without incurring some costs
	# this isn't as bad as it seems, without the local user's keys these are read-only (and even then all you can do is scrobble)
	# and the local user's keys are only stored on their computer
	# still unfortunate, though
	export LASTFM_API_KEY="7bbd03d0dda426841c6d812f16851d45"
	export LASTFM_API_SECRET="c9e763ffc75b2920aeebe914dfad449c"
	cargo build --release --locked
}

package() {
	cd "$_pkgname-$pkgver"
	cargo cntp-bundle --no-open
	local appdir="target/bundle/$(rustc -vV | grep 'host:' | cut -d' ' -f2)/release/appdir"
	install -Dm755 "$appdir/usr/bin/hummingbird" "$pkgdir/usr/bin/hummingbird"
	install -Dm644 "$appdir/usr/share/applications/org.mailliw.hummingbird.desktop" \
		"$pkgdir/usr/share/applications/org.mailliw.hummingbird.desktop"
	install -Dm644 "$appdir/usr/share/icons/hicolor/scalable/apps/org.mailliw.hummingbird.svg" \
		"$pkgdir/usr/share/icons/hicolor/scalable/apps/org.mailliw.hummingbird.svg"
}