Skip to content
Permalink
Browse files

mysql55-connector-cpp: Update version to 1.1.9 and add additional mys…

…ql56 and mysql57 subports.
  • Loading branch information
pixilla committed Mar 24, 2018
1 parent 010b501 commit 01b2ce0aea11b55dd9e07a90751ca423dcb69fe3
@@ -3,10 +3,10 @@
PortSystem 1.0
PortGroup cmake 1.0

name mysql55-connector-cpp
name mysql57-connector-cpp
set name_package mysql-connector-c++
version 1.1.1
revision 2
version 1.1.9
revision 0
set branch [join [lrange [split ${version} .] 0 1] .]
categories databases
platforms darwin
@@ -22,8 +22,8 @@ master_sites http://mysql.mirrors.pair.com/${mirror_dir} \
http://ftp.plusline.de/mysql/${mirror_dir}

distname ${name_package}-${version}
checksums rmd160 6415ae385effabb482b12cb9e39186d838d70d74 \
sha256 31c3e4f637153bd270812dffc6a50708dfc686a8afa7ea1c88a9dfda0d8af52e
checksums rmd160 2445b7c3aab96e459bf8726963fbc7e203af7e6e \
sha256 3e31847a69a4e5c113b7c483731317ec4533858e3195d3a85026a0e2f509d2e4

depends_build-append \
port:boost
@@ -38,11 +38,24 @@ patchfiles patch-CMakeLists.txt.diff \
patch-examples-standalone_example_docs1.cpp.diff \
patch-examples-standalone_example_docs2.cpp.diff

post-patch {
post-extract {
file copy -force ${filespath}/examples-CMakeLists.txt \
${worksrcpath}/examples/CMakeLists.txt
}

post-patch {
reinplace "s,@NAME@,/${subport},g" \
${worksrcpath}/CMakeLists.txt \
${worksrcpath}/cppconn/CMakeLists.txt \
${worksrcpath}/driver/CMakeLists.txt
${worksrcpath}/driver/CMakeLists.txt \
${worksrcpath}/examples/CMakeLists.txt

reinplace "s,@DBPORT@,/${mp.port},g" \
${worksrcpath}/examples/CMakeLists.txt \
${worksrcpath}/examples/examples.h

reinplace "s,@PREFIX@,/${prefix},g" \
${worksrcpath}/examples/CMakeLists.txt
}

configure.args-append \
@@ -54,31 +67,28 @@ post-destroot {
${destroot}${prefix}/share/${subport}/

foreach lib [glob -directory ${destroot}${prefix}/lib/${subport} -type f *.dylib] {

system "install_name_tool -id ${prefix}/lib/${subport}/[strsed ${lib} /^.*\\///] ${lib}"
}
}

set mp.ports {
mysql5
mysql51
mysql55
mysql56
mysql57
mariadb
percona
}
set mp.names {}
foreach mp.port ${mp.ports} {

lappend mp.names "${mp.port}-connector-cpp"
}
foreach mp.name ${mp.names} {

set idx [lsearch ${mp.names} ${mp.name}]
set mp.port [lindex ${mp.ports} $idx]
set mp.conflicts [lreplace ${mp.names} $idx $idx]

if {[string compare ${mp.name} ${name}] == 0 && [string compare ${mp.name} ${subport}] == 0} {

description The MySQL Connector/C++ for ${mp.port}.
long_description ${description} \
Standardized MySQL database driver for C++ development.
@@ -87,9 +97,7 @@ foreach mp.name ${mp.names} {
-DMYSQLCPPCONN_DYNLOAD_MYSQL_LIB:FILEPATH=${prefix}/lib/${mp.port}/mysql/libmysqlclient.dylib \
-DMYSQL_CONFIG_EXECUTABLE:FILEPATH=${prefix}/lib/${mp.port}/bin/mysql_config
} else {

subport ${mp.name} {

description The MySQL Connector/C++ for ${mp.port}.
long_description ${description} \
Standardized MySQL database driver for C++ development.
@@ -101,12 +109,6 @@ foreach mp.name ${mp.names} {
}
}

subport mysql-connector-cpp {

replaced_by mysql5-connector-cpp
PortGroup obsolete 1.0
}

livecheck.type regex
livecheck.url [lindex ${master_sites} 0]
livecheck.regex "\"mysql-connector-c\\+\\+-(\\d\[\\d\\.\]*)\\${extract.suffix}\""
@@ -0,0 +1,55 @@
# MacPorts MySQL Connector/C++ examples CMake build
#
# Written in 2018 by Jeffrey Dvornek
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
#
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.

cmake_minimum_required(VERSION 3.10)

SET(CMAKE_VERBOSE_MAKEFILE 0)

FIND_PACKAGE(Boost COMPONENTS system thread REQUIRED)

INCLUDE_DIRECTORIES(
@PREFIX@/include
@PREFIX@/include@NAME@
@PREFIX@/include@DBPORT@
${Boost_INCLUDE_DIRS}
)

LINK_DIRECTORIES(
@PREFIX@/lib/
@PREFIX@/lib@NAME@/
@PREFIX@/lib@DBPORT@/mysql
)

LINK_LIBRARIES(
mysqlcppconn
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
)

FIND_LIBRARY(MYSQLCLIENT_LIB
NAMES libmysqlclient.dylib
PATHS @PREFIX@/lib@NAME@ NO_DEFAULT_PATH)

ADD_DEFINITIONS(-DDYNLOAD_MYSQL_LIB="${MYSQLCLIENT_LIB}")

ADD_EXECUTABLE(connect connect.cpp)
ADD_EXECUTABLE(connection_meta_schemaobj connection_meta_schemaobj.cpp)
ADD_EXECUTABLE(debug_output debug_output.cpp)
ADD_EXECUTABLE(exceptions exceptions.cpp)
ADD_EXECUTABLE(prepared_statement prepared_statement.cpp)
ADD_EXECUTABLE(resultset resultset.cpp)
ADD_EXECUTABLE(resultset_binary resultset_binary.cpp)
ADD_EXECUTABLE(resultset_meta resultset_meta.cpp)
ADD_EXECUTABLE(resultset_types resultset_types.cpp)
ADD_EXECUTABLE(statement statement.cpp)
ADD_EXECUTABLE(dynamic_load dynamic_load.cpp)

@@ -1,21 +1,32 @@
--- a/CMakeLists.txt 2012-08-16 12:15:30.000000000 -0700
+++ b/CMakeLists.txt 2012-08-23 08:36:04.000000000 -0700
@@ -252,14 +252,6 @@
SET( LICENSE_FILENAME "${CPACK_RESOURCE_FILE_LICENSE}")")
ENDIF(WIN32)
--- dist/CMakeLists.txt 2017-05-10 12:14:59.000000000 -0400
+++ macports/CMakeLists.txt 2018-03-03 01:54:24.000000000 -0500
@@ -37,10 +37,10 @@
OPTION(RPM_LAYOUT "Use directory layout for an RPM install")

IF(TAR_LAYOUT OR NOT CMAKE_VERSION OR CMAKE_VERSION VERSION_LESS "2.8.5")
- SET(INSTALL_LIBDIR lib)
+ SET(INSTALL_LIBDIR lib@NAME@)
ELSE()
INCLUDE(GNUInstallDirs)
- SET(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
+ SET(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}@NAME@)
ENDIF()

SET(EDIT_WARNING_MESSAGE "Please do not edit this file - it is generated by cmake. Edit its source file instead.")
@@ -354,12 +354,6 @@
SET(DOC_DESTINATION "share/doc/${CPACK_PACKAGE_NAME}-${MYSQLCPPCONN_VERSION}")
ENDIF()

-INSTALL(FILES
- ${CPACK_RESOURCE_FILE_README}
- ${CPACK_RESOURCE_FILE_INSTALL}
- ${CPACK_RESOURCE_FILE_LICENSE}
- "${CMAKE_SOURCE_DIR}/Licenses_for_Third-Party_Components.txt"
- "${CMAKE_SOURCE_DIR}/ANNOUNCEMENT"
- DESTINATION "." OPTIONAL)
- ${CPACK_RESOURCE_FILE_README}
- ${CPACK_RESOURCE_FILE_LICENSE}
- "${CMAKE_SOURCE_DIR}/Licenses_for_Third-Party_Components.txt"
- DESTINATION ${DOC_DESTINATION} OPTIONAL)
-
SET(COMMON_IGNORE_FILES "/CMakeFiles/" "/Testing/" "/.bzr/" "_CPack_Packages/"
".cmake$" "~" ".swp" ".log" ".gz" ".directory$" "CMakeCache.txt" "Makefile"
"install_manifest.txt")
@@ -291,7 +283,6 @@
SET(COMMON_IGNORE_FILES
"/CMakeFiles/"
"/Testing/"
@@ -419,7 +413,6 @@

ADD_SUBDIRECTORY(cppconn)
ADD_SUBDIRECTORY(driver)
@@ -1,16 +1,16 @@
--- a/cppconn/CMakeLists.txt 2012-08-16 12:15:30.000000000 -0700
+++ b/cppconn/CMakeLists.txt 2012-08-23 07:14:51.000000000 -0700
@@ -58,7 +58,6 @@
--- dist/cppconn/CMakeLists.txt 2017-05-10 12:14:59.000000000 -0400
+++ macports/cppconn/CMakeLists.txt 2018-03-02 23:39:23.000000000 -0500
@@ -59,7 +59,6 @@

SET(MYSQLCPPCONN_INSTALL_HEADERS
build_config.h
- config.h
- ${CMAKE_CURRENT_BINARY_DIR}/config.h
connection.h
datatype.h
driver.h
@@ -72,4 +71,5 @@
sqlstring.h
warning.h)
@@ -75,4 +74,5 @@
${CMAKE_CURRENT_BINARY_DIR}/version_info.h
variant.h)

-INSTALL(FILES ${MYSQLCPPCONN_INSTALL_HEADERS} DESTINATION include/cppconn)
+INSTALL(FILES ${MYSQLCPPCONN_INSTALL_HEADERS} DESTINATION include@NAME@/cppconn)
@@ -1,43 +1,33 @@
--- a/driver/CMakeLists.txt 2012-08-16 12:15:30.000000000 -0700
+++ b/driver/CMakeLists.txt 2012-08-23 07:20:25.000000000 -0700
@@ -275,18 +275,37 @@
)
ELSE(WIN32)
INSTALL(TARGETS mysqlcppconn mysqlcppconn-static
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib@NAME@
+ ARCHIVE DESTINATION lib@NAME@
)
ENDIF(WIN32)


# Install some MySQL specific headers
--- dist/driver/CMakeLists.txt 2017-05-10 12:14:59.000000000 -0400
+++ macports/driver/CMakeLists.txt 2018-03-03 00:54:18.000000000 -0500
@@ -343,9 +343,29 @@
SET(MYSQLCPPCONN_SPECIFIC_INSTALL_HEADERS
+ mysql_art_resultset.h
+ mysql_art_rset_metadata.h
mysql_connection.h
- mysql_driver.h)
+ mysql_connection_data.h
+ mysql_connection_options.h
+ mysql_debug.h
+ mysql_driver.h
+ mysql_metadata.h
+ mysql_parameter_metadata.h
+ mysql_prepared_statement.h
+ mysql_ps_resultset.h
+ mysql_ps_resultset_metadata.h
+ mysql_public_iface.h
+ mysql_resultbind.h
+ mysql_resultset.h
+ mysql_resultset_metadata.h
+ mysql_statement.h
+ mysql_statement_options.h
+ mysql_uri.h
+ mysql_util.h
+ mysql_warning.h)
mysql_connection.h
mysql_driver.h
- mysql_error.h)
+ mysql_error.h
+ mysql_art_resultset.h
+ mysql_art_rset_metadata.h
+ mysql_connection_data.h
+ mysql_connection_options.h
+ mysql_debug.h
+ mysql_metadata.h
+ mysql_parameter_metadata.h
+ mysql_prepared_statement.h
+ mysql_ps_resultset.h
+ mysql_ps_resultset_metadata.h
+ mysql_public_iface.h
+ mysql_resultbind.h
+ mysql_resultset.h
+ mysql_resultset_metadata.h
+ mysql_statement.h
+ mysql_statement_options.h
+ mysql_uri.h
+ mysql_util.h
+ mysql_warning.h)

-INSTALL(FILES ${MYSQLCPPCONN_SPECIFIC_INSTALL_HEADERS} DESTINATION include)
+
+INSTALL(FILES ${MYSQLCPPCONN_SPECIFIC_INSTALL_HEADERS} DESTINATION include@NAME@/driver)


@@ -1,9 +1,9 @@
--- a/examples/examples.h 2012-08-16 12:15:30.000000000 -0700
+++ b/examples/examples.h 2012-08-23 10:05:54.000000000 -0700
@@ -23,10 +23,25 @@
--- dist/examples/examples.h 2017-05-10 12:14:59.000000000 -0400
+++ macports/examples/examples.h 2018-03-03 00:57:16.000000000 -0500
@@ -22,6 +22,22 @@
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/


+// Connection properties
+#ifndef EXAMPLE_DB
+# define EXAMPLE_DB "test"
@@ -18,21 +18,13 @@
+# define EXAMPLE_PASS "root"
+#endif /* EXAMPLE_PASS */
+#ifndef DYNLOAD_MYSQL_LIB
+#define DYNLOAD_MYSQL_LIB "/opt/local/lib/mysql55/mysql/libmysqlclient_r.dylib"
+#define DYNLOAD_MYSQL_LIB "/opt/local/lib@DBPORT@/mysql/libmysqlclient.dylib"
+#endif /* DYNLOAD_MYSQL_LIB */


#ifndef _EXAMPLES_H
#define _EXAMPLES_H
-
/*
__FUNCTION__/__func__ is not portable. We do not promise
that our example definition covers each and every compiler.
@@ -57,15 +72,9 @@
works for you or you have to find your own.
*/
#ifndef __LINE__
- #define __LINE__ "(line number n/a)"
+#define __LINE__ "(line number n/a)"
@@ -60,12 +76,6 @@
#define __LINE__ "(line number n/a)"
#endif

-// Connection properties
@@ -1,5 +1,5 @@
--- a/examples/pthreads.cpp 2012-08-16 12:15:30.000000000 -0700
+++ b/examples/pthreads.cpp 2012-08-23 10:05:54.000000000 -0700
--- dist/examples/pthreads.cpp 2017-05-10 12:14:59.000000000 -0400
+++ macports/examples/pthreads.cpp 2018-03-03 00:59:58.000000000 -0500
@@ -69,17 +69,13 @@
*/
#include "mysql_connection.h"
@@ -1,6 +1,6 @@
--- a/examples/standalone_example.cpp 2012-08-16 12:15:30.000000000 -0700
+++ b/examples/standalone_example.cpp 2012-08-23 10:05:54.000000000 -0700
@@ -64,17 +64,13 @@
--- dist/examples/standalone_example.cpp 2017-05-10 12:14:59.000000000 -0400
+++ macports/examples/standalone_example.cpp 2018-03-03 01:00:15.000000000 -0500
@@ -66,17 +66,13 @@
*/
#include "mysql_connection.h"
#include "mysql_driver.h"

0 comments on commit 01b2ce0

Please sign in to comment.
You can’t perform that action at this time.