example/xz-manual.alienfile

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 14 / 14 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
__ANON__
1.0
CRAP 1.0
« example/curl.alienfile ↑ Summary example/xz.alienfile »
1 1 ▶use alienfile;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 # see xz.alienfile for a more reliable and portable
4 # example that uses plugins.
5  
6 # Use pkg-config to check if the library exists.
7 # also, use which to check that the xz command is
8 # in the path.
9 1 probe [
10 'pkg-config --exists liblzma',
11 'which xz',
12 ];
13  
14 1 ▶share {
Subroutine __ANON__: called CC=1 SCAR=0.0
15  
16 1 start_url 'http://tukaani.org/xz/xz-5.2.3.tar.gz';
17  
18 # the first one which succeeds will be used
19 1 download [ 'wget %{.meta.start_url}' ];
20 1 download [ 'curl -O %{.meta.start_url}' ];
21  
22 # use tar to extract the tarball
23 1 extract [ 'tar zxf %{.install.download}' ];
24  
25 # use the standard build process
26 1 build [
27 './configure --prefix=%{.install.prefix} --disable-shared',
28 '%{make}',
29 '%{make} install',
30 ];
31  
32 # This package doesn't build a dynamic library by default, but if
33 # it did this would make sure that it wasn't used with XS.
34 # (See Alien::Build::Manual::AlienAuthor for details).
35 1 plugin 'Gather::IsolateDynamic';
36  
37 1 };
38  
39 # You can specify individual gather steps in share {} or
40 # sys {} too, but for many cases the same procedure can
41 # be used for both.
42 1 gather [
43 # store the (chomped) output into the appropriate runtime properties
44 [ 'pkg-config', '--modversion', 'liblzma', \'%{.runtime.version}' ],
45 [ 'pkg-config', '--cflags', 'liblzma', \'%{.runtime.cflags}' ],
46 [ 'pkg-config', '--libs', 'liblzma', \'%{.runtime.libs}' ],
47 ];
« example/curl.alienfile ↑ Summary example/xz.alienfile »