|
1 |
| -use strict; |
2 |
| -use warnings; |
3 |
| - |
4 |
| -use lib "inc"; |
5 |
| -use File::Spec::Functions qw(catdir catfile); |
6 |
| -use My::Utility qw(check_config_script check_src_build); |
7 |
| - |
8 |
| -#### we need the platform-specific module |
9 |
| -my %platforms =( |
10 |
| - # Unix = default, thus not listing all UNIX like systems |
11 |
| - MSWin32 => 'Windows', |
12 |
| -); |
13 |
| -my $package = 'My::Builder::' . ($platforms{$^O} || 'Unix'); |
14 |
| -print "Gonna use '$package' class ...\n"; |
15 |
| -eval "require $package" or die "Require '$package' failed: $@\n"; |
16 |
| - |
17 |
| -#### Stadard Module::Builder stuff |
18 |
| -my $build = $package->new( |
19 |
| - module_name => 'Alien::ODE', |
20 |
| - all_from => 'lib/Alien/ODE.pm', |
21 |
| - dist_author => 'KMX <[email protected]>', |
22 |
| - license => 'perl', |
23 |
| - requires => { |
24 |
| - 'File::Spec' => '0', |
25 |
| - 'File::ShareDir' => '0', |
26 |
| - }, |
27 |
| - build_requires => { #need to have for running: ./Build (install|test) |
28 |
| - 'File::Spec' => '0', |
29 |
| - 'File::ShareDir' => '0', |
30 |
| - 'File::Path' => '2.07', |
31 |
| - 'File::Copy' => '0', |
32 |
| - 'File::Fetch' => '0', |
33 |
| - 'File::Find' => '0', |
34 |
| - 'Digest::SHA' => '0', |
35 |
| - 'Archive::Extract' => '0', |
36 |
| - 'Archive::Tar' => '0', |
37 |
| - 'Module::Build' => '0.36', |
38 |
| - }, |
39 |
| - configure_requires => { #need to have for running: perl Buil.PL |
40 |
| - 'File::Spec' => '0', |
41 |
| - 'File::Path' => '2.07', |
42 |
| - 'File::Copy' => '0', |
43 |
| - 'File::Fetch' => '0', |
44 |
| - 'File::Find' => '0', |
45 |
| - 'Digest::SHA' => '0', |
46 |
| - 'Archive::Extract' => '0', |
47 |
| - 'Module::Build' => '0.36', |
48 |
| - }, |
49 |
| - meta_merge => { |
50 |
| - resources => { |
51 |
| - bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Alien-ODE', |
52 |
| - repository => 'http://github.com/PerlGameDev/Alien-ODE' |
53 |
| - } |
54 |
| - }, |
55 |
| - create_readme => 1, |
56 |
| - share_dir => 'sharedir', |
57 |
| - # sharedir is used for storing compiled/prebuilt binaries of ODE lib |
58 |
| - # avoid using 'share' name as M::B doe not handle well paths like /xx/yy/share/zz/ww/share/xx |
59 |
| -); |
60 |
| -$build->create_build_script(); |
61 |
| - |
62 |
| -#### clean build_done stamp; force rebuild when running 'Build' |
63 |
| -$build->clean_build_done_marker; |
64 |
| - |
65 |
| -print "\nWelcome to Alien::ODE module installation"; |
66 |
| -print "\n-----------------------------------------\n\n"; |
67 |
| - |
68 |
| -#### check what options we have for our platform |
69 |
| -my $rv; |
70 |
| -my @candidates = (); |
71 |
| - |
72 |
| -if($rv=check_src_build($build->os_type)) { |
73 |
| - push @candidates, @{$rv}; |
74 |
| -}; |
75 |
| - |
76 |
| -if($rv=check_config_script("ode-config")) { |
77 |
| - push @candidates, $rv; |
78 |
| -}; |
79 |
| - |
80 |
| -push @candidates, { title => 'Quit installation' }; |
81 |
| - |
82 |
| -#### ask user what way to go |
83 |
| -my $i = 1; |
84 |
| -my $prompt_string = "\nYou have the following options:\n"; |
85 |
| -foreach my $c (@candidates) { |
86 |
| - $prompt_string .= "[" . $i++ . "] " . $c->{title} . "\n" |
87 |
| -} |
88 |
| -$prompt_string .= "\nWhat way do you wanna go?"; |
89 |
| -my $ans = $build->prompt($prompt_string, 1); |
90 |
| - |
91 |
| -#### store build params into 'notes' |
92 |
| -if(($ans>0) && ($ans<scalar(@candidates))) { |
93 |
| - $build->notes('build_params', $candidates[$ans-1]); |
94 |
| -} |
95 |
| -else { |
96 |
| - $build->notes('build_params', undef); # just to be sure |
97 |
| -} |
| 1 | +use strict; |
| 2 | +use warnings; |
| 3 | + |
| 4 | +use lib "inc"; |
| 5 | +use File::Spec::Functions qw(catdir catfile); |
| 6 | +use My::Utility qw(check_config_script check_src_build); |
| 7 | + |
| 8 | +#### we need the platform-specific module |
| 9 | +my %platforms =( |
| 10 | + # Unix = default, thus not listing all UNIX like systems |
| 11 | + MSWin32 => 'Windows', |
| 12 | +); |
| 13 | +my $package = 'My::Builder::' . ($platforms{$^O} || 'Unix'); |
| 14 | +print "Gonna use '$package' class ...\n"; |
| 15 | +eval "require $package" or die "Require '$package' failed: $@\n"; |
| 16 | + |
| 17 | +#### Stadard Module::Builder stuff |
| 18 | +my $build = $package->new( |
| 19 | + module_name => 'Alien::Box2D', |
| 20 | + all_from => 'lib/Alien/Box2D.pm', |
| 21 | + dist_author => 'KMX <[email protected]>', |
| 22 | + license => 'perl', |
| 23 | + requires => { |
| 24 | + 'File::Spec' => '0', |
| 25 | + 'File::ShareDir' => '0', |
| 26 | + }, |
| 27 | + build_requires => { #need to have for running: ./Build (install|test) |
| 28 | + 'File::Spec' => '0', |
| 29 | + 'File::ShareDir' => '0', |
| 30 | + 'File::Path' => '2.07', |
| 31 | + 'File::Copy' => '0', |
| 32 | + 'File::Fetch' => '0', |
| 33 | + 'File::Find' => '0', |
| 34 | + 'Digest::SHA' => '0', |
| 35 | + 'Archive::Extract' => '0', |
| 36 | + 'Archive::Tar' => '0', |
| 37 | + 'Module::Build' => '0.36', |
| 38 | + }, |
| 39 | + configure_requires => { #need to have for running: perl Buil.PL |
| 40 | + 'File::Spec' => '0', |
| 41 | + 'File::Path' => '2.07', |
| 42 | + 'File::Copy' => '0', |
| 43 | + 'File::Fetch' => '0', |
| 44 | + 'File::Find' => '0', |
| 45 | + 'Digest::SHA' => '0', |
| 46 | + 'Archive::Extract' => '0', |
| 47 | + 'Module::Build' => '0.36', |
| 48 | + }, |
| 49 | + meta_merge => { |
| 50 | + resources => { |
| 51 | + bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Alien-Box2D', |
| 52 | + repository => 'http://github.com/PerlGameDev/Alien-Box2D' |
| 53 | + } |
| 54 | + }, |
| 55 | + create_readme => 1, |
| 56 | + share_dir => 'sharedir', |
| 57 | + # sharedir is used for storing compiled/prebuilt binaries of Box2D lib |
| 58 | + # avoid using 'share' name as M::B doe not handle well paths like /xx/yy/share/zz/ww/share/xx |
| 59 | +); |
| 60 | +$build->create_build_script(); |
| 61 | + |
| 62 | +#### clean build_done stamp; force rebuild when running 'Build' |
| 63 | +$build->clean_build_done_marker; |
| 64 | + |
| 65 | +print "\nWelcome to Alien::Box2D module installation"; |
| 66 | +print "\n-----------------------------------------\n\n"; |
| 67 | + |
| 68 | +#### check what options we have for our platform |
| 69 | +my $rv; |
| 70 | +my @candidates = (); |
| 71 | + |
| 72 | +if($rv=check_src_build($build->os_type)) { |
| 73 | + push @candidates, @{$rv}; |
| 74 | +}; |
| 75 | + |
| 76 | +if($rv=check_config_script("ode-config")) { |
| 77 | + push @candidates, $rv; |
| 78 | +}; |
| 79 | + |
| 80 | +push @candidates, { title => 'Quit installation' }; |
| 81 | + |
| 82 | +#### ask user what way to go |
| 83 | +my $i = 1; |
| 84 | +my $prompt_string = "\nYou have the following options:\n"; |
| 85 | +foreach my $c (@candidates) { |
| 86 | + $prompt_string .= "[" . $i++ . "] " . $c->{title} . "\n" |
| 87 | +} |
| 88 | +$prompt_string .= "\nWhat way do you wanna go?"; |
| 89 | +my $ans = $build->prompt($prompt_string, 1); |
| 90 | + |
| 91 | +#### store build params into 'notes' |
| 92 | +if(($ans>0) && ($ans<scalar(@candidates))) { |
| 93 | + $build->notes('build_params', $candidates[$ans-1]); |
| 94 | +} |
| 95 | +else { |
| 96 | + $build->notes('build_params', undef); # just to be sure |
| 97 | +} |
0 commit comments