1 | # $Id: Portfile 85049 2011-10-08 09:53:47Z takeshi@macports.org $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | name gdal |
---|
5 | version 1.8.0 |
---|
6 | revision 1 |
---|
7 | maintainers gmail.com:seanasy |
---|
8 | platforms darwin |
---|
9 | description GDAL - Geospatial Data Abstraction Library |
---|
10 | long_description GDAL is a translator library for raster geospatial \ |
---|
11 | data formats that is released under an X/MIT style \ |
---|
12 | Open Source license. As a library, it presents a \ |
---|
13 | single abstract data model to the calling application \ |
---|
14 | for all supported formats. The related OGR library \ |
---|
15 | (which lives within the GDAL source tree) provides a \ |
---|
16 | similar capability for simple features vector data. |
---|
17 | homepage http://www.gdal.org/ |
---|
18 | master_sites http://www.gdal.org/dl/ \ |
---|
19 | http://download.osgeo.org/gdal/ |
---|
20 | categories gis |
---|
21 | checksums md5 c762cdab0f7e51a677ba49278a8a263d \ |
---|
22 | rmd160 0e116f41b23ff5b44c692f56459facab332c6201 \ |
---|
23 | sha1 e5a2802933054050c6fb0b0a0e1f46b5dd195b0a |
---|
24 | |
---|
25 | depends_lib port:zlib port:libpng port:tiff port:libgeotiff port:jpeg \ |
---|
26 | path:include/gif_lib.h:giflib port:proj |
---|
27 | |
---|
28 | set PYINST "" |
---|
29 | set OPENCLBASE "/System/Library/Frameworks/OpenCL.framework/" |
---|
30 | |
---|
31 | configure.args --with-local=${prefix} \ |
---|
32 | --with-libz=${prefix} --without-lzma \ |
---|
33 | --with-png=${prefix} \ |
---|
34 | --with-libtiff=${prefix} --with-geotiff=${prefix} \ |
---|
35 | --with-jpeg=${prefix}\ |
---|
36 | --with-gif=${prefix} \ |
---|
37 | --with-static-proj4=${prefix} \ |
---|
38 | --without-pg --without-grass --without-libgrass \ |
---|
39 | --without-cfitsio --without-pcraster --without-netcdf \ |
---|
40 | --without-ogdi --without-fme --without-hdf4 --without-hdf5 \ |
---|
41 | --without-jasper --without-openjpeg \ |
---|
42 | --without-ecw --without-kakadu \ |
---|
43 | --without-mrsid \ |
---|
44 | --without-jp2mrsid --without-msg --without-bsb --without-oci \ |
---|
45 | --without-grib --without-mysql --without-ingres \ |
---|
46 | --without-xerces \ |
---|
47 | --without-odbc \ |
---|
48 | --without-curl --without-sqlite3 --without-spatialite\ |
---|
49 | --without-dwgdirect --without-idb --without-sde \ |
---|
50 | --without-geos \ |
---|
51 | --without-opencl \ |
---|
52 | --without-pam --without-perl \ |
---|
53 | --without-php --without-ruby \ |
---|
54 | --without-python \ |
---|
55 | --without-xerces --without-expat \ |
---|
56 | --mandir=${prefix}/share/man |
---|
57 | # Patch to ensure that the python installation respects DESTDIR |
---|
58 | patchfiles patch-swig_python_GNUmakefile \ |
---|
59 | patch-gdalwarpkernel_opencl_c.diff |
---|
60 | |
---|
61 | # Patches for universal build |
---|
62 | |
---|
63 | post-configure { |
---|
64 | reinplace -E "s|(INST_PYMOD).*|\\1\t=\t${PYINST}|" \ |
---|
65 | ${worksrcpath}/GDALmake.opt |
---|
66 | if {[variant_isset universal]} { |
---|
67 | system "ed - ${worksrcpath}/port/cpl_config.h < ${filespath}/config.h.ed" |
---|
68 | |
---|
69 | } |
---|
70 | } |
---|
71 | |
---|
72 | # Set target to none |
---|
73 | build.target |
---|
74 | |
---|
75 | variant lzma conflicts universal \ |
---|
76 | description {Enable LZMA (7Z) compression support} { |
---|
77 | depends_lib-append port:lzma |
---|
78 | configure.args-delete --without-lzma |
---|
79 | configure.args-append --with-lzma=${prefix} |
---|
80 | } |
---|
81 | |
---|
82 | variant geos description {Enable GEOS geometry engine functionality} { |
---|
83 | depends_lib-append port:geos |
---|
84 | configure.args-delete --without-geos |
---|
85 | configure.args-append --with-geos=${prefix}/bin/geos-config |
---|
86 | } |
---|
87 | |
---|
88 | variant curl description {Enable curl support} { |
---|
89 | depends_lib-append port:curl |
---|
90 | configure.args-delete --without-curl |
---|
91 | configure.args-append --with-curl=${prefix}/bin/curl-config |
---|
92 | } |
---|
93 | |
---|
94 | variant mrsid description {Enable MrSID file format} { |
---|
95 | depends_lib-append port:geoexpress-sdk |
---|
96 | configure.args-delete --without-mrsid |
---|
97 | configure.args-append --with-mrsid=${prefix}/share/Geo_DSDK |
---|
98 | |
---|
99 | # Fixes for Geo_DSDK 7.x - http://trac.osgeo.org/gdal/ticket/2410 |
---|
100 | patchfiles-append patch-frmts_mrsid_mrsiddataset.cpp \ |
---|
101 | patch-mrsid-configure |
---|
102 | } |
---|
103 | |
---|
104 | variant hdf4 description {Enable HDF4 file format} { |
---|
105 | depends_lib-append port:hdf4 |
---|
106 | configure.args-delete --without-hdf4 |
---|
107 | configure.args-append --with-hdf4=${prefix} |
---|
108 | } |
---|
109 | |
---|
110 | variant hdf5 description {Enable HDF5 file format} { |
---|
111 | depends_lib-append port:hdf5-18 |
---|
112 | configure.args-delete --without-hdf5 |
---|
113 | configure.args-append --with-hdf5=${prefix} |
---|
114 | } |
---|
115 | |
---|
116 | variant netcdf description {Enable NetCDF file format} { |
---|
117 | depends_lib-append port:netcdf |
---|
118 | configure.args-delete --without-netcdf |
---|
119 | configure.args-append --with-netcdf=${prefix} |
---|
120 | } |
---|
121 | |
---|
122 | #JPEG-2K |
---|
123 | |
---|
124 | variant jasper conflicts openjpeg \ |
---|
125 | description {Enable JasPer JPEG-2000 format support} { |
---|
126 | depends_lib-append port:jasper |
---|
127 | configure.args-delete --without-jasper |
---|
128 | configure.args-append --with-jasper=${prefix} |
---|
129 | } |
---|
130 | |
---|
131 | variant openjpeg conflicts jasper \ |
---|
132 | description {Enable OpenJPEG JPEG-2000 format support} { |
---|
133 | depends_lib-append port:openjpeg |
---|
134 | configure.args-delete --without-openjpeg |
---|
135 | configure.args-append --with-openjpeg=${prefix} |
---|
136 | } |
---|
137 | |
---|
138 | |
---|
139 | variant xerces description {Enable xerces XML support for GML file format} { |
---|
140 | depends_lib-append port:xercesc |
---|
141 | configure.args-delete --without-xerces |
---|
142 | configure.args-append --with-xerces=${prefix} |
---|
143 | } |
---|
144 | |
---|
145 | variant expat description {Enable expat XML support} { |
---|
146 | depends_lib-append port:expat |
---|
147 | configure.args-delete --without-expat |
---|
148 | configure.args-append --with-expat=${prefix} |
---|
149 | } |
---|
150 | |
---|
151 | # Python variants |
---|
152 | variant python24 conflicts python25 python26 python27 \ |
---|
153 | description {Enable Python 2.4 support} { |
---|
154 | depends_lib-append port:python24 \ |
---|
155 | port:py-numpy |
---|
156 | configure.args-delete --without-python |
---|
157 | configure.args-append --with-python |
---|
158 | set PYINST ${frameworks_dir}/Python.framework/Versions/2.4 |
---|
159 | build.args-append PYTHON=python2.4 |
---|
160 | } |
---|
161 | |
---|
162 | variant python25 conflicts python24 python26 python27 \ |
---|
163 | description {Enable Python 2.5 support} { |
---|
164 | depends_lib-append port:python25 \ |
---|
165 | port:py25-numpy |
---|
166 | configure.args-delete --without-python |
---|
167 | configure.args-append --with-python |
---|
168 | set PYINST ${frameworks_dir}/Python.framework/Versions/2.5 |
---|
169 | build.args-append PYTHON=python2.5 |
---|
170 | } |
---|
171 | |
---|
172 | variant python26 conflicts python24 python25 python27 \ |
---|
173 | description {Enable Python 2.6 support} { |
---|
174 | depends_lib-append port:python26 \ |
---|
175 | port:py26-numpy |
---|
176 | configure.args-delete --without-python |
---|
177 | configure.args-append --with-python |
---|
178 | configure.args-append |
---|
179 | build.args-append PYTHON=python2.6 |
---|
180 | set PYINST ${frameworks_dir}/Python.framework/Versions/2.6 |
---|
181 | use_parallel_build no |
---|
182 | } |
---|
183 | |
---|
184 | variant python27 conflicts python24 python25 python26 \ |
---|
185 | description {Enable Python 2.7 support} { |
---|
186 | depends_lib-append port:python27 \ |
---|
187 | port:py27-numpy |
---|
188 | configure.args-delete --without-python |
---|
189 | configure.args-append --with-python |
---|
190 | configure.args-append |
---|
191 | build.args-append PYTHON=python2.7 |
---|
192 | set PYINST ${frameworks_dir}/Python.framework/Versions/2.7 |
---|
193 | use_parallel_build no |
---|
194 | } |
---|
195 | |
---|
196 | # Database variants |
---|
197 | variant postgresql81 description {Enable PostgreSQL 8.1 support} { |
---|
198 | depends_lib-append port:postgresql81 |
---|
199 | configure.args-delete --without-pg |
---|
200 | configure.args-append --with-pg=${prefix}/lib/postgresql81/bin/pg_config |
---|
201 | } |
---|
202 | |
---|
203 | variant postgresql82 description {Enable PostgreSQL 8.2 support} { |
---|
204 | depends_lib-append port:postgresql82 |
---|
205 | configure.args-delete --without-pg |
---|
206 | configure.args-append --with-pg=${prefix}/lib/postgresql82/bin/pg_config |
---|
207 | } |
---|
208 | |
---|
209 | variant postgresql83 description {Enable PostgreSQL 8.3 support} { |
---|
210 | depends_lib-append port:postgresql83 |
---|
211 | configure.args-delete --without-pg |
---|
212 | configure.args-append --with-pg=${prefix}/lib/postgresql83/bin/pg_config |
---|
213 | } |
---|
214 | |
---|
215 | variant postgresql84 description {Enable PostgreSQL 8.4 support} { |
---|
216 | depends_lib-append port:postgresql84 |
---|
217 | configure.args-delete --without-pg |
---|
218 | configure.args-append --with-pg=${prefix}/lib/postgresql84/bin/pg_config |
---|
219 | } |
---|
220 | |
---|
221 | variant postgresql90 description {Enable PostgreSQL 9.0 support} { |
---|
222 | depends_lib-append port:postgresql90 |
---|
223 | configure.args-delete --without-pg |
---|
224 | configure.args-append --with-pg=${prefix}/lib/postgresql90/bin/pg_config |
---|
225 | } |
---|
226 | |
---|
227 | variant postgresql91 description {Enable PostgreSQL 9.1 support} { |
---|
228 | depends_lib-append port:postgresql91 |
---|
229 | configure.args-delete --without-pg |
---|
230 | configure.args-append --with-pg=${prefix}/lib/postgresql91/bin/pg_config |
---|
231 | } |
---|
232 | |
---|
233 | variant mysql5 description {Enable MySQL 5 support} { |
---|
234 | depends_lib-append path:bin/mysql_config5:mysql5 |
---|
235 | configure.args-delete --without-mysql |
---|
236 | configure.args-append --with-mysql=${prefix}/lib/mysql5/bin/mysql_config |
---|
237 | } |
---|
238 | |
---|
239 | variant sqlite3 description {Enable SQLite3 support} { |
---|
240 | depends_lib-append port:sqlite3 |
---|
241 | configure.args-delete --without-sqlite3 |
---|
242 | configure.args-append --with-sqlite3=${prefix} |
---|
243 | } |
---|
244 | |
---|
245 | variant spatialite description {Enable SpartiaLite support} { |
---|
246 | depends_lib-append port:spatialite |
---|
247 | configure.args-delete --without-spatialite |
---|
248 | configure.args-append --with-spatialite=${prefix} |
---|
249 | } |
---|
250 | |
---|
251 | variant odbc description {Enable ODBC support} { |
---|
252 | depends_lib-append port:unixODBC |
---|
253 | configure.args-delete --without-odbc |
---|
254 | configure.args-append --with-odbc=${prefix} |
---|
255 | } |
---|
256 | |
---|
257 | # OpenCL |
---|
258 | |
---|
259 | variant opencl description {Use OpenCL for parallel computations} { |
---|
260 | configure.args-delete --without-opencl |
---|
261 | configure.args-append --with-opencl |
---|
262 | configure.args-append --with-opencl-include=${OPENCLBASE}/Headers |
---|
263 | configure.args-append --with-opencl-lib='-framework OpenCL' |
---|
264 | } |
---|
265 | |
---|
266 | # OS X Framework |
---|
267 | variant framework description {Build as a Mac OS X framework} { |
---|
268 | configure.args-append --with-macosx-framework |
---|
269 | } |
---|
270 | |
---|
271 | default_variants +expat |
---|
272 | |
---|
273 | # Postconfigure hack to avoid read ${include} .h files before |
---|
274 | # GDAL own include directories |
---|
275 | |
---|
276 | post-configure { |
---|
277 | set FRMT_PATH ${worksrcpath}/ogr/ogrsf_frmts |
---|
278 | foreach makefile [glob -dir $FRMT_PATH */GNUmakefile] { |
---|
279 | reinplace "s|\$\(EXPAT_INCLUDE\)||" $makefile |
---|
280 | } |
---|
281 | } |
---|
282 | |
---|
283 | post-destroot { |
---|
284 | xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name} |
---|
285 | xinstall -m 644 -W ${worksrcpath} HOWTO-RELEASE NEWS VERSION \ |
---|
286 | ${destroot}${prefix}/share/doc/${name} |
---|
287 | } |
---|
288 | |
---|
289 | |
---|
290 | livecheck.type regex |
---|
291 | livecheck.url http://download.osgeo.org/gdal/ |
---|
292 | livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)\\.tar |
---|