termux-packages/disabled-packages/ghc/build.sh

48 lines
1.7 KiB
Bash
Raw Normal View History

2015-09-15 02:18:02 +02:00
# See https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling
# https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux
2015-09-15 02:38:29 +02:00
# and
# https://github.com/neurocyte/ghc-android
2015-09-15 02:18:02 +02:00
TERMUX_PKG_HOMEPAGE=https://www.haskell.org/ghc/
TERMUX_PKG_DESCRIPTION="The Glasgow Haskell Compilation system"
2016-06-24 00:07:08 +02:00
TERMUX_PKG_VERSION=8.0.1
2015-09-15 02:18:02 +02:00
TERMUX_PKG_SRCURL=http://downloads.haskell.org/~ghc/${TERMUX_PKG_VERSION}/ghc-${TERMUX_PKG_VERSION}-src.tar.xz
2019-08-12 17:56:27 +02:00
TERMUX_PKG_BUILD_IN_SRC=true
2016-06-24 00:16:44 +02:00
# Depend on clang for now until llvm is split into separate package:
TERMUX_PKG_DEPENDS="clang, ncurses"
2015-09-15 02:18:02 +02:00
2016-06-24 00:07:08 +02:00
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-iconv-includes=$TERMUX_PREFIX/include -with-iconv-libraries=$TERMUX_PREFIX/lib"
2015-09-15 02:18:02 +02:00
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-curses-includes=$TERMUX_PREFIX/include/ncursesw -with-curses-libraries=$TERMUX_PREFIX/lib"
2016-06-24 00:07:08 +02:00
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --host=x86_64-unknown-linux --build=x86_64-unknown-linux"
2015-09-15 02:18:02 +02:00
2016-09-07 12:55:56 +02:00
termux_step_post_extract_package() {
ORIG_CFLAGS="$CFLAGS"
ORIG_CPPFLAGS="$CPPFLAGS"
ORIG_LDFLAGS="$LDFLAGS"
2015-09-15 02:18:02 +02:00
2016-09-07 12:55:56 +02:00
unset AR
unset AS
unset CC
export CFLAGS=""
unset CPP
export CPPFLAGS=""
unset CXXFLAGS
unset CXX
export LDFLAGS=""
unset LD
unset PKG_CONFIG
unset RANLIB
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --target=${TERMUX_HOST_PLATFORM}"
}
2015-09-15 02:18:02 +02:00
termux_step_pre_configure() {
2015-09-17 03:11:09 +02:00
echo "INTEGER_LIBRARY = integer-simple" > mk/build.mk
#echo "GhcStage2HcOpts = $ORIG_CFLAGS $ORIG_CPPFLAGS $ORIG_LDFLAGS" >> mk/build.mk
# Avoid "Can't use -fPIC or -dynamic on this platform":
echo "DYNAMIC_GHC_PROGRAMS = NO" >> mk/build.mk
2016-06-24 00:07:08 +02:00
echo "GhcLibWays = v" >> mk/build.mk
# "Can not build haddock docs when CrossCompiling or Stage1Only".
echo "HADDOCK_DOCS=NO" >> mk/build.mk
2015-09-15 02:18:02 +02:00
}