Skip to content

Commit

Permalink
mariadb-connector-c: add v3.3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Dec 26, 2023
1 parent 6c7ceb6 commit edcaa4f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 166 deletions.
19 changes: 7 additions & 12 deletions recipes/mariadb-connector-c/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"3.3.8":
url: "https://downloads.mariadb.com/Connectors/c/connector-c-3.3.8/mariadb-connector-c-3.3.8-src.tar.gz"
sha256: "f9f076b4aa9fb22cc94b24f82c80f9ef063805ecd6533a2eb5d5060cf93833e8"
"3.3.3":
url: "https://downloads.mariadb.com/Connectors/c/connector-c-3.3.3/mariadb-connector-c-3.3.3-src.tar.gz"
sha256: "d77630e2376fe08185b5354621c877b0a203a6b186a0694574d37b764aeb2874"
Expand All @@ -12,16 +15,11 @@ sources:
url: "https://downloads.mariadb.com/Connectors/c/connector-c-3.1.11/mariadb-connector-c-3.1.11-src.tar.gz"
sha256: "3e6f6c399493fe90efdc21a3fe70c30434b7480e8195642a959f1dd7a0fa5b0f"
patches:
"3.3.8":
- patch_file: "patches/3.1.11-0004-include-mysqld_error-header.patch"
patch_description: "always include mysqld_error.h"
patch_type: "portability"
"3.3.3":
- patch_file: "patches/3.3.3-0002-find-package-zstd.patch"
patch_description: "Use ZSTD cmake file from Conan"
patch_type: "conan"
- patch_file: "patches/3.3.3-0001-fix-install-and-static-or-shared.patch"
patch_description: "fix install path, separate static/shared build"
patch_type: "conan"
- patch_file: "patches/3.1.19-0002-remove-wx-flag.patch"
patch_description: "remove WX flags in MSVC"
patch_type: "conan"
- patch_file: "patches/3.1.11-0003-include-order-windows-winsock2.patch"
patch_description: "fix include order for windows winsock2"
patch_type: "portability"
Expand All @@ -32,9 +30,6 @@ patches:
- patch_file: "patches/3.1.19-0001-fix-install-and-static-or-shared.patch"
patch_description: "fix install path, separate static/shared build"
patch_type: "conan"
- patch_file: "patches/3.1.19-0002-remove-wx-flag.patch"
patch_description: "remove WX flags in MSVC"
patch_type: "conan"
- patch_file: "patches/3.1.11-0003-include-order-windows-winsock2.patch"
patch_description: "fix include order for windows winsock2"
patch_type: "portability"
Expand Down
19 changes: 18 additions & 1 deletion recipes/mariadb-connector-c/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def generate(self):
tc.variables["INSTALL_BINDIR"] = "bin"
tc.variables["INSTALL_LIBDIR"] = "lib"
tc.variables["INSTALL_PLUGINDIR"] = os.path.join("lib", "plugin").replace("\\", "/")
tc.variables["ZLIB_LIBRARY"] = "ZLIB::ZLIB"
# To install relocatable shared libs on Macos
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW"
tc.generate()
Expand All @@ -104,7 +105,7 @@ def _patch_sources(self):
apply_conandata_patches(self)

root_cmake = os.path.join(self.source_folder, "CMakeLists.txt")
replace_in_file(self, root_cmake, "${ZLIB_LIBRARY}", "${ZLIB_LIBRARIES}")
libmariadb_cmake = os.path.join(self.source_folder, "libmariadb", "CMakeLists.txt")
replace_in_file(self,
root_cmake,
"SET(SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})",
Expand All @@ -113,6 +114,16 @@ def _patch_sources(self):
replace_in_file(self, root_cmake, "${CURL_LIBRARIES}", "CURL::libcurl")
plugins_io_cmake = os.path.join(self.source_folder, "plugins", "io", "CMakeLists.txt")
replace_in_file(self, plugins_io_cmake, "${CURL_LIBRARIES}", "CURL::libcurl")
replace_in_file(self, root_cmake, " -WX", "", strict=False)
if Version(self.version) >= "3.3":
replace_in_file(self, root_cmake,
"INCLUDE(${CC_SOURCE_DIR}/cmake/FindZStd.cmake)",
"find_package(ZSTD REQUIRED CONFIG)")
replace_in_file(self, libmariadb_cmake,
"DESTINATION ${INSTALL_LIBDIR}",
"RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib")
replace_in_file(self, libmariadb_cmake, " NAMELINK_SKIP", "")
replace_in_file(self, libmariadb_cmake, " NAMELINK_ONLY", "")

def build(self):
self._patch_sources()
Expand All @@ -128,6 +139,12 @@ def package(self):
rmdir(self, os.path.join(self.package_folder, "symbols"))
rmdir(self, os.path.join(self.package_folder, "man"))
rm(self, "*.pdb", os.path.join(self.package_folder, "lib"))
if self.options.shared:
rm(self, "*.a", os.path.join(self.package_folder, "lib"))
else:
rm(self, "*.dll", os.path.join(self.package_folder, "bin"))
rm(self, "*.lib", os.path.join(self.package_folder, "lib"))
rm(self, "*.dylib", os.path.join(self.package_folder, "lib"))

def package_info(self):
self.cpp_info.set_property("pkg_config_name", "libmariadb")
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions recipes/mariadb-connector-c/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"3.3.8":
folder: all
"3.3.3":
folder: all
"3.1.19":
Expand Down

0 comments on commit edcaa4f

Please sign in to comment.