Skip to content

Commit

Permalink
haskell.compiler.*: set cctools tools in settings if applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
sternenseemann committed Sep 8, 2024
1 parent 8c08fb1 commit de13f8f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkgs/development/compilers/ghc/8.10.7.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions pkgs/development/compilers/ghc/common-hadrian.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions pkgs/development/compilers/ghc/common-make-native-bignum.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit de13f8f

Please sign in to comment.