# Template file for 'chibi-scheme'
pkgname=chibi-scheme
version=0.11
revision=1
build_helper="qemu"
build_style=gnu-makefile
short_desc="Small Footprint R7RS Scheme for use as a C Extension Language"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="BSD-3-Clause"
homepage="http://synthcode.com/scheme/chibi/"
distfiles="https://github.com/ashinn/chibi-scheme/archive/${version}.tar.gz"
checksum=b4404d5304b51b243684702fa7b5f2d82f77cb7ef470bcfca1d94f8ed7660342
alternatives="
 scheme:scheme:/usr/bin/chibi-scheme
 scheme:scheme.1:/usr/share/man/man1/chibi-scheme.1
"
disable_parallel_build=yes

pre_patch() {
	if [ "$CROSS_BUILD" ]; then
		vsed -e "s/CHIBI_MODULE_PATH=lib \.\/chibi-scheme/CHIBI_MODULE_PATH=lib qemu-${XBPS_TARGET_QEMU_MACHINE}-static .\/chibi-scheme/" -i Makefile
	fi
}

post_install() {
	vlicense COPYING
}
chibi-scheme-devel_package() {
	depends="chibi-scheme>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/bin/chibi-ffi
		vmove usr/share/man/man1/chibi-ffi.1
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
	}
}
