perlPackages.JSON: fix cross build

Fix cross build by forcing the core provided JSON::PP backend. Also
remove cross related Makefile.PL patch that is no longer needed.
This commit is contained in:
Stig Palmquist
2026-01-05 20:18:53 +01:00
parent 1e46161ce7
commit a34ef0b0a1
+5 -2
View File
@@ -18100,9 +18100,12 @@ with self;
url = "mirror://cpan/authors/id/I/IS/ISHIGAKI/JSON-4.10.tar.gz";
hash = "sha256-34tRQ9mn3pnEe1XxoXC9H2n3EZNcGGptwKtW3QV1jjU=";
};
# Do not abort cross-compilation on failure to load native JSON module into host perl
# Force core provided JSON::PP backend when cross building since dynamic
# loading attempts of other backends presumably fail
preConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
substituteInPlace Makefile.PL --replace "exit 0;" ""
substituteInPlace lib/JSON.pm \
--replace-fail 'my $backend = exists $ENV{PERL_JSON_BACKEND} ? $ENV{PERL_JSON_BACKEND} : 1;' \
'my $backend = "JSON::PP";'
'';
buildInputs = [ TestPod ];
meta = {