source: trunk/dports/databases/mysql55-connector-cpp/Portfile

Last change on this file was 96976, checked in by pixilla@…, 5 years ago

databases/mysql-connector-cpp:

  • Move to mysql55-connector-cpp.

databases/mysql55-connector-cpp:

  • Update to version 1.1.1.
  • Port/subports for mysql5, mysql51, mysql55, mariadb and percona.
  • mysql-connector-cpp replaced_by mysql5-connector-cpp
  • Patch examples to make them more friendly. Closes #34235
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.0 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 96976 2012-08-23 18:07:35Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           cmake 1.0
6
7name                mysql55-connector-cpp
8set name_package    mysql-connector-c++
9version             1.1.1
10set branch          [join [lrange [split ${version} .] 0 1] .]
11categories          databases
12platforms           darwin
13maintainers         pixilla openmaintainer
14license             GPL-2
15
16set mirror_dir      Downloads/Connector-C++
17homepage            http://www.mysql.com/products/connector/
18master_sites        http://mysql.mirrors.pair.com/${mirror_dir} \
19                    http://mysql.he.net/${mirror_dir} \
20                    http://mirrors.sunsite.dk/mysql/${mirror_dir} \
21                    http://sunsite.informatik.rwth-aachen.de/mysql/${mirror_dir} \
22                    http://ftp.plusline.de/mysql/${mirror_dir}
23
24distname            ${name_package}-${version}
25checksums           rmd160  6415ae385effabb482b12cb9e39186d838d70d74 \
26                    sha256  31c3e4f637153bd270812dffc6a50708dfc686a8afa7ea1c88a9dfda0d8af52e
27
28depends_build-append \
29                    port:boost
30
31patch.pre_args      -p1
32patchfiles          patch-CMakeLists.txt.diff \
33                    patch-cppconn-CMakeLists.txt.diff \
34                    patch-driver-CMakeLists.txt.diff \
35                    patch-examples-examples.h.diff \
36                    patch-examples-pthreads.cpp.diff \
37                    patch-examples-standalone_example.cpp.diff \
38                    patch-examples-standalone_example_docs1.cpp.diff \
39                    patch-examples-standalone_example_docs2.cpp.diff
40
41post-patch {
42
43    reinplace "s,@NAME@,/${subport},g" \
44        ${worksrcpath}/cppconn/CMakeLists.txt \
45        ${worksrcpath}/driver/CMakeLists.txt
46}
47
48configure.args-append \
49                    -DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib/${subport}
50
51post-destroot {
52    xinstall -d ${destroot}${prefix}/share/${subport}
53    copy ${worksrcpath}/examples \
54        ${destroot}${prefix}/share/${subport}/
55
56    foreach lib [glob -directory ${destroot}${prefix}/lib/${subport} -type f *.dylib] {
57
58        system "install_name_tool -id ${prefix}/lib/${subport}/[strsed ${lib} /^.*\\///] ${lib}"
59    }
60}
61
62set mp.ports {
63    mysql5
64    mysql51
65    mysql55
66    mariadb
67    percona
68}
69set mp.names {}
70foreach mp.port ${mp.ports} {
71
72    lappend mp.names "${mp.port}-connector-cpp"
73}
74foreach mp.name ${mp.names} {
75
76    set idx             [lsearch ${mp.names} ${mp.name}]
77    set mp.port     [lindex ${mp.ports} $idx]
78    set mp.conflicts  [lreplace ${mp.names} $idx $idx]
79
80    if {[string compare ${mp.name} ${name}] == 0 && [string compare ${mp.name} ${subport}] == 0} {
81
82        description         The MySQL Connector/C++ for ${mp.port}.
83        long_description    ${description} \
84                            Standardized MySQL database driver for C++ development.
85        depends_lib-append  port:${mp.port}
86        configure.args-append \
87                            -DMYSQLCPPCONN_DYNLOAD_MYSQL_LIB:FILEPATH=${prefix}/lib/${mp.port}/mysql/libmysqlclient.dylib \
88                            -DMYSQL_CONFIG_EXECUTABLE:FILEPATH=${prefix}/lib/${mp.port}/bin/mysql_config
89    } else {
90
91        subport ${mp.name} {
92       
93            description         The MySQL Connector/C++ for ${mp.port}.
94            long_description    ${description} \
95                                Standardized MySQL database driver for C++ development.
96            depends_lib-append  port:${mp.port}
97            configure.args-append \
98                                -DMYSQLCPPCONN_DYNLOAD_MYSQL_LIB:FILEPATH=${prefix}/lib/${mp.port}/mysql/libmysqlclient.dylib \
99                                -DMYSQL_CONFIG_EXECUTABLE:FILEPATH=${prefix}/lib/${mp.port}/bin/mysql_config
100        }
101    }
102}
103
104subport mysql-connector-cpp {
105
106    replaced_by         mysql5-connector-cpp
107    PortGroup           obsolete 1.0
108}
109
110livecheck.type      regex
111livecheck.url       [lindex ${master_sites} 0]
112livecheck.regex     "\"mysql-connector-c\\+\\+-(\\d\[\\d\\.\]*)\\${extract.suffix}\""
Note: See TracBrowser for help on using the repository browser.