Compare commits

..

No commits in common. 'cs10' and 'c9' have entirely different histories.
cs10 ... c9

2
.gitignore vendored

@ -1 +1 @@
SOURCES/Module-Build-0.4234.tar.gz SOURCES/Module-Build-0.4231.tar.gz

@ -1 +1 @@
76914d0e46eec1d00cbd982a2aa01f2742458997 SOURCES/Module-Build-0.4234.tar.gz 7ab592964c75c59603f2ea0009c785b8f16a61e8 SOURCES/Module-Build-0.4231.tar.gz

@ -0,0 +1,145 @@
From 6b096ea5670ed291abac632b296222b56d9fadb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Thu, 1 Mar 2018 14:44:40 +0100
Subject: [PATCH] Do not need a compiler if c_source is an empty list
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
c_source used to be string, then it allowed a reference to an array.
But in case the array was empty, auto_require() still enabled
needs_compiler property and thus implied probing a compiler and
a failure if none was available.
Minilla generates these Build.PLs for pure-Perl distributions. See
KAZUHO/Server-Starter-0.34.
This patch makes Module::Build not require C compiler for
c_source = [].
Petr Písař: Ported to 0.4224.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
lib/Module/Build/API.pod | 8 ++++----
lib/Module/Build/Base.pm | 6 +++++-
t/properties/needs_compiler.t | 46 ++++++++++++++++++++++++++++++++++++++++---
3 files changed, 52 insertions(+), 8 deletions(-)
diff --git a/lib/Module/Build/API.pod b/lib/Module/Build/API.pod
index cd2021a..c9be539 100644
--- a/lib/Module/Build/API.pod
+++ b/lib/Module/Build/API.pod
@@ -209,10 +209,10 @@ created by Module::Build.
[version 0.04]
-An optional C<c_source> argument specifies a directory which contains
-C source files that the rest of the build may depend on. Any C<.c>
-files in the directory will be compiled to object files. The
-directory will be added to the search path during the compilation and
+An optional C<c_source> argument specifies a directory or a reference to array
+of directories which contain C source files that the rest of the build may
+depend on. Any C<.c> files in the directory will be compiled to object files.
+The directory will be added to the search path during the compilation and
linking phases of any C or XS files.
[version 0.3604]
diff --git a/lib/Module/Build/Base.pm b/lib/Module/Build/Base.pm
index 984810a..a29c664 100644
--- a/lib/Module/Build/Base.pm
+++ b/lib/Module/Build/Base.pm
@@ -1520,7 +1520,11 @@ sub auto_require {
if ( $self->pureperl_only && $self->allow_pureperl ) {
$self->needs_compiler( 0 );
} else {
- $self->needs_compiler( keys %$xs_files || defined $self->c_source );
+ $self->needs_compiler( keys %$xs_files ||
+ ( defined $self->c_source &&
+ ( ref($self->c_source) ne 'ARRAY' || @{$self->c_source} )
+ )
+ );
}
}
if ($self->needs_compiler) {
diff --git a/t/properties/needs_compiler.t b/t/properties/needs_compiler.t
index f616dfc..c76d38f 100644
--- a/t/properties/needs_compiler.t
+++ b/t/properties/needs_compiler.t
@@ -5,7 +5,7 @@ use lib 't/lib';
use MBTest;
use DistGen;
-plan tests => 19;
+plan tests => 27;
# Ensure any Module::Build modules are loaded from correct directory
blib_load('Module::Build');
@@ -24,7 +24,7 @@ ok( ! exists $mb->{properties}{build_requires}{'ExtUtils::CBuilder'},
);
#--------------------------------------------------------------------------#
-# try with c_source
+# try with c_source as a string
#--------------------------------------------------------------------------#
$dist->change_build_pl({
module_name => $dist->name,
@@ -34,7 +34,7 @@ $dist->change_build_pl({
$dist->regen;
stderr_of(sub {
ok( $mb = $dist->new_from_context,
- "Build.PL with c_source"
+ "Build.PL with string c_source"
);
});
is( $mb->c_source, 'src', "c_source is set" );
@@ -44,6 +44,46 @@ ok( exists $mb->{properties}{build_requires}{'ExtUtils::CBuilder'},
);
#--------------------------------------------------------------------------#
+# try with c_source as an array
+#--------------------------------------------------------------------------#
+$dist->change_build_pl({
+ module_name => $dist->name,
+ license => 'perl',
+ c_source => ['src'],
+});
+$dist->regen;
+stderr_of(sub {
+ ok( $mb = $dist->new_from_context,
+ "Build.PL with non-empty array c_source"
+ );
+});
+is_deeply( $mb->c_source, ['src'], "c_source is set" );
+ok( $mb->needs_compiler, "needs_compiler is true" );
+ok( exists $mb->{properties}{build_requires}{'ExtUtils::CBuilder'},
+ "ExtUtils::CBuilder was added to build_requires"
+);
+
+#--------------------------------------------------------------------------#
+# try with c_source as an empty array
+#--------------------------------------------------------------------------#
+$dist->change_build_pl({
+ module_name => $dist->name,
+ license => 'perl',
+ c_source => [],
+});
+$dist->regen;
+stderr_of(sub {
+ ok( $mb = $dist->new_from_context,
+ "Build.PL with empty array c_source"
+ );
+});
+is_deeply( $mb->c_source, [], "c_source is set" );
+ok( ! $mb->needs_compiler, "needs_compiler is false" );
+ok( ! exists $mb->{properties}{build_requires}{'ExtUtils::CBuilder'},
+ "ExtUtils::CBuilder is not in build_requires"
+);
+
+#--------------------------------------------------------------------------#
# try with xs files
#--------------------------------------------------------------------------#
$dist = DistGen->new(dir => 'MBTest', xs => 1);
--
2.13.6

@ -1,39 +0,0 @@
From 043add527dd6bc05d5ef5750839ab21c2fdab9e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Mon, 28 Mar 2022 11:18:38 +0200
Subject: [PATCH] Do not die on missing ExtUtils::CBuilder in have_c_compiler()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In Fedora, ExtUtils::CBuilder is optional to allow installing perl
without gcc (bug #1547165). Module::Build::have_c_compiler() uses
ExtUtils::CBuilder to detect a presence of a C compiler. If
ExtUtils::CBuilder was not installed, have_c_compiler() died instead
of returning a false value.
This error manifested in perl-Alien-Base-ModuleBuild tests. This patch
changes have_c_compiler() to return true if ExtUtils::CBuilder is not
available.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
lib/Module/Build/Base.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Module/Build/Base.pm b/lib/Module/Build/Base.pm
index 1352fcf..4e0f843 100644
--- a/lib/Module/Build/Base.pm
+++ b/lib/Module/Build/Base.pm
@@ -5315,7 +5315,7 @@ sub have_c_compiler {
return $p->{_have_c_compiler} if defined $p->{_have_c_compiler};
$self->log_verbose("Checking if compiler tools configured... ");
- my $b = $self->cbuilder;
+ my $b = eval { $self->cbuilder };
my $have = $b && eval { $b->have_compiler };
$self->log_verbose($have ? "ok.\n" : "failed.\n");
return $p->{_have_c_compiler} = $have;
--
2.34.1

@ -1,5 +1,5 @@
%global cpan_version_major 0.42 %global cpan_version_major 0.42
%global cpan_version_minor 34 %global cpan_version_minor 31
%global cpan_version %{cpan_version_major}%{?cpan_version_minor} %global cpan_version %{cpan_version_major}%{?cpan_version_minor}
# Run optional tests # Run optional tests
@ -12,18 +12,20 @@
Name: perl-Module-Build Name: perl-Module-Build
Epoch: 2 Epoch: 2
Version: %{cpan_version_major}%{?cpan_version_minor:.%cpan_version_minor} Version: %{cpan_version_major}%{?cpan_version_minor:.%cpan_version_minor}
Release: 7%{?dist} Release: 9%{?dist}
Summary: Build and install Perl modules Summary: Build and install Perl modules
License: GPL-1.0-or-later OR Artistic-1.0-Perl License: GPL+ or Artistic
URL: https://metacpan.org/release/Module-Build URL: https://metacpan.org/release/Module-Build
Source0: https://cpan.metacpan.org/modules/by-module/Module/Module-Build-%{cpan_version}.tar.gz Source0: https://cpan.metacpan.org/authors/id/L/LE/LEONT/Module-Build-%{cpan_version}.tar.gz
# Handle missing ExtUtils::CBuilder as a missing compiler, bug #1547165. # Do not require a compiler if c_source is an empty list, bug #1547165,
Patch1: Module-Build-0.4231-Do-not-die-on-missing-ExtUtils-CBuilder-in-have_c_co.patch # CPAN RT#124625,
# <https://lists.fedoraproject.org/archives/list/perl-devel@lists.fedoraproject.org/message/UWQ6SDRKNTX6SM6RBJ35CDBGRCV3ZSKP/>
Patch0: Module-Build-0.4224-Do-not-need-a-compiler-if-c_source-is-an-empty-list.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: coreutils BuildRequires: coreutils
BuildRequires: perl-interpreter
BuildRequires: perl-devel BuildRequires: perl-devel
BuildRequires: perl-generators BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(Archive::Tar) BuildRequires: perl(Archive::Tar)
BuildRequires: perl(AutoSplit) BuildRequires: perl(AutoSplit)
BuildRequires: perl(base) BuildRequires: perl(base)
@ -81,6 +83,7 @@ BuildRequires: perl(utf8)
BuildRequires: perl(vars) BuildRequires: perl(vars)
BuildRequires: perl(version) >= 0.87 BuildRequires: perl(version) >= 0.87
BuildRequires: perl(warnings) BuildRequires: perl(warnings)
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
Requires: perl(CPAN::Meta) >= 2.142060 Requires: perl(CPAN::Meta) >= 2.142060
Requires: perl(CPAN::Meta::Converter) >= 2.141170 Requires: perl(CPAN::Meta::Converter) >= 2.141170
Requires: perl(CPAN::Meta::Merge) Requires: perl(CPAN::Meta::Merge)
@ -121,14 +124,6 @@ Requires: perl(Pod::Text)
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\((ExtUtils::Install|File::Spec|Module::Build|Module::Metadata|Perl::OSType)\\)$ %global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\((ExtUtils::Install|File::Spec|Module::Build|Module::Metadata|Perl::OSType)\\)$
%global __requires_exclude %__requires_exclude|^perl\\(CPAN::Meta::YAML\\) >= 0.002$ %global __requires_exclude %__requires_exclude|^perl\\(CPAN::Meta::YAML\\) >= 0.002$
# Filter modules bundled for tests
%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
%global __requires_exclude %{__requires_exclude}|^perl\\(DistGen\\)
%global __requires_exclude %{__requires_exclude}|^perl\\(MBTest\\)
%global __requires_exclude %{__requires_exclude}|^perl\\(Simple\\)
%global __requires_exclude %{__requires_exclude}|^perl\\(Software::License.*\\)
%global __requires_exclude %{__requires_exclude}|^perl\\(Tie::CPHash\\)
%description %description
Module::Build is a system for building, testing, and installing Perl Module::Build is a system for building, testing, and installing Perl
modules. It is meant to be an alternative to ExtUtils::MakeMaker. modules. It is meant to be an alternative to ExtUtils::MakeMaker.
@ -140,73 +135,17 @@ so even platforms like MacOS (traditional) can use it fairly easily. Its
only prerequisites are modules that are included with perl 5.6.0, and it only prerequisites are modules that are included with perl 5.6.0, and it
works fine on perl 5.005 if you can install a few additional modules. works fine on perl 5.005 if you can install a few additional modules.
%package tests
Summary: Tests for %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
# Optional tests:
%if !%{defined perl_bootstrap}
%if %{with perl_Module_Build_enables_optional_test}
Requires: perl(Archive::Zip)
Requires: perl(File::ShareDir) >= 1.00
Requires: perl(PAR::Dist)
%endif
%endif
Requires: perl(TAP::Harness)
Requires: perl(TAP::Harness::Env)
Requires: perl(Text::ParseWords)
Requires: perl(version) >= 0.87
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep %prep
%autosetup -p1 -n Module-Build-%{cpan_version} %setup -q -n Module-Build-%{cpan_version}
%patch0 -p1
# Help generators to recognize Perl scripts
for F in `find t -name *.t -o -name *.pl`; do
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
chmod +x "$F"
done
%build %build
perl Build.PL --installdirs=vendor perl Build.PL installdirs=vendor
./Build ./Build
%install %install
./Build install --destdir=%{buildroot} --create_packlist=0 ./Build install destdir=%{buildroot} create_packlist=0
%{_fixperms} -c %{buildroot} %{_fixperms} %{buildroot}/*
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t _build %{buildroot}%{_libexecdir}/%{name}
perl -pi -e 's#%{buildroot}##' %{buildroot}%{_libexecdir}/%{name}/_build/runtime_params
rm %{buildroot}%{_libexecdir}/%{name}/_build/magicnum
mkdir -p %{buildroot}%{_libexecdir}/%{name}/bin
ln -s %{_bindir}/config_data %{buildroot}%{_libexecdir}/%{name}/bin
# Requires copy of modules in test directory
rm %{buildroot}%{_libexecdir}/%{name}/t/00-compile.t
# Remove using of blib
for F in `find %{buildroot}%{_libexecdir}/%{name}/t -name *.t -o -name *.pm`; do
perl -pi -e "s/^\s*blib_load\('([^']+)'\);/use \1;/" $F
perl -pi -e "s/^blib_load '([^']+)';/use \1;/" $F
done
perl -pi -e "s{'-Mblib', }{'-I'.\\N{U+0024}tmp.'/Simple/blib/lib', '-I'.\\N{U+0024}tmp.'/Simple/blib/arch', }x" \
%{buildroot}%{_libexecdir}/%{name}/t/xs.t
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/bash
set -e
# Some tests write into temporary files/directories. The easiest 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
%check %check
rm t/signature.t rm t/signature.t
@ -214,70 +153,19 @@ LANG=C TEST_SIGNATURE=1 MB_TEST_EXPERIMENTAL=1 ./Build test
%files %files
%license LICENSE %license LICENSE
%doc Changes contrib/ README %doc Changes contrib README
%{_bindir}/config_data %{_bindir}/config_data
%{perl_vendorlib}/Module/ %{perl_vendorlib}/*
%{_mandir}/man1/config_data.1* %{_mandir}/man1/*
%{_mandir}/man3/Module::Build*.3* %{_mandir}/man3/*
%files tests
%{_libexecdir}/%{name}
%changelog %changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 2:0.42.34-7 * Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2:0.42.31-9
- Bump release for October 2024 mass rebuild: - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Resolves: RHEL-64018 Related: rhbz#1991688
* Thu Jul 18 2024 Jitka Plesnikova <jplesnik@redhat.com> - 2:0.42.34-6
- Package tests
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 2:0.42.34-5
- Bump release for June 2024 mass rebuild
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2:0.42.34-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2:0.42.34-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2:0.42.34-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Apr 28 2023 Paul Howarth <paul@city-fan.org> - 2:0.42.34-1
- 0.4234 bump
- Use author-independent source URL
- Fix permissions verbosely
- Make %%files list more explicit
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2:0.42.32-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Dec 16 2022 Jitka Plesnikova <jplesnik@redhat.com> -2:0.42.32-1
- 0.4232 bump
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2:0.42.31-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Jun 03 2022 Jitka Plesnikova <jplesnik@redhat.com> - 2:0.42.31-14
- Perl 5.36 re-rebuild of bootstrapped packages
* Tue May 31 2022 Jitka Plesnikova <jplesnik@redhat.com> - 2:0.42.31-13
- Perl 5.36 rebuild
* Mon Mar 28 2022 Petr Pisar <ppisar@redhat.com> - 2:0.42.31-12
- Handle missing ExtUtils::CBuilder as a missing compiler (bug #1547165)
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2:0.42.31-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2:0.42.31-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon May 24 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2:0.42.31-9
- Perl 5.34 re-rebuild of bootstrapped packages
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2:0.42.31-8 * Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2:0.42.31-8
- Perl 5.34 rebuild - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2:0.42.31-7 * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2:0.42.31-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

Loading…
Cancel
Save