Ticket #55831: postgis2.Portfile.ok

File postgis2.Portfile.ok, 5.0 KB (added by fvaccari, 6 years ago)
Line 
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
3PortSystem          1.0
4
5name                postgis2
6categories          databases gis
7license             GPL-2+
8version             2.4.3
9epoch               1
10#revision            3
11platforms           darwin
12maintainers         vince openmaintainer
13
14description         PostGIS is the spatial extension to the\
15                    PostGreSQL database.
16
17long_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
22homepage            http://postgis.refractions.net/
23
24master_sites        http://download.osgeo.org/postgis/source
25distname            postgis-${version}
26
27checksums           rmd160  0c0d4ca47a9a0cddfdc3127558d19a5a193d8c68 \
28                    sha256  ea5374c5db6b645ba5628ddcb08f71d3b3d90a464d366b4e1d20d5a268bde4b9
29
30depends_build       port:autoconf \
31                    port:automake \
32                    port:libtool \
33                    port:libxslt
34
35depends_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
43conflicts           postgis
44
45# Neither is PostGIS 2.0 compatible with PostGreSQL 8
46# Database variants (from the GDAL port)
47set postgresql_suffixes {10 93 94 95 96}
48
49set postgresql_variants {}
50
51foreach suffix ${postgresql_suffixes} {
52    lappend postgresql_variants postgresql${suffix}
53}
54
55foreach 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
75set pgdefault "if {"
76
77foreach suffix ${postgresql_suffixes} {
78    set pgdefault "${pgdefault}!\[variant_isset postgresql${suffix}\] && "
79}
80
81set pgdefault [string range ${pgdefault} 0 end-4]
82set pgdefault "${pgdefault}} { default_variants +postgresql10 }"
83
84eval ${pgdefault}
85
86variant raster              description {Build raster support} {
87
88    depends_lib-append      port:gdal
89    configure.args-append   --with-raster
90}
91
92variant topology            description {Build topology support} {
93
94    configure.args-append   --with-topology
95}
96
97variant 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
102variant gui                 description {Build the GUI import tool} {
103
104    depends_lib-append      port:gtk2
105    configure.args-append   --with-gui
106}
107
108variant 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
126default_variants            +raster +topology
127
128# Port phases
129
130configure.cflags-append \
131    -Diconv=libiconv -Diconv_open=libiconv_open -Diconv_close=libiconv_close
132
133# see https://trac.macports.org/wiki/UsingTheRightCompiler
134configure.env-append    CPPBIN=${configure.cpp}
135
136post-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
147build.args                  ICONV_LDFLAGS='-L${prefix}/lib -liconv'
148build.args-append       CC=${configure.cc} \
149                        CXX=${configure.cxx} \
150                        CPP=${configure.cpp}
151
152use_parallel_build          no
153
154livecheck.type              regex
155livecheck.url               ${master_sites}
156livecheck.regex             {postgis2?-(\d+(?:\.\d+)*)\.[tz]}