# Maintainer: Integral <integral@member.fsf.org>
# Contributor: kraxarn <kraxie@protonmail.com>

pkgname=spotify-qt-git
_pkgname=${pkgname%-git}
pkgver=4.0.4.r18.g3e84c429
pkgrel=1
pkgdesc="Lightweight Spotify client using Qt"
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url="https://github.com/kraxarn/${_pkgname}"
license=("GPL-3.0-or-later")
depends=('qt6-base' 'qt6-svg' 'hicolor-icon-theme')
makedepends=('git' 'cmake')
optdepends=(
	"librespot: Recommended playback client"
	"spotifyd: Recommended playback client"
)
conflicts=("${_pkgname}")
source=("git+${url}.git")
sha256sums=('SKIP')

pkgver() {
	cd "${_pkgname}/"
	git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	cmake -B build -S "${_pkgname}" \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr

	cmake --build build

}

package() {
	DESTDIR="${pkgdir}" cmake --install build
}
