Upgrade to 0.280238 as provided in perl-5.37.11

This commit is contained in:
Jitka Plesnikova 2023-05-16 17:09:22 +02:00
parent a11750e58f
commit 1a50e94ea9
2 changed files with 406 additions and 10 deletions

View File

@ -0,0 +1,381 @@
From fd23ba47d6ac8702c4bb498c9cbc3f8c583bab8e Mon Sep 17 00:00:00 2001
From: Jitka Plesnikova <jplesnik@redhat.com>
Date: Tue, 16 May 2023 16:45:36 +0200
Subject: [PATCH] Upgrade to 0.280238
---
Changes | 14 +++++++++
LICENSE | 6 ++--
Makefile.PL | 4 +--
lib/ExtUtils/CBuilder.pm | 3 +-
lib/ExtUtils/CBuilder/Base.pm | 19 ++++++++++--
lib/ExtUtils/CBuilder/Platform/Unix.pm | 3 +-
lib/ExtUtils/CBuilder/Platform/VMS.pm | 2 +-
lib/ExtUtils/CBuilder/Platform/Windows.pm | 31 ++++++++++++++++---
lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm | 2 +-
lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm | 2 +-
.../CBuilder/Platform/Windows/MSVC.pm | 2 +-
lib/ExtUtils/CBuilder/Platform/aix.pm | 2 +-
lib/ExtUtils/CBuilder/Platform/android.pm | 2 +-
lib/ExtUtils/CBuilder/Platform/cygwin.pm | 2 +-
lib/ExtUtils/CBuilder/Platform/darwin.pm | 19 +++++++++++-
lib/ExtUtils/CBuilder/Platform/dec_osf.pm | 2 +-
lib/ExtUtils/CBuilder/Platform/os2.pm | 2 +-
17 files changed, 90 insertions(+), 27 deletions(-)
diff --git a/Changes b/Changes
index 2ee209a..5c5c7ce 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,19 @@
Revision history for Perl extension ExtUtils::CBuilder.
+0.280238
+
+ Fix:
+
+ - use -isyswithroot option for the CORE directory for the system perl on darwin.
+ The compiler would fail to find EXTERN.h with -I.
+ Came up while working on a fix for the similar issue in
+ https://github.com/Perl/perl5/issues/20362
+
+0.280237 - 2022-05-09
+
+ - when not set to quiet, print commands being run in a usable form.
+ https://github.com/Perl/perl5/pull/19701
+
0.280236 - 2021-02-12
Fix:
diff --git a/LICENSE b/LICENSE
index 1102da8..1bffb03 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-This software is copyright (c) 2021 by Ken Williams.
+This software is copyright (c) 2020 by Ken Williams.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@ b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
-This software is Copyright (c) 2021 by Ken Williams.
+This software is Copyright (c) 2020 by Ken Williams.
This is free software, licensed under:
@@ -272,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 ---
-This software is Copyright (c) 2021 by Ken Williams.
+This software is Copyright (c) 2020 by Ken Williams.
This is free software, licensed under:
diff --git a/Makefile.PL b/Makefile.PL
index 4177e21..5b7dd5d 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.017.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.015.
use strict;
use warnings;
@@ -29,7 +29,7 @@ my %WriteMakefileArgs = (
"TEST_REQUIRES" => {
"Test::More" => "0.47"
},
- "VERSION" => "0.280236",
+ "VERSION" => "0.280235",
"test" => {
"TESTS" => "t/*.t"
}
diff --git a/lib/ExtUtils/CBuilder.pm b/lib/ExtUtils/CBuilder.pm
index 8b4fc4c..705d30a 100644
--- a/lib/ExtUtils/CBuilder.pm
+++ b/lib/ExtUtils/CBuilder.pm
@@ -1,5 +1,4 @@
package ExtUtils::CBuilder;
-our $VERSION = '0.280236'; # VERSION
use File::Spec ();
use File::Path ();
@@ -8,7 +7,7 @@ use Perl::OSType qw/os_type/;
use warnings;
use strict;
-
+our $VERSION = '0.280238'; # VERSION
our @ISA;
# We only use this once - don't waste a symbol table entry on it.
diff --git a/lib/ExtUtils/CBuilder/Base.pm b/lib/ExtUtils/CBuilder/Base.pm
index e42226f..0494caf 100644
--- a/lib/ExtUtils/CBuilder/Base.pm
+++ b/lib/ExtUtils/CBuilder/Base.pm
@@ -9,8 +9,7 @@ use Text::ParseWords;
use IPC::Cmd qw(can_run);
use File::Temp qw(tempfile);
-our $VERSION = '0.280236'; # VERSION
-
+our $VERSION = '0.280238'; # VERSION
# More details about C/C++ compilers:
# http://developers.sun.com/sunstudio/documentation/product/compiler.jsp
@@ -336,10 +335,24 @@ sub _do_link {
return wantarray ? ($out, @temp_files) : $out;
}
+sub quote_literal {
+ my ($self, $string) = @_;
+
+ if (length $string && $string !~ /[^a-zA-Z0-9,._+@%\/-]/) {
+ return $string;
+ }
+
+ $string =~ s{'}{'\\''}g;
+
+ return "'$string'";
+}
sub do_system {
my ($self, @cmd) = @_;
- print "@cmd\n" if !$self->{quiet};
+ if (!$self->{quiet}) {
+ my $full = join ' ', map $self->quote_literal($_), @cmd;
+ print $full . "\n";
+ }
return !system(@cmd);
}
diff --git a/lib/ExtUtils/CBuilder/Platform/Unix.pm b/lib/ExtUtils/CBuilder/Platform/Unix.pm
index 974903d..2eaf591 100644
--- a/lib/ExtUtils/CBuilder/Platform/Unix.pm
+++ b/lib/ExtUtils/CBuilder/Platform/Unix.pm
@@ -4,8 +4,7 @@ use warnings;
use strict;
use ExtUtils::CBuilder::Base;
-our $VERSION = '0.280236'; # VERSION
-
+our $VERSION = '0.280238'; # VERSION
our @ISA = qw(ExtUtils::CBuilder::Base);
sub link_executable {
diff --git a/lib/ExtUtils/CBuilder/Platform/VMS.pm b/lib/ExtUtils/CBuilder/Platform/VMS.pm
index d9b1fbd..d09a608 100644
--- a/lib/ExtUtils/CBuilder/Platform/VMS.pm
+++ b/lib/ExtUtils/CBuilder/Platform/VMS.pm
@@ -4,7 +4,7 @@ use warnings;
use strict;
use ExtUtils::CBuilder::Base;
-our $VERSION = '0.280236'; # VERSION
+our $VERSION = '0.280238'; # VERSION
our @ISA = qw(ExtUtils::CBuilder::Base);
use File::Spec::Functions qw(catfile catdir);
diff --git a/lib/ExtUtils/CBuilder/Platform/Windows.pm b/lib/ExtUtils/CBuilder/Platform/Windows.pm
index b81384f..2fffc83 100644
--- a/lib/ExtUtils/CBuilder/Platform/Windows.pm
+++ b/lib/ExtUtils/CBuilder/Platform/Windows.pm
@@ -8,7 +8,7 @@ use File::Spec;
use ExtUtils::CBuilder::Base;
use IO::File;
-our $VERSION = '0.280236'; # VERSION
+our $VERSION = '0.280238'; # VERSION
our @ISA = qw(ExtUtils::CBuilder::Base);
=begin comment
@@ -51,6 +51,22 @@ sub _compiler_type {
: 'GCC');
}
+# native quoting, not shell quoting
+sub quote_literal {
+ my ($self, $string) = @_;
+
+ # some of these characters don't need to be quoted for "native" quoting, but
+ # quote them anyway so they are more likely to make it through cmd.exe
+ if (length $string && $string !~ /[ \t\n\x0b"|<>%]/) {
+ return $string;
+ }
+
+ $string =~ s{(\\*)(?="|\z)}{$1$1}g;
+ $string =~ s{"}{\\"}g;
+
+ return qq{"$string"};
+}
+
sub split_like_shell {
# Since Windows will pass the whole command string (not an argument
# array) to the target program and make the program parse it itself,
@@ -65,10 +81,15 @@ sub split_like_shell {
sub do_system {
# See above
my $self = shift;
- my $cmd = join(" ",
- grep length,
- map {$a=$_;$a=~s/\t/ /g;$a=~s/^\s+|\s+$//;$a}
- grep defined, @_);
+ my $cmd = join ' ',
+ grep length,
+ map {$a=$_;$a=~s/\t/ /g;$a=~s/^\s+|\s+$//;$a}
+ grep defined, @_;
+
+ if (!$self->{quiet}) {
+ print $cmd . "\n";
+ }
+ local $self->{quiet} = 1;
return $self->SUPER::do_system($cmd);
}
diff --git a/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm b/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm
index 657241a..6ab48ba 100644
--- a/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm
+++ b/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm
@@ -1,6 +1,6 @@
package ExtUtils::CBuilder::Platform::Windows::BCC;
-our $VERSION = '0.280236'; # VERSION
+our $VERSION = '0.280238'; # VERSION
use strict;
use warnings;
diff --git a/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm b/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm
index 52664c7..c3eb7a0 100644
--- a/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm
+++ b/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm
@@ -1,6 +1,6 @@
package ExtUtils::CBuilder::Platform::Windows::GCC;
-our $VERSION = '0.280236'; # VERSION
+our $VERSION = '0.280238'; # VERSION
use warnings;
use strict;
diff --git a/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm b/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm
index 6cbcc9b..ce5e99f 100644
--- a/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm
+++ b/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm
@@ -1,6 +1,6 @@
package ExtUtils::CBuilder::Platform::Windows::MSVC;
-our $VERSION = '0.280236'; # VERSION
+our $VERSION = '0.280238'; # VERSION
use warnings;
use strict;
diff --git a/lib/ExtUtils/CBuilder/Platform/aix.pm b/lib/ExtUtils/CBuilder/Platform/aix.pm
index 2ef8b38..35de7fa 100644
--- a/lib/ExtUtils/CBuilder/Platform/aix.pm
+++ b/lib/ExtUtils/CBuilder/Platform/aix.pm
@@ -5,7 +5,7 @@ use strict;
use ExtUtils::CBuilder::Platform::Unix;
use File::Spec;
-our $VERSION = '0.280236'; # VERSION
+our $VERSION = '0.280238'; # VERSION
our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
sub need_prelink { 1 }
diff --git a/lib/ExtUtils/CBuilder/Platform/android.pm b/lib/ExtUtils/CBuilder/Platform/android.pm
index 8500ab9..44ad646 100644
--- a/lib/ExtUtils/CBuilder/Platform/android.pm
+++ b/lib/ExtUtils/CBuilder/Platform/android.pm
@@ -6,7 +6,7 @@ use File::Spec;
use ExtUtils::CBuilder::Platform::Unix;
use Config;
-our $VERSION = '0.280236'; # VERSION
+our $VERSION = '0.280238'; # VERSION
our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
# The Android linker will not recognize symbols from
diff --git a/lib/ExtUtils/CBuilder/Platform/cygwin.pm b/lib/ExtUtils/CBuilder/Platform/cygwin.pm
index 3c8beac..14d814c 100644
--- a/lib/ExtUtils/CBuilder/Platform/cygwin.pm
+++ b/lib/ExtUtils/CBuilder/Platform/cygwin.pm
@@ -5,7 +5,7 @@ use strict;
use File::Spec;
use ExtUtils::CBuilder::Platform::Unix;
-our $VERSION = '0.280236'; # VERSION
+our $VERSION = '0.280238'; # VERSION
our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
# TODO: If a specific exe_file name is requested, if the exe created
diff --git a/lib/ExtUtils/CBuilder/Platform/darwin.pm b/lib/ExtUtils/CBuilder/Platform/darwin.pm
index e050e32..7e8ae7a 100644
--- a/lib/ExtUtils/CBuilder/Platform/darwin.pm
+++ b/lib/ExtUtils/CBuilder/Platform/darwin.pm
@@ -3,10 +3,14 @@ package ExtUtils::CBuilder::Platform::darwin;
use warnings;
use strict;
use ExtUtils::CBuilder::Platform::Unix;
+use Config;
-our $VERSION = '0.280236'; # VERSION
+our $VERSION = '0.280238'; # VERSION
our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
+my ($osver) = split /\./, $Config{osvers};
+my $apple_cor = $^X eq "/usr/bin/perl" && $osver >= 18;
+
sub compile {
my $self = shift;
my $cf = $self->{config};
@@ -22,5 +26,18 @@ sub compile {
$self->SUPER::compile(@_);
}
+sub arg_include_dirs {
+ my $self = shift;
+
+ if ($apple_cor) {
+ my $perl_inc = $self->perl_inc;
+ return map {
+ $_ eq $perl_inc ? ("-iwithsysroot", $_ ) : "-I$_"
+ } @_;
+ }
+ else {
+ return $self->SUPER::arg_include_dirs(@_);
+ }
+}
1;
diff --git a/lib/ExtUtils/CBuilder/Platform/dec_osf.pm b/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
index 971cf93..6b97095 100644
--- a/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
+++ b/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
@@ -5,7 +5,7 @@ use strict;
use ExtUtils::CBuilder::Platform::Unix;
use File::Spec;
-our $VERSION = '0.280236'; # VERSION
+our $VERSION = '0.280238'; # VERSION
our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
sub link_executable {
diff --git a/lib/ExtUtils/CBuilder/Platform/os2.pm b/lib/ExtUtils/CBuilder/Platform/os2.pm
index 58d316b..a7d11dc 100644
--- a/lib/ExtUtils/CBuilder/Platform/os2.pm
+++ b/lib/ExtUtils/CBuilder/Platform/os2.pm
@@ -4,7 +4,7 @@ use warnings;
use strict;
use ExtUtils::CBuilder::Platform::Unix;
-our $VERSION = '0.280236'; # VERSION
+our $VERSION = '0.280238'; # VERSION
our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
sub need_prelink { 1 }
--
2.40.1

View File

@ -1,15 +1,19 @@
%global base_version 0.280236
Name: perl-ExtUtils-CBuilder
# Compete with perl.spec
Epoch: 1
# Mimic perl.spec
Version: 0.280236
Release: 491%{?dist}
Version: 0.280238
Release: 1%{?dist}
Summary: Compile and link C code for Perl modules
License: GPL-1.0-or-later OR Artistic-1.0-Perl
URL: https://metacpan.org/release/ExtUtils-CBuilder
Source0: https://cpan.metacpan.org/authors/id/A/AM/AMBS/ExtUtils-CBuilder-%{version}.tar.gz
Source0: https://cpan.metacpan.org/authors/id/A/AM/AMBS/ExtUtils-CBuilder-%{base_version}.tar.gz
# Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048
Patch0: ExtUtils-CBuilder-0.280230-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch
# Unbundled from perl 5.37.11
Patch1: ExtUtils-CBuilder-0.280236-Upgrade-to-0.280238.patch
BuildArch: noarch
BuildRequires: make
BuildRequires: perl-generators
@ -69,12 +73,13 @@ Tests from %{name}-%{version}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep
%setup -q -n ExtUtils-CBuilder-%{version}
%patch0 -p1
%setup -q -n ExtUtils-CBuilder-%{base_version}
%patch -P0 -p1
%patch -P1 -p1
# Normalize shebangs
for F in t/*.t; do
perl -MConfig -i -pe 's/\A#!.*perl/$Config{startperl}/' "$F"
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
chmod +x "$F"
done
@ -84,18 +89,25 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%install
%{make_install}
%{_fixperms} %{buildroot}/*
# Install tests
mkdir -p %{buildroot}/%{_libexecdir}/%{name}
cp -a t %{buildroot}/%{_libexecdir}/%{name}
cat > %{buildroot}/%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/sh
cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
#!/bin/bash
set -e
# Tests write into temporary files/directories. The solution is to copy the
# tests into a writable directory and execute them from there.
DIR=$(mktemp -d)
pushd "$DIR"
cp -a %{_libexecdir}/%{name}/* ./
prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
popd
rm -rf "$DIR"
EOF
chmod +x %{buildroot}/%{_libexecdir}/%{name}/test
%{_fixperms} %{buildroot}/*
%check
make test
@ -109,6 +121,9 @@ make test
%{_libexecdir}/%{name}
%changelog
* Tue May 16 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1:0.280238-1
- Upgrade to 0.280238 as provided in perl-5.37.11
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.280236-491
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild