60 Commits

Author SHA1 Message Date
Tom Hunze 2f2b2bf499 buildPerlPackage: remove explicit src argument
This goal of this change is to make nix-update-script work out of the
box with packages built using `buildPerlPackage`.

Explicitly setting `src` in the `stdenv.mkDerivation` call currently
causes `builtins.unsafeGetAttrPos "src" <package>` to point to
`pkgs/development/perl-modules/generic/default.nix` for packages built
using `buildPerlPackage`. If the result of this expression is not
`null`, nix-update will try to update `src` of `<package>` in this
file [1], which will fail for obvious reasons.

A good example of this happening is with the pgformatter package.
Removing the explicit `inherit src` allows
`builtins.unsafeGetAttrPos "src" <package>` to point to the file where
`<package>.src` is actually defined, fixing nix-update runs for
affected packages.

Git history doesn't provide any indication as to why this argument was
introduced in the first place, so I hope it's fine to remove it. The
only difference in evaluation will be for calls to `buildPerlPackage`
without `src`: In these cases, `src` will be unset instead of `null`.

[1] https://github.com/Mic92/nix-update/blob/8227513ecf2f9ca657951fac3a6935410107eb90/nix_update/eval.nix#L99
2026-01-19 00:20:48 +01:00
polyfloyd 637727353c perlPackages: Deprecate shortenPerlShebang 2025-11-15 19:33:37 +01:00
Ramses 92aad01e3c perl buildPerlPackage: use patchShebangs by default (#390744) 2025-08-19 23:21:57 +03:00
Wolfgang Walther 5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Gabriel Ostrolucký 5368225673 perl buildPerlPackage: use patchShebangs by default 2025-03-16 22:48:49 +01:00
K900 9f2a89f948 buildPerlPackage: export some things harder
Those may be used by the later stages of the build.

Co-authored-by: Tristan Ross <tristan.ross@midstall.com>
2025-02-10 09:38:10 +03:00
Tristan Ross 6e1ce1a647 perl: set ar, cc, and ld in the generic builder 2025-01-19 21:56:04 -08:00
Wolfgang Walther cf127c9dc3 treewide: load structured attributes in all bash builders consistently
It's hard to put the sourcing of ./.attrs.sh into all builder
consistently - mistakes will happen. Thus, load structured attrs once in
make-derivation and then source the remaining builder on top.

This should fix quite a few builders with structured attributes in
principle. Most importantly it helps substitute / substituteAll, which
are required for bootstrap on some platforms.
2024-12-29 18:36:47 +01:00
Silvan Mosberger 667d42c00d treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
      --argstr baseRev 57b193d8dd
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:27:17 +01:00
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