Alien::Build::MM - Alien::Build installer code for ExtUtils::MakeMaker
version 2.70
In your Makefile.PL:
Makefile.PL
use ExtUtils::MakeMaker; use Alien::Build::MM; my $abmm = Alien::Build::MM->new; WriteMakefile($abmm->mm_args( ABSTRACT => 'Discover or download and install libfoo', DISTNAME => 'Alien-Libfoo', NAME => 'Alien::Libfoo', VERSION_FROM => 'lib/Alien/Libfoo.pm', ... )); sub MY::postamble { $abmm->mm_postamble(@_); } sub MY::install { $abmm->mm_install(@_); }
In your lib/Alien/Libfoo.pm:
lib/Alien/Libfoo.pm
package Alien::Libfoo; use parent qw( Alien::Base ); 1;
In your alienfile (needs to be named alienfile and should be in the root of your dist):
alienfile
use alienfile; plugin 'PkgConfig' => 'libfoo'; share { start_url 'http://libfoo.org'; ... };
This class allows you to use Alien::Build and Alien::Base with ExtUtils::MakeMaker. It load the alienfile recipe in the root of your Alien dist, updates the prereqs passed into WriteMakefile if any are specified by your alienfile or its plugins, and adds a postamble to the Makefile that will download/build/test the alienized package as appropriate.
WriteMakefile
Makefile
The alienfile must be named alienfile.
If you are using Dist::Zilla to author your Alien dist, you should consider using the Dist::Zilla::Plugin::AlienBuild plugin.
I personally don't recommend it, but if you want to use Module::Build instead, you can use Alien::Build::MB.
my $abmm = Alien::Build::MM->new;
Create a new instance of Alien::Build::MM.
my $build = $abmm->build;
The Alien::Build instance.
my $bool = $abmm->alienfile_meta
Set to a false value, in order to turn off the x_alienfile meta
my $bool = $abmm->clean_install;
Set to a true value, in order to clean the share directory prior to installing. If you use this you have to make sure that you install the install handler in your Makefile.PL:
$abmm = Alien::Build::MM->new( clean_install => 1, ); ... sub MY::install { $abmm->mm_install(@_); }
my %args = $abmm->mm_args(%args);
Adjust the arguments passed into WriteMakefile as needed by Alien::Build.
my $postamble $abmm->mm_postamble; my $postamble $abmm->mm_postamble($mm);
Returns the postamble for the Makefile needed for Alien::Build. This adds the following make targets which are normally called when you run make all, but can be run individually if needed for debugging.
make
make all
Determines the final install prefix (%{.install.prefix}).
%{.install.prefix}
Determine the perl_module_version (%{.runtime.perl_module_version})
%{.runtime.perl_module_version}
Downloads the source from the internet. Does nothing for a system install.
Build from source (if a share install). Gather configuration (for either system or share install).
Prints the meta, install and runtime properties for the Alien.
Removes the alien specific files. These targets are executed when you call the realclean and clean targets respectively.
realclean
clean
Cleans out the Alien's share directory. Caution should be used in invoking this target directly, as if you do not understand what you are doing you are likely to break your already installed Alien.
sub MY::install { $abmm->mm_install(@_); }
EXPERIMENTAL
Adds an install rule to clean the final install dist directory prior to installing.
Alien::Build, Alien::Base, Alien, Dist::Zilla::Plugin::AlienBuild, Alien::Build::MB
Author: Graham Ollis <plicease@cpan.org>
Contributors:
Diab Jerius (DJERIUS)
Roy Storey (KIWIROY)
Ilya Pavlov
David Mertens (run4flat)
Mark Nunberg (mordy, mnunberg)
Christian Walde (Mithaldu)
Brian Wightman (MidLifeXis)
Zaki Mughal (zmughal)
mohawk (mohawk2, ETJ)
Vikas N Kumar (vikasnkumar)
Flavio Poletti (polettix)
Salvador Fandiño (salva)
Gianni Ceccarelli (dakkar)
Pavel Shaydo (zwon, trinitum)
Kang-min Liu (劉康民, gugod)
Nicholas Shipp (nshp)
Juan Julián Merelo Guervós (JJ)
Joel Berger (JBERGER)
Petr Písař (ppisar)
Lance Wicks (LANCEW)
Ahmad Fatoum (a3f, ATHREEF)
José Joaquín Atria (JJATRIA)
Duke Leto (LETO)
Shoichi Kaji (SKAJI)
Shawn Laffan (SLAFFAN)
Paul Evans (leonerd, PEVANS)
Håkon Hægland (hakonhagland, HAKONH)
nick nauwelaerts (INPHOBIA)
This software is copyright (c) 2011-2022 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Alien::Build, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Alien::Build
CPAN shell
perl -MCPAN -e shell install Alien::Build
For more information on module installation, please visit the detailed CPAN module installation guide.