# Template file for 'txr'
pkgname=txr
version=296
revision=2
build_style=configure
configure_args="--prefix=/usr"
make_check_target=tests
makedepends="libffi-devel"
short_desc="Programming language for convenient data munging"
maintainer="Leon (adigitoleo) <adigitoleo@posteo.net>"
license="BSD-2-Clause"
homepage="http://www.nongnu.org/txr/"
changelog="http://www.kylheku.com/cgit/txr/tree/RELNOTES"
distfiles="http://www.kylheku.com/cgit/txr/snapshot/${pkgname}-${version}.tar.bz2"
checksum=753e74c1f11c109a5235856b5e5800912b8267e08257a1a26f17e74efd5c2917
nopie=yes

if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
	makedepends+=" libxcrypt-devel"
fi

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

pre_configure() {
	if [ "$CROSS_BUILD" ]; then
		vsed -i Makefile -e 's#^TXR :=.*#TXR = /usr/bin/txr#'
	fi
}

pre_check() {
	if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
		# IPv6 not supported in github CI
		vsed -i -e 's/,\*maybe-ipv6//' tests/014/dgram-stream.tl
	fi
}

post_install() {
	vlicense LICENSE
	vmkdir usr/share/vim/vimfiles/syntax
	vcopy *.vim usr/share/vim/vimfiles/syntax/
}
