# Template file for 'citations'
pkgname=citations
version=0.5.1
revision=1
build_style=meson
build_helper=rust
hostmakedepends="glib-devel gettext rust cargo pkg-config
 gtk-update-icon-cache gtk4-update-icon-cache desktop-file-utils"
makedepends="libadwaita-devel gtk4-devel openssl-devel
 rust-std poppler-glib-devel gtksourceview5-devel"
short_desc="Manage your bibliography using BibTeX format"
maintainer="Alex Childs <misuchiru03+github@gmail.com>"
license="GPL-3.0-or-later"
homepage="https://gitlab.gnome.org/World/citations"
distfiles="https://gitlab.gnome.org/World/citations/-/archive/${version}/citations-${version}.tar.gz"
checksum=77ac6a7cc442de74eccfc3f07687803cd1feca2da348753eddd34404b94bf253

# Allows the cross build to know where the file is placed--build.ninja does not account for cross build
pre_build() {
	if [ "${CROSS_BUILD}" ]; then
		vsed -i build/build.ninja -e 's, && cp src/release/citations src/citations,,'
	fi
}

# Take the cross-build folder into account when copying the file for the install
post_build() {
	pwd
	if [ "${CROSS_BUILD}" ]; then
		cp -r build/src/*-linux-*/release/citations build/src/citations
	fi
}
