Add GDAL 2.3.0 (#8263)
* Add GDAL 2.3.0 * Add missing dependencies, change default variants, and add links * GDAL requires old hacked version of JasPer * Move JasPer patch to GDAL
This commit is contained in:
		| @@ -27,73 +27,385 @@ | |||||||
|  |  | ||||||
|  |  | ||||||
| class Gdal(AutotoolsPackage): | class Gdal(AutotoolsPackage): | ||||||
|     """GDAL is a translator library for raster and vector geospatial |     """GDAL (Geospatial Data Abstraction Library) is a translator library for | ||||||
|     data formats that is released under an X/MIT style Open Source |     raster and vector geospatial data formats that is released under an X/MIT | ||||||
|     license by the Open Source Geospatial Foundation. As a library, |     style Open Source license by the Open Source Geospatial Foundation. As a | ||||||
|     it presents a single raster abstract data model and vector |     library, it presents a single raster abstract data model and vector | ||||||
|     abstract data model to the calling application for all supported |     abstract data model to the calling application for all supported formats. | ||||||
|     formats. It also comes with a variety of useful command line |     It also comes with a variety of useful command line utilities for data | ||||||
|     utilities for data translation and processing. |     translation and processing. | ||||||
|     """ |     """ | ||||||
|  |  | ||||||
|     homepage   = "http://www.gdal.org/" |     homepage   = "http://www.gdal.org/" | ||||||
|     url        = "http://download.osgeo.org/gdal/2.1.2/gdal-2.1.2.tar.xz" |     url        = "http://download.osgeo.org/gdal/2.3.0/gdal-2.3.0.tar.xz" | ||||||
|     list_url   = "http://download.osgeo.org/gdal/" |     list_url   = "http://download.osgeo.org/gdal/" | ||||||
|     list_depth = 1 |     list_depth = 1 | ||||||
|  |  | ||||||
|  |     version('2.3.0', '2fe9d64fcd9dc37645940df020d3e200') | ||||||
|     version('2.1.2', 'ae85b78888514c75e813d658cac9478e') |     version('2.1.2', 'ae85b78888514c75e813d658cac9478e') | ||||||
|     version('2.0.2', '940208e737c87d31a90eaae43d0efd65') |     version('2.0.2', '940208e737c87d31a90eaae43d0efd65') | ||||||
|  |  | ||||||
|  |     variant('libtool',   default=True,  description='Use libtool to build the library') | ||||||
|  |     variant('libz',      default=True,  description='Include libz support') | ||||||
|  |     variant('libiconv',  default=False, description='Include libiconv support') | ||||||
|  |     variant('liblzma',   default=True,  description='Include liblzma support') | ||||||
|  |     variant('zstd',      default=False, description='Include zstd support') | ||||||
|  |     variant('pg',        default=False, description='Include PostgreSQL support') | ||||||
|  |     variant('cfitsio',   default=False, description='Include FITS support') | ||||||
|  |     variant('png',       default=False, description='Include PNG support') | ||||||
|  |     variant('jpeg',      default=True,  description='Include JPEG support') | ||||||
|  |     variant('gif',       default=False, description='Include GIF support') | ||||||
|  |     variant('sosi',      default=False, description='Include SOSI support') | ||||||
|  |     variant('hdf4',      default=False, description='Include HDF4 support') | ||||||
|  |     variant('hdf5',      default=False, description='Include HDF5 support') | ||||||
|  |     variant('kea',       default=False, description='Include kealib') | ||||||
|  |     variant('netcdf',    default=False, description='Include netCDF support') | ||||||
|  |     variant('jasper',    default=False, description='Include JPEG-2000 support via JasPer library') | ||||||
|  |     variant('openjpeg',  default=False, description='Include JPEG-2000 support via OpenJPEG 2.x library') | ||||||
|  |     variant('xerces',    default=False, description='Use Xerces-C++ parser') | ||||||
|  |     variant('expat',     default=False, description='Use Expat XML parser') | ||||||
|  |     variant('odbc',      default=False, description='Include ODBC support') | ||||||
|  |     variant('curl',      default=False, description='Include curl') | ||||||
|  |     variant('xml2',      default=False, description='Include libxml2') | ||||||
|  |     variant('sqlite3',   default=False, description='Use SQLite 3 library') | ||||||
|  |     variant('pcre',      default=False, description='Include libpcre support') | ||||||
|  |     variant('geos',      default=False, description='Include GEOS support') | ||||||
|  |     variant('qhull',     default=False, description='Include QHull support') | ||||||
|  |     variant('opencl',    default=False, description='Include OpenCL (GPU) support') | ||||||
|  |     variant('poppler',   default=False, description='Include poppler (for PDF) support') | ||||||
|  |     variant('proj',      default=True,  description='Compile with PROJ.x') | ||||||
|  |     variant('perl',      default=False, description='Enable perl bindings') | ||||||
|  |     variant('python',    default=False, description='Enable python bindings') | ||||||
|  |     variant('java',      default=False, description='Include Java support') | ||||||
|  |     variant('armadillo', default=False, description='Include Armadillo support for faster TPS transform computation') | ||||||
|  |     variant('cryptopp',  default=False, description='Include cryptopp support') | ||||||
|  |     variant('crypto',    default=False, description='Include crypto (from openssl) support') | ||||||
|  |  | ||||||
|  |     extends('perl', when='+perl') | ||||||
|     extends('python', when='+python') |     extends('python', when='+python') | ||||||
|  |  | ||||||
|     variant('hdf5', default=False, description='Enable HDF5 support') |     # GDAL depends on GNUmake on Unix platforms. | ||||||
|     variant('hdf', default=False, description='Enable HDF4 support') |     # https://trac.osgeo.org/gdal/wiki/BuildingOnUnix | ||||||
|     variant('openjpeg', default=False, description='Enable JPEG2000 support') |     depends_on('gmake', type='build') | ||||||
|     variant('geos', default=False, description='Enable GEOS support') |     depends_on('pkg-config@0.25:', type='build') | ||||||
|     variant('kea', default=False, description='Enable KEA support') |  | ||||||
|     variant('netcdf', default=False, description='Enable NetCDF support') |  | ||||||
|     variant('python', default=False, description='Enable Python support') |  | ||||||
|  |  | ||||||
|     depends_on('swig', when='+python') |     # Required dependencies | ||||||
|     depends_on("hdf5", when='+hdf5') |     depends_on('libtiff@3.6.0:')  # 3.9.0+ needed to pass testsuite | ||||||
|     depends_on("hdf", when='+hdf') |     depends_on('libgeotiff@1.2.1:') | ||||||
|     depends_on("openjpeg", when='+openjpeg') |     depends_on('json-c') | ||||||
|     depends_on("geos", when='+geos') |  | ||||||
|     depends_on("kealib", when='+kea') |  | ||||||
|     depends_on("netcdf", when='+netcdf') |  | ||||||
|     depends_on("libtiff") |  | ||||||
|     depends_on("libpng") |  | ||||||
|     depends_on("zlib") |  | ||||||
|     depends_on("proj") |  | ||||||
|     depends_on("py-numpy", type=('build', 'run')) |  | ||||||
|  |  | ||||||
|     parallel = False |     # Optional dependencies | ||||||
|  |     depends_on('libtool', type='build', when='+libtool') | ||||||
|  |     depends_on('zlib', when='+libz') | ||||||
|  |     depends_on('libiconv', when='+libiconv') | ||||||
|  |     depends_on('xz', when='+liblzma') | ||||||
|  |     depends_on('zstd', when='+zstd') | ||||||
|  |     depends_on('postgresql', when='+pg') | ||||||
|  |     depends_on('cfitsio', when='+cfitsio') | ||||||
|  |     depends_on('libpng', when='+png') | ||||||
|  |     depends_on('jpeg', when='+jpeg') | ||||||
|  |     depends_on('giflib', when='+gif') | ||||||
|  |     depends_on('fyba', when='+sosi') | ||||||
|  |     depends_on('hdf', when='+hdf4') | ||||||
|  |     depends_on('hdf5', when='+hdf5') | ||||||
|  |     depends_on('kealib', when='+kea') | ||||||
|  |     depends_on('netcdf', when='+netcdf') | ||||||
|  |     depends_on('jasper@1.900.1', patches=patch('uuid.patch'), when='+jasper') | ||||||
|  |     depends_on('openjpeg', when='+openjpeg') | ||||||
|  |     depends_on('xerces-c', when='+xerces') | ||||||
|  |     depends_on('expat', when='+expat') | ||||||
|  |     depends_on('unixodbc', when='+odbc') | ||||||
|  |     depends_on('curl@7.10.8:', when='+curl') | ||||||
|  |     depends_on('libxml2', when='+xml2') | ||||||
|  |     depends_on('sqlite@3:', when='+sqlite3') | ||||||
|  |     depends_on('pcre', when='+pcre') | ||||||
|  |     depends_on('geos', when='+geos') | ||||||
|  |     depends_on('qhull', when='+qhull') | ||||||
|  |     depends_on('opencl', when='+opencl') | ||||||
|  |     depends_on('poppler', when='+poppler') | ||||||
|  |     depends_on('proj', when='+proj') | ||||||
|  |     depends_on('perl', type=('build', 'run'), when='+perl') | ||||||
|  |     depends_on('python', type=('build', 'run'), when='+python') | ||||||
|  |     depends_on('java', type=('build', 'run'), when='+java') | ||||||
|  |     depends_on('armadillo', when='+armadillo') | ||||||
|  |     depends_on('cryptopp', when='+cryptopp') | ||||||
|  |     depends_on('openssl', when='+crypto') | ||||||
|  |  | ||||||
|  |     # https://trac.osgeo.org/gdal/wiki/SWIG | ||||||
|  |     depends_on('swig', type='build', when='+python') | ||||||
|  |     depends_on('swig', type='build', when='+perl') | ||||||
|  |  | ||||||
|  |     # https://trac.osgeo.org/gdal/wiki/SupportedCompilers | ||||||
|  |     msg = 'GDAL requires C++11 support' | ||||||
|  |     conflicts('%gcc@:4.8.0', msg=msg) | ||||||
|  |     conflicts('%clang@:3.2', msg=msg) | ||||||
|  |     conflicts('%intel@:12',  msg=msg) | ||||||
|  |     conflicts('%xl@:13.0',   msg=msg) | ||||||
|  |     conflicts('%xl_r@:13.0', msg=msg) | ||||||
|  |  | ||||||
|  |     # https://trac.osgeo.org/gdal/wiki/BuildHints | ||||||
|     def configure_args(self): |     def configure_args(self): | ||||||
|         spec = self.spec |         spec = self.spec | ||||||
|  |  | ||||||
|         args = [] |         # Required dependencies | ||||||
|         args.append("--with-liblzma=yes") |         args = [ | ||||||
|         args.append("--with-zlib=%s" % spec['zlib'].prefix) |             # https://trac.osgeo.org/gdal/wiki/TIFF | ||||||
|         args.append("--without-libtool") |             '--with-libtiff={0}'.format(spec['libtiff'].prefix), | ||||||
|  |             '--with-geotiff={0}'.format(spec['libgeotiff'].prefix), | ||||||
|  |             '--with-libjson-c={0}'.format(spec['json-c'].prefix), | ||||||
|  |         ] | ||||||
|  |  | ||||||
|         if '+python' in spec: |         # Optional dependencies | ||||||
|             args.append("--with-python=%s" % spec['python'].command.path) |         if '+libtool' in spec: | ||||||
|  |             args.append('--with-libtool=yes') | ||||||
|         else: |         else: | ||||||
|             args.append("--with-python=no") |             args.append('--with-libtool=no') | ||||||
|  |  | ||||||
|  |         if '+libz' in spec: | ||||||
|  |             args.append('--with-libz={0}'.format(spec['zlib'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-libz=no') | ||||||
|  |  | ||||||
|  |         if '+libiconv' in spec: | ||||||
|  |             args.append('--with-libiconv-prefix={0}'.format( | ||||||
|  |                 spec['libiconv'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-libiconv-prefix=no') | ||||||
|  |  | ||||||
|  |         if '+liblzma' in spec: | ||||||
|  |             args.append('--with-liblzma=yes') | ||||||
|  |         else: | ||||||
|  |             args.append('--with-liblzma=no') | ||||||
|  |  | ||||||
|  |         if '+zstd' in spec: | ||||||
|  |             args.append('--with-zstd={0}'.format(spec['zstd'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-zstd=no') | ||||||
|  |  | ||||||
|  |         if '+pg' in spec: | ||||||
|  |             args.append('--with-pg={0}'.format( | ||||||
|  |                 spec['postgresql'].prefix.bin.pg_config)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-pg=no') | ||||||
|  |  | ||||||
|  |         if '+cfitsio' in spec: | ||||||
|  |             args.append('--with-cfitsio={0}'.format(spec['cfitsio'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-cfitsio=no') | ||||||
|  |  | ||||||
|  |         if '+png' in spec: | ||||||
|  |             args.append('--with-png={0}'.format(spec['libpng'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-png=no') | ||||||
|  |  | ||||||
|  |         if '+jpeg' in spec: | ||||||
|  |             args.append('--with-jpeg={0}'.format(spec['jpeg'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-jpeg=no') | ||||||
|  |  | ||||||
|  |         if '+gif' in spec: | ||||||
|  |             args.append('--with-gif={0}'.format(spec['giflib'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-gif=no') | ||||||
|  |  | ||||||
|  |         # https://trac.osgeo.org/gdal/wiki/SOSI | ||||||
|  |         if '+sosi' in spec: | ||||||
|  |             args.append('--with-sosi={0}'.format(spec['fyba'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-sosi=no') | ||||||
|  |  | ||||||
|  |         # https://trac.osgeo.org/gdal/wiki/HDF | ||||||
|  |         if '+hdf4' in spec: | ||||||
|  |             args.append('--with-hdf4={0}'.format(spec['hdf'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-hdf4=no') | ||||||
|  |  | ||||||
|  |         if '+hdf5' in spec: | ||||||
|  |             args.append('--with-hdf5={0}'.format(spec['hdf5'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-hdf5=no') | ||||||
|  |  | ||||||
|  |         if '+kea' in spec: | ||||||
|  |             args.append('--with-kea={0}'.format( | ||||||
|  |                 join_path(spec['kealib'].prefix.bin, 'kea-config'))) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-kea=no') | ||||||
|  |  | ||||||
|  |         # https://trac.osgeo.org/gdal/wiki/NetCDF | ||||||
|  |         if '+netcdf' in spec: | ||||||
|  |             args.append('--with-netcdf={0}'.format(spec['netcdf'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-netcdf=no') | ||||||
|  |  | ||||||
|  |         # https://trac.osgeo.org/gdal/wiki/JasPer | ||||||
|  |         if '+jasper' in spec: | ||||||
|  |             args.append('--with-jasper={0}'.format(spec['jasper'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-jasper=no') | ||||||
|  |  | ||||||
|  |         if '+openjpeg' in spec: | ||||||
|  |             args.append('--with-openjpeg=yes') | ||||||
|  |         else: | ||||||
|  |             args.append('--with-openjpeg=no') | ||||||
|  |  | ||||||
|  |         if '+xerces' in spec: | ||||||
|  |             args.append('--with-xerces={0}'.format(spec['xerces-c'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-xerces=no') | ||||||
|  |  | ||||||
|  |         if '+expat' in spec: | ||||||
|  |             args.append('--with-expat={0}'.format(spec['expat'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-expat=no') | ||||||
|  |  | ||||||
|  |         if '+odbc' in spec: | ||||||
|  |             args.append('--with-odbc={0}'.format(spec['unixodbc'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-odbc=no') | ||||||
|  |  | ||||||
|  |         # https://trac.osgeo.org/gdal/wiki/LibCurl | ||||||
|  |         if '+curl' in spec: | ||||||
|  |             args.append('--with-curl={0}'.format( | ||||||
|  |                 join_path(spec['curl'].prefix.bin, 'curl-config'))) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-curl=no') | ||||||
|  |  | ||||||
|  |         if '+xml2' in spec: | ||||||
|  |             args.append('--with-xml2={0}'.format( | ||||||
|  |                 join_path(spec['libxml2'].prefix.bin, 'xml2-config'))) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-xml2=no') | ||||||
|  |  | ||||||
|  |         # https://trac.osgeo.org/gdal/wiki/SQLite | ||||||
|  |         if '+sqlite3' in spec: | ||||||
|  |             args.append('--with-sqlite3={0}'.format(spec['sqlite'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-sqlite3=no') | ||||||
|  |  | ||||||
|  |         if '+pcre' in spec: | ||||||
|  |             args.append('--with-pcre={0}'.format(spec['pcre'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-pcre=no') | ||||||
|  |  | ||||||
|         if '+geos' in spec: |         if '+geos' in spec: | ||||||
|             args.append('--with-geos=yes') |             args.append('--with-geos={0}'.format( | ||||||
|         if '+hdf' in spec: |                 join_path(spec['geos'].prefix.bin, 'geos-config'))) | ||||||
|             args.append('--with-hdf4=%s' % spec['hdf'].prefix) |         else: | ||||||
|         if '+hdf5' in spec: |             args.append('--with-geos=no') | ||||||
|             args.append('--with-hdf5=%s' % spec['hdf5'].prefix) |  | ||||||
|         if '+openjpeg' in spec: |         if '+qhull' in spec: | ||||||
|             args.append('--with-openjpeg=%s' % spec['openjpeg'].prefix) |             args.append('--with-qhull=yes') | ||||||
|         if '+kea' in spec: |         else: | ||||||
|             args.append('--with-kea=yes') |             args.append('--with-qhull=no') | ||||||
|         if '+netcdf' in spec: |  | ||||||
|             args.append('--with-netcdf=%s' % spec['netcdf'].prefix) |         if '+opencl' in spec: | ||||||
|  |             args.append('--with-opencl={0}'.format(spec['opencl'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-opencl=no') | ||||||
|  |  | ||||||
|  |         if '+poppler' in spec: | ||||||
|  |             args.append('--with-poppler={0}'.format(spec['poppler'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-poppler=no') | ||||||
|  |  | ||||||
|  |         if '+proj' in spec: | ||||||
|  |             args.append('--with-proj={0}'.format(spec['proj'].prefix)) | ||||||
|  |             if spec.satisfies('^proj@5.0:5.999'): | ||||||
|  |                 args.append('--with-proj5-api=yes') | ||||||
|  |             else: | ||||||
|  |                 args.append('--with-proj5-api=no') | ||||||
|  |         else: | ||||||
|  |             args.append('--with-proj=no') | ||||||
|  |  | ||||||
|  |         if '+perl' in spec: | ||||||
|  |             args.append('--with-perl=yes') | ||||||
|  |         else: | ||||||
|  |             args.append('--with-perl=no') | ||||||
|  |  | ||||||
|  |         if '+python' in spec: | ||||||
|  |             args.append('--with-python={0}'.format( | ||||||
|  |                 spec['python'].command.path)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-python=no') | ||||||
|  |  | ||||||
|  |         if '+java' in spec: | ||||||
|  |             args.append('--with-java={0}'.format(spec['java'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-java=no') | ||||||
|  |  | ||||||
|  |         if '+armadillo' in spec: | ||||||
|  |             args.append('--with-armadillo={0}'.format( | ||||||
|  |                 spec['armadillo'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-armadillo=no') | ||||||
|  |  | ||||||
|  |         if '+cryptopp' in spec: | ||||||
|  |             args.append('--with-cryptopp={0}'.format(spec['cryptopp'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-cryptopp=no') | ||||||
|  |  | ||||||
|  |         if '+crypto' in spec: | ||||||
|  |             args.append('--with-crypto={0}'.format(spec['openssl'].prefix)) | ||||||
|  |         else: | ||||||
|  |             args.append('--with-crypto=no') | ||||||
|  |  | ||||||
|  |         # TODO: add packages for these dependencies | ||||||
|  |         args.extend([ | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/GRASS | ||||||
|  |             '--with-grass=no', | ||||||
|  |             '--with-libgrass=no', | ||||||
|  |             '--with-pcraster=no', | ||||||
|  |             '--with-dds=no', | ||||||
|  |             '--with-gta=no', | ||||||
|  |             '--with-pcidsk=no', | ||||||
|  |             '--with-ogdi=no', | ||||||
|  |             '--with-fme=no', | ||||||
|  |             '--with-mongocxx=no', | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/FileGDB | ||||||
|  |             '--with-fgdb=no', | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/ECW | ||||||
|  |             '--with-ecw=no', | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/JP2KAK | ||||||
|  |             '--with-kakadu=no', | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/MrSID | ||||||
|  |             '--with-mrsid=no', | ||||||
|  |             '--with-jp2mrsid=no', | ||||||
|  |             '--with-mrsid_lidar=no', | ||||||
|  |             '--with-jp2lura=no', | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/MSG | ||||||
|  |             '--with-msg=no', | ||||||
|  |             '--with-bsb=no', | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/Oracle | ||||||
|  |             '--with-oci=no', | ||||||
|  |             '--with-grib=no', | ||||||
|  |             '--with-gnm=no', | ||||||
|  |             '--with-mysql=no', | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/Ingres | ||||||
|  |             '--with-ingres=no', | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/LibKML | ||||||
|  |             '--with-libkml=no', | ||||||
|  |             '--with-dods-root=no', | ||||||
|  |             '--with-spatialite=no', | ||||||
|  |             '--with-rasterlite2=no', | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/DxfDwg | ||||||
|  |             '--with-teigha=no', | ||||||
|  |             '--with-idb=no', | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/ArcSDE | ||||||
|  |             '--with-sde=no', | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/Epsilon | ||||||
|  |             '--with-epsilon=no', | ||||||
|  |             '--with-webp=no', | ||||||
|  |             '--with-sfcgal=no', | ||||||
|  |             '--with-freexl=no', | ||||||
|  |             '--with-pam=no', | ||||||
|  |             '--with-podofo=no', | ||||||
|  |             '--with-pdfium=no', | ||||||
|  |             '--with-php=no', | ||||||
|  |             # https://trac.osgeo.org/gdal/wiki/mdbtools | ||||||
|  |             '--with-mdb=no', | ||||||
|  |             '--with-rasdaman=no', | ||||||
|  |             '--with-mrf=no', | ||||||
|  |         ]) | ||||||
|  |  | ||||||
|         return args |         return args | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										234
									
								
								var/spack/repos/builtin/packages/gdal/uuid.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										234
									
								
								var/spack/repos/builtin/packages/gdal/uuid.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,234 @@ | |||||||
|  | diff -Naur jasper-1.900.1/src/libjasper/jp2/jp2_cod.c jasper-1.900.1.uuid/src/libjasper/jp2/jp2_cod.c | ||||||
|  | --- jasper-1.900.1/src/libjasper/jp2/jp2_cod.c	2007-01-19 15:43:05.000000000 -0600 | ||||||
|  | +++ jasper-1.900.1.uuid/src/libjasper/jp2/jp2_cod.c	2007-03-06 07:49:58.000000000 -0600 | ||||||
|  | @@ -5,6 +5,11 @@ | ||||||
|  |   * All rights reserved. | ||||||
|  |   */ | ||||||
|  |   | ||||||
|  | +/* | ||||||
|  | + * Modified by Andrey Kiselev <dron@ak4719.spb.edu> to properly handle UUID | ||||||
|  | + * box. | ||||||
|  | + */ | ||||||
|  | + | ||||||
|  |  /* __START_OF_JASPER_LICENSE__ | ||||||
|  |   *  | ||||||
|  |   * JasPer License Version 2.0 | ||||||
|  | @@ -127,6 +132,9 @@ | ||||||
|  |  static int jp2_pclr_getdata(jp2_box_t *box, jas_stream_t *in); | ||||||
|  |  static int jp2_pclr_putdata(jp2_box_t *box, jas_stream_t *out); | ||||||
|  |  static void jp2_pclr_dumpdata(jp2_box_t *box, FILE *out); | ||||||
|  | +static void jp2_uuid_destroy(jp2_box_t *box); | ||||||
|  | +static int jp2_uuid_getdata(jp2_box_t *box, jas_stream_t *in); | ||||||
|  | +static int jp2_uuid_putdata(jp2_box_t *box, jas_stream_t *out); | ||||||
|  |   | ||||||
|  |  /******************************************************************************\ | ||||||
|  |  * Local data. | ||||||
|  | @@ -164,7 +172,7 @@ | ||||||
|  |  	{JP2_BOX_XML, "XML", 0, | ||||||
|  |  	  {0, 0, 0, 0, 0}}, | ||||||
|  |  	{JP2_BOX_UUID, "UUID", 0, | ||||||
|  | -	  {0, 0, 0, 0, 0}}, | ||||||
|  | +	  {0, jp2_uuid_destroy, jp2_uuid_getdata, jp2_uuid_putdata, 0}}, | ||||||
|  |  	{JP2_BOX_UINF, "UINF", JP2_BOX_SUPER, | ||||||
|  |  	  {0, 0, 0, 0, 0}}, | ||||||
|  |  	{JP2_BOX_ULST, "ULST", 0, | ||||||
|  | @@ -271,7 +279,7 @@ | ||||||
|  |  	} else { | ||||||
|  |  		box->datalen = box->len - JP2_BOX_HDRLEN(false); | ||||||
|  |  	} | ||||||
|  | -	if (box->len != 0 && box->len < 8) { | ||||||
|  | +	if (box->len != 0 && box->len < JP2_BOX_HDRLEN(false)) { | ||||||
|  |  		goto error; | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  | @@ -876,6 +884,56 @@ | ||||||
|  |  	} | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | +static void jp2_uuid_destroy(jp2_box_t *box) | ||||||
|  | +{ | ||||||
|  | +	jp2_uuid_t *uuid = &box->data.uuid; | ||||||
|  | +	if (uuid->data) | ||||||
|  | +	{ | ||||||
|  | +	    jas_free(uuid->data); | ||||||
|  | +	    uuid->data = NULL; | ||||||
|  | +	} | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | +static int jp2_uuid_getdata(jp2_box_t *box, jas_stream_t *in) | ||||||
|  | +{ | ||||||
|  | +	jp2_uuid_t *uuid = &box->data.uuid; | ||||||
|  | +	int i; | ||||||
|  | +	 | ||||||
|  | +	for (i = 0; i < 16; i++) | ||||||
|  | +	{ | ||||||
|  | +	    if (jp2_getuint8(in, &uuid->uuid[i])) | ||||||
|  | +		return -1; | ||||||
|  | +	} | ||||||
|  | +	 | ||||||
|  | +	uuid->datalen = box->datalen - 16; | ||||||
|  | +	uuid->data = jas_malloc(uuid->datalen * sizeof(uint_fast8_t)); | ||||||
|  | +	for (i = 0; i < uuid->datalen; i++) | ||||||
|  | +	{ | ||||||
|  | +	    if (jp2_getuint8(in, &uuid->data[i])) | ||||||
|  | +		return -1; | ||||||
|  | +	} | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | +static int jp2_uuid_putdata(jp2_box_t *box, jas_stream_t *out) | ||||||
|  | +{ | ||||||
|  | +	jp2_uuid_t *uuid = &box->data.uuid; | ||||||
|  | +	int i; | ||||||
|  | +	 | ||||||
|  | +	for (i = 0; i < 16; i++) | ||||||
|  | +	{ | ||||||
|  | +	    if (jp2_putuint8(out, uuid->uuid[i])) | ||||||
|  | +		return -1; | ||||||
|  | +	} | ||||||
|  | +	 | ||||||
|  | +	for (i = 0; i < uuid->datalen; i++) | ||||||
|  | +	{ | ||||||
|  | +	    if (jp2_putuint8(out, uuid->data[i])) | ||||||
|  | +		return -1; | ||||||
|  | +	} | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  |  static int jp2_getint(jas_stream_t *in, int s, int n, int_fast32_t *val) | ||||||
|  |  { | ||||||
|  |  	int c; | ||||||
|  | diff -Naur jasper-1.900.1/src/libjasper/jp2/jp2_cod.h jasper-1.900.1.uuid/src/libjasper/jp2/jp2_cod.h | ||||||
|  | --- jasper-1.900.1/src/libjasper/jp2/jp2_cod.h	2007-01-19 15:43:05.000000000 -0600 | ||||||
|  | +++ jasper-1.900.1.uuid/src/libjasper/jp2/jp2_cod.h	2007-03-06 07:49:58.000000000 -0600 | ||||||
|  | @@ -5,6 +5,11 @@ | ||||||
|  |   * All rights reserved. | ||||||
|  |   */ | ||||||
|  |   | ||||||
|  | +/* | ||||||
|  | + * Modified by Andrey Kiselev <dron@ak4719.spb.edu> to properly handle UUID | ||||||
|  | + * box. | ||||||
|  | + */ | ||||||
|  | + | ||||||
|  |  /* __START_OF_JASPER_LICENSE__ | ||||||
|  |   *  | ||||||
|  |   * JasPer License Version 2.0 | ||||||
|  | @@ -229,6 +234,12 @@ | ||||||
|  |  	jp2_cmapent_t *ents; | ||||||
|  |  } jp2_cmap_t; | ||||||
|  |   | ||||||
|  | +typedef struct { | ||||||
|  | +	uint_fast32_t datalen; | ||||||
|  | +	uint_fast8_t uuid[16]; | ||||||
|  | +	uint_fast8_t *data; | ||||||
|  | +} jp2_uuid_t; | ||||||
|  | + | ||||||
|  |  #define	JP2_CMAP_DIRECT		0 | ||||||
|  |  #define	JP2_CMAP_PALETTE	1 | ||||||
|  |   | ||||||
|  | @@ -257,6 +268,7 @@ | ||||||
|  |  		jp2_pclr_t pclr; | ||||||
|  |  		jp2_cdef_t cdef; | ||||||
|  |  		jp2_cmap_t cmap; | ||||||
|  | +		jp2_uuid_t uuid; | ||||||
|  |  	} data; | ||||||
|  |   | ||||||
|  |  } jp2_box_t; | ||||||
|  | diff -Naur jasper-1.900.1/src/libjasper/jp2/jp2_enc.c jasper-1.900.1.uuid/src/libjasper/jp2/jp2_enc.c | ||||||
|  | --- jasper-1.900.1/src/libjasper/jp2/jp2_enc.c	2007-01-19 15:43:05.000000000 -0600 | ||||||
|  | +++ jasper-1.900.1.uuid/src/libjasper/jp2/jp2_enc.c	2007-03-06 07:49:58.000000000 -0600 | ||||||
|  | @@ -5,6 +5,11 @@ | ||||||
|  |   * All rights reserved. | ||||||
|  |   */ | ||||||
|  |   | ||||||
|  | +/* | ||||||
|  | + * Modified by Andrey Kiselev <dron@ak4719.spb.edu> to properly handle UUID | ||||||
|  | + * box. | ||||||
|  | + */ | ||||||
|  | + | ||||||
|  |  /* __START_OF_JASPER_LICENSE__ | ||||||
|  |   *  | ||||||
|  |   * JasPer License Version 2.0 | ||||||
|  | @@ -86,7 +91,7 @@ | ||||||
|  |  * Functions. | ||||||
|  |  \******************************************************************************/ | ||||||
|  |   | ||||||
|  | -int jp2_encode(jas_image_t *image, jas_stream_t *out, char *optstr) | ||||||
|  | +int jp2_write_header(jas_image_t *image, jas_stream_t *out) | ||||||
|  |  { | ||||||
|  |  	jp2_box_t *box; | ||||||
|  |  	jp2_ftyp_t *ftyp; | ||||||
|  | @@ -97,8 +102,6 @@ | ||||||
|  |  	long len; | ||||||
|  |  	uint_fast16_t cmptno; | ||||||
|  |  	jp2_colr_t *colr; | ||||||
|  | -	char buf[4096]; | ||||||
|  | -	uint_fast32_t overhead; | ||||||
|  |  	jp2_cdefchan_t *cdefchanent; | ||||||
|  |  	jp2_cdef_t *cdef; | ||||||
|  |  	int i; | ||||||
|  | @@ -326,6 +329,26 @@ | ||||||
|  |  	jas_stream_close(tmpstream); | ||||||
|  |  	tmpstream = 0; | ||||||
|  |   | ||||||
|  | +	return 0; | ||||||
|  | +	abort(); | ||||||
|  | + | ||||||
|  | +error: | ||||||
|  | + | ||||||
|  | +	if (box) { | ||||||
|  | +		jp2_box_destroy(box); | ||||||
|  | +	} | ||||||
|  | +	if (tmpstream) { | ||||||
|  | +		jas_stream_close(tmpstream); | ||||||
|  | +	} | ||||||
|  | +	return -1; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | +int jp2_write_codestream(jas_image_t *image, jas_stream_t *out, char *optstr) | ||||||
|  | +{ | ||||||
|  | +	jp2_box_t *box; | ||||||
|  | +	char buf[4096]; | ||||||
|  | +	uint_fast32_t overhead; | ||||||
|  | + | ||||||
|  |  	/* | ||||||
|  |  	 * Output the contiguous code stream box. | ||||||
|  |  	 */ | ||||||
|  | @@ -358,12 +381,34 @@ | ||||||
|  |  	if (box) { | ||||||
|  |  		jp2_box_destroy(box); | ||||||
|  |  	} | ||||||
|  | -	if (tmpstream) { | ||||||
|  | -		jas_stream_close(tmpstream); | ||||||
|  | -	} | ||||||
|  |  	return -1; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | +int jp2_encode(jas_image_t *image, jas_stream_t *out, char *optstr) | ||||||
|  | +{ | ||||||
|  | +	if (jp2_write_header(image, out) < 0) | ||||||
|  | +		return -1; | ||||||
|  | +	if (jp2_write_codestream(image, out, optstr) < 0) | ||||||
|  | +		return -1; | ||||||
|  | + | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | +int jp2_encode_uuid(jas_image_t *image, jas_stream_t *out, | ||||||
|  | +		    char *optstr, jp2_box_t *uuid) | ||||||
|  | +{ | ||||||
|  | +	if (jp2_write_header(image, out) < 0) | ||||||
|  | +		return -1; | ||||||
|  | +	if (uuid) { | ||||||
|  | +		if (jp2_box_put(uuid, out)) | ||||||
|  | +			return -1; | ||||||
|  | +	} | ||||||
|  | +	if (jp2_write_codestream(image, out, optstr) < 0) | ||||||
|  | +		return -1; | ||||||
|  | + | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  |  static uint_fast32_t jp2_gettypeasoc(int colorspace, int ctype) | ||||||
|  |  { | ||||||
|  |  	int type; | ||||||
		Reference in New Issue
	
	Block a user
	 Adam J. Stewart
					Adam J. Stewart