1Alien::Base::ModuleBuilUds(e3r)Contributed Perl DocumentAaltiieonn::Base::ModuleBuild(3)
2
3
4
6 Alien::Base::ModuleBuild - A Module::Build subclass for building
7 Alien:: modules and their libraries
8
10 In your Build.PL:
11
12 use Alien::Base::ModuleBuild;
13
14 my $builder = Alien::Base::ModuleBuild->new(
15 module_name => 'Alien::MyLibrary',
16
17 configure_requires => {
18 'Alien::Base::ModuleBuild' => '0.005',
19 'Module::Build' => '0.28'
20 },
21 requires => {
22 'Alien::Base' => '0.005',
23 },
24
25 alien_name => 'mylibrary', # the pkg-config name if you want
26 # to use pkg-config to discover
27 # system version of the mylibrary
28
29 alien_repository => {
30 protocol => 'http',
31 host => 'myhost.org',
32 location => '/path/to/tarballs',
33 pattern => qr{^mylibrary-([0-9\.]+)\.tar\.gz$},
34 },
35
36 # this is the default:
37 alien_build_commands => [
38 "%c --prefix=%s", # %c is a platform independent version of ./configure
39 "make",
40 ],
41
42 # this is the default for install:
43 alien_install_commands => [
44 "make install",
45 ],
46
47 alien_isolate_dynamic => 1,
48 );
49
51 NOTE: Please consider for new development of Aliens that you use
52 Alien::Build and alienfile instead. Like this module they work with
53 Alien::Base. Unlike this module they are more easily customized and
54 handle a number of corner cases better. For a good place to start,
55 please see Alien::Build::Manual::AlienAuthor. Although the Alien-Base
56 / Alien-Build team will continue to maintain this module, (we will
57 continue to fix bugs where appropriate), we aren't adding any new
58 features to this module.
59
60 This is a subclass of Module::Build, that with Alien::Base allows for
61 easy creation of Alien distributions. This module is used during the
62 build step of your distribution. When properly configured it will
63
64 use pkg-config to find and use the system version of the library
65 download, build and install the library if the system does not provide
66 it
67
69 alien_check_installed_version
70 [version 0.001]
71
72 my $version = $abmb->alien_check_installed_version;
73
74 This function determines if the library is already installed as part of
75 the operating system, and returns the version as a string. If it can't
76 be detected then it should return empty list.
77
78 The default implementation relies on "pkg-config", but you will
79 probably want to override this with your own implementation if the
80 package you are building does not use "pkg-config".
81
82 alien_check_built_version
83 [version 0.006]
84
85 my $version = $amb->alien_check_built_version;
86
87 This function determines the version of the library after it has been
88 built from source. This function only gets called if the operating
89 system version can not be found and the package is successfully built.
90 The version is returned on success. If the version can't be detected
91 then it should return empty list. Note that failing to detect a
92 version is considered a failure and the corresponding "./Build" action
93 will fail!
94
95 Any string is valid as a version as far as Alien::Base is concerned.
96 The most useful value would be a number or dotted decimal that most
97 software developers recognize and that software tools can
98 differentiate. In some cases packages will not have a clear version
99 number, in which case the string "unknown" would be a reasonable
100 choice.
101
102 The default implementation relies on "pkg-config", and other
103 heuristics, but you will probably want to override this with your own
104 implementation if the package you are building does not use
105 "pkg-config".
106
107 When this method is called, the current working directory will be the
108 build root.
109
110 If you see an error message like this:
111
112 Library looks like it installed, but no version was determined
113
114 After the package is built from source code then you probably need to
115 provide an implementation for this method.
116
117 alien_extract_archive
118 [version 0.024]
119
120 my $dir = $amb->alien_extract_archive($filename);
121
122 This function unpacks the given archive and returns the directory
123 containing the unpacked files.
124
125 The default implementation relies on Archive::Extract that is able to
126 handle most common formats. In order to handle other formats or
127 archives requiring some special treatment you may want to override this
128 method.
129
130 alien_do_system
131 [version 0.024]
132
133 my %result = $amb->alien_do_system($cmd)
134
135 Similar to Module::Build::do_system, also sets the path and several
136 environment variables in accordance to the object configuration (i.e.
137 "alien_bin_requires") and performs the interpolation of the patterns
138 described in "COMMAND INTERPOLATION" in Alien::Base::ModuleBuild::API.
139
140 Returns a set of key value pairs including "stdout", "stderr",
141 "success" and "command".
142
144 The documentation for "Module::Build" is broken up into sections:
145
146 General Usage (Module::Build)
147 This is the landing document for Alien::Base::ModuleBuild's parent
148 class. It describes basic usage and background information. Its
149 main purpose is to assist the user who wants to learn how to invoke
150 and control "Module::Build" scripts at the command line.
151
152 It also lists the extra documentation for its use. Users and
153 authors of Alien:: modules should familiarize themselves with these
154 documents. Module::Build::API is of particular importance to
155 authors.
156
157 Alien-Specific Usage (Alien::Base::ModuleBuild)
158 This is the document you are currently reading.
159
160 Authoring Reference (Alien::Base::Authoring)
161 This document describes the structure and organization of
162 "Alien::Base" based projects, beyond that contained in
163 "Module::Build::Authoring", and the relevant concepts needed by
164 authors who are writing Build.PL scripts for a distribution or
165 controlling "Alien::Base::ModuleBuild" processes programmatically.
166
167 Note that as it contains information both for the build and use
168 phases of Alien::Base projects, it is located in the upper
169 namespace.
170
171 API Reference (Alien::Base::ModuleBuild::API)
172 This is a reference to the "Alien::Base::ModuleBuild" API beyond
173 that contained in "Module::Build::API".
174
176 ALIEN_VERBOSE
177 Enables verbose output from M::B::do_system.
178
179 ALIEN_FORCE
180 Skips checking for an installed version and forces reinstalling the
181 Alien target.
182
183 ALIEN_INSTALL_TYPE
184 Set to 'share' or 'system' to override the install type. Set to
185 'default' or unset to restore the default.
186
187 ALIEN_ARCH
188 Set to a true value to install to an arch-specific directory.
189
190 ALIEN_${MODULENAME}_REPO_${PROTOCOL}_${KEY}
191 Overrides $KEY in the given module's repository configuration
192 matching $PROTOCOL. For example,
193 "ALIEN_OPENSSL_REPO_FTP_HOST=ftp.example.com".
194
196 Alien::Build
197 alienfile
198 Alien::Build::Manual::AlienAuthor
199 Alien
200
202 <http://github.com/Perl5-Alien/Alien-Base-ModuleBuild>
203
205 Original author: Joel Berger, <joel.a.berger@gmail.com>
206
207 Current maintainer: Graham Ollis <plicease@cpan.org> and the
208 Alien::Base team
209
211 David Mertens (run4flat)
212 Mark Nunberg (mordy, mnunberg)
213 Christian Walde (Mithaldu)
214 Brian Wightman (MidLifeXis)
215 Graham Ollis (plicease)
216 Zaki Mughal (zmughal)
217 mohawk2
218 Vikas N Kumar (vikasnkumar)
219 Flavio Poletti (polettix)
220 Salvador Fandin~o (salva)
221 Gianni Ceccarelli (dakkar)
222 Pavel Shaydo (zwon, trinitum)
223 Kang-min Liu (XXX, gugod)
224 Nicholas Shipp (nshp)
225 Petr Pisar (ppisar)
226
227 Thanks also to
228
229 Christian Walde (Mithaldu)
230 For productive conversations about component interoperablility.
231
232 kmx For writing Alien::Tidyp from which I drew many of my initial
233 ideas.
234
235 David Mertens (run4flat)
236 For productive conversations about implementation.
237
238 Mark Nunberg (mordy, mnunberg)
239 For graciously teaching me about rpath and dynamic loading,
240
242 Copyright (C) 2012-2017 by Joel Berger
243
244 This library is free software; you can redistribute it and/or modify it
245 under the same terms as Perl itself.
246
247
248
249perl v5.28.1 2018-12-19 Alien::Base::ModuleBuild(3)