2022-08-04 02:58:02 +08:00
|
|
|
if(EXISTS "${CURRENT_INSTALLED_DIR}/share/libmysql")
|
2018-03-14 18:18:12 +08:00
|
|
|
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()
|
|
|
|
|
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
|
2022-08-12 09:51:38 +08:00
|
|
|
REF 5e94e7c27ffad7e76665b1333a67975316b9c3c2 # v3.3.1
|
|
|
|
SHA512 0f740f88f64037990bf9d4593574b147ee02adb1fbbeb03c0dec745f0ee27d7cf03417dd09546ab70e16b4465622b8567864dbb243de0a3a7ffaebe313f7c231
|
|
|
|
HEAD_REF 3.3
|
2019-05-24 12:44:54 +08:00
|
|
|
PATCHES
|
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
|
2021-11-18 07:33:26 +08:00
|
|
|
pkgconfig.patch
|
|
|
|
fix-openssl.patch
|
2022-09-13 04:50:09 +08:00
|
|
|
fix-CMakeLists.patch
|
2022-10-09 12:38:15 +08:00
|
|
|
zstd.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
|
2022-08-04 02:58:02 +08:00
|
|
|
FEATURES
|
2022-09-13 04:50:09 +08:00
|
|
|
iconv WITH_ICONV
|
|
|
|
mariadbclient VCPKG_MARIADBCLIENT
|
2022-10-09 12:38:15 +08:00
|
|
|
zstd WITH_ZSTD
|
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}
|
2022-08-04 02:58:02 +08:00
|
|
|
-DINSTALL_INCLUDEDIR=include/mysql # legacy port decisiong
|
2021-11-18 07:33:26 +08:00
|
|
|
-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
|
2022-10-09 12:38:15 +08:00
|
|
|
-DWITH_ZSTD=${WITH_ZSTD}
|
2021-11-18 07:33:26 +08:00
|
|
|
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()
|
2022-08-04 02:58:02 +08:00
|
|
|
|
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
|
|
|
|
2021-11-18 07:33:26 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING.LIB" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|