# Template file for 'mit-scheme-c'
pkgname=mit-scheme-c
version=9.2
revision=2
build_wrksrc="src"
short_desc="Implementation of the Scheme programming language"
maintainer="Andrew Benson <abenson+void@gmail.com>"
license="GPL-2.0-or-later"
homepage="https://www.gnu.org/software/mit-scheme/"
distfiles="${GNU_SITE}/mit-scheme/stable.pkg/${version}/mit-scheme-c-${version}.tar.gz"
checksum=4f6a16f9c7d4b4b7bb3aa53ef523cad39b54ae1eaa3ab3205930b6a87759b170
alternatives="
 scheme:scheme:/usr/bin/mit-scheme
 scheme:scheme.1:/usr/share/man/man1/mit-scheme.1
"
nocross="Tries to build parts of the package with itself"

CFLAGS="-fcommon"

case "$XBPS_TARGET_MACHINE" in
	ppc) broken="free(): invalid pointer";;
	ppc*-musl) broken="Fails to link";;
esac

do_build() {
	etc/make-liarc.sh --prefix=/usr
}

do_install() {
	make install DESTDIR=${DESTDIR}
	rm ${DESTDIR}/usr/bin/scheme
	vman ../doc/scheme.1 mit-scheme.1
}
