-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
144 lines (116 loc) · 5.14 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
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup select 1.0
PortGroup compiler_blacklist_versions 1.0
PortGroup muniversal 1.0
#remember to update the -doc and -server as well
name postgresql96
version 9.6.17
revision 0
categories databases
platforms darwin
maintainers {jwa @jyrkiwahlstedt}
license Permissive
description The most advanced open-source database available anywhere.
long_description PostgreSQL is Object-Relational Database Management System.\
It supports almost all SQL constructs, including transactions, \
subselects, and user-defined types and functions. Write-ahead \
logging means increased performance while retaining data \
integrity.
homepage https://www.postgresql.org/
master_sites http://ftp3.de.postgresql.org/pub/Mirrors/ftp.postgresql.org/source/v${version}/ \
postgresql:source/v${version}/
distname postgresql-${version}
checksums rmd160 3e46a95188b7bdf60c430275f6d3634d45693abc \
sha256 f6e1e32d32545f97c066f3c19f4d58dfab1205c01252cf85c5c92294ace1a0c2 \
size 18812282
use_bzip2 yes
# do not build man or html files (use postgresqlXY-doc instead)
patchfiles-append patch-no_doc.diff
depends_lib port:readline path:lib/libssl.dylib:openssl port:zlib port:libxml2 port:libxslt
depends_build port:bison
depends_run port:postgresql_select
worksrcdir postgresql-${version}
set libdir ${prefix}/lib/${name}
configure.args PG_SYSROOT=disabled \
--sysconfdir=${prefix}/etc/${name} \
--bindir=${libdir}/bin \
--libdir=${libdir} \
--includedir=${prefix}/include/${name} \
--datadir=${prefix}/share/${name} \
--docdir=${prefix}/share/doc/${name} \
--mandir=${prefix}/share/man \
--with-includes=${prefix}/include \
--with-libraries=${prefix}/lib \
--with-openssl \
--with-bonjour \
--with-readline \
--with-zlib \
--with-libxml \
--with-libxslt \
--with-gssapi \
--enable-thread-safety \
--with-uuid=e2fs
configure.ldflags-append -headerpad_max_install_names
configure.universal_args-delete --disable-dependency-tracking
# building psql with clang from Xcode prior to 4.4 causes segfault on query; see #31717
compiler.blacklist-append {clang < 421}
notes "To use the postgresql server, install the ${name}-server port"
if {[variant_isset universal]} {
configure.cflags-append -DAC_APPLE_UNIVERSAL_BUILD
}
build.type gnu
build.target world
destroot.target install-world
test.run yes
test.target check
# remember to change livecheck with first proper release
livecheck.type regex
#livecheck.regex (9\\.6\[.0-9\]*\[a-z\]+\[0-9\])
livecheck.regex (9\\.6\\.\[.0-9\]+)
livecheck.url ${homepage}/ftp/source/
post-destroot {
system "cd ${destroot}${prefix}/bin && ln -sf ${libdir}/bin/psql psql96"
reinplace -E "s#^CFLAGS =#CFLAGS +=#g" \
${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global
reinplace -E "s#^(\[\[:space:\]\]+)LDFLAGS =#\\1LDFLAGS +=#g" \
${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global
}
if {![variant_isset universal]} {
post-destroot {
reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \
${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global
}
} else {
merger-post-destroot {
foreach arch ${configure.universal_archs} {
reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \
${destroot}-${arch}${prefix}/lib/${name}/pgxs/src/Makefile.global
reinplace -E "s#${worksrcpath}-${arch}#${worksrcpath}#g" \
${destroot}-${arch}${prefix}/lib/${name}/pgxs/src/Makefile.global
}
}
}
select.group postgresql
select.file ${filespath}/${name}
variant python requires python27 description {add support for python} {
}
variant python27 conflicts python3 description {add support for python 2.7} {
depends_lib-append port:python27
configure.args-append --with-python
configure.python ${prefix}/bin/python2.7
}
variant python3 conflicts python27 description {add support for python 3.x} {
depends_lib-append port:python37
configure.args-append --with-python
configure.python ${prefix}/bin/python3.7
}
variant perl description {add Perl support} {
depends_lib-append bin:perl:perl5
configure.args-append --with-perl
}
variant tcl description {add Tcl support} {
depends_lib-append port:tcl
configure.args-append --with-tcl --with-tclconfig=${prefix}/lib
configure.env-append TCLSH=${prefix}/bin/tclsh
}