Permalink
Browse files

Added logic which detects compiled libraries in share_dir

  • Loading branch information...
1 parent 5ec2b3f commit 02f8e60c95a23f2565248d8656a3a972147f3162 @jberger jberger committed Oct 24, 2011
Showing with 33 additions and 2 deletions.
  1. +0 −1 .gitignore
  2. +15 −0 MANIFEST.SKIP
  3. +18 −1 builder/My/Builder.pm
  4. 0 {bin → script}/gsl-config.pl
View
1 .gitignore
@@ -1,5 +1,4 @@
Build
-MANIFEST
*META*
_build/*
blib/*
View
15 MANIFEST.SKIP
@@ -0,0 +1,15 @@
+#!include_default
+# Avoid configuration metadata file
+^MYMETA\.
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\bBuild.bat$
+\b_build
+\bBuild.COM$
+\bBUILD.COM$
+\bbuild.com$
+^MANIFEST\.SKIP
+
+# Avoid archives of this distribution
+\bAlien-GSL-[\d\.\_]+
View
19 builder/My/Builder.pm
@@ -65,7 +65,10 @@ sub ACTION_code {
my $have_version = $self->have_gsl_version;
- if ( $have_version and ! $self->args('Force') and ! $self->args('ShareDir') ) {
+ if ($self->is_share_dir_populated()) {
+ print "Found GSL in share_dir\n";
+
+ } elsif ( $have_version and ! $self->args('Force') and ! $self->args('ShareDir') ) {
print "Found system-wide installation of GSL. This will be used by Alien::GSL.\n";
$self->config_data( location => 'system' );
@@ -102,6 +105,20 @@ sub ACTION_install {
}
}
+sub is_share_dir_populated {
+ my $self = shift;
+
+ local $CWD = 'share_dir';
+ return 0 unless (-d 'lib');
+
+ push @CWD, 'lib';
+
+ opendir(my $dh, $CWD);
+ my @found = grep { /gsl/ } readdir($dh);
+
+ return !! @found;
+}
+
sub rewrite_pc_file {
my $self = shift;
View
0 bin/gsl-config.pl → script/gsl-config.pl
File renamed without changes.

0 comments on commit 02f8e60

Please sign in to comment.