# This is a patch for Math-GSL-0.27.orig to update it to Math-GSL-0.27
#
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
#
http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'patch' program with this file as input.
#
#### End of Preamble ####
#### Patch data follows ####
diff -c 'Math-GSL-0.27.orig/Build.PL' 'Math-GSL-0.27/Build.PL'
Index: ./Build.PL
*** ./Build.PL Sun Jul 8 23:24:47 2012
--- ./Build.PL Fri Mar 22 16:19:09 2013
***************
*** 104,113 ****
}
print "Checking for GSL..\n";
! chomp(my $gv = qx{gsl-config --version});
! chomp(my $gsl_prefix = qx{gsl-config --prefix});
! chomp(my $gsl_cflags = qx{gsl-config --cflags});
! chomp(my $gsl_libs = qx{gsl-config --libs});
my $MIN_GSL_VERSION = "1.11";
--- 104,122 ----
}
print "Checking for GSL..\n";
! # gsl provides both gsl-config and pkg-config's gsl.pc. Try the
! # latter, then the former
!
!
! my %gsl;
! ( %gsl = find_via_pkg_config()) or ( %gsl = find_via_gsl_config());
!
! die( q[
! ***
! *** Can't find GSL configuration info. Is GSL installed?
! *** Get GSL at
http://www.gnu.org/software/gsl
! ] ) unless %gsl;
!
my $MIN_GSL_VERSION = "1.11";
***************
*** 115,123 ****
open my $fh, ">", "$path_system" or die "Could not create $path_system : $!";
my $current_version;
! if (defined $gv) {
! if ($gv =~ m{\A(\d+(?:\.\d+)+)}) {
$current_version = $1;
my @current = split /\./, $current_version;
print $fh "#define GSL_MAJOR_VERSION $current[0]\n";
--- 124,133 ----
open my $fh, ">", "$path_system" or die "Could not create $path_system : $!";
+
my $current_version;
! if (defined $gsl{version}) {
! if ($gsl{version} =~ m{\A(\d+(?:\.\d+)+)}) {
$current_version = $1;
my @current = split /\./, $current_version;
print $fh "#define GSL_MAJOR_VERSION $current[0]\n";
***************
*** 126,164 ****
if (GSLBuilder::cmp_versions($current_version, $MIN_GSL_VERSION) == -1) {
printf "
***
! *** You need to have GSL %s or greater installed. (You have $gv).
*** Get GSL at
http://www.gnu.org/software/gsl\n", $MIN_GSL_VERSION;
exit 1;
} else {
! print "Found GSL $gv (via gsl-config) installed in $gsl_prefix, CFLAGS=$gsl_cflags, $gsl_libs\n";
}
} else {
print "
***
! *** Can't parse GSL version $gv.
*** Will continue and keep my fingers crossed for luck.
";
}
- } else {
- print "
- ***
- *** Can't find GSL configuration info. Is GSL installed?
- *** Get GSL at
http://www.gnu.org/software/gsl
- ";
- exit 1;
}
-
close $fh or die "Could not close $path_system : $!";
! modify_env();
!
! print "Asking ExtUtils::PkgConfig with ENV{PKG_CONFIG_PATH}=" . ($ENV{PKG_CONFIG_PATH} || '') . "\n";
! my %gsl_pkgcfg = ExtUtils::PkgConfig->find ('gsl');
! my $pkgcfg_ver = $gsl_pkgcfg{'modversion'};
!
! warn "pkgconfig version $pkgcfg_ver != gsl-config $gv possible misconfiguration" if $pkgcfg_ver ne $gv;
!
! my $ccflags = $gsl_pkgcfg{cflags};
# In case GSL in installed in the system-wide directory, $ccflags is
# empty (because pkg-config remove -I/usr/include), but swig needs it
--- 136,158 ----
if (GSLBuilder::cmp_versions($current_version, $MIN_GSL_VERSION) == -1) {
printf "
***
! *** You need to have GSL %s or greater installed. (You have $gsl{version}).
*** Get GSL at
http://www.gnu.org/software/gsl\n", $MIN_GSL_VERSION;
exit 1;
} else {
! print "Found GSL $gsl{version}, CFLAGS=$gsl{cflags}, LIBS=$gsl{libs}\n";
}
} else {
print "
***
! *** Can't parse GSL version $gsl{version}.
*** Will continue and keep my fingers crossed for luck.
";
}
}
close $fh or die "Could not close $path_system : $!";
! my $ccflags = $gsl{cflags};
# In case GSL in installed in the system-wide directory, $ccflags is
# empty (because pkg-config remove -I/usr/include), but swig needs it
***************
*** 178,185 ****
$ccflags .= try_cflags("-g");
! my $ldflags = "$gsl_pkgcfg{libs} -gsl";
! $swig_flags = "$gsl_pkgcfg{cflags} $swig_flags";
if ( GSLBuilder::is_cygwin() && $Config{shrpenv} =~ m{\Aenv LD_RUN_PATH=(.*)\Z} ) {
$ldflags .= " -L$1 -lperl";
--- 172,179 ----
$ccflags .= try_cflags("-g");
! my $ldflags = "$gsl{libs} -gsl";
! $swig_flags = "$gsl{cflags} $swig_flags";
if ( GSLBuilder::is_cygwin() && $Config{shrpenv} =~ m{\Aenv LD_RUN_PATH=(.*)\Z} ) {
$ldflags .= " -L$1 -lperl";
***************
*** 276,282 ****
}
}
! sub modify_env {
$ENV{PKG_CONFIG_PATH} ||= '';
# TODO: What about windows and darwin?
--- 270,307 ----
}
}
!
!
! sub find_via_gsl_config {
!
! my %info;
!
! for my $what ( [ version => '--version' ],
! [ prefix => '--prefix' ],
! [ cflags => '--cflags' ],
! [ libs => '--libs' ]
! ) {
!
! {
!
! my ($key, $flag ) = @$what;
!
! $info{$key} = qx{gsl-config $flag};
! if ( $! ) {
! warn "error running gsl-config $flag: $!\n";
! return ();
! }
! }
!
! return %info;
!
! }
!
! }
!
!
! sub find_via_pkg_config {
!
$ENV{PKG_CONFIG_PATH} ||= '';
# TODO: What about windows and darwin?
***************
*** 284,288 ****
/usr/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/pkgconfig:/usr/libdata/pkgconfig:/usr/local/libdata/pkgconfig:/opt/pkgconfig:
CARGOCULT
! $ENV{PKG_CONFIG_PATH} = $guess . $ENV{PKG_CONFIG_PATH};
}
--- 309,326 ----
/usr/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/pkgconfig:/usr/libdata/pkgconfig:/usr/local/libdata/pkgconfig:/opt/pkgconfig:
CARGOCULT
! chomp $guess;
! $ENV{PKG_CONFIG_PATH} = join( ':', $ENV{PKG_CONFIG_PATH}, $guess );
!
! # this will die if not found
! my %info = eval { ExtUtils::PkgConfig->find ('gsl') };
!
! if ( $@ ) {
! warn $@;
! return ();
! }
!
! $info{version} = delete $info{modversion};
!
! return %info;
}
#### End of Patch data ####
#### ApplyPatch data follows ####
# Data version : 1.0
# Date generated : Fri Mar 22 16:24:00 2013
# Generated by : makepatch 2.04
# Recurse directories : Yes
# Excluded files : (\A|/).*\~\Z
# (\A|/).*\.a\Z
# (\A|/).*\.bak\Z
# (\A|/).*\.BAK\Z
# (\A|/).*\.elc\Z
# (\A|/).*\.exe\Z
# (\A|/).*\.gz\Z
# (\A|/).*\.ln\Z
# (\A|/).*\.o\Z
# (\A|/).*\.obj\Z
# (\A|/).*\.olb\Z
# (\A|/).*\.old\Z
# (\A|/).*\.orig\Z
# (\A|/).*\.rej\Z
# (\A|/).*\.so\Z
# (\A|/).*\.Z\Z
# (\A|/)\.del\-.*\Z
# (\A|/)\.make\.state\Z
# (\A|/)\.nse_depinfo\Z
# (\A|/)core\Z
# (\A|/)tags\Z
# (\A|/)TAGS\Z
# p 'Build.PL' 8597 1363983549 0100444
#### End of ApplyPatch data ####
#### End of Patch kit [created: Fri Mar 22 16:24:00 2013] ####
#### Patch checksum: 250 7088 40080 ####
#### Checksum: 268 7781 31641 ####