Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use manually entered libs/cflags if present or system-wide libs/cflag…

…s library was found in system
  • Loading branch information...
commit c790a80e6d2d974005b105feee3ca2221d1b279c 1 parent 27a981f
@jberger jberger authored
Showing with 25 additions and 4 deletions.
  1. +15 −0 lib/Alien/Base.pm
  2. +10 −4 lib/Alien/Base/ModuleBuild.pm
View
15 lib/Alien/Base.pm
@@ -54,6 +54,21 @@ sub _keyword {
my $self = shift;
my $keyword = shift;
+ # use manually entered info if it exists
+ # alien_provides_*
+ my $manual_data = $self->config($keyword);
+ return $manual_data if defined $manual_data;
+
+ # use pkg-config if installed system-wide
+ my $type = $self->config('install_type');
+ if ($type eq 'system') {
+ my $name = $self->config('name');
+ my $pcdata = `pkg-config --\L$keyword\E $name`;
+ croak "Could not call pkg-config: $!" if $!;
+ return $pcdata;
+ }
+
+ # use parsed info from build .pc file
my $dist_dir = $self->_find_dist_dir;
my @pc = $self->pkgconfig(@_);
my @strings =
View
14 lib/Alien/Base/ModuleBuild.pm
@@ -93,6 +93,9 @@ __PACKAGE__->add_property( 'alien_repository_class' => {} );
# pkgconfig: hashref of A::B::PkgConfig objects created from .pc file found in build_share_dir
# install_type: either system or share
# version: version number installed or available
+# Cflags: holder for cflags if manually specified
+# Libs: same but libs
+# name: holder for name as needed by pkg-config
############################
# Initialization Methods #
@@ -198,15 +201,17 @@ sub alien_init_temp_dir {
}
}
-#TODO this method not used yet
sub alien_init_configdata {
my $self = shift;
my $cflags = $self->alien_provides_cflags;
- $self->config_data( cflags => $cflags );
+ $self->config_data( Cflags => $cflags );
my $libs = $self->alien_provides_libs;
- $self->config_data( libs => $libs );
+ $self->config_data( Libs => $libs );
+
+ my $name = $self->alien_name;
+ $self->config_data( name => $name );
}
####################
@@ -222,8 +227,9 @@ sub ACTION_code {
sub ACTION_alien {
my $self = shift;
- my $version;
+ $self->alien_init_configdata;
+ my $version;
$version = $self->alien_check_installed_version
unless $Force;
Please sign in to comment.
Something went wrong with that request. Please try again.