!1 perl-ExtUtils-CBuilder package init

Merge pull request !1 from 严志华/master
This commit is contained in:
openeuler-ci-bot 2019-12-09 13:58:45 +08:00 committed by Gitee
commit 9572cbae13
3 changed files with 125 additions and 0 deletions

View File

@ -0,0 +1,64 @@
From f55b546a261651ad76a2a339768a599a4d84b4f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 3 Jul 2013 11:01:02 +0200
Subject: [PATCH] Link XS modules to libperl.so with EU::CBuilder on Linux
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
<https://bugzilla.redhat.com/show_bug.cgi?id=960048>
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=327585#50>
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
MANIFEST | 1 +
lib/ExtUtils/CBuilder/Platform/linux.pm | 25 +++++++++++++++++++++++++
2 files changed, 26 insertions(+)
create mode 100644 lib/ExtUtils/CBuilder/Platform/linux.pm
diff --git a/MANIFEST b/MANIFEST
index fdc8bd9..a7de63a 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -25,6 +25,7 @@ lib/ExtUtils/CBuilder/Platform/android.pm
lib/ExtUtils/CBuilder/Platform/cygwin.pm
lib/ExtUtils/CBuilder/Platform/darwin.pm
lib/ExtUtils/CBuilder/Platform/dec_osf.pm
+lib/ExtUtils/CBuilder/Platform/linux.pm
lib/ExtUtils/CBuilder/Platform/os2.pm
t/00-have-compiler.t
t/01-basic.t
diff --git a/lib/ExtUtils/CBuilder/Platform/linux.pm b/lib/ExtUtils/CBuilder/Platform/linux.pm
new file mode 100644
index 0000000..823f852
--- /dev/null
+++ b/lib/ExtUtils/CBuilder/Platform/linux.pm
@@ -0,0 +1,25 @@
+package ExtUtils::CBuilder::Platform::linux;
+
+use strict;
+use ExtUtils::CBuilder::Platform::Unix;
+use File::Spec;
+
+our $VERSION = '0.280230';
+our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
+
+sub link {
+ my ($self, %args) = @_;
+ my $cf = $self->{config};
+
+ # Link XS modules to libperl.so explicitly because multiple
+ # dlopen(, RTLD_LOCAL) hides libperl symbols from XS module.
+ local $cf->{lddlflags} = $cf->{lddlflags};
+ if ($ENV{PERL_CORE}) {
+ $cf->{lddlflags} .= ' -L' . $self->perl_inc();
+ }
+ $cf->{lddlflags} .= ' -lperl';
+
+ return $self->SUPER::link(%args);
+}
+
+1;
--
2.13.6

Binary file not shown.

View File

@ -0,0 +1,61 @@
Name: perl-ExtUtils-CBuilder
Version: 0.280230
Release: 418
Summary: Build the C portions of Perl modules
License: GPL+ or Artistic
URL: https://metacpan.org/release/ExtUtils-CBuilder
Source0: https://cpan.metacpan.org/authors/id/A/AM/AMBS/ExtUtils-CBuilder-%{version}.tar.gz
Patch0001: ExtUtils-CBuilder-0.280230-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch
BuildArch: noarch
Epoch: 1
BuildRequires: make perl-generators perl-interpreter perl(ExtUtils::MakeMaker) >= 6.76
BuildRequires: perl(strict) perl(warnings) perl(Config) perl(Cwd) perl(DynaLoader)
BuildRequires: perl(File::Basename) perl(File::Path) perl(File::Spec) >= 3.13
BuildRequires: perl(File::Temp) perl(IPC::Cmd) perl(Perl::OSType) >= 1
BuildRequires: perl(Text::ParseWords) perl-devel gcc-c++ perl(Test::More) >= 0.47
Requires: gcc-c++ perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
Requires: perl(DynaLoader) perl(ExtUtils::Mksymlists) >= 6.30 perl(File::Spec) >= 3.13
Requires: perl(Perl::OSType) >= 1 perl-devel
%{?perl_default_filter}
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\((File::Spec|Perl::OSType)\\)$
%description
This module can build the C portions of Perl modules by invoking the
appropriate compilers and linkers in a cross-platform manner. It was
motivated by the 'Module::Build' project, but may be useful for other
purposes as well. However, it is _not_ intended as a general cross-platform
interface to all your C building needs. That would have been a much more
ambitious goal!
%package help
Summary: Help documents for perl-ExtUtils-CBuilder
%description help
This package provides man pages and other related help documents for perl-ExtUtils-CBuilder.
%prep
%autosetup -n ExtUtils-CBuilder-%{version} -p1
%build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1
%make_build
%install
make pure_install DESTDIR=$RPM_BUILD_ROOT
%{_fixperms} $RPM_BUILD_ROOT/*
%check
make test
%files
%license LICENSE
%{perl_vendorlib}/*
%files help
%doc Changes CONTRIBUTING README README.mkdn
%{_mandir}/man3/*
%changelog
* Wed Nov 27 2019 yanzhihua <yanzhihua4@huawei.com> - 1:0.280230-418
- Package init