fix(setup ghc cross compiler): did no registered haskell packages

Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
This commit is contained in:
Aditya Alok 2022-03-12 16:24:52 +05:30 committed by Henrik Grimler
parent f21125b33a
commit 5dfa5ccbd0
No known key found for this signature in database
GPG Key ID: B0076E490B71616B
1 changed files with 4 additions and 4 deletions

View File

@ -1,11 +1,11 @@
__termux_haskell_register_packages() {
# Register dependency haskell packages with termux-ghc-pkg.
IFS=',' read -r -a DEP <<<"${TERMUX_PKG_DEPENDS},${TERMUX_PKG_BUILD_DEPENDS}"
IFS=',' read -r -a DEP <<<"$(echo "${TERMUX_PKG_DEPENDS},${TERMUX_PKG_BUILD_DEPENDS}" | tr -d ' ')"
for dep in "${DEP[@]}"; do
if [[ "${dep}" == haskell-* ]]; then
echo "Dependency '${pkg}' is a haskell package, registering it with ghc-pkg..."
if [[ "${dep/haskell-/}" != "${dep}" ]]; then
echo "Dependency '${dep}' is a haskell package, registering it with ghc-pkg..."
sed "s|${TERMUX_PREFIX}/bin/ghc-pkg|$(command -v termux-ghc-pkg)|g" \
"${TERMUX_PREFIX}/share/haskell/register/${pkg}.sh" | sh
"${TERMUX_PREFIX}/share/haskell/register/${dep}.sh" | sh
termux-ghc-pkg recache
# NOTE: Above command rewrites a cache file at
# "${TERMUX_PREFIX}/lib/ghc-${TERMUX_GHC_VERSION}/package.conf.d". Since it is done after