2015-09-17 02:57:29 +02:00
|
|
|
TERMUX_PKG_HOMEPAGE=http://www.swi-prolog.org/
|
|
|
|
TERMUX_PKG_DESCRIPTION="Comprehensive free Prolog environment"
|
|
|
|
TERMUX_PKG_VERSION=7.3.6
|
|
|
|
TERMUX_PKG_SRCURL=http://www.swi-prolog.org/download/devel/src/swipl-${TERMUX_PKG_VERSION}.tar.gz
|
|
|
|
TERMUX_PKG_BUILD_IN_SRC=true
|
|
|
|
TERMUX_PKG_HOSTBUILD=true
|
|
|
|
TERMUX_PKG_DEPENDS="readline, libgmp"
|
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_host_build() {
|
2015-09-17 02:57:29 +02:00
|
|
|
cp -Rf $TERMUX_PKG_SRCDIR/* .
|
|
|
|
|
|
|
|
# apt install libgmp-dev:i386 libncurses5-dev:i386
|
|
|
|
./configure --host=i386-linux --disable-readline #--disable-gmp
|
|
|
|
|
|
|
|
if [ $TERMUX_ARCH_BITS = 32 ]; then
|
|
|
|
# "Make sure that the native swipl has the same word-length (32/64 bits)
|
|
|
|
# and use the native swipl for creating the boot file"
|
|
|
|
# https://groups.google.com/forum/#!topic/swi-prolog/8lBcjb9cxuk
|
|
|
|
find . -name Makefile | xargs perl -p -i -e 's/CFLAGS=/CFLAGS=-m32 /'
|
|
|
|
find . -name Makefile | xargs perl -p -i -e 's/LDFLAGS=/LDFLAGS=-m32 /'
|
|
|
|
fi
|
|
|
|
make
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_post_configure() {
|
2015-09-17 02:57:29 +02:00
|
|
|
cp $TERMUX_PKG_HOSTBUILD_DIR/src/defatom src/
|
2017-04-18 08:19:48 +02:00
|
|
|
touch -d "next hour" $TERMUX_PKG_BUILDDIR/src/defatom
|
2015-09-17 02:57:29 +02:00
|
|
|
#cp $TERMUX_PKG_HOSTBUILD_DIR/{defatom,swipl} $TERMUX_PKG_BUILDDIR/src/
|
|
|
|
|
|
|
|
#bdir=/home/fornwall/termux/swi-prolog/src/src
|
|
|
|
#PLARCH=arm-linux
|
|
|
|
perl -p -i -e "s|bdir=|bdir=$TERMUX_PKG_HOSTBUILD_DIR/src/ # |" */swipl.sh
|
|
|
|
perl -p -i -e "s|PLARCH=|PLARCH=i386-linux # |" */swipl.sh
|
|
|
|
perl -p -i -e "s|${TERMUX_ARCH}-linux|i386-linux|" */swipl.sh
|
|
|
|
}
|
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_post_make_install() {
|
2015-10-02 01:13:56 +02:00
|
|
|
mv $TERMUX_PREFIX/lib/swipl-$TERMUX_PKG_VERSION/lib/${TERMUX_ARCH}-linux/libswipl.so* $TERMUX_PREFIX/lib/
|
2015-09-17 02:57:29 +02:00
|
|
|
}
|