Skip to content

Commit

Permalink
Split version checking from use Alien::Gnuplot
Browse files Browse the repository at this point in the history
in order to make downstream packaging easier.

This works around dependency scanning code that assumes the standard
semantics where a version-like string in that location refers to the
version of the Perl module that is stored in the package variable
`$VERSION`.

In particular, this is what `rpmbuild` does via the `perl-generators`
plugin per <https://github.com/jplesnik/generators/blob/1.16/template/bin/perl.req#L240>.

Fixes <#98>.
  • Loading branch information
zmughal committed Aug 17, 2023
1 parent 254116d commit 0220b8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- Split version checking from `use Alien::Gnuplot` line for easier downstream
packaging. Fixes #98.

2.024 2023-03-30
- Add Alien::Gnuplot as a configure-time dependency. Fixes #92 - thanks @zmughal

Expand Down
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ WriteMakefile(
'Alien::Gnuplot' => 0,
},
PREREQ_PM => {
'Alien::Gnuplot' => 0,
'Alien::Gnuplot' => '1.031',
'PDL' => 0,
'PDL::Transform::Color' => 0,
'IPC::Run' => 0,
Expand Down
4 changes: 3 additions & 1 deletion lib/PDL/Graphics/Gnuplot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2010,14 +2010,16 @@ use Time::HiRes qw(gettimeofday tv_interval);
use Safe::Isa;
use Carp;

use Alien::Gnuplot 4.4; # Ensure gnuplot exists and is recent, and get ancillary info about it.
use Alien::Gnuplot;
if($Alien::Gnuplot::VERSION < 1.031) {
# Have to check explicitly since we use the version hack to check the *gnuplot* version.
die "PDL::Graphics::Gnuplot requires Alien::Gnuplot version 1.031 or higher\n (v$Alien::Gnuplot::VERSION found). You can pull the latest from CPAN.\n";
}

our $gnuplot_dep_v = 4.006; # Versions below this are deprecated.
our $gnuplot_req_v = 4.004; # Versions below this are not supported.
# Ensure gnuplot exists and is recent, and get ancillary info about it.
Alien::Gnuplot->VERSION('4.4');

# Compile time config flags...
our $check_syntax = 0;
Expand Down

0 comments on commit 0220b8e

Please sign in to comment.