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