summaryrefslogtreecommitdiff
path: root/Build.PL
blob: fd68150b30cc91c33b9af4dc43ff2210bf018284 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!perl 
use strict;
use warnings;
use Alien::Base::ModuleBuild;
 
my $mb = Alien::Base::ModuleBuild->new(
    dist_name => 'Alien-QREncode',
    module_name => 'Alien::QREncode',
 
    alien_name => 'qrencode',
    alien_inline_auto_include => ['qrencode.h'],
    alien_repository => {
        protocol => 'https',
        host => 'fukuchi.org',
        location => '/works/qrencode/index.html.en',
        pattern => qr{^qrencode-(.*?)\.tar\.bz2$},
    },
    configure_requires  => { 'Alien::Base::ModuleBuild' => '0.022' },
    alien_version_check => '%{pkg_config} --atleast-version 3.4.4 %n && %{pkg_config} --modversion %n',
 
    license => 'gpl',
);
 
my %png_check = $mb->alien_do_system('%{pkg_config} libpng');
my %sdl_check = $mb->alien_do_system('%{pkg_config} sdl');
 
if ($png_check{success} && $sdl_check{success}) {
    $mb->alien_build_commands([
        '%c --prefix=%s --with-tests',
        'make',
    ]);
    $mb->alien_test_commands([
        'cd tests && ./create_frame_pattern frame',
        'cd tests && ./test_all.sh',
    ]);
}
 
$mb->create_build_script;