1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | PortGroup active_variants 1.1 |
---|
5 | PortGroup cmake 1.1 |
---|
6 | PortGroup compiler_blacklist_versions 1.0 |
---|
7 | PortGroup legacysupport 1.0 |
---|
8 | PortGroup muniversal 1.0 |
---|
9 | |
---|
10 | name gdal |
---|
11 | version 3.8.0 |
---|
12 | revision 1 |
---|
13 | |
---|
14 | checksums rmd160 21ca0198e5fa72efdb535118ab7ffa141b9671ce \ |
---|
15 | sha256 ec0f78d9dc32352aeac6edc9c3b27a991b91f9dc6f92c452207d84431c58757d \ |
---|
16 | size 8853728 |
---|
17 | |
---|
18 | categories gis |
---|
19 | license MIT BSD |
---|
20 | maintainers {vince @Veence} {yahoo.com:n_larsson @nilason} openmaintainer |
---|
21 | |
---|
22 | description GDAL - Geospatial Data Abstraction Library |
---|
23 | long_description GDAL is a translator library for raster and vector \ |
---|
24 | geospatial data formats that is released under an MIT \ |
---|
25 | style Open Source License by the Open Source Geospatial \ |
---|
26 | Foundation. As a library, it presents a single raster \ |
---|
27 | abstract data model and single vector abstract data model \ |
---|
28 | to the calling application for all supported formats. It \ |
---|
29 | also comes with a variety of useful command line utilities \ |
---|
30 | for data translation and processing |
---|
31 | |
---|
32 | homepage https://www.gdal.org/ |
---|
33 | master_sites https://download.osgeo.org/gdal/${version} |
---|
34 | use_xz yes |
---|
35 | |
---|
36 | # error: call to 'abs' is ambiguous |
---|
37 | compiler.blacklist-append {clang < 900} |
---|
38 | |
---|
39 | #compiler.cxx_standard 2014 |
---|
40 | compiler.cxx_standard 2017 |
---|
41 | cmake.set_cxx_standard yes |
---|
42 | |
---|
43 | # See https://trac.macports.org/ticket/56908 |
---|
44 | compiler.thread_local_storage yes |
---|
45 | |
---|
46 | configure.optflags -DGDAL_COMPILATION |
---|
47 | |
---|
48 | depends_build-append \ |
---|
49 | port:bash-completion \ |
---|
50 | port:pkgconfig |
---|
51 | |
---|
52 | depends_lib-append \ |
---|
53 | port:blosc \ |
---|
54 | port:brunsli \ |
---|
55 | port:charls \ |
---|
56 | port:curl \ |
---|
57 | port:expat \ |
---|
58 | port:giflib \ |
---|
59 | path:include/turbojpeg.h:libjpeg-turbo \ |
---|
60 | port:lerc \ |
---|
61 | port:libaec \ |
---|
62 | port:libdeflate \ |
---|
63 | port:libpng \ |
---|
64 | port:libxml2 \ |
---|
65 | port:lz4 \ |
---|
66 | path:lib/libssl.dylib:openssl \ |
---|
67 | port:pcre2 \ |
---|
68 | port:qhull \ |
---|
69 | port:spatialite \ |
---|
70 | port:sqlite3 \ |
---|
71 | port:webp \ |
---|
72 | port:zlib \ |
---|
73 | port:zstd |
---|
74 | |
---|
75 | # By default, disable all drivers |
---|
76 | configure.args-append \ |
---|
77 | -DGDAL_BUILD_OPTIONAL_DRIVERS=OFF \ |
---|
78 | -DOGR_BUILD_OPTIONAL_DRIVERS=OFF \ |
---|
79 | -DGDAL_ENABLE_PLUGINS=ON \ |
---|
80 | -DGDAL_USE_EXTERNAL_LIBS=ON |
---|
81 | |
---|
82 | # Enable all built-in raster drivers |
---|
83 | configure.args-append \ |
---|
84 | -DGDAL_ENABLE_DRIVER_AAIGRID=ON \ |
---|
85 | -DGDAL_ENABLE_DRIVER_ADRG=ON \ |
---|
86 | -DGDAL_ENABLE_DRIVER_AIGRID=ON \ |
---|
87 | -DGDAL_ENABLE_DRIVER_AIRSAR=ON \ |
---|
88 | -DGDAL_ENABLE_DRIVER_ARG=ON \ |
---|
89 | -DGDAL_ENABLE_DRIVER_BLX=ON \ |
---|
90 | -DGDAL_ENABLE_DRIVER_BMP=ON \ |
---|
91 | -DGDAL_ENABLE_DRIVER_BSB=ON \ |
---|
92 | -DGDAL_ENABLE_DRIVER_CALS=ON \ |
---|
93 | -DGDAL_ENABLE_DRIVER_CEOS=ON \ |
---|
94 | -DGDAL_ENABLE_DRIVER_COASP=ON \ |
---|
95 | -DGDAL_ENABLE_DRIVER_COSAR=ON \ |
---|
96 | -DGDAL_ENABLE_DRIVER_CTG=ON \ |
---|
97 | -DGDAL_ENABLE_DRIVER_DIMAP=ON \ |
---|
98 | -DGDAL_ENABLE_DRIVER_DTED=ON \ |
---|
99 | -DGDAL_ENABLE_DRIVER_ELAS=ON \ |
---|
100 | -DGDAL_ENABLE_DRIVER_ERS=ON \ |
---|
101 | -DGDAL_ENABLE_DRIVER_ENVISAT=ON \ |
---|
102 | -DGDAL_ENABLE_DRIVER_ESRIC=ON \ |
---|
103 | -DGDAL_ENABLE_DRIVER_FIT=ON \ |
---|
104 | -DGDAL_ENABLE_DRIVER_GFF=ON \ |
---|
105 | -DGDAL_ENABLE_DRIVER_GIF=ON \ |
---|
106 | -DGDAL_ENABLE_DRIVER_GRIB=ON \ |
---|
107 | -DGDAL_ENABLE_DRIVER_GSG=ON \ |
---|
108 | -DGDAL_ENABLE_DRIVER_GXF=ON \ |
---|
109 | -DGDAL_ENABLE_DRIVER_HF2=ON \ |
---|
110 | -DGDAL_ENABLE_DRIVER_IDRISI=ON \ |
---|
111 | -DGDAL_ENABLE_DRIVER_ILWIS=ON \ |
---|
112 | -DGDAL_ENABLE_DRIVER_IRIS=ON \ |
---|
113 | -DGDAL_ENABLE_DRIVER_JAXAPALSAR=ON \ |
---|
114 | -DGDAL_ENABLE_DRIVER_JDEM=ON \ |
---|
115 | -DGDAL_ENABLE_DRIVER_JPEG=ON \ |
---|
116 | -DGDAL_ENABLE_DRIVER_KMLSUPEROVERLAY=ON \ |
---|
117 | -DGDAL_ENABLE_DRIVER_L1B=ON \ |
---|
118 | -DGDAL_ENABLE_DRIVER_LEVELLER=ON \ |
---|
119 | -DGDAL_ENABLE_DRIVER_MAP=ON \ |
---|
120 | -DGDAL_ENABLE_DRIVER_MRF=ON \ |
---|
121 | -DGDAL_ENABLE_DRIVER_MSGN=ON \ |
---|
122 | -DGDAL_ENABLE_DRIVER_NGSGEOID=ON \ |
---|
123 | -DGDAL_ENABLE_DRIVER_NITF=ON \ |
---|
124 | -DGDAL_ENABLE_DRIVER_NORTHWOOD=ON \ |
---|
125 | -DGDAL_ENABLE_DRIVER_OZI=ON \ |
---|
126 | -DGDAL_ENABLE_DRIVER_PCIDSK=ON \ |
---|
127 | -DGDAL_ENABLE_DRIVER_PDS=ON \ |
---|
128 | -DGDAL_ENABLE_DRIVER_PNG=ON \ |
---|
129 | -DGDAL_ENABLE_DRIVER_PRF=ON \ |
---|
130 | -DGDAL_ENABLE_DRIVER_R=ON \ |
---|
131 | -DGDAL_ENABLE_DRIVER_RAW=ON \ |
---|
132 | -DGDAL_ENABLE_DRIVER_RMF=ON \ |
---|
133 | -DGDAL_ENABLE_DRIVER_RS2=ON \ |
---|
134 | -DGDAL_ENABLE_DRIVER_SAFE=ON \ |
---|
135 | -DGDAL_ENABLE_DRIVER_SAGA=ON \ |
---|
136 | -DGDAL_ENABLE_DRIVER_SAR_CEOS=ON \ |
---|
137 | -DGDAL_ENABLE_DRIVER_SDTS=ON \ |
---|
138 | -DGDAL_ENABLE_DRIVER_SENTINEL2=ON \ |
---|
139 | -DGDAL_ENABLE_DRIVER_SGI=ON \ |
---|
140 | -DGDAL_ENABLE_DRIVER_SIGDEM=ON \ |
---|
141 | -DGDAL_ENABLE_DRIVER_SRTMHGT=ON \ |
---|
142 | -DGDAL_ENABLE_DRIVER_STACIT=ON \ |
---|
143 | -DGDAL_ENABLE_DRIVER_STACTA=ON \ |
---|
144 | -DGDAL_ENABLE_DRIVER_TERRAGEN=ON \ |
---|
145 | -DGDAL_ENABLE_DRIVER_TGA=ON \ |
---|
146 | -DGDAL_ENABLE_DRIVER_TIL=ON \ |
---|
147 | -DGDAL_ENABLE_DRIVER_TSX=ON \ |
---|
148 | -DGDAL_ENABLE_DRIVER_USGSDEM=ON \ |
---|
149 | -DGDAL_ENABLE_DRIVER_XPM=ON \ |
---|
150 | -DGDAL_ENABLE_DRIVER_XYZ=ON \ |
---|
151 | -DGDAL_ENABLE_DRIVER_ZARR=ON \ |
---|
152 | -DGDAL_ENABLE_DRIVER_ZMAP=ON |
---|
153 | |
---|
154 | # Same with built-in vector drivers |
---|
155 | configure.args-append \ |
---|
156 | -DOGR_ENABLE_DRIVER_AVC=ON \ |
---|
157 | -DOGR_ENABLE_DRIVER_CAD=ON \ |
---|
158 | -DOGR_ENABLE_DRIVER_CSV=ON \ |
---|
159 | -DOGR_ENABLE_DRIVER_DGN=ON \ |
---|
160 | -DOGR_ENABLE_DRIVER_DXF=ON \ |
---|
161 | -DOGR_ENABLE_DRIVER_EDIGEO=ON \ |
---|
162 | -DOGR_ENABLE_DRIVER_FLATGEOBUF=ON \ |
---|
163 | -DOGR_ENABLE_DRIVER_JSONFG=ON \ |
---|
164 | -DOGR_ENABLE_DRIVER_GEOCONCEPT=ON \ |
---|
165 | -DOGR_ENABLE_DRIVER_GMT=ON \ |
---|
166 | -DOGR_ENABLE_DRIVER_MAPML=ON \ |
---|
167 | -DOGR_ENABLE_DRIVER_MVT=ON \ |
---|
168 | -DOGR_ENABLE_DRIVER_NTF=ON \ |
---|
169 | -DOGR_ENABLE_DRIVER_OPENFILEGDB=ON \ |
---|
170 | -DOGR_ENABLE_DRIVER_PG=OFF \ |
---|
171 | -DOGR_ENABLE_DRIVER_PGDUMP=ON \ |
---|
172 | -DOGR_ENABLE_DRIVER_S57=ON \ |
---|
173 | -DOGR_ENABLE_DRIVER_SDTS=ON \ |
---|
174 | -DOGR_ENABLE_DRIVER_SELAFIN=ON \ |
---|
175 | -DOGR_ENABLE_DRIVER_SQLITE=ON \ |
---|
176 | -DOGR_ENABLE_DRIVER_SXF=ON \ |
---|
177 | -DOGR_ENABLE_DRIVER_TIGER=ON \ |
---|
178 | -DOGR_ENABLE_DRIVER_VDV=ON \ |
---|
179 | -DOGR_ENABLE_DRIVER_WASP=ON |
---|
180 | |
---|
181 | # These drivers require curl |
---|
182 | configure.args-append \ |
---|
183 | -DGDAL_ENABLE_DRIVER_DAAS=ON \ |
---|
184 | -DGDAL_ENABLE_DRIVER_EEDA=ON \ |
---|
185 | -DGDAL_ENABLE_DRIVER_OGCAPI=ON \ |
---|
186 | -DGDAL_ENABLE_DRIVER_PLMOSAIC=ON \ |
---|
187 | -DGDAL_ENABLE_DRIVER_WCS=ON \ |
---|
188 | -DGDAL_ENABLE_DRIVER_WMS=ON \ |
---|
189 | -DGDAL_ENABLE_DRIVER_WMTS=ON \ |
---|
190 | -DOGR_ENABLE_DRIVER_AMIGOCLOUD=ON \ |
---|
191 | -DOGR_ENABLE_DRIVER_CARTO=ON \ |
---|
192 | -DOGR_ENABLE_DRIVER_CSW=OFF \ |
---|
193 | -DOGR_ENABLE_DRIVER_ELASTIC=ON \ |
---|
194 | -DOGR_ENABLE_DRIVER_NGW=ON \ |
---|
195 | -DOGR_ENABLE_DRIVER_PLSCENES=ON \ |
---|
196 | -DOGR_ENABLE_DRIVER_WFS=ON |
---|
197 | |
---|
198 | # These drivers require sqlite3 |
---|
199 | configure.args-append \ |
---|
200 | -DGDAL_ENABLE_DRIVER_MBTILES=ON \ |
---|
201 | -DGDAL_ENABLE_DRIVER_RASTERLITE=ON \ |
---|
202 | -DOGR_ENABLE_DRIVER_GPKG=ON \ |
---|
203 | -DOGR_ENABLE_DRIVER_OSM=ON \ |
---|
204 | -DOGR_ENABLE_DRIVER_PMTILES=ON \ |
---|
205 | -DOGR_ENABLE_DRIVER_VFK=ON |
---|
206 | |
---|
207 | # These drivers require expat |
---|
208 | configure.args-append \ |
---|
209 | -DOGR_ENABLE_DRIVER_GEORSS=ON \ |
---|
210 | -DOGR_ENABLE_DRIVER_GML=ON \ |
---|
211 | -DOGR_ENABLE_DRIVER_GPSBABEL=ON \ |
---|
212 | -DOGR_ENABLE_DRIVER_GPX=ON \ |
---|
213 | -DOGR_ENABLE_DRIVER_JML=ON \ |
---|
214 | -DOGR_ENABLE_DRIVER_LVBAG=ON \ |
---|
215 | -DOGR_ENABLE_DRIVER_ODS=ON \ |
---|
216 | -DOGR_ENABLE_DRIVER_SVG=ON \ |
---|
217 | -DOGR_ENABLE_DRIVER_XLSX=ON |
---|
218 | |
---|
219 | # These drivers require libxml2 |
---|
220 | configure.args-append \ |
---|
221 | -DGDAL_USE_LIBXML2=ON |
---|
222 | |
---|
223 | # These drivers require OpenEXR |
---|
224 | configure.args-append \ |
---|
225 | -DGDAL_ENABLE_DRIVER_EXR=OFF |
---|
226 | |
---|
227 | # These drivers require Apache Arrow |
---|
228 | configure.args-append \ |
---|
229 | -DGDAL_USE_ARROW=OFF \ |
---|
230 | -DGDAL_USE_PARQUET=OFF \ |
---|
231 | -DOGR_ENABLE_DRIVER_ARROW=OFF \ |
---|
232 | -DOGR_ENABLE_DRIVER_PARQUET=OFF |
---|
233 | |
---|
234 | # Miscellaneous drivers |
---|
235 | configure.args-append \ |
---|
236 | -DBUILD_CSHARP_BINDINGS=OFF \ |
---|
237 | -DBUILD_JAVA_BINDINGS=OFF \ |
---|
238 | -DBUILD_PYTHON_BINDINGS=OFF \ |
---|
239 | -DGDAL_USE_ARCHIVE=OFF \ |
---|
240 | -DGDAL_USE_CFITSIO=OFF \ |
---|
241 | -DGDAL_USE_CRYPTOPP=OFF \ |
---|
242 | -DGDAL_USE_CURL=ON \ |
---|
243 | -DGDAL_USE_DEFLATE=ON \ |
---|
244 | -DGDAL_USE_ECW=OFF \ |
---|
245 | -DGDAL_USE_EXPAT=ON \ |
---|
246 | -DGDAL_USE_GEOS=ON \ |
---|
247 | -DGDAL_USE_GEOTIFF_INTERNAL=ON \ |
---|
248 | -DGDAL_USE_GIF=ON \ |
---|
249 | -DGDAL_USE_HDF4=OFF \ |
---|
250 | -DGDAL_USE_HDF5=OFF \ |
---|
251 | -DGDAL_USE_HEIF=OFF \ |
---|
252 | -DGDAL_USE_ICONV=ON \ |
---|
253 | -DGDAL_USE_IDB=OFF \ |
---|
254 | -DGDAL_USE_LIBAEC=ON \ |
---|
255 | -DGDAL_USE_LIBKML=OFF \ |
---|
256 | -DGDAL_USE_LIBLZMA=OFF \ |
---|
257 | -DGDAL_USE_MRSID=OFF \ |
---|
258 | -DGDAL_USE_MYSQL=OFF \ |
---|
259 | -DGDAL_USE_NETCDF=OFF \ |
---|
260 | -DGDAL_USE_ODBC=OFF \ |
---|
261 | -DGDAL_USE_OGDI=OFF \ |
---|
262 | -DGDAL_USE_OPENCL=OFF \ |
---|
263 | -DGDAL_USE_OPENEXR=OFF \ |
---|
264 | -DGDAL_USE_OPENJPEG=OFF \ |
---|
265 | -DGDAL_USE_PCRE2=ON \ |
---|
266 | -DGDAL_USE_PDFIUM=OFF \ |
---|
267 | -DGDAL_USE_PNG=ON \ |
---|
268 | -DGDAL_USE_POPPLER=OFF \ |
---|
269 | -DGDAL_USE_POSTGRESQL=ON \ |
---|
270 | -DGDAL_USE_QHULL=ON \ |
---|
271 | -DGDAL_USE_SPATIALITE=ON \ |
---|
272 | -DGDAL_USE_SQLITE3=ON \ |
---|
273 | -DGDAL_USE_TILEDB=OFF \ |
---|
274 | -DGDAL_USE_TIFF_INTERNAL=ON \ |
---|
275 | -DGDAL_USE_WEBP=ON \ |
---|
276 | -DGDAL_USE_XERCESC=OFF \ |
---|
277 | -DGDAL_USE_ZSTD=ON |
---|
278 | |
---|
279 | |
---|
280 | configure.args-append \ |
---|
281 | -DLIBAEC_INCLUDE_DIR=${prefix}/lib/libaec/include \ |
---|
282 | -DLIBAEC_LIBRARY=${prefix}/lib/libaec/lib/libaec.dylib |
---|
283 | |
---|
284 | # Always choose internal libjson code (#44098) |
---|
285 | configure.args-append -DGDAL_USE_JSONC_INTERNAL=ON |
---|
286 | |
---|
287 | if {${build_arch} in [list i386 ppc]} { |
---|
288 | # https://trac.macports.org/ticket/67468 |
---|
289 | configure.args-append \ |
---|
290 | -DBUILD_WITHOUT_64BIT_OFFSET=ON |
---|
291 | } |
---|
292 | |
---|
293 | pre-configure { |
---|
294 | # see https://trac.macports.org/ticket/56517 |
---|
295 | if {[string match *clang* ${configure.cxx}] && ${configure.cxx_stdlib} ne ""} { |
---|
296 | configure.ldflags-append -stdlib=${configure.cxx_stdlib} |
---|
297 | } |
---|
298 | |
---|
299 | global worksrcpath_dirs |
---|
300 | if {![variant_exists universal] || ![variant_isset universal]} { |
---|
301 | set worksrcpath_dirs ${worksrcpath} |
---|
302 | } else { |
---|
303 | foreach arch ${universal_archs_to_use} { |
---|
304 | lappend worksrcpath_dirs ${worksrcpath}-${arch} |
---|
305 | } |
---|
306 | } |
---|
307 | } |
---|
308 | |
---|
309 | if {[variant_isset kea] && ![variant_isset hdf5]} { |
---|
310 | ui_msg "NOTE: KEA driver support depends on HDF5, +hdf5 variant is added." |
---|
311 | default_variants +hdf5 |
---|
312 | } |
---|
313 | |
---|
314 | # Set target to none |
---|
315 | build.target |
---|
316 | |
---|
317 | variant arrow description {Enable (Geo)Arrow IPC File Format / Stream and (Geo)Parquet support} { |
---|
318 | depends_lib-append port:apache-arrow |
---|
319 | configure.args-replace -DGDAL_USE_ARROW=OFF -DGDAL_USE_ARROW=ON \ |
---|
320 | -DGDAL_USE_PARQUET=OFF -DGDAL_USE_PARQUET=ON \ |
---|
321 | -DOGR_ENABLE_DRIVER_ARROW=OFF -DOGR_ENABLE_DRIVER_ARROW=ON \ |
---|
322 | -DOGR_ENABLE_DRIVER_PARQUET=OFF -DOGR_ENABLE_DRIVER_PARQUET=ON |
---|
323 | configure.args-append -DARROW_USE_STATIC_LIBRARIES=OFF |
---|
324 | } |
---|
325 | |
---|
326 | variant cfitsio description {Enable FITS support} { |
---|
327 | depends_lib-append port:cfitsio |
---|
328 | configure.args-replace -DGDAL_USE_CFITSIO=OFF -DGDAL_USE_CFITSIO=ON |
---|
329 | configure.args-append -DGDAL_ENABLE_DRIVER_FITS=ON |
---|
330 | } |
---|
331 | |
---|
332 | variant cryptopp description {Enable Crypto++ support} { |
---|
333 | depends_lib-append port:libcryptopp |
---|
334 | configure.args-replace -DGDAL_USE_CRYPTOPP=OFF -DGDAL_USE_CRYPTOPP=ON |
---|
335 | } |
---|
336 | |
---|
337 | variant ecw description {Enable ECW file format} { |
---|
338 | configure.args-replace -DGDAL_USE_ECW=OFF -DGDAL_USE_ECW=ON |
---|
339 | configure.args-append -DECW_ROOT=${prefix}/lib/ECW \ |
---|
340 | -DGDAL_ENABLE_DRIVER_ECW=ON |
---|
341 | pre-configure { |
---|
342 | if {(![file exists ${prefix}/lib/ECW]) && \ |
---|
343 | (![file exists /Intergraph/ERDASEcwJpeg2000SDK5.1.1/Desktop_Read-Only])} { |
---|
344 | ui_error " |
---|
345 | **** |
---|
346 | * The Intergraph ECW SDK version 5.5.0.2034 is needed to |
---|
347 | * compile gdal with the ecw variant. It must be installed separately. |
---|
348 | * Please download the macOS version of the SDK |
---|
349 | * 'ERDAS ECW/JP2 SDK v5.5 (MacOSX)' from |
---|
350 | * https://download.hexagongeospatial.com/downloads/ecw/erdas-ecw-jp2-sdk-v5-5-update-3-macos |
---|
351 | * Choose to install it in ${prefix}/lib/ECW. |
---|
352 | * Then try to install GDAL again. |
---|
353 | ****" |
---|
354 | return -code error "ECW SDK 5.5 not installed." |
---|
355 | } |
---|
356 | |
---|
357 | if {(![file exists ${prefix}/lib/ECW]) && \ |
---|
358 | ([file exists /Intergraph/ERDASEcwJpeg2000SDK5.1.1/Desktop_Read-Only])} { |
---|
359 | |
---|
360 | ui_error " |
---|
361 | **** |
---|
362 | * Please create symbolic links from the installation directory to |
---|
363 | * ${prefix}/lib/ECW, by executing at the prompt: |
---|
364 | * sudo ln -s \${ECW_install_dir}/ERDASEcwJpeg2000SDK5.5.1/Desktop_Read-Only \ |
---|
365 | ${prefix}/lib/ECW |
---|
366 | * Or reinstall the ECW SDK in ${prefix}/lib/ECW directly. |
---|
367 | * Then try again. |
---|
368 | ****" |
---|
369 | return -code error "Symlinks missing." |
---|
370 | } |
---|
371 | } |
---|
372 | } |
---|
373 | |
---|
374 | variant hdf4 description {Enable HDF4 file format} { |
---|
375 | depends_lib-append port:hdf4 |
---|
376 | configure.args-replace -DGDAL_USE_HDF4=OFF -DGDAL_USE_HDF4=ON |
---|
377 | configure.args-append -DGDAL_ENABLE_DRIVER_HDF4=ON |
---|
378 | } |
---|
379 | |
---|
380 | variant hdf5 description {Enable HDF5 file format} { |
---|
381 | pre-configure { |
---|
382 | # If HDF5 is built with a mpi variant, we need to know the path to "mpi.h". |
---|
383 | # Figure out HDF5's mpi include directory: |
---|
384 | set mpl_include_dir "" |
---|
385 | if {![catch {set result [active_variants hdf5 openmpi]}]} { |
---|
386 | if {$result} { |
---|
387 | set mpl_include_dir "-I${prefix}/include/openmpi-mp" |
---|
388 | } |
---|
389 | } |
---|
390 | if {![catch {set result [active_variants hdf5 mpich]}]} { |
---|
391 | if {$result} { |
---|
392 | set mpl_include_dir "-I${prefix}/include/mpich-mp" |
---|
393 | } |
---|
394 | } |
---|
395 | if {$mpl_include_dir ne ""} { |
---|
396 | configure.cxxflags-append ${mpl_include_dir} |
---|
397 | } |
---|
398 | } |
---|
399 | depends_lib-append port:hdf5 |
---|
400 | configure.args-replace -DGDAL_USE_HDF5=OFF -DGDAL_USE_HDF5=ON |
---|
401 | configure.args-append -DGDAL_ENABLE_DRIVER_HDF5=ON |
---|
402 | } |
---|
403 | |
---|
404 | variant heif description {Enable HEIF support} { |
---|
405 | depends_lib-append port:libheif |
---|
406 | configure.args-replace -DGDAL_USE_HEIF=OFF -DGDAL_USE_HEIF=ON |
---|
407 | configure.args-append -DGDAL_ENABLE_DRIVER_HEIF=ON |
---|
408 | } |
---|
409 | |
---|
410 | variant kea description {Enable KEA support} { |
---|
411 | depends_lib-append port:kealib |
---|
412 | configure.args-append -DGDAL_ENABLE_DRIVER_KEA=ON |
---|
413 | } |
---|
414 | |
---|
415 | variant libarchive description {Enable libarchive support} { |
---|
416 | depends_lib-append port:libarchive |
---|
417 | configure.args-replace -DGDAL_USE_ARCHIVE=OFF -DGDAL_USE_ARCHIVE=ON |
---|
418 | } |
---|
419 | |
---|
420 | variant libkml description {Enable libkml} { |
---|
421 | pre-configure { |
---|
422 | set boost_includedir [exec ${prefix}/bin/pkg-config --variable=boost_includedir libkml] |
---|
423 | configure.cxxflags-append -I${boost_includedir} |
---|
424 | } |
---|
425 | depends_lib-append port:libkml |
---|
426 | configure.args-replace -DGDAL_USE_LIBKML=OFF -DGDAL_USE_LIBKML=ON |
---|
427 | configure.args-append -DOGR_ENABLE_DRIVER_LIBKML=ON |
---|
428 | } |
---|
429 | |
---|
430 | variant lto description {Enable Link Time Optimization} { |
---|
431 | configure.args-append -DENABLE_IPO=ON |
---|
432 | } |
---|
433 | |
---|
434 | variant lzma description {Enable LZMA (7Z) compression support} { |
---|
435 | depends_lib-append port:lzma |
---|
436 | configure.args-replace -DGDAL_USE_LIBLZMA=OFF -DGDAL_USE_LIBLZMA=ON |
---|
437 | } |
---|
438 | |
---|
439 | variant mrsid description {Enable MrSID file format} { |
---|
440 | depends_lib-append port:geoexpress-sdk |
---|
441 | configure.args-replace -DGDAL_USE_MRSID=OFF -DGDAL_USE_MRSID=ON \ |
---|
442 | -DGDAL_USE_JP2MRSID=OFF -DGDAL_USE_JP2MRSID=ON |
---|
443 | } |
---|
444 | |
---|
445 | variant mysql57 conflicts mysql8 description {Enable MySQL 5.7 support} { |
---|
446 | depends_lib-append port:mysql57 |
---|
447 | configure.args-replace -DGDAL_USE_MYSQL=OFF -DGDAL_USE_MYSQL=ON |
---|
448 | configure.args-append -DMYSQL_INCLUDE_DIR=${prefix}/include/mysql57/mysql \ |
---|
449 | -DMYSQL_LIBRARY=${prefix}/lib/mysql57/mysql/libmysqlclient.dylib |
---|
450 | } |
---|
451 | |
---|
452 | variant mysql8 conflicts mysql57 description {Enable MySQL 8 support} { |
---|
453 | depends_lib-append port:mysql8 |
---|
454 | configure.args-replace -DGDAL_USE_MYSQL=OFF -DGDAL_USE_MYSQL=ON |
---|
455 | configure.args-append -DMYSQL_INCLUDE_DIR=${prefix}/include/mysql8/mysql \ |
---|
456 | -DMYSQL_LIBRARY=${prefix}/lib/mysql8/mysql/libmysqlclient.dylib |
---|
457 | } |
---|
458 | |
---|
459 | variant native description {Optimize for speed} { |
---|
460 | if {${os.arch} eq "arm"} { |
---|
461 | configure.optflags -O3 -pipe -mcpu=apple-m1 -DGDAL_COMPILATION |
---|
462 | } elseif {${os.arch} eq "powerpc"} { |
---|
463 | # https://github.com/macports/macports-ports/pull/18587#issuecomment-1540025830 |
---|
464 | configure.optflags -O3 -pipe -mtune=native -mcpu=native -DGDAL_COMPILATION |
---|
465 | } else { |
---|
466 | configure.optflags -O3 -pipe -march=native -DGDAL_COMPILATION |
---|
467 | } |
---|
468 | } |
---|
469 | |
---|
470 | variant netcdf description {Enable NetCDF file format} { |
---|
471 | pre-configure { |
---|
472 | # If NetCDF is built with a mpi variant, we need to know the path to "mpi.h". |
---|
473 | # Figure out NetCDF's mpi include directory: |
---|
474 | set mpl_include_dir "" |
---|
475 | if {![catch {set result [active_variants netcdf openmpi]}]} { |
---|
476 | if {$result} { |
---|
477 | set mpl_include_dir "-I${prefix}/include/openmpi-mp" |
---|
478 | } |
---|
479 | } |
---|
480 | if {![catch {set result [active_variants netcdf mpich]}]} { |
---|
481 | if {$result} { |
---|
482 | set mpl_include_dir "-I${prefix}/include/mpich-mp" |
---|
483 | } |
---|
484 | } |
---|
485 | if {$mpl_include_dir ne ""} { |
---|
486 | configure.cxxflags-append ${mpl_include_dir} |
---|
487 | } |
---|
488 | } |
---|
489 | depends_lib-append port:netcdf |
---|
490 | configure.args-replace -DGDAL_USE_NETCDF=OFF -DGDAL_USE_NETCDF=ON |
---|
491 | configure.args-append -DGDAL_ENABLE_DRIVER_NETCDF=ON |
---|
492 | } |
---|
493 | |
---|
494 | variant odbc description {Enable ODBC support} { |
---|
495 | depends_lib-append port:unixODBC |
---|
496 | configure.args-replace -DGDAL_USE_ODBC=OFF -DGDAL_USE_ODBC=ON |
---|
497 | # These drivers depend on odbc |
---|
498 | configure.args-append -DOGR_ENABLE_DRIVER_ODBC=ON \ |
---|
499 | -DOGR_ENABLE_DRIVER_PGEO=ON \ |
---|
500 | -DOGR_ENABLE_DRIVER_MSSQLSPATIAL=ON |
---|
501 | } |
---|
502 | |
---|
503 | variant opencl description {Enable OpenCL} { |
---|
504 | configure.args-replace -DGDAL_USE_OPENCL=OFF -DGDAL_USE_OPENCL=ON |
---|
505 | } |
---|
506 | |
---|
507 | variant openexr description {Enable OpenEXR image file format} { |
---|
508 | depends_lib-append port:openexr |
---|
509 | configure.args-replace -DGDAL_USE_OPENEXR=OFF -DGDAL_USE_OPENEXR=ON \ |
---|
510 | -DGDAL_ENABLE_DRIVER_EXR=OFF -DGDAL_ENABLE_DRIVER_EXR=ON |
---|
511 | } |
---|
512 | |
---|
513 | variant openjpeg description {Enable OpenJPEG JPEG-2000 format support} { |
---|
514 | depends_lib-append port:openjpeg |
---|
515 | configure.args-replace -DGDAL_USE_OPENJPEG=OFF -DGDAL_USE_OPENJPEG=ON |
---|
516 | configure.args-append -DGDAL_ENABLE_DRIVER_JP2OPENJPEG=ON |
---|
517 | } |
---|
518 | |
---|
519 | variant poppler description {Enable Poppler support} { |
---|
520 | depends_lib-append path:lib/pkgconfig/poppler.pc:poppler |
---|
521 | configure.args-replace -DGDAL_USE_POPPLER=OFF -DGDAL_USE_POPPLER=ON |
---|
522 | configure.args-append -DGDAL_ENABLE_DRIVER_PDF=ON |
---|
523 | } |
---|
524 | |
---|
525 | variant tiledb description {Enable TileDB support} { |
---|
526 | depends_lib-append port:tiledb |
---|
527 | configure.args-replace -DGDAL_USE_TILEDB=OFF -DGDAL_USE_TILEDB=ON |
---|
528 | configure.args-append -DGDAL_ENABLE_DRIVER_TILEDB=ON |
---|
529 | } |
---|
530 | |
---|
531 | # PostgreSQL variants |
---|
532 | set pg_suffixes {12 13 14 15} |
---|
533 | set pg_variants {} |
---|
534 | set pg_default_variant "if {" |
---|
535 | foreach v ${pg_suffixes} { |
---|
536 | lappend pg_variants postgresql${v} |
---|
537 | set pg_default_variant "${pg_default_variant}!\[variant_isset postgresql${v}] && " |
---|
538 | } |
---|
539 | set pg_default_variant [string range ${pg_default_variant} 0 end-4] |
---|
540 | set pg_default_variant "${pg_default_variant}} {default_variants +postgresql${v}}" |
---|
541 | eval $pg_default_variant |
---|
542 | foreach v ${pg_suffixes} { |
---|
543 | set p postgresql${v} |
---|
544 | set i [lsearch -exact ${pg_variants} ${p}] |
---|
545 | set c [lreplace ${pg_variants} ${i} ${i}] |
---|
546 | variant ${p} description "Enable PostgreSQL ${v} support" conflicts {*}${c} " |
---|
547 | depends_lib-append port:${p} |
---|
548 | configure.args-replace -DOGR_ENABLE_DRIVER_PG=OFF -DOGR_ENABLE_DRIVER_PG=ON |
---|
549 | configure.args-append -DPostgreSQL_INCLUDE_DIR=${prefix}/include/${p} \ |
---|
550 | -DPostgreSQL_LIBRARY_DIR=${prefix}/lib/${p} \ |
---|
551 | -DPostgreSQL_ADDITIONAL_VERSIONS=${v} |
---|
552 | " |
---|
553 | } |
---|
554 | |
---|
555 | # PROJ variants |
---|
556 | set proj_versions {6 7 8 9} |
---|
557 | set proj_variants {} |
---|
558 | foreach pjver ${proj_versions} { |
---|
559 | lappend proj_variants proj${pjver} |
---|
560 | } |
---|
561 | foreach proj_ver ${proj_versions} { |
---|
562 | set index [lsearch -exact ${proj_variants} proj${proj_ver}] |
---|
563 | set cflcts [lreplace ${proj_variants} ${index} ${index}] |
---|
564 | variant proj${proj_ver} description "Use Proj${proj_ver}" conflicts {*}${cflcts} " |
---|
565 | depends_lib-append port:proj${proj_ver} |
---|
566 | configure.args-append -DGDAL_USE_PROJ=ON \ |
---|
567 | -DPROJ_INCLUDE_DIR=${prefix}/lib/proj${proj_ver}/include \ |
---|
568 | -DPROJ_LIBRARY_RELEASE=${prefix}/lib/proj${proj_ver}/lib/libproj.dylib |
---|
569 | " |
---|
570 | } |
---|
571 | set projdf "if {" |
---|
572 | foreach pv ${proj_versions} { |
---|
573 | set projdf "${projdf}!\[variant_isset proj${pv}\] && " |
---|
574 | } |
---|
575 | set projdf [string range ${projdf} 0 end-4] |
---|
576 | set projdf "${projdf}} { default_variants +proj${pv} }" |
---|
577 | eval ${projdf} |
---|
578 | |
---|
579 | variant xerces description {Enable Xerces XML support for GML file format} { |
---|
580 | depends_lib-append path:include/xercesc/util/XercesVersion.hpp:xercesc3 |
---|
581 | configure.args-replace -DGDAL_USE_XERCESC=OFF -DGDAL_USE_XERCESC=ON |
---|
582 | # These drivers need xerces-c |
---|
583 | configure.args-append -DOGR_ENABLE_DRIVER_NAS=ON \ |
---|
584 | -DOGR_ENABLE_DRIVER_ILI=ON \ |
---|
585 | -DOGR_ENABLE_DRIVER_GMLAS=ON |
---|
586 | } |
---|
587 | |
---|
588 | set jpeg2k 0 |
---|
589 | foreach jpeg2kVariant {openjpeg ecw} { |
---|
590 | if {[variant_isset ${jpeg2kVariant}]} { |
---|
591 | incr jpeg2k 1 |
---|
592 | } |
---|
593 | } |
---|
594 | if {${jpeg2k} > 1} { |
---|
595 | notes-append "Multiple drivers are able to open JPEG-2000 datasets. See https://trac.osgeo.org/gdal/wiki/ConfigOptions#GDAL_SKIP." |
---|
596 | } |
---|
597 | |
---|
598 | post-destroot { |
---|
599 | xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name} |
---|
600 | xinstall -m 644 -W ${worksrcpath} HOWTO-RELEASE VERSION \ |
---|
601 | ${destroot}${prefix}/share/doc/${name} |
---|
602 | |
---|
603 | if {[variant_isset ecw]} { |
---|
604 | foreach f [list \ |
---|
605 | bin/gdal_contour \ |
---|
606 | bin/gdal_create \ |
---|
607 | bin/gdal_grid \ |
---|
608 | bin/gdal_rasterize \ |
---|
609 | bin/gdal_translate \ |
---|
610 | bin/gdal_viewshed \ |
---|
611 | bin/gdaladdo \ |
---|
612 | bin/gdalbuildvrt \ |
---|
613 | bin/gdaldem \ |
---|
614 | bin/gdalenhance \ |
---|
615 | bin/gdalinfo \ |
---|
616 | bin/gdallocationinfo \ |
---|
617 | bin/gdalmanage \ |
---|
618 | bin/gdalmdiminfo \ |
---|
619 | bin/gdalmdimtranslate \ |
---|
620 | bin/gdalsrsinfo \ |
---|
621 | bin/gdaltindex \ |
---|
622 | bin/gdaltransform \ |
---|
623 | bin/gdalwarp \ |
---|
624 | bin/gnmanalyse \ |
---|
625 | lib/libgdal.dylib] \ |
---|
626 | { |
---|
627 | if {${configure.cxx_stdlib} eq "libc++"} { |
---|
628 | system "install_name_tool -change \ |
---|
629 | /Users/jenkins/hudson/workspace/RL_5.1.1_ECWJP2SDK_OSX/Master/libNCSEcw.dylib ${prefix}/lib/ECW/redistributable/libc++/libNCSEcw.dylib \ |
---|
630 | ${destroot}${prefix}/${f}" |
---|
631 | } else { |
---|
632 | system "install_name_tool -change \ |
---|
633 | /Users/jenkins/hudson/workspace/RL_5.1.1_ECWJP2SDK_OSX/Master/libNCSEcw.dylib ${prefix}/lib/ECW/redistributable/libstdc++/libNCSEcw.dylib \ |
---|
634 | ${destroot}${prefix}/${f}" |
---|
635 | } |
---|
636 | } |
---|
637 | } |
---|
638 | |
---|
639 | } |
---|
640 | |
---|
641 | livecheck.type regex |
---|
642 | livecheck.url https://download.osgeo.org/gdal/CURRENT |
---|
643 | livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)\\.tar |
---|