Alien-spatialite
view release on metacpan or search on metacpan
my $with_cpp11 = '';
start_url 'https://www.gaia-gis.it/gaia-sins/libspatialite-sources/';
#start_url "file://$base_dir"; # debug
plugin Download => (
filter => qr/^libspatialite-([0-9\.]+[a-z]?)\.tar\.gz$/,
version => qr/^libspatialite-([0-9\.]+[a-z]?)\.tar\.gz$/,
);
my $lib_version = get_lib_version() // 'not yet defined';
say "Downloaded spatialite version is $lib_version";
plugin Extract => (format => 'tar.gz');
plugin 'Build::Autoconf' => ();
plugin 'PkgConfig::PPWrapper';
my $build_static = ($^O =~ /mswin/i) ? '' : '--disable-shared';
#$build_static = '';
#$build_static = '--enable-static=no'; # override - needed? leftover from gdal
--enable-libxml2=no
--enable-examples=no
--enable-minizip=no
--disable-rttopo
--disable-gcp
/);
# see if this helps with cirrus bsd builds
#$ENV{SQLITE3_CFLAGS} = Alien::sqlite->cflags;
#$ENV{SQLITE3_LIBS} = Alien::sqlite->libs;
#say "sqlite cflags: " . Alien::sqlite->cflags;
#say "sqlite libs: " . Alien::sqlite->libs;
if ($^O =~ /bsd/) {
plugin 'Build::Make' => 'gmake';
if (-d '/usr/local') {
$with_local = ' --with-local=/usr/local ';
}
if (!-e '/usr/local/include/sqlite3.h' && Alien::sqlite->install_type eq 'system') {
warn '/usr/local/include/sqlite3.h does not exist, '
. 'you might need to install the sqlite package for your system, '
. 'or install a share version of Alien::sqlite';
# might need to be combined with bsd check above
# but not sure if /usr/local is needed yet
plugin 'Build::Make' => 'gmake';
}
my $make_cmd = '%{make}';
my $make_inst_cmd = '%{make} install';
my @make_clean;
# try not to exceed the cpan-testers log limits
if ($on_automated_rig) {
say "Running under CI or automated testing";
$make_cmd .= q/ | perl -ne "BEGIN {$|=1; open our $log, q|>|, q|build.log|}; print qq|\n| if 0 == ($. %% 100); print q|.|; print {$log} $_;" || type build.log/;
$make_inst_cmd .= q/ | perl -ne "BEGIN {$|=1; open our $log, q|>|, q|install.log|}; print qq|\n| if 0 == ($. %% 100); print q|.|; print {$log} $_;" || type install.log/;
if (!$on_windows) {
$make_cmd =~ s/%%/%/;
$make_cmd =~ s/type/cat/;
$make_cmd =~ s/"/'/g;
$make_inst_cmd =~ s/%%/%/;
$make_inst_cmd =~ s/type/cat/;
$make_inst_cmd =~ s/"/'/g;
}
$build->log ("Setting compiler flag env vars to -O2");
$orig->($build, @args);
}
sub pause {
return; # re-enable in case of debug
return if $on_automated_rig;
return if !$on_windows;
say "CONTINUE?";
my $response = <>;
while (not $response =~ /yes/) {
$response = <>;
}
}
sub get_lib_version {
my $h = get_alien_state_hash();
return $h->{runtime}{version};
( run in 1.483 second using v1.01-cache-2.11-cpan-483215c6ad5 )