# Template file for 'keypunch'
pkgname=keypunch
version=6.3
revision=1
build_helper="rust"
build_style=meson
hostmakedepends="cargo rust gettext glib pkg-config blueprint-compiler
 gtk4-devel libadwaita-devel"
makedepends="gtk4-devel libadwaita-devel rust-std"
short_desc="Practice your typing skills"
maintainer="Duncaen <duncaen@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="https://apps.gnome.org/Keypunch/"
changelog="https://github.com/bragefuglseth/keypunch/releases/"
distfiles="https://github.com/bragefuglseth/keypunch/archive/refs/tags/v${version}.tar.gz"
checksum=c58a6f3a7b4c7cc857c3126ca8ddb856d45c5275fe2b9f51a820d6d22fec8641

post_patch() {
	vsed -e 's/\(gtk_update_icon_cache: \)true/\1false/' \
		-e 's/\(update_desktop_database: \)true/\1false/' \
		-e "s/\(get_option('buildtype') != \)'release'/\1'plain'/" \
		-i meson.build
	vsed -e "s/\(get_option('buildtype') == \)'release'/\1'plain'/" \
		-i src/meson.build
	if [ "$CROSS_BUILD" ]; then
		vsed -i src/meson.build \
			-e "s%rust_target /%'${RUST_TARGET}' / &%"
	fi
}
