# Template file for 'keypunch'
pkgname=keypunch
version=7.0
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=4c2ade53b30ab0a5ae31af4ff265c53204a180adcc525c31b24234e75f1db13b

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
}
