diff --git a/doc/languages-frameworks/perl.section.md b/doc/languages-frameworks/perl.section.md index 50fc4945ff76..dd95f3740837 100644 --- a/doc/languages-frameworks/perl.section.md +++ b/doc/languages-frameworks/perl.section.md @@ -71,7 +71,7 @@ To install it with `nix-env` instead: `nix-env -f. -iA perlPackages.ClassC3`. So what does `buildPerlPackage` do? It does the following: 1. In the configure phase, it calls `perl Makefile.PL` to generate a Makefile. You can set the variable `makeMakerFlags` to pass flags to `Makefile.PL` -2. It adds the contents of the `PERL5LIB` environment variable to `#! .../bin/perl` line of Perl scripts as `-Idir` flags. This ensures that a script can find its dependencies. (This can cause this shebang line to become too long for Darwin to handle; see the note below.) +2. It adds the contents of the `PERL5LIB` environment variable to a use lib statement at the start of Perl scripts. This ensures that a script can find its dependencies. 3. In the fixup phase, it writes the propagated build inputs (`propagatedBuildInputs`) to the file `$out/nix-support/propagated-user-env-packages`. `nix-env` recursively installs all packages listed in this file when you install a package that has it. This ensures that a Perl package can find its dependencies. `buildPerlPackage` is built on top of `stdenv`, so everything can be customised in the usual way. For instance, the `BerkeleyDB` module has a `preConfigure` hook to generate a configuration file used by `Makefile.PL`: @@ -120,37 +120,6 @@ Dependencies on other Perl packages can be specified in the `buildInputs` and `p } ``` -On Darwin, if a script has too many `-Idir` flags in its first line (its “shebang line”), it will not run. This can be worked around by calling the `shortenPerlShebang` function from the `postInstall` phase: - -```nix -{ - lib, - stdenv, - buildPerlPackage, - fetchurl, - shortenPerlShebang, -}: - -{ - ImageExifTool = buildPerlPackage { - pname = "Image-ExifTool"; - version = "12.50"; - - src = fetchurl { - url = "https://exiftool.org/Image-ExifTool-${version}.tar.gz"; - hash = "sha256-vOhB/FwQMC8PPvdnjDvxRpU6jAZcC6GMQfc0AH4uwKg="; - }; - - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/exiftool - ''; - }; -} -``` - -This will remove the `-I` flags from the shebang line, rewrite them in the `use lib` form, and put them on the next line instead. This function can be given any number of Perl scripts as arguments; it will modify them in-place. - ### Generation from CPAN {#ssec-generation-from-CPAN} Nix expressions for Perl packages can be generated (almost) automatically from CPAN. This is done by the program `nix-generate-from-cpan`, which can be installed as follows: diff --git a/pkgs/build-support/setup-hooks/shorten-perl-shebang.sh b/pkgs/build-support/setup-hooks/shorten-perl-shebang.sh index 825da1bde962..e573ba0b13db 100644 --- a/pkgs/build-support/setup-hooks/shorten-perl-shebang.sh +++ b/pkgs/build-support/setup-hooks/shorten-perl-shebang.sh @@ -1,88 +1,4 @@ -# This setup hook modifies a Perl script so that any "-I" flags in its shebang -# line are rewritten into a "use lib ..." statement on the next line. This gets -# around a limitation in Darwin, which will not properly handle a script whose -# shebang line exceeds 511 characters. -# -# Each occurrence of "-I /path/to/lib1" or "-I/path/to/lib2" is removed from -# the shebang line, along with the single space that preceded it. These library -# paths are placed into a new line of the form -# -# use lib "/path/to/lib1", "/path/to/lib2"; -# -# immediately following the shebang line. If a library appeared in the original -# list more than once, only its first occurrence will appear in the output -# list. In other words, the libraries are deduplicated, but the ordering of the -# first appearance of each one is preserved. -# -# Any flags other than "-I" in the shebang line are left as-is, and the -# interpreter is also left alone (although the script will abort if the -# interpreter does not seem to be either "perl" or else "env" with "perl" as -# its argument). Each line after the shebang line is left unchanged. Each file -# is modified in place. -# -# Usage: -# shortenPerlShebang SCRIPT... - +# Deprecated. Invocation in derivations can be safely removed. shortenPerlShebang() { - while [ $# -gt 0 ]; do - _shortenPerlShebang "$1" - shift - done -} - -_shortenPerlShebang() { - local program="$1" - - echo "shortenPerlShebang: rewriting shebang line in $program" - - if ! isScript "$program"; then - die "shortenPerlShebang: refusing to modify $program because it is not a script" - fi - - local temp="$(mktemp)" - - gawk ' - (NR == 1) { - if (!($0 ~ /\/(perl|env +perl)\>/)) { - print "shortenPerlShebang: script does not seem to be a Perl script" > "/dev/stderr" - exit 1 - } - idx = 0 - while (match($0, / -I ?([^ ]+)/, pieces)) { - matches[idx] = pieces[1] - idx++ - $0 = gensub(/ -I ?[^ ]+/, "", 1, $0) - } - print $0 - if (idx > 0) { - prefix = "use lib " - for (idx in matches) { - path = matches[idx] - if (!(path in seen)) { - printf "%s\"%s\"", prefix, path - seen[path] = 1 - prefix = ", " - } - } - print ";" - } - } - (NR > 1 ) { - print - } - ' "$program" > "$temp" || die - # Preserve the mode of the original file - cp --preserve=mode --attributes-only "$program" "$temp" - mv "$temp" "$program" - - # Measure the new shebang line length and make sure it's okay. We subtract - # one to account for the trailing newline that "head" included in its - # output. - local new_length=$(( $(head -n 1 "$program" | wc -c) - 1 )) - - # Darwin is okay when the shebang line contains 511 characters, but not - # when it contains 512 characters. - if [ $new_length -ge 512 ]; then - die "shortenPerlShebang: shebang line is $new_length characters--still too long for Darwin!" - fi + : } diff --git a/pkgs/by-name/bi/biber-ms/package.nix b/pkgs/by-name/bi/biber-ms/package.nix index 0ab78240ec49..1789c38419ef 100644 --- a/pkgs/by-name/bi/biber-ms/package.nix +++ b/pkgs/by-name/bi/biber-ms/package.nix @@ -3,7 +3,6 @@ stdenv, fetchFromGitHub, perlPackages, - shortenPerlShebang, texlive, }: @@ -78,7 +77,6 @@ perlPackages.buildPerlModule { XMLWriter autovivification ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; preConfigure = '' cp '${multiscriptBltxml}' t/tdata/multiscript.bltxml @@ -86,9 +84,6 @@ perlPackages.buildPerlModule { postInstall = '' mv "$out"/bin/biber{,-ms} - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang "$out"/bin/biber-ms ''; meta = with lib; { diff --git a/pkgs/by-name/bi/biber/package.nix b/pkgs/by-name/bi/biber/package.nix index ccc47ea66539..8f4ea872e8cd 100644 --- a/pkgs/by-name/bi/biber/package.nix +++ b/pkgs/by-name/bi/biber/package.nix @@ -3,7 +3,6 @@ stdenv, fetchpatch, perlPackages, - shortenPerlShebang, texlive, }: @@ -69,11 +68,6 @@ perlPackages.buildPerlModule { TestDifferences PerlIOutf8_strict ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/biber - ''; meta = with lib; { description = "Backend for BibLaTeX"; diff --git a/pkgs/by-name/co/convos/package.nix b/pkgs/by-name/co/convos/package.nix index aa65ed66b656..74c3b41cfbeb 100644 --- a/pkgs/by-name/co/convos/package.nix +++ b/pkgs/by-name/co/convos/package.nix @@ -5,7 +5,6 @@ perl, perlPackages, makeWrapper, - shortenPerlShebang, openssl, nixosTests, }: @@ -21,10 +20,7 @@ perlPackages.buildPerlPackage rec { sha256 = "sha256-dBvXo8y4OMKcb0imgnnzoklnPN3YePHDvy5rIBOkTfs="; }; - nativeBuildInputs = [ - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ shortenPerlShebang ]; + nativeBuildInputs = [ makeWrapper ]; buildInputs = with perlPackages; [ CryptPassphrase @@ -108,9 +104,6 @@ perlPackages.buildPerlPackage rec { cp -vR templates $out/templates cp Makefile.PL $out/Makefile.PL '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/convos - '' + '' wrapProgram $out/bin/convos --set MOJO_HOME $out ''; diff --git a/pkgs/by-name/fe/feedgnuplot/package.nix b/pkgs/by-name/fe/feedgnuplot/package.nix index 9b1f5e7380e3..c472eec8205d 100644 --- a/pkgs/by-name/fe/feedgnuplot/package.nix +++ b/pkgs/by-name/fe/feedgnuplot/package.nix @@ -8,7 +8,6 @@ perl, perlPackages, stdenv, - shortenPerlShebang, installShellFiles, }: @@ -34,8 +33,7 @@ perlPackages.buildPerlPackage rec { nativeBuildInputs = [ makeWrapper installShellFiles - ] - ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; + ]; buildInputs = [ gnuplot @@ -57,18 +55,14 @@ perlPackages.buildPerlPackage rec { # Tests require gnuplot 4.6.4 and are completely skipped with gnuplot 5. doCheck = false; - postInstall = - lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/feedgnuplot - '' - + '' - wrapProgram $out/bin/feedgnuplot \ - --prefix "PATH" ":" "$PATH" \ - --prefix "PERL5LIB" ":" "$PERL5LIB" + postInstall = '' + wrapProgram $out/bin/feedgnuplot \ + --prefix "PATH" ":" "$PATH" \ + --prefix "PERL5LIB" ":" "$PERL5LIB" - installShellCompletion --bash --name feedgnuplot.bash completions/bash/feedgnuplot - installShellCompletion --zsh completions/zsh/_feedgnuplot - ''; + installShellCompletion --bash --name feedgnuplot.bash completions/bash/feedgnuplot + installShellCompletion --zsh completions/zsh/_feedgnuplot + ''; meta = with lib; { description = "General purpose pipe-oriented plotting tool"; diff --git a/pkgs/by-name/ge/get_iplayer/package.nix b/pkgs/by-name/ge/get_iplayer/package.nix index 811f18801919..63f45dcb606e 100644 --- a/pkgs/by-name/ge/get_iplayer/package.nix +++ b/pkgs/by-name/ge/get_iplayer/package.nix @@ -4,7 +4,6 @@ fetchFromGitHub, makeWrapper, stdenv, - shortenPerlShebang, perl, atomicparsley, ffmpeg, @@ -23,7 +22,7 @@ perlPackages.buildPerlPackage rec { hash = "sha256-O/mVtbudrYw0jKeSckZlgonFDiWxfeiVc8gdcy4iNBw="; }; - nativeBuildInputs = [ makeWrapper ] ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; + nativeBuildInputs = [ makeWrapper ]; buildInputs = [ perl ]; propagatedBuildInputs = with perlPackages; [ LWP @@ -54,10 +53,6 @@ perlPackages.buildPerlPackage rec { runHook postInstall ''; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/.get_iplayer-wrapped - ''; - passthru.tests.version = testers.testVersion { package = get_iplayer; command = "HOME=$(mktemp -d) get_iplayer --help"; diff --git a/pkgs/by-name/hy/hydra/package.nix b/pkgs/by-name/hy/hydra/package.nix index a8e40efcdf39..55c86b663f08 100644 --- a/pkgs/by-name/hy/hydra/package.nix +++ b/pkgs/by-name/hy/hydra/package.nix @@ -117,7 +117,6 @@ let TermReadKey Test2Harness TestPostgreSQL - TestSimple13 TextDiff TextTable UUID4Tiny diff --git a/pkgs/by-name/is/isync/package.nix b/pkgs/by-name/is/isync/package.nix index 414299bab329..6e514b3dec23 100644 --- a/pkgs/by-name/is/isync/package.nix +++ b/pkgs/by-name/is/isync/package.nix @@ -8,7 +8,7 @@ db, cyrus_sasl, zlib, - perl538Packages, + perlPackages, autoreconfHook, # Disabled by default as XOAUTH2 is an "OBSOLETE" SASL mechanism and this relies # on a package that isn't really maintained anymore: @@ -43,7 +43,7 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals withCyrusSaslXoauth2 [ makeWrapper ]; buildInputs = [ - perl538Packages.TimeDate + perlPackages.TimeDate openssl db cyrus_sasl diff --git a/pkgs/by-name/oc/ocsinventory-agent/package.nix b/pkgs/by-name/oc/ocsinventory-agent/package.nix index 1a3ef373e127..f9c5bc2f1144 100644 --- a/pkgs/by-name/oc/ocsinventory-agent/package.nix +++ b/pkgs/by-name/oc/ocsinventory-agent/package.nix @@ -5,7 +5,6 @@ fetchFromGitHub, fetchpatch, makeWrapper, - shortenPerlShebang, coreutils, dmidecode, findutils, @@ -43,7 +42,7 @@ perlPackages.buildPerlPackage rec { }) ]; - nativeBuildInputs = [ makeWrapper ] ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; + nativeBuildInputs = [ makeWrapper ]; buildInputs = with perlPackages; @@ -94,10 +93,7 @@ perlPackages.buildPerlPackage rec { util-linux # last, lsblk, mount ]; in - lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/ocsinventory-agent '' - + '' wrapProgram $out/bin/ocsinventory-agent --prefix PATH : ${lib.makeBinPath runtimeDependencies} ''; diff --git a/pkgs/by-name/op/openscap/package.nix b/pkgs/by-name/op/openscap/package.nix index 34776269a5ca..6262ad6dc43e 100644 --- a/pkgs/by-name/op/openscap/package.nix +++ b/pkgs/by-name/op/openscap/package.nix @@ -35,7 +35,7 @@ perl, doxygen, pkg-config, - perl538Packages, + perlPackages, }: stdenv.mkDerivation rec { @@ -62,7 +62,7 @@ stdenv.mkDerivation rec { ]; buildInputs = - with perl538Packages; + with perlPackages; [ XMLXPath LinuxACL diff --git a/pkgs/by-name/pg/pgformatter/package.nix b/pkgs/by-name/pg/pgformatter/package.nix index 05a491f51baa..0721b37acb20 100644 --- a/pkgs/by-name/pg/pgformatter/package.nix +++ b/pkgs/by-name/pg/pgformatter/package.nix @@ -1,9 +1,7 @@ { lib, - stdenv, perlPackages, fetchFromGitHub, - shortenPerlShebang, }: perlPackages.buildPerlPackage rec { @@ -33,11 +31,6 @@ perlPackages.buildPerlPackage rec { --replace "'INSTALLDIRS' => \$INSTALLDIRS," "'INSTALLDIRS' => \$INSTALLDIRS, 'INSTALLVENDORLIB' => 'bin/lib', 'INSTALLVENDORBIN' => 'bin', 'INSTALLVENDORSCRIPT' => 'bin', 'INSTALLVENDORMAN1DIR' => 'share/man/man1', 'INSTALLVENDORMAN3DIR' => 'share/man/man3'," ''; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/pg_format - ''; - doCheck = false; meta = { diff --git a/pkgs/by-name/pg/pgtop/package.nix b/pkgs/by-name/pg/pgtop/package.nix index f34ae6c2e4f4..fdb3153caf5f 100644 --- a/pkgs/by-name/pg/pgtop/package.nix +++ b/pkgs/by-name/pg/pgtop/package.nix @@ -1,9 +1,7 @@ { lib, - stdenv, perlPackages, fetchFromGitHub, - shortenPerlShebang, }: perlPackages.buildPerlPackage rec { @@ -27,11 +25,6 @@ perlPackages.buildPerlPackage rec { LWP ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/pgtop - ''; - meta = { description = "PostgreSQL clone of `mytop', which in turn is a `top' clone for MySQL"; mainProgram = "pgtop"; diff --git a/pkgs/by-name/sh/shelldap/package.nix b/pkgs/by-name/sh/shelldap/package.nix index 3144a7fdce05..4b222ed0e8b7 100644 --- a/pkgs/by-name/sh/shelldap/package.nix +++ b/pkgs/by-name/sh/shelldap/package.nix @@ -3,7 +3,6 @@ stdenv, fetchFromGitHub, perlPackages, - shortenPerlShebang, }: perlPackages.buildPerlPackage rec { @@ -29,8 +28,6 @@ perlPackages.buildPerlPackage rec { YAMLSyck ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - prePatch = '' touch Makefile.PL ''; @@ -41,10 +38,6 @@ perlPackages.buildPerlPackage rec { runHook postInstall ''; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/shelldap - ''; - # no make target 'test', not tests provided by source doCheck = false; diff --git a/pkgs/by-name/wa/wakeonlan/package.nix b/pkgs/by-name/wa/wakeonlan/package.nix index 4bc1b65674fd..2e36ef4d2275 100644 --- a/pkgs/by-name/wa/wakeonlan/package.nix +++ b/pkgs/by-name/wa/wakeonlan/package.nix @@ -1,10 +1,8 @@ { lib, - stdenv, perlPackages, fetchFromGitHub, installShellFiles, - shortenPerlShebang, }: perlPackages.buildPerlPackage rec { @@ -22,8 +20,7 @@ perlPackages.buildPerlPackage rec { nativeBuildInputs = [ installShellFiles - ] - ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; + ]; nativeCheckInputs = [ perlPackages.TestPerlCritic @@ -38,9 +35,6 @@ perlPackages.buildPerlPackage rec { installPhase = '' install -Dt $out/bin wakeonlan installManPage blib/man1/wakeonlan.1 - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/wakeonlan ''; meta = with lib; { diff --git a/pkgs/development/interpreters/perl/CVE-2024-56406.patch b/pkgs/development/interpreters/perl/CVE-2024-56406.patch deleted file mode 100644 index 3960d17e6519..000000000000 --- a/pkgs/development/interpreters/perl/CVE-2024-56406.patch +++ /dev/null @@ -1,26 +0,0 @@ -commit 385e8759c3ff1e7f7f996bd4ea391074d61d48c1 -Author: Karl Williamson -AuthorDate: 2024-12-18 18:25:29 -0700 -Commit: Steve Hay -CommitDate: 2025-03-30 11:59:51 +0100 - - CVE-2024-56406: Heap-buffer-overflow with tr// - - This was due to underallocating needed space. If the translation forces - something to become UTF-8 that is initially bytes, that UTF-8 could - now require two bytes where previously a single one would do. - - (cherry picked from commit f93109c8a6950aafbd7488d98e112552033a3686) - -diff --git a/op.c b/op.c -index 3fc23eca49a..aeee88e0335 100644 ---- a/op.c -+++ b/op.c -@@ -6649,6 +6649,7 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) - * same time. But otherwise one crosses before the other */ - if (t_cp < 256 && r_cp_end > 255 && r_cp != t_cp) { - can_force_utf8 = TRUE; -+ max_expansion = MAX(2, max_expansion); - } - } - diff --git a/pkgs/development/interpreters/perl/CVE-2025-40909.patch b/pkgs/development/interpreters/perl/CVE-2025-40909.patch deleted file mode 100644 index 984c56e871ff..000000000000 --- a/pkgs/development/interpreters/perl/CVE-2025-40909.patch +++ /dev/null @@ -1,408 +0,0 @@ -From 918bfff86ca8d6d4e4ec5b30994451e0bd74aba9 Mon Sep 17 00:00:00 2001 -From: Leon Timmermans -Date: Fri, 23 May 2025 15:40:41 +0200 -Subject: [PATCH] CVE-2025-40909: Clone dirhandles without fchdir - -This uses fdopendir and dup to dirhandles. This means it won't change -working directory during thread cloning, which prevents race conditions -that can happen if a third thread is active at the same time. ---- - Configure | 6 ++ - Cross/config.sh-arm-linux | 1 + - Cross/config.sh-arm-linux-n770 | 1 + - Porting/Glossary | 5 ++ - Porting/config.sh | 1 + - config_h.SH | 6 ++ - configure.com | 1 + - plan9/config_sh.sample | 1 + - sv.c | 91 +---------------------------- - t/op/threads-dirh.t | 104 +-------------------------------- - win32/config.gc | 1 + - win32/config.vc | 1 + - 12 files changed, 28 insertions(+), 191 deletions(-) - -diff --git a/Configure b/Configure -index 44c12ced4014..7a13249caa96 100755 ---- a/Configure -+++ b/Configure -@@ -478,6 +478,7 @@ d_fd_set='' - d_fds_bits='' - d_fdclose='' - d_fdim='' -+d_fdopendir='' - d_fegetround='' - d_ffs='' - d_ffsl='' -@@ -13344,6 +13345,10 @@ esac - set i_fcntl - eval $setvar - -+: see if fdopendir exists -+set fdopendir d_fdopendir -+eval $inlibc -+ - : see if fork exists - set fork d_fork - eval $inlibc -@@ -25052,6 +25057,7 @@ d_flockproto='$d_flockproto' - d_fma='$d_fma' - d_fmax='$d_fmax' - d_fmin='$d_fmin' -+d_fdopendir='$d_fdopendir' - d_fork='$d_fork' - d_fp_class='$d_fp_class' - d_fp_classify='$d_fp_classify' -diff --git a/Cross/config.sh-arm-linux b/Cross/config.sh-arm-linux -index bfa0b00d5f0f..9e056539198b 100644 ---- a/Cross/config.sh-arm-linux -+++ b/Cross/config.sh-arm-linux -@@ -212,6 +212,7 @@ d_fd_macros='define' - d_fd_set='define' - d_fdclose='undef' - d_fdim='undef' -+d_fdopendir=undef - d_fds_bits='undef' - d_fegetround='define' - d_ffs='undef' -diff --git a/Cross/config.sh-arm-linux-n770 b/Cross/config.sh-arm-linux-n770 -index 47ad5c37e3fd..365e4c4f9671 100644 ---- a/Cross/config.sh-arm-linux-n770 -+++ b/Cross/config.sh-arm-linux-n770 -@@ -211,6 +211,7 @@ d_fd_macros='define' - d_fd_set='define' - d_fdclose='undef' - d_fdim='undef' -+d_fdopendir=undef - d_fds_bits='undef' - d_fegetround='define' - d_ffs='undef' -diff --git a/Porting/Glossary b/Porting/Glossary -index bb505c653b0b..8b2965ca99c6 100644 ---- a/Porting/Glossary -+++ b/Porting/Glossary -@@ -947,6 +947,11 @@ d_fmin (d_fmin.U): - This variable conditionally defines the HAS_FMIN symbol, which - indicates to the C program that the fmin() routine is available. - -+d_fdopendir (d_fdopendir.U): -+ This variable conditionally defines the HAS_FORK symbol, which -+ indicates that the fdopen routine is available to open a -+ directory descriptor. -+ - d_fork (d_fork.U): - This variable conditionally defines the HAS_FORK symbol, which - indicates to the C program that the fork() routine is available. -diff --git a/Porting/config.sh b/Porting/config.sh -index a921f7e1c79a..6231ea0f31ea 100644 ---- a/Porting/config.sh -+++ b/Porting/config.sh -@@ -223,6 +223,7 @@ d_fd_macros='define' - d_fd_set='define' - d_fdclose='undef' - d_fdim='define' -+d_fdopendir='define' - d_fds_bits='define' - d_fegetround='define' - d_ffs='define' -diff --git a/config_h.SH b/config_h.SH -index da0f2dbcd7b7..5a0f81cf2011 100755 ---- a/config_h.SH -+++ b/config_h.SH -@@ -142,6 +142,12 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un - */ - #$d_fcntl HAS_FCNTL /**/ - -+/* HAS_FDOPENDIR: -+ * This symbol, if defined, indicates that the fdopen routine is -+ * available to open a directory descriptor. -+ */ -+#$d_fdopendir HAS_FDOPENDIR /**/ -+ - /* HAS_FGETPOS: - * This symbol, if defined, indicates that the fgetpos routine is - * available to get the file position indicator, similar to ftell(). -diff --git a/configure.com b/configure.com -index 99527c180bfc..7c38711bb85d 100644 ---- a/configure.com -+++ b/configure.com -@@ -6010,6 +6010,7 @@ $ WC "d_fd_set='" + d_fd_set + "'" - $ WC "d_fd_macros='define'" - $ WC "d_fdclose='undef'" - $ WC "d_fdim='" + d_fdim + "'" -+$ WC "d_fdopendir='undef'" - $ WC "d_fds_bits='define'" - $ WC "d_fegetround='undef'" - $ WC "d_ffs='undef'" -diff --git a/plan9/config_sh.sample b/plan9/config_sh.sample -index 636acbdf6db3..246bad954424 100644 ---- a/plan9/config_sh.sample -+++ b/plan9/config_sh.sample -@@ -212,6 +212,7 @@ d_fd_macros='undef' - d_fd_set='undef' - d_fdclose='undef' - d_fdim='undef' -+d_fdopendir=undef - d_fds_bits='undef' - d_fegetround='undef' - d_ffs='undef' -diff --git a/sv.c b/sv.c -index ae6d09dea28a..8a005b2d165b 100644 ---- a/sv.c -+++ b/sv.c -@@ -14096,15 +14096,6 @@ Perl_dirp_dup(pTHX_ DIR *const dp, CLONE_PARAMS *const param) - { - DIR *ret; - --#if defined(HAS_FCHDIR) && defined(HAS_TELLDIR) && defined(HAS_SEEKDIR) -- DIR *pwd; -- const Direntry_t *dirent; -- char smallbuf[256]; /* XXX MAXPATHLEN, surely? */ -- char *name = NULL; -- STRLEN len = 0; -- long pos; --#endif -- - PERL_UNUSED_CONTEXT; - PERL_ARGS_ASSERT_DIRP_DUP; - -@@ -14116,89 +14107,13 @@ Perl_dirp_dup(pTHX_ DIR *const dp, CLONE_PARAMS *const param) - if (ret) - return ret; - --#if defined(HAS_FCHDIR) && defined(HAS_TELLDIR) && defined(HAS_SEEKDIR) -+#ifdef HAS_FDOPENDIR - - PERL_UNUSED_ARG(param); - -- /* create anew */ -- -- /* open the current directory (so we can switch back) */ -- if (!(pwd = PerlDir_open("."))) return (DIR *)NULL; -- -- /* chdir to our dir handle and open the present working directory */ -- if (fchdir(my_dirfd(dp)) < 0 || !(ret = PerlDir_open("."))) { -- PerlDir_close(pwd); -- return (DIR *)NULL; -- } -- /* Now we should have two dir handles pointing to the same dir. */ -- -- /* Be nice to the calling code and chdir back to where we were. */ -- /* XXX If this fails, then what? */ -- PERL_UNUSED_RESULT(fchdir(my_dirfd(pwd))); -+ ret = fdopendir(dup(my_dirfd(dp))); - -- /* We have no need of the pwd handle any more. */ -- PerlDir_close(pwd); -- --#ifdef DIRNAMLEN --# define d_namlen(d) (d)->d_namlen --#else --# define d_namlen(d) strlen((d)->d_name) --#endif -- /* Iterate once through dp, to get the file name at the current posi- -- tion. Then step back. */ -- pos = PerlDir_tell(dp); -- if ((dirent = PerlDir_read(dp))) { -- len = d_namlen(dirent); -- if (len > sizeof(dirent->d_name) && sizeof(dirent->d_name) > PTRSIZE) { -- /* If the len is somehow magically longer than the -- * maximum length of the directory entry, even though -- * we could fit it in a buffer, we could not copy it -- * from the dirent. Bail out. */ -- PerlDir_close(ret); -- return (DIR*)NULL; -- } -- if (len <= sizeof smallbuf) name = smallbuf; -- else Newx(name, len, char); -- Move(dirent->d_name, name, len, char); -- } -- PerlDir_seek(dp, pos); -- -- /* Iterate through the new dir handle, till we find a file with the -- right name. */ -- if (!dirent) /* just before the end */ -- for(;;) { -- pos = PerlDir_tell(ret); -- if (PerlDir_read(ret)) continue; /* not there yet */ -- PerlDir_seek(ret, pos); /* step back */ -- break; -- } -- else { -- const long pos0 = PerlDir_tell(ret); -- for(;;) { -- pos = PerlDir_tell(ret); -- if ((dirent = PerlDir_read(ret))) { -- if (len == (STRLEN)d_namlen(dirent) -- && memEQ(name, dirent->d_name, len)) { -- /* found it */ -- PerlDir_seek(ret, pos); /* step back */ -- break; -- } -- /* else we are not there yet; keep iterating */ -- } -- else { /* This is not meant to happen. The best we can do is -- reset the iterator to the beginning. */ -- PerlDir_seek(ret, pos0); -- break; -- } -- } -- } --#undef d_namlen -- -- if (name && name != smallbuf) -- Safefree(name); --#endif -- --#ifdef WIN32 -+#elif defined(WIN32) - ret = win32_dirp_dup(dp, param); - #endif - -diff --git a/t/op/threads-dirh.t b/t/op/threads-dirh.t -index bb4bcfc14184..14c399ca19cd 100644 ---- a/t/op/threads-dirh.t -+++ b/t/op/threads-dirh.t -@@ -13,16 +13,12 @@ BEGIN { - skip_all_if_miniperl("no dynamic loading on miniperl, no threads"); - skip_all("runs out of memory on some EBCDIC") if $ENV{PERL_SKIP_BIG_MEM_TESTS}; - -- plan(6); -+ plan(1); - } - - use strict; - use warnings; - use threads; --use threads::shared; --use File::Path; --use File::Spec::Functions qw 'updir catdir'; --use Cwd 'getcwd'; - - # Basic sanity check: make sure this does not crash - fresh_perl_is <<'# this is no comment', 'ok', {}, 'crash when duping dirh'; -@@ -31,101 +27,3 @@ fresh_perl_is <<'# this is no comment', 'ok', {}, 'crash when duping dirh'; - async{}->join for 1..2; - print "ok"; - # this is no comment -- --my $dir; --SKIP: { -- skip "telldir or seekdir not defined on this platform", 5 -- if !$Config::Config{d_telldir} || !$Config::Config{d_seekdir}; -- my $skip = sub { -- chdir($dir); -- chdir updir; -- skip $_[0], 5 -- }; -- -- if(!$Config::Config{d_fchdir} && $^O ne "MSWin32") { -- $::TODO = 'dir handle cloning currently requires fchdir on non-Windows platforms'; -- } -- -- my @w :shared; # warnings accumulator -- local $SIG{__WARN__} = sub { push @w, $_[0] }; -- -- $dir = catdir getcwd(), "thrext$$" . int rand() * 100000; -- -- rmtree($dir) if -d $dir; -- mkdir($dir); -- -- # Create a dir structure like this: -- # $dir -- # | -- # `- toberead -- # | -- # +---- thrit -- # | -- # +---- rile -- # | -- # `---- zor -- -- chdir($dir); -- mkdir 'toberead'; -- chdir 'toberead'; -- {open my $fh, ">thrit" or &$skip("Cannot create file thrit")} -- {open my $fh, ">rile" or &$skip("Cannot create file rile")} -- {open my $fh, ">zor" or &$skip("Cannot create file zor")} -- chdir updir; -- -- # Then test that dir iterators are cloned correctly. -- -- opendir my $toberead, 'toberead'; -- my $start_pos = telldir $toberead; -- my @first_2 = (scalar readdir $toberead, scalar readdir $toberead); -- my @from_thread = @{; async { [readdir $toberead ] } ->join }; -- my @from_main = readdir $toberead; -- is join('-', sort @from_thread), join('-', sort @from_main), -- 'dir iterator is copied from one thread to another'; -- like -- join('-', "", sort(@first_2, @from_thread), ""), -- qr/(?join, 'undef', -- 'cloned dir iterator that points to the end of the directory' -- ; -- } -- -- # Make sure the cloning code can handle file names longer than 255 chars -- SKIP: { -- chdir 'toberead'; -- open my $fh, -- ">floccipaucinihilopilification-" -- . "pneumonoultramicroscopicsilicovolcanoconiosis-" -- . "lopadotemachoselachogaleokranioleipsanodrimypotrimmatosilphiokarabo" -- . "melitokatakechymenokichlepikossyphophattoperisteralektryonoptokephal" -- . "liokinklopeleiolagoiosiraiobaphetraganopterygon" -- or -- chdir updir, -- skip("OS does not support long file names (and I mean *long*)", 1); -- chdir updir; -- opendir my $dirh, "toberead"; -- my $test_name -- = "dir iterators can be cloned when the next fn > 255 chars"; -- while() { -- my $pos = telldir $dirh; -- my $fn = readdir($dirh); -- if(!defined $fn) { fail($test_name); last SKIP; } -- if($fn =~ 'lagoio') { -- seekdir $dirh, $pos; -- last; -- } -- } -- is length async { scalar readdir $dirh } ->join, 258, $test_name; -- } -- -- is scalar @w, 0, 'no warnings during all that' or diag @w; -- chdir updir; --} --rmtree($dir); -diff --git a/win32/config.gc b/win32/config.gc -index f8776188c09c..34aa8de6ed75 100644 ---- a/win32/config.gc -+++ b/win32/config.gc -@@ -199,6 +199,7 @@ d_fd_macros='define' - d_fd_set='define' - d_fdclose='undef' - d_fdim='undef' -+d_fdopendir='undef' - d_fds_bits='define' - d_fegetround='undef' - d_ffs='undef' -diff --git a/win32/config.vc b/win32/config.vc -index 619979e22b53..536085fe94e0 100644 ---- a/win32/config.vc -+++ b/win32/config.vc -@@ -199,6 +199,7 @@ d_fd_macros='define' - d_fd_set='define' - d_fdclose='undef' - d_fdim='undef' -+d_fdopendir='undef' - d_fds_bits='define' - d_fegetround='undef' - d_ffs='undef' diff --git a/pkgs/development/interpreters/perl/cross.patch b/pkgs/development/interpreters/perl/cross.patch index e0f05ede90d0..46ed70bbeb7c 100644 --- a/pkgs/development/interpreters/perl/cross.patch +++ b/pkgs/development/interpreters/perl/cross.patch @@ -7,15 +7,15 @@ ExtUtils::MakeMaker JSON::PP Data::Dumper -Updated for perl v5.38.0 by stig@stig.io +Updated for perl v5.40.0 by marcus@means.no --- -diff --git a/cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements.pm b/cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements.pm +diff --git a/cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements/Range.pm b/cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements/Range.pm index b0e83b0d2d..dab4907704 100644 ---- a/cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements.pm -+++ b/cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements.pm -@@ -86,21 +86,7 @@ sub new { +--- a/cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements/Range.pm ++++ b/cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements/Range.pm +@@ -52,21 +52,38 @@ # from version::vpp sub _find_magic_vstring { my $value = shift; @@ -31,13 +31,42 @@ index b0e83b0d2d..dab4907704 100644 - } - else { - $magic = $magic->MOREMAGIC; -- } -- } ++ ++ # B is not available in miniperl (it depends on XS), so try to load it safely ++ my $has_B = eval { require B; 1 }; ++ ++ if ($has_B) { ++ my $sv = B::svref_2object(\$value); ++ my $magic = ref($sv) eq 'B::PVMG' ? $sv->MAGIC : undef; ++ while ($magic) { ++ if ($magic->TYPE eq 'V') { ++ my $tvalue = $magic->PTR; ++ $tvalue =~ s/^v?(.+)$/v$1/; ++ return $tvalue; ++ } ++ $magic = $magic->MOREMAGIC; + } + } - return $tvalue; -+ return version::->parse($value)->stringify; ++ ++ # --- Fallback for miniperl --- ++ # Perl represents vstrings internally as sequences of bytes like "\x01\x02\x03" ++ # and only shows them as "v1.2.3" when printed. ++ # Try to detect that pattern heuristically. ++ use builtin qw/reftype/; ++ if (!ref($value) && reftype(\$value) eq 'VSTRING') { ++ return sprintf("v%vd", $value); ++ } ++ ++ # If it's already a "v1.2.3" string, just return it as is ++ if ($value =~ /^v\d+(?:\.\d+)*$/) { ++ return $value; ++ } ++ ++ return ''; } - - # safe if given an unblessed reference + + # Perl 5.10.0 didn't have "is_qv" in version.pm diff --git a/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm b/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm index 746abd63bc..c55d7cd2d0 100644 --- a/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm @@ -47,13 +76,13 @@ index 746abd63bc..c55d7cd2d0 100644 use strict; use warnings; +no warnings 'experimental::builtin'; - package CPAN::Meta::YAML; # git description: v1.68-2-gcc5324e + package CPAN::Meta::YAML; # git description: v1.75-3-g85169f1 # XXX-INGY is 5.8.1 too old/broken for utf8? # XXX-XDG Lancaster consensus was that it was sufficient until @@ -650,27 +651,29 @@ sub _dump_string { join '', map { "$_\n" } @lines; } - + -sub _has_internal_string_value { +# taken from cpan/JSON-PP/lib/JSON/PP.pm +sub _looks_like_number { @@ -72,7 +101,7 @@ index 746abd63bc..c55d7cd2d0 100644 + return 1 if $value * 0 == 0; + return -1; # inf/nan } - + sub _dump_scalar { my $string = $_[1]; my $is_key = $_[2]; @@ -95,8 +124,8 @@ index 746abd63bc..c55d7cd2d0 100644 $string =~ s/\\/\\\\/g; @@ -800,9 +803,6 @@ sub errstr { # Helper functions. Possibly not needed. - - + + -# Use to detect nv or iv -use B; - @@ -106,7 +135,7 @@ index 746abd63bc..c55d7cd2d0 100644 @@ -822,35 +822,8 @@ sub _can_flock { } } - + - -# XXX-INGY Is this core in 5.8.1? Can we remove this? -# XXX-XDG Scalar::Util 1.18 didn't land until 5.8.8, so we need this @@ -138,7 +167,7 @@ index 746abd63bc..c55d7cd2d0 100644 - } + *refaddr = *builtin::refaddr; } - + delete $CPAN::Meta::YAML::{refaddr}; diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm index 3604eae402..991f69d275 100644 @@ -148,16 +177,16 @@ index 3604eae402..991f69d275 100644 use strict; use warnings; +no warnings 'experimental::builtin'; - + package CPAN::Meta::Merge; - + our $VERSION = '2.150010'; - + use Carp qw/croak/; -use Scalar::Util qw/blessed/; +use builtin qw/blessed/; use CPAN::Meta::Converter 2.141170; - + sub _is_identical { diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm index d4e93fd8a5..809da68d02 100644 @@ -169,40 +198,27 @@ index d4e93fd8a5..809da68d02 100644 use warnings; +no warnings 'experimental::builtin'; package CPAN::Meta::Prereqs; - + our $VERSION = '2.150010'; -@@ -14,7 +15,6 @@ our $VERSION = '2.150010'; +@@ -14,7 +14,7 @@ our $VERSION = '2.150010'; #pod =cut - + use Carp qw(confess); -use Scalar::Util qw(blessed); ++use builtin qw(blessed); use CPAN::Meta::Requirements 2.121; - + #pod =method new -@@ -168,7 +168,12 @@ sub types_in { - sub with_merged_prereqs { - my ($self, $other) = @_; - -- my @other = blessed($other) ? $other : @$other; -+ eval 'require Scalar::Util'; -+ my @other = unless($@){ -+ Scalar::Util::blessed($other) ? $other : @$other; -+ }else{ -+ builtin::blessed($other) ? $other : @$other; -+ } - - my @prereq_objs = ($self, @other); - diff --git a/cpan/JSON-PP/lib/JSON/PP.pm b/cpan/JSON-PP/lib/JSON/PP.pm index fc8fcbc8f0..cda7b90c65 100644 --- a/cpan/JSON-PP/lib/JSON/PP.pm +++ b/cpan/JSON-PP/lib/JSON/PP.pm @@ -4,6 +4,7 @@ package JSON::PP; - + use 5.008; use strict; +no warnings 'experimental::builtin'; - + use Exporter (); BEGIN { our @ISA = ('Exporter') } diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm @@ -210,34 +226,34 @@ index bb6d3caedb..0c2fde4743 100644 --- a/dist/Data-Dumper/Dumper.pm +++ b/dist/Data-Dumper/Dumper.pm @@ -11,6 +11,7 @@ package Data::Dumper; - + use strict; use warnings; +no warnings 'experimental::builtin'; - + #$| = 1; - + @@ -125,8 +126,7 @@ sub new { # Packed numeric addresses take less memory. Plus pack is faster than sprintf - + sub format_refaddr { - require Scalar::Util; - pack "J", Scalar::Util::refaddr(shift); + pack "J", builtin::refaddr(shift); }; - + # @@ -282,9 +282,8 @@ sub _dump { warn "WARNING(Freezer method call failed): $@" if $@; } - + - require Scalar::Util; - my $realpack = Scalar::Util::blessed($val); - my $realtype = $realpack ? Scalar::Util::reftype($val) : ref $val; + my $realpack = builtin::blessed($val); + my $realtype = $realpack ? builtin::reftype($val) : ref $val; $id = format_refaddr($val); - + # Note: By this point $name is always defined and of non-zero length. @@ -576,7 +575,7 @@ sub _dump { # here generates a different result. So there are actually "three" different @@ -248,3 +264,36 @@ index bb6d3caedb..0c2fde4743 100644 $out .= sprintf "v%vd", $val; } # \d here would treat "1\x{660}" as a safe decimal number +diff --git a/cpan/JSON-PP/lib/JSON/PP.pm b/cpan/JSON-PP/lib/JSON/PP.pm +index fc8fcbc8f0..cda7b90c65 100644 +--- a/cpan/JSON-PP/lib/JSON/PP.pm ++++ b/cpan/JSON-PP/lib/JSON/PP.pm +@@ -12,6 +12,6 @@ package JSON::PP; + + use Carp (); +-use Scalar::Util qw(blessed reftype refaddr); ++use builtin qw(blessed reftype refaddr); + #use Devel::Peek; + + +diff --git a/cpan/CPAN-Meta/lib/Parse/CPAN/Meta.pm b/cpan/CPAN-Meta/lib/Parse/CPAN/Meta.pm +--- a/cpan/CPAN-Meta/lib/Parse/CPAN/Meta.pm ++++ b/cpan/CPAN-Meta/lib/Parse/CPAN/Meta.pm +@@ -53,7 +53,8 @@ sub load_json_string { + my ($class, $string) = @_; + require Encode; + # load_json_string takes characters, decode_json expects bytes +- my $encoded = Encode::encode('UTF-8', $string, Encode::PERLQQ()); ++ my $encoded = $string; ++ utf8::encode($encoded); # Miniperl workaround + my $data = eval { $class->json_decoder()->can('decode_json')->($encoded) }; + croak $@ if $@; + return $data || {}; +@@ -122,7 +122,7 @@ sub _slurp { + open my $fh, "<:raw", "$_[0]" ## no critic + or die "can't open $_[0] for reading: $!"; + my $content = do { local $/; <$fh> }; +- $content = Encode::decode('UTF-8', $content, Encode::PERLQQ()); ++ utf8::decode($content); # Workaround for miniperl + return $content; + } diff --git a/pkgs/development/interpreters/perl/cross540.patch b/pkgs/development/interpreters/perl/cross540.patch deleted file mode 100644 index 0736c16d4f45..000000000000 --- a/pkgs/development/interpreters/perl/cross540.patch +++ /dev/null @@ -1,224 +0,0 @@ -From: =?UTF-8?q?Christian=20K=C3=B6gler?= -Date: Mon, 10 Apr 2023 22:12:24 +0200 -Subject: [PATCH] miniperl compatible modules - -CPAN::Meta -ExtUtils::MakeMaker -JSON::PP -Data::Dumper - -Updated for perl v5.40.0 by marcus@means.no - ---- - - # safe if given an unblessed reference -diff --git a/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm b/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm -index 746abd63bc..c55d7cd2d0 100644 ---- a/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm -+++ b/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm -@@ -1,6 +1,7 @@ - use 5.008001; # sane UTF-8 support - use strict; - use warnings; -+no warnings 'experimental::builtin'; - package CPAN::Meta::YAML; # git description: v1.68-2-gcc5324e - # XXX-INGY is 5.8.1 too old/broken for utf8? - # XXX-XDG Lancaster consensus was that it was sufficient until -@@ -650,27 +651,29 @@ sub _dump_string { - join '', map { "$_\n" } @lines; - } - --sub _has_internal_string_value { -+# taken from cpan/JSON-PP/lib/JSON/PP.pm -+sub _looks_like_number { - my $value = shift; -- my $b_obj = B::svref_2object(\$value); # for round trip problem -- return $b_obj->FLAGS & B::SVf_POK(); -+ no warnings 'numeric'; -+ # if the utf8 flag is on, it almost certainly started as a string -+ return if utf8::is_utf8($value); -+ # detect numbers -+ # string & "" -> "" -+ # number & "" -> 0 (with warning) -+ # nan and inf can detect as numbers, so check with * 0 -+ return unless length((my $dummy = "") & $value); -+ return unless 0 + $value eq $value; -+ return 1 if $value * 0 == 0; -+ return -1; # inf/nan - } - - sub _dump_scalar { - my $string = $_[1]; - my $is_key = $_[2]; -- # Check this before checking length or it winds up looking like a string! -- my $has_string_flag = _has_internal_string_value($string); - return '~' unless defined $string; - return "''" unless length $string; -- if (Scalar::Util::looks_like_number($string)) { -- # keys and values that have been used as strings get quoted -- if ( $is_key || $has_string_flag ) { -- return qq['$string']; -- } -- else { -- return $string; -- } -+ if (_looks_like_number($string)) { -+ return qq['$string']; - } - if ( $string =~ /[\x00-\x09\x0b-\x0d\x0e-\x1f\x7f-\x9f\'\n]/ ) { - $string =~ s/\\/\\\\/g; -@@ -800,9 +803,6 @@ sub errstr { - # Helper functions. Possibly not needed. - - --# Use to detect nv or iv --use B; -- - # XXX-INGY Is flock CPAN::Meta::YAML's responsibility? - # Some platforms can't flock :-( - # XXX-XDG I think it is. When reading and writing files, we ought -@@ -822,35 +822,8 @@ sub _can_flock { - } - } - -- --# XXX-INGY Is this core in 5.8.1? Can we remove this? --# XXX-XDG Scalar::Util 1.18 didn't land until 5.8.8, so we need this --##################################################################### --# Use Scalar::Util if possible, otherwise emulate it -- --use Scalar::Util (); - BEGIN { -- local $@; -- if ( eval { Scalar::Util->VERSION(1.18); } ) { -- *refaddr = *Scalar::Util::refaddr; -- } -- else { -- eval <<'END_PERL'; --# Scalar::Util failed to load or too old --sub refaddr { -- my $pkg = ref($_[0]) or return undef; -- if ( !! UNIVERSAL::can($_[0], 'can') ) { -- bless $_[0], 'Scalar::Util::Fake'; -- } else { -- $pkg = undef; -- } -- "$_[0]" =~ /0x(\w+)/; -- my $i = do { no warnings 'portable'; hex $1 }; -- bless $_[0], $pkg if defined $pkg; -- $i; --} --END_PERL -- } -+ *refaddr = *builtin::refaddr; - } - - delete $CPAN::Meta::YAML::{refaddr}; -diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm -index 3604eae402..991f69d275 100644 ---- a/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm -+++ b/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm -@@ -1,12 +1,13 @@ - use strict; - use warnings; -+no warnings 'experimental::builtin'; - - package CPAN::Meta::Merge; - - our $VERSION = '2.150010'; - - use Carp qw/croak/; --use Scalar::Util qw/blessed/; -+use builtin qw/blessed/; - use CPAN::Meta::Converter 2.141170; - - sub _is_identical { -diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm -index d4e93fd8a5..809da68d02 100644 ---- a/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm -+++ b/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm -@@ -1,6 +1,7 @@ - use 5.006; - use strict; - use warnings; -+no warnings 'experimental::builtin'; - package CPAN::Meta::Prereqs; - - our $VERSION = '2.150010'; -@@ -14,7 +15,6 @@ our $VERSION = '2.150010'; - #pod =cut - - use Carp qw(confess); --use Scalar::Util qw(blessed); - use CPAN::Meta::Requirements 2.121; - - #pod =method new -@@ -168,7 +168,12 @@ sub types_in { - sub with_merged_prereqs { - my ($self, $other) = @_; - -- my @other = blessed($other) ? $other : @$other; -+ eval 'require Scalar::Util'; -+ my @other = unless($@){ -+ Scalar::Util::blessed($other) ? $other : @$other; -+ }else{ -+ builtin::blessed($other) ? $other : @$other; -+ } - - my @prereq_objs = ($self, @other); - -diff --git a/cpan/JSON-PP/lib/JSON/PP.pm b/cpan/JSON-PP/lib/JSON/PP.pm -index fc8fcbc8f0..cda7b90c65 100644 ---- a/cpan/JSON-PP/lib/JSON/PP.pm -+++ b/cpan/JSON-PP/lib/JSON/PP.pm -@@ -4,6 +4,7 @@ package JSON::PP; - - use 5.008; - use strict; -+no warnings 'experimental::builtin'; - - use Exporter (); - BEGIN { our @ISA = ('Exporter') } -diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm -index bb6d3caedb..0c2fde4743 100644 ---- a/dist/Data-Dumper/Dumper.pm -+++ b/dist/Data-Dumper/Dumper.pm -@@ -11,6 +11,7 @@ package Data::Dumper; - - use strict; - use warnings; -+no warnings 'experimental::builtin'; - - #$| = 1; - -@@ -125,8 +126,7 @@ sub new { - # Packed numeric addresses take less memory. Plus pack is faster than sprintf - - sub format_refaddr { -- require Scalar::Util; -- pack "J", Scalar::Util::refaddr(shift); -+ pack "J", builtin::refaddr(shift); - }; - - # -@@ -282,9 +282,8 @@ sub _dump { - warn "WARNING(Freezer method call failed): $@" if $@; - } - -- require Scalar::Util; -- my $realpack = Scalar::Util::blessed($val); -- my $realtype = $realpack ? Scalar::Util::reftype($val) : ref $val; -+ my $realpack = builtin::blessed($val); -+ my $realtype = $realpack ? builtin::reftype($val) : ref $val; - $id = format_refaddr($val); - - # Note: By this point $name is always defined and of non-zero length. -@@ -576,7 +575,7 @@ sub _dump { - # here generates a different result. So there are actually "three" different - # implementations of Data::Dumper (kind of sort of) but we only test two. - elsif (!defined &_vstring -- and ref $ref eq 'VSTRING' || eval{Scalar::Util::isvstring($val)}) { -+ and ref $ref eq 'VSTRING') { - $out .= sprintf "v%vd", $val; - } - # \d here would treat "1\x{660}" as a safe decimal number diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix index 69d02530a90f..8fc7b5dd07a3 100644 --- a/pkgs/development/interpreters/perl/default.nix +++ b/pkgs/development/interpreters/perl/default.nix @@ -68,19 +68,10 @@ let in rec { - # Maint version - perl538 = callPackage ./interpreter.nix { - self = perl538; - version = "5.38.2"; - sha256 = "sha256-oKMVNEUet7g8fWWUpJdUOlTUiLyQygD140diV39AZV4="; - inherit passthruFun; - }; - - # Maint version - perl540 = callPackage ./interpreter.nix { - self = perl540; - version = "5.40.0"; - sha256 = "sha256-x0A0jzVzljJ6l5XT6DI7r9D+ilx4NfwcuroMyN/nFh8="; + perl5 = callPackage ./interpreter.nix { + self = perl5; + version = "5.42.0"; + sha256 = "sha256-4JPvGE1/mhuXl+JGUpb1VRCtttq4hCsMPtUzKWYwltw="; inherit passthruFun; }; } diff --git a/pkgs/development/interpreters/perl/fix-build-with-only-C-locale-5.40.0.patch b/pkgs/development/interpreters/perl/fix-build-with-only-C-locale-5.40.0.patch deleted file mode 100644 index 9f9e1e96f619..000000000000 --- a/pkgs/development/interpreters/perl/fix-build-with-only-C-locale-5.40.0.patch +++ /dev/null @@ -1,57 +0,0 @@ -From bd0ab509f890a6638bd5033ef58526f8c74f7e4b Mon Sep 17 00:00:00 2001 -From: Andrei Horodniceanu -Date: Wed, 4 Sep 2024 12:46:44 +0300 -Subject: [PATCH] locale.c: Fix compilation on platforms with only a C locale - -Signed-off-by: Andrei Horodniceanu ---- - AUTHORS | 1 + - locale.c | 16 ++++++++++++++++ - 2 files changed, 17 insertions(+) - -diff --git a/AUTHORS b/AUTHORS -index b2e0bf2043a9..b196b93bda13 100644 ---- a/AUTHORS -+++ b/AUTHORS -@@ -103,6 +103,7 @@ Andreas König - Andreas Marienborg - Andreas Schwab - Andreas Voegele -+Andrei Horodniceanu - Andrei Yelistratov - Andrej Borsenkow - Andrew Bettison -diff --git a/locale.c b/locale.c -index 168b94914318..d764b4b3c11e 100644 ---- a/locale.c -+++ b/locale.c -@@ -8963,6 +8963,7 @@ Perl_init_i18nl10n(pTHX_ int printwarn) - * categories into our internal indices. */ - if (map_LC_ALL_position_to_index[0] == LC_ALL_INDEX_) { - -+# ifdef PERL_LC_ALL_CATEGORY_POSITIONS_INIT - /* Use this array, initialized by a config.h constant */ - int lc_all_category_positions[] = PERL_LC_ALL_CATEGORY_POSITIONS_INIT; - STATIC_ASSERT_STMT( C_ARRAY_LENGTH(lc_all_category_positions) -@@ -8975,6 +8976,21 @@ Perl_init_i18nl10n(pTHX_ int printwarn) - map_LC_ALL_position_to_index[i] = - get_category_index(lc_all_category_positions[i]); - } -+# else -+ /* It is possible for both PERL_LC_ALL_USES_NAME_VALUE_PAIRS and -+ * PERL_LC_ALL_CATEGORY_POSITIONS_INIT not to be defined, e.g. on -+ * systems with only a C locale during ./Configure. Assume that this -+ * can only happen as part of some sort of bootstrapping so allow -+ * compilation to succeed by ignoring correctness. -+ */ -+ for (unsigned int i = 0; -+ i < C_ARRAY_LENGTH(map_LC_ALL_position_to_index); -+ i++) -+ { -+ map_LC_ALL_position_to_index[i] = 0; -+ } -+# endif -+ - } - - LOCALE_UNLOCK; diff --git a/pkgs/development/interpreters/perl/interpreter.nix b/pkgs/development/interpreters/perl/interpreter.nix index 16e6bd821d5a..70368487e61b 100644 --- a/pkgs/development/interpreters/perl/interpreter.nix +++ b/pkgs/development/interpreters/perl/interpreter.nix @@ -15,7 +15,7 @@ zlib, config, passthruFun, - perlAttr ? "perl${lib.versions.major version}${lib.versions.minor version}", + perlAttr ? "perl${lib.versions.major version}", enableThreading ? true, coreutils, makeWrapper, @@ -33,6 +33,16 @@ assert (enableCrypt -> (libxcrypt != null)); let crossCompiling = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform); + commonPatches = [ + ./no-sys-dirs.patch + ] + ++ lib.optional stdenv.hostPlatform.isSunOS ./ld-shared.patch + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ./cpp-precomp.patch + ./sw_vers.patch + ] + ++ lib.optional crossCompiling ./cross.patch; + libc = if stdenv.cc.libc or null != null then stdenv.cc.libc else "/usr"; libcInc = lib.getDev libc; libcLib = lib.getLib libc; @@ -71,27 +81,7 @@ stdenv.mkDerivation ( disallowedReferences = [ stdenv.cc ]; - patches = [ - ./CVE-2024-56406.patch - ./CVE-2025-40909.patch - ] - # Do not look in /usr etc. for dependencies. - ++ lib.optional ((lib.versions.majorMinor version) == "5.38") ./no-sys-dirs-5.38.0.patch - ++ lib.optional ((lib.versions.majorMinor version) == "5.40") ./no-sys-dirs-5.40.0.patch - - # Fix compilation on platforms with only a C locale: https://github.com/Perl/perl5/pull/22569 - ++ lib.optional (version == "5.40.0") ./fix-build-with-only-C-locale-5.40.0.patch - - ++ lib.optional stdenv.hostPlatform.isSunOS ./ld-shared.patch - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - ./cpp-precomp.patch - ./sw_vers.patch - ] - # fixes build failure due to missing d_fdopendir/HAS_FDOPENDIR configure option - # https://github.com/arsv/perl-cross/pull/159 - ++ lib.optional (crossCompiling && (lib.versionAtLeast version "5.40.0")) ./cross-fdopendir.patch - ++ lib.optional (crossCompiling && (lib.versionAtLeast version "5.40.0")) ./cross540.patch - ++ lib.optional (crossCompiling && (lib.versionOlder version "5.40.0")) ./cross.patch; + patches = commonPatches; # This is not done for native builds because pwd may need to come from # bootstrap tools when building bootstrap perl. @@ -159,6 +149,7 @@ stdenv.mkDerivation ( "-Dinstallstyle=lib/perl5" "-Dlocincpth=${libcInc}/include" "-Dloclibpth=${libcLib}/lib" + "-Accflags=-D_GNU_SOURCE" ] ++ lib.optional stdenv.hostPlatform.isStatic "-Uusedl" ++ lib.optionals ((builtins.match ''5\.[0-9]*[13579]\..+'' version) != null) [ @@ -177,16 +168,20 @@ stdenv.mkDerivation ( configureScript = lib.optionalString (!crossCompiling) "${stdenv.shell} ./Configure"; # !canExecute cross uses miniperl which doesn't have this - postConfigure = lib.optionalString (!crossCompiling && stdenv.cc.targetPrefix != "") '' - substituteInPlace Makefile \ - --replace-fail "AR = ar" "AR = ${stdenv.cc.targetPrefix}ar" - ''; + postConfigure = + lib.optionalString (!crossCompiling && stdenv.cc.targetPrefix != "") '' + substituteInPlace Makefile \ + --replace-fail "AR = ar" "AR = ${stdenv.cc.targetPrefix}ar" + '' + + lib.optionalString crossCompiling '' + substituteInPlace miniperl_top --replace-fail '-I$top/lib' '-I$top/cpan/JSON-PP/lib -I$top/cpan/CPAN-Meta-YAML/lib -I$top/lib' + ''; dontAddStaticConfigureFlags = true; dontAddPrefix = !crossCompiling; - enableParallelBuilding = false; + enableParallelBuilding = true; # perl includes the build date, the uname of the build system and the # username of the build user in some files. @@ -329,8 +324,14 @@ stdenv.mkDerivation ( rev = crossVersion; hash = "sha256-mG9ny+eXGBL4K/rXqEUPSbar+4Mq4IaQrGRFIHIyAAw="; }; - - # Patches are above!!! + patches = commonPatches ++ [ + # fixes build failure due to missing d_fdopendir/HAS_FDOPENDIR configure option + # https://github.com/arsv/perl-cross/pull/159 + ./cross-fdopendir.patch + # Add patchset for 5.42.0 - Can hopefully be removed once perl-cross is updated + # https://github.com/arsv/perl-cross/pull/164 + ./perl-5.42.0-cross.patch + ]; depsBuildBuild = [ buildPackages.stdenv.cc diff --git a/pkgs/development/interpreters/perl/no-sys-dirs-5.38.0.patch b/pkgs/development/interpreters/perl/no-sys-dirs-5.38.0.patch deleted file mode 100644 index c959730d1420..000000000000 --- a/pkgs/development/interpreters/perl/no-sys-dirs-5.38.0.patch +++ /dev/null @@ -1,256 +0,0 @@ -diff --git a/Configure b/Configure -index e261cb9548..3bbbc4b9df 100755 ---- a/Configure -+++ b/Configure -@@ -108,15 +108,7 @@ if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; th - fi - - : Proper PATH setting --paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin' --paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin" --paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin" --paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin" --paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb" --paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin" --paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib" --paths="$paths /sbin /usr/sbin /usr/libexec" --paths="$paths /system/gnu_library/bin" -+paths='' - - for p in $paths - do -@@ -1455,8 +1447,7 @@ groupstype='' - i_whoami='' - : Possible local include directories to search. - : Set locincpth to "" in a hint file to defeat local include searches. --locincpth="/usr/local/include /opt/local/include /usr/gnu/include" --locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include" -+locincpth="" - : - : no include file wanted by default - inclwanted='' -@@ -1470,17 +1461,12 @@ DEBUGGING='' - archobjs='' - libnames='' - : change the next line if compiling for Xenix/286 on Xenix/386 --xlibpth='/usr/lib/386 /lib/386' -+xlibpth='' - : Possible local library directories to search. --loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" --loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" -+loclibpth="" - - : general looking path for locating libraries --glibpth="/lib /usr/lib $xlibpth" --glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib" --test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth" --test -f /shlib/libc.so && glibpth="/shlib $glibpth" --test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64" -+glibpth="" - - : Private path used by Configure to find libraries. Its value - : is prepended to libpth. This variable takes care of special -@@ -1515,8 +1501,6 @@ libswanted="cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld" - libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD" - : We probably want to search /usr/shlib before most other libraries. - : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. --glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` --glibpth="/usr/shlib $glibpth" - : Do not use vfork unless overridden by a hint file. - usevfork=false - -@@ -2581,7 +2565,6 @@ uname - zip - " - pth=`echo $PATH | sed -e "s/$p_/ /g"` --pth="$pth $sysroot/lib $sysroot/usr/lib" - for file in $loclist; do - eval xxx=\$$file - case "$xxx" in -@@ -5023,7 +5006,7 @@ esac - : Set private lib path - case "$plibpth" in - '') if ./mips; then -- plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib" -+ plibpth="$incpath/usr/lib" - fi;; - esac - case "$libpth" in -@@ -8860,13 +8843,8 @@ esac - echo " " - case "$sysman" in - '') -- syspath='/usr/share/man/man1 /usr/man/man1' -- syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1" -- syspath="$syspath /usr/man/u_man/man1" -- syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1" -- syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" -- syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1" -- sysman=`./loc . /usr/man/man1 $syspath` -+ syspath='' -+ sysman='' - ;; - esac - if $test -d "$sysman"; then -@@ -21500,9 +21478,10 @@ $rm_try tryp - case "$full_ar" in - '') full_ar=$ar ;; - esac -+full_ar=ar - - : Store the full pathname to the sed program for use in the C program --full_sed=$sed -+full_sed=sed - - : see what type gids are declared as in the kernel - echo " " -diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL -index ae647d5f06..9a05d66592 100644 ---- a/ext/Errno/Errno_pm.PL -+++ b/ext/Errno/Errno_pm.PL -@@ -135,12 +135,7 @@ sub get_files { - if ($dep =~ /(\S+errno\.h)/) { - push(@file, $1); - } -- } elsif ($^O eq 'linux' && -- $Config{gccversion} ne '' && -- $Config{gccversion} !~ /intel/i && -- # might be using, say, Intel's icc -- $linux_errno_h -- ) { -+ } elsif (0) { - push(@file, $linux_errno_h); - } elsif ($^O eq 'haiku') { - # hidden in a special place -diff --git a/hints/freebsd.sh b/hints/freebsd.sh -index 4d26835e99..c6d365d84d 100644 ---- a/hints/freebsd.sh -+++ b/hints/freebsd.sh -@@ -127,21 +127,21 @@ case "$osvers" in - objformat=`/usr/bin/objformat` - if [ x$objformat = xaout ]; then - if [ -e /usr/lib/aout ]; then -- libpth="/usr/lib/aout /usr/local/lib /usr/lib" -- glibpth="/usr/lib/aout /usr/local/lib /usr/lib" -+ libpth="" -+ glibpth="" - fi - lddlflags='-Bshareable' - else -- libpth="/usr/lib /usr/local/lib" -- glibpth="/usr/lib /usr/local/lib" -+ libpth="" -+ glibpth="" - ldflags="-Wl,-E " - lddlflags="-shared " - fi - cccdlflags='-DPIC -fPIC' - ;; - *) -- libpth="/usr/lib /usr/local/lib" -- glibpth="/usr/lib /usr/local/lib" -+ libpth="" -+ glibpth="" - ldflags="-Wl,-E " - lddlflags="-shared " - cccdlflags='-DPIC -fPIC' -diff --git a/hints/linux.sh b/hints/linux.sh -index e1508c7509..5a187c583a 100644 ---- a/hints/linux.sh -+++ b/hints/linux.sh -@@ -150,28 +150,6 @@ case "$optimize" in - ;; - esac - --# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries --# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us --# where to look. We don't want gcc's own libraries, however, so we --# filter those out. --# This could be conditional on Ubuntu, but other distributions may --# follow suit, and this scheme seems to work even on rather old gcc's. --# This unconditionally uses gcc because even if the user is using another --# compiler, we still need to find the math library and friends, and I don't --# know how other compilers will cope with that situation. --# Morever, if the user has their own gcc earlier in $PATH than the system gcc, --# we don't want its libraries. So we try to prefer the system gcc --# Still, as an escape hatch, allow Configure command line overrides to --# plibpth to bypass this check. --if [ -x /usr/bin/gcc ] ; then -- gcc=/usr/bin/gcc --# clang also provides -print-search-dirs --elif ${cc:-cc} --version 2>/dev/null | grep -q '^clang ' ; then -- gcc=${cc:-cc} --else -- gcc=gcc --fi -- - case "$plibpth" in - '') plibpth=`LANG=C LC_ALL=C $gcc $ccflags $ldflags -print-search-dirs | grep libraries | - cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` -@@ -208,32 +186,6 @@ case "$usequadmath" in - ;; - esac - --case "$libc" in --'') --# If you have glibc, then report the version for ./myconfig bug reporting. --# (Configure doesn't need to know the specific version since it just uses --# gcc to load the library for all tests.) --# We don't use __GLIBC__ and __GLIBC_MINOR__ because they --# are insufficiently precise to distinguish things like --# libc-2.0.6 and libc-2.0.7. -- for p in $plibpth -- do -- for trylib in libc.so.6 libc.so -- do -- if $test -e $p/$trylib; then -- libc=`ls -l $p/$trylib | awk '{print $NF}'` -- if $test "X$libc" != X; then -- break -- fi -- fi -- done -- if $test "X$libc" != X; then -- break -- fi -- done -- ;; --esac -- - if ${sh:-/bin/sh} -c exit; then - echo '' - echo 'You appear to have a working bash. Good.' -@@ -311,33 +263,6 @@ sparc*) - ;; - esac - --# SuSE8.2 has /usr/lib/libndbm* which are ld scripts rather than --# true libraries. The scripts cause binding against static --# version of -lgdbm which is a bad idea. So if we have 'nm' --# make sure it can read the file --# NI-S 2003/08/07 --case "$nm" in -- '') ;; -- *) -- for p in $plibpth -- do -- if $test -r $p/libndbm.so; then -- if $nm $p/libndbm.so >/dev/null 2>&1 ; then -- echo 'Your shared -lndbm seems to be a real library.' -- _libndbm_real=1 -- break -- fi -- fi -- done -- if $test "X$_libndbm_real" = X; then -- echo 'Your shared -lndbm is not a real library.' -- set `echo X "$libswanted "| sed -e 's/ ndbm / /'` -- shift -- libswanted="$*" -- fi -- ;; --esac -- - # Linux on Synology. - if [ -f /etc/synoinfo.conf -a -d /usr/syno ]; then - # Tested on Synology DS213 and DS413 diff --git a/pkgs/development/interpreters/perl/no-sys-dirs-5.40.0.patch b/pkgs/development/interpreters/perl/no-sys-dirs.patch similarity index 100% rename from pkgs/development/interpreters/perl/no-sys-dirs-5.40.0.patch rename to pkgs/development/interpreters/perl/no-sys-dirs.patch diff --git a/pkgs/development/interpreters/perl/perl-5.42.0-cross.patch b/pkgs/development/interpreters/perl/perl-5.42.0-cross.patch new file mode 100644 index 000000000000..66b536b6973d --- /dev/null +++ b/pkgs/development/interpreters/perl/perl-5.42.0-cross.patch @@ -0,0 +1,186 @@ +From b47ef629459076a5ccb3d0caf83ccfbb8ba0571b Mon Sep 17 00:00:00 2001 +From: Marcus Ramberg +Date: Wed, 3 Sep 2025 10:35:58 +0200 +Subject: [PATCH] patches for perl-5.42.0 + +--- + cnf/diffs/perl5-5.42.0/constant.patch | 1 + + cnf/diffs/perl5-5.42.0/dynaloader.patch | 1 + + cnf/diffs/perl5-5.42.0/findext.patch | 1 + + cnf/diffs/perl5-5.42.0/installscripts.patch | 1 + + cnf/diffs/perl5-5.42.0/liblist.patch | 80 +++++++++++++++++++++ + cnf/diffs/perl5-5.42.0/makemaker.patch | 1 + + cnf/diffs/perl5-5.42.0/posix-makefile.patch | 1 + + cnf/diffs/perl5-5.42.0/test-checkcase.patch | 1 + + cnf/diffs/perl5-5.42.0/test-makemaker.patch | 1 + + cnf/diffs/perl5-5.42.0/xconfig.patch | 1 + + 10 files changed, 89 insertions(+) + create mode 120000 cnf/diffs/perl5-5.42.0/constant.patch + create mode 120000 cnf/diffs/perl5-5.42.0/dynaloader.patch + create mode 120000 cnf/diffs/perl5-5.42.0/findext.patch + create mode 120000 cnf/diffs/perl5-5.42.0/installscripts.patch + create mode 100644 cnf/diffs/perl5-5.42.0/liblist.patch + create mode 120000 cnf/diffs/perl5-5.42.0/makemaker.patch + create mode 120000 cnf/diffs/perl5-5.42.0/posix-makefile.patch + create mode 120000 cnf/diffs/perl5-5.42.0/test-checkcase.patch + create mode 120000 cnf/diffs/perl5-5.42.0/test-makemaker.patch + create mode 120000 cnf/diffs/perl5-5.42.0/xconfig.patch + +diff --git a/cnf/diffs/perl5-5.42.0/constant.patch b/cnf/diffs/perl5-5.42.0/constant.patch +new file mode 120000 +index 0000000..065e198 +--- /dev/null ++++ b/cnf/diffs/perl5-5.42.0/constant.patch +@@ -0,0 +1 @@ ++../perl5-5.22.3/constant.patch +\ No newline at end of file +diff --git a/cnf/diffs/perl5-5.42.0/dynaloader.patch b/cnf/diffs/perl5-5.42.0/dynaloader.patch +new file mode 120000 +index 0000000..ffb73eb +--- /dev/null ++++ b/cnf/diffs/perl5-5.42.0/dynaloader.patch +@@ -0,0 +1 @@ ++../perl5-5.22.3/dynaloader.patch +\ No newline at end of file +diff --git a/cnf/diffs/perl5-5.42.0/findext.patch b/cnf/diffs/perl5-5.42.0/findext.patch +new file mode 120000 +index 0000000..9efbe5b +--- /dev/null ++++ b/cnf/diffs/perl5-5.42.0/findext.patch +@@ -0,0 +1 @@ ++../perl5-5.22.3/findext.patch +\ No newline at end of file +diff --git a/cnf/diffs/perl5-5.42.0/installscripts.patch b/cnf/diffs/perl5-5.42.0/installscripts.patch +new file mode 120000 +index 0000000..1c05e0f +--- /dev/null ++++ b/cnf/diffs/perl5-5.42.0/installscripts.patch +@@ -0,0 +1 @@ ++../perl5-5.36.0/installscripts.patch +\ No newline at end of file +diff --git a/cnf/diffs/perl5-5.42.0/liblist.patch b/cnf/diffs/perl5-5.42.0/liblist.patch +new file mode 100644 +index 0000000..5e6331f +--- /dev/null ++++ b/cnf/diffs/perl5-5.42.0/liblist.patch +@@ -0,0 +1,80 @@ ++When deciding which libraries are available, the original Configure uses ++shaky heuristics to physically locate library files. ++This is a very very bad thing to do, *especially* when cross-compiling, ++as said heiristics are likely to locate the host libraries, not the target ones. ++ ++The only real need for this test is to make sure it's safe to pass -llibrary ++to the compiler. So that's exactly what perl-cross does, pass -llibrary ++and see if it breaks things. ++ ++Note this is a part of MakeMaker, and only applies to module Makefiles. ++ ++ ++--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm +++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm ++@@ -20,9 +20,10 @@ ++ use File::Spec; ++ ++ sub ext { ++- if ( $^O eq 'VMS' ) { goto &_vms_ext; } ++- elsif ( $^O eq 'MSWin32' ) { goto &_win32_ext; } ++- else { goto &_unix_os2_ext; } +++ if ($Config{usemmldlt}){ goto &_ld_ext; } +++ elsif($^O eq 'VMS') { goto &_vms_ext; } +++ elsif($^O eq 'MSWin32') { goto &_win32_ext; } +++ else { goto &_unix_os2_ext; } ++ } ++ ++ sub _unix_os2_ext { ++@@ -661,4 +662,51 @@ ++ wantarray ? ( $lib, '', $ldlib, '', ( $give_libs ? \@flibs : () ) ) : $lib; ++ } ++ +++# A direct test for -l validity. +++# Because guessing real file names for -llib options when dealing +++# with a cross compiler is generally a BAD IDEA^tm. +++sub _ld_ext { +++ my($self,$potential_libs, $verbose, $give_libs) = @_; +++ $verbose ||= 0; +++ +++ if ($^O =~ 'os2' and $Config{perllibs}) { +++ # Dynamic libraries are not transitive, so we may need including +++ # the libraries linked against perl.dll again. +++ +++ $potential_libs .= " " if $potential_libs; +++ $potential_libs .= $Config{perllibs}; +++ } +++ return ("", "", "", "", ($give_libs ? [] : ())) unless $potential_libs; +++ warn "Potential libraries are '$potential_libs':\n" if $verbose; +++ +++ my($ld) = $Config{ld}; +++ my($ldflags) = $Config{ldflags}; +++ my($libs) = defined $Config{perllibs} ? $Config{perllibs} : $Config{libs}; +++ +++ my $try = 'try_mm.c'; +++ my $tryx = 'try_mm.x'; +++ open(TRY, '>', $try) || die "Can't create MakeMaker test file $try: $!\n"; +++ print TRY "int main(void) { return 0; }\n"; +++ close(TRY); +++ +++ my $testlibs = ''; +++ my @testlibs = (); +++ foreach my $thislib (split ' ', $potential_libs) { +++ $testlibs = join(' ', @testlibs); +++ if($thislib =~ /^-L/) { +++ push(@testlibs, $thislib); +++ next +++ }; +++ my $cmd = "$ld $ldflags -o $tryx $try $testlibs $thislib >/dev/null 2>&1"; +++ my $ret = system($cmd); +++ warn "Warning (mostly harmless): " . "No library found for $thislib\n" if $ret; +++ next if $ret; +++ push @testlibs, $thislib; +++ } +++ unlink($try); +++ unlink($tryx); +++ +++ return (join(' ', @testlibs), '', join(' ', @testlibs), ''); +++} +++ ++ 1; +diff --git a/cnf/diffs/perl5-5.42.0/makemaker.patch b/cnf/diffs/perl5-5.42.0/makemaker.patch +new file mode 120000 +index 0000000..d7bd609 +--- /dev/null ++++ b/cnf/diffs/perl5-5.42.0/makemaker.patch +@@ -0,0 +1 @@ ++../perl5-5.38.0/makemaker.patch +\ No newline at end of file +diff --git a/cnf/diffs/perl5-5.42.0/posix-makefile.patch b/cnf/diffs/perl5-5.42.0/posix-makefile.patch +new file mode 120000 +index 0000000..29463b7 +--- /dev/null ++++ b/cnf/diffs/perl5-5.42.0/posix-makefile.patch +@@ -0,0 +1 @@ ++../perl5-5.22.3/posix-makefile.patch +\ No newline at end of file +diff --git a/cnf/diffs/perl5-5.42.0/test-checkcase.patch b/cnf/diffs/perl5-5.42.0/test-checkcase.patch +new file mode 120000 +index 0000000..36c5186 +--- /dev/null ++++ b/cnf/diffs/perl5-5.42.0/test-checkcase.patch +@@ -0,0 +1 @@ ++../perl5-5.22.3/test-checkcase.patch +\ No newline at end of file +diff --git a/cnf/diffs/perl5-5.42.0/test-makemaker.patch b/cnf/diffs/perl5-5.42.0/test-makemaker.patch +new file mode 120000 +index 0000000..4e970ff +--- /dev/null ++++ b/cnf/diffs/perl5-5.42.0/test-makemaker.patch +@@ -0,0 +1 @@ ++../perl5-5.34.0/test-makemaker.patch +\ No newline at end of file +diff --git a/cnf/diffs/perl5-5.42.0/xconfig.patch b/cnf/diffs/perl5-5.42.0/xconfig.patch +new file mode 120000 +index 0000000..1c22c96 +--- /dev/null ++++ b/cnf/diffs/perl5-5.42.0/xconfig.patch +@@ -0,0 +1 @@ ++../perl5-5.41.3/xconfig.patch +\ No newline at end of file diff --git a/pkgs/development/perl-modules/ImageExifTool/default.nix b/pkgs/development/perl-modules/ImageExifTool/default.nix index b264606cd05a..5659a58e9a65 100644 --- a/pkgs/development/perl-modules/ImageExifTool/default.nix +++ b/pkgs/development/perl-modules/ImageExifTool/default.nix @@ -3,9 +3,7 @@ fetchFromGitHub, gitUpdater, lib, - shortenPerlShebang, - stdenv, - versionCheckHook, + testers, }: buildPerlPackage rec { @@ -19,20 +17,10 @@ buildPerlPackage rec { hash = "sha256-GPm3HOt7fNMbXRrV5V+ykJAfhww1O6NrD0l/7hA2i28="; }; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postPatch = '' patchShebangs exiftool ''; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/exiftool - ''; - - doInstallCheck = true; - nativeInstallCheckInputs = [ versionCheckHook ]; - versionCheckProgramArg = "-ver"; - passthru = { updateScript = gitUpdater { }; }; diff --git a/pkgs/development/perl-modules/MusicBrainz-DiscID---ExtUtils-ParseXS-compat.patch b/pkgs/development/perl-modules/MusicBrainz-DiscID---ExtUtils-ParseXS-compat.patch new file mode 100644 index 000000000000..f558f7c4dada --- /dev/null +++ b/pkgs/development/perl-modules/MusicBrainz-DiscID---ExtUtils-ParseXS-compat.patch @@ -0,0 +1,19 @@ +Patch from Fedora to fix ExtUtils::ParseXS ≥ 3.57: + + Unparseable XSUB parameter: 'offsets ...' in DiscID.xs, line 116 + +https://bugzilla-attachments.redhat.com/attachment.cgi?id=2089957 +https://bugzilla.redhat.com/show_bug.cgi?id=2364631 + +diff -up MusicBrainz-DiscID-0.06/DiscID.xs.orig MusicBrainz-DiscID-0.06/DiscID.xs +--- MusicBrainz-DiscID-0.06/DiscID.xs.orig 2025-05-15 14:01:31.501503137 +0200 ++++ MusicBrainz-DiscID-0.06/DiscID.xs 2025-05-15 14:02:10.538285963 +0200 +@@ -113,7 +113,7 @@ discid_get_track_length( disc, track_num + ## Provides the TOC of a known CD. + ## + int +-discid_put( disc, first_track, sectors, offsets ... ) ++discid_put( disc, first_track, sectors, offsets, ... ) + DiscId *disc + int first_track + int sectors diff --git a/pkgs/development/perl-modules/NetRemctl/default.nix b/pkgs/development/perl-modules/NetRemctl/default.nix index 78ee5dfdffcb..7d51489a9b0e 100644 --- a/pkgs/development/perl-modules/NetRemctl/default.nix +++ b/pkgs/development/perl-modules/NetRemctl/default.nix @@ -11,6 +11,7 @@ buildPerlModule { postPatch = '' cp -R tests/tap/perl/Test perl/t/lib + rm perl/t/backend/options.t cd perl ''; diff --git a/pkgs/development/perl-modules/Percona-Toolkit/default.nix b/pkgs/development/perl-modules/Percona-Toolkit/default.nix index d27972dff455..f155a9542d47 100644 --- a/pkgs/development/perl-modules/Percona-Toolkit/default.nix +++ b/pkgs/development/perl-modules/Percona-Toolkit/default.nix @@ -2,7 +2,6 @@ lib, fetchFromGitHub, buildPerlPackage, - shortenPerlShebang, DBDmysql, DBI, IOSocketSSL, @@ -42,7 +41,6 @@ buildPerlPackage { nativeBuildInputs = [ git - shortenPerlShebang ]; buildInputs = [ @@ -64,10 +62,6 @@ buildPerlPackage { export HOME=$TMPDIR ''; - postInstall = '' - shortenPerlShebang $(grep -l "/bin/env perl" $out/bin/*) - ''; - meta = { description = "Collection of advanced command-line tools to perform a variety of MySQL and system tasks"; homepage = "https://www.percona.com/software/database-tools/percona-toolkit"; diff --git a/pkgs/development/perl-modules/WWW-YoutubeViewer/default.nix b/pkgs/development/perl-modules/WWW-YoutubeViewer/default.nix index 0669f5b7c7af..495b9f66e972 100644 --- a/pkgs/development/perl-modules/WWW-YoutubeViewer/default.nix +++ b/pkgs/development/perl-modules/WWW-YoutubeViewer/default.nix @@ -3,7 +3,6 @@ lib, fetchFromGitHub, buildPerlPackage, - shortenPerlShebang, LWP, LWPProtocolHttps, DataDump, @@ -22,16 +21,12 @@ buildPerlPackage rec { sha256 = "9Z4fv2B0AnwtYsp7h9phnRMmHtBOMObIJvK8DmKQRxs="; }; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; propagatedBuildInputs = [ LWP LWPProtocolHttps DataDump JSON ]; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/youtube-viewer - ''; passthru.updateScript = gitUpdater { }; diff --git a/pkgs/development/perl-modules/generic/builder.sh b/pkgs/development/perl-modules/generic/builder.sh index 97d0bbcce7ac..afd42c840182 100644 --- a/pkgs/development/perl-modules/generic/builder.sh +++ b/pkgs/development/perl-modules/generic/builder.sh @@ -1,9 +1,10 @@ PERL5LIB="$PERL5LIB${PERL5LIB:+:}$out/lib/perl5/site_perl" -perlFlags= +perlUseLibs='use lib' for i in $(IFS=:; echo $PERL5LIB); do - perlFlags="$perlFlags -I$i" + perlUseLibs="$perlUseLibs \"$i\"," done +perlUseLibs=$(echo "$perlUseLibs" | sed 's/,$/;/') oldPreConfigure="$preConfigure" preConfigure() { @@ -15,7 +16,7 @@ preConfigure() { first=$(dd if="$fn" count=2 bs=1 2> /dev/null) if test "$first" = "#!"; then echo "patching $fn..." - sed -i "$fn" -e "s|^#\!\(.*\bperl\b.*\)$|#\!\1$perlFlags|" + sed -i "$fn" -e "s|^#\!\(.*\bperl\b.*\)$|#\!\1\n$perlUseLibs|" fi fi done diff --git a/pkgs/development/perl-modules/strip-nondeterminism/default.nix b/pkgs/development/perl-modules/strip-nondeterminism/default.nix index 3d16d4cb245a..8a768ff7e444 100644 --- a/pkgs/development/perl-modules/strip-nondeterminism/default.nix +++ b/pkgs/development/perl-modules/strip-nondeterminism/default.nix @@ -7,7 +7,6 @@ ArchiveZip, ArchiveCpio, SubOverride, - shortenPerlShebang, gitUpdater, }: @@ -29,7 +28,6 @@ buildPerlPackage rec { }; strictDeps = true; - nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ shortenPerlShebang ]; buildInputs = [ ArchiveZip ArchiveCpio @@ -49,9 +47,6 @@ buildPerlPackage rec { # we don’t need the debhelper script rm $out/bin/dh_strip_nondeterminism rm $out/share/man/man1/dh_strip_nondeterminism.1 - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/strip-nondeterminism ''; installCheckPhase = '' @@ -60,8 +55,6 @@ buildPerlPackage rec { runHook postInstallCheck ''; - # running shortenPerlShebang in postBuild results in non-functioning binary 'exec format error' - doCheck = !stdenv.hostPlatform.isDarwin; doInstallCheck = true; passthru = { diff --git a/pkgs/development/tools/misc/sqitch/default.nix b/pkgs/development/tools/misc/sqitch/default.nix index bbd7bef633ef..5e60898c76dc 100644 --- a/pkgs/development/tools/misc/sqitch/default.nix +++ b/pkgs/development/tools/misc/sqitch/default.nix @@ -3,7 +3,6 @@ lib, perlPackages, makeWrapper, - shortenPerlShebang, mysqlSupport ? false, postgresqlSupport ? false, sqliteSupport ? false, @@ -25,7 +24,7 @@ stdenv.mkDerivation { pname = "sqitch"; version = sqitch.version; - nativeBuildInputs = [ makeWrapper ] ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; + nativeBuildInputs = [ makeWrapper ]; src = sqitch; dontBuild = true; @@ -39,9 +38,6 @@ stdenv.mkDerivation { ln -s ${sqitch}/$d $out/$d fi done - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/sqitch ''; dontStrip = true; postFixup = '' diff --git a/pkgs/servers/mail/public-inbox/default.nix b/pkgs/servers/mail/public-inbox/default.nix index 32effee18f62..4ee96bff0ad2 100644 --- a/pkgs/servers/mail/public-inbox/default.nix +++ b/pkgs/servers/mail/public-inbox/default.nix @@ -39,7 +39,6 @@ PlackMiddlewareReverseProxy, PlackTestExternalServer, Xapian, - TestSimple13, TimeDate, URI, XMLTreePP, @@ -145,7 +144,6 @@ buildPerlPackage rec { xapian EmailMIME PlackTestExternalServer - TestSimple13 XMLTreePP ] ++ lib.optionals stdenv.hostPlatform.isLinux [ diff --git a/pkgs/tools/misc/pgbadger/default.nix b/pkgs/tools/misc/pgbadger/default.nix index 3d8d76c2b886..8eab77a847cb 100644 --- a/pkgs/tools/misc/pgbadger/default.nix +++ b/pkgs/tools/misc/pgbadger/default.nix @@ -7,8 +7,6 @@ nix-update-script, pgbadger, PodMarkdown, - shortenPerlShebang, - stdenv, testers, TextCSV_XS, which, @@ -29,13 +27,6 @@ buildPerlPackage rec { patchShebangs ./pgbadger ''; - # pgbadger has too many `-Idir` flags on its shebang line on Darwin, - # causing the build to fail when trying to generate the documentation. - # Rewrite the -I flags in `use lib` form. - preBuild = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang ./pgbadger - ''; - outputs = [ "out" ]; PERL_MM_OPT = "INSTALL_BASE=${placeholder "out"}"; @@ -46,8 +37,6 @@ buildPerlPackage rec { TextCSV_XS ]; - nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ shortenPerlShebang ]; - nativeCheckInputs = [ bzip2 which diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index f7d4a1b408a9..5f15b950012e 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -43,7 +43,6 @@ woff2, xxHash, makeWrapper, - shortenPerlShebang, useFixedHashes, asymptote, biber-ms, diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1ab3d82d2ef8..5fdb2ddca247 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -327,11 +327,6 @@ with pkgs; stdenv = clangStdenv; }; - cope = callPackage ../by-name/co/cope/package.nix { - perl = perl538; - perlPackages = perl538Packages; - }; - coolercontrol = recurseIntoAttrs (callPackage ../applications/system/coolercontrol { }); cup-docker-noserver = cup-docker.override { withServer = false; }; @@ -8928,13 +8923,12 @@ with pkgs; ### DEVELOPMENT / PERL MODULES perlInterpreters = import ../development/interpreters/perl { inherit callPackage; }; - inherit (perlInterpreters) perl538 perl540; + inherit (perlInterpreters) perl5; - perl538Packages = recurseIntoAttrs perl538.pkgs; - perl540Packages = recurseIntoAttrs perl540.pkgs; + perl5Packages = recurseIntoAttrs perl5.pkgs; - perl = perl540; - perlPackages = perl540Packages; + perl = perl5; + perlPackages = perl5Packages; ack = perlPackages.ack; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 26a964e72138..f0142a127a63 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -20,7 +20,6 @@ fetchFromGitHub, fetchFromGitLab, perl, - shortenPerlShebang, nixosTests, }: @@ -66,19 +65,22 @@ with self; args: buildPerlPackage ( { + # In case of cross-compilation, generated ./Build have host perl shebang, not build one + # so run it with build perl explicitly buildPhase = '' runHook preBuild - perl Build.PL --prefix=$out; ./Build build + perl Build.PL --prefix=$out; + perl ./Build build runHook postBuild ''; installPhase = '' runHook preInstall - ./Build install + perl ./Build install runHook postInstall ''; checkPhase = '' runHook preCheck - ./Build test + perl ./Build test runHook postCheck ''; } @@ -126,11 +128,7 @@ with self; "man" ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; propagatedBuildInputs = [ FileNext ]; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/ack - ''; # tests fails on nixos and hydra because of different purity issues doCheck = false; @@ -1217,10 +1215,6 @@ with self; --replace-fail http://cpanmetadb.plackperl.org https://cpanmetadb.plackperl.org ''; propagatedBuildInputs = [ IOSocketSSL ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/cpanm - ''; meta = { description = "Get, unpack, build and install modules from CPAN"; homepage = "https://github.com/miyagawa/cpanminus"; @@ -1258,10 +1252,6 @@ with self; ParallelPipes locallib ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/cpm - ''; meta = { description = "Fast CPAN module installer"; homepage = "https://github.com/skaji/cpm"; @@ -1309,7 +1299,6 @@ with self; TextLayout ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ Wx ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; # Delete tests that fail when version env var is set, see # https://github.com/ChordPro/chordpro/issues/293 @@ -1318,7 +1307,6 @@ with self; ''; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/chordpro rm $out/bin/wxchordpro # Wx not supported on darwin ''; meta = { @@ -1874,10 +1862,10 @@ with self; AudioScan = buildPerlPackage { pname = "Audio-Scan"; - version = "1.10"; + version = "1.11"; src = fetchurl { - url = "https://github.com/Logitech/slimserver-vendor/raw/public/9.0/CPAN/Audio-Scan-1.10.tar.gz"; - hash = "sha256-Vqi/rnYKijmaWYwTFTyj88aMoDB2cCSHxHeR1bkfqSk="; + url = "https://github.com/Logitech/slimserver-vendor/raw/public/9.1/CPAN/Audio-Scan-1.11.tar.gz"; + hash = "sha256-G+0qaqP2c1w/UKuOmRawq/qKZjsWvZUzTAl5C6H6bUI="; }; buildInputs = [ pkgs.zlib @@ -2596,10 +2584,10 @@ with self; BKeywords = buildPerlPackage { pname = "B-Keywords"; - version = "1.27"; + version = "1.28"; src = fetchurl { - url = "mirror://cpan/authors/id/R/RU/RURBAN/B-Keywords-1.27.tar.gz"; - hash = "sha256-7xC5CF5nTqpBfMt9aS+2zZj3u2feKhJ+ujRX2K5YfP8="; + url = "mirror://cpan/authors/id/R/RU/RURBAN/B-Keywords-1.28.tar.gz"; + hash = "sha256-nn62dpWSlIfGGq8trouvndoa2HYCu1oJTxB0SxJ2Xj4="; }; meta = { description = "Lists of reserved barewords and symbol names"; @@ -2732,63 +2720,6 @@ with self; }; }; - BSON = buildPerlPackage { - pname = "BSON"; - version = "1.12.2"; - src = fetchurl { - url = "mirror://cpan/authors/id/M/MO/MONGODB/BSON-v1.12.2.tar.gz"; - hash = "sha256-9GEsDDVDEHQbmattJkUSJoIxUMonEJsbORIy1c/dpts="; - }; - buildInputs = [ - JSONMaybeXS - PathTiny - TestDeep - TestFatal - ]; - propagatedBuildInputs = [ - CryptURandom - Moo - TieIxHash - boolean - namespaceclean - ]; - meta = { - description = "BSON serialization and deserialization (EOL)"; - homepage = "https://github.com/mongodb-labs/mongo-perl-bson"; - license = with lib.licenses; [ asl20 ]; - }; - }; - - BSONXS = buildPerlPackage { - pname = "BSON-XS"; - version = "0.8.4"; - src = fetchurl { - url = "mirror://cpan/authors/id/M/MO/MONGODB/BSON-XS-v0.8.4.tar.gz"; - hash = "sha256-KPfTOP14tvnJpggL6d4/XLI9iIuW6/b8v6zp8pZq6/k="; - }; - buildInputs = [ - ConfigAutoConf - JSONMaybeXS - PathTiny - TestDeep - TestFatal - TieIxHash - ]; - propagatedBuildInputs = [ - BSON - boolean - JSONXS - JSONPP - CpanelJSONXS - ]; - meta = { - description = "XS implementation of MongoDB's BSON serialization (EOL)"; - homepage = "https://github.com/mongodb-labs/mongo-perl-bson-xs"; - license = with lib.licenses; [ asl20 ]; - platforms = lib.platforms.linux; # configure phase fails with "ld: unknown option: -mmacosx-version-min=10.12" - }; - }; - BUtils = buildPerlPackage { pname = "B-Utils"; version = "0.27"; @@ -2798,6 +2729,10 @@ with self; }; propagatedBuildInputs = [ TaskWeaken ]; buildInputs = [ ExtUtilsDepends ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/utils/40walk.t + ''; meta = { description = "Helper functions for op tree manipulation"; homepage = "https://search.cpan.org/dist/B-Utils"; @@ -3383,7 +3318,6 @@ with self; buildInputs = [ ModuleBuildTiny TestLongString - TestSimple13 TestWWWMechanize TestWWWMechanizeCatalyst ]; @@ -3804,7 +3738,6 @@ with self; buildInputs = [ CatalystRuntime TestLongString - TestSimple13 TestWWWMechanize TestWWWMechanizeCatalyst ]; @@ -4178,7 +4111,6 @@ with self; buildInputs = [ CatalystRuntime TestLongString - TestSimple13 TestWWWMechanize TestWWWMechanizeCatalyst TextCSV @@ -4441,6 +4373,11 @@ with self; TestWarn ]; propagatedBuildInputs = [ HTMLParser ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/rt-84767.t + rm t/param_list_context.t + ''; meta = { description = "Handle Common Gateway Interface requests and responses"; homepage = "https://metacpan.org/module/CGI"; @@ -5296,6 +5233,12 @@ with self; url = "mirror://cpan/authors/id/K/KM/KMX/Class-Throwable-0.13.tar.gz"; hash = "sha256-3JoR4Nq1bcIg3qjJT+PEfbXn3Xwe0E3IF4qlu3v7vM4="; }; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/10_Class_Throwable_test.t + rm t/20_Class_Throwable_subException_test.t + rm t/35_Class_Throwable_sub_class_test.t + ''; meta = { description = "Minimal lightweight exception class"; license = with lib.licenses; [ @@ -6439,7 +6382,6 @@ with self; }; buildInputs = [ TestException - TestSimple13 ]; meta = { description = "Run code after a subroutine call, preserving the context the subroutine would have seen if it were the last statement in the caller"; @@ -6635,14 +6577,10 @@ with self; url = "mirror://cpan/authors/id/R/RJ/RJBS/CPAN-Mini-1.111017.tar.gz"; hash = "sha256-8gQpO+JqyEGsyHBEoYjbD1kegIgTFseiiK7A7s4wYVU="; }; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; propagatedBuildInputs = [ FileHomeDir LWPProtocolHttps ]; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/minicpan - ''; meta = { description = "Create a minimal mirror of CPAN"; @@ -7108,7 +7046,6 @@ with self; url = "mirror://cpan/authors/id/B/BA/BARTB/Crypt-HSXKPasswd-v3.6.tar.gz"; hash = "sha256-lZ3MX58BG/ALha0i31ZrerK/XqHTYrDeD7WuKfvEWLM="; }; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; propagatedBuildInputs = [ Clone DateTime @@ -7123,9 +7060,6 @@ with self; TextUnidecode TypeTiny ]; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/hsxkpasswd - ''; meta = { description = "Secure memorable password generator"; @@ -7318,7 +7252,6 @@ with self; buildInputs = [ ModuleBuildTiny TestFatal - TestSimple13 ]; propagatedBuildInputs = [ CaptureTiny @@ -7578,10 +7511,6 @@ with self; LWP ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/pgplet - ''; doCheck = false; # test fails with 'No random source available!' meta = { @@ -10052,7 +9981,6 @@ with self; }; buildInputs = [ DBIxClass - TestSimple13 ]; propagatedBuildInputs = [ DBDSQLite @@ -10221,6 +10149,10 @@ with self; SafeIsa TextBrew ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/ResultSet/Errors.t + ''; meta = { description = "Simplify the common case stuff for DBIx::Class"; homepage = "https://github.com/frioux/DBIx-Class-Helpers"; @@ -10606,10 +10538,6 @@ with self; CaptureTiny TestDifferences ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/* - ''; meta = { description = "Powerful fast feature-rich Perl source code profiler"; homepage = "https://code.google.com/p/perl-devel-nytprof"; @@ -10672,7 +10600,6 @@ with self; namespaceclean ]; buildInputs = [ - TestSimple13 TestWarnings ]; meta = { @@ -10700,10 +10627,10 @@ with self; DevelSize = buildPerlPackage { pname = "Devel-Size"; - version = "0.84"; + version = "0.85"; src = fetchurl { - url = "mirror://cpan/authors/id/N/NW/NWCLARK/Devel-Size-0.84.tar.gz"; - hash = "sha256-2y5NZfaI2/WSc7XoIQGsPxpm9mWvsFlNzhaLhlCk0OQ="; + url = "mirror://cpan/authors/id/N/NW/NWCLARK/Devel-Size-0.85.tar.gz"; + hash = "sha256-KS+YsT7dGqSlROOlzx2fLXAZ91xzZNLo+oo16lRR5z4="; }; meta = { description = "Perl extension for finding the memory usage of Perl variables"; @@ -11034,10 +10961,6 @@ with self; TermUI YAMLTiny ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/dzil - ''; doCheck = false; meta = { description = "Distribution builder; installer not included"; @@ -11895,13 +11818,9 @@ with self; Throwable TryTiny ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; postPatch = '' patchShebangs --build util ''; - preCheck = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang util/sendmail - ''; meta = { description = "Library for sending email"; homepage = "https://github.com/rjbs/Email-Sender"; @@ -12264,10 +12183,10 @@ with self; Error = buildPerlModule { pname = "Error"; - version = "0.17029"; + version = "0.17030"; src = fetchurl { - url = "mirror://cpan/authors/id/S/SH/SHLOMIF/Error-0.17029.tar.gz"; - hash = "sha256-GiP3kTAyrtbUtoMhNzo4mcpmWQ9HJzkaCR7BnJW/etw="; + url = "mirror://cpan/authors/id/S/SH/SHLOMIF/Error-0.17030.tar.gz"; + hash = "sha256-NNOCJ2wPsNazg1W5TJajCxLYNNVmLrU/CI7iXj5xKSQ="; }; meta = { description = "Error/exception handling in an OO-ish way"; @@ -12285,6 +12204,13 @@ with self; url = "mirror://cpan/authors/id/M/ML/MLEHMANN/EV-4.34.tar.gz"; hash = "sha256-EhFoPc57Z3H0q3EMwVNxK913umFXoTKU0LtzSR/QZWA="; }; + patches = [ + (fetchpatch { + name = "EV-4.34-perl-5.42.patch"; + url = "https://free.nchc.org.tw/gentoo-portage/dev-perl/EV/files/EV-4.34-perl-5.42.patch"; + hash = "sha256-GiQ89pk3EZ3b6oxB7jDTY5C62qqKsZUjJ4Ag2JVwGFw="; + }) + ]; buildInputs = [ CanaryStability ]; propagatedBuildInputs = [ commonsense ]; meta = { @@ -14402,6 +14328,10 @@ with self; DirSelf TestFatal ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/eating_strict_error.t + ''; meta = { description = "Define functions and methods with parameter lists (\"subroutine signatures\")"; license = with lib.licenses; [ @@ -14465,10 +14395,10 @@ with self; FutureAsyncAwait = buildPerlModule { pname = "Future-AsyncAwait"; - version = "0.66"; + version = "0.70"; src = fetchurl { - url = "mirror://cpan/authors/id/P/PE/PEVANS/Future-AsyncAwait-0.66.tar.gz"; - hash = "sha256-xqD03kYr8yS1usoXddGZ7DJGo1jBPbm2Ssv82+bl7CE="; + url = "mirror://cpan/authors/id/P/PE/PEVANS/Future-AsyncAwait-0.70.tar.gz"; + hash = "sha256-hCiZBJyXf7IyaoCWkmRB5XvsqRK7K0kY1c4JDfTUprc="; }; buildInputs = [ Test2Suite ]; propagatedBuildInputs = [ @@ -14800,10 +14730,6 @@ with self; url = "mirror://cpan/authors/id/T/TO/TORBIAK/App-Git-Autofixup-0.004007.tar.gz"; hash = "sha256-2pe/dnKAlbO27nHaGfC/GUMBsvRd9HietU23Tt0hCjs="; }; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/git-autofixup - ''; meta = { description = "Create fixup commits for topic branches"; license = with lib.licenses; [ artistic2 ]; @@ -15582,16 +15508,12 @@ with self; TermSk namespaceclean ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; patches = [ ../development/perl-modules/Hailo-fix-test-gld.patch ]; postPatch = '' patchShebangs bin ''; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/hailo - ''; meta = { description = "Pluggable Markov engine analogous to MegaHAL"; homepage = "https://github.com/hailo/hailo"; @@ -15611,7 +15533,6 @@ with self; hash = "sha256-vJpKo47JjwqYKJ41q/mhfC8qMjmiIJoymADglwqi4MU="; }; propagatedBuildInputs = [ HashMerge ]; - buildInputs = [ TestSimple13 ]; meta = { description = "Return difference between two hashes as a hash"; @@ -16697,25 +16618,6 @@ with self; }; }; - HTTPHeaderParserXS = buildPerlPackage { - pname = "HTTP-HeaderParser-XS"; - version = "0.20"; - src = fetchurl { - url = "mirror://cpan/authors/id/M/MA/MARKSMITH/HTTP-HeaderParser-XS-0.20.tar.gz"; - hash = "sha256-qeAP/7PYmRoUqq/dxh1tFoxP8U4xSuPbstTaMAjXRu8="; - }; - meta = { - description = "XS extension for processing HTTP headers"; - license = with lib.licenses; [ - artistic1 - gpl1Plus - ]; - broken = - stdenv.hostPlatform.isi686 # loadable library and perl binaries are mismatched (got handshake key 0x7d40080, needed 0x7dc0080) - || stdenv.hostPlatform.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/staging-next/perl534Packages.HTTPHeaderParserXS.x86_64-darwin - }; - }; - HTTPHeadersFast = buildPerlModule { pname = "HTTP-Headers-Fast"; version = "0.22"; @@ -17307,10 +17209,6 @@ with self; }; buildInputs = [ CanaryStability ]; propagatedBuildInputs = [ commonsense ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/treescan - ''; meta = { description = "Asynchronous/Advanced Input/Output"; license = with lib.licenses; [ @@ -17493,7 +17391,6 @@ with self; ]; buildInputs = [ ModuleBuildTiny - TestSimple13 ]; meta = { description = "Functions for working with IO::Handle like objects"; @@ -18452,8 +18349,7 @@ with self; ]; nativeBuildInputs = [ pkgs.makeWrapper - ] - ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; + ]; makeMakerFlags = [ "TEXMF=\${tex}" "NOMKTEXLSR" @@ -18461,11 +18357,6 @@ with self; # shebangs need to be patched before executables are copied to $out preBuild = '' patchShebangs bin/ - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - for file in bin/*; do - shortenPerlShebang "$file" - done ''; postInstall = '' for file in latexmlc latexmlmath latexmlpost ; do @@ -20845,22 +20736,23 @@ with self; MathPari = buildPerlPackage rec { pname = "Math-Pari"; - version = "2.030523"; + version = "2.030528"; nativeBuildInputs = [ pkgs.unzip ]; - pariversion = "2.1.7"; + pariversion = "2.3.5"; pari_tgz = fetchurl { - url = "https://pari.math.u-bordeaux.fr/pub/pari/OLD/2.1/pari-${pariversion}.tgz"; - hash = "sha256-kULyza8wg8iWLxpcK7Dp/okV99lJDAMxKsI2HH6hVfo="; + url = "https://pari.math.u-bordeaux.fr/pub/pari/OLD/2.3/pari-${pariversion}.tar.gz"; + hash = "sha256-R92uGvc7RHZmDSqJM4SDlJBnqX/7h1jILoGJ36TInYg="; }; + # Workaround build failure on -fno-common toolchains: # ld: libPARI/libPARI.a(compat.o):(.bss+0x8): multiple definition of # `overflow'; Pari.o:(.bss+0x80): first defined here env.NIX_CFLAGS_COMPILE = "-fcommon -Wno-error=implicit-int -Wno-error=implicit-function-declaration"; - preConfigure = "cp ${pari_tgz} pari-${pariversion}.tgz"; - makeMakerFlags = [ "pari_tgz=pari-${pariversion}.tgz" ]; + preConfigure = "cp ${pari_tgz} pari-${pariversion}.tar.gz"; + makeMakerFlags = [ "pari_tgz=pari-${pariversion}.tar.gz" ]; src = fetchurl { - url = "mirror://cpan/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.030518.zip"; - hash = "sha256-3DiVWpaQvmuvqN4lJiEjd8Psn+jaXsAiY6nK+UtYu5E="; + url = "mirror://cpan/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.030528.tar.gz"; + hash = "sha256-Z/dNIWxpY1qxxuo+J84ZdQqUorVgrnKIuy1s9xT85sg="; }; meta = { description = "Perl interface to PARI"; @@ -22029,6 +21921,10 @@ with self; TestDeep TestNoWarnings ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/20_parse_self.t + ''; meta = { description = "Find out what modules are used"; license = with lib.licenses; [ @@ -22956,47 +22852,6 @@ with self; }; }; - MongoDB = buildPerlPackage { - pname = "MongoDB"; - version = "2.2.2"; - src = fetchurl { - url = "mirror://cpan/authors/id/M/MO/MONGODB/MongoDB-v2.2.2.tar.gz"; - hash = "sha256-IBk1+S2slPOcNd5zZh6LJSQ55JbyKGV9uF/5MlfDJo8="; - }; - buildInputs = [ - JSONMaybeXS - PathTiny - TestDeep - TestFatal - TimeMoment - ]; - propagatedBuildInputs = [ - AuthenSASLSASLprep - AuthenSCRAM - BSON - IOSocketSSL - NetSSLeay - ClassXSAccessor - BSONXS - TypeTinyXS - MozillaCA - Moo - NetDNS - SafeIsa - SubQuote - TieIxHash - TypeTiny - UUIDURandom - boolean - namespaceclean - ]; - meta = { - description = "Official MongoDB Driver for Perl (EOL)"; - homepage = "https://github.com/mongodb-labs/mongo-perl-driver"; - license = with lib.licenses; [ asl20 ]; - }; - }; - MonitoringPlugin = buildPerlPackage { pname = "Monitoring-Plugin"; version = "0.40"; @@ -24150,7 +24005,6 @@ with self; buildInputs = [ ModuleBuildTiny TestFatal - TestSimple13 TestTableDriven ]; propagatedBuildInputs = [ @@ -24303,7 +24157,6 @@ with self; MooseXRoleParameterized TestFatal TestRequires - TestSimple13 ]; propagatedBuildInputs = [ Moose @@ -24402,7 +24255,6 @@ with self; buildInputs = [ ModuleBuildTiny TestFatal - TestSimple13 ]; propagatedBuildInputs = [ DateTime @@ -24428,7 +24280,6 @@ with self; buildInputs = [ ModuleBuildTiny TestFatal - TestSimple13 ]; propagatedBuildInputs = [ DateTimeXEasy @@ -24675,10 +24526,10 @@ with self; Mouse = buildPerlModule { pname = "Mouse"; - version = "2.5.10"; + version = "2.5.11"; src = fetchurl { - url = "mirror://cpan/authors/id/S/SK/SKAJI/Mouse-v2.5.10.tar.gz"; - hash = "sha256-zo3COUYVOkZ/8JdlFn7iWQ9cUCEg9IotlEFzPzmqMu4="; + url = "mirror://cpan/authors/id/S/SK/SKAJI/Mouse-v2.5.11.tar.gz"; + hash = "sha256-4qDQkwGQwhpES5YHk6ouNp7yih3QuPNIKXlfhqGRWVY="; }; buildInputs = [ ModuleBuildXSUtil @@ -24793,6 +24644,9 @@ with self; substituteInPlace Makefile.PL \ --replace-fail '`which pkg-config`' "'$PKG_CONFIG'" ''; + patches = [ + ../development/perl-modules/MusicBrainz-DiscID---ExtUtils-ParseXS-compat.patch + ]; doCheck = false; # The main test performs network access nativeBuildInputs = [ pkgs.pkg-config ]; propagatedBuildInputs = [ pkgs.libdiscid ]; @@ -25070,6 +24924,12 @@ with self; url = "mirror://cpan/authors/id/B/BA/BARNEY/Net-Amazon-S3-0.991.tar.gz"; hash = "sha256-+3r4umSUjRo/MdgJ13EFImiA8GmYrH8Rn4JITmijI9M="; }; + patches = [ + (fetchpatch { + url = "https://github.com/rustyconover/net-amazon-s3/commit/233cb0f2812c4f71b4fecd4058dbf34fe8d6824d.patch"; + hash = "sha256-lVx1CoAFY37KIkDdl2Inqb16aZ9D0lXt475/7LyjOLM="; + }) + ]; buildInputs = [ TestDeep TestException @@ -26575,10 +26435,10 @@ with self; ObjectPad = buildPerlModule { pname = "Object-Pad"; - version = "0.809"; + version = "0.821"; src = fetchurl { - url = "mirror://cpan/authors/id/P/PE/PEVANS/Object-Pad-0.809.tar.gz"; - hash = "sha256-EpUKZkwGB+o/ynSA82XfVNF0YpH0XrsO2AkXt0+xXvU="; + url = "mirror://cpan/authors/id/P/PE/PEVANS/Object-Pad-0.821.tar.gz"; + hash = "sha256-tdUF+PoWLg5r4q5YsPM0SUxPeRs6BA8va4kBTwSEUgw="; }; buildInputs = [ Test2Suite @@ -27640,21 +27500,11 @@ with self; PDL = buildPerlPackage { pname = "PDL"; - version = "2.025"; + version = "2.100"; src = fetchurl { - url = "mirror://cpan/authors/id/E/ET/ETJ/PDL-2.025.tar.gz"; - hash = "sha256-G1oWfq0ndy2V2tJ/jrfQlRnSkVbu1TxvwUQVGUtaitY="; + url = "mirror://cpan/authors/id/E/ET/ETJ/PDL-2.100.tar.gz"; + hash = "sha256-iqpu35AlWj0LTQBH1icOESS/HhrNJBSATocxC2s5vkA="; }; - patchPhase = '' - substituteInPlace perldl.conf \ - --replace 'POSIX_THREADS_LIBS => undef' 'POSIX_THREADS_LIBS => "-L${pkgs.glibc.dev}/lib"' \ - --replace 'POSIX_THREADS_INC => undef' 'POSIX_THREADS_INC => "-I${pkgs.glibc.dev}/include"' \ - --replace 'WITH_MINUIT => undef' 'WITH_MINUIT => 0' \ - --replace 'WITH_SLATEC => undef' 'WITH_SLATEC => 0' \ - --replace 'WITH_HDF => undef' 'WITH_HDF => 0' \ - --replace 'WITH_GD => undef' 'WITH_GD => 0' \ - --replace 'WITH_PROJ => undef' 'WITH_PROJ => 0' - ''; # FIXME: Why are these libraries in `nativeBuildInputs`? nativeBuildInputs = with pkgs; [ @@ -27771,7 +27621,6 @@ with self; hash = "sha256-5c2V3j5DvOcHdRdidLqkBfMm/IdA3wBUu4FpdcyNNJs="; }; buildInputs = [ TestDeep ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; propagatedBuildInputs = [ BKeywords ConfigTiny @@ -27789,8 +27638,10 @@ with self; Readonly StringFormat ]; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/perlcritic + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/20_policy_require_tidy_code.t + rm t/03_pragmas.t ''; meta = { description = "Critique Perl source code for best-practices"; @@ -27805,18 +27656,18 @@ with self; PerlCriticCommunity = buildPerlModule { pname = "Perl-Critic-Community"; - version = "1.0.3"; + version = "1.0.4"; src = fetchurl { - url = "mirror://cpan/authors/id/D/DB/DBOOK/Perl-Critic-Community-v1.0.3.tar.gz"; - hash = "sha256-Ed3bt5F5/mIp8zPKOS+U/firXNmJzJfZk1IaidXEetU="; + url = "mirror://cpan/authors/id/D/DB/DBOOK/Perl-Critic-Community-v1.0.4.tar.gz"; + hash = "sha256-OzFiTqDPQ5K49Dl6UpUVJIgUohZml/GkU9WKtvES0gk="; }; buildInputs = [ ModuleBuildTiny ]; propagatedBuildInputs = [ PPI PathTiny PerlCritic + PerlCriticPolicyPliceaseProhibitArrayAssignAref PerlCriticPolicyVariablesProhibitLoopOnHash - PerlCriticPulp ]; meta = { description = "Community-inspired Perl::Critic policies"; @@ -27844,6 +27695,21 @@ with self; }; }; + PerlCriticPolicyPliceaseProhibitArrayAssignAref = buildPerlPackage { + pname = "Perl-Critic-Policy-Plicease-ProhibitArrayAssignAref"; + version = "100.00"; + src = fetchurl { + url = "mirror://cpan/authors/id/P/PL/PLICEASE/Perl-Critic-Policy-Plicease-ProhibitArrayAssignAref-100.00.tar.gz"; + hash = "sha256-2LcyMNK4vyuAEE/Ap1jHSLn/N7CL+Buqc/jXCeIM/r4="; + }; + propagatedBuildInputs = [ PerlCritic ]; + meta = { + homepage = "https://metacpan.org/pod/Perl::Critic::Policy::Plicease::ProhibitArrayAssignAref"; + description = "Don't assign an anonymous arrayref to an array"; + license = lib.licenses.gpl3Plus; + }; + }; + PerlCriticPolicyVariablesProhibitLoopOnHash = buildPerlPackage { pname = "Perl-Critic-Policy-Variables-ProhibitLoopOnHash"; version = "0.008"; @@ -28099,10 +27965,10 @@ with self; PerlTidy = buildPerlPackage { pname = "Perl-Tidy"; - version = "20230912"; + version = "20250711"; src = fetchurl { - url = "mirror://cpan/authors/id/S/SH/SHANCOCK/Perl-Tidy-20230912.tar.gz"; - hash = "sha256-DFeIjyBvmHd34WZA5yV0qgp3eEZxn44+0EE8NTJfVUA="; + url = "mirror://cpan/authors/id/S/SH/SHANCOCK/Perl-Tidy-20250711.tar.gz"; + hash = "sha256-NHqpC8773itZDa9I04fvH9m3pzqZawQCafEatvuLpEg="; }; meta = { description = "Indent and reformat perl scripts"; @@ -28491,9 +28357,9 @@ with self; PodMarkdown URI ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/pls + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/02document-new.t ''; meta = { description = "Perl Language Server"; @@ -28615,10 +28481,12 @@ with self; TaskWeaken ]; - # Remove test that fails due to unexpected shebang after - # patchShebang. - preCheck = "rm t/03_document.t"; - + preCheck = " + # Remove test that fails due to unexpected shebang after patchShebang. + rm t/03_document.t + # Remove tests with hardcoded line numbers. + rm t/29_logical_filename.t + "; meta = { description = "Parse, Analyze and Manipulate Perl (without perl)"; homepage = "https://github.com/Perl-Critic/PPI"; @@ -29194,6 +29062,10 @@ with self; url = "mirror://cpan/authors/id/M/MA/MAREKR/Pod-Checker-1.75.tar.gz"; hash = "sha256-82O1dOxmCvbtvT5dTJ/8UVodRsvxx8ytmkbO0oh5wiE="; }; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/pod/podchkenc.t + ''; meta = { description = "Verifies POD documentation contents for compliance with the POD format specifications"; license = with lib.licenses; [ @@ -29304,6 +29176,10 @@ with self; }; propagatedBuildInputs = [ MixinLinewise ]; buildInputs = [ TestDeep ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/non-pod.t + ''; meta = { description = "Read a POD document as a series of trivial events"; homepage = "https://github.com/rjbs/Pod-Eventual"; @@ -29732,10 +29608,6 @@ with self; url = "mirror://cpan/authors/id/S/SY/SYP/App-rainbarf-1.4.tar.gz"; hash = "sha256-TxOa01+q8t4GI9wLsd2J+lpDHlSL/sh97hlM8OJcyX0="; }; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/rainbarf - ''; meta = { description = "CPU/RAM/battery stats chart bar for tmux (and GNU screen)"; homepage = "https://github.com/creaktive/rainbarf"; @@ -30183,6 +30055,10 @@ with self; AnyEvent DataSExpression ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/06.query.t + ''; meta = { description = "Asynchronous Remote Procedure Stack"; license = with lib.licenses; [ @@ -31206,13 +31082,6 @@ with self; patchShebangs script ''; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - for file in $out/bin/*; do - shortenPerlShebang $file - done - ''; - meta = { description = "SQL DDL transformations and more"; license = with lib.licenses; [ @@ -31300,7 +31169,6 @@ with self; TestRequires TestTCP ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; propagatedBuildInputs = [ DataDump HTTPParserXS @@ -31309,9 +31177,6 @@ with self; NetServerSSPrefork IOSocketINET6 ]; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/starman - ''; doCheck = false; # binds to various TCP ports meta = { @@ -31341,10 +31206,10 @@ with self; StatisticsCaseResampling = buildPerlPackage { pname = "Statistics-CaseResampling"; - version = "0.15"; + version = "0.17"; src = fetchurl { - url = "mirror://cpan/authors/id/S/SM/SMUELLER/Statistics-CaseResampling-0.15.tar.gz"; - hash = "sha256-hRxDvW8Q0yKJUipQxqIJw7JGz9PrVmdz5oYe2gSkkIc="; + url = "mirror://cpan/authors/id/S/SM/SMUELLER/Statistics-CaseResampling-0.17.tar.gz"; + hash = "sha256-buZtDu2BiC7E+kj//hY6BP2YxNVqwejNwUqfg70YObw="; }; meta = { description = "Efficient resampling and calculation of medians with confidence intervals"; @@ -31874,7 +31739,6 @@ with self; }; buildInputs = [ TestException - TestSimple13 TestTableDriven ]; propagatedBuildInputs = [ @@ -32038,6 +31902,11 @@ with self; url = "mirror://cpan/authors/id/R/RG/RGARCIA/Sub-Identify-0.14.tar.gz"; hash = "sha256-Bo0nIIZRTdHoQrakCxvtuv7mOQDlsIiQ72cAA53vrW8="; }; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/04codelocation-pureperl.t + rm t/04codelocation.t + ''; meta = { description = "Retrieve names of code references"; license = with lib.licenses; [ @@ -32292,6 +32161,10 @@ with self; url = "mirror://cpan/authors/id/D/DE/DEXTER/Symbol-Util-0.0203.tar.gz"; hash = "sha256-VbZh3SL5zpub5afgo/UomsAM0lTCHj2GAyiaVlrm3DI="; }; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/10use.t + ''; meta = { description = "Additional utils for Perl symbols manipulation"; license = with lib.licenses; [ @@ -32343,10 +32216,10 @@ with self; SyntaxKeywordTry = buildPerlModule { pname = "Syntax-Keyword-Try"; - version = "0.29"; + version = "0.30"; src = fetchurl { - url = "mirror://cpan/authors/id/P/PE/PEVANS/Syntax-Keyword-Try-0.29.tar.gz"; - hash = "sha256-zDIHGdNgjaqVFHQ6Q9rCvpnLjM2Ymx/vooUpDLHVnY8="; + url = "mirror://cpan/authors/id/P/PE/PEVANS/Syntax-Keyword-Try-0.30.tar.gz"; + hash = "sha256-8Gjwuccf/4/vbYqentaVHLelK5djIr2VUYHMXnsX5pI="; }; buildInputs = [ Test2Suite ]; propagatedBuildInputs = [ XSParseKeyword ]; @@ -33381,7 +33254,6 @@ with self; IPCRun3 Test2Suite ]; - propagatedBuildInputs = [ TestSimple13 ]; meta = { description = "Fail if tests warn"; homepage = "https://metacpan.org/release/Test2-Plugin-NoWarnings"; @@ -33401,7 +33273,6 @@ with self; ScopeGuard SubInfo TermTable - TestSimple13 ]; meta = { description = "Distribution with a rich set of tools built upon the Test2 framework"; @@ -33514,6 +33385,10 @@ with self; hash = "sha256-/NzkHVcnOIFYGt9oCiCmrfUaTDt+McP2mGb7kQk3AoA="; }; propagatedBuildInputs = [ LogTrace ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/Test-Assertions.t + ''; meta = { description = "Simple set of building blocks for both unit and runtime testing"; license = with lib.licenses; [ gpl2Only ]; @@ -33609,6 +33484,14 @@ with self; ModuleRuntime TryTiny ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/runtests_die.t + rm t/runtests_die_empty.t + rm t/runtests_die_nearlyempty.t + rm t/runtests_result.t + rm t/todo.t + ''; meta = { description = "Easily create test classes in an xUnit/JUnit style"; license = with lib.licenses; [ @@ -33934,6 +33817,10 @@ with self; hash = "sha256-FWsT8Hdk92bYtFpDco8kOa+Bo1EmJUON6reDt4g+tTM="; }; propagatedBuildInputs = [ SubUplevel ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/return.t + ''; meta = { description = "Test exception-based code"; license = with lib.licenses; [ @@ -34315,6 +34202,11 @@ with self; url = "mirror://cpan/authors/id/L/LE/LEEJO/Test-LeakTrace-0.17.tar.gz"; hash = "sha256-d31k0pOPXqWGMA7vl+8D6stD1MGFPJw7EJHrMxFGeXA="; }; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/09_info_more.t + rm t/11_logfp.t + ''; meta = { description = "Traces memory leaks"; homepage = "https://metacpan.org/release/Test-LeakTrace"; @@ -34332,6 +34224,10 @@ with self; url = "mirror://cpan/authors/id/T/TM/TMOERTEL/Test-LectroTest-0.5001.tar.gz"; hash = "sha256-rCtPDZWJmvGhoex4TLdAsrkCVqvuEcg+eykRA+ye1zU="; }; + preCheck = '' + # Remove impure test + rm t/gens.t + ''; meta = { description = "Easy, automatic, specification-based tests"; license = with lib.licenses; [ @@ -34596,6 +34492,10 @@ with self; url = "mirror://cpan/authors/id/S/SY/SYP/Test-Mojibake-1.3.tar.gz"; hash = "sha256-j/51/5tpNSSIcn3Kc9uR+KoUtZ8voQTrdxfA1xpfGzM="; }; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/02-bad-source.t + ''; meta = { description = "Check your source for encoding misbehavior"; homepage = "https://github.com/creaktive/Test-Mojibake"; @@ -34808,6 +34708,13 @@ with self; TextDiff ]; buildInputs = [ TestPerlCritic ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/perltidy.t + rm t/list_files.t + rm t/exclude_files.t + rm t/exclude_perltidy.t + ''; meta = { description = "Check that all your files are tidy"; homepage = "https://metacpan.org/release/Test-PerlTidy"; @@ -35205,13 +35112,15 @@ with self; url = "mirror://cpan/authors/id/P/PL/PLICEASE/Test-Script-1.29.tar.gz"; hash = "sha256-iS5+bB6nsWcQkJlCz1wL2rcO7i79SqnBbqlS4rkPiVA="; }; - buildInputs = [ Test2Suite ]; - propagatedBuildInputs = [ CaptureTiny ProbePerl ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/test_script__script_compiles.t + ''; meta = { description = "Basic cross-platform tests for scripts"; license = with lib.licenses; [ @@ -35259,22 +35168,6 @@ with self; }; }; - TestSimple13 = buildPerlPackage { - pname = "Test-Simple"; - version = "1.302195"; - src = fetchurl { - url = "mirror://cpan/authors/id/E/EX/EXODIST/Test-Simple-1.302195.tar.gz"; - hash = "sha256-s5C7I1kuC5Rsla27PDCxG8Y0ooayhHvmEa2SnFfjmmw="; - }; - meta = { - description = "Basic utilities for writing tests"; - license = with lib.licenses; [ - artistic1 - gpl1Plus - ]; - }; - }; - TestSnapshot = buildPerlPackage { pname = "Test-Snapshot"; version = "0.06"; @@ -35492,6 +35385,9 @@ with self; hash = "sha256-mMoy5/L16om4v7mgYJl389FT4kLi5RcFEmy5VPGga1c="; }; propagatedBuildInputs = [ SubUplevel ]; + # Tests fail because they hardcode line numbers which have been shifted due to the inclusion of + # libraries. + doCheck = false; meta = { description = "Perl extension to test methods for warnings"; license = with lib.licenses; [ @@ -35655,6 +35551,10 @@ with self; hash = "sha256-36phHnFGrZyXabW89oiUmXa4Ny3354ekC5M6FI2JIDk="; }; propagatedBuildInputs = [ XMLLibXML ]; + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/simple.t + ''; meta = { description = "Test XML and HTML content and structure with XPath expressions"; license = with lib.licenses; [ @@ -36125,15 +36025,11 @@ with self; url = "mirror://cpan/authors/id/B/BO/BOBTFISH/Text-Markdown-1.000031.tar.gz"; hash = "sha256-wZHG1ezrjLdcBWUZI2BmLSAtcWutB6IzxLMppChNxxs="; }; - nativeBuildInputs = [ shortenPerlShebang ]; nativeCheckInputs = [ ListMoreUtils TestDifferences TestException ]; - postInstall = '' - shortenPerlShebang $out/bin/Markdown.pl - ''; meta = { description = "Convert Markdown syntax to (X)HTML"; license = with lib.licenses; [ bsd3 ]; @@ -36500,9 +36396,11 @@ with self; url = "mirror://cpan/authors/id/G/GF/GFUJI/Test-Vars-0.015.tar.gz"; hash = "sha256-4Y3RWCcuTsmTnh37M8dDGrTnXGtAsoDDi16AT9pHGlQ="; }; - buildInputs = [ ModuleBuildTiny ]; - + preCheck = '' + # Remove tests with hardcoded line numbers. + rm t/03_warned.t + ''; meta = { description = "Detects unused variables in perl modules"; homepage = "https://github.com/houseabsolute/p5-Test-Vars"; @@ -37818,10 +37716,10 @@ with self; VariableMagic = buildPerlPackage { pname = "Variable-Magic"; - version = "0.63"; + version = "0.64"; src = fetchurl { - url = "mirror://cpan/authors/id/V/VP/VPIT/Variable-Magic-0.63.tar.gz"; - hash = "sha256-ukCDssMf8mlPI3EzPVVMgmqvJLTZjQPki1tKQ6Kg5nk="; + url = "mirror://cpan/authors/id/V/VP/VPIT/Variable-Magic-0.64.tar.gz"; + hash = "sha256-n3hTJJyeo7TfkvtreQwDpgaA/AKfRMi/mJTczwGVFr0="; }; meta = { description = "Associate user-defined magic to variables from Perl"; @@ -38321,10 +38219,10 @@ with self; X11XCB = buildPerlPackage { pname = "X11-XCB"; - version = "0.20"; + version = "0.24"; src = fetchurl { - url = "mirror://cpan/authors/id/Z/ZH/ZHMYLOVE/X11-XCB-0.20.tar.gz"; - hash = "sha256-rVY5Yd4gIlVOdZHvXLjZY0ngxzdxIYXkeFBViMZ6L9I="; + url = "mirror://cpan/authors/id/Z/ZH/ZHMYLOVE/X11-XCB-0.24.tar.gz"; + hash = "sha256-eIUZZzpDxHUecwYaiCG2WPyV8G1cGcnx3rtgX7ILoEU="; }; env.AUTOMATED_TESTING = false; nativeBuildInputs = [ pkgs.pkg-config ]; @@ -38445,11 +38343,7 @@ with self; url = "mirror://cpan/authors/id/S/SI/SIXTEASE/XML-Entities-1.0002.tar.gz"; hash = "sha256-wyqk8wlXPXZIqy5Bb2K2sgZS8q2c/T7sgv1REB/nMQ0="; }; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; propagatedBuildInputs = [ LWP ]; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/download-entities.pl - ''; meta = { description = "Mapping of XML entities to Unicode"; license = with lib.licenses; [ @@ -38535,14 +38429,10 @@ with self; url = "mirror://cpan/authors/id/G/GR/GRANTM/XML-Filter-Sort-1.01.tar.gz"; hash = "sha256-UQWF85pJFszV+o1UXpYXnJHq9vx8l6QBp1aOhBFi+l8="; }; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; propagatedBuildInputs = [ XMLSAX XMLSAXWriter ]; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/xmlsort - ''; meta = { description = "SAX filter for sorting elements in XML"; license = with lib.licenses; [ @@ -39060,7 +38950,6 @@ with self; buildInputs = [ ExtUtilsDepends TestFatal - TestSimple13 ]; meta = { description = "Opaque, extensible XS pointer backed objects using sv_magic"; @@ -39096,10 +38985,10 @@ with self; XSParseSublike = buildPerlModule { pname = "XS-Parse-Sublike"; - version = "0.29"; + version = "0.37"; src = fetchurl { - url = "mirror://cpan/authors/id/P/PE/PEVANS/XS-Parse-Sublike-0.29.tar.gz"; - hash = "sha256-UnX1w457gFe6cuzRzAcpO26TOadzdA51pse+lSAfHjw="; + url = "mirror://cpan/authors/id/P/PE/PEVANS/XS-Parse-Sublike-0.37.tar.gz"; + hash = "sha256-c2UoyIjqe2phkQEeXVp4JOw4pWIFB95u9F5LxuHPDak="; }; buildInputs = [ Test2Suite ]; propagatedBuildInputs = [ FileShareDir ]; @@ -39571,7 +39460,11 @@ with self; SubExporterUtil = self.SubExporter; version = self.Version; - Gtk2GladeXML = throw "Gtk2GladeXML has been removed"; # 2022-01-15 - pcscperl = throw "'pcscperl' has been renamed to 'ChipcardPCSC'"; # Added 2023-12-07 + BSON = throw "BSON has been removed"; # 2025-09-12 + BSONXS = throw "BSONXS has been removed"; # 2025-09-12 GnuPG = throw "'GnuPG' has been removed"; # 2025-01-11 + Gtk2GladeXML = throw "Gtk2GladeXML has been removed"; # 2022-01-15 + MongoDB = throw "MongoDB has been removed"; # 2025-09-12 + pcscperl = throw "'pcscperl' has been renamed to 'ChipcardPCSC'"; # Added 2023-12-07 + HTTPHeaderParserXS = throw "HTTPHeaderParserXS has been removed"; # Added 2025-11-08 }