From 23f75822bd61ba518421641c92d8112f3fa2b599 Mon Sep 17 00:00:00 2001 From: sempiternal-aurora <78790545+sempiternal-aurora@users.noreply.github.com> Date: Sun, 19 Apr 2026 23:44:38 +1000 Subject: [PATCH] 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 Co-Authored-By: Ivan Trubach (cherry picked from commit 3a717e7522076b62cc6a9f49551cd82acb79e8bc) --- pkgs/by-name/po/polyml/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/po/polyml/package.nix b/pkgs/by-name/po/polyml/package.nix index d8f6aff45d7f..18674635298b 100644 --- a/pkgs/by-name/po/polyml/package.nix +++ b/pkgs/by-name/po/polyml/package.nix @@ -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 = {