Skip to content

Commit

Permalink
!fixup haskell.compiler.ghc948: use ghc-settings-edit
Browse files Browse the repository at this point in the history
  • Loading branch information
sternenseemann committed Apr 27, 2024
1 parent 98c5478 commit c5f0619
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pkgs/development/compilers/ghc/9.4.8.nix
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ stdenv.mkDerivation (rec {
nativeBuildInputs = [
perl autoconf automake m4 python3
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
bootPkgs.ghc-settings-edit
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
autoSignDarwinBinariesHook
] ++ lib.optionals enableDocs [
Expand Down Expand Up @@ -384,12 +385,15 @@ stdenv.mkDerivation (rec {

postInstall = ''
# Make the installed GHC use the host platform's tools.
sed -i $out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings \
-e "s!$CC!${installCC}/bin/${installCC.targetPrefix}cc!g" \
-e "s!$CXX!${installCC}/bin/${installCC.targetPrefix}c++!g" \
-e "s!$LD!${installCC.bintools}/bin/${installCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}!g" \
-e "s!$AR!${installCC.bintools.bintools}/bin/${installCC.bintools.targetPrefix}ar!g" \
-e "s!$RANLIB!${installCC.bintools.bintools}/bin/${installCC.bintools.targetPrefix}ranlib!g"
ghc-settings-edit "$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings" \
"C compiler command" "${installCC}/bin/${installCC.targetPrefix}cc" \
"Haskell CPP command" "${installCC}/bin/${installCC.targetPrefix}cc" \
"C++ compiler command" "${installCC}/bin/${installCC.targetPrefix}c++" \
"ld command" "${installCC.bintools}/bin/${installCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}" \
"Merge objects command" "${installCC.bintools}/bin/${installCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}" \
"ar command" "${installCC.bintools}/bin/${installCC.bintools.targetPrefix}ar" \
"ranlib command" "${installCC.bintools}/bin/${installCC.bintools.targetPrefix}ranlib"
# TODO: otool/install_name_tool
# 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 c5f0619

Please sign in to comment.