ppisar pushed to perl-PDL-Graphics-PLplot (master). "Support linking to plplot-5.11.0"
notifications at fedoraproject.org
notifications at fedoraproject.org
Fri May 15 10:08:45 UTC 2015
From e720b147c6af7b5881d7e6b94e88a7131bc2f2b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
Date: Fri, 15 May 2015 09:35:41 +0200
Subject: Support linking to plplot-5.11.0
diff --git a/PDL-Graphics-PLplot-0.67-Search-for-plplotd-before-plplot-library.patch b/PDL-Graphics-PLplot-0.67-Search-for-plplotd-before-plplot-library.patch
new file mode 100644
index 0000000..103e6dc
--- /dev/null
+++ b/PDL-Graphics-PLplot-0.67-Search-for-plplotd-before-plplot-library.patch
@@ -0,0 +1,194 @@
+From fb95787f2bcaff936e961665782c90becdf69963 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Thu, 14 May 2015 10:31:28 +0200
+Subject: [PATCH] Search for plplotd before plplot library
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+PLplot 5.11.0 renamed the library from plplotd to plplot. This patch
+checks first for plplotd and then for plplot library because older PLplot
+versions could deliver both of them while only the plplotd supported
+double precision.
+
+This patch also corrects check for double precission support to use
+discoverd linker flags.
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+---
+ Makefile.PL | 125 ++++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 70 insertions(+), 55 deletions(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index 8e0938e..6072b29 100755
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -28,56 +28,68 @@ if (!$pdl_installed) {
+ exit;
+ }
+
+-#
+-## Search for plplot library and include file
+-#
+-print "\nChecking PDL::Graphics::PLplot...\n";
+-
+-unlink ("OPTIONS!"); # remove file used to communicate with plplot.pd
+-
+-# on OS-X the library is called libplplotd.dylib, so we
+-# use $Config{"so"} to get the extension name
+-#
+-my $libname = "libplplotd." . $Config{"so"};
+-my $libname_static = "libplplotd.a";
+-my $incname = "plplot.h";
+-my $devnull = File::Spec->devnull(); # Portable null device.
+-
+ # require bad value support. D. Hunt 10/20/2008
+ unless ($PDL::Config{WITH_BADVAL}) {
+ buildDummy ("Bad value support required! (Turn on WITH_BADVAL in perldl.conf)");
+ return if (caller); exit;
+ }
+
++#
++## Search for plplot library and include file
++#
++print "\nChecking PDL::Graphics::PLplot...\n";
+
+-foreach my $libdir (
+- $ENV{PLPLOT_LIBDIR},
+- $PDL::Config{WHERE_PLPLOT_LIBS},
+- '/usr/local/plplot/lib64',
+- '/usr/local/plplot/lib',
+- '/usr/local/lib64',
+- '/usr/local/lib',
+- '/opt/local/lib',
+- '/usr/lib64',
+- '/usr/lib',
+- '/opt/lib64',
+- '/opt/lib',
+- '/ops/tools/lib',
+- '/sw/lib/', # default FINK installation
+- # Add new library paths here!!
+- ) {
++unlink ("OPTIONS!"); # remove file used to communicate with plplot.pd
++
++my $libbasename;
++my $libname;
++my $plplot_lib_path;
++
++# PLplot 5.11.0 renamed the library from plplotd to plplot. Search for both of
++# them.
++foreach ('plplotd', 'plplot') {
++ # on OS-X the library is called libplplot.dylib, so we
++ # use $Config{"so"} to get the extension name
++ #
++ $libbasename = $_;
++ $libname = "lib${libbasename}." . $Config{"so"};
++ my $libname_static = "lib{$libbasename}.a";
++ print "Searching for ${libname} library.\n";
++
++ foreach my $libdir (
++ $ENV{PLPLOT_LIBDIR},
++ $PDL::Config{WHERE_PLPLOT_LIBS},
++ '/usr/local/plplot/lib64',
++ '/usr/local/plplot/lib',
++ '/usr/local/lib64',
++ '/usr/local/lib',
++ '/opt/local/lib',
++ '/usr/lib64',
++ '/usr/lib',
++ '/opt/lib64',
++ '/opt/lib',
++ '/ops/tools/lib',
++ '/sw/lib/', # default FINK installation
++ # Add new library paths here!!
++ ) {
++
++ if (-e "$libdir/$libname") {
++ $plplot_lib_path = $libdir;
++ $ENV{LD_LIBRARY_PATH} .= ":$libdir";
++ last;
++ } elsif (-e "$libdir/$libname_static") {
++ $plplot_lib_path = $libdir;
++ $ENV{LD_LIBRARY_PATH} .= ":$libdir";
++ $libname = $libname_static;
++ last;
++ }
+
+- if (-e "$libdir/$libname") {
+- $plplot_lib_path = $libdir;
+- $ENV{LD_LIBRARY_PATH} .= ":$libdir";
+- last;
+- } elsif (-e "$libdir/$libname_static") {
+- $plplot_lib_path = $libdir;
+- $ENV{LD_LIBRARY_PATH} .= ":$libdir";
+- $libname = $libname_static;
+- last;
+ }
+
++ if (defined $plplot_lib_path) {
++ print "Found in ${plplot_lib_path}.\n";
++ last;
++ }
+ }
+
+ unless (defined ($plplot_lib_path)) {
+@@ -85,6 +97,9 @@ unless (defined ($plplot_lib_path)) {
+ return if (caller); exit;
+ }
+
++my $incname = "plplot.h";
++my $devnull = File::Spec->devnull(); # Portable null device.
++
+ foreach my $incdir (
+ $ENV{PLPLOT_INCDIR},
+ $PDL::Config{WHERE_PLPLOT_INCLUDE},
+@@ -118,24 +133,12 @@ unless (defined ($plplot_include_path)) {
+ return if (caller); exit;
+ }
+
+-# Test that PLplot was compiled --with-double (IE, a PLFLT is a double)
+-my $size = compileAndRun ("$plplot_include_path", 1, <<'EOC');
+-#include <plplot.h>
+-main () { printf ("%d", sizeof (PLFLT)); }
+-EOC
+-
+-unless ($size == 8) {
+- print " Sizeof(PLFLT) must be 8. PLplot must be compiled --with-double (IE ./configure --with-double)\n";
+- buildDummy ("Cannot find good set of libraries for linking PLplot, try fiddling perldl.conf\n");
+- return if (caller); exit;
+-}
+-
+ # Try linking with library. New if blocks should be added if necessary
+ my $libs;
+ foreach my $l (
+- "-L$plplot_lib_path -lplplotd -lX11",
+- "-L$plplot_lib_path -lplplotd",
+- "-L$plplot_lib_path -lplplotd -lqsastime -lcsirocsa -lgdi32 -lcomdlg32",
++ "-L$plplot_lib_path -l${libbasename} -lX11",
++ "-L$plplot_lib_path -l${libbasename}",
++ "-L$plplot_lib_path -l${libbasename} -lqsastime -lcsirocsa -lgdi32 -lcomdlg32",
+ # New lib combinations should be added here!
+ ) {
+ if (trylink( '', '#include <plplot.h>', 'plinit();', "$l $plplot_include_path")) {
+@@ -150,6 +153,18 @@ unless (defined($libs)) {
+ return if (caller); exit;
+ }
+
++# Test that PLplot was compiled --with-double (IE, a PLFLT is a double)
++my $size = compileAndRun ("$plplot_include_path $libs", 1, <<'EOC');
++#include <plplot.h>
++main () { printf ("%d", sizeof (PLFLT)); }
++EOC
++
++unless ($size == 8) {
++ print " Sizeof(PLFLT) must be 8. PLplot must be compiled --with-double (IE ./configure --with-double)\n";
++ buildDummy ("PLplot was not compiled --with-double, try fiddling perldl.conf\n");
++ return if (caller); exit;
++}
++
+ #
+ ## Tests for various PLplot features, present in different versions of PLplot
+ #
+--
+2.1.0
+
diff --git a/perl-PDL-Graphics-PLplot.spec b/perl-PDL-Graphics-PLplot.spec
index 17c80cb..f04a290 100644
--- a/perl-PDL-Graphics-PLplot.spec
+++ b/perl-PDL-Graphics-PLplot.spec
@@ -2,13 +2,15 @@
Name: perl-PDL-Graphics-PLplot
Version: 0.67
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Object-oriented interface from perl/PDL to the PLPLOT plotting library
License: GPL+ or Artistic
URL: http://search.cpan.org/dist/PDL-Graphics-PLplot/
Source0: http://search.cpan.org/CPAN/authors/id/D/DH/DHUNT/%{pkgname}-%{version}.tar.gz
# Work around to FTBFS triggered by -Werror=format-security
Patch0: PDL-Graphics-PLplot-0.67-hardening.patch
+# Support linking to plplot-5.11.0, bug #1215584, CPAN RT#104424
+Patch1: PDL-Graphics-PLplot-0.67-Search-for-plplotd-before-plplot-library.patch
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(Test::More)
@@ -28,6 +30,7 @@ interface which is easier to use.
%prep
%setup -qn %{pkgname}-%{version}
%patch0 -p1
+%patch1 -p1
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="${RPM_OPT_FLAGS}"
@@ -48,6 +51,9 @@ make test
%{_mandir}/man3/*
%changelog
+* Fri May 15 2015 Petr Pisar <ppisar at redhat.com> - 0.67-6
+- Support linking to plplot-5.11.0 (bug #1215584)
+
* Mon Sep 01 2014 Jitka Plesnikova <jplesnik at redhat.com> - 0.67-5
- Perl 5.20 rebuild
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-PDL-Graphics-PLplot.git/commit/?h=master&id=e720b147c6af7b5881d7e6b94e88a7131bc2f2b4
More information about the scm-commits
mailing list