polyml: Fix polyc linking script

polyc linking script hardcodes the linker to be the value of `$CXX` at
compile time. This is bad for environments without `g++` in path. Fix
this by patching the correct path into the script.

Co-Authored-By: Ricardo Correia <someplaceguy@wizy.org>
Co-Authored-By: Ivan Trubach <mr.trubach@icloud.com>
(cherry picked from commit 3a717e7522)
This commit is contained in:
sempiternal-aurora
2026-04-19 23:44:38 +10:00
parent 19e44e2608
commit 23f75822bd

View File

@@ -1,6 +1,7 @@
{
lib,
stdenv,
pkgsHostTarget,
fetchFromGitHub,
autoreconfHook,
gmp,
@@ -35,6 +36,7 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
libffi
gmp
pkgsHostTarget.stdenv.cc
];
nativeBuildInputs = [ autoreconfHook ];
@@ -45,6 +47,11 @@ stdenv.mkDerivation (finalAttrs: {
"--with-gmp"
];
preInstall = ''
substituteInPlace polyc \
--replace-fail "LINK=\"$CXX\"" "LINK=\"${lib.getExe' pkgsHostTarget.stdenv.cc "c++"}\""
'';
doCheck = true;
meta = {