1{ callPackage }:
2
3let
4 # Common passthru for all perl interpreters.
5 # copied from lua
6 passthruFun =
7 { overrides
8 , perlOnBuildForBuild
9 , perlOnBuildForHost
10 , perlOnBuildForTarget
11 , perlOnHostForHost
12 , perlOnTargetForTarget
13 , perlAttr ? null
14 , self # is perlOnHostForTarget
15 }: let
16 perlPackages = callPackage
17 # Function that when called
18 # - imports perl-packages.nix
19 # - adds spliced package sets to the package set
20 ({ stdenv, pkgs, perl, callPackage, makeScopeWithSplicing' }: let
21 perlPackagesFun = callPackage ../../../top-level/perl-packages.nix {
22 # allow 'perlPackages.override { pkgs = pkgs // { imagemagick = imagemagickBig; }; }' like in python3Packages
23 # most perl packages aren't called with callPackage so it's not possible to override their arguments individually
24 # the conditional is because the // above won't be applied to __splicedPackages and hopefully no one is doing that when cross-compiling
25 pkgs = if stdenv.buildPlatform != stdenv.hostPlatform then pkgs.__splicedPackages else pkgs;
26 inherit stdenv;
27 perl = self;
28 };
29
30 otherSplices = {
31 selfBuildBuild = perlOnBuildForBuild.pkgs;
32 selfBuildHost = perlOnBuildForHost.pkgs;
33 selfBuildTarget = perlOnBuildForTarget.pkgs;
34 selfHostHost = perlOnHostForHost.pkgs;
35 selfTargetTarget = perlOnTargetForTarget.pkgs or {};
36 };
37 in makeScopeWithSplicing' {
38 inherit otherSplices;
39 f = perlPackagesFun;
40 })
41 {
42 perl = self;
43 };
44 in rec {
45 buildEnv = callPackage ./wrapper.nix {
46 perl = self;
47 inherit (pkgs) requiredPerlModules;
48 };
49 withPackages = f: buildEnv.override { extraLibs = f pkgs; };
50 pkgs = perlPackages // (overrides pkgs);
51 interpreter = "${self}/bin/perl";
52 libPrefix = "lib/perl5/site_perl";
53 perlOnBuild = perlOnBuildForHost.override { inherit overrides; self = perlOnBuild; };
54 };
55
56in rec {
57 # Maint version
58 perl536 = callPackage ./intepreter.nix {
59 self = perl536;
60 version = "5.36.1";
61 sha256 = "sha256-aCA2Zdjs4CmI/HfckvzLspeoOku0uNB1WEQvl42lTME=";
62 inherit passthruFun;
63 };
64
65 # Maint version
66 perl538 = callPackage ./intepreter.nix {
67 self = perl538;
68 version = "5.38.0";
69 sha256 = "sha256-IT71gInS8sly6jU1F9xg7DZW8FDcwCdmbhGLUIQj5Rc=";
70 inherit passthruFun;
71 };
72}