# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=fuzzel
pkgver=1.10.2
pkgrel=0
pkgdesc="Application launcher for wlroots-based Wayland compositors"
url="https://codeberg.org/dnkl/fuzzel"
license="MIT"
arch="all"
makedepends="
	meson
	pixman-dev
	cairo-dev
	libpng-dev
	wayland-protocols
	wayland-dev
	libxkbcommon-dev
	tllist-dev
	fcft-dev
	scdoc
	"
subpackages="$pkgname-doc $pkgname-fish-completion $pkgname-zsh-completion"
source="$pkgname-$pkgver.tar.gz::https://codeberg.org/dnkl/fuzzel/archive/$pkgver.tar.gz
	no-werror.patch
	"
options="!check" # no test suite
builddir="$srcdir/fuzzel"

# use librsvg where possible
case "$CARCH" in
	s390x|riscv64)
		_svg_backend=nanosvg
		license="MIT AND Zlib"
		;;
	*)
		_svg_backend=librsvg
		makedepends="$makedepends librsvg-dev"
		;;
esac

build() {
	abuild-meson \
		-Dsvg-backend=$_svg_backend \
		. output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
bc2a3780838ae4a68f23cd9c5e240576cb79c8c29fe5a2069628f3763670139d9c19695b55fbc10cf16affcf8527bedcef0524e374d406e698be8c4afb7a2579  fuzzel-1.10.2.tar.gz
59fb7099a959b00542e938643b0e04ccaf414fa7d281a8cf362fb28aa1061d452d1a8e594fd9008de492d0fdeb5708bef94713de2438b3a933e837e30d6ff483  no-werror.patch
"
