Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at netboot-syslinux-multiplatform 84 lines 2.9 kB view raw
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 keep = self: { }; 38 extra = spliced0: {}; 39 in makeScopeWithSplicing 40 otherSplices 41 keep 42 extra 43 perlPackagesFun) 44 { 45 perl = self; 46 }; 47 in rec { 48 buildEnv = callPackage ./wrapper.nix { 49 perl = self; 50 inherit (pkgs) requiredPerlModules; 51 }; 52 withPackages = f: buildEnv.override { extraLibs = f pkgs; }; 53 pkgs = perlPackages // (overrides pkgs); 54 interpreter = "${self}/bin/perl"; 55 libPrefix = "lib/perl5/site_perl"; 56 perlOnBuild = perlOnBuildForHost.override { inherit overrides; self = perlOnBuild; }; 57 }; 58 59in rec { 60 # Maint version 61 perl534 = callPackage ./intepreter.nix { 62 self = perl534; 63 version = "5.34.1"; 64 sha256 = "sha256-NXlRpJGwuhzjYRJjki/ux4zNWB3dwkpEawM+JazyQqE="; 65 inherit passthruFun; 66 }; 67 68 # Maint version 69 perl536 = callPackage ./intepreter.nix { 70 self = perl536; 71 version = "5.36.0"; 72 sha256 = "sha256-4mCFr4rDlvYq3YpTPDoOqMhJfYNvBok0esWr17ek4Ao="; 73 inherit passthruFun; 74 }; 75 76 # the latest Devel version 77 perldevel = callPackage ./intepreter.nix { 78 self = perldevel; 79 perlAttr = "perldevel"; 80 version = "5.37.0"; 81 sha256 = "sha256-8RQO6gtH+WmghqzRafbqAH1MhKv/vJCcvysi7/+T9XI="; 82 inherit passthruFun; 83 }; 84}