From 579c10293cfab0416475823d48d9e011664bb168 Mon Sep 17 00:00:00 2001 From: xtkoba <69125751+xtkoba@users.noreply.github.com> Date: Tue, 4 Jan 2022 20:13:23 +0900 Subject: [PATCH] ghc: enable package & fix for current ndk (#8436) --- ...lways-use-pic-on-android-for-dynexec.patch | 0 .../ghc/always_link_m.patch | 0 {disabled-packages => packages}/ghc/build.sh | 27 ++++++++++++++++--- packages/ghc/mk-config.mk.in.patch | 15 +++++++++++ .../ghc/undefined_symbols.patch | 0 .../ghc/use-stage1-binaries-for-install.patch | 0 6 files changed, 39 insertions(+), 3 deletions(-) rename {disabled-packages => packages}/ghc/always-use-pic-on-android-for-dynexec.patch (100%) rename {disabled-packages => packages}/ghc/always_link_m.patch (100%) rename {disabled-packages => packages}/ghc/build.sh (92%) create mode 100644 packages/ghc/mk-config.mk.in.patch rename {disabled-packages => packages}/ghc/undefined_symbols.patch (100%) rename {disabled-packages => packages}/ghc/use-stage1-binaries-for-install.patch (100%) diff --git a/disabled-packages/ghc/always-use-pic-on-android-for-dynexec.patch b/packages/ghc/always-use-pic-on-android-for-dynexec.patch similarity index 100% rename from disabled-packages/ghc/always-use-pic-on-android-for-dynexec.patch rename to packages/ghc/always-use-pic-on-android-for-dynexec.patch diff --git a/disabled-packages/ghc/always_link_m.patch b/packages/ghc/always_link_m.patch similarity index 100% rename from disabled-packages/ghc/always_link_m.patch rename to packages/ghc/always_link_m.patch diff --git a/disabled-packages/ghc/build.sh b/packages/ghc/build.sh similarity index 92% rename from disabled-packages/ghc/build.sh rename to packages/ghc/build.sh index 4710d1a41..db9d52486 100644 --- a/disabled-packages/ghc/build.sh +++ b/packages/ghc/build.sh @@ -1,10 +1,9 @@ -# Build failure with recent NDK. - TERMUX_PKG_HOMEPAGE=https://www.haskell.org/ghc/ TERMUX_PKG_DESCRIPTION="The Glasgow Haskell Compilation system" TERMUX_PKG_LICENSE="BSD 2-Clause, BSD 3-Clause, LGPL-2.1" +TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=8.10.1 -TERMUX_PKG_REVISION=5 +TERMUX_PKG_REVISION=6 TERMUX_PKG_SRCURL=http://downloads.haskell.org/~ghc/${TERMUX_PKG_VERSION}/ghc-${TERMUX_PKG_VERSION}-src.tar.xz TERMUX_PKG_SHA256=4e3b07f83a266b3198310f19f71e371ebce97c769b14f0d688f4cbf2a2a1edf5 TERMUX_PKG_DEPENDS="binutils, clang, iconv, libffi, llvm, ncurses" @@ -18,6 +17,26 @@ DYNAMIC_GHC_PROGRAMS=NO termux_step_pre_configure() { termux_setup_ghc + _WRAPPER_BIN=$TERMUX_PKG_BUILDDIR/_wrapper/bin + mkdir -p $_WRAPPER_BIN + _WRAPPER_AR=$_WRAPPER_BIN/$TERMUX_HOST_PLATFORM-ar + cat > $_WRAPPER_AR <<-EOF + #!$(which sh) + exec $(which $AR) "\$@" + EOF + chmod 0700 $_WRAPPER_AR + + for cmd in llc opt; do + local wrapper="$_WRAPPER_BIN/$cmd" + cat > "$wrapper" <<-EOF + #!$(which sh) + exec /usr/lib/llvm-10/bin/${cmd} "\$@" + EOF + chmod 0700 "$wrapper" + done + + export PATH=$_WRAPPER_BIN:$PATH + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --target=${TERMUX_HOST_PLATFORM}" # After stage 0, cabal passes a host string to the libraries' configure scripts that isn't valid. @@ -78,6 +97,8 @@ patch -Np1 <