summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ff491df197314cf819e443ab71c1748da23aabc3 (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
# Maintainer: Huynh Thien Khiem <my_github_name 2000 at gmail dot com>
_pkgname=euphonica
pkgname=${_pkgname}-git
pkgver=0.96.1.r342
pkgrel=1
pkgdesc="Libadwaita MPD client with visualiser, wikis and synced lyrics"
arch=("x86_64")
url="https://github.com/htkhiem/euphonica"
license=('GPL-3.0-or-later')
depends=('libadwaita' 'libpipewire' 'sqlite' 'dbus' 'xdg-desktop-portal-gtk' 'dconf' 'openssl')
makedepends=('git' 'meson' 'cargo' 'clang')
provides=(${_pkgname})
conflicts=(${_pkgname})
options=(!lto)
source=(
	"git+https://github.com/htkhiem/euphonica.git"
)
sha256sums=('SKIP')

pkgver() {
	local semantic_version
	cd "$srcdir/${_pkgname%-git}"
	# Extract semantic version from Cargo.toml (seems easier than meson.build).
	# Take care to only do so under the [package] group and not the dependencies.
	semantic_version=$(awk -F '=' '
        /^\[package\]/ { in_package_section = 1 }
        in_package_section && /^version/ {
            gsub(/[" \t]/, "", $2) # Remove quotes from the version string
            print $2
            exit
        }
		' Cargo.toml)

	# Add commit count in case we have an update version bump
	printf "%s.r%s" "${semantic_version}" "$(git rev-list --count HEAD)"
}

prepare() {
	export RUSTUP_TOOLCHAIN=stable
	cd "$srcdir/${_pkgname%-git}"
	git submodule update --init
	meson setup build --buildtype=release --prefix=/usr
}

build() {
	export RUSTUP_TOOLCHAIN=stable
	cd "$srcdir/${_pkgname%-git}/build"
	meson compile
}

check() {
	cd "$srcdir/${_pkgname%-git}/build"
	meson test --print-errorlogs
}

package() {
	cd "$srcdir/${_pkgname%-git}/build"
	meson install --destdir "$pkgdir"
}