From d7d46acb3804da587b59a285cbcc77c8c0d3931c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com> Date: Fri, 15 May 2015 11:11:25 +0200 Subject: Apply a workaround scaling character size in plplot-5.11.0
diff --git a/PDL-Graphics-PLplot-0.67-Postpone-setting-CHARSIZE-after-initializing-plplot.patch b/PDL-Graphics-PLplot-0.67-Postpone-setting-CHARSIZE-after-initializing-plplot.patch new file mode 100644 index 0000000..7e20dad --- /dev/null +++ b/PDL-Graphics-PLplot-0.67-Postpone-setting-CHARSIZE-after-initializing-plplot.patch @@ -0,0 +1,55 @@ +From 85865109e9b2455bfe2cec8c947dcbab4942f0e9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com> +Date: Fri, 15 May 2015 09:38:15 +0200 +Subject: [PATCH] Postpone setting CHARSIZE after initializing plplot +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Since PLplot 5.11.0, calling plschr() before plinit() leads to crash. +Reproducer: + +$ perl -MPDL -MPDL::Graphics::PLplot -e 'PDL::Graphics::PLplot->new()' + +This patch moves setting CHARSIZE after calling plinit(). + +<https://rt.cpan.org/Public/Bug/Display.html?id=104424> +<https://sourceforge.net/p/plplot/bugs/162/> + +Signed-off-by: Petr Písař <ppi...@redhat.com> +--- + plplot.pd | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/plplot.pd b/plplot.pd +index 4410604..c3b74e1 100644 +--- a/plplot.pd ++++ b/plplot.pd +@@ -1516,6 +1516,14 @@ sub new { + CHARSIZE => 1, + @_); + ++ # Since PLplot 5.11.0, calling plschr() before plinit() cases a crash ++ # (CPAN RT#104424). Postpone setting CHARSIZE after plinit(). ++ my %postinit_opts; ++ for my $option ('CHARSIZE') { ++ if (exists $opts{$option}) { ++ $postinit_opts{$option} = delete $opts{$option}; ++ } ++ } + + # apply options + $self->setparm(%opts); +@@ -1528,6 +1536,9 @@ sub new { + plscmap1n (128); # set map 1 to 128 colors (should work for devices with 256 colors) + plinit (); + ++ # apply post-plinit options ++ $self->setparm(%postinit_opts); ++ + # set page orientation + plsdiori ($self->{ORIENTATION}); + +-- +2.1.0 + diff --git a/perl-PDL-Graphics-PLplot.spec b/perl-PDL-Graphics-PLplot.spec index f04a290..b3d3a77 100644 --- a/perl-PDL-Graphics-PLplot.spec +++ b/perl-PDL-Graphics-PLplot.spec @@ -11,6 +11,9 @@ Source0: http://search.cpan.org/CPAN/authors/id/D/DH/DHUNT/%{pkgname}-%{v 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 +# Apply a workaround scaling character size in plplot-5.11.0, bug #1215584, +# CPAN RT#104424 +Patch2: PDL-Graphics-PLplot-0.67-Postpone-setting-CHARSIZE-after-initializing-plplot.patch BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(Test::More) @@ -31,6 +34,7 @@ interface which is easier to use. %setup -qn %{pkgname}-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build %{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="${RPM_OPT_FLAGS}" @@ -53,6 +57,7 @@ make test %changelog * Fri May 15 2015 Petr Pisar <ppi...@redhat.com> - 0.67-6 - Support linking to plplot-5.11.0 (bug #1215584) +- Apply a workaround scaling character size in plplot-5.11.0 (bug #1215584) * Mon Sep 01 2014 Jitka Plesnikova <jples...@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=d7d46acb3804da587b59a285cbcc77c8c0d3931c -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/perl-devel