From 6a282bf0c70f66e3b9cb120627d028b6e17a0556 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 14 May 2019 06:48:04 +0000 Subject: [PATCH 1/3] [libmysql]Fix build error in linux. --- ports/libmysql/CONTROL | 2 +- ports/libmysql/linux_libmysql.patch | 18 ++++++++++++++++++ ports/libmysql/portfile.cmake | 13 +++++++------ 3 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 ports/libmysql/linux_libmysql.patch diff --git a/ports/libmysql/CONTROL b/ports/libmysql/CONTROL index 007718af75abe5..a6f97e1fe2ee27 100644 --- a/ports/libmysql/CONTROL +++ b/ports/libmysql/CONTROL @@ -1,4 +1,4 @@ Source: libmysql -Version: 8.0.4-3 +Version: 8.0.4-4 Build-Depends: boost-algorithm, boost-geometry, boost-optional, boost-functional, boost-graph, openssl, icu, libevent, liblzma, lz4, zlib Description: A MySQL client library for C development. diff --git a/ports/libmysql/linux_libmysql.patch b/ports/libmysql/linux_libmysql.patch new file mode 100644 index 00000000000000..42dfa73d8d5782 --- /dev/null +++ b/ports/libmysql/linux_libmysql.patch @@ -0,0 +1,18 @@ +diff --git a/configure.cmake b/configure.cmake +index 1f3d8e2..9e45f48 100644 +--- a/configure.cmake ++++ b/configure.cmake +@@ -456,7 +456,11 @@ IF(NOT HAVE_FCNTL_NONBLOCK) + ENDIF() + + IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC) +- STRING(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} processor) ++ IF(${CMAKE_SYSTEM_PROCESSOR}) ++ STRING(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} processor) ++ ELSE() ++ STRING(TOLOWER ${CMAKE_HOST_SYSTEM_PROCESSOR} processor) ++ ENDIF() + IF(processor MATCHES "86" OR processor MATCHES "amd64" OR processor MATCHES "x64") + IF(NOT CMAKE_SYSTEM_NAME MATCHES "SunOS") + # The loader in some Solaris versions has a bug due to which it refuses to + diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index dfd38c41c0158c..f0655b6f691b18 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -10,6 +10,10 @@ if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND NOT CMAKE_SYSTEM_NAME OR CMAKE_S message(FATAL_ERROR "Oracle has dropped support in libmysql for 32-bit Windows.") endif() +if (UNIX) + message(WARNING "libmysql needs ncurses on LINUX, please install nucrses first. On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.") +endif() + include(vcpkg_common_functions) vcpkg_from_github( @@ -18,13 +22,10 @@ vcpkg_from_github( REF mysql-8.0.4 SHA512 8d9129e7670e88df14238299052a5fe6d4f3e40bf27ef7a3ca8f4f91fb40507b13463e9bd24435b34e5d06c5d056dfb259fb04e77cc251b188eea734db5642be HEAD_REF master -) - -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} PATCHES - ${CMAKE_CURRENT_LIST_DIR}/ignore-boost-version.patch - ${CMAKE_CURRENT_LIST_DIR}/system-libs.patch + ignore-boost-version.patch + system-libs.patch + linux_libmysql.patch ) file(REMOVE_RECURSE ${SOURCE_PATH}/include/boost_1_65_0) From 2f42313facef18ae28ea290c559a0d7c703a7bdb Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Tue, 14 May 2019 12:19:19 -0700 Subject: [PATCH 2/3] [libmysql] Fix typo in prerequisites message --- ports/libmysql/portfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index f0655b6f691b18..344865f5389250 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -10,8 +10,8 @@ if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND NOT CMAKE_SYSTEM_NAME OR CMAKE_S message(FATAL_ERROR "Oracle has dropped support in libmysql for 32-bit Windows.") endif() -if (UNIX) - message(WARNING "libmysql needs ncurses on LINUX, please install nucrses first. On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.") +if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") + message(WARNING "libmysql needs ncurses on LINUX, please install ncurses first.\nOn Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.") endif() include(vcpkg_common_functions) @@ -101,13 +101,13 @@ else() ${CURRENT_PACKAGES_DIR}/lib/mysqlclient.lib ${CURRENT_PACKAGES_DIR}/debug/lib/mysqlclient.lib) - # correct the dll directory + # correct the dll directory if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/bin/libmysql.dll) file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/bin/libmysql.pdb) endif() - + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.dll) From a9ed1f7bfe1cbb45429ec6b4369dc606ef4b5508 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 3 Jun 2019 17:49:52 -0700 Subject: [PATCH 3/3] [libmysql]Re-trigger CI system. --- ports/libmysql/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index 344865f5389250..e179ca714a59a0 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -121,4 +121,4 @@ file(WRITE ${CURRENT_PACKAGES_DIR}/include/mysql/mysql_com.h "${_contents}") # copy license file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmysql) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmysql/LICENSE ${CURRENT_PACKAGES_DIR}/share/libmysql/copyright) \ No newline at end of file +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmysql/LICENSE ${CURRENT_PACKAGES_DIR}/share/libmysql/copyright)