| 1 | #line 1 | ||||||||||
| 2 | package Module::Install::External; | ||||||||||
| 3 | |||||||||||
| 4 | # Provides dependency declarations for external non-Perl things | ||||||||||
| 5 | 1 | ▶ | |||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | use Module::Install::Base (); | ||||||||||
| 8 | 1 | ▶ | |||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use vars qw{$VERSION $ISCORE @ISA}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | BEGIN { | |||||||||
| 11 | 1 | $VERSION = '0.91'; | |||||||||
| 12 | 1 | $ISCORE = 1; | |||||||||
| 13 | @ISA = qw{Module::Install::Base}; | ||||||||||
| 14 | } | ||||||||||
| 15 | 1 | ▶ | |||||||||
|
Subroutine
requires_external_cc: called CC=2 SCAR=9.9
Pod
undocumented
| |||||||||||
| 16 | 1 | sub requires_external_cc { | |||||||||
| 17 | my $self = shift; | ||||||||||
| 18 | |||||||||||
| 19 | 1 | ▶ | # We need a C compiler, use the can_cc method for this | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 0 | unless ( $self->can_cc ) { | |||||||||
| 21 | 0 | print "Unresolvable missing external dependency.\n"; | |||||||||
| 22 | 0 | print "This package requires a C compiler.\n"; | |||||||||
| 23 | 0 | print STDERR "NA: Unable to build distribution on this platform.\n"; | |||||||||
| 24 | exit(0); | ||||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | # Unlike some of the other modules, while we need to specify a | ||||||||||
| 28 | # C compiler as a dep, it needs to be a build-time dependency. | ||||||||||
| 29 | 1 | ||||||||||
| 30 | 1; | ||||||||||
| 31 | } | ||||||||||
| 32 | 0 | ▶ | |||||||||
|
Subroutine
requires_external_bin: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 33 | 0 | sub requires_external_bin { | |||||||||
| 34 | 0 | ▶ | my ($self, $bin, $version) = @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | 0 | if ( $version ) { | |||||||||
| 36 | die "requires_external_bin does not support versions yet"; | ||||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | # Load the package containing can_run early, | ||||||||||
| 40 | 0 | # to avoid breaking the message below. | |||||||||
| 41 | $self->load('can_run'); | ||||||||||
| 42 | |||||||||||
| 43 | 0 | # Locate the bin | |||||||||
| 44 | 0 | print "Locating required external dependency bin:$bin..."; | |||||||||
| 45 | 0 | ▶ | my $found_bin = $self->can_run( $bin ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | 0 | if ( $found_bin ) { | |||||||||
| 47 | print " found at $found_bin.\n"; | ||||||||||
| 48 | 0 | } else { | |||||||||
| 49 | 0 | print " missing.\n"; | |||||||||
| 50 | 0 | print "Unresolvable missing external dependency.\n"; | |||||||||
| 51 | 0 | print "Please install '$bin' seperately and try again.\n"; | |||||||||
| 52 | 0 | print STDERR "NA: Unable to build distribution on this platform.\n"; | |||||||||
| 53 | exit(0); | ||||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | # Once we have some way to specify external deps, do it here. | ||||||||||
| 57 | # In the mean time, continue as normal. | ||||||||||
| 58 | 0 | ||||||||||
| 59 | 1; | ||||||||||
| 60 | } | ||||||||||
| 61 | 1 | ||||||||||
| 62 | 1; | ||||||||||
| 63 | |||||||||||
| 64 | __END__ | ||||||||||