From 6e96ad3e922cb61c9bc81017db3e22a3c4535894 Mon Sep 17 00:00:00 2001 From: Aditya Alok Date: Fri, 26 Jan 2024 14:43:20 +0530 Subject: [PATCH] Cabal: patch to not pass host flag We pass manually using `--configure-option` --- scripts/cabal-install/dont-pass-host-flag.patch | 13 +++++++++++++ scripts/compile.sh | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 scripts/cabal-install/dont-pass-host-flag.patch diff --git a/scripts/cabal-install/dont-pass-host-flag.patch b/scripts/cabal-install/dont-pass-host-flag.patch new file mode 100644 index 0000000..e9d75ff --- /dev/null +++ b/scripts/cabal-install/dont-pass-host-flag.patch @@ -0,0 +1,13 @@ +--- cabal-Cabal-v3.10.1.0/Cabal/src/Distribution/Simple/ConfigureScript.hs 2023-03-09 21:16:30.000000000 +0530 ++++ cabal-Cabal-v3.10.1.0.mod/Cabal/src/Distribution/Simple/ConfigureScript.hs 2024-01-26 14:37:01.961853234 +0530 +@@ -133,9 +133,7 @@ + overEnv = ("CFLAGS", Just cflagsEnv) : + [("PATH", Just pathEnv) | not (null extraPath)] ++ + cabalFlagEnv +- hp = hostPlatform lbi +- maybeHostFlag = if hp == buildPlatform then [] else ["--host=" ++ show (pretty hp)] +- args' = configureFile':args ++ ["CC=" ++ ccProgShort] ++ maybeHostFlag ++ args' = configureFile':args ++ ["CC=" ++ ccProgShort] + shProg = simpleProgram "sh" + progDb = modifyProgramSearchPath + (\p -> map ProgramSearchPathDir extraPath ++ p) emptyProgramDb diff --git a/scripts/compile.sh b/scripts/compile.sh index 075b74c..cdac409 100755 --- a/scripts/compile.sh +++ b/scripts/compile.sh @@ -30,7 +30,9 @@ build_cabal() { cd "${build_dir}" - patch -p1 <"${ROOT}"/cabal-install/fix-cabal-osStr.patch + for patch in "${ROOT}"/cabal-install/*.patch; do + patch -p1 <"$patch" + done mkdir -p "${build_dir}/bin" cabal install cabal-install \