From 738cc1a199d941d8f333529324c6cb0b2bc2920f Mon Sep 17 00:00:00 2001 From: "Alexander V. Nikolaev" Date: Tue, 14 Oct 2025 17:53:02 +0300 Subject: [PATCH] perl: Fix bootstrap loop in case of cross-compilation Signed-off-by: Alexander V. Nikolaev --- pkgs/development/interpreters/perl/interpreter.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/development/interpreters/perl/interpreter.nix b/pkgs/development/interpreters/perl/interpreter.nix index 0de0d9c6cdb7..9255a3d6d9fb 100644 --- a/pkgs/development/interpreters/perl/interpreter.nix +++ b/pkgs/development/interpreters/perl/interpreter.nix @@ -166,10 +166,14 @@ stdenv.mkDerivation ( configureScript = lib.optionalString (!crossCompiling) "${stdenv.shell} ./Configure"; # !canExecute cross uses miniperl which doesn't have this - postConfigure = lib.optionalString (!crossCompiling && stdenv.cc.targetPrefix != "") '' - substituteInPlace Makefile \ - --replace-fail "AR = ar" "AR = ${stdenv.cc.targetPrefix}ar" - ''; + postConfigure = + lib.optionalString (!crossCompiling && stdenv.cc.targetPrefix != "") '' + substituteInPlace Makefile \ + --replace-fail "AR = ar" "AR = ${stdenv.cc.targetPrefix}ar" + '' + + lib.optionalString crossCompiling '' + substituteInPlace miniperl_top --replace-fail '-I$top/lib' '-I$top/cpan/JSON-PP/lib -I$top/cpan/CPAN-Meta-YAML/lib -I$top/lib' + ''; dontAddStaticConfigureFlags = true;