Commit Graph

51 Commits

Author SHA1 Message Date
Tobias Mayer
8df266da79
pkgsStatic.perl: fix build 2024-09-07 19:09:49 +02:00
Wolfgang Walther
581aebcdad
perl: support structuredAttrs in generic builder
Tested perlPackages.GSSAPI with and without __structuredAttrs.
2024-08-24 12:23:38 +02:00
Maximilian Bosch
8bc5104a6e
treewide: refactor .attrs.sh detection
When specifying the `builder` attribute in `stdenv.mkDerivation`, this
will be effectively transformed into

    builtins.derivation {
      builder = stdenv.shell;
      args = [ "-e" builder ];
    }

This also means that `default-builder.sh` is never sourced and as a
result it's not guaranteed that `$NIX_ATTRS_SH_FILE` is set to a correct
location[1].

Also, we need to source `.attrs.sh` to source `$stdenv`. So, the
following is done now:

* If `$NIX_ATTRS_SH_FILE` points to a correct location, then use it.
  Directly using `.attrs.sh` is problematic for `nix-shell(1)` usage
  (see previous commit for more context), so prefer the environment
  variable if possible.

* Otherwise, if `.attrs.sh` exists, then use it. See [1] for when this
  can happen.

* If neither applies, it can be assumed that `__structuredAttrs` is
  turned off and thus nothing needs to be done.

[1] It's possible that it doesn't exist at all - in case of Nix 2.3 or
    it can point to a wrong location on older Nix versions with a bug in
    `__structuredAttrs`.
2023-10-04 18:36:57 +02:00
Artturin
af0fc32127 perlPackages: use makeScopeWithSplicing 2023-04-11 18:49:10 +03:00
Artturin
c01f509e44 treewide: source .attrs in builders
if theres a source $stdenv then this is needed

for structuredAttrs
2022-12-08 21:09:02 +02:00
Artturin
adc8900df1 treewide: fix some core package structuredAttrs 2022-12-08 21:05:28 +02:00
Malo Bourgon
399732b449 buildPerlPackage: don't mess with pname and phase out use of name
Currently `buildPerlPackage` prefixes the Perl version to the package's
`pname`, which results in `nix run` not being able to work for any
packages build with it out of the box. This commit corrects that and
phases out the ability to set `name` directly, as well as refactors the
code to not require `cleanedAttrs`.
2022-06-07 12:49:23 -07:00
Malo Bourgon
61beb33b83 Revert "perlPackages: add default meta.mainProgram (#176398)"
This reverts commit ff7b216dcf.
2022-06-07 12:20:33 -07:00
Jonas Chevalier
ff7b216dcf
perlPackages: add default meta.mainProgram (#176398)
Because perl packages are prefixed with the perl version, it means that
the `lib.getExe` heuristic will never point to the binary name. So we
provide the meta.mainProgram that overrides that, using the original
pname or parsed name. It's not perfect but should yield better results
already.
2022-06-06 14:35:07 +02:00
Artturin
1d44ac176c treewide: add enableParallelBuilding's to bootstrap packages so hashes stay the same
when enableParallelBuildingByDefault is enabled

verified with
`nix-diff $(nix eval ".#gcc-unwrapped.drvPath") $(nix eval --expr 'with import ./. { config = { enableParallelBuildingByDefault = true; }; }; gcc-unwrapped.drvPath' --impure)`
2022-05-25 16:03:14 +03:00
Jonathan Ringer
c36c0bdba3 perlPackages: restore meta.positoin 2022-02-10 10:50:25 -08:00
Alyssa Ross
a8afbb45c1 treewide: use lib.warnIf where appropriate 2021-04-28 21:44:21 +00:00
Ben Wolsieffer
d61f1a4a5f perl: rename miniperl output from dev to mini 2020-08-17 13:43:42 -04:00
John Ericson
d0d5136cce Merge remote-tracking branch 'upstream/master' into wrapper-pname-support 2019-11-24 17:25:07 +00:00
John Ericson
9b090ccbca treewide: Get rid of most parseDrvName without breaking compat
That is because this commit should be merged to both master and
release-19.09.
2019-11-24 17:22:28 +00:00
volth
9e60fefc34 buildPerlPackage: remove postFixup
It has no effect since system-wide $PERL5LIB removed more than an year ago
2019-10-22 07:07:18 +00:00
Alyssa Ross
979811fa43
Revert "perl-modules: do not create perllocal.pod, for determinism"
This reverts commit d0bad145f5.

We don't need this any more, because the generated timestamps are
always set to 1970-01-01.

Reverting this will mean we get man pages for perl programs for free,
because those are generally part of the `install' target.
2019-10-03 10:25:14 +00:00
volth
b46e5ea184 buildPerlPackage: recognize "#!perl" as shebang 2019-07-03 08:38:20 +02:00
volth
b3cc65f8b9 buildPerlPackage: name -> (pname, version) 2019-06-20 15:56:50 +00:00
worldofpeace
764c298111 perl: get perl in HOST_PATH for patch-shebangs 2019-05-17 17:04:29 -04:00
volth
120398ab4b perlPackages: fix build packages for non-default perl 2019-05-03 10:53:36 +00:00
volth
03eaa480bd perl: add .withPackages 2019-04-12 09:09:06 +00:00
Michael Eden
33ef2829b6 perlPackages.TermReadKey: add workarounds for cross compilation 2019-02-18 17:31:59 -05:00
volth
aefd9db91b
buildPerlPackage: provide default value for meta.platforms 2019-01-18 12:47:58 +00:00
volth
5f91657ad1 remove support for pre-5.26 Perl 2018-10-03 19:29:58 +00:00
volth
391d9ecc09 perlPackages -> perl{522,524,526,528}Packages 2018-07-16 19:26:05 +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
Shea Levy
ab42a7595a
buildPerlPackage: "properly" quote FULLPERL 2018-03-20 08:43:21 -04:00
Shea Levy
306d5cdf03
perlPackages: Add cross-compilation support.
This involved:

* Installing miniperl as $dev/bin/perl
* Setting miniperl to take INC from
  lib/perl5/{site_perl/,}cross_perl/${version} as well as
  lib/perl5/{site_perl/,}/${version}/${runtimeArch}, in that
  order. miniperl taking from runtimeArch is not really correct, but
  it works in some pure-perl cases (e.g. Config.pm) and can be
  overridden with the cross_perl variant.
* Installing perl-cross's stubs into
  $dev/lib/perl5/cross_perl/${version}
* Patching MakeMaker.pm to gracefully degrade (very slightly) if B.pm
  can't be loaded, which it can't in cross-compilation.
* Passing the right build-time and runtime perls to Makefile.PL
2018-02-28 15:01:32 -05:00
Gabriel Ebner
dbeffe38e8 perl generic builder: recognize #!/usr/bin/env perl 2017-12-15 19:16:23 +01:00
John Ericson
da19c34d0f stdenv setup: Always use both propagated files
This continues #23374, which always kept around both attributes, by
always including both propagated files: `propgated-native-build-inputs`
and `propagated-build-inputs`. `nativePkgs` and `crossPkgs` are still
defined as before, however, so this change should only barely
observable.

This is an incremental step to fully keeping the dependencies separate
in all cases.
2017-11-21 10:44:44 -05:00
Eelco Dolstra
8172cd734c docdev -> devdoc
It's "developer documentation", not "documentation developer" after
all.
2016-09-01 11:07:23 +02:00
Vladimír Čunát
787f322540 $docdev fixups: mostly to avoid empty output
... after auto-removing some kinds of files by default.
In some cases I let them be removed and in others I let them be put into
$docdev. That was more due to general indecisiveness on this question
than any reasons in the particular cases.
2015-10-28 18:58:06 +01:00
Vladimír Čunát
bf414c9d4f Merge 'staging' into closure-size
- there were many easy merge conflicts
- cc-wrapper needed nontrivial changes

Many other problems might've been created by interaction of the branches,
but stdenv and a few other packages build fine now.
2015-04-18 11:22:20 +02:00
Alexander Kjeldaas
d0bad145f5 perl-modules: do not create perllocal.pod, for determinism 2014-12-30 17:03:15 +01:00
Eelco Dolstra
a7b1aa429e Perl generic builder: Put man pages in a separate output 2013-08-26 12:04:56 +02:00
Eelco Dolstra
ab3eeabfed Rename buildNativeInputs -> nativeBuildInputs
Likewise for propagatedBuildNativeInputs, etc.  "buildNativeInputs"
sounds like an imperative rather than a noun phrase.
2012-12-28 19:20:09 +01:00
Eelco Dolstra
d1a7c6e39f * Don't use nested lists.
svn path=/nixpkgs/trunk/; revision=20914
2010-04-01 14:41:51 +00:00
Eelco Dolstra
8126b88ef1 * Doh.
svn path=/nixpkgs/trunk/; revision=19879
2010-02-09 10:43:13 +00:00
Eelco Dolstra
6478e92556 * Symlink propagated-user-env-packages to
propagated-build-native-inputs rather than propagated-build-inputs.

svn path=/nixpkgs/trunk/; revision=19878
2010-02-09 10:42:36 +00:00
Eelco Dolstra
ce84af677b * Improve the determinism of Perl builds: don't try to download stuff
from CPAN.

svn path=/nixpkgs/trunk/; revision=16137
2009-07-02 13:54:52 +00:00
Eelco Dolstra
7ec61219db * lib/site_perl -> lib/perl5/site_perl.
svn path=/nixpkgs/branches/stdenv-updates/; revision=15258
2009-04-22 23:04:18 +00:00
Eelco Dolstra
8b28c599a3 * Removed the hack to fix the installation path of some Perl
packages.  Turns out that those packages set INSTALLDIRS=perl, so we
  override it to INSTALLDIRS=site.

svn path=/nixpkgs/branches/stdenv-updates/; revision=15251
2009-04-22 17:32:57 +00:00
Eelco Dolstra
47b27a6c00 * `mv .../* ...' no longer works if nullglob is on. However, the real
WTF is that the Perl module installation path suddenly has changed
  from $out/lib/site_perl to $out/lib/perl5/site_perl.  Investigating...

svn path=/nixpkgs/branches/stdenv-updates/; revision=15241
2009-04-22 07:41:31 +00:00
Eelco Dolstra
0c3abad795 * Latest Compress::Zlib.
* Put the fix for Perl modules that install in the wrong location
  ($out/lib instead of $out/lib/site_perl) in the generic Perl
  builder.

svn path=/nixpkgs/trunk/; revision=14051
2009-02-12 20:18:13 +00:00
Eelco Dolstra
61e7bd7372 * Perl builder: run tests by default.
svn path=/nixpkgs/trunk/; revision=14041
2009-02-12 15:56:35 +00:00
Eelco Dolstra
23ee8eff77 * More Perl packages.
svn path=/nixpkgs/trunk/; revision=13100
2008-10-20 03:58:49 +00:00
Eelco Dolstra
6e6624f4c5 * Perl generic builder: set nix-support/propagated-user-env-packages
to the propagated build inputs as a convenience to people who want
  to install Perl packages into their user environments.

svn path=/nixpkgs/trunk/; revision=8278
2007-03-13 13:32:17 +00:00
Eelco Dolstra
82e678362f * "." -> "source".
svn path=/nixpkgs/trunk/; revision=4335
2005-12-05 14:11:09 +00:00
Eelco Dolstra
8a282aa46c * Set PERL5LIB automatically in the Perl setup hook.
* Remove explicit setting of PERL5LIB.
* Use the generic Perl builder for the BerkeleyDB and XML::Parser
  modules.
* Prefix all names of Perl modules with `perl-' (in the generic Perl
  builder).

svn path=/nixpkgs/trunk/; revision=2365
2005-03-10 12:49:37 +00:00