Skip to content

Commit

Permalink
!fixup settingsFile variable
Browse files Browse the repository at this point in the history
TODO: annotate
  • Loading branch information
sternenseemann committed Sep 4, 2024
1 parent ce4208a commit ca53372
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pkgs/development/compilers/ghc/8.10.7.nix
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,10 @@ stdenv.mkDerivation (rec {
requiredSystemFeatures = [ "big-parallel" ];

postInstall = ''
settingsFile="$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings"
# Make the installed GHC use the host platform's tools.
sed -i $out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings \
sed -i "$settingsFile" \
-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" \
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/compilers/ghc/common-hadrian.nix
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,10 @@ stdenv.mkDerivation ({
# leave bindist directory
popd
settingsFile="$out/lib/${targetPrefix}${haskellCompilerName}/lib/settings"
# Make the installed GHC use the host platform's tools.
sed -i $out/lib/${targetPrefix}${haskellCompilerName}/lib/settings \
sed -i "$settingsFile" \
-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" \
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/compilers/ghc/common-make-native-bignum.nix
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,10 @@ stdenv.mkDerivation (rec {
requiredSystemFeatures = [ "big-parallel" ];

postInstall = ''
settingsFile="$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings"
# Make the installed GHC use the host platform's tools.
ghc-settings-edit "$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings" \
ghc-settings-edit "$settingsFile" \
"C compiler command" "${toolPath "cc" installCC}" \
"Haskell CPP command" "${toolPath "cc" installCC}" \
"C++ compiler command" "${toolPath "c++" installCC}" \
Expand Down

0 comments on commit ca53372

Please sign in to comment.