Skip to content

mongo-cxx-driver: add version 3.7.0, update boost #14924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 36 additions & 10 deletions recipes/mongo-cxx-driver/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,52 @@
sources:
"3.7.0":
url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.7.0/mongo-cxx-driver-r3.7.0.tar.gz"
sha256: "fb2da11178db728f63147fe4b0c7509eb49b1b02c5cb55f9bee5f927e451a0c7"
"3.6.7":
url: "https://github.com/mongodb/mongo-cxx-driver/archive/debian/3.6.7-1.tar.gz"
sha256: "62a0a16e4a35289e1692f60cf07a7f6957485446b7bc1d82306b731ad6763fb9"
"3.6.6":
url: "https://github.com/mongodb/mongo-cxx-driver/archive/r3.6.6.tar.gz"
sha256: "f989c371800458ae45ef69f6d9566e010f9420435a01bf5eb14db77fc024662e"
url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.6/mongo-cxx-driver-r3.6.6.tar.gz"
sha256: "d5906b9e308a8a353a2ef92b699c9b27ae28ec6b34fdda94e15d2981b27e64ca"
"3.6.2":
url: "https://github.com/mongodb/mongo-cxx-driver/archive/r3.6.2.tar.gz"
sha256: "f50a1acb98a473f0850e2766dc7e84c05415dc63b1a2f851b77b12629ac14d62"
url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.2/mongo-cxx-driver-r3.6.2.tar.gz"
sha256: "24325dce74723f7632da76d0eeb5f5020828498cc5bc1a624c6d7117efb2b7cf"
"3.6.1":
url: https://github.com/mongodb/mongo-cxx-driver/archive/r3.6.1.tar.gz
sha256: c6d1b307f7b074d178c4a815d8739195fb4d7870701064bdad6f1f2360ae0af9
url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.1/mongo-cxx-driver-r3.6.1.tar.gz"
sha256: "83523e897ef18f7ce05d85d1632dd4ba486c264a1b89c09020163ab29e11eab7"
patches:
"3.7.0":
- patch_file: "patches/3.7.0-dirs.patch"
patch_description: "disable documentation features, fix directories"
patch_type: "conan"
- patch_file: "patches/poly_use_std_define.patch"
patch_description: "use poly macro instead __cplusplus"
patch_type: "portability"
"3.6.7":
- patch_file: "patches/dirs_and_tests.patch"
- patch_file: "patches/3.6.x-dirs_and_tests.patch"
patch_description: "disable test and documentation features, fix directories"
patch_type: "conan"
- patch_file: "patches/poly_use_std_define.patch"
patch_description: "use poly macro instead __cplusplus"
patch_type: "portability"
"3.6.6":
- patch_file: "patches/dirs_and_tests.patch"
- patch_file: "patches/3.6.x-dirs_and_tests.patch"
patch_description: "disable test and documentation features, fix directories"
patch_type: "conan"
- patch_file: "patches/poly_use_std_define.patch"
patch_description: "use poly macro instead __cplusplus"
patch_type: "portability"
"3.6.2":
- patch_file: "patches/dirs_and_tests.patch"
- patch_file: "patches/3.6.x-dirs_and_tests.patch"
patch_description: "disable test and documentation features, fix directories"
patch_type: "conan"
- patch_file: "patches/poly_use_std_define.patch"
patch_description: "use poly macro instead __cplusplus"
patch_type: "portability"
"3.6.1":
- patch_file: "patches/dirs_and_tests.patch"
- patch_file: "patches/3.6.x-dirs_and_tests.patch"
patch_description: "disable test and documentation features, fix directories"
patch_type: "conan"
- patch_file: "patches/poly_use_std_define.patch"
patch_description: "use poly macro instead __cplusplus"
patch_type: "portability"
12 changes: 6 additions & 6 deletions recipes/mongo-cxx-driver/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from conan.errors import ConanException, ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd, valid_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, get, rm, rmdir
from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get, rm, rmdir
from conan.tools.scm import Version
import os
import shutil
Expand Down Expand Up @@ -33,21 +33,20 @@ class MongoCxxConan(ConanFile):
}

def export_sources(self):
for p in self.conan_data.get("patches", {}).get(self.version, []):
copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder)
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.options.shared:
del self.options.fPIC
self.options.rm_safe("fPIC")

def requirements(self):
self.requires("mongo-c-driver/1.22.0")
self.requires("mongo-c-driver/1.23.2")
if self.options.polyfill == "boost":
self.requires("boost/1.79.0")
self.requires("boost/1.81.0")

@property
def _minimal_std_version(self):
Expand Down Expand Up @@ -130,6 +129,7 @@ def generate(self):
tc.variables["MONGOCXX_ENABLE_SSL"] = self.options.with_ssl
if not valid_min_cppstd(self, self._minimal_std_version):
tc.variables["CMAKE_CXX_STANDARD"] = self._minimal_std_version
tc.variables["ENABLE_TESTS"] = False
# Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840)
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"
tc.generate()
Expand Down
80 changes: 80 additions & 0 deletions recipes/mongo-cxx-driver/all/patches/3.7.0-dirs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 20254fa..d7dc7c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -206,6 +206,7 @@ set (BUILD_SOURCE_DIR ${CMAKE_BINARY_DIR})

include (MakeDistFiles)

+if(FALSE)
add_custom_target(hugo_dir
COMMAND ${CMAKE_COMMAND} -E make_directory hugo
)
@@ -261,6 +262,7 @@ add_custom_target(format-lint
add_custom_target(docs
DEPENDS hugo doxygen-current
)
+endif()

set(THIRD_PARTY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party)

@@ -270,6 +272,9 @@ if (ENABLE_TESTS)
enable_testing()
endif ()

+set(MONGO_CXX_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(MONGO_CXX_PROJECT_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR})
+
add_subdirectory(src)

add_subdirectory(examples EXCLUDE_FROM_ALL)
@@ -281,6 +286,7 @@ add_subdirectory(benchmark EXCLUDE_FROM_ALL)
# CMake does not implement anything like 'dist' from autotools.
# This implementation is based on the one in GnuCash.

+if(FALSE)
add_subdirectory (cmake)
add_subdirectory (data)
add_subdirectory (docs)
@@ -381,4 +387,4 @@ endif ()
if (CMAKE_GENERATOR_TOOLSET)
message (STATUS "\tinstance: ${CMAKE_GENERATOR_TOOLSET}")
endif ()
-
+endif()
diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt
index d87d588..1aefd91 100644
--- a/src/bsoncxx/CMakeLists.txt
+++ b/src/bsoncxx/CMakeLists.txt
@@ -71,7 +71,7 @@ set(BSONCXX_VERSION_NO_EXTRA ${BSONCXX_VERSION_MAJOR}.${BSONCXX_VERSION_MINOR}.$
set(BSONCXX_VERSION ${BSONCXX_VERSION_NO_EXTRA}${BSONCXX_VERSION_EXTRA})
message ("bsoncxx version: ${BSONCXX_VERSION}")
set(BSONCXX_INLINE_NAMESPACE "v${BSONCXX_ABI_VERSION}")
-set(BSONCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/bsoncxx/${BSONCXX_INLINE_NAMESPACE}" CACHE INTERNAL "")
+set(BSONCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}" CACHE INTERNAL "")

set(LIBBSON_REQUIRED_VERSION 1.13.0)
set(LIBBSON_REQUIRED_ABI_VERSION 1.0)
@@ -94,7 +94,8 @@ if(TARGET bson_shared OR TARGET bson_static)
endif()
else()
# Attempt to find libbson by new package name (without lib).
- find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} ${LIBBSON_REQUIRED_VERSION} QUIET)
+ find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} REQUIRED)
+ set(bson-${LIBBSON_REQUIRED_ABI_VERSION}_FOUND TRUE)

if(bson-${LIBBSON_REQUIRED_ABI_VERSION}_FOUND)
message ("found libbson version ${bson-${LIBBSON_REQUIRED_ABI_VERSION}_VERSION}")
diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt
index 7106040..3be4b83 100644
--- a/src/mongocxx/CMakeLists.txt
+++ b/src/mongocxx/CMakeLists.txt
@@ -27,7 +27,7 @@ set(MONGOCXX_VERSION_NO_EXTRA ${MONGOCXX_VERSION_MAJOR}.${MONGOCXX_VERSION_MINOR
set(MONGOCXX_VERSION ${MONGOCXX_VERSION_NO_EXTRA}${MONGOCXX_VERSION_EXTRA})
message ("mongocxx version: ${MONGOCXX_VERSION}")
set(MONGOCXX_INLINE_NAMESPACE "v${MONGOCXX_ABI_VERSION}")
-set(MONGOCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/mongocxx/${MONGOCXX_INLINE_NAMESPACE}" CACHE INTERNAL "")
+set(MONGOCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/" CACHE INTERNAL "")

set(LIBMONGOC_REQUIRED_VERSION 1.19.0)
set(LIBMONGOC_REQUIRED_ABI_VERSION 1.0)
21 changes: 3 additions & 18 deletions recipes/mongo-cxx-driver/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
cmake_minimum_required(VERSION 3.8)
project(test_package LANGUAGES CXX)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(mongocxx REQUIRED CONFIG)

add_executable(${PROJECT_NAME} ../test_package/test_package.cpp)

if(${MONGO-CXX-DRIVER_POLYFILL} STREQUAL "std")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
elseif(${MONGO-CXX-DRIVER_POLYFILL} STREQUAL "experimental")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
else()
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
endif()

if(TARGET mongo::mongocxx_shared)
target_link_libraries(${PROJECT_NAME} PRIVATE mongo::mongocxx_shared mongo::bsoncxx_shared)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE mongo::mongocxx_static mongo::bsoncxx_static)
endif()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/
${CMAKE_CURRENT_BINARY_DIR}/test_package/)
2 changes: 2 additions & 0 deletions recipes/mongo-cxx-driver/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"3.7.0":
folder: all
"3.6.7":
folder: all
"3.6.6":
Expand Down