1 | # -*- 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 |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | PortGroup select 1.0 |
---|
5 | PortGroup compilers 1.0 |
---|
6 | PortGroup compiler_blacklist_versions 1.0 |
---|
7 | PortGroup muniversal 1.0 |
---|
8 | |
---|
9 | #remember to update the -doc and -server as well |
---|
10 | name postgresql13 |
---|
11 | version 13.4 |
---|
12 | revision 2 |
---|
13 | |
---|
14 | categories databases |
---|
15 | platforms darwin |
---|
16 | maintainers {jwa @jyrkiwahlstedt} |
---|
17 | license Permissive |
---|
18 | description The most advanced open-source database available anywhere. |
---|
19 | long_description PostgreSQL is Object-Relational Database Management System.\ |
---|
20 | It supports almost all SQL constructs, including transactions, \ |
---|
21 | subselects, and user-defined types and functions. Write-ahead \ |
---|
22 | logging means increased performance while retaining data \ |
---|
23 | integrity. |
---|
24 | |
---|
25 | homepage https://www.postgresql.org/ |
---|
26 | master_sites http://ftp3.de.postgresql.org/pub/Mirrors/ftp.postgresql.org/source/v${version}/ \ |
---|
27 | postgresql:source/v${version}/ |
---|
28 | distname postgresql-${version} |
---|
29 | |
---|
30 | checksums rmd160 8766ce228491c11629096da54dd5fd4d1c46f9ef \ |
---|
31 | sha256 ea93e10390245f1ce461a54eb5f99a48d8cabd3a08ce4d652ec2169a357bc0cd \ |
---|
32 | size 21157443 |
---|
33 | |
---|
34 | use_bzip2 yes |
---|
35 | |
---|
36 | # do not build man or html files (use postgresqlXY-doc instead) |
---|
37 | patchfiles-append patch-no_doc.diff |
---|
38 | |
---|
39 | depends_lib port:readline path:lib/libssl.dylib:openssl port:zlib port:libxml2 port:libxslt port:icu port:kerberos5 |
---|
40 | depends_build port:bison port:pkgconfig |
---|
41 | depends_run port:postgresql_select |
---|
42 | |
---|
43 | worksrcdir postgresql-${version} |
---|
44 | |
---|
45 | set libdir ${prefix}/lib/${name} |
---|
46 | configure.args PG_SYSROOT=disabled \ |
---|
47 | --sysconfdir=${prefix}/etc/${name} \ |
---|
48 | --bindir=${libdir}/bin \ |
---|
49 | --libdir=${libdir} \ |
---|
50 | --includedir=${prefix}/include/${name} \ |
---|
51 | --datadir=${prefix}/share/${name} \ |
---|
52 | --docdir=${prefix}/share/doc/${name} \ |
---|
53 | --mandir=${prefix}/share/man \ |
---|
54 | --with-includes=${prefix}/include \ |
---|
55 | --with-libraries=${prefix}/lib \ |
---|
56 | --with-openssl \ |
---|
57 | --with-bonjour \ |
---|
58 | --with-readline \ |
---|
59 | --with-zlib \ |
---|
60 | --with-libxml \ |
---|
61 | --with-libxslt \ |
---|
62 | --with-gssapi \ |
---|
63 | --enable-thread-safety \ |
---|
64 | --with-uuid=e2fs \ |
---|
65 | --with-icu |
---|
66 | |
---|
67 | configure.ldflags-append -headerpad_max_install_names |
---|
68 | configure.universal_args-delete --disable-dependency-tracking |
---|
69 | |
---|
70 | # building psql with clang from Xcode prior to 4.4 causes segfault on query; see #31717 |
---|
71 | compiler.blacklist-append {clang < 421} |
---|
72 | compilers.choose cc cxx |
---|
73 | compilers.setup -gcc -fortran -clang33 -clang34 -clang37 |
---|
74 | notes "To use the postgresql server, install the ${name}-server port" |
---|
75 | |
---|
76 | if {![info exists universal_possible]} { |
---|
77 | set universal_possible [expr {${os.universal_supported} && [llength ${configure.universal_archs}] >= 2}] |
---|
78 | } |
---|
79 | if {${universal_possible} && [variant_isset universal]} { |
---|
80 | configure.cflags-append -DAC_APPLE_UNIVERSAL_BUILD |
---|
81 | } |
---|
82 | |
---|
83 | build.type gnu |
---|
84 | build.target world |
---|
85 | |
---|
86 | destroot.target install-world |
---|
87 | |
---|
88 | test.run yes |
---|
89 | test.target check |
---|
90 | |
---|
91 | # remember to change livecheck with first proper release |
---|
92 | livecheck.type regex |
---|
93 | #livecheck.regex (13\\.\[.0-9\]*\[a-z\]+\[0-9\]) |
---|
94 | #livecheck.regex (13\[a-z\]+\[0-9\]) |
---|
95 | livecheck.regex (13\\.\[.0-9\]+) |
---|
96 | livecheck.url ${homepage}/ftp/source/ |
---|
97 | |
---|
98 | post-destroot { |
---|
99 | system "cd ${destroot}${prefix}/bin && ln -sf ${libdir}/bin/psql psql13" |
---|
100 | |
---|
101 | reinplace -E "s#^CFLAGS =#CFLAGS +=#g" \ |
---|
102 | ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global |
---|
103 | |
---|
104 | reinplace -E "s#^(\[\[:space:\]\]+)LDFLAGS =#\\1LDFLAGS +=#g" \ |
---|
105 | ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global |
---|
106 | } |
---|
107 | |
---|
108 | if {!${universal_possible} || ![variant_isset universal]} { |
---|
109 | post-destroot { |
---|
110 | reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \ |
---|
111 | ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global |
---|
112 | } |
---|
113 | } else { |
---|
114 | merger-post-destroot { |
---|
115 | foreach arch ${configure.universal_archs} { |
---|
116 | reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \ |
---|
117 | ${destroot}-${arch}${prefix}/lib/${name}/pgxs/src/Makefile.global |
---|
118 | |
---|
119 | reinplace -E "s#${worksrcpath}-${arch}#${worksrcpath}#g" \ |
---|
120 | ${destroot}-${arch}${prefix}/lib/${name}/pgxs/src/Makefile.global |
---|
121 | } |
---|
122 | } |
---|
123 | } |
---|
124 | |
---|
125 | select.group postgresql |
---|
126 | select.file ${filespath}/${name} |
---|
127 | |
---|
128 | variant python requires python27 description {add support for python} { |
---|
129 | } |
---|
130 | |
---|
131 | variant python27 conflicts python3 description {add support for python 2.7} { |
---|
132 | depends_lib-append port:python27 |
---|
133 | configure.args-append --with-python |
---|
134 | configure.python ${prefix}/bin/python2.7 |
---|
135 | } |
---|
136 | |
---|
137 | variant python3 conflicts python27 description {add support for python 3.x} { |
---|
138 | depends_lib-append port:python38 |
---|
139 | configure.args-append --with-python |
---|
140 | configure.python ${prefix}/bin/python3.8 |
---|
141 | } |
---|
142 | |
---|
143 | variant perl description {add Perl support} { |
---|
144 | depends_lib-append bin:perl:perl5 |
---|
145 | configure.args-append --with-perl |
---|
146 | } |
---|
147 | |
---|
148 | variant tcl description {add Tcl support} { |
---|
149 | depends_lib-append port:tcl |
---|
150 | configure.args-append --with-tcl --with-tclconfig=${prefix}/lib |
---|
151 | configure.env-append TCLSH=${prefix}/bin/tclsh |
---|
152 | } |
---|
153 | |
---|
154 | variant llvm description {add support for JIT compilation} { |
---|
155 | set llvm_ver 11 |
---|
156 | |
---|
157 | foreach clang ${compilers.clang_variants} { |
---|
158 | if { [variant_exists ${clang}] && [variant_isset ${clang}] } { |
---|
159 | set clang_port_ver [string range ${clang} 5 6] |
---|
160 | |
---|
161 | if { ${clang_port_ver} >= 50 } { |
---|
162 | set llvm_ver [string index ${clang} end-1].[string index ${clang} end] |
---|
163 | } else { |
---|
164 | set llvm_ver ${clang_port_ver} |
---|
165 | } |
---|
166 | } |
---|
167 | } |
---|
168 | |
---|
169 | depends_lib-append port:llvm-${llvm_ver} |
---|
170 | configure.args-append --with-llvm |
---|
171 | configure.env-append LLVM_CONFIG=${prefix}/libexec/llvm-${llvm_ver}/bin/llvm-config \ |
---|
172 | CLANG=${configure.cc} |
---|
173 | } |
---|
174 | |
---|