[libmariadb] Update to 3.1.10 (#14121)

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
NancyLi1013 2020-10-21 02:01:40 +08:00 committed by GitHub
parent 84ece08de0
commit 4aa08938a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 121 additions and 92 deletions

View File

@ -1,6 +1,5 @@
Source: libmariadb
Version: 3.1.9
Port-Version: 1
Version: 3.1.10
Homepage: https://github.com/MariaDB/mariadb-connector-c
Description: MariaDB Connector/C is used to connect C/C++ applications to MariaDB and MySQL databases
Default-Features: zlib, openssl
@ -12,3 +11,7 @@ Description: Use internal zlib
Feature: openssl
Build-Depends: openssl
Description: Enable SSL support
Feature: iconv
Build-Depends: libiconv
Description: Enables character set conversion

View File

@ -1,34 +1,18 @@
diff --git a/unittest/libmariadb/CMakeLists.txt b/unittest/libmariadb/CMakeLists.txt
index 9cea916..a39ba94 100644
--- a/unittest/libmariadb/CMakeLists.txt
+++ b/unittest/libmariadb/CMakeLists.txt
@@ -58,16 +58,16 @@ ENDIF()
ADD_LIBRARY(ma_getopt ma_getopt.c)
-FOREACH(API_TEST ${API_TESTS})
- IF (NOT TARGET ${API_TEST})
- ADD_EXECUTABLE(${API_TEST} ${API_TEST}.c)
- ENDIF()
- TARGET_LINK_LIBRARIES(${API_TEST} cctap ma_getopt mariadbclient)
- ADD_TEST(${API_TEST} ${EXECUTABLE_OUTPUT_PATH}/${API_TEST})
- SET_TESTS_PROPERTIES(${API_TEST} PROPERTIES TIMEOUT 180)
-ENDFOREACH(API_TEST)
-
-FOREACH(API_TEST ${MANUAL_TESTS})
- ADD_EXECUTABLE(${API_TEST} ${API_TEST}.c)
- TARGET_LINK_LIBRARIES(${API_TEST} cctap ma_getopt mariadbclient)
-ENDFOREACH()
+#FOREACH(API_TEST ${API_TESTS})
+# IF (NOT TARGET ${API_TEST})
+# ADD_EXECUTABLE(${API_TEST} ${API_TEST}.c)
+# ENDIF()
+# TARGET_LINK_LIBRARIES(${API_TEST} cctap ma_getopt mariadbclient)
+# ADD_TEST(${API_TEST} ${EXECUTABLE_OUTPUT_PATH}/${API_TEST})
+# SET_TESTS_PROPERTIES(${API_TEST} PROPERTIES TIMEOUT 180)
+#ENDFOREACH(API_TEST)
+#
+#FOREACH(API_TEST ${MANUAL_TESTS})
+# ADD_EXECUTABLE(${API_TEST} ${API_TEST}.c)
+# TARGET_LINK_LIBRARIES(${API_TEST} cctap ma_getopt mariadbclient)
+#ENDFOREACH()
diff --git a/unittest/libmariadb/CMakeLists.txt b/unittest/libmariadb/CMakeLists.txt
index e3ba18b..48c4f1d 100644
--- a/unittest/libmariadb/CMakeLists.txt
+++ b/unittest/libmariadb/CMakeLists.txt
@@ -48,6 +48,7 @@ ENDIF()
ADD_LIBRARY(ma_getopt ma_getopt.c)
+if(0)
FOREACH(API_TEST ${API_TESTS})
IF (NOT TARGET ${API_TEST})
ADD_EXECUTABLE(${API_TEST} ${API_TEST}.c)
@@ -65,3 +66,4 @@ FOREACH(API_TEST ${MANUAL_TESTS})
ADD_EXECUTABLE(${API_TEST} ${API_TEST}.c)
TARGET_LINK_LIBRARIES(${API_TEST} cctap ma_getopt mariadbclient)
ENDFOREACH()
+endif()
\ No newline at end of file

View File

@ -1,50 +1,49 @@
diff --git a/cmake/install_plugins.cmake b/cmake/install_plugins.cmake
index b8d15ba..7f59db7 100644
--- a/cmake/install_plugins.cmake
+++ b/cmake/install_plugins.cmake
@@ -8,7 +8,7 @@
# plugin installation
MACRO(INSTALL_PLUGIN name binary_dir)
- INSTALL(TARGETS ${name} COMPONENT ClientPlugins DESTINATION ${INSTALL_PLUGINDIR})
+ INSTALL(TARGETS ${name} COMPONENT ClientPlugins DESTINATION ${INSTALL_PLUGINDIR}/../../../bin/plugin)
IF(MSVC)
INSTALL(FILES $<TARGET_PDB_FILE:${name}> COMPONENT Debuginfo
DESTINATION symbols CONFIGURATIONS Debug RelWithDebInfo)
diff --git a/libmariadb/CMakeLists.txt b/libmariadb/CMakeLists.txt
index f406b37..a9ae9d7 100644
--- a/libmariadb/CMakeLists.txt
+++ b/libmariadb/CMakeLists.txt
@@ -395,10 +395,10 @@ ADD_LIBRARY(mariadbclient STATIC ${MARIADB_OBJECTS} ${EMPTY_FILE})
TARGET_LINK_LIBRARIES(mariadbclient ${SYSTEM_LIBS})
IF(UNIX)
- ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE})
+ ADD_LIBRARY(libmariadb ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE})
SET_TARGET_PROPERTIES(libmariadb PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}")
ELSE()
- ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} mariadbclient.def)
+ ADD_LIBRARY(libmariadb ${libmariadb_RC} mariadbclient.def)
TARGET_LINK_LIBRARIES(libmariadb LINK_PRIVATE mariadbclient)
SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINKER_LANGUAGE C)
ENDIF()
@@ -452,13 +452,14 @@ ENDIF()
INSTALL(TARGETS mariadbclient
COMPONENT Development
- DESTINATION ${INSTALL_LIBDIR})
+ LIBRARY DESTINATION lib)
INSTALL(TARGETS libmariadb
- COMPONENT SharedLibraries
- DESTINATION ${INSTALL_LIBDIR})
+ COMPONENT SharedLibraries
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
-
-IF(MSVC)
+IF(0)
# On Windows, install PDB
INSTALL(FILES $<TARGET_PDB_FILE:libmariadb> DESTINATION "${INSTALL_LIBDIR}"
CONFIGURATIONS Debug RelWithDebInfo
diff --git a/cmake/install_plugins.cmake b/cmake/install_plugins.cmake
index b8d15ba..7f59db7 100644
--- a/cmake/install_plugins.cmake
+++ b/cmake/install_plugins.cmake
@@ -8,7 +8,7 @@
# plugin installation
MACRO(INSTALL_PLUGIN name binary_dir)
- INSTALL(TARGETS ${name} COMPONENT ClientPlugins DESTINATION ${INSTALL_PLUGINDIR})
+ INSTALL(TARGETS ${name} COMPONENT ClientPlugins DESTINATION ${INSTALL_PLUGINDIR}/../../../bin/plugin)
IF(MSVC)
INSTALL(FILES $<TARGET_PDB_FILE:${name}> COMPONENT Debuginfo
DESTINATION symbols CONFIGURATIONS Debug RelWithDebInfo)
diff --git a/libmariadb/CMakeLists.txt b/libmariadb/CMakeLists.txt
index 14e34ab..083a863 100644
--- a/libmariadb/CMakeLists.txt
+++ b/libmariadb/CMakeLists.txt
@@ -398,10 +398,10 @@ ADD_LIBRARY(mariadbclient STATIC ${MARIADB_OBJECTS} ${EMPTY_FILE})
TARGET_LINK_LIBRARIES(mariadbclient ${SYSTEM_LIBS})
IF(UNIX)
- ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE})
+ ADD_LIBRARY(libmariadb ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE})
SET_TARGET_PROPERTIES(libmariadb PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}")
ELSE()
- ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} mariadbclient.def)
+ ADD_LIBRARY(libmariadb ${libmariadb_RC} mariadbclient.def)
TARGET_LINK_LIBRARIES(libmariadb LINK_PRIVATE mariadbclient)
SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINKER_LANGUAGE C)
ENDIF()
@@ -457,13 +457,15 @@ ENDIF()
INSTALL(TARGETS mariadbclient
COMPONENT Development
- DESTINATION ${INSTALL_LIBDIR})
+ LIBRARY DESTINATION lib)
INSTALL(TARGETS libmariadb
COMPONENT SharedLibraries
- DESTINATION ${INSTALL_LIBDIR})
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
-IF(MSVC)
+IF(0)
# On Windows, install PDB
INSTALL(FILES $<TARGET_PDB_FILE:libmariadb> DESTINATION "${INSTALL_LIBDIR}"
CONFIGURATIONS Debug RelWithDebInfo

View File

@ -0,0 +1,40 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cd716e3..7b694e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -346,7 +346,8 @@ ENDIF()
IF(WITH_ICONV)
IF(NOT WIN32)
- INCLUDE(${CC_SOURCE_DIR}/cmake/FindIconv.cmake)
+ find_package(Iconv REQUIRED)
+ include_directories(${Iconv_INCLUDE_DIRS})
ENDIF()
ENDIF()
@@ -363,8 +364,8 @@ IF(WIN32)
SET(SYSTEM_LIBS ws2_32 advapi32 kernel32 shlwapi crypt32 ${LIBZ})
ELSE()
SET(SYSTEM_LIBS ${SYSTEM_LIBS} ${LIBPTHREAD} ${LIBDL} ${LIBM})
- IF(ICONV_EXTERNAL)
- SET(SYSTEM_LIBS ${SYSTEM_LIBS} ${ICONV_LIBRARIES})
+ IF(WITH_ICONV)
+ SET(SYSTEM_LIBS ${SYSTEM_LIBS} ${Iconv_LIBRARIES})
ENDIF()
ENDIF()
IF(WITH_SSL)
diff --git a/mariadb_config/CMakeLists.txt b/mariadb_config/CMakeLists.txt
index 5bbf36b..70e619b 100644
--- a/mariadb_config/CMakeLists.txt
+++ b/mariadb_config/CMakeLists.txt
@@ -38,8 +38,8 @@ STRING(STRIP "${extra_dynamic_LDFLAGS}" extra_dynamic_LDFLAGS)
LIST(REMOVE_DUPLICATES extra_dynamic_LDFLAGS)
IF(UNIX AND NOT APPLE)
- IF(ICONV_EXTERNAL)
- GET_LIB_NAME(${ICONV_LIBRARIES} LIB_OUT)
+ IF(WITH_ICONV)
+ GET_LIB_NAME(${Iconv_LIBRARIES} LIB_OUT)
SET(extra_dynamic_LDFLAGS "${extra_dynamic_LDFLAGS} ${LIB_OUT}")
ENDIF()
ENDIF()

View File

@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 528c170..a5cd3fe 100644
index cd716e3..a1f2ada 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,7 +108,7 @@ IF(MSVC)
@@ -98,7 +98,7 @@ IF(MSVC)
# Speedup system tests
INCLUDE(${CC_SOURCE_DIR}/cmake/WindowsCache.cmake)
ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)

View File

@ -5,18 +5,20 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO MariaDB/mariadb-connector-c
REF a746c3af449a8754e78ad7971e59e79af7957cdb # v3.1.9
SHA512 6f200b984b0642bd75dd8b1ca8f6b996c4b9236c4180255d15dee369a10b3b802c0e8e1942135aeb3c279f3087ff4b19096e5fef15935f4b76cf4fcb344d9133
HEAD_REF master
REF 159540fe8c8f30b281748fe8a1b79e8b17993a67 # v3.1.10
SHA512 3e154f5dc4b5051607c7ebc0691a50c0699d60e4414660cf8f65689081ff78ef6b135667761ba8ac4163b469a3b55158c6b48c6fc0a0cc09381452aad157e4ad
HEAD_REF 3.1
PATCHES
md.patch
disable-test-build.patch
fix-InstallPath.patch
fix-iconv.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
zlib WITH_EXTERNAL_ZLIB
openssl WITH_SSL
iconv WITH_ICONV
)
vcpkg_configure_cmake(
@ -61,4 +63,5 @@ file(RENAME
${CURRENT_PACKAGES_DIR}/include/mariadb
${CURRENT_PACKAGES_DIR}/include/mysql)
file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
# copy license file
file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)