1Alien::Build::Plugin(3)User Contributed Perl DocumentatioAnlien::Build::Plugin(3)
2
3
4
6 Alien::Build::Plugin - Plugin base class for Alien::Build
7
9 version 2.80
10
12 Create your plugin:
13
14 package Alien::Build::Plugin::Type::MyPlugin;
15
16 use Alien::Build::Plugin;
17 use Carp ();
18
19 has prop1 => 'default value';
20 has prop2 => sub { 'default value' };
21 has prop3 => sub { Carp::croak 'prop3 is a required property' };
22
23 sub init
24 {
25 my($self, $meta) = @_;
26
27 my $prop1 = $self->prop1;
28 my $prop2 = $self->prop2;
29 my $prop3 = $self->prop3;
30
31 $meta->register_hook(sub {
32 build => [ '%{make}', '%{make} install' ],
33 });
34 }
35
36 From your alienfile
37
38 use alienfile;
39 plugin 'Type::MyPlugin' => (
40 prop2 => 'different value',
41 prop3 => 'need to provide since it is required',
42 );
43
45 This document describes the Alien::Build plugin base class. For
46 details on how to write a plugin, see
47 Alien::Build::Manual::PluginAuthor.
48
49 Listed are some common types of plugins:
50
51 Alien::Build::Plugin::Build
52 Tools for building.
53
54 Alien::Build::Plugin::Core
55 Tools already included.
56
57 Alien::Build::Plugin::Decode
58 Normally use Download plugins which will pick the correct Decode
59 plugins.
60
61 Alien::Build::Plugin::Digest
62 Tools for checking cryptographic signatures during a "share"
63 install.
64
65 Alien::Build::Plugin::Download
66 Methods for retrieving from the internet.
67
68 Alien::Build::Plugin::Extract
69 Extract from archives that have been downloaded.
70
71 Alien::Build::Plugin::Fetch
72 Normally use Download plugins which will pick the correct Fetch
73 plugins.
74
75 Alien::Build::Plugin::Gather
76 Plugins that modify or enhance the gather step.
77
78 Alien::Build::Plugin::PkgConfig
79 Plugins that work with "pkg-config" or libraries that provide the
80 same functionality.
81
82 Alien::Build::Plugin::Prefer
83 Normally use Download plugins which will pick the correct Prefer
84 plugins.
85
86 Alien::Build::Plugin::Probe
87 Look for packages already installed on the system.
88
89 Alien::Build::Plugin::Probe
90 Plugins useful for unit testing Alien::Build itself, or plugins for
91 it.
92
94 new
95 my $plugin = Alien::Build::Plugin->new(%props);
96
97 PROPERTIES
98 instance_id
99 my $id = $plugin->instance_id;
100
101 Returns an instance id for the plugin. This is computed from the class
102 and arguments that are passed into the plugin constructor, so
103 technically two instances with the exact same arguments will have the
104 same instance id, but in practice you should never have two instances
105 with the exact same arguments.
106
108 init
109 $plugin->init($ab_class->meta); # $ab is an Alien::Build class name
110
111 You provide the implementation for this. The intent is to register
112 hooks and set meta properties on the Alien::Build class.
113
114 has
115 has $prop_name;
116 has $prop_name => $default;
117
118 Specifies a property of the plugin. You may provide a default value as
119 either a string scalar, or a code reference. The code reference will
120 be called to compute the default value, and if you want the default to
121 be a list or hash reference, this is how you want to do it:
122
123 has foo => sub { [1,2,3] };
124
125 meta
126 my $meta = $plugin->meta;
127
128 Returns the plugin meta object.
129
131 Alien::Build, alienfile, Alien::Build::Manual::PluginAuthor
132
134 Author: Graham Ollis <plicease@cpan.org>
135
136 Contributors:
137
138 Diab Jerius (DJERIUS)
139
140 Roy Storey (KIWIROY)
141
142 Ilya Pavlov
143
144 David Mertens (run4flat)
145
146 Mark Nunberg (mordy, mnunberg)
147
148 Christian Walde (Mithaldu)
149
150 Brian Wightman (MidLifeXis)
151
152 Zaki Mughal (zmughal)
153
154 mohawk (mohawk2, ETJ)
155
156 Vikas N Kumar (vikasnkumar)
157
158 Flavio Poletti (polettix)
159
160 Salvador Fandiño (salva)
161
162 Gianni Ceccarelli (dakkar)
163
164 Pavel Shaydo (zwon, trinitum)
165
166 Kang-min Liu (劉康民, gugod)
167
168 Nicholas Shipp (nshp)
169
170 Juan Julián Merelo Guervós (JJ)
171
172 Joel Berger (JBERGER)
173
174 Petr Písař (ppisar)
175
176 Lance Wicks (LANCEW)
177
178 Ahmad Fatoum (a3f, ATHREEF)
179
180 José Joaquín Atria (JJATRIA)
181
182 Duke Leto (LETO)
183
184 Shoichi Kaji (SKAJI)
185
186 Shawn Laffan (SLAFFAN)
187
188 Paul Evans (leonerd, PEVANS)
189
190 Håkon Hægland (hakonhagland, HAKONH)
191
192 nick nauwelaerts (INPHOBIA)
193
194 Florian Weimer
195
197 This software is copyright (c) 2011-2022 by Graham Ollis.
198
199 This is free software; you can redistribute it and/or modify it under
200 the same terms as the Perl 5 programming language system itself.
201
202
203
204perl v5.38.0 2023-07-20 Alien::Build::Plugin(3)