From 5066c335b9d84abb5515eb6aae55c54159d97bc3 Mon Sep 17 00:00:00 2001 From: Slaven Rezic Date: Mon, 20 May 2024 18:11:08 +0200 Subject: [PATCH] ALIEN_PROJ_CONFIG_ARGS may contain --max-proj-version --- alienfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/alienfile b/alienfile index e508ce0..55ebd93 100755 --- a/alienfile +++ b/alienfile @@ -107,11 +107,20 @@ share { # say "libtiff libs: $ENV{TIFF_LIBS}"; #} + my $config_args = $ENV{ALIEN_PROJ_CONFIG_ARGS} // ''; + $config_args =~ s/[^-\s\w,=.]//g; # overkill? if ($on_windows) { # there are issues with strawberry perl's gcc plugin 'Prefer::BadVersion' => '7.1.0'; } + if ($config_args =~ /--max-proj-version=(\S+)/) { + my $max_proj_version = $1; + if ($max_proj_version !~ /^\d+\.\d+\.\d+$/) { + die "--max-proj-version value '$max_proj_version' does not look like a version.\n"; + } + plugin 'Prefer::BadVersion' => sub { my($file) = @_; versioncmp($file->{version}, $max_proj_version) >= 0 }; + } start_url 'https://download.osgeo.org/proj/'; #start_url "file://$base_dir"; # debug @@ -174,8 +183,6 @@ share { } } - my $config_args = $ENV{ALIEN_PROJ_CONFIG_ARGS} // ''; - $config_args =~ s/[^-\s\w,=]//g; # overkill? my $enable_tiff = 'OFF'; my $enable_curl = 'OFF'; my @curl_extra_args; -- 2.11.0