source: trunk/dports/databases/libpqxx/Portfile @ 123696

Last change on this file since 123696 was 123696, checked in by mf2k@…, 5 years ago

cableswig gdb HexFiend HexFiend-framework InsightToolkit InsightToolkit312 InsightToolkit314 libpqxx libpqxx26 py25-pydb py26-pydb vtk-devel: Ports abandoned by dweber. (#43834)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.6 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 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]} {
38    default_variants +postgresql93
39}
40
41variant postgresql83 conflicts postgresql84 postgresql90 postgresql91 postgresql92 postgresql93 description {Use postgresql83} {}
42variant postgresql84 conflicts postgresql83 postgresql90 postgresql91 postgresql92 postgresql93 description {Use postgresql84} {}
43variant postgresql90 conflicts postgresql83 postgresql84 postgresql91 postgresql92 postgresql93 description {Use postgresql90} {}
44variant postgresql91 conflicts postgresql83 postgresql84 postgresql90 postgresql92 postgresql93 description {Use postgresql91} {}
45variant postgresql92 conflicts postgresql83 postgresql84 postgresql90 postgresql91 postgresql93 description {Use postgresql92} {}
46variant postgresql93 conflicts postgresql83 postgresql84 postgresql90 postgresql91 postgresql92 description {Use postgresql93} {}
47
48if {[variant_isset postgresql83]} {
49    set server postgresql83
50} elseif {[variant_isset postgresql84]} {
51    set server postgresql84
52} elseif {[variant_isset postgresql90]} {
53    set server postgresql90
54} elseif {[variant_isset postgresql91]} {
55    set server postgresql91
56} elseif {[variant_isset postgresql92]} {
57    set server postgresql92
58} elseif {[variant_isset postgresql93]} {
59    set server postgresql93
60}
61
62platforms       darwin
63depends_build   path:bin/pkg-config:pkgconfig
64depends_lib     port:${server}
65
66patchfiles      patch-tools-maketemporary.diff
67
68platform darwin {
69    patchfiles-append patch-configure.diff
70}
71
72configure.env-append \
73    PG_CONFIG=${prefix}/lib/${server}/bin/pg_config
74
75configure.args-append \
76    --enable-shared
77
78# Enable tests after the build phase; see
79# http://guide.macports.org/#reference.phases.test
80# http://pqxx.org/development/libpqxx/browser/trunk/README?rev=latest
81# http://pqxx.org/development/libpqxx/wiki/TestDocs
82
83set dbdir       ${workpath}/db
84set dbname      test_libpqxx
85set dbport      5455
86test.run        yes
87test.cmd        make
88test.target     check
89test.post_args  [portbuild::build_getjobsarg]
90
91# PGDATABASE    (name of database; defaults to your user name)
92# PGHOST        (database server; defaults to local machine)
93# PGPORT        (PostgreSQL port to connect to; default is 5432)
94# PGUSER        (your PostgreSQL user ID; defaults to your login name)
95# PGPASSWORD    (your PostgreSQL password, if needed)
96test.env        PGDATABASE=${dbname} \
97                PGPORT=${dbport}
98                #PGUSER
99                #PGPASSWORD
100
101pre-test {
102    system "${prefix}/lib/${server}/bin/initdb -D ${dbdir}"
103    # "system" doesn't return for some reason, but exec does
104    if {[catch {exec sudo -u ${macportsuser} ${prefix}/lib/${server}/bin/pg_ctl -w -D ${dbdir} -l ${dbdir}/logfile -o "-p ${dbport}" start} result]} {
105        return -code error "could not start postgresql server"
106    }
107    system "${prefix}/lib/${server}/bin/createdb -p ${dbport} ${dbname}"
108}
109
110post-test {
111    system "${prefix}/lib/${server}/bin/pg_ctl -w -D ${dbdir} stop -m fast"
112}
Note: See TracBrowser for help on using the repository browser.