Files

237 lines
9.2 KiB
Tcl
Raw Permalink Normal View History

2009-09-03 00:06:44 +00:00
# -*- 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
2005-12-29 06:46:10 +00:00
2010-02-11 10:04:34 +00:00
PortSystem 1.0
2005-12-29 06:46:10 +00:00
2010-02-11 10:04:34 +00:00
name postgis
categories databases gis
license GPL-2+
2026-05-14 13:00:07 +02:00
version 3.6.3
revision 1
maintainers {yahoo.com:n_larsson @nilason} openmaintainer
2010-02-11 10:04:34 +00:00
description PostGIS is the spatial extension to the\
PostGreSQL database.
2005-12-29 06:46:10 +00:00
long_description PostGIS adds geometrical, geographical and topological\
types, and functions operating thereon, to the PostGreSQL\
database. It also handles raster tiles and MVT format.
2005-12-29 06:46:10 +00:00
homepage https://postgis.net/
2005-12-29 06:46:10 +00:00
master_sites https://download.osgeo.org/postgis/source
distname postgis-${version}
2009-09-03 12:11:45 +00:00
2026-05-14 13:00:07 +02:00
checksums rmd160 e51ae92c9e74f664a26ce15189895f98fe9693f5 \
sha256 58ff19ae133e470280efb4949ef92e0364d4c2a66bef8c57e69477348d815ea3 \
size 16283593
2005-12-29 06:46:10 +00:00
patchfiles patch-configure.diff
2010-03-15 13:15:37 +00:00
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"
2009-09-03 12:11:45 +00:00
}
}
2010-02-11 10:04:34 +00:00
livecheck.type regex
2013-09-06 06:34:14 +00:00
livecheck.url ${master_sites}
livecheck.regex {postgis2?-(\d+(?:\.\d+)*)\.[tz]}
# PostgreSQL subports
2026-05-14 13:00:46 +02:00
set postgresql_suffixes {12 13 14 15 16 17 18}
set subport_names {}
set docports {}
foreach v ${postgresql_suffixes} {
lappend subport_names pg${v}-${name}
lappend docports pg${v}-${name}-doc
}
foreach v ${postgresql_suffixes} {
subport pg${v}-${name} {
depends_build-append \
port:autoconf \
port:automake \
port:libtool \
port:libxslt \
port:pkgconfig
depends_lib-append port:geos \
port:json-c \
port:libiconv \
port:libxml2 \
port:protobuf-c
if {${v} eq 12} {
conflicts postgis2
}
compiler.cxx_standard 2011
compiler.thread_local_storage yes
configure.args-append \
--without-address-standardizer \
--without-raster \
--without-sfcgal \
--without-topology
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}
build.args ICONV_LDFLAGS='-L${prefix}/lib -liconv'
variant address_standardizer description {Build with Address Standardizer support} {
depends_lib-append port:pcre2
configure.args-replace --without-address-standardizer --with-address-standardizer
}
variant lto description {Build with Link Time Optimization (LTO)} {
configure.args-append --enable-lto
}
# PROJ variants
set proj_versions {6 7 8 9}
set proj_variants {}
foreach pjver ${proj_versions} {
lappend proj_variants proj${pjver}
}
foreach proj_ver ${proj_versions} {
set index [lsearch -exact ${proj_variants} proj${proj_ver}]
set cflcts [lreplace ${proj_variants} ${index} ${index}]
variant proj${proj_ver} description "Use Proj${proj_ver}" conflicts {*}${cflcts} "
depends_lib-append port:proj${proj_ver}
configure.args-append PROJ_CFLAGS=-I${prefix}/lib/proj${proj_ver}/include \
PROJ_LIBS=\"-L${prefix}/lib/proj${proj_ver}/lib -lproj\"
"
}
set projdf "if {"
foreach pv ${proj_versions} {
set projdf "${projdf}!\[variant_isset proj${pv}\] && "
}
set projdf [string range ${projdf} 0 end-4]
set projdf "${projdf}} { default_variants +proj${pv} }"
eval ${projdf}
variant raster description {Build raster support} {
depends_lib-append port:gdal
configure.args-replace --without-raster --with-raster
configure.args-append --with-gdalconfig=${prefix}/bin/gdal-config
}
variant sfcgal description {Uses SFCGAL for 3D queries} {
depends_lib-append port:sfcgal
configure.args-replace --without-sfcgal --with-sfcgal=${prefix}/bin/sfcgal-config
}
variant topology description {Build topology support} {
configure.args-replace --without-topology --with-topology
}
default_variants +raster +topology
# Set PostgreSQL subport
set p postgresql${v}
depends_lib-append port:${p}
configure.args-append --libdir=${prefix}/lib/${p} \
--bindir=${prefix}/lib/${p}/bin \
--with-pgconfig=${prefix}/lib/${p}/bin/pg_config
build.args-append PGSQL_DOCDIR=${destroot}${prefix}/share/doc/${p} \
PGSQL_MANDIR=${destroot}${prefix}/share/man
livecheck.type none
post-destroot {
delete ${destroot}${prefix}/share/man
}
if {${v} eq 14} {
notes-append "\n\
! This version comes with the following warning if you use postgresql14:\n\
Due to some query performance degradation with the new fast index build\n\
that requires PG14, we have decided to disable the feature by default\n\
until we get more user testing as to the true impact of real-world queries.\n\
If you are running PG14+, you can reenable it by doing:\n\
\n\
ALTER OPERATOR FAMILY gist_geometry_ops_2d USING gist\n\
ADD FUNCTION 11 (geometry)\n\
geometry_gist_sortsupport_2d (internal);\n\
\n\
and then reindex your gist indexes.\n\
To revert back to the old index behavior:\n\
\n\
ALTER OPERATOR FAMILY gist_geometry_ops_2d using gist\n\
DROP FUNCTION 11 (geometry);\n\
\n\
and then reindex your gist indexes."
}
}
subport pg${v}-${name}-doc {
platforms any
supported_archs noarch
description Documentation of PostGIS for PostgreSQL $v
long_description {*}${long_description} This adds documentation.
set index [lsearch -exact ${docports} pg${v}-${name}-doc]
set cflcts [lreplace ${docports} ${index} ${index}]
conflicts {*}${cflcts}
set p postgresql${v}
depends_build-append \
port:autoconf \
port:automake \
port:geos \
port:libtool \
port:libxslt \
port:pkgconfig \
port:${p} \
port:proj9 \
port:protobuf-c
configure.args-append \
--libdir=${prefix}/lib/${p} \
--bindir=${prefix}/lib/${p}/bin \
--with-pgconfig=${prefix}/lib/${p}/bin/pg_config \
--without-address-standardizer \
--without-raster \
--without-sfcgal \
--without-topology \
PROJ_CFLAGS=-I${prefix}/lib/proj9/include \
PROJ_LIBS=\"-L${prefix}/lib/proj9/lib -lproj\"
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}
build.args ICONV_LDFLAGS='-L${prefix}/lib -liconv'
build.args-append PGSQL_DOCDIR=${destroot}${prefix}/share/doc/${p} \
PGSQL_MANDIR=${destroot}${prefix}/share/man
build.env-append DESTDIR=${destroot}
build.dir ${worksrcpath}/doc
build.target man-install
post-destroot {
delete ${destroot}${prefix}/share/${p}
}
livecheck.type none
}
}
if {${name} eq ${subport}} {
PortGroup stub 1.0
platforms any
supported_archs noarch
notes "The $name port is just a stub. Please install one of the\
subports: ${subport_names}."
}