# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=spotify-qt
pkgver=3.11
pkgrel=1
pkgdesc="Lightweight Spotify client using Qt"
url="https://github.com/kraxarn/spotify-qt"
arch="all"
license="GPL-3.0-or-later"
makedepends="cmake samurai qt6-qtbase-dev qt6-qtsvg-dev"
source="https://github.com/kraxarn/spotify-qt/archive/v$pkgver/spotify-qt-$pkgver.tar.gz
	disable-crash-handler.patch
	"
options="!check"  # no tests provided

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	CXXFLAGS="$CXXFLAGS -flto=auto" \
	cmake -G Ninja -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DQT_VERSION_MAJOR=6 \
		$CMAKE_CROSSOPTS
	cmake --build build
}

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

sha512sums="
67c42bfafc533baeab1b917eaa815652338bad2242fae7392d36b735d2c97ad46273e448c083f147062ba07fa8929c3bcf0f2a4e38cd3c896ce152caf0de8013  spotify-qt-3.11.tar.gz
89eb9c98ef8f05e49448b3f98393990b42602fc4d3d9722942c61cbb9f1634fc85aef19d413ba0b3da79ed536ec6212f594ba81a37db15e3102ad5514e910f44  disable-crash-handler.patch
"
