# Template file for 'conduit'
pkgname=conduit
version=0.10.12
revision=1
build_style=cargo
hostmakedepends="clang pkg-config"
makedepends="libzstd-devel sqlite-devel"
short_desc="Simple, fast and reliable chat server powered by Matrix"
maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
license="Apache-2.0"
homepage="https://conduit.rs/"
distfiles="https://gitlab.com/famedly/conduit/-/archive/v${version}/conduit-v${version}.tar.gz"
checksum=51ace710d645677c71d7ef99bbdfdd5dd78d179d1180bca5b3cd54426c11ddd4

system_accounts="_conduit"
_conduit_homedir="/var/lib/conduit"

make_dirs="/var/lib/conduit 0700 _conduit _conduit
 /etc/conduit 755 _conduit _conduit"

if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
	XBPS_CROSS_RUSTFLAGS+=" -latomic"
fi

# copied from srcpkgs/oniux/template
# aws-lc-sys only ships pre-generated files for certain architectures
case "${XBPS_TARGET_MACHINE}" in
armv[67]l*)
	hostmakedepends+=" cmake rust-bindgen"
	;;
esac

post_install() {
	vsconf conduit-example.toml conduit.toml
	vsv conduit
}
