Skip to content

Commit

Permalink
newpkg(main/chez-scheme): 10.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mbekkomo committed Nov 30, 2024
1 parent 0cb7d49 commit 03b8908
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions packages/chez-scheme/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
TERMUX_PKG_HOMEPAGE=https://cisco.github.io/ChezScheme
TERMUX_PKG_DESCRIPTION="Chez Scheme is both a programming language, an implementation, and a superset of R6RS"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="Komo @mbekkomo"
TERMUX_PKG_VERSION=10.1.0
TERMUX_PKG_SRCURL=https://github.com/cisco/ChezScheme/releases/download/v${TERMUX_PKG_VERSION}/csv${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=9181a6c8c4ab5e5d32d879ff159d335a50d4f8b388611ae22a263e932c35398b
TERMUX_PKG_DEPENDS="libiconv, liblz4, libx11, ncurses, zlib"
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_BUILD_IN_SRC=true

# Copied from chez-scheme APKBUILD
case ${TERMUX_ARCH} in
x86_64) _chez_host=ta6le ;;
aarch64) _chez_host=tarm64le ;;
i686) _chez_host=ti3le ;;
arm) _chez_host=tarm32le ;;
esac

termux_step_host_build() {
cd "${TERMUX_PKG_SRCDIR}" || termux_error_exit "Error: failed to perform host build for chez-scheme"
./configure CC=gcc
make -j "${TERMUX_PKG_MAKE_PROCESSES}"
make -j "${TERMUX_PKG_MAKE_PROCESSES}" bootquick XM="$_chez_host"
}

termux_step_configure() {
./configure --cross --force \
--prefix="${TERMUX_PREFIX}" \
--installman="${TERMUX_PREFIX}/share/man" \
--nogzip-man-pages \
--machine="$_chez_host" \
--installschemename=chez \
--installscriptname=chez-script \
ZLIB="-lz" LZ4="-llz4" LIBS="-liconv" \
CC_FOR_BUILD=gcc
}

termux_step_post_make_install() {
# remove hardlinks and replace with symlinks instead
local chezlib="${TERMUX_PREFIX}/lib/csv${TERMUX_PKG_VERSION}"
local bootlib="$chezlib/$_chez_host"
rm -f \
"$bootlib/chez.boot" \
"$bootlib/chez-script.boot"

ln -s "$bootlib/"{scheme,chez}.boot
ln -s "$bootlib/"{scheme,chez-script}.boot
}

0 comments on commit 03b8908

Please sign in to comment.