Alien::Base::ModuleBuild - A Module::Build subclass for building Alien:: modules and their libraries
In your Build.PL:
use Alien::Base::ModuleBuild; my $builder = Alien::Base::Module::Build->new( module_name => 'Alien::MyLibrary', configure_requires => { 'Alien::Base' => '0.005', 'Module::Build' => '0.28' }, requires => { 'Alien::Base' => '0.005', }, alien_name => 'mylibrary', # the pkg-config name if you want # to use pkg-config to discover # system version of the mylibrary alien_repository => { protocol => 'http', host => 'myhost.org', location => '/path/to/tarballs', pattern => qr{^mylibrary-([0-9\.]+)\.tar\.gz$}, }, # this is the default: alien_build_commands => [ "%c --prefix=%s", # %c is a platform independent version of ./configure "make", ], # this is the default for install: alien_install_commands => [ "make install", ], alien_isolate_dynamic => 1, );
This is a subclass of Module::Build, that with Alien::Base allows for easy creation of Alien distributions. This module is used during the build step of your distribution. When properly configured it will
my $version = $abmb->alien_check_installed_version;
This function determines if the library is already installed as part of the operating system, and returns the version as a string. If it can't be detected then it should return empty list.
The default implementation relies on pkg-config, but you will probably want to override this with your own implementation if the package you are building does not use pkg-config.
pkg-config
my $version = $amb->alien_check_built_version;
This function determines the version of the library after it has been built from source. This function only gets called if the operating system version can not be found and the package is successfully built.
The default implementation relies on pkg-config, and other huristics, but you will probably want to override this with your own implementation if the package you are building does not use pkg-config.
When this method is called, the current working directory will be the build root.
If you see an error message like this:
Library looks like it installed, but no version was determined
After the package is built from source code then you probably need to provide an implementation for this method.
The documentation for Module::Build is broken up into sections:
Module::Build
This is the landing document for Alien::Base::ModuleBuild's parent class. It describes basic usage and background information. Its main purpose is to assist the user who wants to learn how to invoke and control Module::Build scripts at the command line.
It also lists the extra documentation for its use. Users and authors of Alien:: modules should familiarize themselves with these documents. Module::Build::API is of particular importance to authors.
This is the document you are currently reading.
This document describes the structure and organization of Alien::Base based projects, beyond that contained in Module::Build::Authoring, and the relevant concepts needed by authors who are writing Build.PL scripts for a distribution or controlling Alien::Base::ModuleBuild processes programmatically.
Alien::Base
Module::Build::Authoring
Alien::Base::ModuleBuild
Note that as it contains information both for the build and use phases of Alien::Base projects, it is located in the upper namespace.
This is a reference to the Alien::Base::ModuleBuild API beyond that contained in Module::Build::API.
Module::Build::API
Alien
http://github.com/Perl5-Alien/Alien-Base
Original author: Joel Berger, <joel.a.berger@gmail.com>
Current maintainer: Graham Ollis <plicease@cpan.org> and the Alien::Base team
Copyright (C) 2012-2015 by Joel Berger
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Alien::Base, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Alien::Base
CPAN shell
perl -MCPAN -e shell install Alien::Base
For more information on module installation, please visit the detailed CPAN module installation guide.