Ticket #48310: Portfile.pg94

File Portfile.pg94, 5.0 KB (added by wichert@…, 9 years ago)

Portfile with postgresql94 variant

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 123696 2014-08-12 21:43:57Z mf2k@macports.org $
3
4PortSystem 1.0
5
6name        libpqxx
7version     4.0.1
8
9categories  databases devel
10license     BSD
11
12maintainers nomaintainer
13
14description Official C++ client API for PostgreSQL
15
16long_description \
17libpqxx is the official C++ client API for PostgreSQL, the enterprise-strength \
18open-source database software.  There are many similar libraries for PostgreSQL \
19and for other databases, some of them database independent.  Most of these, \
20however, are fairly C like in their programming style, and fail to take \
21advantage of the full power of the C++ language as it has matured since \
22the acceptance of the Standard in 1996.  What libpqxx brings you is effective \
23use of templates to reduce the inconvenience of dealing with type conversions, \
24standard C++ strings to keep you from having to worry about buffer allocation \
25and overflow attacks, exceptions to take the tedious and error prone plumbing \
26around error handling out of your hands, constructors and destructors to bring \
27resource management under control, and even basic object orientation to give \
28you some extra reliability features that would be hard to get with most other \
29database interfaces.
30
31homepage        http://pqxx.org/development/libpqxx/
32master_sites    http://pqxx.org/download/software/libpqxx/
33
34checksums       rmd160  7fae516d6aa59dac0d2403c6a979c5c3d9fb3fce \
35                sha256  097ceda2797761ce517faa5bee186c883df1c407cb2aada613a16773afeedc38
36
37if {![variant_isset postgresql83] && ![variant_isset postgresql84] && ![variant_isset postgresql90] && ![variant_isset postgresql91] && ![variant_isset postgresql92] && ![variant_isset postgresql93] && ![variant_isset postgresql94]} {
38    default_variants +postgresql94
39}
40
41variant postgresql83 conflicts postgresql84 postgresql90 postgresql91 postgresql92 postgresql93 postgresql94 description {Use postgresql83} {}
42variant postgresql84 conflicts postgresql83 postgresql90 postgresql91 postgresql92 postgresql93 postgresql94 description {Use postgresql84} {}
43variant postgresql90 conflicts postgresql83 postgresql84 postgresql91 postgresql92 postgresql93 postgresql94 description {Use postgresql90} {}
44variant postgresql91 conflicts postgresql83 postgresql84 postgresql90 postgresql92 postgresql93 postgresql94 description {Use postgresql91} {}
45variant postgresql92 conflicts postgresql83 postgresql84 postgresql90 postgresql91 postgresql93 postgresql94 description {Use postgresql92} {}
46variant postgresql93 conflicts postgresql83 postgresql84 postgresql90 postgresql91 postgresql92 postgresql94 description {Use postgresql93} {}
47variant postgresql94 conflicts postgresql83 postgresql84 postgresql90 postgresql91 postgresql92 postgresql93 description {Use postgresql94} {}
48
49if {[variant_isset postgresql83]} {
50    set server postgresql83
51} elseif {[variant_isset postgresql84]} {
52    set server postgresql84
53} elseif {[variant_isset postgresql90]} {
54    set server postgresql90
55} elseif {[variant_isset postgresql91]} {
56    set server postgresql91
57} elseif {[variant_isset postgresql92]} {
58    set server postgresql92
59} elseif {[variant_isset postgresql93]} {
60    set server postgresql93
61} elseif {[variant_isset postgresql94]} {
62    set server postgresql94
63}
64
65platforms       darwin
66depends_build   path:bin/pkg-config:pkgconfig
67depends_lib     port:${server}
68
69patchfiles      patch-tools-maketemporary.diff
70
71platform darwin {
72    patchfiles-append patch-configure.diff
73}
74
75configure.env-append \
76    PG_CONFIG=${prefix}/lib/${server}/bin/pg_config
77
78configure.args-append \
79    --enable-shared
80
81# Enable tests after the build phase; see
82# http://guide.macports.org/#reference.phases.test
83# http://pqxx.org/development/libpqxx/browser/trunk/README?rev=latest
84# http://pqxx.org/development/libpqxx/wiki/TestDocs
85
86set dbdir       ${workpath}/db
87set dbname      test_libpqxx
88set dbport      5455
89test.run        yes
90test.cmd        make
91test.target     check
92test.post_args  [portbuild::build_getjobsarg]
93
94# PGDATABASE    (name of database; defaults to your user name)
95# PGHOST        (database server; defaults to local machine)
96# PGPORT        (PostgreSQL port to connect to; default is 5432)
97# PGUSER        (your PostgreSQL user ID; defaults to your login name)
98# PGPASSWORD    (your PostgreSQL password, if needed)
99test.env        PGDATABASE=${dbname} \
100                PGPORT=${dbport}
101                #PGUSER
102                #PGPASSWORD
103
104pre-test {
105    system "${prefix}/lib/${server}/bin/initdb -D ${dbdir}"
106    # "system" doesn't return for some reason, but exec does
107    if {[catch {exec sudo -u ${macportsuser} ${prefix}/lib/${server}/bin/pg_ctl -w -D ${dbdir} -l ${dbdir}/logfile -o "-p ${dbport}" start} result]} {
108        return -code error "could not start postgresql server"
109    }
110    system "${prefix}/lib/${server}/bin/createdb -p ${dbport} ${dbname}"
111}
112
113post-test {
114    system "${prefix}/lib/${server}/bin/pg_ctl -w -D ${dbdir} stop -m fast"
115}