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 | |
---|
4 | PortSystem 1.0 |
---|
5 | |
---|
6 | name libpqxx |
---|
7 | version 4.0.1 |
---|
8 | |
---|
9 | categories databases devel |
---|
10 | license BSD |
---|
11 | |
---|
12 | maintainers nomaintainer |
---|
13 | |
---|
14 | description Official C++ client API for PostgreSQL |
---|
15 | |
---|
16 | long_description \ |
---|
17 | libpqxx is the official C++ client API for PostgreSQL, the enterprise-strength \ |
---|
18 | open-source database software. There are many similar libraries for PostgreSQL \ |
---|
19 | and for other databases, some of them database independent. Most of these, \ |
---|
20 | however, are fairly C like in their programming style, and fail to take \ |
---|
21 | advantage of the full power of the C++ language as it has matured since \ |
---|
22 | the acceptance of the Standard in 1996. What libpqxx brings you is effective \ |
---|
23 | use of templates to reduce the inconvenience of dealing with type conversions, \ |
---|
24 | standard C++ strings to keep you from having to worry about buffer allocation \ |
---|
25 | and overflow attacks, exceptions to take the tedious and error prone plumbing \ |
---|
26 | around error handling out of your hands, constructors and destructors to bring \ |
---|
27 | resource management under control, and even basic object orientation to give \ |
---|
28 | you some extra reliability features that would be hard to get with most other \ |
---|
29 | database interfaces. |
---|
30 | |
---|
31 | homepage http://pqxx.org/development/libpqxx/ |
---|
32 | master_sites http://pqxx.org/download/software/libpqxx/ |
---|
33 | |
---|
34 | checksums rmd160 7fae516d6aa59dac0d2403c6a979c5c3d9fb3fce \ |
---|
35 | sha256 097ceda2797761ce517faa5bee186c883df1c407cb2aada613a16773afeedc38 |
---|
36 | |
---|
37 | if {![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 | |
---|
41 | variant postgresql83 conflicts postgresql84 postgresql90 postgresql91 postgresql92 postgresql93 postgresql94 description {Use postgresql83} {} |
---|
42 | variant postgresql84 conflicts postgresql83 postgresql90 postgresql91 postgresql92 postgresql93 postgresql94 description {Use postgresql84} {} |
---|
43 | variant postgresql90 conflicts postgresql83 postgresql84 postgresql91 postgresql92 postgresql93 postgresql94 description {Use postgresql90} {} |
---|
44 | variant postgresql91 conflicts postgresql83 postgresql84 postgresql90 postgresql92 postgresql93 postgresql94 description {Use postgresql91} {} |
---|
45 | variant postgresql92 conflicts postgresql83 postgresql84 postgresql90 postgresql91 postgresql93 postgresql94 description {Use postgresql92} {} |
---|
46 | variant postgresql93 conflicts postgresql83 postgresql84 postgresql90 postgresql91 postgresql92 postgresql94 description {Use postgresql93} {} |
---|
47 | variant postgresql94 conflicts postgresql83 postgresql84 postgresql90 postgresql91 postgresql92 postgresql93 description {Use postgresql94} {} |
---|
48 | |
---|
49 | if {[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 | |
---|
65 | platforms darwin |
---|
66 | depends_build path:bin/pkg-config:pkgconfig |
---|
67 | depends_lib port:${server} |
---|
68 | |
---|
69 | patchfiles patch-tools-maketemporary.diff |
---|
70 | |
---|
71 | platform darwin { |
---|
72 | patchfiles-append patch-configure.diff |
---|
73 | } |
---|
74 | |
---|
75 | configure.env-append \ |
---|
76 | PG_CONFIG=${prefix}/lib/${server}/bin/pg_config |
---|
77 | |
---|
78 | configure.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 | |
---|
86 | set dbdir ${workpath}/db |
---|
87 | set dbname test_libpqxx |
---|
88 | set dbport 5455 |
---|
89 | test.run yes |
---|
90 | test.cmd make |
---|
91 | test.target check |
---|
92 | test.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) |
---|
99 | test.env PGDATABASE=${dbname} \ |
---|
100 | PGPORT=${dbport} |
---|
101 | #PGUSER |
---|
102 | #PGPASSWORD |
---|
103 | |
---|
104 | pre-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 | |
---|
113 | post-test { |
---|
114 | system "${prefix}/lib/${server}/bin/pg_ctl -w -D ${dbdir} stop -m fast" |
---|
115 | } |
---|