Skip Menu |
 

This queue is for tickets about the GD CPAN distribution.

Report information
The Basics
Id: 106274
Status: resolved
Priority: 0/
Queue: GD

People
Owner: Nobody in particular
Requestors: CLEACH [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.56
Fixed in: (no value)



Subject: Your "perl Build.PL" doesn't honor Module::Build options like --install_base
Hello, It looks like you've hard coded in your Build.PL code all the options you wish to allow in your code via a call to GetOptions() and it didn't allow for installing your module in alternate locations. Or any of a dozen other options natively supported by Module::Build. Other modules allow "perl Build.PL --install_base /<install-dir>" so that you can install your module in an alternate location when you don't have access to update the perl library tree. This is the equivalent to "perl Makefile.PL INSTALL_BASE=/<install-dir>". So maybe it's best to just ignore the result to GetOptions() & don't call die with a usage statement. Or just add a --help option to call die with the usage instead. GetOptions() doesn't monkey with @ARGV, so your call to it shouldn't bother Module::Build any. Though you may want to look into if there was any way to suppress the "Unknown option:" messages it writes to STDERR to avoid build confusion. For more details & the options to support see http://search.cpan.org/~leont/Module-Build-0.4214/lib/Module/Build.pm#INSTALL_PATHS Curtis
Download (untitled) / with headers
text/plain 1.7k
On Thu Aug 06 13:13:19 2015, CLEACH wrote: Show quoted text
> Hello, > > It looks like you've hard coded in your Build.PL code all the options > you wish to allow in your code via a call to GetOptions() and it > didn't allow for installing your module in alternate locations. Or > any of a dozen other options natively supported by Module::Build. > > Other modules allow "perl Build.PL --install_base /<install-dir>" so > that you can install your module in an alternate location when you > don't have access to update the perl library tree. > > This is the equivalent to "perl Makefile.PL INSTALL_BASE=/<install-
> dir>".
> > So maybe it's best to just ignore the result to GetOptions() & don't > call die with a usage statement. Or just add a --help option to call > die with the usage instead. GetOptions() doesn't monkey with @ARGV, > so your call to it shouldn't bother Module::Build any. Though you may > want to look into if there was any way to suppress the "Unknown > option:" messages it writes to STDERR to avoid build confusion. > > For more details & the options to support see > http://search.cpan.org/~leont/Module-Build- > 0.4214/lib/Module/Build.pm#INSTALL_PATHS > > Curtis
I was able to make "--install_base DIR" by making the following change to Build.PL: ... my $help; Getopt::Long::Configure('pass_through'); my $result = GetOptions("options=s" => \$options, "lib_gd_path=s" => \$lib_gd_path, "lib_ft_path=s" => \$lib_ft_path, "lib_png_path=s" => \$lib_png_path, "lib_jpeg_path=s" => \$lib_jpeg_path, "lib_xpm_path=s" => \$lib_xpm_path, "lib_zlib_path=s" => \$lib_zlib_path, "h|help" => \$help, ); Getopt::Long::Configure('no_pass_through'); if ($help) { die <<END; Usage: perl Build.PL [options] ...
For reference here's a patch.
Subject: patch.txt
Download patch.txt
text/plain 1.7k
commit 76e0617a55fa84f43f2e2501b53fc72054f2061d Author: Todd Rinaldo <toddr@cpan.org> Date: Thu Nov 12 00:26:19 2015 -0600 Restore Build.PL command line options for GD See RT 106274 diff --git a/modules/GD/GD/Build.PL b/modules/GD/GD/Build.PL index ad31624..ff46b5f 100644 --- a/modules/GD/GD/Build.PL +++ b/modules/GD/GD/Build.PL @@ -9,7 +9,7 @@ use Config; my (@INC,@LIBPATH,@LIBS); my $AUTOCONFIG = 0; # global set by try_to_autoconfigure() below -my ($options,$lib_gd_path,$lib_ft_path,$lib_png_path,$lib_jpeg_path,$lib_xpm_path,$lib_zlib_path); +my ($options,$lib_gd_path,$lib_ft_path,$lib_png_path,$lib_jpeg_path,$lib_xpm_path,$lib_zlib_path, $help); unless (try_to_autoconfigure(\$options,\$lib_gd_path,\@INC,\@LIBPATH,\@LIBS)) { die <<END; @@ -31,6 +31,7 @@ if (-d '/usr/lib64') { ############################################################################################# # Build options passed in to script to support reproducible builds via Makefiles ############################################################################################# +Getopt::Long::Configure('pass_through'); my $result = GetOptions("options=s" => \$options, "lib_gd_path=s" => \$lib_gd_path, "lib_ft_path=s" => \$lib_ft_path, @@ -38,9 +39,11 @@ my $result = GetOptions("options=s" => \$options, "lib_jpeg_path=s" => \$lib_jpeg_path, "lib_xpm_path=s" => \$lib_xpm_path, "lib_zlib_path=s" => \$lib_zlib_path, + "h|help" => \$help, ); -unless ($result) { - die <<END; +Getopt::Long::Configure('no_pass_through'); + if ($help) { + die <<END; Usage: perl Build.PL [options] Configure GD module.
Download (untitled) / with headers
text/plain 145b
This is pretty important. Basically any RPM / Debian packager needs access to these things or they're not going to be able to update this module.
Download (untitled) / with headers
text/plain 377b
On Thu Nov 12 01:29:05 2015, TODDR wrote: Show quoted text
> This is pretty important. Basically any RPM / Debian packager needs > access to these things or they're not going to be able to update this > module.
Yes. I've removed Build.PL and sanified the option handling to override any autodetected values. Fixed in RURBAN/GD-2.56_03.tar.gz and the upcoming official GD-2.57 -- Reini Urban


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.