From 586a03afa301f9fddb3c84be360a90dd8f0f91b9 Mon Sep 17 00:00:00 2001 From: Silver Zachara Date: Wed, 27 Oct 2021 08:45:32 +0200 Subject: [PATCH] [libmysql] Added limits include patch (#20947) * [libmysql] Added limits include patch Fixes numeric_limits is not a member of std build failure on GCC 11.2 in sql-common/sql_string.cc file. * Updated version database * Update portfile.cmake * Update versions/l-/libmysql.json Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> --- ports/libmysql/004-added-limits-include.patch | 12 ++++ ports/libmysql/portfile.cmake | 55 ++++++++++--------- ports/libmysql/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/l-/libmysql.json | 5 ++ 5 files changed, 47 insertions(+), 29 deletions(-) create mode 100644 ports/libmysql/004-added-limits-include.patch diff --git a/ports/libmysql/004-added-limits-include.patch b/ports/libmysql/004-added-limits-include.patch new file mode 100644 index 0000000000..d02641ad76 --- /dev/null +++ b/ports/libmysql/004-added-limits-include.patch @@ -0,0 +1,12 @@ +diff --git a/sql-common/sql_string.cc b/sql-common/sql_string.cc +index 40435729..8b6ee827 100644 +--- a/sql-common/sql_string.cc ++++ b/sql-common/sql_string.cc +@@ -23,6 +23,7 @@ + #include "sql_string.h" + + #include ++#include + + #include "my_dbug.h" + #include "my_macros.h" diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index aaffaffe5f..2a98b683dc 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -19,9 +19,10 @@ vcpkg_from_github( system-libs.patch rename-version.patch export-cmake-targets.patch + 004-added-limits-include.patch ) -file(REMOVE_RECURSE ${SOURCE_PATH}/include/boost_1_70_0) +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") @@ -37,7 +38,7 @@ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_CRT_LINKAGE) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH "${SOURCE_PATH}" PREFER_NINJA OPTIONS -DWITHOUT_SERVER=ON @@ -101,45 +102,45 @@ endif() vcpkg_copy_tools(TOOL_NAMES ${MYSQL_TOOLS} AUTO_CLEAN) -file(RENAME ${CURRENT_PACKAGES_DIR}/share ${CURRENT_PACKAGES_DIR}/libmysql) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/debug/libmysql) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/share) -file(RENAME ${CURRENT_PACKAGES_DIR}/libmysql ${CURRENT_PACKAGES_DIR}/share/libmysql) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/libmysql ${CURRENT_PACKAGES_DIR}/debug/share/libmysql) +file(RENAME "${CURRENT_PACKAGES_DIR}/share" "${CURRENT_PACKAGES_DIR}/libmysql") +file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/libmysql") +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share") +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/share") +file(RENAME "${CURRENT_PACKAGES_DIR}/libmysql" "${CURRENT_PACKAGES_DIR}/share/libmysql") +file(RENAME "${CURRENT_PACKAGES_DIR}/debug/libmysql" "${CURRENT_PACKAGES_DIR}/debug/share/libmysql") vcpkg_fixup_cmake_targets(CONFIG_PATH share/libmysql/unofficial-libmysql TARGET_PATH share/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) +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}/docs - ${CURRENT_PACKAGES_DIR}/debug/docs - ${CURRENT_PACKAGES_DIR}/lib/debug - ${CURRENT_PACKAGES_DIR}/lib/plugin - ${CURRENT_PACKAGES_DIR}/lib/plugin/debug + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/docs" + "${CURRENT_PACKAGES_DIR}/debug/docs" + "${CURRENT_PACKAGES_DIR}/lib/debug" + "${CURRENT_PACKAGES_DIR}/lib/plugin" + "${CURRENT_PACKAGES_DIR}/lib/plugin/debug" ) ## remove misc files file(REMOVE - ${CURRENT_PACKAGES_DIR}/LICENSE - ${CURRENT_PACKAGES_DIR}/README - ${CURRENT_PACKAGES_DIR}/debug/LICENSE - ${CURRENT_PACKAGES_DIR}/debug/README + "${CURRENT_PACKAGES_DIR}/LICENSE" + "${CURRENT_PACKAGES_DIR}/README" + "${CURRENT_PACKAGES_DIR}/debug/LICENSE" + "${CURRENT_PACKAGES_DIR}/debug/README" ) -file(READ ${CURRENT_PACKAGES_DIR}/include/mysql/mysql_com.h _contents) +file(READ "${CURRENT_PACKAGES_DIR}/include/mysql/mysql_com.h" _contents) string(REPLACE "#include " "#include \"mysql/udf_registration_types.h\"" _contents "${_contents}") -file(WRITE ${CURRENT_PACKAGES_DIR}/include/mysql/mysql_com.h "${_contents}") +file(WRITE "${CURRENT_PACKAGES_DIR}/include/mysql/mysql_com.h" "${_contents}") -file(INSTALL ${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(INSTALL ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(INSTALL "${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") # copy license -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/libmysql/vcpkg.json b/ports/libmysql/vcpkg.json index 225ec74956..cd230360b4 100644 --- a/ports/libmysql/vcpkg.json +++ b/ports/libmysql/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libmysql", "version": "8.0.20", - "port-version": 2, + "port-version": 3, "description": "A MySQL client library for C development", "homepage": "https://github.com/mysql/mysql-server", "supports": "!(windows & x86) & !uwp", diff --git a/versions/baseline.json b/versions/baseline.json index bc2cd41bfb..642f2f31cc 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3634,7 +3634,7 @@ }, "libmysql": { "baseline": "8.0.20", - "port-version": 2 + "port-version": 3 }, "libnice": { "baseline": "0.1.15", diff --git a/versions/l-/libmysql.json b/versions/l-/libmysql.json index 6ad4a2384e..f4cade8716 100644 --- a/versions/l-/libmysql.json +++ b/versions/l-/libmysql.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "9fccf9613dee83d48f9ba68a356a8db324224948", + "version": "8.0.20", + "port-version": 3 + }, { "git-tree": "55f99b850b59d83a2bc77a7a3980e96ccb67c875", "version": "8.0.20",