Perl5-Alien / Alien-Base

Base classes for Alien:: modules (deprecated, see Alien-Build)
Other
35 stars 19 forks source link

A::B::FAQ typo in minimum version code and error when running code #159

Closed djerius closed 8 years ago

djerius commented 8 years ago

I'm using Alien::base 0.027.

The FAQ section dealing with specifying a minimum version of a module has a typo: this

alien_version_check => '%{pkg_config} --atleast-version 1.2.3 && %{pkg_config} --modversion %n',

should be

alien_version_check => '%{pkg_config} --atleast-version 1.2.3 %n && %{pkg_config} --modversion %n',

Unfortunately, even with that fix I'm still unable to proceed:

I've attached the Build.PL and pkg-config files in a zip file.

The minimum version of the library requested is 2.1.8, and the installed version is 2.1.17:

% pkg-config --modversion xpa
2.1.17
% pkg-config --atleast-version 2.1.18 xpa && pkg-config --modversion xpa
% echo $?
1

So I'm expecting the version check to fail and for a download of 2.1.18 to be attempted (which will fail, as 2.1.17 is the latest released module).

However, here's what I get:

% perl Build.pl
+ pkg-config --atleast-version 2.1.18 xpa && pkg-config --modversion xpa
Can't find dist packages without a MANIFEST file
Run 'Build manifest' to generate one

WARNING: Possible missing or corrupt 'MANIFEST' file.
Nothing to enter for 'provides' field in metafile.
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Alien-XPA' version '0.01'

% ./Build
Building Alien-XPA
+ pkg-config --atleast-version 2.1.18 xpa && pkg-config --modversion xpa
Can't call method "new" on an undefined value at [...]/lib/site_perl/5.16.3/Alien/Base/ModuleBuild.pm line 592.

Am I missing something?

Thanks,

Diab

xpa.zip

plicease commented 8 years ago

HTTPS should be https

   alien_repository => [
                        {
                         protocol => 'https',
                         host     => 'github.com',
                         location => 'ericmandel/xpa/archive',
                         exact_filename => "v${XPA_VERSION}.zip",
                        },
                       ],
plicease commented 8 years ago

Thank you for reporting the bug in the FAQ example! I'll open a PR for that.

djerius commented 8 years ago

thanks! Please consider implementing a sanity check on the attributes in alien_repository for people like me.