# Template file for 'sequoia-sop'
pkgname=sequoia-sop
version=0.37.0
revision=1
build_style=cargo
configure_args="--bin sqop --features cli,sequoia-openpgp/compression"
hostmakedepends="pkg-config llvm clang"
makedepends="nettle-devel bzip2-devel sqlite-devel"
short_desc="Implementation of the Stateless OpenPGP CLI using Sequoia"
maintainer="classabbyamp <void@placeviolette.net>"
license="GPL-2.0-or-later"
homepage="https://gitlab.com/sequoia-pgp/sequoia-sop/"
distfiles="https://gitlab.com/sequoia-pgp/sequoia-sop/-/archive/v${version}/sequoia-sop-v${version}.tar.gz"
checksum=4ced35c68b54a190b40acf1009c21da1e78b7d4b4e52b15feabdbab718b9baf5

if [ "$CROSS_BUILD" ]; then
	hostmakedepends+=" $makedepends"
fi

case "$XBPS_TARGET_MACHINE" in
	armv*l) nocross="Requires C libs included in build.rs, which is currently broken in xbps-src. These failures only manifest on a hf archs right now";;
esac

pre_build() {
	export ASSET_OUT_DIR=assets
}

post_install() {
	for page in assets/man-pages/*; do
		vman ${page}
	done
	vcompletion assets/shell-completions/_sqop zsh
	vcompletion assets/shell-completions/sqop.bash bash
	vcompletion assets/shell-completions/sqop.fish fish
}
