-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.PL
64 lines (59 loc) · 1.96 KB
/
Build.PL
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use strict;
use warnings;
use lib 'inc';
use My::ModuleBuild;
use Config;
my $cflags = '';
my $libs
= join( ' ', '-lchipmunk', grep( /^-lm$/, split /\s+/, $Config{libs} ) );
if ( $ENV{ALIEN_CHIPMUNK_PREFIX} ) {
$cflags = "-I$ENV{ALIEN_CHIPMUNK_PREFIX}/include/chipmunk";
$libs = "-L$ENV{ALIEN_CHIPMUNK_PREFIX}/lib $libs";
}
else {
foreach
my $dir ( map {"$_/chipmunk"} qw( /usr/include /usr/local/include ) )
{
if ( -r "$dir/chipmunk.h" ) {
$cflags = "-I$dir";
}
}
}
my $builder = My::ModuleBuild->new(
module_name => 'Alien::Chipmunk',
dist_abstract => 'Build and install the Chipmunk Physics library',
dist_author => 'Jeffrey T. Palmer <[email protected]>',
license => 'mit',
configure_requires => {
'Module::Build' => 0,
'Alien::Base::ModuleBuild' => 0,
},
build_requires => { 'Test::More' => 0, },
alien_bin_requires => { 'Alien::CMake' => '0.03', },
requires => {
'perl' => '5.8.1',
'Alien::Base' => '0.020',
},
add_to_cleanup => [ 't/src/test.o', 't/src/test' ],
meta_merge => {
resources => {
homepage => 'https://github.com/jtpalmer/Alien-Chipmunk',
repository => 'https://github.com/jtpalmer/Alien-Chipmunk.git',
bugtracker => 'https://github.com/jtpalmer/Alien-Chipmunk/issues',
},
},
alien_name => 'chipmunk',
alien_isolate_dynamic => 1,
alien_provides_cflags => $cflags,
alien_provides_libs => $libs,
alien_repository => {
protocol => 'http',
host => 'chipmunk-physics.net',
location => '/release/Chipmunk-6.x',
pattern => qr/Chipmunk-([\d\.]+)\.tgz$/,
},
alien_build_commands =>
[ 'cmake -DBUILD_DEMOS=OFF -DCMAKE_INSTALL_PREFIX=%s', 'make', ],
alien_install_commands => ['make install'],
);
$builder->create_build_script;