haskell.compiler.*: set cctools tools in settings if applicable

This commit is contained in:
sternenseemann 2024-09-05 23:41:28 +02:00
parent 8c08fb1090
commit de13f8f454
3 changed files with 19 additions and 0 deletions

View File

@ -466,6 +466,13 @@ stdenv.mkDerivation (rec {
"Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
"ar command" "${toolPath "ar" installCC}" \
"ranlib command" "${toolPath "ranlib" installCC}"
''
+ lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
ghc-settings-edit "$settingsFile" \
"otool command" "${toolPath "otool" installCC}" \
"install_name_tool command" "${toolPath "install_name_tool" installCC}"
''
+ ''
# Install the bash completion file.
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc

View File

@ -617,6 +617,11 @@ stdenv.mkDerivation ({
"ar command" "${toolPath "ar" installCC}" \
"ranlib command" "${toolPath "ranlib" installCC}"
''
+ lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
ghc-settings-edit "$settingsFile" \
"otool command" "${toolPath "otool" installCC}" \
"install_name_tool command" "${toolPath "install_name_tool" installCC}"
''
# Work around a GHC bug which causes unlit to be installed under a different
# name than is used in the settings file.
# https://gitlab.haskell.org/ghc/ghc/-/issues/23317

View File

@ -483,6 +483,13 @@ stdenv.mkDerivation (rec {
"Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
"ar command" "${toolPath "ar" installCC}" \
"ranlib command" "${toolPath "ranlib" installCC}"
''
+ lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
ghc-settings-edit "$settingsFile" \
"otool command" "${toolPath "otool" installCC}" \
"install_name_tool command" "${toolPath "install_name_tool" installCC}"
''
+ ''
# Install the bash completion file.
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc