From de13f8f45475ca2d7c8a9baa378f92e835703939 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Thu, 5 Sep 2024 23:41:28 +0200 Subject: [PATCH] haskell.compiler.*: set cctools tools in settings if applicable --- pkgs/development/compilers/ghc/8.10.7.nix | 7 +++++++ pkgs/development/compilers/ghc/common-hadrian.nix | 5 +++++ .../compilers/ghc/common-make-native-bignum.nix | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/pkgs/development/compilers/ghc/8.10.7.nix b/pkgs/development/compilers/ghc/8.10.7.nix index 294ec4d8c3c8..3fe17f620d07 100644 --- a/pkgs/development/compilers/ghc/8.10.7.nix +++ b/pkgs/development/compilers/ghc/8.10.7.nix @@ -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 diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index 644481bb3081..7ccd78154484 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -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 diff --git a/pkgs/development/compilers/ghc/common-make-native-bignum.nix b/pkgs/development/compilers/ghc/common-make-native-bignum.nix index b3f04952de77..d121baf21c24 100644 --- a/pkgs/development/compilers/ghc/common-make-native-bignum.nix +++ b/pkgs/development/compilers/ghc/common-make-native-bignum.nix @@ -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