Add GRASS 7.8.0 (#13026)

* Add GRASS 7.8.0

* Add new variants/dependencies

* Remove unused dep

* Filter entire libiconv line
This commit is contained in:
Adam J. Stewart 2019-10-31 12:48:54 -05:00 committed by GitHub
parent a334007808
commit b4a51084ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,8 +12,13 @@ class Grass(AutotoolsPackage):
used for geospatial data management and analysis, image processing, used for geospatial data management and analysis, image processing,
graphics and maps production, spatial modeling, and visualization.""" graphics and maps production, spatial modeling, and visualization."""
homepage = "http://grass.osgeo.org" homepage = "https://grass.osgeo.org"
url = "https://grass.osgeo.org/grass78/source/grass-7.8.0.tar.gz"
list_url = "https://grass.osgeo.org/download/software/sources/"
maintainers = ['adamjstewart']
version('7.8.0', sha256='4b1192294e959ffd962282344e4ff325c4472f73abe605e246a1da3beda7ccfa')
version('7.6.1', sha256='9e25c99cafd16ed8f5e2dca75b5a10dc2af0568dbedf3fc39f1c5a0a9c840b0b') version('7.6.1', sha256='9e25c99cafd16ed8f5e2dca75b5a10dc2af0568dbedf3fc39f1c5a0a9c840b0b')
version('7.4.4', sha256='96a39e273103f7375a670eba94fa3e5dad2819c5c5664c9aee8f145882a94e8c') version('7.4.4', sha256='96a39e273103f7375a670eba94fa3e5dad2819c5c5664c9aee8f145882a94e8c')
version('7.4.3', sha256='004e65693ee97fd4d5dc7ad244e3286a115dccd88964d04be61c07db6574b399') version('7.4.3', sha256='004e65693ee97fd4d5dc7ad244e3286a115dccd88964d04be61c07db6574b399')
@ -21,75 +26,88 @@ class Grass(AutotoolsPackage):
version('7.4.1', sha256='560b8669caaafa9e8dbd4bbf2b4b4bbab7dca1cc46ee828eaf26c744fe0635fc') version('7.4.1', sha256='560b8669caaafa9e8dbd4bbf2b4b4bbab7dca1cc46ee828eaf26c744fe0635fc')
version('7.4.0', sha256='cb6fa188e030a3a447fc5451fbe0ecbeb4069ee2fd1bf52ed8e40e9b89e293cc') version('7.4.0', sha256='cb6fa188e030a3a447fc5451fbe0ecbeb4069ee2fd1bf52ed8e40e9b89e293cc')
variant('cxx', default=True, description='Add c++ functionality') variant('cxx', default=True, description='Support C++ functionality')
variant('tiff', default=True, description='Add TIFF functionality') variant('tiff', default=False, description='Support TIFF functionality')
variant('png', default=True, description='Add PNG functionality') variant('png', default=False, description='Support PNG functionality')
variant('postgres', default=False, description='Add PostgreSQL functionality') variant('postgres', default=False, description='Support PostgreSQL functionality')
variant('mysql', default=False, description='Add MySQL functionality') variant('mysql', default=False, description='Support MySQL functionality')
variant('sqlite', default=True, description='Add SQLite functionality') variant('sqlite', default=False, description='Support SQLite functionality')
variant('opengl', default=True, description='Add OpenGL functionality') variant('opengl', default=False, description='Support OpenGL functionality')
variant('fftw', default=True, description='Add FFTW functionality') variant('odbc', default=False, description='Support ODBC functionality')
variant('blas', default=False, description='Add BLAS functionality') variant('fftw', default=False, description='Support FFTW functionality')
variant('lapack', default=False, description='Add LAPACK functionality') variant('blas', default=False, description='Support BLAS functionality')
variant('cairo', default=True, description='Add Cairo functionality') variant('lapack', default=False, description='Support LAPACK functionality')
variant('freetype', default=True, description='Add FreeType functionality') variant('cairo', default=False, description='Support Cairo functionality')
variant('readline', default=False, description='Add Readline functionality') variant('freetype', default=False, description='Support FreeType functionality')
variant('regex', default=True, description='Add regex functionality') variant('readline', default=False, description='Support Readline functionality')
variant('pthread', default=False, description='Add POSIX threads functionality') variant('regex', default=False, description='Support regex functionality')
variant('openmp', default=False, description='Add OpenMP functionality') variant('pthread', default=False, description='Support POSIX threads functionality')
variant('opencl', default=False, description='Add OpenCL functionality') variant('openmp', default=False, description='Support OpenMP functionality')
variant('bzlib', default=False, description='Add BZIP2 functionality') variant('opencl', default=False, description='Support OpenCL functionality')
variant('bzlib', default=False, description='Support BZIP2 functionality')
variant('zstd', default=False, description='Support Zstandard functionality')
variant('gdal', default=True, description='Enable GDAL/OGR support')
variant('liblas', default=False, description='Enable libLAS support')
variant('wxwidgets', default=False, description='Enable wxWidgets support')
variant('netcdf', default=False, description='Enable NetCDF support') variant('netcdf', default=False, description='Enable NetCDF support')
variant('geos', default=False, description='Geometry Engine for v.buffer') variant('geos', default=False, description='Enable GEOS support')
variant('x', default=False, description='Use the X Window System')
# required components # http://htmlpreview.github.io/?https://github.com/OSGeo/grass/blob/master/REQUIREMENTS.html
depends_on('gmake@3.8.1:', type='build') # General requirements
depends_on('gmake@3.81:', type='build')
depends_on('libiconv')
depends_on('zlib') depends_on('zlib')
depends_on('flex', type='build') depends_on('flex', type='build')
depends_on('bison', type='build') depends_on('bison', type='build')
depends_on('proj') depends_on('proj')
depends_on('proj@:4', when='@:7.5') depends_on('proj@:4', when='@:7.5')
depends_on('proj@:5', when='@:7.7') # GRASS 7.8.0 was supposed to support PROJ 6, but it still checks for
depends_on('gdal') # share/proj/epsg, which was removed in PROJ 6
depends_on('python@2.7:2.9', type=('build', 'run')) depends_on('proj@:5', when='@:7.8')
depends_on('libx11') depends_on('python@2.7:', type=('build', 'run'))
depends_on('python@2.7:2.8', when='@:7.6', type=('build', 'run'))
depends_on('py-six', when='@7.8:', type=('build', 'run'))
# optional pieces # Optional packages
depends_on('libtiff', when='+tiff') depends_on('libtiff', when='+tiff')
depends_on('libpng', when='+png') depends_on('libpng', when='+png')
depends_on('postgresql', when='+postgres') depends_on('postgresql', when='+postgres')
depends_on('mariadb', when='+mysql') depends_on('mariadb', when='+mysql')
depends_on('sqlite', when='+sqlite') depends_on('sqlite', when='+sqlite')
depends_on('gl', when='+opengl') depends_on('gl', when='+opengl')
depends_on('unixodbc', when='+odbc')
depends_on('fftw', when='+fftw') depends_on('fftw', when='+fftw')
depends_on('blas', when='+blas') depends_on('blas', when='+blas')
depends_on('lapack', when='+lapack') depends_on('lapack', when='+lapack')
depends_on('cairo', when='+cairo') depends_on('cairo@1.5.8:', when='+cairo')
depends_on('freetype', when='+freetype') depends_on('freetype', when='+freetype')
depends_on('readline', when='+readline') depends_on('readline', when='+readline')
depends_on('opencl', when='+opencl') depends_on('opencl', when='+opencl')
depends_on('bzip2', when='+bzlib') depends_on('bzip2', when='+bzlib')
depends_on('zstd', when='+zstd')
depends_on('gdal', when='+gdal') # required?
depends_on('liblas', when='+liblas')
depends_on('wxwidgets', when='+wxwidgets')
depends_on('py-wxpython@2.8.10.1:', when='+wxwidgets', type=('build', 'run'))
depends_on('netcdf-c', when='+netcdf') depends_on('netcdf-c', when='+netcdf')
depends_on('geos', when='+geos') depends_on('geos', when='+geos')
depends_on('libx11', when='+x')
def url_for_version(self, version): def url_for_version(self, version):
base = 'https://grass.osgeo.org' url = "https://grass.osgeo.org/grass{0}/source/grass-{1}.tar.gz"
return '{0}/grass{1}/source/grass-{2}.tar.gz'.format( return url.format(version.up_to(2).joined, version)
base, version.up_to(2).joined, version.dotted
)
# https://grasswiki.osgeo.org/wiki/Compile_and_Install
def configure_args(self): def configure_args(self):
spec = self.spec spec = self.spec
args = [ args = [
'--without-odbc',
'--without-nls', '--without-nls',
# TODO: add packages for these optional dependencies
'--without-opendwg', '--without-opendwg',
'--with-x', '--without-pdal',
'--with-gdal={0}/bin/gdal-config'.format( '--with-proj-share={0}'.format(spec['proj'].prefix.share.proj),
spec['gdal'].prefix),
'--with-proj-share={0}/share/proj'.format(
spec['proj'].prefix),
] ]
if '+cxx' in spec: if '+cxx' in spec:
@ -127,6 +145,11 @@ def configure_args(self):
else: else:
args.append('--without-opengl') args.append('--without-opengl')
if '+odbc' in spec:
args.append('--with-odbc')
else:
args.append('--without-odbc')
if '+fftw' in spec: if '+fftw' in spec:
args.append('--with-fftw') args.append('--with-fftw')
else: else:
@ -182,6 +205,29 @@ def configure_args(self):
else: else:
args.append('--without-bzlib') args.append('--without-bzlib')
if '+zstd' in spec:
args.append('--with-zstd')
else:
args.append('--without-zstd')
if '+gdal' in spec:
args.append('--with-gdal={0}/gdal-config'.format(
spec['gdal'].prefix.bin))
else:
args.append('--without-gdal')
if '+liblas' in spec:
args.append('--with-liblas={0}/liblas-config'.format(
spec['liblas'].prefix.bin))
else:
args.append('--without-liblas')
if '+wxwidgets' in spec:
args.append('--with-wxwidgets={0}/wx-config'.format(
spec['wxwidgets'].prefix.bin))
else:
args.append('--without-wxwidgets')
if '+netcdf' in spec: if '+netcdf' in spec:
args.append('--with-netcdf={0}/bin/nc-config'.format( args.append('--with-netcdf={0}/bin/nc-config'.format(
spec['netcdf-c'].prefix)) spec['netcdf-c'].prefix))
@ -194,6 +240,11 @@ def configure_args(self):
else: else:
args.append('--without-geos') args.append('--without-geos')
if '+x' in spec:
args.append('--with-x')
else:
args.append('--without-x')
return args return args
# see issue: https://github.com/spack/spack/issues/11325 # see issue: https://github.com/spack/spack/issues/11325
@ -202,5 +253,4 @@ def configure_args(self):
@run_after('configure') @run_after('configure')
def fix_iconv_linking(self): def fix_iconv_linking(self):
makefile = FileFilter('include/Make/Platform.make') makefile = FileFilter('include/Make/Platform.make')
makefile.filter(r'^ICONVLIB\s*=\s*', 'ICONVLIB = -liconv') makefile.filter(r'^ICONVLIB\s*=.*', 'ICONVLIB = -liconv')
return None