2019-01-01 14:04:23 +08:00
|
|
|
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
|
2018-12-18 09:10:50 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
from spack import *
|
|
|
|
|
|
|
|
|
|
|
|
class SagaGis(AutotoolsPackage):
|
|
|
|
"""
|
|
|
|
SAGA is a GIS for Automated Geoscientific Analyses and has been designed
|
|
|
|
for an easy and effective implementation of spatial algorithms. It offers
|
|
|
|
a comprehensive, growing set of geoscientific methods and provides an
|
|
|
|
easily approachable user interface with many visualisation options
|
|
|
|
"""
|
|
|
|
homepage = "http://saga-gis.org/"
|
|
|
|
url = "https://sourceforge.net/projects/saga-gis/files/SAGA%20-%205/SAGA%20-%205.0.0/saga-5.0.0.tar.gz"
|
|
|
|
git = "git://git.code.sf.net/p/saga-gis/code"
|
|
|
|
|
|
|
|
version('develop', branch='master')
|
2019-11-04 07:26:53 +08:00
|
|
|
version('7.4.0', branch='release-7.4.0')
|
2019-03-20 12:03:14 +08:00
|
|
|
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')
|
|
|
|
version('7.0.0', branch='release-7.0.0')
|
2018-12-18 09:10:50 +08:00
|
|
|
version('6.4.0', branch='release-6.4.0')
|
|
|
|
version('6.3.0', branch='release-6.3.0')
|
|
|
|
version('6.2.0', branch='release-6.2.0')
|
|
|
|
version('6.1.0', branch='release-6.1.0')
|
|
|
|
version('6.0.0', branch='release-6.0.0')
|
|
|
|
version('5.0.1', branch='release-5-0-1')
|
|
|
|
version('5.0.0', branch='release-5.0.0')
|
|
|
|
version('4.1.0', branch='release-4.1.0')
|
|
|
|
version('4.0.0', branch='release-4.0.0')
|
|
|
|
version('4.0.0', branch='release-4.0.0')
|
|
|
|
version('3.0.0', branch='release-3.0.0')
|
|
|
|
version('2.3-lts', branch='release-2-3-lts')
|
|
|
|
version('2.3.1', branch='release-2-3-1')
|
|
|
|
version('2.3.0', branch='release-2-3-0')
|
|
|
|
|
|
|
|
variant('gui', default=True, description='Build GUI and interactive SAGA tools')
|
|
|
|
variant('odbc', default=True, description='Build with ODBC support')
|
2019-11-04 07:26:53 +08:00
|
|
|
|
2018-12-18 09:10:50 +08:00
|
|
|
# FIXME Saga-gis configure file disables triangle even if
|
|
|
|
# --enable-triangle flag is used
|
|
|
|
# variant('triangle', default=True, description='Build with triangle.c
|
2019-11-04 07:26:53 +08:00
|
|
|
|
2018-12-18 09:10:50 +08:00
|
|
|
# non free for commercial use otherwise use qhull')
|
2019-11-04 07:26:53 +08:00
|
|
|
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')
|
2018-12-18 09:10:50 +08:00
|
|
|
|
|
|
|
depends_on('autoconf', type='build')
|
|
|
|
depends_on('automake', type='build')
|
|
|
|
depends_on('libtool', type='build')
|
|
|
|
depends_on('m4', type='build')
|
|
|
|
|
2019-11-04 07:26:53 +08:00
|
|
|
depends_on('libharu')
|
2019-07-31 06:13:32 +08:00
|
|
|
depends_on('wxwidgets')
|
2019-11-04 07:26:53 +08:00
|
|
|
depends_on('postgresql', when='+postgresql')
|
2018-12-18 09:10:50 +08:00
|
|
|
depends_on('unixodbc', when='+odbc')
|
2019-11-04 07:26:53 +08:00
|
|
|
|
|
|
|
# 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')
|
|
|
|
|
2018-12-18 09:10:50 +08:00
|
|
|
# FIXME Saga-Gis uses a wrong include path
|
|
|
|
# depends_on('qhull', when='~triangle')
|
2019-11-04 07:26:53 +08:00
|
|
|
|
2018-12-18 09:10:50 +08:00
|
|
|
depends_on('swig', type='build', when='+python')
|
2019-11-04 07:26:53 +08:00
|
|
|
extends('python', when='+python')
|
2018-12-18 09:10:50 +08:00
|
|
|
|
|
|
|
configure_directory = "saga-gis"
|
|
|
|
|
|
|
|
def configure_args(self):
|
|
|
|
args = []
|
|
|
|
args += self.enable_or_disable('gui')
|
|
|
|
args += self.enable_or_disable('odbc')
|
|
|
|
# FIXME Saga-gis configure file disables triangle even if
|
|
|
|
# --enable-triangle flag is used
|
|
|
|
# args += self.enable_or_disable('triangle')
|
|
|
|
# FIXME SAGA-GIS uses a wrong include path
|
|
|
|
# if '~triangle' in self.spec:
|
|
|
|
# args.append('--disable-triangle')
|
|
|
|
args += self.enable_or_disable('libfire')
|
|
|
|
args += self.enable_or_disable('openmp')
|
|
|
|
args += self.enable_or_disable('python')
|
2019-11-04 07:26:53 +08:00
|
|
|
args += self.with_or_without('postgresql')
|
2018-12-18 09:10:50 +08:00
|
|
|
|
|
|
|
return args
|
2019-11-04 07:26:53 +08:00
|
|
|
|
|
|
|
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)
|