1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | |
---|
5 | name postgis2 |
---|
6 | categories databases gis |
---|
7 | license GPL-2+ |
---|
8 | version 2.4.3 |
---|
9 | epoch 1 |
---|
10 | #revision 3 |
---|
11 | platforms darwin |
---|
12 | maintainers vince openmaintainer |
---|
13 | |
---|
14 | description PostGIS is the spatial extension to the\ |
---|
15 | PostGreSQL database. |
---|
16 | |
---|
17 | long_description PostGIS 2 adds geometrical, geographical and topological\ |
---|
18 | types, and functions operating thereon, to the PostGreSQL\ |
---|
19 | database. The 2.0 release also provides raster handling\ |
---|
20 | and basic 3D geometry capacities (TIN and polyhedra). |
---|
21 | |
---|
22 | homepage http://postgis.refractions.net/ |
---|
23 | |
---|
24 | master_sites http://download.osgeo.org/postgis/source |
---|
25 | distname postgis-${version} |
---|
26 | |
---|
27 | checksums rmd160 0c0d4ca47a9a0cddfdc3127558d19a5a193d8c68 \ |
---|
28 | sha256 ea5374c5db6b645ba5628ddcb08f71d3b3d90a464d366b4e1d20d5a268bde4b9 |
---|
29 | |
---|
30 | depends_build port:autoconf \ |
---|
31 | port:automake \ |
---|
32 | port:libtool \ |
---|
33 | port:libxslt |
---|
34 | |
---|
35 | depends_lib port:geos\ |
---|
36 | port:proj\ |
---|
37 | port:libiconv\ |
---|
38 | port:libxml2\ |
---|
39 | port:json-c |
---|
40 | |
---|
41 | # PostGIS 2.0 is not compatible with PostGIS 1.5 |
---|
42 | |
---|
43 | conflicts postgis |
---|
44 | |
---|
45 | # Neither is PostGIS 2.0 compatible with PostGreSQL 8 |
---|
46 | # Database variants (from the GDAL port) |
---|
47 | set postgresql_suffixes {10 93 94 95 96} |
---|
48 | |
---|
49 | set postgresql_variants {} |
---|
50 | |
---|
51 | foreach suffix ${postgresql_suffixes} { |
---|
52 | lappend postgresql_variants postgresql${suffix} |
---|
53 | } |
---|
54 | |
---|
55 | foreach suffix ${postgresql_suffixes} { |
---|
56 | set vrt postgresql${suffix} |
---|
57 | set pgversion [string index ${suffix} 0].[string index ${suffix} 1] |
---|
58 | set index [lsearch -exact ${postgresql_variants} ${vrt}] |
---|
59 | set conf [lreplace ${postgresql_variants} ${index} ${index}] |
---|
60 | |
---|
61 | variant ${vrt} \ |
---|
62 | conflicts ${conf} \ |
---|
63 | description "Use PostgreSQL ${pgversion}" \ |
---|
64 | " |
---|
65 | depends_lib-append port:${vrt} |
---|
66 | configure.args-append --libdir=${prefix}/lib/${vrt} \ |
---|
67 | --with-pgconfig=${prefix}/lib/${vrt}/bin/pg_config |
---|
68 | build.args-append \ |
---|
69 | PGSQL_DOCDIR=${destroot}${prefix}/share/doc/${vrt} \ |
---|
70 | PGSQL_MANDIR=${destroot}${prefix}/share/man |
---|
71 | " |
---|
72 | } |
---|
73 | |
---|
74 | # postgresql default |
---|
75 | set pgdefault "if {" |
---|
76 | |
---|
77 | foreach suffix ${postgresql_suffixes} { |
---|
78 | set pgdefault "${pgdefault}!\[variant_isset postgresql${suffix}\] && " |
---|
79 | } |
---|
80 | |
---|
81 | set pgdefault [string range ${pgdefault} 0 end-4] |
---|
82 | set pgdefault "${pgdefault}} { default_variants +postgresql10 }" |
---|
83 | |
---|
84 | eval ${pgdefault} |
---|
85 | |
---|
86 | variant raster description {Build raster support} { |
---|
87 | |
---|
88 | depends_lib-append port:gdal |
---|
89 | configure.args-append --with-raster |
---|
90 | } |
---|
91 | |
---|
92 | variant topology description {Build topology support} { |
---|
93 | |
---|
94 | configure.args-append --with-topology |
---|
95 | } |
---|
96 | |
---|
97 | variant sfcgal description {Uses SFCGAL for 3D queries} { |
---|
98 | depends_lib-append port:sfcgal |
---|
99 | configure.args-append --with-sfcgal=${prefix}/bin/sfcgal-config |
---|
100 | } |
---|
101 | |
---|
102 | variant gui description {Build the GUI import tool} { |
---|
103 | |
---|
104 | depends_lib-append port:gtk2 |
---|
105 | configure.args-append --with-gui |
---|
106 | } |
---|
107 | |
---|
108 | variant comments description {Build comments -- ! broken } { |
---|
109 | |
---|
110 | ui_warn "The comments variant is currently broken. Use at your own risk." |
---|
111 | |
---|
112 | depends_build-append port:docbook-xsl \ |
---|
113 | port:libxslt \ |
---|
114 | port:ImageMagick |
---|
115 | |
---|
116 | configure.args-append --datadir=${prefix}/share/${name} \ |
---|
117 | --with-projdir=${prefix} \ |
---|
118 | --with-xsldir=${prefix}/share/xsl/docbook-xsl \ |
---|
119 | --with-json \ |
---|
120 | --with-jsondir=${prefix}/lib |
---|
121 | |
---|
122 | build.target-append comments |
---|
123 | destroot.target-append docs-install comments-install |
---|
124 | } |
---|
125 | |
---|
126 | default_variants +raster +topology |
---|
127 | |
---|
128 | # Port phases |
---|
129 | |
---|
130 | configure.cflags-append \ |
---|
131 | -Diconv=libiconv -Diconv_open=libiconv_open -Diconv_close=libiconv_close |
---|
132 | |
---|
133 | # see https://trac.macports.org/wiki/UsingTheRightCompiler |
---|
134 | configure.env-append CPPBIN=${configure.cpp} |
---|
135 | |
---|
136 | post-configure { |
---|
137 | if {[variant_isset universal]} { |
---|
138 | # We must add universal flags to compile liblwgeom properly |
---|
139 | file copy ${filespath}/ed_command ${worksrcpath}/ed_command |
---|
140 | reinplace -E "s#XXX#${configure.universal_cflags}#" \ |
---|
141 | ${worksrcpath}/ed_command |
---|
142 | system -W ${worksrcpath}/liblwgeom \ |
---|
143 | "ed Makefile < ${worksrcpath}/ed_command" |
---|
144 | } |
---|
145 | } |
---|
146 | |
---|
147 | build.args ICONV_LDFLAGS='-L${prefix}/lib -liconv' |
---|
148 | build.args-append CC=${configure.cc} \ |
---|
149 | CXX=${configure.cxx} \ |
---|
150 | CPP=${configure.cpp} |
---|
151 | |
---|
152 | use_parallel_build no |
---|
153 | |
---|
154 | livecheck.type regex |
---|
155 | livecheck.url ${master_sites} |
---|
156 | livecheck.regex {postgis2?-(\d+(?:\.\d+)*)\.[tz]} |
---|