perl: Fix bootstrap loop in case of cross-compilation

Signed-off-by: Alexander V. Nikolaev <avn@avnik.info>
This commit is contained in:
Alexander V. Nikolaev
2025-10-14 17:53:02 +03:00
committed by Stig Palmquist
parent 2b13410f7a
commit 738cc1a199
@@ -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;