Ticket #63831: Portfile

File Portfile, 6.3 KB (added by RobK88, 3 years ago)

Propoed updated portfile which adds kerberos5 dependency

Line 
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
3PortSystem 1.0
4PortGroup select 1.0
5PortGroup compilers 1.0
6PortGroup compiler_blacklist_versions 1.0
7PortGroup muniversal 1.0
8
9#remember to update the -doc and -server as well
10name                postgresql13
11version             13.4
12revision            2
13
14categories          databases
15platforms           darwin
16maintainers         {jwa @jyrkiwahlstedt}
17license             Permissive
18description         The most advanced open-source database available anywhere.
19long_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
25homepage            https://www.postgresql.org/
26master_sites        http://ftp3.de.postgresql.org/pub/Mirrors/ftp.postgresql.org/source/v${version}/ \
27            postgresql:source/v${version}/
28distname            postgresql-${version}
29
30checksums           rmd160  8766ce228491c11629096da54dd5fd4d1c46f9ef \
31                    sha256  ea93e10390245f1ce461a54eb5f99a48d8cabd3a08ce4d652ec2169a357bc0cd \
32                    size    21157443
33
34use_bzip2           yes
35
36# do not build man or html files (use postgresqlXY-doc instead)
37patchfiles-append   patch-no_doc.diff
38
39depends_lib         port:readline path:lib/libssl.dylib:openssl port:zlib port:libxml2 port:libxslt port:icu port:kerberos5
40depends_build       port:bison port:pkgconfig
41depends_run         port:postgresql_select
42
43worksrcdir          postgresql-${version}
44
45set libdir          ${prefix}/lib/${name}
46configure.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
67configure.ldflags-append    -headerpad_max_install_names
68configure.universal_args-delete --disable-dependency-tracking
69
70# building psql with clang from Xcode prior to 4.4 causes segfault on query; see #31717
71compiler.blacklist-append {clang < 421}
72compilers.choose          cc cxx
73compilers.setup           -gcc -fortran -clang33 -clang34 -clang37
74notes "To use the postgresql server, install the ${name}-server port"
75
76if {![info exists universal_possible]} {
77    set universal_possible [expr {${os.universal_supported} && [llength ${configure.universal_archs}] >= 2}]
78}
79if {${universal_possible} && [variant_isset universal]} {
80    configure.cflags-append    -DAC_APPLE_UNIVERSAL_BUILD
81}
82
83build.type          gnu
84build.target        world
85
86destroot.target     install-world
87
88test.run            yes
89test.target         check
90
91# remember to change livecheck with first proper release
92livecheck.type      regex
93#livecheck.regex    (13\\.\[.0-9\]*\[a-z\]+\[0-9\])
94#livecheck.regex    (13\[a-z\]+\[0-9\])
95livecheck.regex    (13\\.\[.0-9\]+)
96livecheck.url       ${homepage}/ftp/source/
97
98post-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
108if {!${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
125select.group        postgresql
126select.file         ${filespath}/${name}
127
128variant python requires python27 description {add support for python} {
129}
130
131variant 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
137variant 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
143variant perl description {add Perl support} {
144    depends_lib-append      bin:perl:perl5
145    configure.args-append   --with-perl
146}
147
148variant 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
154variant 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