mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-30 23:11:16 +08:00
[libmysql] Update to 8.0.34 (#34736)
* [libmysql] Update to 8.0.34 * [libmysql] Fix deps * [libmysql] Fix deps, cont. * WIP * WIP * [libmysql] Don't wrap downstream Find modules Downstream Find modules are not standardized and cannot be wrapped reliably. By moving the legacy wrapper behaviour to a config module, we can catch those users which were relying on the old usage, and display the instructions for migrating to the canonical unofficial usage. * [libmysql] Cross build stuff * [libmysql] Cross build stuff * [libmysql] Cross build stuff
This commit is contained in:
parent
eb76636c04
commit
23d3731eae
@ -1,20 +0,0 @@
|
||||
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
|
||||
index ae13a63dfdc..b450b3c2e4c 100644
|
||||
--- a/cmake/libutils.cmake
|
||||
+++ b/cmake/libutils.cmake
|
||||
@@ -222,6 +222,7 @@ MACRO(MERGE_LIBRARIES_SHARED TARGET_ARG)
|
||||
ADD_VERSION_INFO(${TARGET} SHARED SRC)
|
||||
ENDIF()
|
||||
ADD_LIBRARY(${TARGET} SHARED ${SRC})
|
||||
+ TARGET_INCLUDE_DIRECTORIES(${TARGET} INTERFACE $<INSTALL_INTERFACE:include>)
|
||||
|
||||
IF(ARG_EXCLUDE_FROM_ALL)
|
||||
IF(NOT ARG_SKIP_INSTALL)
|
||||
@@ -361,6 +362,7 @@ MACRO(MERGE_CONVENIENCE_LIBRARIES TARGET_ARG)
|
||||
CONFIGURE_FILE_CONTENT("${SOURCE_FILE_CONTENT}" "${SOURCE_FILE}")
|
||||
|
||||
ADD_LIBRARY(${TARGET} STATIC ${SOURCE_FILE})
|
||||
+ TARGET_INCLUDE_DIRECTORIES(${TARGET} INTERFACE $<INSTALL_INTERFACE:include>)
|
||||
MY_CHECK_CXX_COMPILER_WARNING("-Wmissing-profile" HAS_MISSING_PROFILE)
|
||||
IF(FPROFILE_USE AND HAS_MISSING_PROFILE)
|
||||
ADD_COMPILE_FLAGS(${SOURCE_FILE} COMPILE_FLAGS ${HAS_MISSING_PROFILE})
|
141
ports/libmysql/cross-build.patch
Normal file
141
ports/libmysql/cross-build.patch
Normal file
@ -0,0 +1,141 @@
|
||||
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
|
||||
index 8e224532..2b63413b 100644
|
||||
--- a/libmysql/CMakeLists.txt
|
||||
+++ b/libmysql/CMakeLists.txt
|
||||
@@ -259,6 +259,7 @@ ELSEIF(FREEBSD)
|
||||
MESSAGE(STATUS "BSD built in DNS SRV APIs")
|
||||
ELSE()
|
||||
FIND_LIBRARY(RESOLV_LIBRARY NAMES resolv)
|
||||
+ FIND_LIBRARY(RESOLV_LIBRARY NAMES resolv PATHS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES} NO_DEFAULT_PATH)
|
||||
IF (RESOLV_LIBRARY)
|
||||
LIST(APPEND LIBS_TO_LINK ${RESOLV_LIBRARY})
|
||||
SET(HAVE_UNIX_DNS_SRV 1 PARENT_SCOPE)
|
||||
@@ -413,6 +414,7 @@ MYSQL_ADD_EXECUTABLE(libmysql_api_test
|
||||
${CMAKE_CURRENT_BINARY_DIR}/api_test.c
|
||||
LINK_LIBRARIES libmysql ${LIBRT}
|
||||
SKIP_INSTALL
|
||||
+ EXCLUDE_FROM_ALL
|
||||
)
|
||||
# Clang/UBSAN needs this on some platforms.
|
||||
SET_TARGET_PROPERTIES(libmysql_api_test PROPERTIES LINKER_LANGUAGE CXX)
|
||||
@@ -439,6 +441,6 @@ ADD_CUSTOM_COMMAND(
|
||||
COMMAND libmysql_api_test
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/libmysql_api_test.out
|
||||
)
|
||||
-MY_ADD_CUSTOM_TARGET(run_libmysql_api_test ALL
|
||||
+MY_ADD_CUSTOM_TARGET(run_libmysql_api_test
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/libmysql_api_test.out
|
||||
)
|
||||
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
|
||||
index 8e933877..d971acbf 100644
|
||||
--- a/scripts/CMakeLists.txt
|
||||
+++ b/scripts/CMakeLists.txt
|
||||
@@ -69,7 +69,6 @@ ADD_CUSTOM_COMMAND(
|
||||
|
||||
# Add target for the above to be built
|
||||
MY_ADD_CUSTOM_TARGET(GenFixPrivs
|
||||
- ALL
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables_sql.h
|
||||
)
|
||||
|
||||
diff --git a/scripts/sys_schema/CMakeLists.txt b/scripts/sys_schema/CMakeLists.txt
|
||||
index aaba3575..a0e52652 100644
|
||||
--- a/scripts/sys_schema/CMakeLists.txt
|
||||
+++ b/scripts/sys_schema/CMakeLists.txt
|
||||
@@ -221,7 +221,6 @@ MY_ADD_CUSTOM_TARGET(sql_commands
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sql_commands.h)
|
||||
|
||||
MY_ADD_CUSTOM_TARGET(GenSysSchemaC
|
||||
- ALL
|
||||
DEPENDS comp_sql sql_commands
|
||||
COMMENT "Generating Sys Schema C code"
|
||||
)
|
||||
diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt
|
||||
index 28cde40e..be916cbc 100644
|
||||
--- a/share/CMakeLists.txt
|
||||
+++ b/share/CMakeLists.txt
|
||||
@@ -47,8 +47,12 @@ SET(dirs
|
||||
ukrainian
|
||||
)
|
||||
|
||||
-FOREACH (dir ${dirs})
|
||||
- INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/${INSTALL_MYSQLSHAREDIR}/${dir}
|
||||
+ set(src_dir ${CMAKE_BINARY_DIR}/share/libmysql)
|
||||
+ if(CMAKE_CROSSCOMPILING)
|
||||
+ set(src_dir ${VCPKG_INSTALLED_DIR}/${VCPKG_HOST_TRIPLET}/share/libmysql)
|
||||
+ endif()
|
||||
+ FOREACH (dir ${dirs})
|
||||
+ INSTALL(DIRECTORY ${src_dir}/${dir}
|
||||
DESTINATION ${INSTALL_MYSQLSHAREDIR}
|
||||
COMPONENT Server
|
||||
)
|
||||
diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt
|
||||
index 665b35da..88f0743b 100644
|
||||
--- a/strings/CMakeLists.txt
|
||||
+++ b/strings/CMakeLists.txt
|
||||
@@ -69,6 +69,13 @@ SET(ZH_HANS_SRC_FILE ${CMAKE_SOURCE_DIR}/strings/lang_data/zh_hans.txt)
|
||||
SET(ZH_HANS_DST_FILE ${CMAKE_BINARY_DIR}/strings/uca900_zh_tbls.cc)
|
||||
SET(JA_HANS_SRC_FILE ${CMAKE_SOURCE_DIR}/strings/lang_data/ja_hans.txt)
|
||||
SET(JA_HANS_DST_FILE ${CMAKE_BINARY_DIR}/strings/uca900_ja_tbls.cc)
|
||||
+if(CMAKE_CROSSCOMPILING)
|
||||
+ file(COPY
|
||||
+ "${VCPKG_INSTALLED_DIR}/${VCPKG_HOST_TRIPLET}/share/libmysql/${PROJECT_VERSION}/uca900_zh_tbls.cc"
|
||||
+ "${VCPKG_INSTALLED_DIR}/${VCPKG_HOST_TRIPLET}/share/libmysql/${PROJECT_VERSION}/uca900_ja_tbls.cc"
|
||||
+ DESTINATION "${CMAKE_BINARY_DIR}/strings"
|
||||
+ )
|
||||
+else()
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${ZH_HANS_DST_FILE}
|
||||
${JA_HANS_DST_FILE}
|
||||
COMMAND uca9dump zh
|
||||
@@ -79,6 +86,8 @@ ADD_CUSTOM_COMMAND(OUTPUT ${ZH_HANS_DST_FILE}
|
||||
--out_file=${JA_HANS_DST_FILE}
|
||||
DEPENDS uca9dump ${ZH_HANS_SRC_FILE} ${JA_HANS_SRC_FILE}
|
||||
)
|
||||
+install(FILES "${ZH_HANS_DST_FILE}" "${JA_HANS_DST_FILE}" DESTINATION "share/libmysql/${PROJECT_VERSION}")
|
||||
+endif()
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(
|
||||
${JA_HANS_DST_FILE} ${ZH_HANS_DST_FILE}
|
||||
diff --git a/utilities/CMakeLists.txt b/utilities/CMakeLists.txt
|
||||
index da34524c..dc397dae 100644
|
||||
--- a/utilities/CMakeLists.txt
|
||||
+++ b/utilities/CMakeLists.txt
|
||||
@@ -39,6 +39,21 @@ MYSQL_ADD_EXECUTABLE(comp_client_err
|
||||
SKIP_INSTALL
|
||||
)
|
||||
|
||||
+if(CMAKE_CROSSCOMPILING)
|
||||
+ file(COPY
|
||||
+ ${VCPKG_INSTALLED_DIR}/${VCPKG_HOST_TRIPLET}/include/mysql/mysqld_error.h
|
||||
+ ${VCPKG_INSTALLED_DIR}/${VCPKG_HOST_TRIPLET}/share/libmysql/${PROJECT_VERSION}/mysqlclient_ername.h
|
||||
+ ${VCPKG_INSTALLED_DIR}/${VCPKG_HOST_TRIPLET}/share/libmysql/${PROJECT_VERSION}/mysqld_ername.h
|
||||
+ ${VCPKG_INSTALLED_DIR}/${VCPKG_HOST_TRIPLET}/share/libmysql/${PROJECT_VERSION}/mysqld_errmsg.h
|
||||
+ DESTINATION ${PROJECT_BINARY_DIR}/include
|
||||
+ )
|
||||
+ file(COPY
|
||||
+ ${VCPKG_INSTALLED_DIR}/${VCPKG_HOST_TRIPLET}/share/libmysql/${PROJECT_VERSION}/errmsg.sys
|
||||
+ DESTINATION ${PROJECT_BINARY_DIR}/share/libmysql/english
|
||||
+ )
|
||||
+ add_custom_target(GenClientError)
|
||||
+ add_custom_target(GenError)
|
||||
+else()
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/include/mysqlclient_ername.h
|
||||
COMMAND comp_client_err
|
||||
--in_file=${PROJECT_SOURCE_DIR}/include/errmsg.h
|
||||
@@ -97,6 +112,16 @@ MYSQL_ADD_EXECUTABLE(range_check_err
|
||||
SKIP_INSTALL
|
||||
)
|
||||
|
||||
+ install(
|
||||
+ FILES
|
||||
+ ${PROJECT_BINARY_DIR}/include/mysqlclient_ername.h
|
||||
+ ${PROJECT_BINARY_DIR}/include/mysqld_ername.h
|
||||
+ ${PROJECT_BINARY_DIR}/include/mysqld_errmsg.h
|
||||
+ ${PROJECT_BINARY_DIR}/share/libmysql/english/errmsg.sys
|
||||
+ DESTINATION share/libmysql/${PROJECT_VERSION}
|
||||
+ )
|
||||
+endif()
|
||||
+
|
||||
# Set InnoDB mutex type
|
||||
ADD_DEFINITIONS(-DMUTEX_EVENT)
|
||||
|
140
ports/libmysql/dependencies.patch
Normal file
140
ports/libmysql/dependencies.patch
Normal file
@ -0,0 +1,140 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index e17ec1d0..465e42f0 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -818,8 +818,12 @@ INCLUDE(fileutils)
|
||||
INCLUDE(zlib)
|
||||
INCLUDE(zstd)
|
||||
INCLUDE(lz4)
|
||||
-INCLUDE(icu)
|
||||
-INCLUDE(libevent)
|
||||
+macro(MYSQL_CHECK_ICU)
|
||||
+endmacro()
|
||||
+macro(MYSQL_CHECK_LIBEVENT)
|
||||
+endmacro()
|
||||
+macro(WARN_MISSING_SYSTEM_LIBEVENT)
|
||||
+endmacro()
|
||||
INCLUDE(ssl)
|
||||
INCLUDE(sasl)
|
||||
INCLUDE(ldap)
|
||||
@@ -837,7 +841,8 @@ INCLUDE(curl)
|
||||
INCLUDE(rapidjson)
|
||||
INCLUDE(fprofile)
|
||||
INCLUDE(gloves)
|
||||
-INCLUDE(fido2)
|
||||
+macro(MYSQL_CHECK_FIDO)
|
||||
+endmacro()
|
||||
INCLUDE(win_jemalloc)
|
||||
|
||||
IF(UNIX)
|
||||
@@ -1942,7 +1947,7 @@ MYSQL_CHECK_RAPIDJSON()
|
||||
MYSQL_CHECK_FIDO()
|
||||
MYSQL_CHECK_FIDO_DLLS()
|
||||
|
||||
-IF(APPLE)
|
||||
+IF(0)
|
||||
GET_FILENAME_COMPONENT(HOMEBREW_BASE ${HOMEBREW_HOME} DIRECTORY)
|
||||
IF(EXISTS ${HOMEBREW_BASE}/include/boost)
|
||||
FOREACH(SYSTEM_LIB ICU LIBEVENT LZ4 PROTOBUF ZSTD FIDO)
|
||||
diff --git a/cmake/boost.cmake b/cmake/boost.cmake
|
||||
index c979055c..53e55fcf 100644
|
||||
--- a/cmake/boost.cmake
|
||||
+++ b/cmake/boost.cmake
|
||||
@@ -301,7 +301,7 @@ IF(NOT BOOST_MAJOR_VERSION EQUAL 10)
|
||||
COULD_NOT_FIND_BOOST()
|
||||
ENDIF()
|
||||
|
||||
-IF(NOT BOOST_MINOR_VERSION EQUAL 77)
|
||||
+IF(NOT BOOST_MINOR_VERSION EQUAL 77 AND NOT IGNORE_BOOST_VERSION)
|
||||
MESSAGE(WARNING "Boost minor version found is ${BOOST_MINOR_VERSION} "
|
||||
"we need 77"
|
||||
)
|
||||
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
|
||||
index 7107f4bd..bb7f3733 100644
|
||||
--- a/cmake/libutils.cmake
|
||||
+++ b/cmake/libutils.cmake
|
||||
@@ -534,7 +534,7 @@ MACRO(MERGE_CONVENIENCE_LIBRARIES TARGET_ARG)
|
||||
|
||||
# On Windows, ssleay32.lib/libeay32.lib or libssl.lib/libcrypto.lib
|
||||
# must be merged into mysqlclient.lib
|
||||
- IF(WIN32 AND ${TARGET} STREQUAL "mysqlclient")
|
||||
+ IF(0)
|
||||
SET(LINKER_EXTRA_FLAGS "")
|
||||
FOREACH(LIB ${SSL_LIBRARIES})
|
||||
STRING_APPEND(LINKER_EXTRA_FLAGS " ${LIB}")
|
||||
diff --git a/cmake/lz4.cmake b/cmake/lz4.cmake
|
||||
index 10e7e8c8..48772329 100644
|
||||
--- a/cmake/lz4.cmake
|
||||
+++ b/cmake/lz4.cmake
|
||||
@@ -46,7 +46,7 @@ FUNCTION(FIND_SYSTEM_LZ4)
|
||||
FIND_PATH(LZ4_INCLUDE_DIR
|
||||
NAMES lz4frame.h)
|
||||
FIND_LIBRARY(LZ4_SYSTEM_LIBRARY
|
||||
- NAMES lz4)
|
||||
+ NAMES lz4d lz4 NAMES_PER_DIR)
|
||||
IF (LZ4_INCLUDE_DIR AND LZ4_SYSTEM_LIBRARY)
|
||||
SET(SYSTEM_LZ4_FOUND 1 CACHE INTERNAL "")
|
||||
ADD_LIBRARY(lz4_interface INTERFACE)
|
||||
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
|
||||
index 04e3af87..8ae52c82 100644
|
||||
--- a/cmake/ssl.cmake
|
||||
+++ b/cmake/ssl.cmake
|
||||
@@ -273,7 +273,18 @@ MACRO (MYSQL_CHECK_SSL)
|
||||
FIND_ALTERNATIVE_SYSTEM_SSL()
|
||||
ENDIF()
|
||||
|
||||
- IF(WITH_SSL STREQUAL "system" OR WITH_SSL_PATH OR ALTERNATIVE_SYSTEM_SSL)
|
||||
+ IF(WITH_SSL STREQUAL "system")
|
||||
+ find_package(OpenSSL REQUIRED)
|
||||
+ set(OPENSSL_LIBRARY OpenSSL::SSL CACHE STRING "")
|
||||
+ set(CRYPTO_LIBRARY OpenSSL::Crypto CACHE STRING "")
|
||||
+ find_program(OPENSSL_EXECUTABLE openssl
|
||||
+ DOC "path to the openssl executable")
|
||||
+ set(SSL_DEFINES "-DHAVE_OPENSSL")
|
||||
+ add_library(ext::openssl ALIAS OpenSSL::SSL)
|
||||
+ set(SSL_LIBRARIES ext::openssl)
|
||||
+ set(OPENSSL_APPLINK_C "${OPENSSL_APPLINK_SOURCE}")
|
||||
+ include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR})
|
||||
+ ELSEIF(WITH_SSL STREQUAL "system" OR WITH_SSL_PATH OR ALTERNATIVE_SYSTEM_SSL)
|
||||
IF((APPLE OR WIN32) AND WITH_SSL STREQUAL "system")
|
||||
# FindOpenSSL.cmake knows about
|
||||
# http://www.slproweb.com/products/Win32OpenSSL.html
|
||||
diff --git a/cmake/zlib.cmake b/cmake/zlib.cmake
|
||||
index 3781fe09..ac312ad0 100644
|
||||
--- a/cmake/zlib.cmake
|
||||
+++ b/cmake/zlib.cmake
|
||||
@@ -124,7 +124,7 @@ MACRO (MYSQL_CHECK_ZLIB)
|
||||
MESSAGE(FATAL_ERROR "WITH_ZLIB must be bundled or system")
|
||||
ENDIF()
|
||||
|
||||
- ADD_LIBRARY(ext::zlib ALIAS zlib_interface)
|
||||
+ ADD_LIBRARY(ext::zlib ALIAS ZLIB::ZLIB)
|
||||
|
||||
IF(ZLIB_VERSION VERSION_LESS MIN_ZLIB_VERSION_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR
|
||||
diff --git a/cmake/zstd.cmake b/cmake/zstd.cmake
|
||||
index 425426d1..0ae1a907 100644
|
||||
--- a/cmake/zstd.cmake
|
||||
+++ b/cmake/zstd.cmake
|
||||
@@ -90,15 +90,16 @@ MACRO (MYSQL_CHECK_ZSTD)
|
||||
IF(WITH_ZSTD STREQUAL "bundled")
|
||||
MYSQL_USE_BUNDLED_ZSTD()
|
||||
ELSEIF(WITH_ZSTD STREQUAL "system")
|
||||
- FIND_SYSTEM_ZSTD()
|
||||
- IF (NOT SYSTEM_ZSTD_FOUND)
|
||||
- MESSAGE(FATAL_ERROR "Cannot find system zstd libraries.")
|
||||
- ENDIF()
|
||||
+ find_package(ZSTD NAMES zstd REQUIRED)
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "WITH_ZSTD must be bundled or system")
|
||||
ENDIF()
|
||||
|
||||
- ADD_LIBRARY(ext::zstd ALIAS zstd_interface)
|
||||
+ if(TARGET zstd::libzstd_shared)
|
||||
+ add_library(ext::zstd ALIAS zstd::libzstd_shared)
|
||||
+ else()
|
||||
+ add_library(ext::zstd ALIAS zstd::libzstd_static)
|
||||
+ endif()
|
||||
|
||||
IF(ZSTD_VERSION VERSION_LESS MIN_ZSTD_VERSION_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR
|
@ -1,143 +0,0 @@
|
||||
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
|
||||
index 870c9f13732..98bc3ea15e4 100644
|
||||
--- a/cmake/install_macros.cmake
|
||||
+++ b/cmake/install_macros.cmake
|
||||
@@ -97,7 +97,7 @@ ENDFUNCTION()
|
||||
FUNCTION(MYSQL_INSTALL_TARGET target_arg)
|
||||
CMAKE_PARSE_ARGUMENTS(ARG
|
||||
"NAMELINK_SKIP"
|
||||
- "DESTINATION;COMPONENT"
|
||||
+ "DESTINATION;COMPONENT;EXPORT"
|
||||
""
|
||||
${ARGN}
|
||||
)
|
||||
@@ -113,10 +113,21 @@ FUNCTION(MYSQL_INSTALL_TARGET target_arg)
|
||||
IF(ARG_NAMELINK_SKIP)
|
||||
SET(LIBRARY_INSTALL_ARGS NAMELINK_SKIP)
|
||||
ENDIF()
|
||||
- INSTALL(TARGETS ${target}
|
||||
- RUNTIME DESTINATION ${ARG_DESTINATION} ${COMP}
|
||||
- ARCHIVE DESTINATION ${ARG_DESTINATION} ${COMP}
|
||||
- LIBRARY DESTINATION ${ARG_DESTINATION} ${COMP} ${LIBRARY_INSTALL_ARGS})
|
||||
+ IF (ARG_EXPORT)
|
||||
+ FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${ARG_EXPORT}-config.cmake"
|
||||
+"include(CMakeFindDependencyMacro)
|
||||
+find_dependency(ZLIB)
|
||||
+find_dependency(OpenSSL)
|
||||
+find_dependency(Threads)
|
||||
+include(\"\${CMAKE_CURRENT_LIST_DIR}/${ARG_EXPORT}-targets.cmake\")
|
||||
+")
|
||||
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ARG_EXPORT}-config.cmake DESTINATION share/${ARG_EXPORT})
|
||||
+ set(EXPORT_ARGS EXPORT ${ARG_EXPORT}-targets)
|
||||
+ ENDIF()
|
||||
+ INSTALL(TARGETS ${target} ${EXPORT_ARGS} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ${COMP})
|
||||
+ IF (ARG_EXPORT)
|
||||
+ INSTALL(${EXPORT_ARGS} DESTINATION share/${ARG_EXPORT})
|
||||
+ ENDIF()
|
||||
SET(INSTALL_LOCATION ${ARG_DESTINATION} )
|
||||
INSTALL_DEBUG_SYMBOLS(${target})
|
||||
SET(INSTALL_LOCATION)
|
||||
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
|
||||
index 23e60ad..cc969a8 100644
|
||||
--- a/cmake/libutils.cmake
|
||||
+++ b/cmake/libutils.cmake
|
||||
@@ -298,8 +298,9 @@ MACRO(MERGE_LIBRARIES_SHARED TARGET_ARG)
|
||||
IF(ARG_NAMELINK_SKIP)
|
||||
SET(INSTALL_ARGS NAMELINK_SKIP)
|
||||
ENDIF()
|
||||
- MYSQL_INSTALL_TARGET(${TARGET} DESTINATION "${DESTINATION}" ${COMP}
|
||||
- ${INSTALL_ARGS})
|
||||
+ IF(NOT INSTALL_STATIC_LIBRARIES)
|
||||
+ MYSQL_INSTALL_TARGET(${TARGET} EXPORT unofficial-libmysql DESTINATION "${INSTALL_LIBDIR}" ${COMP})
|
||||
+ ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32)
|
||||
@@ -464,7 +465,7 @@ MACRO(MERGE_CONVENIENCE_LIBRARIES TARGET_ARG)
|
||||
SET(COMP COMPONENT ${ARG_COMPONENT})
|
||||
ENDIF()
|
||||
IF(INSTALL_STATIC_LIBRARIES)
|
||||
- MYSQL_INSTALL_TARGET(${TARGET} DESTINATION "${INSTALL_LIBDIR}" ${COMP})
|
||||
+ MYSQL_INSTALL_TARGET(${TARGET} EXPORT unofficial-libmysql DESTINATION "${INSTALL_LIBDIR}" ${COMP})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDMACRO(MERGE_CONVENIENCE_LIBRARIES)
|
||||
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
|
||||
index 2ee26bfa284..46583f4f0a3 100644
|
||||
--- a/libmysql/CMakeLists.txt
|
||||
+++ b/libmysql/CMakeLists.txt
|
||||
@@ -277,6 +277,14 @@ ENDIF()
|
||||
# LDAP authentication SASL client plug-in
|
||||
ADD_SUBDIRECTORY(authentication_ldap)
|
||||
|
||||
+IF (BUILD_SHARED_LIBS)
|
||||
+ set(INSTALL_SHARED )
|
||||
+ set(INSTALL_STATIC SKIP_INSTALL)
|
||||
+ELSE()
|
||||
+ set(INSTALL_SHARED SKIP_INSTALL)
|
||||
+ set(INSTALL_STATIC )
|
||||
+ENDIF()
|
||||
+
|
||||
# FIDO authentication client plugin
|
||||
ADD_SUBDIRECTORY(authentication_fido)
|
||||
|
||||
@@ -287,7 +295,7 @@ ADD_SUBDIRECTORY(authentication_kerberos)
|
||||
ADD_SUBDIRECTORY(authentication_oci_client)
|
||||
|
||||
# Merge several convenience libraries into one big mysqlclient
|
||||
-MERGE_CONVENIENCE_LIBRARIES(mysqlclient ${LIBS_TO_MERGE}
|
||||
+MERGE_CONVENIENCE_LIBRARIES(mysqlclient ${LIBS_TO_MERGE} ${INSTALL_STATIC}
|
||||
COMPONENT Development
|
||||
LINK_LIBRARIES ${LIBS_TO_LINK}
|
||||
)
|
||||
@@ -403,6 +403,7 @@ CONFIGURE_FILE(api_test.c.in ${CMAKE_CURRENT_BINARY_DIR}/api_test.c)
|
||||
# from @CLIENT_API_FUNCTIONS@ are declared by <mysql.h>. It will fail
|
||||
# to run if not all of these symbols are exported by the library.
|
||||
#
|
||||
+IF (ENABLE_TESTING)
|
||||
MYSQL_ADD_EXECUTABLE(libmysql_api_test
|
||||
${CMAKE_CURRENT_BINARY_DIR}/api_test.c
|
||||
LINK_LIBRARIES libmysql ${LIBRT}
|
||||
@@ -410,6 +411,7 @@ MYSQL_ADD_EXECUTABLE(libmysql_api_test
|
||||
)
|
||||
# Clang/UBSAN needs this on some platforms.
|
||||
SET_TARGET_PROPERTIES(libmysql_api_test PROPERTIES LINKER_LANGUAGE CXX)
|
||||
+ENDIF()
|
||||
|
||||
IF(MY_COMPILER_IS_GNU)
|
||||
ADD_COMPILE_FLAGS(
|
||||
@@ -426,9 +428,11 @@ IF(HAS_WARN_FLAG)
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
+IF (ENABLE_TESTING)
|
||||
# Verify that libmysql_api_test runs OK
|
||||
MY_ADD_CUSTOM_TARGET(run_libmysql_api_test ALL
|
||||
DEPENDS libmysql_api_test
|
||||
COMMAND libmysql_api_test
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/libmysql_api_test.out
|
||||
)
|
||||
+ENDIF()
|
||||
\ No newline at end of file
|
||||
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
|
||||
index a5fa18e..0f2e15c 100644
|
||||
--- a/scripts/CMakeLists.txt
|
||||
+++ b/scripts/CMakeLists.txt
|
||||
@@ -329,13 +329,13 @@ MACRO(EXTRACT_LINK_LIBRARIES target var)
|
||||
STRING(REGEX REPLACE "^[ ]+" "" ${var} "${${var}}")
|
||||
STRING(REGEX REPLACE "[ ]+$" "" ${var} "${${var}}")
|
||||
ENDMACRO()
|
||||
-
|
||||
+IF (NOT BUILD_SHARED_LIBS)
|
||||
EXTRACT_LINK_LIBRARIES(mysqlclient CLIENT_LIBS)
|
||||
-
|
||||
-IF(MSVC)
|
||||
+ENDIF()
|
||||
+IF(MSVC AND NOT BUILD_SHARED_LIBS)
|
||||
GET_TARGET_PROPERTY(LIBMYSQL_OS_SHLIB_VERSION mysqlclient VERSION)
|
||||
GET_TARGET_PROPERTY(LIBMYSQL_OS_OUTPUT_NAME mysqlclient OUTPUT_NAME)
|
||||
-ELSE()
|
||||
+ELSEIF(BUILD_SHARED_LIBS)
|
||||
GET_TARGET_PROPERTY(LIBMYSQL_OS_SHLIB_VERSION libmysql VERSION)
|
||||
GET_TARGET_PROPERTY(LIBMYSQL_OS_OUTPUT_NAME libmysql OUTPUT_NAME)
|
||||
ENDIF()
|
@ -1,13 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 52d12a15190..6033494e4f0 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1929,7 +1929,7 @@ IF(APPLE)
|
||||
GET_FILENAME_COMPONENT(HOMEBREW_BASE ${HOMEBREW_HOME} DIRECTORY)
|
||||
IF(EXISTS ${HOMEBREW_BASE}/include/boost)
|
||||
FOREACH(SYSTEM_LIB ICU LIBEVENT LZ4 PROTOBUF ZSTD FIDO)
|
||||
- IF(WITH_${SYSTEM_LIB} STREQUAL "system")
|
||||
+ IF(FALSE)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"WITH_${SYSTEM_LIB}=system is not compatible with Homebrew boost\n"
|
||||
"MySQL depends on ${BOOST_PACKAGE_NAME} with a set of patches.\n"
|
@ -1,13 +0,0 @@
|
||||
diff --git a/cmake/boost.cmake b/cmake/boost.cmake
|
||||
index e879484a9d9..437b77ff49a 100644
|
||||
--- a/cmake/boost.cmake
|
||||
+++ b/cmake/boost.cmake
|
||||
@@ -301,7 +301,7 @@ IF(NOT BOOST_MAJOR_VERSION EQUAL 10)
|
||||
COULD_NOT_FIND_BOOST()
|
||||
ENDIF()
|
||||
|
||||
-IF(NOT BOOST_MINOR_VERSION EQUAL 77)
|
||||
+IF(NOT BOOST_MINOR_VERSION EQUAL 77 AND NOT IGNORE_BOOST_VERSION)
|
||||
MESSAGE(WARNING "Boost minor version found is ${BOOST_MINOR_VERSION} "
|
||||
"we need 77"
|
||||
)
|
121
ports/libmysql/install-exports.patch
Normal file
121
ports/libmysql/install-exports.patch
Normal file
@ -0,0 +1,121 @@
|
||||
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
|
||||
index baf49cd5..c45fda71 100644
|
||||
--- a/cmake/install_macros.cmake
|
||||
+++ b/cmake/install_macros.cmake
|
||||
@@ -113,8 +113,30 @@ FUNCTION(MYSQL_INSTALL_TARGET target_arg)
|
||||
IF(ARG_NAMELINK_SKIP)
|
||||
SET(LIBRARY_INSTALL_ARGS NAMELINK_SKIP)
|
||||
ENDIF()
|
||||
+ if(target STREQUAL "libmysql" OR target STREQUAL "mysqlclient")
|
||||
+ target_include_directories(${target} INTERFACE $<INSTALL_INTERFACE:include>)
|
||||
+ if(target STREQUAL "mysqlclient")
|
||||
+ set_target_properties(${target} PROPERTIES EXPORT_NAME libmysql) # uniform
|
||||
+ endif()
|
||||
+ FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/unofficial-libmysql-config.cmake"
|
||||
+"include(CMakeFindDependencyMacro)
|
||||
+find_dependency(OpenSSL)
|
||||
+find_dependency(Threads)
|
||||
+find_dependency(ZLIB)
|
||||
+find_dependency(zstd CONFIG)
|
||||
+include(\"\${CMAKE_CURRENT_LIST_DIR}/unofficial-libmysql-targets.cmake\")
|
||||
+if(NOT TARGET ${target}) # legacy vcpkg
|
||||
+ add_library(${target} INTERFACE IMPORTED)
|
||||
+ set_target_properties(${target} PROPERTIES INTERFACE_LINK_LIBRARIES unofficial::libmysql::libmysql)
|
||||
+endif()
|
||||
+")
|
||||
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-libmysql-config.cmake" DESTINATION "share/unofficial-libmysql")
|
||||
+ install(EXPORT "unofficial-libmysql-targets" NAMESPACE unofficial::libmysql:: DESTINATION "share/unofficial-libmysql")
|
||||
+ set(LIBRARY_EXPORT_ARGS EXPORT unofficial-libmysql-targets)
|
||||
+ endif()
|
||||
INSTALL(TARGETS ${target}
|
||||
- RUNTIME DESTINATION ${ARG_DESTINATION} ${COMP}
|
||||
+ ${LIBRARY_EXPORT_ARGS}
|
||||
+ RUNTIME DESTINATION bin ${COMP}
|
||||
ARCHIVE DESTINATION ${ARG_DESTINATION} ${COMP}
|
||||
LIBRARY DESTINATION ${ARG_DESTINATION} ${COMP} ${LIBRARY_INSTALL_ARGS})
|
||||
SET(INSTALL_LOCATION ${ARG_DESTINATION} )
|
||||
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
|
||||
index a5333987..c954bfb1 100644
|
||||
--- a/cmake/libutils.cmake
|
||||
+++ b/cmake/libutils.cmake
|
||||
@@ -385,8 +385,12 @@ MACRO(MERGE_LIBRARIES_SHARED TARGET_ARG)
|
||||
IF(ARG_NAMELINK_SKIP)
|
||||
SET(INSTALL_ARGS NAMELINK_SKIP)
|
||||
ENDIF()
|
||||
+ if(INSTALL_STATIC_LIBRARIES)
|
||||
+ set_target_properties(${TARGET} PROPERTIES EXCLUDE_FROM_ALL 1)
|
||||
+ else()
|
||||
MYSQL_INSTALL_TARGET(${TARGET} DESTINATION "${DESTINATION}" ${COMP}
|
||||
${INSTALL_ARGS})
|
||||
+ endif()
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32)
|
||||
@@ -563,6 +567,8 @@ MACRO(MERGE_CONVENIENCE_LIBRARIES TARGET_ARG)
|
||||
ENDIF()
|
||||
IF(INSTALL_STATIC_LIBRARIES)
|
||||
MYSQL_INSTALL_TARGET(${TARGET} DESTINATION "${INSTALL_LIBDIR}" ${COMP})
|
||||
+ else()
|
||||
+ set_target_properties(${TARGET} PROPERTIES EXCLUDE_FROM_ALL 1)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDMACRO(MERGE_CONVENIENCE_LIBRARIES)
|
||||
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
|
||||
index c4ef5694..8e933877 100644
|
||||
--- a/scripts/CMakeLists.txt
|
||||
+++ b/scripts/CMakeLists.txt
|
||||
@@ -315,10 +315,14 @@ MACRO(EXTRACT_LINK_LIBRARIES target var)
|
||||
FOREACH(lib ${TARGET_LIB_DEPENDS})
|
||||
IF (lib MATCHES "^\\-l")
|
||||
SET(${var} "${${var}} ${lib} ")
|
||||
+ elseif(lib MATCHES "^ext::(openssl|zlib|zstd)" AND NOT WIN32)
|
||||
+ list(APPEND ext_targets "${CMAKE_MATCH_1}")
|
||||
ELSEIF (lib MATCHES "^ext::")
|
||||
STRING(REGEX MATCH "ext::([a-z]+)" MATCH_LIB "${lib}")
|
||||
SET(SYSTEM_LIB ${CMAKE_MATCH_1})
|
||||
SET(${var} "${${var}} -l${SYSTEM_LIB} ")
|
||||
+ elseif(TARGET "${lib}" AND NOT WIN32)
|
||||
+ # merged or shared, not external
|
||||
ELSEIF (lib MATCHES "^\\-L")
|
||||
# Search directory. Test on FreeBSD: -L/usr/local/lib -lunwind
|
||||
SET(${var} "${${var}} ${lib} ")
|
||||
@@ -354,6 +358,7 @@ IF(MSVC)
|
||||
GET_TARGET_PROPERTY(LIBMYSQL_OS_SHLIB_VERSION mysqlclient VERSION)
|
||||
GET_TARGET_PROPERTY(LIBMYSQL_OS_OUTPUT_NAME mysqlclient OUTPUT_NAME)
|
||||
ELSE()
|
||||
+ EXTRACT_LINK_LIBRARIES(libmysql CLIENT_LIBS)
|
||||
GET_TARGET_PROPERTY(LIBMYSQL_OS_SHLIB_VERSION libmysql VERSION)
|
||||
GET_TARGET_PROPERTY(LIBMYSQL_OS_OUTPUT_NAME libmysql OUTPUT_NAME)
|
||||
ENDIF()
|
||||
@@ -373,6 +378,10 @@ IF (WITH_SSL STREQUAL "system")
|
||||
"${CONFIG_LIBS_PRIVATE}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
+list(APPEND CONFIG_REQUIRES_PRIVATE ${ext_targets})
|
||||
+list(REMOVE_DUPLICATES CONFIG_REQUIRES_PRIVATE)
|
||||
+list(JOIN CONFIG_REQUIRES_PRIVATE " " CONFIG_REQUIRES_PRIVATE)
|
||||
+string(REPLACE "zstd" "libzstd" CONFIG_REQUIRES_PRIVATE "${CONFIG_REQUIRES_PRIVATE}" )
|
||||
|
||||
MESSAGE(STATUS "CONFIG_CLIENT_LIBS ${CONFIG_CLIENT_LIBS}")
|
||||
MESSAGE(STATUS "CONFIG_LIBS_PRIVATE ${CONFIG_LIBS_PRIVATE}")
|
||||
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
|
||||
index 6e8520be..bf1a45af 100644
|
||||
--- a/scripts/mysql_config.sh
|
||||
+++ b/scripts/mysql_config.sh
|
||||
@@ -119,6 +119,16 @@ fi
|
||||
# Create options
|
||||
libs="-L$pkglibdir@RPATH_OPTION@"
|
||||
libs="$libs -l@LIBMYSQL_OS_OUTPUT_NAME@ @CONFIG_CLIENT_LIBS@"
|
||||
+if test -z "${PKG_CONFIG}" ; then
|
||||
+ if pkg-config --version >/dev/null 2>&1 ; then
|
||||
+ PKG_CONFIG=pkg-config
|
||||
+ elif pkgconf --version >/dev/null 2>&1 ; then
|
||||
+ PKG_CONFIG=pkgconf
|
||||
+ else
|
||||
+ PKG_CONFIG=false
|
||||
+ fi
|
||||
+fi
|
||||
+libs="$libs $(${PKG_CONFIG} --libs @CONFIG_REQUIRES_PRIVATE@)"
|
||||
|
||||
cflags="-I$pkgincludedir @CFLAGS@"
|
||||
cxxflags="-I$pkgincludedir @CXXFLAGS@"
|
6
ports/libmysql/libmysql-config.cmake
Normal file
6
ports/libmysql/libmysql-config.cmake
Normal file
@ -0,0 +1,6 @@
|
||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/usage" usage)
|
||||
message(WARNING "find_package(libmysql) is deprecated.\n${usage}")
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(unofficial-libmysql CONFIG REQUIRED)
|
||||
set(libmysql_FOUND 1)
|
||||
set(MYSQL_LIBRARIES unofficial::libmysql::libmysql)
|
@ -2,31 +2,21 @@ if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql/mysql.h")
|
||||
message(FATAL_ERROR "FATAL ERROR: ${PORT} and libmariadb are incompatible.")
|
||||
endif()
|
||||
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
message(WARNING "'autoconf-archive' must be installed via your system package manager (brew, apt, etc.).")
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO mysql/mysql-server
|
||||
REF mysql-${VERSION}
|
||||
SHA512 8b9f15b301b158e6ffc99dd916b9062968d36f6bdd7b898636fa61badfbe68f7328d4a39fa3b8b3ebef180d3aec1aee353bd2dac9ef1594e5772291390e17ac0
|
||||
SHA512 5df45c1ce1e2c620856b9274666cf56738d6a0308c33c9c96583b494c987fb0e862e676301109b9e4732070d54e6086596a62ad342f35adc59ca9f749e37b561
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
ignore-boost-version.patch
|
||||
system-libs.patch
|
||||
export-cmake-targets.patch
|
||||
Add-target-include-directories.patch
|
||||
homebrew.patch
|
||||
dependencies.patch
|
||||
install-exports.patch
|
||||
fix_dup_symbols.patch
|
||||
cross-build.patch
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/include/boost_1_70_0")
|
||||
|
||||
set(STACK_DIRECTION "")
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
set(STACK_DIRECTION -DSTACK_DIRECTION=-1)
|
||||
endif()
|
||||
file(GLOB third_party "${SOURCE_PATH}/extra/*" "${SOURCE_PATH}/include/boost_1_70_0")
|
||||
list(REMOVE_ITEM third_party "${SOURCE_PATH}/extra/libedit")
|
||||
file(REMOVE_RECURSE ${third_party})
|
||||
|
||||
#Skip the version check for Visual Studio
|
||||
set(FORCE_UNSUPPORTED_COMPILER "")
|
||||
@ -37,27 +27,56 @@ endif()
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS)
|
||||
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_CRT_LINKAGE)
|
||||
|
||||
set(cross_options "")
|
||||
if(VCPKG_CROSSCOMPILING)
|
||||
list(APPEND cross_options
|
||||
-DCMAKE_CROSSCOMPILING=1
|
||||
-DVCPKG_HOST_TRIPLET=${HOST_TRIPLET}
|
||||
# required, skip try_run
|
||||
-DHAVE_RAPIDJSON_WITH_STD_REGEX=1
|
||||
)
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
list(APPEND cross_options
|
||||
# optimistic, skip try_run
|
||||
-DHAVE_CLOCK_GETTIME=1
|
||||
-DHAVE_CLOCK_REALTIME=1
|
||||
# pessimistic, skip try_run
|
||||
-DHAVE_C_FLOATING_POINT_FUSED_MADD=1
|
||||
-DHAVE_CXX_FLOATING_POINT_FUSED_MADD=1
|
||||
-DHAVE_SETNS=0
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${cross_options}
|
||||
-DINSTALL_INCLUDEDIR=include/mysql
|
||||
-DINSTALL_DOCDIR=share/${PORT}/doc
|
||||
-DINSTALL_MANDIR=share/${PORT}/doc
|
||||
-DINSTALL_INFODIR=share/${PORT}/doc
|
||||
-DINSTALL_DOCREADMEDIR=share/${PORT}
|
||||
-DINSTALL_SHAREDIR=share
|
||||
-DINSTALL_MYSQLSHAREDIR=share/${PORT}
|
||||
-DWITHOUT_SERVER=ON
|
||||
-DWITH_BUILD_ID=OFF
|
||||
-DWITH_UNIT_TESTS=OFF
|
||||
-DENABLED_PROFILING=OFF
|
||||
-DENABLE_TESTING=OFF
|
||||
-DWIX_DIR=OFF
|
||||
${STACK_DIRECTION}
|
||||
-DIGNORE_BOOST_VERSION=ON
|
||||
-DWITH_SYSTEMD=OFF
|
||||
-DWITH_TEST_TRACE_PLUGIN=OFF
|
||||
-DMYSQL_MAINTAINER_MODE=OFF
|
||||
-DBUNDLE_RUNTIME_LIBRARIES=OFF
|
||||
-DDOWNLOAD_BOOST=OFF
|
||||
-DWITH_SSL=system
|
||||
-DWITH_ICU=system
|
||||
-DWITH_LIBEVENT=system
|
||||
-DWITH_CURL=none
|
||||
-DWITH_EDITLINE=bundled # not in vcpkg
|
||||
-DWITH_LZ4=system
|
||||
-DWITH_RAPIDJSON=system
|
||||
-DWITH_SSL=system
|
||||
-DWITH_SYSTEMD=OFF
|
||||
-DWITH_ZLIB=system
|
||||
-DWITH_ZSTD=system
|
||||
-DFORCE_UNSUPPORTED_COMPILER=${FORCE_UNSUPPORTED_COMPILER}
|
||||
-DINSTALL_STATIC_LIBRARIES=${BUILD_STATIC_LIBS}
|
||||
-DLINK_STATIC_RUNTIME_LIBRARIES=${STATIC_CRT_LINKAGE}
|
||||
@ -69,9 +88,10 @@ vcpkg_cmake_configure(
|
||||
)
|
||||
|
||||
vcpkg_cmake_install(ADD_BIN_TO_PATH)
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libmysql)
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
list(APPEND MYSQL_TOOLS
|
||||
comp_err
|
||||
set(MYSQL_TOOLS
|
||||
my_print_defaults
|
||||
mysql
|
||||
mysql_config_editor
|
||||
@ -90,7 +110,11 @@ list(APPEND MYSQL_TOOLS
|
||||
perror
|
||||
zlib_decompress
|
||||
)
|
||||
|
||||
if (NOT VCPKG_CROSSCOMPILING)
|
||||
list(APPEND MYSQL_TOOLS
|
||||
comp_err
|
||||
)
|
||||
endif()
|
||||
if (VCPKG_TARGET_IS_WINDOWS)
|
||||
list(APPEND MYSQL_TOOLS
|
||||
echo
|
||||
@ -103,72 +127,21 @@ endif()
|
||||
|
||||
vcpkg_copy_tools(TOOL_NAMES ${MYSQL_TOOLS} AUTO_CLEAN)
|
||||
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/share" "${CURRENT_PACKAGES_DIR}/${PORT}")
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/${PORT}" "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/${PORT}")
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/${PORT}" "${CURRENT_PACKAGES_DIR}/debug/share/${PORT}")
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libmysql CONFIG_PATH share/${PORT}/unofficial-libmysql)
|
||||
|
||||
# switch mysql into /mysql
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/include" "${CURRENT_PACKAGES_DIR}/include2")
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/include2" "${CURRENT_PACKAGES_DIR}/include/mysql")
|
||||
|
||||
## delete useless vcruntime/scripts/bin/msg file
|
||||
file(REMOVE_RECURSE
|
||||
"${CURRENT_PACKAGES_DIR}/debug/include"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/share"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/man"
|
||||
"${CURRENT_PACKAGES_DIR}/docs"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/docs"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/debug"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/plugin"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/lib/plugin"
|
||||
)
|
||||
|
||||
# delete dynamic dll on static build
|
||||
if (BUILD_STATIC_LIBS)
|
||||
# libmysql.dll
|
||||
file(REMOVE_RECURSE
|
||||
"${CURRENT_PACKAGES_DIR}/bin"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/bin"
|
||||
)
|
||||
file(REMOVE
|
||||
"${CURRENT_PACKAGES_DIR}/lib/libmysql.lib"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.lib"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.pdb"
|
||||
)
|
||||
endif()
|
||||
|
||||
## remove misc files
|
||||
file(REMOVE
|
||||
"${CURRENT_PACKAGES_DIR}/LICENSE"
|
||||
"${CURRENT_PACKAGES_DIR}/README"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/LICENSE"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/README"
|
||||
)
|
||||
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/mysql/mysql_com.h" "#include <mysql/udf_registration_types.h>" "#include \"mysql/udf_registration_types.h\"")
|
||||
if (NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
set(MYSQL_CONFIG_FILE "${CURRENT_PACKAGES_DIR}/tools/libmysql/mysql_config")
|
||||
vcpkg_replace_string(${MYSQL_CONFIG_FILE} "/bin/mysql_.*config" "/tools/libmysql/mysql_.*config") # try to get correct $basedir
|
||||
vcpkg_replace_string(${MYSQL_CONFIG_FILE} "${CURRENT_PACKAGES_DIR}" "$basedir") # use $basedir to format paths
|
||||
vcpkg_replace_string(${MYSQL_CONFIG_FILE} "-l\$\<\$\<CONFIG:DEBUG\>:${CURRENT_INSTALLED_DIR}/debug/lib/libz.a> " "") # remove debug version of libz
|
||||
vcpkg_replace_string(${MYSQL_CONFIG_FILE}
|
||||
"\$\<\$\<NOT:\$\<CONFIG:DEBUG\>\>:${CURRENT_INSTALLED_DIR}"
|
||||
"`dirname $0`/../../../../installed/${TARGET_TRIPLET}") # correct path for release version of libz
|
||||
vcpkg_replace_string(${MYSQL_CONFIG_FILE} "\> -l" " -l") # trailing > tag for previous item
|
||||
vcpkg_replace_string("${MYSQL_CONFIG_FILE}" "/bin/mysql_.*config" "/tools/libmysql/mysql_.*config")
|
||||
vcpkg_replace_string("${MYSQL_CONFIG_FILE}" "'${CURRENT_PACKAGES_DIR}" "\"\$basedir\"\'")
|
||||
endif()
|
||||
|
||||
file(INSTALL "${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
file(INSTALL "${CURRENT_PORT_DIR}/libmysql-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
||||
# copy license
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
set(libedit_copying "${SOURCE_PATH}/COPYING for libedit")
|
||||
file(COPY_FILE "${SOURCE_PATH}/extra/libedit/libedit-20210910-3.1/COPYING" "${libedit_copying}")
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE" "${libedit_copying}")
|
||||
|
@ -1,76 +0,0 @@
|
||||
diff --git a/cmake/icu.cmake b/cmake/icu.cmake
|
||||
index 3ac136dbfb4..c7bdbc8c47e 100644
|
||||
--- a/cmake/icu.cmake
|
||||
+++ b/cmake/icu.cmake
|
||||
@@ -68,6 +68,12 @@ ENDMACRO()
|
||||
# install_root is either 'system' or is assumed to be a path.
|
||||
#
|
||||
MACRO (FIND_ICU install_root)
|
||||
+ find_package(ICU REQUIRED COMPONENTS uc io dt in)
|
||||
+ set(ICU_SYSTEM_LIBRARIES ICU::uc ICU::io ICU::dt ICU::in)
|
||||
+ set(ICU_COMMON_DIR ${ICU_INCLUDE_DIR})
|
||||
+ SET(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
|
||||
+ENDMACRO()
|
||||
+MACRO (FIND_ICU_OLD install_root)
|
||||
IF("${install_root}" STREQUAL "system")
|
||||
SET(EXTRA_FIND_LIB_ARGS)
|
||||
SET(EXTRA_FIND_INC_ARGS)
|
||||
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
|
||||
index ae13a63dfdc..9604ad2fc2a 100644
|
||||
--- a/cmake/libutils.cmake
|
||||
+++ b/cmake/libutils.cmake
|
||||
@@ -441,19 +441,7 @@ MACRO(MERGE_CONVENIENCE_LIBRARIES TARGET_ARG)
|
||||
# On Windows, ssleay32.lib/libeay32.lib or libssl.lib/libcrypto.lib
|
||||
# must be merged into mysqlclient.lib
|
||||
IF(WIN32 AND ${TARGET} STREQUAL "mysqlclient")
|
||||
- SET(LINKER_EXTRA_FLAGS "")
|
||||
- FOREACH(LIB ${SSL_LIBRARIES})
|
||||
- STRING_APPEND(LINKER_EXTRA_FLAGS " ${LIB}")
|
||||
- ENDFOREACH()
|
||||
-
|
||||
- # __NULL_IMPORT_DESCRIPTOR already defined, second definition ignored
|
||||
- # Same symbol from both libssl and libcrypto
|
||||
- # But: Lib.exe has no /IGNORE option, see
|
||||
- # https://docs.microsoft.com/en-us/cpp/build/reference/running-lib?view=msvc-160
|
||||
- # STRING_APPEND(LINKER_EXTRA_FLAGS " /IGNORE:LNK4006")
|
||||
-
|
||||
- SET_TARGET_PROPERTIES(${TARGET}
|
||||
- PROPERTIES STATIC_LIBRARY_FLAGS "${LINKER_EXTRA_FLAGS}")
|
||||
+ TARGET_LINK_LIBRARIES(${TARGET} PRIVATE ${SSL_LIBRARIES})
|
||||
ENDIF()
|
||||
|
||||
IF(ARG_LINK_LIBRARIES)
|
||||
diff --git a/cmake/lz4.cmake b/cmake/lz4.cmake
|
||||
index e7047412f9b..ffbc95b578d 100644
|
||||
--- a/cmake/lz4.cmake
|
||||
+++ b/cmake/lz4.cmake
|
||||
@@ -46,7 +46,7 @@ MACRO (FIND_SYSTEM_LZ4)
|
||||
FIND_PATH(LZ4_INCLUDE_DIR
|
||||
NAMES lz4frame.h)
|
||||
FIND_LIBRARY(LZ4_SYSTEM_LIBRARY
|
||||
- NAMES lz4)
|
||||
+ NAMES lz4d lz4)
|
||||
IF (LZ4_INCLUDE_DIR AND LZ4_SYSTEM_LIBRARY)
|
||||
SET(SYSTEM_LZ4_FOUND 1)
|
||||
SET(LZ4_LIBRARY ${LZ4_SYSTEM_LIBRARY})
|
||||
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
|
||||
index 52feade..1e71bd7 100644
|
||||
--- a/cmake/ssl.cmake
|
||||
+++ b/cmake/ssl.cmake
|
||||
@@ -93,7 +93,16 @@ ENDMACRO()
|
||||
# Provides the following configure options:
|
||||
# WITH_SSL=[yes|system|<path/to/custom/installation>]
|
||||
MACRO (MYSQL_CHECK_SSL)
|
||||
+ find_package(OpenSSL REQUIRED)
|
||||
+ set(OPENSSL_LIBRARY OpenSSL::SSL CACHE STRING "")
|
||||
+ set(CRYPTO_LIBRARY OpenSSL::Crypto CACHE STRING "")
|
||||
+ FIND_PROGRAM(OPENSSL_EXECUTABLE openssl
|
||||
+ DOC "path to the openssl executable")
|
||||
+ SET(SSL_DEFINES "-DHAVE_OPENSSL")
|
||||
+ set(SSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
|
||||
+ENDMACRO()
|
||||
|
||||
+MACRO (MYSQL_CHECK_SSL_OLD)
|
||||
IF(NOT WITH_SSL)
|
||||
SET(WITH_SSL "system" CACHE STRING ${WITH_SSL_DOC_STRING} FORCE)
|
||||
ENDIF()
|
@ -1,4 +1,4 @@
|
||||
The package libmysql provides CMake targets:
|
||||
libmysql provides CMake targets:
|
||||
|
||||
find_package(libmysql REQUIRED)
|
||||
target_link_libraries(main PRIVATE ${MYSQL_LIBRARIES})
|
||||
find_package(unofficial-libmysql REQUIRED)
|
||||
target_link_libraries(main PRIVATE unofficial::libmysql::libmysql)
|
||||
|
@ -1,9 +0,0 @@
|
||||
find_package(unofficial-libmysql CONFIG REQUIRED)
|
||||
if (TARGET mysqlclient)
|
||||
set(MYSQL_LIBRARY mysqlclient)
|
||||
elseif (TARGET libmysql)
|
||||
set(MYSQL_LIBRARY libmysql)
|
||||
endif()
|
||||
|
||||
set(libmysql_FOUND 1)
|
||||
set(MYSQL_LIBRARIES ${MYSQL_LIBRARY})
|
@ -1,25 +1,27 @@
|
||||
{
|
||||
"name": "libmysql",
|
||||
"version": "8.0.32",
|
||||
"port-version": 6,
|
||||
"version": "8.0.34",
|
||||
"description": "A MySQL client library for C development",
|
||||
"homepage": "https://github.com/mysql/mysql-server",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"supports": "!(windows & x86) & !uwp & !xbox",
|
||||
"supports": "!android & !mingw & !uwp & !xbox",
|
||||
"dependencies": [
|
||||
"boost-algorithm",
|
||||
"boost-functional",
|
||||
"boost-geometry",
|
||||
"boost-graph",
|
||||
"boost-optional",
|
||||
"icu",
|
||||
"libevent",
|
||||
{
|
||||
"name": "libmysql",
|
||||
"host": true
|
||||
},
|
||||
"lz4",
|
||||
{
|
||||
"name": "ncurses",
|
||||
"platform": "!windows | mingw"
|
||||
},
|
||||
"openssl",
|
||||
"rapidjson",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
@ -28,6 +30,7 @@
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
},
|
||||
"zlib"
|
||||
"zlib",
|
||||
"zstd"
|
||||
]
|
||||
}
|
||||
|
@ -587,10 +587,6 @@ libmodman:x64-windows-static=fail
|
||||
libmpeg2:arm-neon-android=fail
|
||||
libmpeg2:arm64-android=fail
|
||||
libmpeg2:x64-android=fail
|
||||
libmysql:arm-neon-android=fail
|
||||
libmysql:arm64-android=fail
|
||||
libmysql:x64-android=fail
|
||||
libmysql:arm64-windows=fail
|
||||
libodb:x64-linux=fail # dynamic exception specifications
|
||||
libopensp:arm-neon-android=fail
|
||||
libopensp:arm64-android=fail
|
||||
|
@ -4513,8 +4513,8 @@
|
||||
"port-version": 1
|
||||
},
|
||||
"libmysql": {
|
||||
"baseline": "8.0.32",
|
||||
"port-version": 6
|
||||
"baseline": "8.0.34",
|
||||
"port-version": 0
|
||||
},
|
||||
"libnice": {
|
||||
"baseline": "0.1.21",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "91349aeb1e56c0b95d609361ae974a08abace26c",
|
||||
"version": "8.0.34",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "5696eb818512a5f9375068dc057c3e074de4bc3d",
|
||||
"version": "8.0.32",
|
||||
|
Loading…
Reference in New Issue
Block a user