Skip to content

Commit

Permalink
Fix mismatch in how Gnuplot is found during configure and runtime
Browse files Browse the repository at this point in the history
This adds `Alien::Gnuplot` as a configure-time dependency so that it
finds the `gnuplot` binary the same way at configure-time that it
already does at runtime.  Since `Alien::Gnuplot` already checks for a
working Gnuplot, `Makefile.PL` does not need to do this.

This allows for overriding via the `GNUPLOT_BINARY` environment variable
(e.g., for testing multiple versions of Gnuplot).

Fixes <#92>.
  • Loading branch information
zmughal committed Mar 30, 2023
1 parent 2ba3b9b commit d100d7f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
with:
target-setup-perl: false
target-install-dist-perl-deps: true
dist-perl-deps-configure: Alien::Gnuplot
target-test-release-testing: true
target-test: true
test-enable-release-testing: ${{ matrix.release-test }}
Expand Down
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Add Alien::Gnuplot as a configure-time dependency. Fixes #92.
2.023 2023-01-29
- Fix over-enthusiastic code tidying - thanks @zmughal

Expand Down
19 changes: 2 additions & 17 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,7 @@ use warnings;
use ExtUtils::MakeMaker 6.48;

# make sure we can run gnuplot before continuing
{
unless(`gnuplot -V`)
{
print STDERR <<EOM;
Error: "$!"
I tried to execute 'gnuplot' and it didn't work. Since this module is an is an
interface to Gnuplot, it must be installed for the module to be useful. Install
Gnuplot to continue. Use your package manager, or download the source from
http://www.gnuplot.info
EOM

exit 0;
}
}

use Alien::Gnuplot;

sub MY::libscan {
package MY;
Expand Down Expand Up @@ -56,6 +40,7 @@ WriteMakefile(
MIN_PERL_VERSION => 5.006,
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => '6.64', # TEST_REQUIRES
'Alien::Gnuplot' => 0,
},
PREREQ_PM => {
'Alien::Gnuplot' => 0,
Expand Down

0 comments on commit d100d7f

Please sign in to comment.