2019-05-03 12:53:36 +02:00
|
|
|
{ lib, stdenv, perl, buildPerl, toPerlModule }:
|
2005-01-22 01:19:27 +01:00
|
|
|
|
2019-06-20 15:07:56 +02:00
|
|
|
{ buildInputs ? [], nativeBuildInputs ? [], ... } @ attrs:
|
2005-01-22 01:19:27 +01:00
|
|
|
|
2019-06-20 15:07:56 +02:00
|
|
|
assert attrs?pname -> attrs?version;
|
|
|
|
assert attrs?pname -> !(attrs?name);
|
|
|
|
|
|
|
|
(if attrs ? name then
|
|
|
|
lib.trivial.warn "builtPerlPackage: `name' (\"${attrs.name}\") is deprecated, use `pname' and `version' instead"
|
|
|
|
else
|
|
|
|
(x: x))
|
2019-04-09 16:49:47 +02:00
|
|
|
toPerlModule(stdenv.mkDerivation (
|
2018-07-11 05:43:22 +02:00
|
|
|
(
|
2018-06-26 12:12:14 +02:00
|
|
|
lib.recursiveUpdate
|
2009-02-12 16:56:35 +01:00
|
|
|
{
|
2016-09-01 11:07:23 +02:00
|
|
|
outputs = [ "out" "devdoc" ];
|
2013-08-26 12:04:56 +02:00
|
|
|
|
2009-02-12 16:56:35 +01:00
|
|
|
doCheck = true;
|
2013-08-26 12:04:56 +02:00
|
|
|
|
2009-02-12 16:56:35 +01:00
|
|
|
checkTarget = "test";
|
2013-08-26 12:04:56 +02:00
|
|
|
|
2009-07-02 15:54:52 +02:00
|
|
|
# Prevent CPAN downloads.
|
|
|
|
PERL_AUTOINSTALL = "--skipdeps";
|
|
|
|
|
2014-04-10 13:45:26 +02:00
|
|
|
# Avoid creating perllocal.pod, which contains a timestamp
|
|
|
|
installTargets = "pure_install";
|
|
|
|
|
2009-07-02 15:54:52 +02:00
|
|
|
# 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;
|
2018-07-11 05:43:22 +02:00
|
|
|
|
2018-06-26 12:12:14 +02:00
|
|
|
# current directory (".") is removed from @INC in Perl 5.26 but many old libs rely on it
|
|
|
|
# https://metacpan.org/pod/release/XSAWYERX/perl-5.26.0/pod/perldelta.pod#Removal-of-the-current-directory-%28%22.%22%29-from-@INC
|
2018-10-03 21:25:44 +02:00
|
|
|
PERL_USE_UNSAFE_INC = "1";
|
2018-06-26 12:12:14 +02:00
|
|
|
|
2019-06-20 15:07:56 +02:00
|
|
|
meta.homepage = "https://metacpan.org/release/${attrs.pname or (builtins.parseDrvName attrs.name).name}"; # TODO: phase-out `attrs.name`
|
2019-01-18 13:47:58 +01:00
|
|
|
meta.platforms = perl.meta.platforms;
|
2009-02-12 16:56:35 +01:00
|
|
|
}
|
|
|
|
attrs
|
2018-07-11 05:43:22 +02:00
|
|
|
)
|
2009-02-12 16:56:35 +01:00
|
|
|
//
|
|
|
|
{
|
2019-06-20 15:07:56 +02:00
|
|
|
pname = "perl${perl.version}-${attrs.pname or (builtins.parseDrvName attrs.name).name}"; # TODO: phase-out `attrs.name`
|
|
|
|
version = attrs.version or (builtins.parseDrvName attrs.name).version; # TODO: phase-out `attrs.name`
|
2009-02-12 16:56:35 +01:00
|
|
|
builder = ./builder.sh;
|
2019-05-17 06:12:24 +02:00
|
|
|
buildInputs = buildInputs ++ [ perl ];
|
2018-02-28 18:00:03 +01:00
|
|
|
nativeBuildInputs = nativeBuildInputs ++ [ (perl.dev or perl) ];
|
2019-05-03 12:53:36 +02:00
|
|
|
fullperl = buildPerl;
|
2009-02-12 16:56:35 +01:00
|
|
|
}
|
2019-04-09 16:49:47 +02:00
|
|
|
))
|