source: trunk/dports/databases/postgresql91/Portfile @ 92935

Last change on this file since 92935 was 92935, checked in by vince@…, 8 years ago

This update closes ticket #33907. It strips any -arch flag from pgxs/Makefile.global and changes CFLAGS = and LDFLAGS = into CFLAGS += and LDFLAGS +=. Bump revision accordingly, since it affects the way PostGIS will be built.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.4 KB
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# $Id: Portfile 92935 2012-05-11 12:37:03Z vince@macports.org $
3
4PortSystem 1.0
5PortGroup select 1.0
6
7name                    postgresql91
8version                 9.1.3
9revision        2
10
11categories              databases
12platforms               darwin
13maintainers             mww jwa
14license                 Permissive
15description             The most advanced open-source database available anywhere.
16long_description PostgreSQL is Object-Relational Database Management System. \
17                                It supports almost all SQL constructs, including transactions, \
18                                subselects, and user-defined types and functions. Write-ahead \
19                                logging means increased performance while retaining data \
20                                integrity.
21
22homepage                http://www.postgresql.org/
23master_sites            http://ftp3.de.postgresql.org/pub/Mirrors/ftp.postgresql.org/source/v${version}/ \
24                        postgresql:source/v${version}/
25distname                postgresql-${version}
26
27checksums           rmd160  84eb235c090083b78e6a2facf3d7bc534395db8b \
28                    sha256  7a79800a624031c1d9bc9cdce73cb40050100ac50a82050cbf7bbbd16ac4d5d5
29
30use_bzip2               yes
31
32depends_lib             port:readline port:openssl port:zlib port:libxml2 port:libxslt port:ossp-uuid
33depends_build           port:bison
34depends_run             port:postgresql_select
35
36worksrcdir              postgresql-${version}
37
38patchfiles              src_pl_plpython_Makefile.patch
39
40set libdir              ${prefix}/lib/${name}
41configure.args  --sysconfdir=${prefix}/etc/${name} \
42                                --bindir=${libdir}/bin \
43                                --libdir=${libdir} \
44                                --includedir=${prefix}/include/${name} \
45                                --datadir=${prefix}/share/${name} \
46                                --mandir=${prefix}/share/man \
47                                --with-includes=${prefix}/include \
48                                --with-libraries=${prefix}/lib \
49                                --with-openssl \
50                                --with-bonjour \
51                                --with-readline \
52                                --with-zlib \
53                                --with-libxml \
54                                --with-libxslt \
55                                --enable-thread-safety \
56                                --enable-integer-datetimes \
57                                --with-ossp-uuid
58configure.cppflags-append       -I${prefix}/include/ossp
59
60# building psql with clang causes segfault on query; see #31717
61if {${configure.compiler} == "clang" && [vercmp ${xcodeversion} 4.4] < 0} {
62    configure.compiler llvm-gcc-4.2
63}
64
65if {[variant_isset universal]} {
66    configure.cflags-append     -DAC_APPLE_UNIVERSAL_BUILD
67    post-configure {
68        system "cd ${worksrcpath}/src/include \
69                && ed - pg_config.h < ${filespath}/pg_config.h.ed \
70                && touch stamp-h"
71        system "cd ${worksrcpath}/src/interfaces/ecpg/include \
72                && ed - ecpg_config.h < ${filespath}/ecpg_config.h.ed \
73                && touch stamp-h"
74    }
75}
76
77build.type              gnu
78build.target
79
80test.run                yes
81test.target             check
82
83livecheck.type  regex
84livecheck.url   ${homepage}
85livecheck.regex (9\\.1\\.\[.0-9\]+)
86#livecheck.url  ${homepage}/developer/beta
87#livecheck.regex        (9\\.1\[a-z\]+\[.0-9\]+)
88
89set contribs    "adminpack dblink fuzzystrmatch lo uuid-ossp pg_buffercache pg_trgm pgcrypto tsearch2 vacuumlo xml2"
90
91post-build {
92        foreach contrib ${contribs} {
93                system "cd ${worksrcpath}/contrib/${contrib}/ && ${build.cmd}"
94        }
95}
96
97post-destroot {
98        foreach contrib ${contribs} {
99                system "echo contrib: \"${contrib}\""
100                system "cd ${worksrcpath}/contrib/${contrib}/ && \
101                        ${destroot.cmd} install ${destroot.destdir} && touch DONE"
102        }
103        system "cd ${destroot}${prefix}/bin && ln -sf ${libdir}/bin/psql psql91"
104        file delete -force ${destroot}${prefix}/share/doc/postgresql \
105                ${destroot}${prefix}/share/man
106               
107        reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \
108            ${destroot}${prefix}/lib/postgresql91/pgxs/src/Makefile.global
109       
110        reinplace -E "s#^CFLAGS =#CFLAGS +=#g" \
111            ${destroot}${prefix}/lib/postgresql91/pgxs/src/Makefile.global
112           
113        reinplace -E "s#^(\[\[:space:\]\]+)LDFLAGS =#\\1LDFLAGS +=#g" \
114            ${destroot}${prefix}/lib/postgresql91/pgxs/src/Makefile.global
115}
116
117select.group    postgresql
118select.file     ${filespath}/${name}
119
120variant python description {add support for python} {
121        depends_lib-append              port:python27
122        configure.args-append   --with-python
123        configure.python                ${prefix}/bin/python2.7
124}
125
126variant krb5 description {add support for Kerberos 5 authentication} {
127        configure.args-append   --with-krb5
128}
129
130variant perl description {add Perl support} {
131        depends_lib-append                      bin:perl:perl5
132        configure.args-append           --with-perl
133}
134
135variant tcl description {add Tcl support} {
136        depends_lib-append                      port:tcl
137        configure.args-append           --with-tcl --with-tclconfig=${prefix}/lib
138        configure.env-append            TCLSH=${prefix}/bin/tclsh
139}
140
141post-install {
142    ui_msg "\nTo use the postgresql server, install the ${name}-server port"
143}
144
Note: See TracBrowser for help on using the repository browser.