fix(setup ghc cross compiler): run `__termux_haskell_register_packages` only when ghc has been setup

Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
This commit is contained in:
Aditya Alok 2022-03-15 16:09:21 +05:30 committed by Henrik Grimler
parent a5f9e8199a
commit 6137422df7
No known key found for this signature in database
GPG Key ID: B0076E490B71616B
1 changed files with 2 additions and 2 deletions

View File

@ -46,10 +46,9 @@ termux_setup_ghc_cross_compiler() {
termux_error_exit "Package 'ghc-libs' is not installed. It is required by GHC cross-compiler." \
"You should specify it in 'TERMUX_PKG_BUILD_DEPENDS'."
__termux_haskell_register_packages
if [[ -d "${TERMUX_GHC_RUNTIME_FOLDER}" ]]; then
__termux_haskell_eval_custom_build "${TERMUX_GHC_RUNTIME_FOLDER}/bin/${TERMUX_ARCH}"
__termux_haskell_register_packages
return
fi
@ -91,6 +90,7 @@ termux_setup_ghc_cross_compiler() {
# timestamp creation, we need to remove it in massage step.
__termux_haskell_eval_custom_build "${TERMUX_GHC_RUNTIME_FOLDER}/bin/${TERMUX_ARCH}"
__termux_haskell_register_packages
rm "${TERMUX_GHC_TAR}"
else