Alien::...:Plugin(3)
π Alien::Build::Plugin β the plugin base class, bestie π
okay so this page is Alien::...:Plugin(3) from the User Contributed Perl Documentation and it's literally the origin story for every Alien::Build plugin. pull up a chair π«Ά
β¨ NAME β¨
Alien::Build::Plugin β the plugin base class for Alien::Build. periodt.
πΈ VERSION πΈ
version 2.88 β yeah she's been around, she's iconic π
π SYNOPSIS π
bestie, here's how you make your plugin:
package Alien::Build::Plugin::Type::MyPlugin;
use Alien::Build::Plugin;
use Carp ();
has prop1 => 'default value';
has prop2 => sub { 'default value' };
has prop3 => sub { Carp::croak 'prop3 is a required property' };
sub init
{
my($self, $meta) = @_;
my $prop1 = $self->prop1;
my $prop2 = $self->prop2;
my $prop3 = $self->prop3;
$meta->register_hook(sub {
build => [ '%{make}', '%{make} install' ],
});
}
and then from your alienfile you pull up like:
use alienfile;
plugin 'Type::MyPlugin' => (
prop2 => 'different value',
prop3 => 'need to provide since it is required',
);
see how prop3 had to get passed in? that's the required-property thing doing its job π
π¦ DESCRIPTION π¦
this doc describes the Alien::Build plugin base class. but bestie β if you actually wanna learn how to write a plugin, go read Alien::Build::Manual::PluginAuthor instead, that's the real one. iykyk.
here are the common types of plugins, and yes every single one of them is in here:
- Alien::Build::Plugin::Build β tools for building. π οΈ
- Alien::Build::Plugin::Core β tools that are already included. no download needed, they came with the vibes.
- Alien::Build::Plugin::Decode β normally you use Download plugins, which will pick the correct Decode plugins for you.
- Alien::Build::Plugin::Digest β tools for checking cryptographic signatures during a
"share"install. security girlie behavior π - Alien::Build::Plugin::Download β methods for retrieving from the internet.
- Alien::Build::Plugin::Extract β extract from archives that have been downloaded.
- Alien::Build::Plugin::Fetch β normally you use Download plugins, which will pick the correct Fetch plugins.
- Alien::Build::Plugin::Gather β plugins that modify or enhance the gather step.
- Alien::Build::Plugin::PkgConfig β plugins that work with
"pkg-config"or libraries that provide the same functionality. - Alien::Build::Plugin::Prefer β normally you use Download plugins, which will pick the correct Prefer plugins.
- Alien::Build::Plugin::Probe β look for packages already installed on the system.
- Alien::Build::Plugin::Probe β plugins useful for unit testing Alien::Build itself, or plugins for it.
and yes bestie, Alien::Build::Plugin::Probe really is listed twice in the original. not a typo on my end, i'm keeping it exactly as it is π
π CONSTRUCTOR π
π new π
my $plugin = Alien::Build::Plugin->new(%props);
that's it. that's the constructor. slay.
π PROPERTIES π
β instance_id β
my $id = $plugin->instance_id;
returns an instance id for the plugin. it gets computed from the class and the arguments you passed into the plugin constructor. so technically, two instances with the exact same arguments will have the same instance id. but in practice you should never have two instances with the exact same arguments. fr fr, don't do it.
π METHODS π
π§ init π§
$plugin->init($ab_class->meta); # $ab is an Alien::Build class name
you provide the implementation for this one, bestie. the whole intent is to register hooks and set meta properties on the Alien::Build class. main character energy, honestly.
π has π
has $prop_name;
has $prop_name => $default;
specifies a property of the plugin. you can hand it a default value as either a string scalar, or a code reference. the code reference gets called to compute the default value β and if you want the default to be a list or a hash reference, this is literally how you want to do it:
has foo => sub { [1,2,3] };
πΈ meta πΈ
my $meta = $plugin->meta;
returns the plugin meta object. that's the whole thing, no notes β¨
π SEE ALSO π
- Alien::Build
- alienfile
- Alien::Build::Manual::PluginAuthor
π«Ά AUTHOR π«Ά
Author: Graham Ollis <plicease@cpan.org>
Contributors β the whole group chat, every single one of them, no cap:
- 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)
- Florian Weimer
- Marcel Telka (mtelka)
π COPYRIGHT AND LICENSE π
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.
okay that's the whole page bestie, you ate it up π this was Alien::...:Plugin(3) as shipped with perl v5.42.3 on 2026-09-21 β go forth and write plugins, mwah πβ¨
π¦ where this page comes from
- fedora 43: perl-Alien-Build 2.88-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Alien-Build 2.88-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms