coreutils: Remove strange ls color patch
[termux-packages] / disabled-packages / ghc / build.sh
1 # See https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling
2 # https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux
3 # and
4 # https://github.com/neurocyte/ghc-android
5 #
6 # Status: Currently fails at "error: cannot find -lpthread"
7 # right after message about building bin/hpc.
8 # As libpthread does not exist on Android (pthread
9 # is built into libc, this needs to be patched away.
10 TERMUX_PKG_HOMEPAGE=https://www.haskell.org/ghc/
11 TERMUX_PKG_DESCRIPTION="The Glasgow Haskell Compilation system"
12 TERMUX_PKG_VERSION=8.0.1
13 TERMUX_PKG_SRCURL=http://downloads.haskell.org/~ghc/${TERMUX_PKG_VERSION}/ghc-${TERMUX_PKG_VERSION}-src.tar.xz
14 TERMUX_PKG_FOLDERNAME=ghc-$TERMUX_PKG_VERSION
15 TERMUX_PKG_BUILD_IN_SRC=yes
16 # Depend on clang for now until llvm is split into separate package:
17 TERMUX_PKG_DEPENDS="clang, ncurses"
18
19 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-iconv-includes=$TERMUX_PREFIX/include -with-iconv-libraries=$TERMUX_PREFIX/lib"
20 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-curses-includes=$TERMUX_PREFIX/include/ncursesw -with-curses-libraries=$TERMUX_PREFIX/lib"
21 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --host=${TERMUX_HOST_PLATFORM}"
22 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --target=${TERMUX_HOST_PLATFORM}"
23 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --host=x86_64-unknown-linux --build=x86_64-unknown-linux"
24
25 ORIG_CFLAGS="$CFLAGS"
26 ORIG_CPPFLAGS="$CPPFLAGS"
27 ORIG_LDFLAGS="$LDFLAGS"
28
29 unset AR
30 unset AS
31 unset CC
32 export CFLAGS=""
33 unset CPP
34 export CPPFLAGS=""
35 unset CXXFLAGS
36 unset CXX
37 export LDFLAGS=""
38 unset LD
39 unset PKG_CONFIG
40 unset RANLIB
41
42 termux_step_pre_configure () {
43 echo "INTEGER_LIBRARY = integer-simple" > mk/build.mk
44 #echo "GhcStage2HcOpts = $ORIG_CFLAGS $ORIG_CPPFLAGS $ORIG_LDFLAGS" >> mk/build.mk
45
46 # Avoid "Can't use -fPIC or -dynamic on this platform":
47 echo "DYNAMIC_GHC_PROGRAMS = NO" >> mk/build.mk
48 echo "GhcLibWays = v" >> mk/build.mk
49 # "Can not build haddock docs when CrossCompiling or Stage1Only".
50 echo "HADDOCK_DOCS=NO" >> mk/build.mk
51 }