termux-packages/packages/pforth/build.sh

38 lines
1.1 KiB
Bash
Raw Normal View History

2016-08-24 01:12:27 +02:00
TERMUX_PKG_HOMEPAGE=http://www.softsynth.com/pforth/
TERMUX_PKG_DESCRIPTION="Portable Forth in C"
2018-05-19 02:32:50 +02:00
_COMMIT=ee8dc9e9e0f59b8e38dec3732caefe9f3af2b431
TERMUX_PKG_VERSION=20180513
TERMUX_PKG_SHA256=3cf472bb944aa53b0eb0b93d021c8c2c0eff18dd2e3e54daddaf4af342e441ea
2016-08-24 01:12:27 +02:00
TERMUX_PKG_SRCURL=https://github.com/philburk/pforth/archive/${_COMMIT}.zip
TERMUX_PKG_HOSTBUILD=yes
2017-11-18 22:22:50 +01:00
termux_step_post_configure () {
# Avoid caching the host build as it differs between arches
# and is quite fast here anyway:
rm -Rf $TERMUX_PKG_HOSTBUILD_DIR
}
2016-08-24 01:12:27 +02:00
termux_step_host_build () {
2017-11-18 22:20:30 +01:00
local M32=""
if [ $TERMUX_ARCH_BITS = "32" ]; then
2017-11-18 22:20:30 +01:00
M32="-m32"
fi
2016-09-14 23:12:09 +02:00
cp -Rf $TERMUX_PKG_SRCDIR/* .
2016-08-24 01:12:27 +02:00
cd build/unix
CC="gcc $M32" make pfdicdat.h
CC="gcc $M32" make all
2016-08-24 01:12:27 +02:00
}
termux_step_pre_configure () {
for file in pfdicdat.h pforth; do
cp $TERMUX_PKG_HOSTBUILD_DIR/build/unix/$file $TERMUX_PKG_SRCDIR/build/unix/$file
touch -d "next hour" $TERMUX_PKG_SRCDIR/build/unix/$file
2016-08-24 01:12:27 +02:00
done
export TERMUX_PKG_BUILDDIR=$TERMUX_PKG_SRCDIR/build/unix
export CC="$CC $CFLAGS"
}
termux_step_make_install () {
cp $TERMUX_PKG_BUILDDIR/pforth_standalone $TERMUX_PREFIX/bin/pforth
}