Skip to content

Commit

Permalink
perlPackages.ModuleBuild: fix cross-compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
ck3d committed Jul 2, 2023
1 parent d75e20c commit 2d6f287
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkgs/top-level/perl-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15381,6 +15381,20 @@ with self; {
url = "mirror://cpan/authors/id/L/LE/LEONT/Module-Build-0.4231.tar.gz";
hash = "sha256-fg9MaSwXQMGshOoU1+o9i8eYsvsmwJh3Ip4E9DCytxc=";
};
postConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
# for unknown reason, the first run of Build fails
./Build || true
'';
postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
# remove version check since miniperl uses a stub of File::Temp, which do not provide a version:
# https://github.com/arsv/perl-cross/blob/master/cnf/stub/File/Temp.pm
sed -i '/File::Temp/d' \
Build.PL

# fix discover perl function, it can not handle a wrapped perl
sed -i "s,\$self->_discover_perl_interpreter,'$(type -p perl)',g" \
lib/Module/Build/Base.pm
'';
meta = {
description = "Build and install Perl modules";
license = with lib.licenses; [ artistic1 gpl1Plus ];
Expand Down

0 comments on commit 2d6f287

Please sign in to comment.