ppisar pushed to perl-Net-LibIDN (master). "Use distribution CFLAGS for Makefile.PL's tests"
notifications at fedoraproject.org
notifications at fedoraproject.org
Tue Jul 14 13:23:07 UTC 2015
From c158460230cb483d33c837ad9482ab33128fa585 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
Date: Tue, 14 Jul 2015 15:21:13 +0200
Subject: Use distribution CFLAGS for Makefile.PL's tests
diff --git a/Net-LibIDN-0.12-Respect-Config-s-cc-ccflags-and-ldflags.patch b/Net-LibIDN-0.12-Respect-Config-s-cc-ccflags-and-ldflags.patch
new file mode 100644
index 0000000..a1b6350
--- /dev/null
+++ b/Net-LibIDN-0.12-Respect-Config-s-cc-ccflags-and-ldflags.patch
@@ -0,0 +1,93 @@
+From 3bd67bf63ee68c88cc05a66607a79c5cd314a6d2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Tue, 14 Jul 2015 14:25:57 +0200
+Subject: [PATCH] Respect Config's cc ccflags and ldflags
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The ExtUils::MakeMaker expects LIBS contains only libs and INC contain
+only include paths. Thus you cannot put ldflags od ccflags there. They
+will be injected later when generating the Makefile.
+
+However to use the flags when checking for libidn, you have to use
+apply them manually only for the manual check.
+
+This patch adds cc and ccflags into consideration as some systems
+needs them when using cusotm ldflags.
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+---
+ Makefile.PL | 31 +++++++++++++++++++------------
+ 1 file changed, 19 insertions(+), 12 deletions(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index 6709fe1..47f63db 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -47,23 +47,17 @@ sub InitMakeParams
+ "disable-tld" => \$disable_tld
+ );
+
++ $Params{LIBS} = '';
+ if ($libdir)
+ {
+- $Params{LIBS} = "-L$libdir -lidn";
+- }
+- else
+- {
+- $Params{LIBS} = $Config{ldflags} . ' -lidn';
++ $Params{LIBS} .= "-L$libdir ";
+ }
++ $Params{LIBS} .= '-lidn';
+
+ if ($incdir)
+ {
+ $Params{INC} = "-I$incdir";
+ }
+- else
+- {
+- $Params{INC} = '';
+- }
+
+ my $libidn = CheckLibidn($Params{INC}, $Params{LIBS});
+
+@@ -146,11 +140,24 @@ sub FilterTLD
+ }
+ }
+
++sub concat {
++ my ($a, $b) = @_;
++ if (!defined $a)
++ {
++ $a = '';
++ }
++ if (!defined $b)
++ {
++ $b = '';
++ };
++ return ($a . ' ' . $b);
++}
++
+ sub CheckCCode
+ {
+ my $code = shift;
+- my $cflags = shift;
+- my $ldflags = shift;
++ my $cflags = concat($Config{ccflags}, shift);
++ my $ldflags = concat($Config{ldflags}, shift);
+ my $output = shift;
+ my $test = '__test'.$testno++;
+ local * FILE;
+@@ -165,7 +172,7 @@ sub CheckCCode
+ return 0;
+ }
+
+- foreach my $cc (qw/cc gcc/)
++ foreach my $cc ($Config{cc}, qw/cc gcc/)
+ {
+ unlink($test);
+ system "$cc $cflags -o $test $test.c $ldflags";
+--
+2.4.3
+
diff --git a/perl-Net-LibIDN.spec b/perl-Net-LibIDN.spec
index 9da4c5b..be49f61 100644
--- a/perl-Net-LibIDN.spec
+++ b/perl-Net-LibIDN.spec
@@ -3,11 +3,13 @@
Summary: Perl bindings for GNU LibIDN
Name: perl-Net-LibIDN
Version: 0.12
-Release: 21%{?dist}
+Release: 22%{?dist}
License: GPL+ or Artistic
Group: Development/Libraries
URL: http://search.cpan.org/dist/%{pkgname}/
Source: http://search.cpan.org/CPAN/authors/id/T/TH/THOR/%{pkgname}-%{version}.tar.gz
+# Use distribution CFLAGS for tests, bug #1242794, CPAN RT#105853
+Patch0: Net-LibIDN-0.12-Respect-Config-s-cc-ccflags-and-ldflags.patch
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
BuildRequires: libidn-devel >= 0.4.0
BuildRequires: perl >= 5.8.0
@@ -30,6 +32,7 @@ a way very much inspired by Turbo Fredriksson's PHP-IDN.
%prep
%setup -q -n %{pkgname}-%{version}
+%patch0 -p1
# Change man page encoding into UTF-8
for F in _LibIDN.pm; do
iconv -f latin1 -t utf-8 < "$F" > "${F}.utf"
@@ -58,6 +61,9 @@ make test
%{perl_vendorarch}/auto/Net
%changelog
+* Tue Jul 14 2015 Petr Pisar <ppisar at redhat.com> - 0.12-22
+- Use distribution CFLAGS for Makefile.PL's tests (bug #1242794)
+
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.12-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-Net-LibIDN.git/commit/?h=master&id=c158460230cb483d33c837ad9482ab33128fa585
More information about the perl-devel
mailing list