Skip to content

Commit

Permalink
perl: use self == __splicedPackages instead of perl and buildPerl
Browse files Browse the repository at this point in the history
  • Loading branch information
Artturin committed Dec 5, 2022
1 parent 170fb52 commit d79affc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
18 changes: 8 additions & 10 deletions pkgs/development/interpreters/perl/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ config, lib, stdenv, fetchurl, fetchFromGitHub, pkgs, buildPackages
{ config, lib, stdenv, fetchurl, fetchFromGitHub, buildPackages
, __splicedPackages
, callPackage
, enableThreading ? true, coreutils, makeWrapper
, enableCrypt ? true, libxcrypt ? null
Expand All @@ -21,7 +22,7 @@ let
libcLib = lib.getLib libc;
crossCompiling = stdenv.buildPlatform != stdenv.hostPlatform;

common = { perl, buildPerl, version, sha256 }: stdenv.mkDerivation (rec {
common = { self, version, sha256 }: stdenv.mkDerivation (rec {
inherit version;
pname = "perl";

Expand Down Expand Up @@ -145,11 +146,11 @@ let
interpreter = "${perl}/bin/perl";
libPrefix = "lib/perl5/site_perl";
pkgs = callPackage ../../../top-level/perl-packages.nix {
inherit perl buildPerl;
perl = self;
overrides = config.perlPackageOverrides or (p: {}); # TODO: (self: super: {}) like in python
};
buildEnv = callPackage ./wrapper.nix {
inherit perl;
perl = self;
inherit (pkgs) requiredPerlModules;
};
withPackages = f: buildEnv.override { extraLibs = f pkgs; };
Expand Down Expand Up @@ -233,24 +234,21 @@ let
in {
# Maint version
perl534 = common {
perl = pkgs.perl534;
buildPerl = buildPackages.perl534;
self = __splicedPackages.perl534;
version = "5.34.1";
sha256 = "sha256-NXlRpJGwuhzjYRJjki/ux4zNWB3dwkpEawM+JazyQqE=";
};

# Maint version
perl536 = common {
perl = pkgs.perl536;
buildPerl = buildPackages.perl536;
self = __splicedPackages.perl536;
version = "5.36.0";
sha256 = "sha256-4mCFr4rDlvYq3YpTPDoOqMhJfYNvBok0esWr17ek4Ao=";
};

# the latest Devel version
perldevel = common {
perl = pkgs.perldevel;
buildPerl = buildPackages.perldevel;
self = __splicedPackages.perldevel;
version = "5.37.0";
sha256 = "sha256-8RQO6gtH+WmghqzRafbqAH1MhKv/vJCcvysi7/+T9XI=";
};
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/perl-modules/generic/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, perl, buildPerl, toPerlModule }:
{ lib, stdenv, perl, toPerlModule }:

{ buildInputs ? []
, nativeBuildInputs ? []
Expand Down Expand Up @@ -43,7 +43,7 @@ lib.throwIf (attrs ? name) "buildPerlPackage: `name` (\"${attrs.name}\") is depr
buildInputs = buildInputs ++ [ perl ];
nativeBuildInputs = nativeBuildInputs ++ [ (perl.mini or perl) ];

fullperl = buildPerl;
fullperl = perl.__spliced.buildHost or perl;

inherit outputs src doCheck checkTarget enableParallelBuilding;
inherit PERL_AUTOINSTALL AUTOMATED_TESTING PERL_USE_UNSAFE_INC;
Expand Down
6 changes: 2 additions & 4 deletions pkgs/top-level/perl-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{ config
, stdenv, lib, buildPackages, pkgs, darwin
, fetchurl, fetchpatch, fetchFromGitHub, fetchFromGitLab
, perl, overrides, buildPerl, shortenPerlShebang
, perl, overrides, shortenPerlShebang
, nixosTests
}:

Expand Down Expand Up @@ -41,9 +41,7 @@ let
};
});

buildPerlPackage = callPackage ../development/perl-modules/generic {
inherit buildPerl;
};
buildPerlPackage = callPackage ../development/perl-modules/generic { inherit perl; };

# Helper functions for packages that use Module::Build to build.
buildPerlModule = args:
Expand Down

0 comments on commit d79affc

Please sign in to comment.