[staging] perl-updates post 25.11 (#349743)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
:
|
||||
}
|
||||
|
||||
@@ -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; {
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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
|
||||
'';
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -117,7 +117,6 @@ let
|
||||
TermReadKey
|
||||
Test2Harness
|
||||
TestPostgreSQL
|
||||
TestSimple13
|
||||
TextDiff
|
||||
TextTable
|
||||
UUID4Tiny
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}
|
||||
'';
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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; {
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
commit 385e8759c3ff1e7f7f996bd4ea391074d61d48c1
|
||||
Author: Karl Williamson <khw@cpan.org>
|
||||
AuthorDate: 2024-12-18 18:25:29 -0700
|
||||
Commit: Steve Hay <steve.m.hay@googlemail.com>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,408 +0,0 @@
|
||||
From 918bfff86ca8d6d4e4ec5b30994451e0bd74aba9 Mon Sep 17 00:00:00 2001
|
||||
From: Leon Timmermans <fawaka@gmail.com>
|
||||
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 <<!GROK!THIS! >$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/(?<!-rile)-rile-thrit-zor-(?!zor-)/i,
|
||||
- 'cloned iterator iterates exactly once over everything not already seen';
|
||||
-
|
||||
- seekdir $toberead, $start_pos;
|
||||
- readdir $toberead for 1 .. @first_2+@from_thread;
|
||||
- {
|
||||
- local $::TODO; # This always passes when dir handles are not cloned.
|
||||
- is
|
||||
- async { readdir $toberead // 'undef' } ->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'
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
From: =?UTF-8?q?Christian=20K=C3=B6gler?= <ck3d@gmx.de>
|
||||
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
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
From bd0ab509f890a6638bd5033ef58526f8c74f7e4b Mon Sep 17 00:00:00 2001
|
||||
From: Andrei Horodniceanu <a.horodniceanu@proton.me>
|
||||
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 <a.horodniceanu@proton.me>
|
||||
---
|
||||
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 <a.koenig@mind.de>
|
||||
Andreas Marienborg <andreas.marienborg@gmail.com>
|
||||
Andreas Schwab <schwab@suse.de>
|
||||
Andreas Voegele <andreas@andreasvoegele.com>
|
||||
+Andrei Horodniceanu <a.horodniceanu@proton.me>
|
||||
Andrei Yelistratov <andrew@sundale.net>
|
||||
Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru>
|
||||
Andrew Bettison <andrewb@zip.com.au>
|
||||
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;
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,186 @@
|
||||
From b47ef629459076a5ccb3d0caf83ccfbb8ba0571b Mon Sep 17 00:00:00 2001
|
||||
From: Marcus Ramberg <marcus@means.no>
|
||||
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
|
||||
@@ -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 { };
|
||||
};
|
||||
|
||||
@@ -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
|
||||
@@ -11,6 +11,7 @@ buildPerlModule {
|
||||
|
||||
postPatch = ''
|
||||
cp -R tests/tap/perl/Test perl/t/lib
|
||||
rm perl/t/backend/options.t
|
||||
cd perl
|
||||
'';
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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 { };
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = ''
|
||||
|
||||
@@ -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 [
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
woff2,
|
||||
xxHash,
|
||||
makeWrapper,
|
||||
shortenPerlShebang,
|
||||
useFixedHashes,
|
||||
asymptote,
|
||||
biber-ms,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+211
-318
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user