Update package saga gis (#13520)

* Improvements of saga-gis package

* Added explicit version ranges for old saga-gis version

* Update var/spack/repos/builtin/packages/saga-gis/package.py

Creative usage of redefinition of getter method

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>

* Update var/spack/repos/builtin/packages/saga-gis/package.py

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>

* Update var/spack/repos/builtin/packages/saga-gis/package.py

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
Jannek Squar 2019-11-04 00:26:53 +01:00 committed by Adam J. Stewart
parent ed89825557
commit ed037d0c5d

View File

@ -17,6 +17,7 @@ class SagaGis(AutotoolsPackage):
git = "git://git.code.sf.net/p/saga-gis/code"
version('develop', branch='master')
version('7.4.0', branch='release-7.4.0')
version('7.3.0', branch='release-7.3.0')
version('7.1.1', branch='release-7.1.1')
version('7.1.0', branch='release-7.1.0')
@ -38,31 +39,52 @@ class SagaGis(AutotoolsPackage):
variant('gui', default=True, description='Build GUI and interactive SAGA tools')
variant('odbc', default=True, description='Build with ODBC support')
# FIXME Saga-gis configure file disables triangle even if
# --enable-triangle flag is used
# variant('triangle', default=True, description='Build with triangle.c
# non free for commercial use otherwise use qhull')
variant('libfire', default=True, description='Build with libfire (non free for commercial usage)')
variant('openmp', default=True, description='Build with OpenMP enabled')
variant('python', default=False, description='Build Python extension')
variant('libfire', default=True, description='Build with libfire (non free for commercial usage)')
variant('openmp', default=True, description='Build with OpenMP enabled')
variant('python', default=False, description='Build Python extension')
variant('postgresql', default=False, description='Build with PostgreSQL library')
variant('opencv', default=False, description='Build with libraries using OpenCV')
depends_on('autoconf', type='build')
depends_on('automake', type='build')
depends_on('libtool', type='build')
depends_on('m4', type='build')
# FIXME unnecessary dependency on python3 because of implicit python3
# dependency through meson by a dependency of wx/gtkplus
depends_on('python@3:')
depends_on('libharu')
depends_on('wxwidgets')
depends_on('gdal')
depends_on('proj@:5')
depends_on('postgresql', when='+postgresql')
depends_on('unixodbc', when='+odbc')
# SAGA-GIS requires projects.h from proj
depends_on('proj')
# https://sourceforge.net/p/saga-gis/bugs/271/
depends_on('proj@:5', when='@:7.2.999')
# Saga-Gis depends on legacy opencv API removed in opencv 4.x
depends_on('opencv@:3', when='+opencv')
# Set jpeg provider (similar to #8133)
depends_on('libjpeg', when='+opencv')
# Set hl variant due to similar issue #7145
depends_on('hdf5+hl')
# write support for grib2 is available since 2.3.0 (https://gdal.org/drivers/raster/grib.html)
depends_on('gdal@2.3:+grib+hdf5+netcdf')
depends_on('gdal@2.3:2.4+grib+hdf5+netcdf', when='@:7.2.999')
depends_on('libgeotiff@:1.4', when='@:7.2.999')
# FIXME Saga-Gis uses a wrong include path
# depends_on('qhull', when='~triangle')
depends_on('swig', type='build', when='+python')
extends('python', when='+python')
configure_directory = "saga-gis"
@ -79,5 +101,11 @@ def configure_args(self):
args += self.enable_or_disable('libfire')
args += self.enable_or_disable('openmp')
args += self.enable_or_disable('python')
args += self.with_or_without('postgresql')
return args
def setup_run_environment(self, env):
# Point saga to its tool set, will be loaded during runtime
env.set("SAGA_MLB", self.prefix.lib.saga)
env.set("SAGA_TLB", self.prefix.lib.saga)