diff options
Diffstat (limited to 'nixpkgs/pkgs/top-level/perl-packages.nix')
-rw-r--r-- | nixpkgs/pkgs/top-level/perl-packages.nix | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/nixpkgs/pkgs/top-level/perl-packages.nix b/nixpkgs/pkgs/top-level/perl-packages.nix index 3db604b9e325..338e4b61ff48 100644 --- a/nixpkgs/pkgs/top-level/perl-packages.nix +++ b/nixpkgs/pkgs/top-level/perl-packages.nix @@ -16,6 +16,7 @@ let _self = with self; { inherit perl; + perlPackages = self; callPackage = pkgs.newScope self; @@ -41,13 +42,29 @@ let }; # Helper functions for packages that use Module::Build to build. - buildPerlModule = { buildInputs ? [], ... } @ args: - buildPerlPackage (args // { - buildInputs = buildInputs ++ [ ModuleBuild ]; - preConfigure = "touch Makefile.PL"; - buildPhase = "perl Build.PL --prefix=$out; ./Build build"; - installPhase = "./Build install"; - checkPhase = "./Build test"; + buildPerlModule = args: + buildPerlPackage ({ + buildPhase = '' + runHook preBuild + perl Build.PL --prefix=$out; ./Build build + runHook postBuild + ''; + installPhase = '' + runHook preInstall + ./Build install + runHook postInstall + ''; + checkPhase = '' + runHook preCheck + ./Build test + runHook postCheck + ''; + } // args // { + preConfigure = '' + touch Makefile.PL + ${args.preConfigure or ""} + ''; + buildInputs = (args.buildInputs or []) ++ [ ModuleBuild ]; }); /* Construct a perl search path (such as $PERL5LIB) @@ -432,10 +449,6 @@ let buildInputs = [ pkgs.curl FileWhich IOAll ModuleBuildTiny PathClass TestException TestNoWarnings TestOutput TestSpec TestTempDirTiny ]; propagatedBuildInputs = [ CPANPerlReleases CaptureTiny DevelPatchPerl locallib ]; - preConfigure = '' - patchShebangs . - ''; - doCheck = false; meta = { @@ -5464,6 +5477,9 @@ let }; buildInputs = [ CaptureTiny ]; propagatedBuildInputs = [ EmailAbstract EmailAddress MooXTypesMooseLike SubExporter Throwable TryTiny ]; + postPatch = '' + patchShebangs --build util + ''; meta = { homepage = https://github.com/rjbs/Email-Sender; description = "A library for sending email"; @@ -6116,7 +6132,7 @@ let sha256 = "c065fcd3e2f22ae769937bcc971b91f80294d5009fac140bfba83bf7d35305e3"; }; configurePhase = '' - preConfigure || true + runHook preConfigure perl Build.PL PREFIX="$out" prefix="$out" ''; propagatedBuildInputs = [ IPCSystemSimple ]; @@ -6220,6 +6236,10 @@ let sha256 = "f1f1820ff44042f6b30e4d6be1db860b9e743b1a9836070ea656ad9829e4eca5"; }; propagatedBuildInputs = [ FileFindObject NumberCompare TextGlob ]; + # restore t/sample-data which is corrupted by patching shebangs + preCheck = '' + tar xf $src */t/sample-data --strip-components=1 + ''; meta = { homepage = https://www.shlomifish.org/open-source/projects/File-Find-Object/; description = "Alternative interface to File::Find::Object"; |