void-packages/srcpkgs/chez-scheme/template

53 lines
1.6 KiB
Bash

# Template file for 'chez-scheme'
pkgname=chez-scheme
version=10.1.0
revision=1
build_style=gnu-makefile
make_build_target="kernel"
hostmakedepends="libX11-devel liblz4-devel ncurses-devel zlib-devel"
makedepends="${hostmakedepends}"
short_desc="Compiler and run-time system for R6RS Scheme"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="Apache-2.0"
homepage="https://scheme.com/"
distfiles="https://github.com/cisco/ChezScheme/releases/download/v${version}/csv${version}.tar.gz"
checksum=9181a6c8c4ab5e5d32d879ff159d335a50d4f8b388611ae22a263e932c35398b
alternatives="
scheme:scheme:/usr/bin/chez-scheme
scheme:scheme.1:/usr/share/man/man1/chez-scheme.1
"
case "$XBPS_TARGET_MACHINE" in
i686*) _target=ti3le;;
x86_64*) _target=ta6le;;
arm*) _target=tarm32le;;
aarch64*) _target=tarm64le;;
riscv64*) _target=trv64le;;
*) _target=pb;; # portable bytecode
esac
pre_configure() {
# Since version 10, Chez only ships portable boot files, so
# first bootstrap with --pb, then build the boot files for the
# target. The kernel is (cross-)compiled in do_build.
[ $_target = pb ] && return
./configure --pb CC="$BUILD_CC" CFLAGS="$BUILD_CFLAGS" LD="$BUILD_LD" \
AR=ar ZLIB=-lz LZ4=-llz4
make ${makejobs} bootquick XM=${_target}
}
do_configure() {
case $_target in
pb) target=--pb;;
*) target=--machine=$_target;;
esac
./configure $target --installprefix=/usr --installman=/usr/share/man \
--nogzip-man-pages --temproot=$DESTDIR \
--installschemename=chez-scheme ZLIB=-lz LZ4=-llz4
}
post_install() {
# replace duplicate file by symlink
ln -sf scheme.boot ${DESTDIR}/usr/lib/csv*/*/scheme-script.boot
}