Commit Graph

10 Commits

Author SHA1 Message Date
rnhmjoj
61b7cab481
treewide: use perl.withPackages when possible
Since 03eaa48 added perl.withPackages, there is a canonical way to
create a perl interpreter from a list of libraries, for use in script
shebangs or generic build inputs. This method is declarative (what we
are doing is clear), produces short shebangs[1] and needs not to wrap
existing scripts.

Unfortunately there are a few exceptions that I've found:

  1. Scripts that are calling perl with the -T switch. This makes perl
  ignore PERL5LIB, which is what perl.withPackages is using to inform
  the interpreter of the library paths.

  2. Perl packages that depends on libraries in their own path. This
  is not possible because perl.withPackages works at build time. The
  workaround is to add `-I $out/${perl.libPrefix}` to the shebang.

In all other cases I propose to switch to perl.withPackages.

[1]: https://lwn.net/Articles/779997/
2021-03-31 21:35:37 +02:00
Profpatsch
4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00
Neil Mayhew
1d0a930d27 file-rename: Fix an incorrect platform test that misidentifies Darwin as Windows
This causes the script to be installed as `file-rename` instead of `rename` like
it is on other Unix systems. This in turn causes `wrapProgram` to fail when
building because it expects the wrapped program to be called `rename`.
2020-06-27 17:45:28 -06:00
Michael Reilly
84cf00f980
treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
volth
b3cc65f8b9 buildPerlPackage: name -> (pname, version) 2019-06-20 15:56:50 +00:00
Matthew Bauer
9eb4623ae3 file-rename: don’t run tests on darwin
https://hydra.nixos.org/build/92527786
2019-04-26 21:55:10 -04:00
volth
bb9557eb7c lib.makePerlPath -> perlPackages.makePerlPath 2018-12-15 03:50:31 +00:00
Ryan Mulligan
220618ef9c perlPackages: remove search.cpan.org; add metacpan.org default homepage
https://www.perl.com/article/saying-goodbye-to-search-cpan-org/

maybe one operation less

..with unifying recursiveUpdate and first //

although not tested

fix whitespace
2018-07-14 18:49:00 -07:00
Graham Christensen
567a72a161
perl.FileRename: fixup meta 2018-02-12 10:30:27 -05:00
Peter Hoeg
646abe9b29 perl.FileRename: init at 0.20 2018-02-12 22:28:02 +08:00