2018-03-14 18:18:12 +08:00
|
|
|
if (EXISTS "${CURRENT_INSTALLED_DIR}/share/libmysql")
|
|
|
|
message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.")
|
2017-01-25 10:25:38 +08:00
|
|
|
endif()
|
|
|
|
|
2021-11-18 07:33:26 +08:00
|
|
|
if("openssl" IN_LIST FEATURES AND "schannel" IN_LIST FEATURES)
|
|
|
|
message(FATAL_ERROR "Only one SSL backend must be selected.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if("schannel" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
message(FATAL_ERROR "Feature schannel not supported on non-Windows platforms.")
|
|
|
|
endif()
|
|
|
|
|
2018-03-14 18:18:12 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2021-04-03 03:46:30 +08:00
|
|
|
REPO mariadb-corporation/mariadb-connector-c
|
2021-11-18 07:33:26 +08:00
|
|
|
REF b2bb1b213c79169b7c994a99f21f47f11be465d4 # v3.1.15
|
|
|
|
SHA512 51ebd2e9fd505eebc7691c60fe0b86cfc5368f8b370fba6c3ec8f5514319ef1e0de4910ad5e093cd7d5e5c7782120e22e8c85c94af9389fa4e240cedf012d755
|
2020-10-21 02:01:40 +08:00
|
|
|
HEAD_REF 3.1
|
2019-05-24 12:44:54 +08:00
|
|
|
PATCHES
|
2021-01-20 08:00:17 +08:00
|
|
|
arm64.patch
|
2020-10-16 03:32:58 +08:00
|
|
|
md.patch
|
|
|
|
disable-test-build.patch
|
|
|
|
fix-InstallPath.patch
|
2020-10-21 02:01:40 +08:00
|
|
|
fix-iconv.patch
|
2020-11-11 01:28:45 +08:00
|
|
|
export-cmake-targets.patch
|
2021-11-18 07:33:26 +08:00
|
|
|
pkgconfig.patch
|
|
|
|
no-extra-static-lib.patch
|
|
|
|
fix-openssl.patch
|
2017-01-20 17:06:11 +08:00
|
|
|
)
|
|
|
|
|
2020-08-06 05:03:22 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-04-03 03:46:30 +08:00
|
|
|
FEATURES
|
|
|
|
iconv WITH_ICONV
|
2021-11-18 07:33:26 +08:00
|
|
|
mariadbclient VCPKG_MARIADBCLIENT
|
2020-08-06 05:03:22 +08:00
|
|
|
)
|
|
|
|
|
2020-10-27 12:00:50 +08:00
|
|
|
if("openssl" IN_LIST FEATURES)
|
2021-07-23 07:19:26 +08:00
|
|
|
set(WITH_SSL OPENSSL)
|
2021-11-18 07:33:26 +08:00
|
|
|
elseif("schannel" IN_LIST FEATURES)
|
|
|
|
set(WITH_SSL ON)
|
2020-10-27 12:00:50 +08:00
|
|
|
else()
|
2021-07-23 07:19:26 +08:00
|
|
|
set(WITH_SSL OFF)
|
2020-10-27 12:00:50 +08:00
|
|
|
endif()
|
|
|
|
|
2021-11-18 07:33:26 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2018-03-14 18:18:12 +08:00
|
|
|
OPTIONS
|
2020-08-06 05:03:22 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2021-11-18 07:33:26 +08:00
|
|
|
-DINSTALL_INCLUDEDIR=include/mysql # legacy port decisiong
|
|
|
|
-DINSTALL_LIBDIR=lib
|
|
|
|
-DINSTALL_PLUGINDIR=plugins/${PORT}
|
2021-07-23 07:19:26 +08:00
|
|
|
-DWITH_UNIT_TESTS=OFF
|
2018-03-14 18:18:12 +08:00
|
|
|
-DWITH_CURL=OFF
|
2021-11-18 07:33:26 +08:00
|
|
|
-DWITH_EXTERNAL_ZLIB=ON
|
2020-10-27 12:00:50 +08:00
|
|
|
-DWITH_SSL=${WITH_SSL}
|
2021-11-18 07:33:26 +08:00
|
|
|
-DREMOTEIO_PLUGIN_TYPE=OFF
|
|
|
|
-DAUTH_GSSAPI_PLUGIN_TYPE=OFF
|
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
AUTH_GSSAPI_PLUGIN_TYPE
|
2017-01-20 17:06:11 +08:00
|
|
|
)
|
|
|
|
|
2021-11-18 07:33:26 +08:00
|
|
|
vcpkg_cmake_install()
|
2018-10-13 06:12:15 +08:00
|
|
|
|
2021-11-18 07:33:26 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libmariadb)
|
2017-01-20 17:06:11 +08:00
|
|
|
|
2021-11-18 07:33:26 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libmariadb.pc" " -lmariadb" " -llibmariadb")
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libmariadb.pc" " -lmariadb" " -llibmariadb")
|
|
|
|
endif()
|
2021-07-23 07:19:26 +08:00
|
|
|
endif()
|
2021-11-18 07:33:26 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-07-23 07:19:26 +08:00
|
|
|
|
2021-11-18 07:33:26 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2017-01-20 17:06:11 +08:00
|
|
|
|
2020-10-21 02:01:40 +08:00
|
|
|
# copy license file
|
2021-11-18 07:33:26 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING.LIB" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|