forked from mirrors/nixpkgs
306d5cdf03
This involved: * Installing miniperl as $dev/bin/perl * Setting miniperl to take INC from lib/perl5/{site_perl/,}cross_perl/${version} as well as lib/perl5/{site_perl/,}/${version}/${runtimeArch}, in that order. miniperl taking from runtimeArch is not really correct, but it works in some pure-perl cases (e.g. Config.pm) and can be overridden with the cross_perl variant. * Installing perl-cross's stubs into $dev/lib/perl5/cross_perl/${version} * Patching MakeMaker.pm to gracefully degrade (very slightly) if B.pm can't be loaded, which it can't in cross-compilation. * Passing the right build-time and runtime perls to Makefile.PL
34 lines
740 B
Nix
34 lines
740 B
Nix
perl:
|
|
|
|
{ nativeBuildInputs ? [], name, ... } @ attrs:
|
|
|
|
perl.stdenv.mkDerivation (
|
|
{
|
|
outputs = [ "out" "devdoc" ];
|
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "test";
|
|
|
|
# Prevent CPAN downloads.
|
|
PERL_AUTOINSTALL = "--skipdeps";
|
|
|
|
# Avoid creating perllocal.pod, which contains a timestamp
|
|
installTargets = "pure_install";
|
|
|
|
# From http://wiki.cpantesters.org/wiki/CPANAuthorNotes: "allows
|
|
# authors to skip certain tests (or include certain tests) when
|
|
# the results are not being monitored by a human being."
|
|
AUTOMATED_TESTING = true;
|
|
}
|
|
//
|
|
attrs
|
|
//
|
|
{
|
|
name = "perl-" + name;
|
|
builder = ./builder.sh;
|
|
nativeBuildInputs = nativeBuildInputs ++ [ (perl.dev or perl) ];
|
|
inherit perl;
|
|
}
|
|
)
|