From 9211b553796238aa4899e7e63da365d68538864a Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 7 Sep 2016 06:55:56 -0400 Subject: [PATCH] Update the disabled ghc package --- disabled-packages/ghc/build.sh | 41 +++++++++---------- .../ghc/compiler-main-DriverPipeline.hs.patch | 15 +++++++ disabled-packages/ghc/configure.patch | 2 +- 3 files changed, 35 insertions(+), 23 deletions(-) create mode 100644 disabled-packages/ghc/compiler-main-DriverPipeline.hs.patch diff --git a/disabled-packages/ghc/build.sh b/disabled-packages/ghc/build.sh index f6ede878f..aaeaea2aa 100644 --- a/disabled-packages/ghc/build.sh +++ b/disabled-packages/ghc/build.sh @@ -2,11 +2,6 @@ # https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux # and # https://github.com/neurocyte/ghc-android -# -# Status: Currently fails at "error: cannot find -lpthread" -# right after message about building bin/hpc. -# As libpthread does not exist on Android (pthread -# is built into libc, this needs to be patched away. TERMUX_PKG_HOMEPAGE=https://www.haskell.org/ghc/ TERMUX_PKG_DESCRIPTION="The Glasgow Haskell Compilation system" TERMUX_PKG_VERSION=8.0.1 @@ -18,26 +13,28 @@ TERMUX_PKG_DEPENDS="clang, ncurses" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-iconv-includes=$TERMUX_PREFIX/include -with-iconv-libraries=$TERMUX_PREFIX/lib" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-curses-includes=$TERMUX_PREFIX/include/ncursesw -with-curses-libraries=$TERMUX_PREFIX/lib" -TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --host=${TERMUX_HOST_PLATFORM}" -TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --target=${TERMUX_HOST_PLATFORM}" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --host=x86_64-unknown-linux --build=x86_64-unknown-linux" -ORIG_CFLAGS="$CFLAGS" -ORIG_CPPFLAGS="$CPPFLAGS" -ORIG_LDFLAGS="$LDFLAGS" +termux_step_post_extract_package() { + ORIG_CFLAGS="$CFLAGS" + ORIG_CPPFLAGS="$CPPFLAGS" + ORIG_LDFLAGS="$LDFLAGS" -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 + 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}" +} termux_step_pre_configure () { echo "INTEGER_LIBRARY = integer-simple" > mk/build.mk diff --git a/disabled-packages/ghc/compiler-main-DriverPipeline.hs.patch b/disabled-packages/ghc/compiler-main-DriverPipeline.hs.patch new file mode 100644 index 000000000..6bb8fba54 --- /dev/null +++ b/disabled-packages/ghc/compiler-main-DriverPipeline.hs.patch @@ -0,0 +1,15 @@ +diff -u -r ../ghc-8.0.1/compiler/main/DriverPipeline.hs ./compiler/main/DriverPipeline.hs +--- ../ghc-8.0.1/compiler/main/DriverPipeline.hs 2016-05-16 13:08:53.000000000 -0400 ++++ ./compiler/main/DriverPipeline.hs 2016-09-07 03:37:48.321941122 -0400 +@@ -1831,10 +1831,7 @@ + | WayThreaded `elem` ways dflags = + let os = platformOS (targetPlatform dflags) + in if os == OSOsf3 then ["-lpthread", "-lexc"] +- else if os `elem` [OSMinGW32, OSFreeBSD, OSOpenBSD, +- OSNetBSD, OSHaiku, OSQNXNTO, OSiOS, OSDarwin] +- then [] +- else ["-lpthread"] ++ else [] + | otherwise = [] + + rc_objs <- maybeCreateManifest dflags output_fn diff --git a/disabled-packages/ghc/configure.patch b/disabled-packages/ghc/configure.patch index fa91898fa..d664b19eb 100644 --- a/disabled-packages/ghc/configure.patch +++ b/disabled-packages/ghc/configure.patch @@ -6,7 +6,7 @@ diff -u -r ../ghc-8.0.1/configure ./configure # versions of LLVM simultaneously, but that stopped working around # 3.5/3.6 release of LLVM. -LlvmVersion=3.7 -+LlvmVersion=3.8 ++LlvmVersion=3.9 sUPPORTED_LLVM_VERSION=$(echo \($LlvmVersion\) | sed 's/\./,/')