Ticket #24877: Portfile

File Portfile, 7.1 KB (added by Veence (Vincent), 14 years ago)

Gdal 1.7.2 Portfile

Line 
1# $Id: Portfile 64763 2010-03-15 16:31:33Z nox@macports.org $
2
3PortSystem                      1.0
4name                            gdal
5version                         1.7.2
6revision                        3
7maintainers                     gmail.com:seanasy
8platforms                       darwin
9description                     GDAL - Geospatial Data Abstraction Library
10long_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.
17homepage                        http://www.gdal.org/
18master_sites            http://www.gdal.org/dl/ \
19                                        http://download.osgeo.org/gdal/
20categories                      gis
21checksums           md5     05351f8cb61761ae579667e24a297fe6 \
22                    sha1    a03127530708e3924aec7b505cc2ca4f8153f13c \
23                    rmd160  a3f7950798448d8179f899dc095a83e23dcc269b
24
25depends_lib                     port:zlib port:libpng port:tiff port:libgeotiff port:jpeg \
26                                        path:include/gif_lib.h:giflib port:proj
27                       
28set                                     PYINST  ""
29
30configure.args-append \
31                                        --with-local=${prefix} --with-libz=${prefix}\
32                                        --with-png=${prefix}\
33                                        --with-libtiff=${prefix} --with-geotiff=${prefix}\
34                                        --with-jpeg=${prefix} --with-gif=${prefix}\
35                                        --with-static-proj4=${prefix}\
36                                        --without-pg --without-grass --without-libgrass\
37                                        --without-cfitsio --without-pcraster --without-netcdf\
38                                        --without-ogdi --without-fme --without-hdf4 --without-hdf5\
39                                        --without-jasper --without-ecw --without-kakadu\
40                                        --without-mrsid --without-jp2mrsid --without-msg\
41                                        --without-bsb --without-oci --without-spatialite\
42                                        --without-grib --without-mysql --without-ingres\
43                                        --without-xerces --without-expat --without-odbc\
44                                        --with-dods-support=no --without-curl --without-sqlite3\
45                                        --without-dwgdirect --without-idb --without-sde\
46                                        --without-geos --without-pam --without-macosx-framework\
47                                        --without-perl --without-php --without-ruby\
48                                        --without-python --without-ogpython\
49                                        --mandir=${prefix}/share/man --with-threads=-lpthread
50
51                               
52# Patch to ensure that the python installation respects DESTDIR
53patchfiles      patch-swig_python_GNUmakefile
54
55# Patches for universal build
56
57post-configure {
58        reinplace -E "s|XXX|${PYINST}|" ${worksrcpath}/swig/python/GNUmakefile
59        if {[variant_isset universal]} {
60                system "cd ${worksrcpath} && patch -p0 < ${portpath}/files/patch_cpl_config_h"
61        }
62}
63
64# Set target to none
65build.target
66
67variant geos description {Enable GEOS geometry engine functionality} {
68        depends_lib-append              port:geos
69        configure.args-delete   --without-geos
70        configure.args-append   --with-geos=${prefix}/bin/geos-config
71}
72
73variant curl description {Enable curl support} {
74        depends_lib-append              port:curl
75        configure.args-delete   --without-curl
76        configure.args-append   --with-curl=${prefix}/bin/curl-config
77}
78
79variant mrsid description       {Enable MrSID file format} {
80        depends_lib-append              port:geoexpress-sdk
81        configure.args-delete   --without-mrsid
82        configure.args-append   --with-mrsid=${prefix}/share/Geo_DSDK
83
84        # Fixes for Geo_DSDK 7.x - http://trac.osgeo.org/gdal/ticket/2410
85        patchfiles-append               patch-frmts_mrsid_mrsiddataset.cpp \
86                                                        patch-mrsid-configure
87}
88
89variant hdf4 description        {Enable HDF4 file format} {
90        depends_lib-append              port:hdf4
91        configure.args-delete   --without-hdf4
92        configure.args-append   --with-hdf4=${prefix}
93}
94
95variant hdf5 description        {Enable HDF5 file format} {
96        depends_lib-append              port:hdf5-18
97        configure.args-delete   --without-hdf5
98        configure.args-append   --with-hdf5=${prefix}
99}
100
101variant netcdf description      {Enable NetCDF file format} {
102        depends_lib-append              port:netcdf
103        configure.args-delete   --without-netcdf
104        configure.args-append   --with-netcdf=${prefix}
105}
106
107variant jasper description {Enable JasPer JPEG-2000 file format} {
108        depends_lib-append              port:jasper
109        configure.args-delete   --without-jasper
110        configure.args-append   --with-jasper=${prefix}
111}
112
113variant xerces description {Enable xerces XML support for GML file format} {
114        depends_lib-append              port:xercesc
115        configure.args-delete   --without-xerces
116        configure.args-append   --with-xerces=${prefix}
117}
118
119# Python variants
120variant python24 description {Enable Python 2.4 support} {
121        depends_lib-append              port:python24 \
122                                                        port:py-numpy
123        configure.args-delete   --without-python
124        configure.args-append   --with-python
125        set     PYINST                          ${frameworks_dir}/Python.framework/Versions/2.4
126        build.args-append               PYTHON=python2.4
127}
128
129variant python25 description {Enable Python 2.5 support} {
130        depends_lib-append              port:python25 \
131                                                        port:py25-numpy
132        configure.args-delete   --without-python
133        configure.args-append   --with-python
134        set     PYINST                          ${frameworks_dir}/Python.framework/Versions/2.5
135        build.args-append               PYTHON=python2.5
136}
137
138variant python26 description {Enable Python 2.6 support} {
139        depends_lib-append              port:python26 \
140                                                        port:py26-numpy
141        configure.args-delete   --without-python
142        configure.args-append   --with-python
143        set     PYINST                           ${frameworks_dir}/Python.framework/Versions/2.6
144        build.args-append               PYTHON=python2.6
145        use_parallel_build              no
146}
147
148# Database variants
149variant postgresql81 description {Enable PostgreSQL 8.1 support} {
150        depends_lib-append              port:postgresql81
151        configure.args-delete   --without-pg
152        configure.args-append   --with-pg=${prefix}/lib/postgresql81/bin/pg_config
153}
154
155variant postgresql82 description {Enable PostgreSQL 8.2 support} {
156        depends_lib-append              port:postgresql82
157        configure.args-delete   --without-pg
158        configure.args-append   --with-pg=${prefix}/lib/postgresql82/bin/pg_config
159}
160
161variant postgresql83 description {Enable PostgreSQL 8.3 support} {
162        depends_lib-append              port:postgresql83
163        configure.args-delete   --without-pg
164        configure.args-append   --with-pg=${prefix}/lib/postgresql83/bin/pg_config
165}
166
167variant postgresql84 description {Enable PostgreSQL 8.4 support} {
168        depends_lib-append              port:postgresql84
169        configure.args-delete   --without-pg
170        configure.args-append   --with-pg=${prefix}/lib/postgresql84/bin/pg_config
171}
172
173variant mysql5 description {Enable MySQL 5 support} {
174        depends_lib-append              path:bin/mysql_config5:mysql5
175        configure.args-delete   --without-mysql
176        configure.args-append   --with-mysql=${prefix}/lib/mysql5/bin/mysql_config
177}       
178
179variant sqlite3 description {Enable SQLite3 support} {
180        depends_lib-append              port:sqlite3
181        configure.args-delete   --without-sqlite3
182        configure.args-append   --with-sqlite3=${prefix}
183}
184
185variant spatialite description {Uses spatialite database} {
186        depends_lib-append              port:spatialite
187        configure.args-delete   --without-spatialite
188        configure.args-append   --with-spatialite=${prefix}
189}
190
191variant odbc description {Enable ODBC support} {
192        depends_lib-append              port:unixODBC
193        configure.args-delete   --without-odbc
194        configure.args-append   --with-odbc=${prefix}
195}
196
197# OS X Framework
198variant framework description {Build as a Mac OS X framework} {
199        configure.args-append   --with-macosx-framework
200}
201
202post-destroot {
203        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
204        xinstall -m 644 -W ${worksrcpath} HOWTO-RELEASE NEWS VERSION \
205                                                ${destroot}${prefix}/share/doc/${name}
206}
207
208livecheck.type  regex
209livecheck.url   http://download.osgeo.org/gdal/
210livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)\\.tar