2023-04-29 16:46:19 +00:00
|
|
|
{ callPackage }:
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2023-04-29 16:46:19 +00:00
|
|
|
# Common passthru for all perl interpreters.
|
|
|
|
# copied from lua
|
|
|
|
passthruFun =
|
|
|
|
{ overrides
|
|
|
|
, perlOnBuildForBuild
|
|
|
|
, perlOnBuildForHost
|
|
|
|
, perlOnBuildForTarget
|
|
|
|
, perlOnHostForHost
|
|
|
|
, perlOnTargetForTarget
|
|
|
|
, perlAttr ? null
|
|
|
|
, self # is perlOnHostForTarget
|
|
|
|
}: let
|
|
|
|
perlPackages = callPackage
|
|
|
|
# Function that when called
|
|
|
|
# - imports perl-packages.nix
|
|
|
|
# - adds spliced package sets to the package set
|
2023-08-22 20:05:09 +00:00
|
|
|
({ stdenv, pkgs, perl, callPackage, makeScopeWithSplicing' }: let
|
2023-04-29 16:46:19 +00:00
|
|
|
perlPackagesFun = callPackage ../../../top-level/perl-packages.nix {
|
|
|
|
# allow 'perlPackages.override { pkgs = pkgs // { imagemagick = imagemagickBig; }; }' like in python3Packages
|
|
|
|
# most perl packages aren't called with callPackage so it's not possible to override their arguments individually
|
|
|
|
# the conditional is because the // above won't be applied to __splicedPackages and hopefully no one is doing that when cross-compiling
|
|
|
|
pkgs = if stdenv.buildPlatform != stdenv.hostPlatform then pkgs.__splicedPackages else pkgs;
|
|
|
|
inherit stdenv;
|
|
|
|
perl = self;
|
|
|
|
};
|
|
|
|
|
|
|
|
otherSplices = {
|
|
|
|
selfBuildBuild = perlOnBuildForBuild.pkgs;
|
|
|
|
selfBuildHost = perlOnBuildForHost.pkgs;
|
|
|
|
selfBuildTarget = perlOnBuildForTarget.pkgs;
|
|
|
|
selfHostHost = perlOnHostForHost.pkgs;
|
|
|
|
selfTargetTarget = perlOnTargetForTarget.pkgs or {};
|
|
|
|
};
|
2023-08-22 20:05:09 +00:00
|
|
|
in makeScopeWithSplicing' {
|
|
|
|
inherit otherSplices;
|
|
|
|
f = perlPackagesFun;
|
|
|
|
})
|
2023-04-29 16:46:19 +00:00
|
|
|
{
|
|
|
|
perl = self;
|
|
|
|
};
|
|
|
|
in rec {
|
|
|
|
buildEnv = callPackage ./wrapper.nix {
|
|
|
|
perl = self;
|
|
|
|
inherit (pkgs) requiredPerlModules;
|
|
|
|
};
|
|
|
|
withPackages = f: buildEnv.override { extraLibs = f pkgs; };
|
|
|
|
pkgs = perlPackages // (overrides pkgs);
|
|
|
|
interpreter = "${self}/bin/perl";
|
|
|
|
libPrefix = "lib/perl5/site_perl";
|
|
|
|
perlOnBuild = perlOnBuildForHost.override { inherit overrides; self = perlOnBuild; };
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
in rec {
|
2021-07-21 07:28:18 +00:00
|
|
|
# Maint version
|
2023-08-10 07:59:29 +00:00
|
|
|
perl536 = callPackage ./intepreter.nix {
|
|
|
|
self = perl536;
|
|
|
|
version = "5.36.1";
|
|
|
|
sha256 = "sha256-aCA2Zdjs4CmI/HfckvzLspeoOku0uNB1WEQvl42lTME=";
|
2023-04-29 16:46:19 +00:00
|
|
|
inherit passthruFun;
|
2021-07-21 07:28:18 +00:00
|
|
|
};
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
# Maint version
|
2023-08-10 07:59:29 +00:00
|
|
|
perl538 = callPackage ./intepreter.nix {
|
|
|
|
self = perl538;
|
|
|
|
version = "5.38.0";
|
|
|
|
sha256 = "sha256-IT71gInS8sly6jU1F9xg7DZW8FDcwCdmbhGLUIQj5Rc=";
|
2023-04-29 16:46:19 +00:00
|
|
|
inherit passthruFun;
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|