2017-10-26 02:51:21 +08:00
|
|
|
if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql/mysql.h")
|
2020-05-16 07:37:54 +08:00
|
|
|
message(FATAL_ERROR "FATAL ERROR: ${PORT} and libmariadb are incompatible.")
|
2017-10-26 02:51:21 +08:00
|
|
|
endif()
|
|
|
|
|
2018-03-03 04:28:34 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO mysql/mysql-server
|
2023-05-02 06:23:17 +08:00
|
|
|
REF mysql-${VERSION}
|
2024-08-10 17:16:37 +08:00
|
|
|
SHA512 80341fe6bf6738b30721933a31c8c3f033ce8342a3a2defeb83e29219375bff274620f6f21a02ee6f4e77f0d3a858a20487436a5afd0a95ea35b0523812c52ab
|
2018-03-03 04:28:34 +08:00
|
|
|
HEAD_REF master
|
2018-03-20 01:30:33 +08:00
|
|
|
PATCHES
|
2023-11-02 03:06:07 +08:00
|
|
|
dependencies.patch
|
|
|
|
install-exports.patch
|
2023-06-27 11:26:55 +08:00
|
|
|
fix_dup_symbols.patch
|
2023-11-02 03:06:07 +08:00
|
|
|
cross-build.patch
|
2024-07-26 04:17:21 +08:00
|
|
|
fix-pdb-install-path.patch
|
2017-10-26 02:51:21 +08:00
|
|
|
)
|
2024-01-05 09:41:17 +08:00
|
|
|
|
2024-08-10 17:16:37 +08:00
|
|
|
file(GLOB third_party "${SOURCE_PATH}/extra/*" "${SOURCE_PATH}/include/boost_1_*")
|
2023-11-02 03:06:07 +08:00
|
|
|
list(REMOVE_ITEM third_party "${SOURCE_PATH}/extra/libedit")
|
2024-01-05 09:41:17 +08:00
|
|
|
if (third_party)
|
|
|
|
file(REMOVE_RECURSE ${third_party})
|
|
|
|
endif()
|
2018-03-08 03:10:12 +08:00
|
|
|
|
2020-05-16 07:37:54 +08:00
|
|
|
#Skip the version check for Visual Studio
|
2022-07-23 05:38:57 +08:00
|
|
|
set(FORCE_UNSUPPORTED_COMPILER "")
|
2020-05-16 07:37:54 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
set(FORCE_UNSUPPORTED_COMPILER 1)
|
|
|
|
endif()
|
|
|
|
|
2020-11-11 01:28:45 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_CRT_LINKAGE)
|
|
|
|
|
2023-11-02 03:06:07 +08:00
|
|
|
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()
|
|
|
|
|
2021-11-23 07:51:13 +08:00
|
|
|
vcpkg_cmake_configure(
|
2021-10-27 14:45:32 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2017-10-26 02:51:21 +08:00
|
|
|
OPTIONS
|
2023-11-02 03:06:07 +08:00
|
|
|
${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}
|
2017-10-26 02:51:21 +08:00
|
|
|
-DWITHOUT_SERVER=ON
|
2023-04-14 03:25:58 +08:00
|
|
|
-DWITH_BUILD_ID=OFF
|
2017-10-26 02:51:21 +08:00
|
|
|
-DWITH_UNIT_TESTS=OFF
|
|
|
|
-DENABLED_PROFILING=OFF
|
|
|
|
-DWIX_DIR=OFF
|
2018-03-13 23:14:58 +08:00
|
|
|
-DIGNORE_BOOST_VERSION=ON
|
2020-11-11 01:28:45 +08:00
|
|
|
-DWITH_TEST_TRACE_PLUGIN=OFF
|
|
|
|
-DMYSQL_MAINTAINER_MODE=OFF
|
|
|
|
-DBUNDLE_RUNTIME_LIBRARIES=OFF
|
|
|
|
-DDOWNLOAD_BOOST=OFF
|
2024-08-10 17:16:37 +08:00
|
|
|
-DWITH_AUTHENTICATION_KERBEROS=OFF
|
|
|
|
-DWITH_AUTHENTICATION_LDAP_DEFAULT=OFF
|
2023-11-02 03:06:07 +08:00
|
|
|
-DWITH_CURL=none
|
|
|
|
-DWITH_EDITLINE=bundled # not in vcpkg
|
2018-03-20 01:30:33 +08:00
|
|
|
-DWITH_LZ4=system
|
2023-11-02 03:06:07 +08:00
|
|
|
-DWITH_RAPIDJSON=system
|
|
|
|
-DWITH_SSL=system
|
|
|
|
-DWITH_SYSTEMD=OFF
|
2018-03-20 01:30:33 +08:00
|
|
|
-DWITH_ZLIB=system
|
2023-11-02 03:06:07 +08:00
|
|
|
-DWITH_ZSTD=system
|
2020-05-16 07:37:54 +08:00
|
|
|
-DFORCE_UNSUPPORTED_COMPILER=${FORCE_UNSUPPORTED_COMPILER}
|
2020-11-11 01:28:45 +08:00
|
|
|
-DINSTALL_STATIC_LIBRARIES=${BUILD_STATIC_LIBS}
|
|
|
|
-DLINK_STATIC_RUNTIME_LIBRARIES=${STATIC_CRT_LINKAGE}
|
2023-03-20 14:41:57 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
BUNDLE_RUNTIME_LIBRARIES # only on windows
|
|
|
|
LINK_STATIC_RUNTIME_LIBRARIES # only on windows
|
|
|
|
WIX_DIR # only on windows
|
2023-05-02 06:23:17 +08:00
|
|
|
WITH_BUILD_ID # only on windows
|
2017-10-26 02:51:21 +08:00
|
|
|
)
|
|
|
|
|
2021-11-23 07:51:13 +08:00
|
|
|
vcpkg_cmake_install(ADD_BIN_TO_PATH)
|
2024-07-26 04:17:21 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2023-11-02 03:06:07 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libmysql)
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2017-10-26 02:51:21 +08:00
|
|
|
|
2023-11-02 03:06:07 +08:00
|
|
|
set(MYSQL_TOOLS
|
2020-11-11 01:28:45 +08:00
|
|
|
my_print_defaults
|
|
|
|
mysql
|
|
|
|
mysql_config_editor
|
2023-04-11 10:26:08 +08:00
|
|
|
mysql_migrate_keyring
|
2020-11-11 01:28:45 +08:00
|
|
|
mysql_secure_installation
|
|
|
|
mysql_ssl_rsa_setup
|
|
|
|
mysqladmin
|
|
|
|
mysqlbinlog
|
|
|
|
mysqlcheck
|
|
|
|
mysqldump
|
|
|
|
mysqlimport
|
|
|
|
mysqlpump
|
|
|
|
mysqlshow
|
|
|
|
mysqlslap
|
|
|
|
mysqltest
|
|
|
|
perror
|
|
|
|
zlib_decompress
|
|
|
|
)
|
2023-11-02 03:06:07 +08:00
|
|
|
if (NOT VCPKG_CROSSCOMPILING)
|
|
|
|
list(APPEND MYSQL_TOOLS
|
|
|
|
comp_err
|
|
|
|
)
|
|
|
|
endif()
|
2020-11-11 01:28:45 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
list(APPEND MYSQL_TOOLS
|
|
|
|
echo
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
list(APPEND MYSQL_TOOLS
|
|
|
|
mysql_config
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES ${MYSQL_TOOLS} AUTO_CLEAN)
|
|
|
|
|
2017-10-26 02:51:21 +08:00
|
|
|
file(REMOVE_RECURSE
|
2021-10-27 14:45:32 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/lib/debug"
|
2020-11-11 01:28:45 +08:00
|
|
|
)
|
2017-10-26 02:51:21 +08:00
|
|
|
|
2021-11-23 07:51:13 +08:00
|
|
|
if (NOT VCPKG_TARGET_IS_WINDOWS)
|
2023-04-11 10:26:08 +08:00
|
|
|
set(MYSQL_CONFIG_FILE "${CURRENT_PACKAGES_DIR}/tools/libmysql/mysql_config")
|
2023-11-02 03:06:07 +08:00
|
|
|
vcpkg_replace_string("${MYSQL_CONFIG_FILE}" "/bin/mysql_.*config" "/tools/libmysql/mysql_.*config")
|
|
|
|
vcpkg_replace_string("${MYSQL_CONFIG_FILE}" "'${CURRENT_PACKAGES_DIR}" "\"\$basedir\"\'")
|
2021-11-23 07:51:13 +08:00
|
|
|
endif()
|
2018-03-20 04:17:59 +08:00
|
|
|
|
2023-11-02 03:06:07 +08:00
|
|
|
file(INSTALL "${CURRENT_PORT_DIR}/libmysql-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2021-10-27 14:45:32 +08:00
|
|
|
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2020-11-11 01:28:45 +08:00
|
|
|
|
2023-11-02 03:06:07 +08:00
|
|
|
set(libedit_copying "${SOURCE_PATH}/COPYING for libedit")
|
2024-08-10 17:16:37 +08:00
|
|
|
file(GLOB libedit_copying_infile "${SOURCE_PATH}/extra/libedit/libedit-*/COPYING")
|
|
|
|
file(COPY_FILE "${libedit_copying_infile}" "${libedit_copying}")
|
2023-11-02 03:06:07 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE" "${libedit_copying}")
|