diff --git a/abseil/all/abi_trick/abi.h.in b/abseil/all/abi_trick/abi.h.in new file mode 100644 index 0000000..ea1ab39 --- /dev/null +++ b/abseil/all/abi_trick/abi.h.in @@ -0,0 +1,5 @@ +#cmakedefine01 USE_STD_STRING_VIEW +#cmakedefine01 USE_STD_ANY +#cmakedefine01 USE_STD_OPTIONAL +#cmakedefine01 USE_STD_VARIANT + diff --git a/abseil/all/abi_trick/conan_abi_test.cmake b/abseil/all/abi_trick/conan_abi_test.cmake new file mode 100644 index 0000000..cebf60c --- /dev/null +++ b/abseil/all/abi_trick/conan_abi_test.cmake @@ -0,0 +1,44 @@ +get_target_property(ABSL_INCLUDES absl::config INTERFACE_INCLUDE_DIRECTORIES) +set(CMAKE_REQUIRED_INCLUDES ${ABSL_INCLUDES}) + +check_cxx_source_compiles(" +#include \"absl/base/config.h\" +#if defined(ABSL_HAVE_STD_STRING_VIEW) && ABSL_HAVE_STD_STRING_VIEW == 1 +int main() {} +#else +#error \"no std::string_view\" +#endif +" +USE_STD_STRING_VIEW) + +check_cxx_source_compiles(" +#include \"absl/base/config.h\" +#if defined(ABSL_HAVE_STD_ANY) && ABSL_HAVE_STD_ANY == 1 +int main() {} +#else +#error \"no std::any\" +#endif +" +USE_STD_ANY) + +check_cxx_source_compiles(" +#include \"absl/base/config.h\" +#if defined(ABSL_HAVE_STD_OPTIONAL) && ABSL_HAVE_STD_OPTIONAL == 1 +int main() {} +#else +#error \"no std::optional\" +#endif +" +USE_STD_OPTIONAL) + +check_cxx_source_compiles(" +#include \"absl/base/config.h\" +#if defined(ABSL_HAVE_STD_VARIANT) && ABSL_HAVE_STD_VARIANT == 1 +int main() {} +#else +#error \"no std::variant\" +#endif +" +USE_STD_VARIANT) + +configure_file(${CMAKE_CURRENT_LIST_DIR}/abi.h.in ${PROJECT_BINARY_DIR}/abi.h) diff --git a/abseil/all/conandata.yml b/abseil/all/conandata.yml new file mode 100644 index 0000000..b213e4b --- /dev/null +++ b/abseil/all/conandata.yml @@ -0,0 +1,71 @@ +sources: + "20240116.2": + url: "https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz" + sha256: "733726b8c3a6d39a4120d7e45ea8b41a434cdacde401cba500f14236c49b39dc" + "20240116.1": + url: "https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz" + sha256: "3c743204df78366ad2eaf236d6631d83f6bc928d1705dd0000b872e53b73dc6a" + "20230802.1": + url: "https://github.com/abseil/abseil-cpp/archive/20230802.1.tar.gz" + sha256: "987ce98f02eefbaf930d6e38ab16aa05737234d7afbab2d5c4ea7adbe50c28ed" + "20230125.3": + url: "https://github.com/abseil/abseil-cpp/archive/20230125.3.tar.gz" + sha256: "5366D7E7FA7BA0D915014D387B66D0D002C03236448E1BA9EF98122C13B35C36" + "20220623.1": + url: "https://github.com/abseil/abseil-cpp/archive/20220623.1.tar.gz" + sha256: "91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8" + "20211102.0": + url: "https://github.com/abseil/abseil-cpp/archive/20211102.0.tar.gz" + sha256: "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4" +patches: + "20240116.2": + - patch_file: "patches/0003-absl-string-libm-20240116.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/issues/1100" + - patch_file: "patches/20240116.1-0001-fix-filesystem-include.patch" + patch_description: "Fix GCC 7 including in C++17 mode when it is not available (until GCC 8)" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303" + - patch_file: "patches/0004-test-allocator-testonly.patch" + patch_description: "Do not build test_allocator target when tests are disabled" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5" + "20240116.1": + - patch_file: "patches/0003-absl-string-libm-20240116.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/issues/1100" + - patch_file: "patches/20240116.1-0001-fix-filesystem-include.patch" + patch_description: "Fix GCC 7 including in C++17 mode when it is not available (until GCC 8)" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303" + - patch_file: "patches/0004-test-allocator-testonly.patch" + patch_description: "Do not build test_allocator target when tests are disabled" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5" + "20230802.1": + - patch_file: "patches/0003-absl-string-libm-20230802.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/issues/1100" + - patch_file: "patches/20230802.1-0001-fix-mingw.patch" + patch_description: "Fix build with MinGW" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/2f77684e8dc473a48dbc19167ffe69c40ce8ada4" + "20230125.3": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + "20220623.1": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + - patch_file: "patches/0005-has-unique-object-representations.patch" + patch_description: "Workaround bug in GCC 7.2" + patch_source: "https://github.com/abseil/abseil-cpp/pull/1250" + patch_type: "portability" + "20211102.0": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" diff --git a/abseil/all/conanfile.py b/abseil/all/conanfile.py new file mode 100644 index 0000000..6c10812 --- /dev/null +++ b/abseil/all/conanfile.py @@ -0,0 +1,266 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get, load, replace_in_file, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import json +import os +import re +import textwrap + +required_conan_version = ">=1.53.0" + +class AbseilConan(ConanFile): + name = "abseil" + description = "Abseil Common Libraries (C++) from Google" + topics = ("algorithm", "container", "google", "common", "utility") + homepage = "https://github.com/abseil/abseil-cpp" + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + short_paths = True + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "20230125.0" else "14" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + copy(self, "abi_trick/*", 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: + self.options.rm_safe("fPIC") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.options.shared and is_msvc(self) and Version(self.version) < "20230802.1": + # upstream tries its best to export symbols, but it's broken for the moment + raise ConanInvalidConfiguration(f"{self.ref} shared not availabe for Visual Studio, please use version 20230802.1 or newer") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ABSL_ENABLE_INSTALL"] = True + tc.variables["ABSL_PROPAGATE_CXX_STD"] = True + tc.variables["BUILD_TESTING"] = False + # We force CMP0067 policy to NEW for our abi trick in _patch_sources() + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0067"] = "NEW" + if is_msvc(self): + # see https://github.com/abseil/abseil-cpp/issues/649 + tc.preprocessor_definitions["_HAS_DEPRECATED_RESULT_OF"] = 1 + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # In case of cross-build, set CMAKE_SYSTEM_PROCESSOR if not set by toolchain or user + if cross_building(self): + toolchain_file = os.path.join(self.generators_folder, "conan_toolchain.cmake") + cmake_system_processor_block = textwrap.dedent(""" + if(NOT CMAKE_SYSTEM_PROCESSOR) + set(CMAKE_SYSTEM_PROCESSOR {}) + endif() + """.format(str(self.settings.arch))) + save(self, toolchain_file, cmake_system_processor_block, append=True) + + # Trick to capture ABI + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + abi_trick_block = textwrap.dedent("""\ + list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../abi_trick") + include(conan_abi_test) + """) + save(self, cmakelists, abi_trick_block, append=True) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + abi_file = _ABIFile(self, os.path.join(self.build_folder, "abi.h")) + abi_file.replace_in_options_file(os.path.join(self.source_folder, "absl", "base", "options.h")) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # Load components hierarchy before removing CMake files generated by abseil installation + cmake_folder = os.path.join(self.package_folder, "lib", "cmake") + absl_targets_file = os.path.join(cmake_folder, "absl", "abslTargets.cmake") + components = self._load_components_from_cmake_target_file(absl_targets_file) + rmdir(self, cmake_folder) + + # Create a json helper file in order to populate package_info() at consume time + self._create_components_file(self._components_helper_filepath, components) + + # Create a build-module that will propagate the required cxx_std to consumers of this recipe's targets + # TODO: Revisit with feedback from https://github.com/conan-io/conan/issues/10281 + self._create_cxx_std_module_file(self._cxx_std_module_filepath, components) + + def _load_components_from_cmake_target_file(self, absl_target_file_path): + components = {} + + abs_target_content = load(self, absl_target_file_path) + + # Replace the line endings to support building with MSys2 on Windows + abs_target_content = abs_target_content.replace("\r\n", "\n") + + cmake_functions = re.findall(r"(?Padd_library|set_target_properties)[\n|\s]*\([\n|\s]*(?P[^)]*)\)", abs_target_content) + for (cmake_function_name, cmake_function_args) in cmake_functions: + cmake_function_args = re.split(r"[\s|\n]+", cmake_function_args, maxsplit=2) + + cmake_imported_target_name = cmake_function_args[0] + cmake_target_nonamespace = cmake_imported_target_name.replace("absl::", "") + potential_lib_name = "absl_" + cmake_target_nonamespace + + components.setdefault(potential_lib_name, {"cmake_target": cmake_target_nonamespace}) + + if cmake_function_name == "add_library": + cmake_imported_target_type = cmake_function_args[1] + if cmake_imported_target_type in ["STATIC", "SHARED"]: + components[potential_lib_name]["libs"] = [potential_lib_name] if cmake_target_nonamespace != "abseil_dll" else ['abseil_dll'] + elif cmake_function_name == "set_target_properties": + target_properties = re.findall(r"(?PINTERFACE_COMPILE_DEFINITIONS|INTERFACE_INCLUDE_DIRECTORIES|INTERFACE_LINK_LIBRARIES)[\n|\s]+(?P.+)", cmake_function_args[2]) + for target_property in target_properties: + property_type = target_property[0] + if property_type == "INTERFACE_LINK_LIBRARIES": + values_list = target_property[1].replace('"', "").split(";") + for dependency in values_list: + if dependency.startswith("absl::"): # abseil targets + components[potential_lib_name].setdefault("requires", []).append(dependency.replace("absl::", "absl_")) + else: # system libs or frameworks + if self.settings.os in ["Linux", "FreeBSD"]: + if dependency == "Threads::Threads": + components[potential_lib_name].setdefault("system_libs", []).append("pthread") + elif "-lm" in dependency: + components[potential_lib_name].setdefault("system_libs", []).append("m") + elif "-lrt" in dependency: + components[potential_lib_name].setdefault("system_libs", []).append("rt") + elif self.settings.os == "Windows": + for system_lib in ["bcrypt", "advapi32", "dbghelp"]: + if system_lib in dependency: + components[potential_lib_name].setdefault("system_libs", []).append(system_lib) + elif is_apple_os(self): + for framework in ["CoreFoundation"]: + if framework in dependency: + components[potential_lib_name].setdefault("frameworks", []).append(framework) + elif property_type == "INTERFACE_COMPILE_DEFINITIONS": + values_list = target_property[1].replace('"', "").split(";") + for definition in values_list: + if definition == r"\$<\$:_LINUX_SOURCE_COMPAT>": + if self.settings.os == "AIX": + components[potential_lib_name].setdefault("defines", []).append("_LINUX_SOURCE_COMPAT") + else: + components[potential_lib_name].setdefault("defines", []).append(definition) + + return components + + def _create_components_file(self, output_file, components): + content = json.dumps(components, indent=4) + save(self, output_file, content) + + @property + def _components_helper_filepath(self): + return os.path.join(self.package_folder, "lib", "components.json") + + def _create_cxx_std_module_file(self, output_file, components): + content = "" + cxx_std_required = _ABIFile(self, os.path.join(self.build_folder, "abi.h")).cxx_std() + for _, values in components.items(): + cmake_target = values["cmake_target"] + content += f"target_compile_features(absl::{cmake_target} INTERFACE cxx_std_{cxx_std_required})\n" + save(self, output_file, content) + + @property + def _cxx_std_module_filepath(self): + return os.path.join(self.package_folder, "lib", "cmake", "conan_trick", "cxx_std.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "absl") + + components_json_file = load(self, self._components_helper_filepath) + abseil_components = json.loads(components_json_file) + for pkgconfig_name, values in abseil_components.items(): + cmake_target = values["cmake_target"] + self.cpp_info.components[pkgconfig_name].set_property("cmake_target_name", "absl::{}".format(cmake_target)) + self.cpp_info.components[pkgconfig_name].set_property("pkg_config_name", pkgconfig_name) + self.cpp_info.components[pkgconfig_name].libs = values.get("libs", []) + self.cpp_info.components[pkgconfig_name].defines = values.get("defines", []) + self.cpp_info.components[pkgconfig_name].system_libs = values.get("system_libs", []) + self.cpp_info.components[pkgconfig_name].frameworks = values.get("frameworks", []) + self.cpp_info.components[pkgconfig_name].requires = values.get("requires", []) + + self.cpp_info.components[pkgconfig_name].names["cmake_find_package"] = cmake_target + self.cpp_info.components[pkgconfig_name].names["cmake_find_package_multi"] = cmake_target + + self.cpp_info.names["cmake_find_package"] = "absl" + self.cpp_info.names["cmake_find_package_multi"] = "absl" + + self.cpp_info.set_property("cmake_build_modules", [self._cxx_std_module_filepath]) + self.cpp_info.components["absl_config"].build_modules["cmake_find_package"] = [self._cxx_std_module_filepath] + self.cpp_info.components["absl_config"].build_modules["cmake_find_package_multi"] = [self._cxx_std_module_filepath] + + +class _ABIFile: + abi = {} + + def __init__(self, conanfile, filepath): + self.conanfile = conanfile + abi_h = load(self.conanfile, filepath) + for line in abi_h.splitlines(): + if line.startswith("#define"): + tokens = line.split() + if len(tokens) == 3: + self.abi[tokens[1]] = tokens[2] + + def replace_in_options_file(self, options_filepath): + for name, value in self.abi.items(): + replace_in_file(self.conanfile, options_filepath, + "#define ABSL_OPTION_{} 2".format(name), + "#define ABSL_OPTION_{} {}".format(name, value)) + + def cxx_std(self): + return 17 if any([v == "1" for k, v in self.abi.items()]) else 11 diff --git a/abseil/all/patches/0003-absl-string-libm-20230802.patch b/abseil/all/patches/0003-absl-string-libm-20230802.patch new file mode 100644 index 0000000..22d29ac --- /dev/null +++ b/abseil/all/patches/0003-absl-string-libm-20230802.patch @@ -0,0 +1,15 @@ +--- a/absl/strings/CMakeLists.txt ++++ b/absl/strings/CMakeLists.txt +@@ -31,9 +31,12 @@ + PUBLIC + ) + ++find_library(LIBM m) + absl_cc_library( + NAME + strings ++ LINKOPTS ++ $<$:-lm> + HDRS + "ascii.h" + "charconv.h" diff --git a/abseil/all/patches/0003-absl-string-libm-20240116.patch b/abseil/all/patches/0003-absl-string-libm-20240116.patch new file mode 100644 index 0000000..640ce8d --- /dev/null +++ b/abseil/all/patches/0003-absl-string-libm-20240116.patch @@ -0,0 +1,15 @@ +--- a/absl/strings/CMakeLists.txt ++++ b/absl/strings/CMakeLists.txt +@@ -32,9 +32,12 @@ + PUBLIC + ) + ++find_library(LIBM m) + absl_cc_library( + NAME + strings ++ LINKOPTS ++ $<$:-lm> + HDRS + "ascii.h" + "charconv.h" diff --git a/abseil/all/patches/0003-absl-string-libm.patch b/abseil/all/patches/0003-absl-string-libm.patch new file mode 100644 index 0000000..8c69d42 --- /dev/null +++ b/abseil/all/patches/0003-absl-string-libm.patch @@ -0,0 +1,15 @@ +--- a/absl/strings/CMakeLists.txt ++++ b/absl/strings/CMakeLists.txt +@@ -14,9 +14,12 @@ + # limitations under the License. + # + ++find_library(LIBM m) + absl_cc_library( + NAME + strings ++ LINKOPTS ++ $<$:-lm> + HDRS + "ascii.h" + "charconv.h" diff --git a/abseil/all/patches/0004-test-allocator-testonly.patch b/abseil/all/patches/0004-test-allocator-testonly.patch new file mode 100644 index 0000000..909c1f7 --- /dev/null +++ b/abseil/all/patches/0004-test-allocator-testonly.patch @@ -0,0 +1,10 @@ +--- a/absl/container/CMakeLists.txt ++++ b/absl/container/CMakeLists.txt +@@ -213,6 +213,7 @@ absl_cc_library( + DEPS + absl::config + GTest::gmock ++ TESTONLY + ) + + absl_cc_test( diff --git a/abseil/all/patches/0005-has-unique-object-representations.patch b/abseil/all/patches/0005-has-unique-object-representations.patch new file mode 100644 index 0000000..2a8dffe --- /dev/null +++ b/abseil/all/patches/0005-has-unique-object-representations.patch @@ -0,0 +1,11 @@ +--- a/absl/hash/internal/hash.h 2022-06-24 06:22:47.000000000 +1200 ++++ b/absl/hash/internal/hash.h 2022-07-28 17:00:02.241173356 +1200 +@@ -444,7 +444,7 @@ + // On other platforms, we assume that pointers-to-members do not have + // padding. + #ifdef __cpp_lib_has_unique_object_representations +- static_assert(std::has_unique_object_representations_v); ++ static_assert(std::has_unique_object_representations::value); + #endif // __cpp_lib_has_unique_object_representations + return n; + #endif diff --git a/abseil/all/patches/20230802.1-0001-fix-mingw.patch b/abseil/all/patches/20230802.1-0001-fix-mingw.patch new file mode 100644 index 0000000..fcb5987 --- /dev/null +++ b/abseil/all/patches/20230802.1-0001-fix-mingw.patch @@ -0,0 +1,40 @@ +--- a/absl/synchronization/internal/pthread_waiter.h ++++ b/absl/synchronization/internal/pthread_waiter.h +@@ -16,7 +16,7 @@ + #ifndef ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_ + #define ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_ + +-#ifndef _WIN32 ++#if !defined(_WIN32) && !defined(__MINGW32__) + #include + + #include "absl/base/config.h" +@@ -55,6 +55,6 @@ class PthreadWaiter : public WaiterCrtp { + ABSL_NAMESPACE_END + } // namespace absl + +-#endif // ndef _WIN32 ++#endif // !defined(_WIN32) && !defined(__MINGW32__) + + #endif // ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_ +--- a/absl/synchronization/internal/win32_waiter.h ++++ b/absl/synchronization/internal/win32_waiter.h +@@ -20,7 +20,8 @@ + #include + #endif + +-#if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA ++#if defined(_WIN32) && !defined(__MINGW32__) && \ ++ _WIN32_WINNT >= _WIN32_WINNT_VISTA + + #include "absl/base/config.h" + #include "absl/synchronization/internal/kernel_timeout.h" +@@ -65,6 +66,7 @@ class Win32Waiter : public WaiterCrtp { + ABSL_NAMESPACE_END + } // namespace absl + +-#endif // defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA ++#endif // defined(_WIN32) && !defined(__MINGW32__) && ++ // _WIN32_WINNT >= _WIN32_WINNT_VISTA + + #endif // ABSL_SYNCHRONIZATION_INTERNAL_WIN32_WAITER_H_ diff --git a/abseil/all/patches/20240116.1-0001-fix-filesystem-include.patch b/abseil/all/patches/20240116.1-0001-fix-filesystem-include.patch new file mode 100644 index 0000000..f29ce61 --- /dev/null +++ b/abseil/all/patches/20240116.1-0001-fix-filesystem-include.patch @@ -0,0 +1,53 @@ +From bb83aceacb554e79e7cd2404856f0be30bd00303 Mon Sep 17 00:00:00 2001 +From: Derek Mauro +Date: Tue, 12 Mar 2024 08:33:40 -0700 +Subject: [PATCH] Fix GCC7 C++17 build + +GCC did not support until GCC8. + +Fixes #1635 + +PiperOrigin-RevId: 615051227 +Change-Id: If7cd5802ead40805b1ff1c3bdfc10ba6d2858ef0 +--- + absl/hash/hash_test.cc | 2 +- + absl/hash/internal/hash.h | 12 ++++++++++-- + 2 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h +index f4a94f9129f..b7d89b01807 100644 +--- a/absl/hash/internal/hash.h ++++ b/absl/hash/internal/hash.h +@@ -24,6 +24,15 @@ + #include + #endif + ++#include "absl/base/config.h" ++ ++// For feature testing and determining which headers can be included. ++#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L ++#include ++#else ++#include ++#endif ++ + #include + #include + #include +@@ -47,7 +56,6 @@ + #include + #include + +-#include "absl/base/config.h" + #include "absl/base/internal/unaligned_access.h" + #include "absl/base/port.h" + #include "absl/container/fixed_array.h" +@@ -61,7 +69,7 @@ + #include "absl/types/variant.h" + #include "absl/utility/utility.h" + +-#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L && \ ++#if defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703L && \ + !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) + #include // NOLINT + #endif diff --git a/abseil/all/test_package/CMakeLists.txt b/abseil/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..ee593a5 --- /dev/null +++ b/abseil/all/test_package/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(absl REQUIRED CONFIG) + +# Test components +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE absl::strings absl::flat_hash_map absl::flat_hash_set absl::int128 absl::time) +# Abseil now requires at least C++14 since 20230125.0 +if(absl_VERSION VERSION_LESS "20230125.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() + +if(cxx_std_14 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + add_executable(${PROJECT_NAME}_14 test_package.cpp) + target_link_libraries(${PROJECT_NAME}_14 PRIVATE absl::strings absl::flat_hash_map absl::flat_hash_set absl::int128 absl::time) + target_compile_features(${PROJECT_NAME}_14 PRIVATE cxx_std_14) +endif() +if(cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + add_executable(${PROJECT_NAME}_17 test_package.cpp) + target_link_libraries(${PROJECT_NAME}_17 PRIVATE absl::strings absl::flat_hash_map absl::flat_hash_set absl::int128 absl::time) + target_compile_features(${PROJECT_NAME}_17 PRIVATE cxx_std_17) +endif() +# old abseil used std::result_of (which was removed in C++20) https://github.com/abseil/abseil-cpp/issues/649 +if(CXX20_SUPPORTED) + if(cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + add_executable(${PROJECT_NAME}_20 test_package.cpp) + target_link_libraries(${PROJECT_NAME}_20 PRIVATE absl::strings absl::flat_hash_map absl::flat_hash_set absl::int128 absl::time) + target_compile_features(${PROJECT_NAME}_20 PRIVATE cxx_std_20) + endif() + if(cxx_std_23 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + add_executable(${PROJECT_NAME}_23 test_package.cpp) + target_link_libraries(${PROJECT_NAME}_23 PRIVATE absl::strings absl::flat_hash_map absl::flat_hash_set absl::int128 absl::time) + target_compile_features(${PROJECT_NAME}_23 PRIVATE cxx_std_23) + endif() +endif() + +# Test also (unofficial) global target +add_executable(${PROJECT_NAME}_global test_package.cpp) +if(TARGET abseil::abseil) + target_link_libraries(${PROJECT_NAME}_global PRIVATE abseil::abseil) +else() + target_link_libraries(${PROJECT_NAME}_global PRIVATE absl::absl) +endif() +# Abseil now requires at least C++14 since 20230125.0 +if(absl_VERSION VERSION_LESS "20230125.0") + target_compile_features(${PROJECT_NAME}_global PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME}_global PRIVATE cxx_std_14) +endif() diff --git a/abseil/all/test_package/conanfile.py b/abseil/all/test_package/conanfile.py new file mode 100644 index 0000000..eab050e --- /dev/null +++ b/abseil/all/test_package/conanfile.py @@ -0,0 +1,33 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CXX20_SUPPORTED"] = Version(self.dependencies["abseil"].ref.version) > "20210324.2" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(f"{bin_path} -s", env="conanrun") + bin_global_path = os.path.join(self.cpp.build.bindirs[0], "test_package_global") + self.run(f"{bin_global_path} -s", env="conanrun") diff --git a/abseil/all/test_package/test_package.cpp b/abseil/all/test_package/test_package.cpp new file mode 100644 index 0000000..b3813a8 --- /dev/null +++ b/abseil/all/test_package/test_package.cpp @@ -0,0 +1,56 @@ +#include +#include +#include +#include + +#include "absl/strings/str_cat.h" +#include "absl/strings/str_split.h" +#include "absl/container/flat_hash_map.h" +#include "absl/container/flat_hash_set.h" +#include "absl/numeric/int128.h" +#include "absl/time/time.h" +#include "absl/types/variant.h" + +int main() +{ + absl::flat_hash_set set1; + absl::flat_hash_map map1; + absl::flat_hash_set set2 = { + {"huey"}, + {"dewey"}, + {"louie"}, + }; + absl::flat_hash_map map2 = { + {1, "huey"}, + {2, "dewey"}, + {3, "louie"}, + }; + absl::flat_hash_set set3(set2); + absl::flat_hash_map map3(map2); + + absl::flat_hash_set set4; + set4 = set3; + absl::flat_hash_map map4; + map4 = map3; + + absl::flat_hash_set set5(std::move(set4)); + absl::flat_hash_map map5(std::move(map4)); + absl::flat_hash_set set6; + set6 = std::move(set5); + absl::flat_hash_map map6; + map6 = std::move(map5); + + const absl::uint128 big = absl::Uint128Max(); + std::cout << absl::StrCat("Arg ", "foo", "\n"); + std::vector v = absl::StrSplit("a,b,,c", ','); + + absl::Time t1 = absl::Now(); + absl::Time t2 = absl::Time(); + absl::Time t3 = absl::UnixEpoch(); + + absl::variant v1 = absl::variant(); + absl::bad_variant_access e1; + + std::string const year = absl::FormatTime("%Y", absl::Now(), absl::UTCTimeZone()); + std::cout << "year " << year << std::endl; +} diff --git a/aws-c-common/all/test_v1_package/CMakeLists.txt b/abseil/all/test_v1_package/CMakeLists.txt similarity index 100% rename from aws-c-common/all/test_v1_package/CMakeLists.txt rename to abseil/all/test_v1_package/CMakeLists.txt diff --git a/abseil/all/test_v1_package/conanfile.py b/abseil/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..5c87f55 --- /dev/null +++ b/abseil/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["CXX20_SUPPORTED"] = tools.Version(self.deps_cpp_info["abseil"].version) > "20210324.2" + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(f"{bin_path} -s", run_environment=True) + bin_global_path = os.path.join("bin", "test_package_global") + self.run(f"{bin_global_path} -s", run_environment=True) diff --git a/abseil/config.yml b/abseil/config.yml new file mode 100644 index 0000000..0af2b7b --- /dev/null +++ b/abseil/config.yml @@ -0,0 +1,13 @@ +versions: + "20240116.2": + folder: all + "20240116.1": + folder: all + "20230802.1": + folder: all + "20230125.3": + folder: all + "20220623.1": + folder: all + "20211102.0": + folder: all diff --git a/arrow/all/conan_cmake_project_include.cmake b/arrow/all/conan_cmake_project_include.cmake new file mode 100644 index 0000000..1bf900d --- /dev/null +++ b/arrow/all/conan_cmake_project_include.cmake @@ -0,0 +1,13 @@ +if(ARROW_S3) + find_package(AWSSDK REQUIRED) + # Fix issue where scripts expect a variable called "AWSSDK_LINK_LIBRARIES" + # which is not defined by the generated AWSSDKConfig.cmake + if(NOT DEFINED AWSSDK_LINK_LIBRARIES) + set(AWSSDK_LINK_LIBRARIES "${AWSSDK_LIBRARIES}") + endif() + + # Causes logic used for generated .pc file to not run + # avoiding instropection of target `aws-cpp-sdk::aws-cpp-sdk` + # This is fine because the generated .pc file is not of use + set(AWSSDK_SOURCE "conan") +endif() diff --git a/arrow/all/conandata.yml b/arrow/all/conandata.yml index a37674d..aa96940 100644 --- a/arrow/all/conandata.yml +++ b/arrow/all/conandata.yml @@ -1,67 +1,71 @@ sources: - '12.0.0-dev1': - url: 'https://github.com/jiaoew1991/arrow/archive/refs/tags/v12.0.0-dev1.tar.gz' - sha256: '2f3532cf16dd0984b7961f0784502e7d16bda8e7b1790eb816b168a63c32fc77' - '10.0.1': - url: 'https://www.apache.org/dyn/closer.lua/arrow/arrow-10.0.1/apache-arrow-10.0.1.tar.gz?action=download' - sha256: 'c814e0670112a22c1a6ec03ab420a52ae236a9a42e9e438c3cbd37f37e658fb3' - '10.0.0': - url: 'https://www.apache.org/dyn/closer.lua/arrow/arrow-10.0.0/apache-arrow-10.0.0.tar.gz?action=download' - sha256: '5b46fa4c54f53e5df0019fe0f9d421e93fc906b625ebe8e89eed010d561f1f12' - '8.0.1': - url: 'https://www.apache.org/dyn/closer.lua/arrow/arrow-8.0.1/apache-arrow-8.0.1.tar.gz?action=download' - sha256: '82d46929f7574715551da21700f100b39f99c3c4d6790f26cac86d869d64e94e' - '8.0.0': - url: 'https://www.apache.org/dyn/closer.lua/arrow/arrow-8.0.0/apache-arrow-8.0.0.tar.gz?action=download' - sha256: 'ad9a05705117c989c116bae9ac70492fe015050e1b80fb0e38fde4b5d863aaa3' - '7.0.0': - url: 'https://www.apache.org/dyn/closer.lua/arrow/arrow-7.0.0/apache-arrow-7.0.0.tar.gz?action=download' - sha256: 'e8f49b149a15ecef4e40fcfab1b87c113c6b1ee186005c169e5cdf95d31a99de' - '2.0.0': - url: 'https://www.apache.org/dyn/closer.lua/arrow/arrow-2.0.0/apache-arrow-2.0.0.tar.gz?action=download' - sha256: 'be0342cc847bb340d86aeaef43596a0b6c1dbf1ede9c789a503d939e01c71fbe' - '1.0.0': - url: 'https://www.apache.org/dyn/closer.lua/arrow/arrow-1.0.0/apache-arrow-1.0.0.tar.gz?action=download' - sha256: '86ddb9feb48203a5aaf9cc4f2827525e20a2ca4d7239e492af17e74532ccf243' + "17.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-17.0.0/apache-arrow-17.0.0.tar.gz?action=download" + sha256: "9d280d8042e7cf526f8c28d170d93bfab65e50f94569f6a790982a878d8d898d" + "16.1.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-16.1.0/apache-arrow-16.1.0.tar.gz?action=download" + sha256: "c9e60c7e87e59383d21b20dc874b17153729ee153264af6d21654b7dff2c60d7" + "16.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-16.0.0/apache-arrow-16.0.0.tar.gz?action=download" + sha256: "9f4051ae9473c97991d9af801e2f94ae3455067719ca7f90b8137f9e9a700b8d" + "15.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-15.0.0/apache-arrow-15.0.0.tar.gz?action=download" + sha256: "01dd3f70e85d9b5b933ec92c0db8a4ef504a5105f78d2d8622e84279fb45c25d" + "14.0.2": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-14.0.2/apache-arrow-14.0.2.tar.gz?action=download" + sha256: "1304dedb41896008b89fe0738c71a95d9b81752efc77fa70f264cb1da15d9bc2" + "14.0.1": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-14.0.1/apache-arrow-14.0.1.tar.gz?action=download" + sha256: "5c70eafb1011f9d124bafb328afe54f62cc5b9280b7080e1e3d668f78c0e407e" + "14.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-14.0.0/apache-arrow-14.0.0.tar.gz?action=download" + sha256: "4eb0da50ec071baf15fc163cb48058931e006f1c862c8def0e180fd07d531021" + "13.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-13.0.0/apache-arrow-13.0.0.tar.gz?action=download" + sha256: "35dfda191262a756be934eef8afee8d09762cad25021daa626eb249e251ac9e6" + "12.0.1": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-12.0.1/apache-arrow-12.0.1.tar.gz?action=download" + sha256: "3481c411393aa15c75e88d93cf8315faf7f43e180fe0790128d3840d417de858" + "12.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-12.0.0/apache-arrow-12.0.0.tar.gz?action=download" + sha256: "ddd8347882775e53af7d0965a1902b7d8fcd0a030fd14f783d4f85e821352d52" + "11.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-11.0.0/apache-arrow-11.0.0.tar.gz?action=download" + sha256: "2dd8f0ea0848a58785628ee3a57675548d509e17213a2f5d72b0d900b43f5430" + "10.0.1": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-10.0.1/apache-arrow-10.0.1.tar.gz?action=download" + sha256: "c814e0670112a22c1a6ec03ab420a52ae236a9a42e9e438c3cbd37f37e658fb3" + "10.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-10.0.0/apache-arrow-10.0.0.tar.gz?action=download" + sha256: "5b46fa4c54f53e5df0019fe0f9d421e93fc906b625ebe8e89eed010d561f1f12" + "8.0.1": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-8.0.1/apache-arrow-8.0.1.tar.gz?action=download" + sha256: "82d46929f7574715551da21700f100b39f99c3c4d6790f26cac86d869d64e94e" + "8.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-8.0.0/apache-arrow-8.0.0.tar.gz?action=download" + sha256: "ad9a05705117c989c116bae9ac70492fe015050e1b80fb0e38fde4b5d863aaa3" + "7.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-7.0.0/apache-arrow-7.0.0.tar.gz?action=download" + sha256: "e8f49b149a15ecef4e40fcfab1b87c113c6b1ee186005c169e5cdf95d31a99de" patches: - '8.0.1': - - patch_file: 'patches/8.0.0-0005-install-utils.patch' - patch_description: 'enable utilis installation' - patch_type: 'conan' - - patch_file: 'patches/8.0.0-0006-fix-cmake.patch' - patch_description: 'use cci package' - patch_type: 'conan' - '8.0.0': - - patch_file: 'patches/8.0.0-0005-install-utils.patch' - patch_description: 'enable utilis installation' - patch_type: 'conan' - - patch_file: 'patches/8.0.0-0006-fix-cmake.patch' - patch_description: 'use cci package' - patch_type: 'conan' - '7.0.0': - - patch_file: 'patches/7.0.0-0006-install-utils.patch' - patch_description: 'enable utilis installation' - patch_type: 'conan' - - patch_file: 'patches/7.0.0-0007-fix-cmake.patch' - patch_description: 'use cci package' - patch_type: 'conan' - '2.0.0': - - patch_file: 'patches/2.0.0-0003-fix-shared-msvc.patch' - patch_description: 'make shared enabled in msvc' - patch_type: 'official' - - patch_file: 'patches/2.0.0-0005-gandiva-engine.patch' - patch_description: 'fix grandiva compilation error' - patch_type: 'official' - - patch_file: 'patches/2.0.0-0008-fix-cmake.patch' - patch_description: 'use cci package' - patch_type: 'conan' - '1.0.0': - - patch_file: 'patches/1.0.0-0003-fix-shared-msvc.patch' - patch_description: 'make shared enabled in msvc' - patch_type: 'official' - - patch_file: 'patches/1.0.0-0005-fix-make12-namespace.patch' - patch_description: 'fix ambiguous `make12` function between std and date' - patch_type: 'official' - - patch_file: 'patches/1.0.0-0006-fix-cmake.patch' - patch_description: 'use cci package' - patch_type: 'conan' + "8.0.1": + - patch_file: "patches/8.0.0-0005-install-utils.patch" + patch_description: "enable utils installation" + patch_type: "conan" + - patch_file: "patches/8.0.0-0006-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + "8.0.0": + - patch_file: "patches/8.0.0-0005-install-utils.patch" + patch_description: "enable utils installation" + patch_type: "conan" + - patch_file: "patches/8.0.0-0006-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + "7.0.0": + - patch_file: "patches/7.0.0-0006-install-utils.patch" + patch_description: "enable utils installation" + patch_type: "conan" + - patch_file: "patches/7.0.0-0007-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" diff --git a/arrow/all/conanfile.py b/arrow/all/conanfile.py index ca66927..8080af2 100644 --- a/arrow/all/conanfile.py +++ b/arrow/all/conanfile.py @@ -1,84 +1,58 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc_static_runtime, is_msvc, check_min_vs -from conan.tools.files import ( - export_conandata_patches, - apply_conandata_patches, - get, - copy, - rmdir, -) +from conan.errors import ConanInvalidConfiguration, ConanException from conan.tools.build import check_min_cppstd, cross_building -from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os import glob +import textwrap required_conan_version = ">=1.53.0" - class ArrowConan(ConanFile): name = "arrow" - description = ( - "Apache Arrow is a cross-language development platform for in-memory data" - ) + description = "Apache Arrow is a cross-language development platform for in-memory data" license = ("Apache-2.0",) url = "https://github.com/conan-io/conan-center-index" homepage = "https://arrow.apache.org/" - topics = ( - "memory", - "gandiva", - "parquet", - "skyhook", - "plasma", - "hdfs", - "csv", - "cuda", - "gcs", - "json", - "hive", - "s3", - "grpc", - ) + topics = ("memory", "gandiva", "parquet", "skyhook", "acero", "hdfs", "csv", "cuda", "gcs", "json", "hive", "s3", "grpc") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "gandiva": [True, False], + "gandiva": [True, False], "parquet": ["auto", True, False], "substrait": [True, False], "skyhook": [True, False], - "plasma": [True, False], + "acero": [True, False], "cli": [True, False], "compute": ["auto", True, False], - "dataset_modules": ["auto", True, False], + "dataset_modules": ["auto", True, False], "deprecated": [True, False], "encryption": [True, False], - "filesystem_layer": [True, False], + "filesystem_layer": [True, False], "hdfs_bridgs": [True, False], - "simd_level": [ - None, - "default", - "sse4_2", - "avx2", - "avx512", - "neon", - ], + "plasma": [True, False, "deprecated"], + "simd_level": [None, "default", "sse4_2", "avx2", "avx512", "neon", ], "runtime_simd_level": [None, "sse4_2", "avx2", "avx512", "max"], "with_backtrace": [True, False], "with_boost": ["auto", True, False], "with_csv": [True, False], "with_cuda": [True, False], - "with_flight_rpc": ["auto", True, False], - "with_flight_sql": [True, False], + "with_flight_rpc": ["auto", True, False], + "with_flight_sql": [True, False], "with_gcs": [True, False], "with_gflags": ["auto", True, False], "with_glog": ["auto", True, False], "with_grpc": ["auto", True, False], "with_jemalloc": ["auto", True, False], - "with_mimalloc": ["auto", True, False], + "with_mimalloc": [True, False], "with_json": [True, False], + "with_thrift": ["auto", True, False], "with_llvm": ["auto", True, False], "with_openssl": ["auto", True, False], "with_opentelemetry": [True, False], @@ -98,407 +72,222 @@ class ArrowConan(ConanFile): "shared": False, "fPIC": True, "gandiva": False, - "parquet": True, + "parquet": False, "skyhook": False, "substrait": False, - "plasma": False, + "acero": False, "cli": False, - "compute": True, - "dataset_modules": "auto", + "compute": False, + "dataset_modules": False, "deprecated": True, "encryption": False, "filesystem_layer": False, "hdfs_bridgs": False, + "plasma": "deprecated", "simd_level": "default", "runtime_simd_level": "max", "with_backtrace": False, - "with_boost": "auto", + "with_boost": False, "with_brotli": False, "with_bz2": False, "with_csv": False, "with_cuda": False, - "with_flight_rpc": "auto", + "with_flight_rpc": False, "with_flight_sql": False, "with_gcs": False, - "with_gflags": "auto", - "with_jemalloc": "auto", + "with_gflags": False, + "with_jemalloc": False, "with_mimalloc": False, - "with_glog": "auto", - "with_grpc": "auto", + "with_glog": False, + "with_grpc": False, "with_json": False, - "with_llvm": "auto", - "with_openssl": "auto", + "with_thrift": False, + "with_llvm": False, + "with_openssl": False, "with_opentelemetry": False, "with_orc": False, - "with_protobuf": "auto", - "with_re2": "auto", + "with_protobuf": False, + "with_re2": False, "with_s3": False, - "with_utf8proc": "auto", + "with_utf8proc": False, "with_lz4": False, "with_snappy": False, "with_zlib": False, - "with_zstd": True, + "with_zstd": False, } short_paths = True @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): # arrow >= 10.0.0 requires C++17. # https://github.com/apache/arrow/pull/13991 - return 11 if Version(self.version) < "10.0.0" else 17 + return "11" if Version(self.version) < "10.0.0" else "17" @property def _compilers_minimum_version(self): return { - "gcc": "8", - "clang": "7", - "apple-clang": "10", - } + "11": { + "clang": "3.9", + }, + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) def export_sources(self): export_conandata_patches(self) + copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if Version(self.version) < "2.0.0": - del self.options.simd_level - del self.options.runtime_simd_level - elif Version(self.version) < "6.0.0": - self.options.simd_level = "sse4_2" - if Version(self.version) < "6.0.0": - del self.options.with_gcs - if Version(self.version) < "7.0.0": - del self.options.skyhook - del self.options.with_flight_sql - del self.options.with_opentelemetry if Version(self.version) < "8.0.0": del self.options.substrait + if is_msvc(self): + self.options.with_boost = True def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, self._minimum_cpp_standard) - - if self._minimum_cpp_standard == 11: - if ( - self.info.settings.compiler == "clang" - and self.info.settings.compiler.version <= Version("3.9") - ): - raise ConanInvalidConfiguration( - "This recipe does not support this compiler version" - ) - else: - check_min_vs(self, 191) - if not is_msvc(self): - minimum_version = self._compilers_minimum_version.get( - str(self.info.settings.compiler), False - ) - if ( - minimum_version - and Version(self.info.settings.compiler.version) < minimum_version - ): - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." - ) - - if self.options.shared: - del self.options.fPIC - if self.options.compute == False and not self._compute(True): - raise ConanInvalidConfiguration( - "compute options is required (or choose auto)" - ) - if self.options.parquet == False and self._parquet(True): - raise ConanInvalidConfiguration( - "parquet options is required (or choose auto)" - ) - if self.options.dataset_modules == False and self._dataset_modules(True): - raise ConanInvalidConfiguration( - "dataset_modules options is required (or choose auto)" - ) - if self.options.get_safe("skyhook", False): - raise ConanInvalidConfiguration("CCI has no librados recipe (yet)") - if self.options.with_jemalloc == False and self._with_jemalloc(True): - raise ConanInvalidConfiguration( - "with_jemalloc option is required (or choose auto)" - ) - if self.options.with_re2 == False and self._with_re2(True): - raise ConanInvalidConfiguration( - "with_re2 option is required (or choose auto)" - ) - if self.options.with_protobuf == False and self._with_protobuf(True): - raise ConanInvalidConfiguration( - "with_protobuf option is required (or choose auto)" - ) - if self.options.with_gflags == False and self._with_gflags(True): - raise ConanInvalidConfiguration( - "with_gflags options is required (or choose auto)" - ) - if self.options.with_flight_rpc == False and self._with_flight_rpc(True): - raise ConanInvalidConfiguration( - "with_flight_rpc options is required (or choose auto)" - ) - if self.options.with_grpc == False and self._with_grpc(True): - raise ConanInvalidConfiguration( - "with_grpc options is required (or choose auto)" - ) - if self.options.with_boost == False and self._with_boost(True): - raise ConanInvalidConfiguration( - "with_boost options is required (or choose auto)" - ) - if self.options.with_openssl == False and self._with_openssl(True): - raise ConanInvalidConfiguration( - "with_openssl options is required (or choose auto)" - ) - if self.options.with_llvm == False and self._with_llvm(True): - raise ConanInvalidConfiguration( - "with_llvm options is required (or choose auto)" - ) - if self.options.with_cuda: - raise ConanInvalidConfiguration("CCI has no cuda recipe (yet)") - if self.options.with_orc: - raise ConanInvalidConfiguration("CCI has no orc recipe (yet)") - if self.options.with_s3 and not self.options["aws-sdk-cpp"].config: - raise ConanInvalidConfiguration( - "arrow:with_s3 requires aws-sdk-cpp:config is True." - ) - - if self.options.shared and self._with_jemalloc(): - if self.options["jemalloc"].enable_cxx: - raise ConanInvalidConfiguration( - "jemmalloc.enable_cxx of a static jemalloc must be disabled" - ) - - if ( - Version(self.version) < "6.0.0" - and self.options.get_safe("simd_level") == "default" - ): - raise ConanInvalidConfiguration( - f"In {self.ref}, simd_level options is not supported `default` value." - ) - def layout(self): cmake_layout(self, src_folder="src") - def _compute(self, required=False): - if required or self.options.compute == "auto": - return bool(self._parquet() or self._dataset_modules()) or bool( - self.options.get_safe("substrait", False) - ) - else: - return bool(self.options.compute) - - def _parquet(self, required=False): - if required or self.options.parquet == "auto": - return bool(self.options.get_safe("substrait", False)) - else: - return bool(self.options.parquet) - - def _dataset_modules(self, required=False): - if required or self.options.dataset_modules == "auto": - return bool(self.options.get_safe("substrait", False)) - else: - return bool(self.options.dataset_modules) - - def _with_jemalloc(self, required=False): - if required or self.options.with_jemalloc == "auto": - return bool("BSD" in str(self.settings.os)) - else: - return bool(self.options.with_jemalloc) - - def _with_re2(self, required=False): - if required or self.options.with_re2 == "auto": - if self.options.gandiva or self.options.parquet: - return True - if Version(self) >= "7.0.0" and ( - self._compute() or self._dataset_modules() - ): - return True - return False - else: - return bool(self.options.with_re2) - - def _with_protobuf(self, required=False): - if required or self.options.with_protobuf == "auto": - return bool( - self.options.gandiva - or self._with_flight_rpc() - or self.options.with_orc - or self.options.get_safe("substrait", False) - ) - else: - return bool(self.options.with_protobuf) - - def _with_flight_rpc(self, required=False): - if required or self.options.with_flight_rpc == "auto": - return bool(self.options.get_safe("with_flight_sql", False)) - else: - return bool(self.options.with_flight_rpc) - - def _with_gflags(self, required=False): - if required or self.options.with_gflags == "auto": - return bool(self.options.plasma or self._with_glog() or self._with_grpc()) - else: - return bool(self.options.with_gflags) - - def _with_glog(self, required=False): - if required or self.options.with_glog == "auto": - return False - else: - return bool(self.options.with_glog) - - def _with_grpc(self, required=False): - if required or self.options.with_grpc == "auto": - return self._with_flight_rpc() - else: - return bool(self.options.with_grpc) - - def _with_boost(self, required=False): - if required or self.options.with_boost == "auto": - if self.options.gandiva: - return True - version = Version(self.version) - if version.major == "1": - if ( - self._parquet() - and self.settings.compiler == "gcc" - and self.settings.compiler.version < Version("4.9") - ): - return True - elif version.major >= "2": - if is_msvc(self): - return True - return False - else: - return bool(self.options.with_boost) - - def _with_thrift(self, required=False): - # No self.options.with_thift exists - return bool(required or self._parquet()) - - def _with_utf8proc(self, required=False): - if required or self.options.with_utf8proc == "auto": - return bool(self._compute() or self.options.gandiva) - else: - return bool(self.options.with_utf8proc) - - def _with_llvm(self, required=False): - if required or self.options.with_llvm == "auto": - return bool(self.options.gandiva) - else: - return bool(self.options.with_llvm) - - def _with_openssl(self, required=False): - if required or self.options.with_openssl == "auto": - return bool( - self.options.encryption - or self._with_flight_rpc() - or self.options.with_s3 - ) - else: - return bool(self.options.with_openssl) - - def _with_rapidjson(self): - if self.options.with_json: - return True - if Version(self.version) >= "7.0.0" and self.options.encryption: - return True - return False + def _requires_rapidjson(self): + return self.options.with_json or self.options.encryption def requirements(self): - if self._with_thrift(): + if self.options.with_thrift: self.requires("thrift/0.17.0") - if self._with_protobuf(): - self.requires("protobuf/3.21.4") - if self._with_jemalloc(): + if self.options.with_protobuf: + self.requires("protobuf/3.21.12") + if self.options.with_jemalloc: self.requires("jemalloc/5.3.0") if self.options.with_mimalloc: self.requires("mimalloc/1.7.6") - if self._with_boost(): - self.requires("boost/1.80.0") - if self._with_gflags(): + if self.options.with_boost: + self.requires("boost/1.84.0") + if self.options.with_gflags: self.requires("gflags/2.2.2") - if self._with_glog(): + if self.options.with_glog: self.requires("glog/0.6.0") if self.options.get_safe("with_gcs"): self.requires("google-cloud-cpp/1.40.1") - if self._with_grpc(): + if self.options.with_grpc: self.requires("grpc/1.50.0") - if self._with_rapidjson(): + if self._requires_rapidjson(): self.requires("rapidjson/1.1.0") - if self._with_llvm(): + if self.options.with_llvm: self.requires("llvm-core/13.0.0") - if self._with_openssl(): + if self.options.with_openssl: # aws-sdk-cpp requires openssl/1.1.1. it uses deprecated functions in openssl/3.0.0 if self.options.with_s3: - self.requires("openssl/1.1.1s") + self.requires("openssl/1.1.1w") else: - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") if self.options.get_safe("with_opentelemetry"): self.requires("opentelemetry-cpp/1.7.0") if self.options.with_s3: self.requires("aws-sdk-cpp/1.9.234") if self.options.with_brotli: - self.requires("brotli/1.0.9") + self.requires("brotli/1.1.0") if self.options.with_bz2: self.requires("bzip2/1.0.8") if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_snappy: self.requires("snappy/1.1.9") - if ( - Version(self.version) >= "6.0.0" - and self.options.get_safe("simd_level") != None - or self.options.get_safe("runtime_simd_level") != None - ): + if self.options.get_safe("simd_level") != None or \ + self.options.get_safe("runtime_simd_level") != None: self.requires("xsimd/9.0.1") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: - self.requires("zstd/1.5.2") - if self._with_re2(): - self.requires("re2/20220601") - if self._with_utf8proc(): + self.requires("zstd/1.5.5") + if self.options.with_re2: + self.requires("re2/20230301") + if self.options.with_utf8proc: self.requires("utf8proc/2.8.0") if self.options.with_backtrace: self.requires("libbacktrace/cci.20210118") + if self.options.with_orc: + self.requires("orc/2.0.0") + + def validate(self): + # Do not allow options with 'auto' value + # TODO: Remove "auto" from the possible values for these options + auto_options = [option for option, value in self.options.items() if value == "auto"] + if auto_options: + raise ConanException("Options with value 'auto' are deprecated. Please set them true/false or use its default value." + f" Please change the following options: {auto_options}") + + # From https://github.com/conan-io/conan-center-index/pull/23163#issuecomment-2039808851 + if self.options.gandiva: + if not self.options.with_re2: + raise ConanException("'with_re2' option should be True when'gandiva=True'") + if not self.options.with_boost: + raise ConanException("'with_boost' option should be True when'gandiva=True'") + if not self.options.with_utf8proc: + raise ConanException("'with_utf8proc' option should be True when'gandiva=True'") + if self.options.parquet: + if not self.options.with_boost: + raise ConanException("'with_boost' option should be True when'parquet=True'") + if not self.options.with_thrift: + raise ConanException("'with_thrift' option should be True when'parquet=True'") + if self.options.with_flight_rpc and not self.options.with_protobuf: + raise ConanException("'with_protobuf' option should be True when'with_flight_rpc=True'") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.options.get_safe("skyhook", False): + raise ConanInvalidConfiguration("CCI has no librados recipe (yet)") + if self.options.with_cuda: + raise ConanInvalidConfiguration("CCI has no cuda recipe (yet)") + if self.options.with_s3 and not self.dependencies["aws-sdk-cpp"].options.config: + raise ConanInvalidConfiguration("arrow:with_s3 requires aws-sdk-cpp:config is True.") + + if self.options.shared and self.options.with_jemalloc: + if self.dependencies["jemalloc"].options.enable_cxx: + raise ConanInvalidConfiguration("jemmalloc.enable_cxx of a static jemalloc must be disabled") + + + def build_requirements(self): + if Version(self.version) >= "13.0.0": + self.tool_requires("cmake/[>=3.16 <4]") def source(self): - get( - self, - **self.conan_data["sources"][self.version], - filename=f"apache-arrow-{self.version}.tar.gz", - destination=self.source_folder, - strip_root=True, - ) + get(self, **self.conan_data["sources"][self.version], + filename=f"apache-arrow-{self.version}.tar.gz", strip_root=True) def generate(self): - # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are automatically parsed when self.options.shared or self.options.fPIC exist tc = CMakeToolchain(self) if cross_building(self): cmake_system_processor = { "armv8": "aarch64", "armv8.3": "aarch64", }.get(str(self.settings.arch), str(self.settings.arch)) - tc.variables["CMAKE_SYSTEM_PROCESSOR"] = cmake_system_processor if cmake_system_processor == "aarch64": tc.variables["ARROW_CPU_FLAG"] = "armv8" if is_msvc(self): tc.variables["ARROW_USE_STATIC_CRT"] = is_msvc_static_runtime(self) tc.variables["ARROW_DEPENDENCY_SOURCE"] = "SYSTEM" - tc.variables[ - "ARROW_PACKAGE_KIND" - ] = "conan" # See https://github.com/conan-io/conan-center-index/pull/14903/files#r1057938314 for details + tc.variables["ARROW_PACKAGE_KIND"] = "conan" # See https://github.com/conan-io/conan-center-index/pull/14903/files#r1057938314 for details tc.variables["ARROW_GANDIVA"] = bool(self.options.gandiva) - tc.variables["ARROW_PARQUET"] = self._parquet() - tc.variables["ARROW_SUBSTRAIT"] = bool( - self.options.get_safe("substrait", False) - ) - tc.variables["ARROW_PLASMA"] = bool(self.options.plasma) - tc.variables["ARROW_DATASET"] = self._dataset_modules() + tc.variables["ARROW_PARQUET"] = self.options.parquet + tc.variables["ARROW_SUBSTRAIT"] = bool(self.options.get_safe("substrait", False)) + tc.variables["ARROW_ACERO"] = bool(self.options.acero) + tc.variables["ARROW_DATASET"] = self.options.dataset_modules tc.variables["ARROW_FILESYSTEM"] = bool(self.options.filesystem_layer) tc.variables["PARQUET_REQUIRE_ENCRYPTION"] = bool(self.options.encryption) tc.variables["ARROW_HDFS"] = bool(self.options.hdfs_bridgs) @@ -506,14 +295,12 @@ def generate(self): tc.variables["ARROW_BUILD_SHARED"] = bool(self.options.shared) tc.variables["ARROW_BUILD_STATIC"] = not bool(self.options.shared) tc.variables["ARROW_NO_DEPRECATED_API"] = not bool(self.options.deprecated) - tc.variables["ARROW_FLIGHT"] = self._with_flight_rpc() - tc.variables["ARROW_FLIGHT_SQL"] = bool( - self.options.get_safe("with_flight_sql", False) - ) - tc.variables["ARROW_COMPUTE"] = self._compute() + tc.variables["ARROW_FLIGHT"] = self.options.with_flight_rpc + tc.variables["ARROW_FLIGHT_SQL"] = bool(self.options.get_safe("with_flight_sql", False)) + tc.variables["ARROW_COMPUTE"] = bool(self.options.compute) tc.variables["ARROW_CSV"] = bool(self.options.with_csv) tc.variables["ARROW_CUDA"] = bool(self.options.with_cuda) - tc.variables["ARROW_JEMALLOC"] = self._with_jemalloc() + tc.variables["ARROW_JEMALLOC"] = self.options.with_jemalloc tc.variables["jemalloc_SOURCE"] = "SYSTEM" tc.variables["ARROW_MIMALLOC"] = bool(self.options.with_mimalloc) tc.variables["ARROW_JSON"] = bool(self.options.with_json) @@ -521,79 +308,58 @@ def generate(self): tc.variables["ARROW_GCS"] = bool(self.options.get_safe("with_gcs", False)) tc.variables["BOOST_SOURCE"] = "SYSTEM" tc.variables["Protobuf_SOURCE"] = "SYSTEM" - if self._with_protobuf(): - tc.variables["ARROW_PROTOBUF_USE_SHARED"] = bool( - self.options["protobuf"].shared - ) + if self.options.with_protobuf: + tc.variables["ARROW_PROTOBUF_USE_SHARED"] = bool(self.dependencies["protobuf"].options.shared) tc.variables["gRPC_SOURCE"] = "SYSTEM" - if self._with_grpc(): - tc.variables["ARROW_GRPC_USE_SHARED"] = bool(self.options["grpc"].shared) + if self.options.with_grpc: + tc.variables["ARROW_GRPC_USE_SHARED"] = bool(self.dependencies["grpc"].options.shared) - tc.variables["ARROW_USE_GLOG"] = self._with_glog() + tc.variables["ARROW_USE_GLOG"] = self.options.with_glog tc.variables["GLOG_SOURCE"] = "SYSTEM" tc.variables["ARROW_WITH_BACKTRACE"] = bool(self.options.with_backtrace) tc.variables["ARROW_WITH_BROTLI"] = bool(self.options.with_brotli) tc.variables["brotli_SOURCE"] = "SYSTEM" if self.options.with_brotli: - tc.variables["ARROW_BROTLI_USE_SHARED"] = bool( - self.options["brotli"].shared - ) + tc.variables["ARROW_BROTLI_USE_SHARED"] = bool(self.dependencies["brotli"].options.shared) tc.variables["gflags_SOURCE"] = "SYSTEM" - if self._with_gflags(): - tc.variables["ARROW_GFLAGS_USE_SHARED"] = bool( - self.options["gflags"].shared - ) + if self.options.with_gflags: + tc.variables["ARROW_GFLAGS_USE_SHARED"] = bool(self.dependencies["gflags"].options.shared) tc.variables["ARROW_WITH_BZ2"] = bool(self.options.with_bz2) tc.variables["BZip2_SOURCE"] = "SYSTEM" if self.options.with_bz2: - tc.variables["ARROW_BZ2_USE_SHARED"] = bool(self.options["bzip2"].shared) + tc.variables["ARROW_BZ2_USE_SHARED"] = bool(self.dependencies["bzip2"].options.shared) tc.variables["ARROW_WITH_LZ4"] = bool(self.options.with_lz4) tc.variables["lz4_SOURCE"] = "SYSTEM" if self.options.with_lz4: - tc.variables["ARROW_LZ4_USE_SHARED"] = bool(self.options["lz4"].shared) + tc.variables["ARROW_LZ4_USE_SHARED"] = bool(self.dependencies["lz4"].options.shared) tc.variables["ARROW_WITH_SNAPPY"] = bool(self.options.with_snappy) tc.variables["RapidJSON_SOURCE"] = "SYSTEM" tc.variables["Snappy_SOURCE"] = "SYSTEM" if self.options.with_snappy: - tc.variables["ARROW_SNAPPY_USE_SHARED"] = bool( - self.options["snappy"].shared - ) + tc.variables["ARROW_SNAPPY_USE_SHARED"] = bool(self.dependencies["snappy"].options.shared) tc.variables["ARROW_WITH_ZLIB"] = bool(self.options.with_zlib) tc.variables["re2_SOURCE"] = "SYSTEM" tc.variables["ZLIB_SOURCE"] = "SYSTEM" tc.variables["xsimd_SOURCE"] = "SYSTEM" tc.variables["ARROW_WITH_ZSTD"] = bool(self.options.with_zstd) - if Version(self.version) >= "2.0": - tc.variables["zstd_SOURCE"] = "SYSTEM" - tc.variables["ARROW_SIMD_LEVEL"] = str(self.options.simd_level).upper() - tc.variables["ARROW_RUNTIME_SIMD_LEVEL"] = str( - self.options.runtime_simd_level - ).upper() - else: - tc.variables["ZSTD_SOURCE"] = "SYSTEM" + tc.variables["zstd_SOURCE"] = "SYSTEM" + tc.variables["ARROW_SIMD_LEVEL"] = str(self.options.simd_level).upper() + tc.variables["ARROW_RUNTIME_SIMD_LEVEL"] = str(self.options.runtime_simd_level).upper() if self.options.with_zstd: - tc.variables["ARROW_ZSTD_USE_SHARED"] = bool(self.options["zstd"].shared) + tc.variables["ARROW_ZSTD_USE_SHARED"] = bool(self.dependencies["zstd"].options.shared) tc.variables["ORC_SOURCE"] = "SYSTEM" - tc.variables["ARROW_WITH_THRIFT"] = self._with_thrift() + tc.variables["ARROW_WITH_THRIFT"] = bool(self.options.with_thrift) tc.variables["Thrift_SOURCE"] = "SYSTEM" - if self._with_thrift(): - tc.variables["THRIFT_VERSION"] = bool( - self.deps_cpp_info["thrift"].version - ) # a recent thrift does not require boost - tc.variables["ARROW_THRIFT_USE_SHARED"] = bool( - self.options["thrift"].shared - ) - tc.variables["ARROW_USE_OPENSSL"] = self._with_openssl() - if self._with_openssl(): - tc.variables["OPENSSL_ROOT_DIR"] = self.deps_cpp_info[ - "openssl" - ].rootpath.replace("\\", "/") - tc.variables["ARROW_OPENSSL_USE_SHARED"] = bool( - self.options["openssl"].shared - ) - if self._with_boost(): + if self.options.with_thrift: + tc.variables["THRIFT_VERSION"] = bool(self.dependencies["thrift"].ref.version) # a recent thrift does not require boost + tc.variables["ARROW_THRIFT_USE_SHARED"] = bool(self.dependencies["thrift"].options.shared) + tc.variables["ARROW_USE_OPENSSL"] = self.options.with_openssl + if self.options.with_openssl: + tc.variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + tc.variables["ARROW_OPENSSL_USE_SHARED"] = bool(self.dependencies["openssl"].options.shared) + if self.options.with_boost: tc.variables["ARROW_USE_BOOST"] = True - tc.variables["ARROW_BOOST_USE_SHARED"] = bool(self.options["boost"].shared) + tc.variables["ARROW_BOOST_USE_SHARED"] = bool(self.dependencies["boost"].options.shared) tc.variables["ARROW_S3"] = bool(self.options.with_s3) tc.variables["AWSSDK_SOURCE"] = "SYSTEM" tc.variables["ARROW_BUILD_UTILITIES"] = bool(self.options.cli) @@ -604,22 +370,18 @@ def generate(self): tc.variables["ARROW_ENABLE_TIMING_TESTS"] = False tc.variables["ARROW_BUILD_BENCHMARKS"] = False tc.variables["LLVM_SOURCE"] = "SYSTEM" - tc.variables["ARROW_WITH_UTF8PROC"] = self._with_utf8proc() - tc.variables["ARROW_BOOST_REQUIRED"] = self._with_boost() + tc.variables["ARROW_WITH_UTF8PROC"] = self.options.with_utf8proc + tc.variables["ARROW_BOOST_REQUIRED"] = self.options.with_boost tc.variables["utf8proc_SOURCE"] = "SYSTEM" - if self._with_utf8proc(): - tc.variables["ARROW_UTF8PROC_USE_SHARED"] = bool( - self.options["utf8proc"].shared - ) + if self.options.with_utf8proc: + tc.variables["ARROW_UTF8PROC_USE_SHARED"] = bool(self.dependencies["utf8proc"].options.shared) tc.variables["BUILD_WARNING_LEVEL"] = "PRODUCTION" if is_msvc(self): - tc.variables["ARROW_USE_STATIC_CRT"] = "MT" in str( - self.settings.compiler.runtime - ) - if self._with_llvm(): - tc.variables["LLVM_DIR"] = self.deps_cpp_info["llvm-core"].rootpath.replace( - "\\", "/" - ) + tc.variables["ARROW_USE_STATIC_CRT"] = is_msvc_static_runtime(self) + if self.options.with_llvm: + tc.variables["LLVM_DIR"] = self.dependencies["llvm-core"].package_folder.replace("\\", "/") + + tc.cache_variables["CMAKE_PROJECT_arrow_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") tc.generate() deps = CMakeDeps(self) @@ -627,12 +389,11 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - if "7.0.0" <= Version(self.version) < "10.0.0": - for filename in glob.glob( - os.path.join(self.source_folder, "cpp", "cmake_modules", "Find*.cmake") - ): + if Version(self.version) < "10.0.0": + for filename in glob.glob(os.path.join(self.source_folder, "cpp", "cmake_modules", "Find*.cmake")): if os.path.basename(filename) not in [ "FindArrow.cmake", + "FindArrowAcero.cmake", "FindArrowCUDA.cmake", "FindArrowDataset.cmake", "FindArrowFlight.cmake", @@ -644,7 +405,6 @@ def _patch_sources(self): "FindArrowTesting.cmake", "FindGandiva.cmake", "FindParquet.cmake", - "FindPlasma.cmake", ]: os.remove(filename) @@ -655,18 +415,8 @@ def build(self): cmake.build() def package(self): - copy( - self, - pattern="LICENSE.txt", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) - copy( - self, - pattern="NOTICE.txt", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="NOTICE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() @@ -674,195 +424,168 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) - def _lib_name(self, name): - if is_msvc(self) and not self.options.shared: - return "{}_static".format(name) - else: - return "{}".format(name) - - def package_id(self): - self.info.options.with_gflags = self._with_gflags() - self.info.options.with_protobuf = self._with_protobuf() - self.info.options.with_re2 = self._with_re2() - self.info.options.with_jemalloc = self._with_jemalloc() - self.info.options.with_openssl = self._with_openssl() - self.info.options.with_boost = self._with_boost() - self.info.options.with_glog = self._with_glog() - self.info.options.with_grpc = self._with_grpc() + cmake_suffix = "shared" if self.options.shared else "static" + + alias_map = { f"Arrow::arrow_{cmake_suffix}": f"arrow::arrow_{cmake_suffix}" } + + if self.options.parquet: + alias_map[f"Parquet::parquet_{cmake_suffix}"] = f"arrow::parquet_{cmake_suffix}" + + if self.options.get_safe("substrait"): + alias_map[f"Arrow::arrow_substrait_{cmake_suffix}"] = f"arrow::arrow_substrait_{cmake_suffix}" + + if self.options.acero: + alias_map[f"Arrow::arrow_acero_{cmake_suffix}"] = f"arrow::arrow_acero_{cmake_suffix}" + + if self.options.gandiva: + alias_map[f"Gandiva::gandiva_{cmake_suffix}"] = f"arrow::gandiva_{cmake_suffix}" + + if self.options.with_flight_rpc: + alias_map[f"ArrowFlight::arrow_flight_sql_{cmake_suffix}"] = f"arrow::arrow_flight_sql_{cmake_suffix}" + + + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), alias_map + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + save(self, module_file, content) + + @property + def _module_subfolder(self): + return os.path.join("lib", "cmake") + + @property + def _module_file_rel_path(self): + return os.path.join(self._module_subfolder, + f"conan-official-{self.name}-targets.cmake") def package_info(self): - self.cpp_info.filenames["cmake_find_package"] = "Arrow" - self.cpp_info.filenames["cmake_find_package_multi"] = "Arrow" - self.cpp_info.components["libarrow"].libs = [self._lib_name("arrow")] - self.cpp_info.components["libarrow"].names["cmake_find_package"] = "arrow" - self.cpp_info.components["libarrow"].names["cmake_find_package_multi"] = "arrow" - self.cpp_info.components["libarrow"].names["pkg_config"] = "arrow" + # FIXME: fix CMake targets of components + + self.cpp_info.set_property("cmake_file_name", "Arrow") + + suffix = "_static" if is_msvc(self) and not self.options.shared else "" + cmake_suffix = "shared" if self.options.shared else "static" + + self.cpp_info.components["libarrow"].set_property("pkg_config_name", "arrow") + self.cpp_info.components["libarrow"].set_property("cmake_target_name", f"Arrow::arrow_{cmake_suffix}") + self.cpp_info.components["libarrow"].libs = [f"arrow{suffix}"] if not self.options.shared: self.cpp_info.components["libarrow"].defines = ["ARROW_STATIC"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["libarrow"].system_libs = [ - "pthread", - "m", - "dl", - "rt", - ] - - if self._parquet(): - self.cpp_info.components["libparquet"].libs = [self._lib_name("parquet")] - self.cpp_info.components["libparquet"].names[ - "cmake_find_package" - ] = "parquet" - self.cpp_info.components["libparquet"].names[ - "cmake_find_package_multi" - ] = "parquet" - self.cpp_info.components["libparquet"].names["pkg_config"] = "parquet" + self.cpp_info.components["libarrow"].system_libs = ["pthread", "m", "dl", "rt"] + + if self.options.parquet: + self.cpp_info.components["libparquet"].set_property("pkg_config_name", "parquet") + self.cpp_info.components["libparquet"].set_property("cmake_target_name", f"Parquet::parquet_{cmake_suffix}") + self.cpp_info.components["libparquet"].libs = [f"parquet{suffix}"] self.cpp_info.components["libparquet"].requires = ["libarrow"] if not self.options.shared: self.cpp_info.components["libparquet"].defines = ["PARQUET_STATIC"] - if self.options.get_safe("substrait", False): - self.cpp_info.components["libarrow_substrait"].libs = [ - self._lib_name("arrow_substrait") - ] - self.cpp_info.components["libarrow_substrait"].names[ - "cmake_find_package" - ] = "arrow_substrait" - self.cpp_info.components["libarrow_substrait"].names[ - "cmake_find_package_multi" - ] = "arrow_substrait" - self.cpp_info.components["libarrow_substrait"].names[ - "pkg_config" - ] = "arrow_substrait" - self.cpp_info.components["libarrow_substrait"].requires = [ - "libparquet", - "dataset", - ] - - if self.options.plasma: - self.cpp_info.components["libplasma"].libs = [self._lib_name("plasma")] - self.cpp_info.components["libplasma"].names["cmake_find_package"] = "plasma" - self.cpp_info.components["libplasma"].names[ - "cmake_find_package_multi" - ] = "plasma" - self.cpp_info.components["libplasma"].names["pkg_config"] = "plasma" - self.cpp_info.components["libplasma"].requires = ["libarrow"] + if self.options.get_safe("substrait"): + self.cpp_info.components["libarrow_substrait"].set_property("pkg_config_name", "arrow_substrait") + self.cpp_info.components["libarrow_substrait"].set_property("cmake_target_name", f"Arrow::arrow_substrait_{cmake_suffix}") + self.cpp_info.components["libarrow_substrait"].libs = [f"arrow_substrait{suffix}"] + self.cpp_info.components["libarrow_substrait"].requires = ["libparquet", "dataset"] + + # Plasma was deprecated in Arrow 12.0.0 + del self.options.plasma + + if self.options.acero: + self.cpp_info.components["libacero"].set_property("pkg_config_name", "acero") + self.cpp_info.components["libacero"].set_property("cmake_target_name", f"Acero::arrow_acero_{cmake_suffix}") + self.cpp_info.components["libacero"].libs = [f"arrow_acero{suffix}"] + self.cpp_info.components["libacero"].names["cmake_find_package"] = "acero" + self.cpp_info.components["libacero"].names["cmake_find_package_multi"] = "acero" + self.cpp_info.components["libacero"].names["pkg_config"] = "acero" + self.cpp_info.components["libacero"].requires = ["libarrow"] if self.options.gandiva: - self.cpp_info.components["libgandiva"].libs = [self._lib_name("gandiva")] - self.cpp_info.components["libgandiva"].names[ - "cmake_find_package" - ] = "gandiva" - self.cpp_info.components["libgandiva"].names[ - "cmake_find_package_multi" - ] = "gandiva" - self.cpp_info.components["libgandiva"].names["pkg_config"] = "gandiva" + self.cpp_info.components["libgandiva"].set_property("pkg_config_name", "gandiva") + self.cpp_info.components["libgandiva"].set_property("cmake_target_name", f"Gandiva::gandiva_{cmake_suffix}") + self.cpp_info.components["libgandiva"].libs = [f"gandiva{suffix}"] self.cpp_info.components["libgandiva"].requires = ["libarrow"] if not self.options.shared: self.cpp_info.components["libgandiva"].defines = ["GANDIVA_STATIC"] - if self._with_flight_rpc(): - self.cpp_info.components["libarrow_flight"].libs = [ - self._lib_name("arrow_flight") - ] - self.cpp_info.components["libarrow_flight"].names[ - "cmake_find_package" - ] = "flight_rpc" - self.cpp_info.components["libarrow_flight"].names[ - "cmake_find_package_multi" - ] = "flight_rpc" - self.cpp_info.components["libarrow_flight"].names[ - "pkg_config" - ] = "flight_rpc" + if self.options.with_flight_rpc: + self.cpp_info.components["libarrow_flight"].set_property("pkg_config_name", "flight_rpc") + self.cpp_info.components["libarrow_flight"].set_property("cmake_target_name", f"ArrowFlight::arrow_flight_{cmake_suffix}") + self.cpp_info.components["libarrow_flight"].libs = [f"arrow_flight{suffix}"] self.cpp_info.components["libarrow_flight"].requires = ["libarrow"] if self.options.get_safe("with_flight_sql"): - self.cpp_info.components["libarrow_flight_sql"].libs = [ - self._lib_name("arrow_flight_sql") - ] - self.cpp_info.components["libarrow_flight_sql"].names[ - "cmake_find_package" - ] = "flight_sql" - self.cpp_info.components["libarrow_flight_sql"].names[ - "cmake_find_package_multi" - ] = "flight_sql" - self.cpp_info.components["libarrow_flight_sql"].names[ - "pkg_config" - ] = "flight_sql" - self.cpp_info.components["libarrow_flight_sql"].requires = [ - "libarrow", - "libarrow_flight", - ] - - if self._dataset_modules(): + self.cpp_info.components["libarrow_flight_sql"].set_property("pkg_config_name", "flight_sql") + self.cpp_info.components["libarrow_flight_sql"].set_property("cmake_target_name", f"ArrowFlightSql::arrow_flight_sql_{cmake_suffix}") + self.cpp_info.components["libarrow_flight_sql"].libs = [f"arrow_flight_sql{suffix}"] + self.cpp_info.components["libarrow_flight_sql"].requires = ["libarrow", "libarrow_flight"] + + if self.options.dataset_modules: self.cpp_info.components["dataset"].libs = ["arrow_dataset"] + if self.options.parquet: + self.cpp_info.components["dataset"].requires = ["libparquet"] - if ( - self.options.cli - and (self.options.with_cuda or self._with_flight_rpc() or self._parquet()) - ) or self.options.plasma: + if self.options.cli and (self.options.with_cuda or self.options.with_flight_rpc or self.options.parquet): binpath = os.path.join(self.package_folder, "bin") self.output.info(f"Appending PATH env var: {binpath}") self.env_info.PATH.append(binpath) - if self._with_boost(): + if self.options.with_boost: if self.options.gandiva: # FIXME: only filesystem component is used self.cpp_info.components["libgandiva"].requires.append("boost::boost") - if ( - self._parquet() - and self.settings.compiler == "gcc" - and self.settings.compiler.version < Version("4.9") - ): + if self.options.parquet and self.settings.compiler == "gcc" and self.settings.compiler.version < Version("4.9"): self.cpp_info.components["libparquet"].requires.append("boost::boost") - if Version(self.version) >= "2.0": - # FIXME: only headers components is used - self.cpp_info.components["libarrow"].requires.append("boost::boost") - if self._with_openssl(): + # FIXME: only headers components is used + self.cpp_info.components["libarrow"].requires.append("boost::boost") + if self.options.with_openssl: self.cpp_info.components["libarrow"].requires.append("openssl::openssl") - if self._with_gflags(): + if self.options.with_gflags: self.cpp_info.components["libarrow"].requires.append("gflags::gflags") - if self._with_glog(): + if self.options.with_glog: self.cpp_info.components["libarrow"].requires.append("glog::glog") - if self._with_jemalloc(): + if self.options.with_jemalloc: self.cpp_info.components["libarrow"].requires.append("jemalloc::jemalloc") if self.options.with_mimalloc: self.cpp_info.components["libarrow"].requires.append("mimalloc::mimalloc") - if self._with_re2(): + if self.options.with_re2: if self.options.gandiva: self.cpp_info.components["libgandiva"].requires.append("re2::re2") - if self._parquet(): + if self.options.parquet: self.cpp_info.components["libparquet"].requires.append("re2::re2") self.cpp_info.components["libarrow"].requires.append("re2::re2") - if self._with_llvm(): - self.cpp_info.components["libgandiva"].requires.append( - "llvm-core::llvm-core" - ) - if self._with_protobuf(): + if self.options.with_llvm: + self.cpp_info.components["libgandiva"].requires.append("llvm-core::llvm-core") + if self.options.with_protobuf: self.cpp_info.components["libarrow"].requires.append("protobuf::protobuf") - if self._with_utf8proc(): + if self.options.with_utf8proc: self.cpp_info.components["libarrow"].requires.append("utf8proc::utf8proc") - if self._with_thrift(): + if self.options.with_thrift: self.cpp_info.components["libarrow"].requires.append("thrift::thrift") if self.options.with_backtrace: - self.cpp_info.components["libarrow"].requires.append( - "libbacktrace::libbacktrace" - ) + self.cpp_info.components["libarrow"].requires.append("libbacktrace::libbacktrace") if self.options.with_cuda: self.cpp_info.components["libarrow"].requires.append("cuda::cuda") - if self._with_rapidjson(): + if self._requires_rapidjson(): self.cpp_info.components["libarrow"].requires.append("rapidjson::rapidjson") if self.options.with_s3: self.cpp_info.components["libarrow"].requires.append("aws-sdk-cpp::s3") if self.options.get_safe("with_gcs"): - self.cpp_info.components["libarrow"].requires.append( - "google-cloud-cpp::storage" - ) + self.cpp_info.components["libarrow"].requires.append("google-cloud-cpp::storage") if self.options.with_orc: self.cpp_info.components["libarrow"].requires.append("orc::orc") if self.options.get_safe("with_opentelemetry"): - self.cpp_info.components["libarrow"].requires.append( - "opentelemetry-cpp::opentelemetry-cpp" - ) + self.cpp_info.components["libarrow"].requires.append("opentelemetry-cpp::opentelemetry-cpp") if self.options.with_brotli: self.cpp_info.components["libarrow"].requires.append("brotli::brotli") if self.options.with_bz2: @@ -871,20 +594,48 @@ def package_info(self): self.cpp_info.components["libarrow"].requires.append("lz4::lz4") if self.options.with_snappy: self.cpp_info.components["libarrow"].requires.append("snappy::snappy") - if ( - self.options.get_safe("simd_level") != None - or self.options.get_safe("runtime_simd_level") != None - ): + if self.options.get_safe("simd_level") != None or self.options.get_safe("runtime_simd_level") != None: self.cpp_info.components["libarrow"].requires.append("xsimd::xsimd") if self.options.with_zlib: self.cpp_info.components["libarrow"].requires.append("zlib::zlib") if self.options.with_zstd: self.cpp_info.components["libarrow"].requires.append("zstd::zstd") - if self._with_boost(): - self.cpp_info.components["libarrow"].requires.append("boost::boost") - if self._with_grpc(): + if self.options.with_grpc: self.cpp_info.components["libarrow"].requires.append("grpc::grpc") - if self._with_flight_rpc(): - self.cpp_info.components["libarrow_flight"].requires.append( - "protobuf::protobuf" - ) + if self.options.with_flight_rpc: + self.cpp_info.components["libarrow_flight"].requires.append("protobuf::protobuf") + + # TODO: to remove in conan v2 + self.cpp_info.filenames["cmake_find_package"] = "Arrow" + self.cpp_info.filenames["cmake_find_package_multi"] = "Arrow" + self.cpp_info.components["libarrow"].names["cmake_find_package"] = f"arrow_{cmake_suffix}" + self.cpp_info.components["libarrow"].names["cmake_find_package_multi"] = f"arrow_{cmake_suffix}" + self.cpp_info.components["libarrow"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libarrow"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.parquet: + self.cpp_info.components["libparquet"].names["cmake_find_package"] = f"parquet_{cmake_suffix}" + self.cpp_info.components["libparquet"].names["cmake_find_package_multi"] = f"parquet_{cmake_suffix}" + self.cpp_info.components["libparquet"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libparquet"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.get_safe("substrait"): + self.cpp_info.components["libarrow_substrait"].names["cmake_find_package"] = f"arrow_substrait_{cmake_suffix}" + self.cpp_info.components["libarrow_substrait"].names["cmake_find_package_multi"] = f"arrow_substrait_{cmake_suffix}" + self.cpp_info.components["libarrow_substrait"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libarrow_substrait"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.gandiva: + self.cpp_info.components["libgandiva"].names["cmake_find_package"] = "gandiva" + self.cpp_info.components["libgandiva"].names["cmake_find_package_multi"] = "gandiva" + self.cpp_info.components["libgandiva"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libgandiva"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.with_flight_rpc: + self.cpp_info.components["libarrow_flight"].names["cmake_find_package"] = "flight_rpc" + self.cpp_info.components["libarrow_flight"].names["cmake_find_package_multi"] = "flight_rpc" + self.cpp_info.components["libarrow_flight"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libarrow_flight"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.get_safe("with_flight_sql"): + self.cpp_info.components["libarrow_flight_sql"].names["cmake_find_package"] = "flight_sql" + self.cpp_info.components["libarrow_flight_sql"].names["cmake_find_package_multi"] = "flight_sql" + self.cpp_info.components["libarrow_flight_sql"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libarrow_flight_sql"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.cli and (self.options.with_cuda or self.options.with_flight_rpc or self.options.parquet): + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/arrow/all/patches/1.0.0-0003-fix-shared-msvc.patch b/arrow/all/patches/1.0.0-0003-fix-shared-msvc.patch deleted file mode 100644 index 3c7e86d..0000000 --- a/arrow/all/patches/1.0.0-0003-fix-shared-msvc.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- cpp/src/arrow/CMakeLists.txt -+++ cpp/src/arrow/CMakeLists.txt -@@ -490,6 +490,10 @@ - target_compile_definitions(arrow_static PUBLIC ARROW_STATIC) - endif() - -+if(ARROW_BUILD_SHARED AND WIN32) -+target_compile_definitions(arrow_shared PRIVATE ARROW_EXPORTING) -+endif() -+ - if(ARROW_WITH_BACKTRACE) - find_package(Backtrace) - diff --git a/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch b/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch deleted file mode 100644 index 5f0f6f4..0000000 --- a/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/cpp/src/arrow/vendored/datetime/date.h b/cpp/src/arrow/vendored/datetime/date.h -index 02a4909..2b168d2 100644 ---- a/cpp/src/arrow/vendored/datetime/date.h -+++ b/cpp/src/arrow/vendored/datetime/date.h -@@ -5152,7 +5152,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt, - if (modified == CharT{}) - #endif - { -- auto h = *fmt == CharT{'I'} ? make12(hms.hours()) : hms.hours(); -+ auto h = *fmt == CharT{'I'} ? arrow_vendored::date::make12(hms.hours()) : hms.hours(); - if (h < hours{10}) - os << CharT{'0'}; - os << h.count(); -@@ -5366,7 +5366,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt, - save_ostream _(os); - os.fill('0'); - os.width(2); -- os << make12(tod.hours()).count() << CharT{':'}; -+ os << arrow_vendored::date::make12(tod.hours()).count() << CharT{':'}; - os.width(2); - os << tod.minutes().count() << CharT{':'}; - os.width(2); diff --git a/arrow/all/patches/1.0.0-0006-fix-cmake.patch b/arrow/all/patches/1.0.0-0006-fix-cmake.patch deleted file mode 100644 index eb68162..0000000 --- a/arrow/all/patches/1.0.0-0006-fix-cmake.patch +++ /dev/null @@ -1,333 +0,0 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index 300f043..0127a7a 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -654,7 +654,7 @@ endif() - - if(ARROW_WITH_BROTLI) - # Order is important for static linking -- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) -+ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) - list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) - list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) - endif() -@@ -664,7 +664,7 @@ if(ARROW_WITH_BZ2) - endif() - - if(ARROW_WITH_LZ4) -- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) -+ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) - endif() - - if(ARROW_WITH_SNAPPY) -@@ -800,8 +800,11 @@ endif() - - if(ARROW_MIMALLOC) - add_definitions(-DARROW_MIMALLOC) -- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) -- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) -+ if (TARGET mimalloc-static) -+ list(APPEND ARROW_LINK_LIBS mimalloc-static) -+ else() -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) -+ endif() - endif() - - # ---------------------------------------------------------------------- -diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake -index eb10ebe..9c81017 100644 ---- a/cpp/cmake_modules/BuildUtils.cmake -+++ b/cpp/cmake_modules/BuildUtils.cmake -@@ -165,10 +165,10 @@ function(create_merged_static_lib output_target) - set(ar_script_path ${CMAKE_BINARY_DIR}/${ARG_NAME}.ar) - - file(WRITE ${ar_script_path}.in "CREATE ${output_lib_path}\n") -- file(APPEND ${ar_script_path}.in "ADDLIB $\n") -+ file(APPEND ${ar_script_path}.in "ADDLIB $\n") - - foreach(lib ${ARG_TO_MERGE}) -- file(APPEND ${ar_script_path}.in "ADDLIB $\n") -+ file(APPEND ${ar_script_path}.in "ADDLIB $\n") - endforeach() - - file(APPEND ${ar_script_path}.in "SAVE\nEND\n") -diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake -index 807e2b9..016c8db 100644 ---- a/cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -154,16 +154,7 @@ macro(build_dependency DEPENDENCY_NAME) - endmacro() - - macro(resolve_dependency DEPENDENCY_NAME) -- if(${DEPENDENCY_NAME}_SOURCE STREQUAL "AUTO") -- find_package(${DEPENDENCY_NAME} MODULE) -- if(NOT ${${DEPENDENCY_NAME}_FOUND}) -- build_dependency(${DEPENDENCY_NAME}) -- endif() -- elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "BUNDLED") -- build_dependency(${DEPENDENCY_NAME}) -- elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM") -- find_package(${DEPENDENCY_NAME} REQUIRED) -- endif() -+ find_package(${DEPENDENCY_NAME} REQUIRED) - endmacro() - - macro(resolve_dependency_with_version DEPENDENCY_NAME REQUIRED_VERSION) -@@ -765,6 +756,7 @@ endif() - # - Tests need Boost at runtime. - # - S3FS and Flight benchmarks need Boost at runtime. - if(ARROW_BUILD_INTEGRATION -+ OR ARROW_BOOST_REQUIRED - OR ARROW_BUILD_TESTS - OR ARROW_GANDIVA - OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) -@@ -785,7 +777,7 @@ if(ARROW_BOOST_REQUIRED) - elseif(BOOST_SOURCE STREQUAL "BUNDLED") - build_boost() - elseif(BOOST_SOURCE STREQUAL "SYSTEM") -- find_package(BoostAlt ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) -+ find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) - endif() - - if(TARGET Boost::system) -@@ -936,11 +928,11 @@ macro(build_brotli) - endmacro() - - if(ARROW_WITH_BROTLI) -- resolve_dependency(Brotli) -+ resolve_dependency(brotli) - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon -+ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon - INTERFACE_INCLUDE_DIRECTORIES) -- include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) -+ include_directories(SYSTEM ${brotli_INCLUDE_DIR}) - endif() - - if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) -@@ -1146,9 +1138,10 @@ if(ARROW_NEED_GFLAGS) - endif() - endif() - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) -+ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) -+ set(GFLAGS_LIBRARIES ${gflags_LIBRARIES}) - -- if(NOT TARGET ${GFLAGS_LIBRARIES}) -+ if(0) - if(TARGET gflags-shared) - set(GFLAGS_LIBRARIES gflags-shared) - elseif(TARGET gflags_shared) -@@ -1237,12 +1230,13 @@ endmacro() - if(ARROW_WITH_THRIFT) - # We already may have looked for Thrift earlier, when considering whether - # to build Boost, so don't look again if already found. -- if(NOT Thrift_FOUND AND NOT THRIFT_FOUND) -+ if(0) - # Thrift c++ code generated by 0.13 requires 0.11 or greater - resolve_dependency_with_version(Thrift 0.11.0) - endif() -+ find_package(Thrift CONFIG REQUIRED) - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) -+ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) - endif() - - # ---------------------------------------------------------------------- -@@ -1407,6 +1401,7 @@ endif() - # jemalloc - Unix-only high-performance allocator - - if(ARROW_JEMALLOC) -+if(0) - message(STATUS "Building (vendored) jemalloc from source") - # We only use a vendored jemalloc as we want to control its version. - # Also our build of jemalloc is specially prefixed so that it will not -@@ -1465,12 +1460,18 @@ if(ARROW_JEMALLOC) - add_dependencies(jemalloc::jemalloc jemalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) -+else() -+ find_package(jemalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- - # mimalloc - Cross-platform high-performance allocator, from Microsoft - - if(ARROW_MIMALLOC) -+if(0) - message(STATUS "Building (vendored) mimalloc from source") - # We only use a vendored mimalloc as we want to control its build options. - -@@ -1518,6 +1519,11 @@ if(ARROW_MIMALLOC) - add_dependencies(toolchain mimalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) -+else() -+ find_package(mimalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1918,11 +1924,16 @@ macro(build_lz4) - endmacro() - - if(ARROW_WITH_LZ4) -- resolve_dependency(Lz4) -+ resolve_dependency(lz4) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) -- include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) -+ if(TARGET LZ4::lz4_static) -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) -+ else() -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) -+ endif() -+ include_directories(SYSTEM ${lz4_INCLUDE_DIR}) -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${lz4_LIBRARIES_TARGETS} ) - endif() - - macro(build_zstd) -@@ -2037,10 +2048,10 @@ macro(build_re2) - endmacro() - - if(ARROW_GANDIVA) -- resolve_dependency(RE2) -+ resolve_dependency(re2) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(RE2_INCLUDE_DIR RE2::re2 INTERFACE_INCLUDE_DIRECTORIES) -+ get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${RE2_INCLUDE_DIR}) - endif() - -@@ -2480,17 +2491,24 @@ if(ARROW_WITH_GRPC) - endif() - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) -+ # get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) -+ if(grpc_INCLUDE_DIRS_RELEASE) -+ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_RELEASE}) -+ elseif(grpc_INCLUDE_DIRS_DEBUG) -+ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_DEBUG}) -+ endif() - include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) -+ include_directories(SYSTEM ${absl_INCLUDE_DIR}) -+ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) - - if(GRPC_VENDORED) - set(GRPCPP_PP_INCLUDE TRUE) - else() - # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp - # depending on the gRPC version. -- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") -+ if(EXISTS ${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE TRUE) -- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") -+ elseif(EXISTS ${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE FALSE) - else() - message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index 5797a78..da6bd4d 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -292,10 +292,15 @@ set(ARROW_TESTING_SRCS - - set(_allocator_dependencies "") # Empty list - if(ARROW_JEMALLOC) -- list(APPEND _allocator_dependencies jemalloc_ep) -+ list(APPEND _allocator_dependencies jemalloc::jemalloc) - endif() -+ - if(ARROW_MIMALLOC) -- list(APPEND _allocator_dependencies mimalloc_ep) -+ if (TARGET mimalloc-static) -+ list(APPEND _allocator_dependencies mimalloc-static) -+ else() -+ list(APPEND _allocator_dependencies mimalloc) -+ endif() - endif() - - if(_allocator_dependencies) -diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc -index 784bf7b..8f005a5 100644 ---- a/cpp/src/arrow/memory_pool.cc -+++ b/cpp/src/arrow/memory_pool.cc -@@ -31,7 +31,7 @@ - // Needed to support jemalloc 3 and 4 - #define JEMALLOC_MANGLE - // Explicitly link to our version of jemalloc --#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" -+#include "jemalloc/jemalloc.h" - #endif - - #ifdef ARROW_MIMALLOC -diff --git a/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt -index 85e8db6..cd70c63 100644 ---- a/cpp/src/gandiva/CMakeLists.txt -+++ b/cpp/src/gandiva/CMakeLists.txt -@@ -25,7 +25,7 @@ add_custom_target(gandiva-benchmarks) - - add_dependencies(gandiva-all gandiva gandiva-tests gandiva-benchmarks) - --find_package(LLVMAlt REQUIRED) -+find_package(LLVM REQUIRED) - - if(LLVM_VERSION_MAJOR LESS "10") - set(GANDIVA_CXX_STANDARD ${CMAKE_CXX_STANDARD}) -@@ -88,9 +88,16 @@ set(SRC_FILES - random_generator_holder.cc - ${GANDIVA_PRECOMPILED_CC_PATH}) - --set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared LLVM::LLVM_INTERFACE RE2::re2) - --set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE RE2::re2) -+ function(get_all_targets var) -+ set(targets) -+ get_all_targets_recursive(targets ${CMAKE_CURRENT_SOURCE_DIR}) -+ set(${var} ${targets} PARENT_SCOPE) -+endfunction() -+ -+set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared llvm-core::llvm-core re2::re2) -+ -+set(GANDIVA_STATIC_LINK_LIBS arrow_static llvm-core::llvm-core re2::re2) - - if(ARROW_GANDIVA_STATIC_LIBSTDCPP - AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)) -@@ -131,7 +138,7 @@ add_arrow_lib(gandiva - arrow_dependencies - precompiled - EXTRA_INCLUDES -- $ -+ $ - SHARED_LINK_FLAGS - ${GANDIVA_SHARED_LINK_FLAGS} - SHARED_LINK_LIBS -@@ -203,7 +210,7 @@ endfunction() - - set(GANDIVA_INTERNALS_TEST_ARGUMENTS) - if(WIN32) -- list(APPEND GANDIVA_INTERNALS_TEST_ARGUMENTS EXTRA_LINK_LIBS LLVM::LLVM_INTERFACE) -+ list(APPEND GANDIVA_INTERNALS_TEST_ARGUMENTS EXTRA_LINK_LIBS llvm-core::llvm-core) - endif() - add_gandiva_test(internals-test - SOURCES -@@ -225,9 +232,9 @@ add_gandiva_test(internals-test - decimal_type_util_test.cc - random_generator_holder_test.cc - EXTRA_DEPENDENCIES -- LLVM::LLVM_INTERFACE -+ llvm-core::llvm-core - EXTRA_INCLUDES -- $ -+ $ - ${GANDIVA_INTERNALS_TEST_ARGUMENTS}) - - if(ARROW_GANDIVA_JAVA) diff --git a/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch b/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch deleted file mode 100644 index f3268ab..0000000 --- a/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- cpp/src/arrow/CMakeLists.txt -+++ cpp/src/arrow/CMakeLists.txt -@@ -504,6 +504,10 @@ - target_compile_definitions(arrow_static PUBLIC ARROW_STATIC) - endif() - -+if(ARROW_BUILD_SHARED AND WIN32) -+target_compile_definitions(arrow_shared PRIVATE ARROW_EXPORTING) -+endif() -+ - if(ARROW_WITH_BACKTRACE) - find_package(Backtrace) - diff --git a/arrow/all/patches/2.0.0-0005-gandiva-engine.patch b/arrow/all/patches/2.0.0-0005-gandiva-engine.patch deleted file mode 100644 index 9fcc4b1..0000000 --- a/arrow/all/patches/2.0.0-0005-gandiva-engine.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- cpp/src/gandiva/engine.cc -+++ cpp/src/gandiva/engine.cc -@@ -64,6 +64,10 @@ - #include - #include - -+#if GANDIVA_LLVM_VERSION >= 11 -+#include -+#endif -+ - #if defined(_MSC_VER) - #pragma warning(pop) - #endif diff --git a/arrow/all/patches/2.0.0-0008-fix-cmake.patch b/arrow/all/patches/2.0.0-0008-fix-cmake.patch deleted file mode 100644 index 7153d64..0000000 --- a/arrow/all/patches/2.0.0-0008-fix-cmake.patch +++ /dev/null @@ -1,273 +0,0 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index 515e6af..7488161 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -109,7 +109,7 @@ set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support") - set(ARROW_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") - set(ARROW_DOC_DIR "share/doc/${PROJECT_NAME}") - --set(ARROW_LLVM_VERSIONS "10" "9" "8" "7") -+set(ARROW_LLVM_VERSIONS "13" "12" "11" "10" "9" "8" "7") - list(GET ARROW_LLVM_VERSIONS 0 ARROW_LLVM_VERSION_PRIMARY) - string(REGEX - REPLACE "^([0-9]+)(\\..+)?" "\\1" ARROW_LLVM_VERSION_PRIMARY_MAJOR -@@ -667,7 +667,7 @@ endif() - - if(ARROW_WITH_BROTLI) - # Order is important for static linking -- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) -+ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) - list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) - list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) - if(Brotli_SOURCE STREQUAL "SYSTEM") -@@ -683,9 +683,9 @@ if(ARROW_WITH_BZ2) - endif() - - if(ARROW_WITH_LZ4) -- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) -+ list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4) - if(Lz4_SOURCE STREQUAL "SYSTEM") -- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) -+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS lz4::lz4) - endif() - endif() - -@@ -842,8 +842,14 @@ endif() - - if(ARROW_MIMALLOC) - add_definitions(-DARROW_MIMALLOC) -- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) -- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) -+ if (TARGET mimalloc-static) -+ list(APPEND ARROW_LINK_LIBS mimalloc-static) -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc-static) -+ else() -+ list(APPEND ARROW_LINK_LIBS mimalloc) -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) -+ endif() -+ - endif() - - # ---------------------------------------------------------------------- -diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake -index cc37a3c..8fe6db9 100644 ---- a/cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -171,6 +171,7 @@ macro(provide_find_module DEPENDENCY_NAME) - endmacro() - - macro(resolve_dependency DEPENDENCY_NAME) -+if(0) - set(options) - set(one_value_args REQUIRED_VERSION) - cmake_parse_arguments(ARG -@@ -207,6 +208,14 @@ macro(resolve_dependency DEPENDENCY_NAME) - provide_find_module(${DEPENDENCY_NAME}) - list(APPEND ARROW_SYSTEM_DEPENDENCIES ${DEPENDENCY_NAME}) - endif() -+else() -+ if(ARG_REQUIRED_VERSION) -+ find_package(${DEPENDENCY_NAME} ${ARG_REQUIRED_VERSION} REQUIRED) -+ else() -+ find_package(${DEPENDENCY_NAME} REQUIRED) -+ endif() -+ list(APPEND ARROW_SYSTEM_DEPENDENCIES ${DEPENDENCY_NAME}) -+endif() - endmacro() - - # ---------------------------------------------------------------------- -@@ -826,6 +835,7 @@ endif() - # - Tests need Boost at runtime. - # - S3FS and Flight benchmarks need Boost at runtime. - if(ARROW_BUILD_INTEGRATION -+ OR ARROW_BOOST_REQUIRED - OR ARROW_BUILD_TESTS - OR ARROW_GANDIVA - OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) -@@ -846,7 +856,7 @@ if(ARROW_BOOST_REQUIRED) - elseif(BOOST_SOURCE STREQUAL "BUNDLED") - build_boost() - elseif(BOOST_SOURCE STREQUAL "SYSTEM") -- find_package(BoostAlt ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) -+ find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) - endif() - - if(TARGET Boost::system) -@@ -973,11 +983,11 @@ macro(build_brotli) - endmacro() - - if(ARROW_WITH_BROTLI) -- resolve_dependency(Brotli) -+ resolve_dependency(brotli) - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon -+ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon - INTERFACE_INCLUDE_DIRECTORIES) -- include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) -+ include_directories(SYSTEM ${brotli_INCLUDE_DIR}) - endif() - - if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) -@@ -1200,9 +1210,10 @@ if(ARROW_NEED_GFLAGS) - endif() - endif() - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) -+ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) -+ set(GFLAGS_LIBRARIES ${gflags_LIBRARIES}) - -- if(NOT TARGET ${GFLAGS_LIBRARIES}) -+ if(0) - if(TARGET gflags-shared) - set(GFLAGS_LIBRARIES gflags-shared) - elseif(TARGET gflags_shared) -@@ -1291,12 +1302,13 @@ endmacro() - if(ARROW_WITH_THRIFT) - # We already may have looked for Thrift earlier, when considering whether - # to build Boost, so don't look again if already found. -- if(NOT Thrift_FOUND AND NOT THRIFT_FOUND) -+ if(0) - # Thrift c++ code generated by 0.13 requires 0.11 or greater - resolve_dependency(Thrift REQUIRED_VERSION 0.11.0) - endif() -+ find_package(Thrift CONFIG REQUIRED) - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) -+ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) - endif() - - # ---------------------------------------------------------------------- -@@ -1461,6 +1473,7 @@ endif() - # jemalloc - Unix-only high-performance allocator - - if(ARROW_JEMALLOC) -+if(0) - message(STATUS "Building (vendored) jemalloc from source") - # We only use a vendored jemalloc as we want to control its version. - # Also our build of jemalloc is specially prefixed so that it will not -@@ -1519,12 +1532,18 @@ if(ARROW_JEMALLOC) - add_dependencies(jemalloc::jemalloc jemalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) -+else() -+ find_package(jemalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- - # mimalloc - Cross-platform high-performance allocator, from Microsoft - - if(ARROW_MIMALLOC) -+if(0) - message(STATUS "Building (vendored) mimalloc from source") - # We only use a vendored mimalloc as we want to control its build options. - -@@ -1572,6 +1591,11 @@ if(ARROW_MIMALLOC) - add_dependencies(toolchain mimalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) -+else() -+ find_package(mimalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1971,11 +1995,16 @@ macro(build_lz4) - endmacro() - - if(ARROW_WITH_LZ4) -- resolve_dependency(Lz4) -+ resolve_dependency(lz4) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) -- include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) -+ if(TARGET LZ4::lz4_static) -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) -+ else() -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) -+ endif() -+ include_directories(SYSTEM ${lz4_INCLUDE_DIR}) -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${lz4_LIBRARIES_TARGETS} ) - endif() - - macro(build_zstd) -@@ -2090,10 +2119,10 @@ macro(build_re2) - endmacro() - - if(ARROW_GANDIVA) -- resolve_dependency(RE2) -+ resolve_dependency(re2) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(RE2_INCLUDE_DIR RE2::re2 INTERFACE_INCLUDE_DIRECTORIES) -+ get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${RE2_INCLUDE_DIR}) - endif() - -@@ -2541,17 +2570,24 @@ if(ARROW_WITH_GRPC) - endif() - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) -+ if(grpc_INCLUDE_DIRS_RELEASE) -+ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_RELEASE}) -+ elseif(grpc_INCLUDE_DIRS_DEBUG) -+ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_DEBUG}) -+ endif() -+ - include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) -+ include_directories(SYSTEM ${absl_INCLUDE_DIR}) -+ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) - - if(GRPC_VENDORED) - set(GRPCPP_PP_INCLUDE TRUE) - else() - # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp - # depending on the gRPC version. -- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") -+ if(EXISTS ${gRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE TRUE) -- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") -+ elseif(EXISTS ${gRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE FALSE) - else() - message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index 2751254..842fc9e 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -307,10 +307,14 @@ set(ARROW_TESTING_SRCS - - set(_allocator_dependencies "") # Empty list - if(ARROW_JEMALLOC) -- list(APPEND _allocator_dependencies jemalloc_ep) -+ list(APPEND _allocator_dependencies jemalloc::jemalloc) - endif() - if(ARROW_MIMALLOC) -- list(APPEND _allocator_dependencies mimalloc_ep) -+ if (TARGET mimalloc-static) -+ list(APPEND _allocator_dependencies mimalloc-static) -+ else() -+ list(APPEND _allocator_dependencies mimalloc) -+ endif() - endif() - - if(_allocator_dependencies) -diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc -index 784bf7b..8f005a5 100644 ---- a/cpp/src/arrow/memory_pool.cc -+++ b/cpp/src/arrow/memory_pool.cc -@@ -31,7 +31,7 @@ - // Needed to support jemalloc 3 and 4 - #define JEMALLOC_MANGLE - // Explicitly link to our version of jemalloc --#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" -+#include "jemalloc/jemalloc.h" - #endif - - #ifdef ARROW_MIMALLOC diff --git a/arrow/all/test_package/CMakeLists.txt b/arrow/all/test_package/CMakeLists.txt index 9b721bb..bd890a4 100644 --- a/arrow/all/test_package/CMakeLists.txt +++ b/arrow/all/test_package/CMakeLists.txt @@ -4,7 +4,13 @@ project(test_package LANGUAGES CXX) find_package(Arrow REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE arrow::arrow) + +if (TARGET Arrow::arrow_shared) + target_link_libraries(${PROJECT_NAME} PRIVATE Arrow::arrow_shared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE Arrow::arrow_static) +endif() + if (${Arrow_VERSION} VERSION_LESS "10.0.0") target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) else() diff --git a/arrow/all/test_package/CMakeUserPresets.json b/arrow/all/test_package/CMakeUserPresets.json deleted file mode 100644 index 185f8cc..0000000 --- a/arrow/all/test_package/CMakeUserPresets.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 4, - "vendor": { - "conan": {} - }, - "include": [ - "/Users/jiaoew/workspace/conanfiles/arrow/all/test_package/build/Release/generators/CMakePresets.json" - ] -} \ No newline at end of file diff --git a/arrow/all/test_package/conanfile.py b/arrow/all/test_package/conanfile.py index 1111583..a9fb966 100644 --- a/arrow/all/test_package/conanfile.py +++ b/arrow/all/test_package/conanfile.py @@ -4,7 +4,6 @@ import os -# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" diff --git a/arrow/config.yml b/arrow/config.yml index 7d7b464..6d01271 100644 --- a/arrow/config.yml +++ b/arrow/config.yml @@ -1,17 +1,33 @@ versions: - '12.0.0-dev1': + "17.0.0": folder: all - '10.0.1': + "16.1.0": folder: all - '10.0.0': + "16.0.0": folder: all - '8.0.1': + "15.0.0": folder: all - '8.0.0': + "14.0.2": folder: all - '7.0.0': + "14.0.1": folder: all - '2.0.0': + "14.0.0": folder: all - '1.0.0': + "13.0.0": + folder: all + "12.0.1": + folder: all + "12.0.0": + folder: all + "11.0.0": + folder: all + "10.0.1": + folder: all + "10.0.0": + folder: all + "8.0.1": + folder: all + "8.0.0": + folder: all + "7.0.0": folder: all diff --git a/autoconf/all/conandata.yml b/autoconf/all/conandata.yml new file mode 100644 index 0000000..9d182df --- /dev/null +++ b/autoconf/all/conandata.yml @@ -0,0 +1,32 @@ +sources: + "2.72": + url: + - "https://ftpmirror.gnu.org/autoconf/autoconf-2.72.tar.xz" + - "https://ftp.gnu.org/gnu/autoconf/autoconf-2.72.tar.xz" + sha256: "ba885c1319578d6c94d46e9b0dceb4014caafe2490e437a0dbca3f270a223f5a" + "2.71": + url: + - "https://ftpmirror.gnu.org/autoconf/autoconf-2.71.tar.xz" + - "https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz" + sha256: "f14c83cfebcc9427f2c3cea7258bd90df972d92eb26752da4ddad81c87a0faa4" +patches: + "2.72": + - patch_file: "patches/2.72-0001-relocatable-autoconf.patch" + patch_description: "Replace instances where absolute paths are embedded the generated files" + patch_type: "conan" + - patch_file: "patches/2.71-0002-no-perl-path-in-shebang.patch" + patch_description: "Avoid build machine's perl path to be embedded the generated files" + patch_type: "conan" + - patch_file: "patches/2.72-0003-disable-man-regeneration.patch" + patch_description: "Disable man regeneration" + patch_type: "conan" + "2.71": + - patch_file: "patches/2.71-0001-relocatable-autoconf.patch" + patch_description: "Replace instances where absolute paths are embedded the generated files" + patch_type: "conan" + - patch_file: "patches/2.71-0002-no-perl-path-in-shebang.patch" + patch_description: "Avoid build machine's perl path to be embedded the generated files" + patch_type: "conan" + - patch_file: "patches/2.71-0003-disable-man-regeneration.patch" + patch_description: "Disable man regeneration" + patch_type: "conan" diff --git a/autoconf/all/conanfile.py b/autoconf/all/conanfile.py new file mode 100644 index 0000000..048942c --- /dev/null +++ b/autoconf/all/conanfile.py @@ -0,0 +1,119 @@ +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir, apply_conandata_patches, replace_in_file, export_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path, is_msvc +import os + +required_conan_version = ">=1.54.0" + + +class AutoconfConan(ConanFile): + name = "autoconf" + description = ( + "Autoconf is an extensible package of M4 macros that produce shell " + "scripts to automatically configure software source code packages" + ) + license = ("GPL-2.0-or-later", "GPL-3.0-or-later") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/autoconf/" + topics = ("configure", "build") + + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + # TODO: Remove for Conan v2 + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("m4/1.4.19") # Needed at runtime by downstream clients as well + + def package_id(self): + self.info.clear() + + def build_requirements(self): + self.tool_requires("m4/1.4.19") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--datarootdir=${prefix}/res", + ]) + + if self.settings.os == "Windows": + if is_msvc(self): + build = "{}-{}-{}".format( + "x86_64" if self._settings_build.arch == "x86_64" else "i686", + "pc" if self._settings_build.arch == "x86" else "win64", + "mingw32") + host = "{}-{}-{}".format( + "x86_64" if self.settings.arch == "x86_64" else "i686", + "pc" if self.settings.arch == "x86" else "win64", + "mingw32") + tc.configure_args.append(f"--build={build}") + tc.configure_args.append(f"--host={host}") + + env = tc.environment() + env.define_path("INSTALL", unix_path(self, os.path.join(self.source_folder, "build-aux", "install-sh"))) + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"), + "M4 = /usr/bin/env m4", "#M4 = /usr/bin/env m4") + if self._settings_build.os == "Windows": + # Handle vagaries of Windows line endings + replace_in_file(self, os.path.join(self.source_folder, "bin", "autom4te.in"), + "$result =~ s/^\\n//mg;", "$result =~ s/^\\R//mg;") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + autotools.install() + + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "res", "info")) + rmdir(self, os.path.join(self.package_folder, "res", "man")) + + def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.resdirs = ["res"] + + bin_path = os.path.join(self.package_folder, "bin") + self.buildenv_info.define_path("AUTOCONF", os.path.join(bin_path, "autoconf")) + self.buildenv_info.define_path("AUTORECONF", os.path.join(bin_path, "autoreconf")) + self.buildenv_info.define_path("AUTOHEADER", os.path.join(bin_path, "autoheader")) + self.buildenv_info.define_path("AUTOM4TE", os.path.join(bin_path, "autom4te")) + + # TODO: to remove in conan v2 + self.env_info.PATH.append(bin_path) + self.env_info.AUTOCONF = "autoconf" + self.env_info.AUTORECONF = "autoreconf" + self.env_info.AUTOHEADER = "autoheader" + self.env_info.AUTOM4TE = "autom4te" diff --git a/autoconf/all/patches/2.71-0001-relocatable-autoconf.patch b/autoconf/all/patches/2.71-0001-relocatable-autoconf.patch new file mode 100644 index 0000000..ab33a00 --- /dev/null +++ b/autoconf/all/patches/2.71-0001-relocatable-autoconf.patch @@ -0,0 +1,275 @@ +diff --git a/Makefile.in b/Makefile.in +index 22a17b3..ac18c85 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -427,7 +427,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LTLIBOBJS = @LTLIBOBJS@ +-M4 = @M4@ ++M4 = /usr/bin/env m4 + M4_DEBUGFILE = @M4_DEBUGFILE@ + M4_GNU = @M4_GNU@ + MAKEINFO = @MAKEINFO@ +diff --git a/bin/autoconf.as b/bin/autoconf.as +index 1407739..50ad1de 100644 +--- a/bin/autoconf.as ++++ b/bin/autoconf.as +@@ -89,8 +89,17 @@ exit_missing_arg=' + # restore font-lock: ' + + # Variables. +-: ${AUTOM4TE='@bindir@/@autom4te-name@'} +-: ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'} ++# Locate autom4ate and support files relative to current script inside package ++SCRIPT_DIR=$(dirname "$as_myself") ++RES_DIR="$SCRIPT_DIR/../res/autoconf" ++if [[ ! -d "$RES_DIR" ]] ++then ++ echo "Autoconf conan package error, unable to locate resource directory at $RES_DIR\n" ++ exit 1 ++fi ++ ++: ${AUTOM4TE="$SCRIPT_DIR/autom4te"} ++: ${trailer_m4="$RES_DIR/autoconf/trailer.m4"} + autom4te_options= + outfile= + verbose=false +diff --git a/bin/autoheader.in b/bin/autoheader.in +index 1cbf509..9bdd1cf 100644 +--- a/bin/autoheader.in ++++ b/bin/autoheader.in +@@ -29,10 +29,13 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, "$pkgdatadir"; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -54,7 +57,8 @@ use Autom4te::XFile; + our ($config_h, %symbol, %verbatim); + + # Lib files. +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $config_h_in; + my @prepend_include; + my @include; +diff --git a/bin/autom4te.in b/bin/autom4te.in +index 7ebe419..42f09b4 100644 +--- a/bin/autom4te.in ++++ b/bin/autom4te.in +@@ -25,10 +25,13 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -48,7 +51,8 @@ use Autom4te::General; + use Autom4te::XFile; + + # Data directory. +-my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $pkgdatadir = $ENV{'AC_MACRODIR'} || "$scriptpath/../res/autoconf"; + + # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE. + my %language; +@@ -91,7 +95,7 @@ my @include; + my $freeze = 0; + + # $M4. +-my $m4 = $ENV{"M4"} || '@M4@'; ++my $m4 = $ENV{"M4"} || '/usr/bin/env m4'; + # Some non-GNU m4's don't reject the --help option, so give them /dev/null. + fatal "need GNU m4 1.4 or later: $m4" + if system "$m4 --help &1 | grep reload-state >/dev/null"; +@@ -271,6 +275,12 @@ sub load_configuration ($) + if /^\s*(\#.*)?$/; + + my @words = shellwords ($_); ++ # not using: s#AUTOCONF_M4DIR#$pkgdatadir#r to support perl <5.14 ++ my @words_clone = @words; ++ @words = (); ++ foreach ( @words_clone ) { ++ push(@words, do { (my $tmp = $_) =~ s#AUTOCONF_M4DIR#$pkgdatadir#; $tmp }); ++ } + my $type = shift @words; + if ($type eq 'begin-language:') + { +diff --git a/bin/autoreconf.in b/bin/autoreconf.in +index ec391a6..2992b16 100644 +--- a/bin/autoreconf.in ++++ b/bin/autoreconf.in +@@ -28,11 +28,14 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + my $buildauxdir; + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + $buildauxdir = $ENV{'autom4te_buildauxdir'} || $pkgdatadir . '/build-aux'; +@@ -117,9 +120,10 @@ Written by David J. MacKenzie and Akim Demaille. + "; + + # Lib files. +-my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@'; +-my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@'; +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autoconf = $ENV{'AUTOCONF'} || "$scriptpath/@autoconf-name@"; ++my $autoheader = $ENV{'AUTOHEADER'} || "$scriptpath/@autoheader-name@"; ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $automake = $ENV{'AUTOMAKE'} || 'automake'; + my $aclocal = $ENV{'ACLOCAL'} || 'aclocal'; + my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize'; +diff --git a/bin/autoscan.in b/bin/autoscan.in +index b89fd1a..6113d62 100644 +--- a/bin/autoscan.in ++++ b/bin/autoscan.in +@@ -27,10 +27,13 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -95,7 +98,8 @@ my %needed_macros = + my $log; + + # Autoconf and lib files. +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $autoconf = "$autom4te --language=autoconf"; + my @prepend_include; + my @include = ('@pkgdatadir@'); +diff --git a/bin/autoupdate.in b/bin/autoupdate.in +index c86203a..844dd20 100644 +--- a/bin/autoupdate.in ++++ b/bin/autoupdate.in +@@ -28,10 +28,13 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -51,14 +54,15 @@ use Autom4te::General; + use Autom4te::XFile; + + # Lib files. +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $autoconf = "$autom4te --language=autoconf"; + # We need to find m4sugar. + my @prepend_include; + my @include = ('@pkgdatadir@'); + my $force = 0; + # m4. +-my $m4 = $ENV{"M4"} || '@M4@'; ++my $m4 = $ENV{"M4"} || '/usr/bin/env m4'; + + + # $HELP +diff --git a/bin/ifnames.in b/bin/ifnames.in +index b04947f..75d014e 100644 +--- a/bin/ifnames.in ++++ b/bin/ifnames.in +@@ -32,10 +32,13 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac' + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +diff --git a/lib/autom4te.in b/lib/autom4te.in +index 9e86c9f..bf3ae42 100644 +--- a/lib/autom4te.in ++++ b/lib/autom4te.in +@@ -115,7 +115,7 @@ end-language: "Autoreconf-preselections" + # This intermediate language is used by aclocal to build aclocal.m4. + + begin-language: "Autoconf-without-aclocal-m4" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: --cache=autom4te.cache + args: autoconf/autoconf.m4f + args: acsite.m4? +@@ -142,7 +142,7 @@ end-language: "Autoconf" + ## -------- ## + + begin-language: "Autotest" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: autotest/autotest.m4f + args: package.m4? + args: local.at? +@@ -156,7 +156,7 @@ end-language: "Autotest" + ## ---- ## + + begin-language: "M4sh" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: m4sugar/m4sh.m4f + args: --mode 777 + args: --language M4sugar +@@ -168,6 +168,6 @@ end-language: "M4sh" + ## ------- ## + + begin-language: "M4sugar" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: m4sugar/m4sugar.m4f + end-language: "M4sugar" diff --git a/autoconf/all/patches/2.71-0002-no-perl-path-in-shebang.patch b/autoconf/all/patches/2.71-0002-no-perl-path-in-shebang.patch new file mode 100644 index 0000000..6fcfe26 --- /dev/null +++ b/autoconf/all/patches/2.71-0002-no-perl-path-in-shebang.patch @@ -0,0 +1,48 @@ +--- bin/autoheader.in ++++ bin/autoheader.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/env perl + # -*- Perl -*- + # @configure_input@ + +--- bin/autom4te.in ++++ bin/autom4te.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/env perl + # -*- perl -*- + # @configure_input@ + +--- bin/autoreconf.in ++++ bin/autoreconf.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/env perl + # -*- perl -*- + # @configure_input@ + +--- bin/autoscan.in ++++ bin/autoscan.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/env perl + # -*- perl -*- + # @configure_input@ + +--- bin/autoupdate.in ++++ bin/autoupdate.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/env perl + # -*- perl -*- + # @configure_input@ + +--- bin/ifnames.in ++++ bin/ifnames.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/env perl + # -*- perl -*- + # @configure_input@ + diff --git a/autoconf/all/patches/2.71-0003-disable-man-regeneration.patch b/autoconf/all/patches/2.71-0003-disable-man-regeneration.patch new file mode 100644 index 0000000..1e29ca1 --- /dev/null +++ b/autoconf/all/patches/2.71-0003-disable-man-regeneration.patch @@ -0,0 +1,23 @@ +--- Makefile.in ++++ Makefile.in +@@ -2202,13 +2203,13 @@ + + .PHONY: install-data-hook install-data-hook-make-aux-scripts-executable + +-man/autoconf.1: $(common_dep) man/autoconf.w man/autoconf.x $(binsrcdir)/autoconf.as +-man/autoheader.1: $(common_dep) man/autoheader.w man/autoheader.x $(binsrcdir)/autoheader.in +-man/autom4te.1: $(common_dep) man/autom4te.w man/autom4te.x $(binsrcdir)/autom4te.in +-man/autoreconf.1: $(common_dep) man/autoreconf.w man/autoreconf.x $(binsrcdir)/autoreconf.in +-man/autoscan.1: $(common_dep) man/autoscan.w man/autoscan.x $(binsrcdir)/autoscan.in +-man/autoupdate.1: $(common_dep) man/autoupdate.w man/autoupdate.x $(binsrcdir)/autoupdate.in +-man/ifnames.1: $(common_dep) man/ifnames.w man/ifnames.x $(binsrcdir)/ifnames.in ++#man/autoconf.1: $(common_dep) man/autoconf.w man/autoconf.x $(binsrcdir)/autoconf.as ++#man/autoheader.1: $(common_dep) man/autoheader.w man/autoheader.x $(binsrcdir)/autoheader.in ++#man/autom4te.1: $(common_dep) man/autom4te.w man/autom4te.x $(binsrcdir)/autom4te.in ++#man/autoreconf.1: $(common_dep) man/autoreconf.w man/autoreconf.x $(binsrcdir)/autoreconf.in ++#man/autoscan.1: $(common_dep) man/autoscan.w man/autoscan.x $(binsrcdir)/autoscan.in ++#man/autoupdate.1: $(common_dep) man/autoupdate.w man/autoupdate.x $(binsrcdir)/autoupdate.in ++#man/ifnames.1: $(common_dep) man/ifnames.w man/ifnames.x $(binsrcdir)/ifnames.in + + .w.1: + @echo "Updating man page $@" diff --git a/autoconf/all/patches/2.72-0001-relocatable-autoconf.patch b/autoconf/all/patches/2.72-0001-relocatable-autoconf.patch new file mode 100644 index 0000000..a7ebbaa --- /dev/null +++ b/autoconf/all/patches/2.72-0001-relocatable-autoconf.patch @@ -0,0 +1,262 @@ +diff --git a/Makefile.in b/Makefile.in +--- a/Makefile.in ++++ b/Makefile.in +@@ -427,7 +427,7 @@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LTLIBOBJS = @LTLIBOBJS@ +-M4 = @M4@ ++M4 = /usr/bin/env m4 + M4_DEBUGFILE = @M4_DEBUGFILE@ + M4_GNU = @M4_GNU@ + MAKEINFO = @MAKEINFO@ +diff --git a/bin/autoconf.in b/bin/autoconf.in +--- a/bin/autoconf.in ++++ b/bin/autoconf.in +@@ -26,10 +26,14 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; ++ $ENV{'trailer_m4'} ||= "$pkgdatadir/autoconf/trailer.m4"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +diff --git a/bin/autoheader.in b/bin/autoheader.in +--- a/bin/autoheader.in ++++ b/bin/autoheader.in +@@ -29,10 +29,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, "$pkgdatadir"; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -54,7 +57,8 @@ + our ($config_h, %symbol, %verbatim); + + # Lib files. +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $config_h_in; + my @prepend_include; + my @include; +diff --git a/bin/autom4te.in b/bin/autom4te.in +--- a/bin/autom4te.in ++++ b/bin/autom4te.in +@@ -25,10 +25,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -48,7 +51,8 @@ + use Autom4te::XFile; + + # Data directory. +-my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $pkgdatadir = $ENV{'AC_MACRODIR'} || "$scriptpath/../res/autoconf"; + + # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE. + my %language; +@@ -91,7 +95,7 @@ + my $freeze = 0; + + # $M4. +-my $m4 = $ENV{"M4"} || '@M4@'; ++my $m4 = $ENV{"M4"} || '/usr/bin/env m4'; + # Some non-GNU m4's don't reject the --help option, so give them /dev/null. + fatal "need GNU m4 1.4 or later: $m4" + if system "$m4 --help &1 | grep reload-state >/dev/null"; +@@ -321,6 +325,12 @@ + if /^\s*(\#.*)?$/; + + my @words = shellwords ($_); ++ # not using: s#AUTOCONF_M4DIR#$pkgdatadir#r to support perl <5.14 ++ my @words_clone = @words; ++ @words = (); ++ foreach ( @words_clone ) { ++ push(@words, do { (my $tmp = $_) =~ s#AUTOCONF_M4DIR#$pkgdatadir#; $tmp }); ++ } + my $type = shift @words; + if ($type eq 'begin-language:') + { +diff --git a/bin/autoreconf.in b/bin/autoreconf.in +--- a/bin/autoreconf.in ++++ b/bin/autoreconf.in +@@ -28,11 +28,14 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + my $buildauxdir; + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + $buildauxdir = $ENV{'autom4te_buildauxdir'} || $pkgdatadir . '/build-aux'; +@@ -116,9 +119,10 @@ + "; + + # Lib files. +-my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@'; +-my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@'; +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autoconf = $ENV{'AUTOCONF'} || "$scriptpath/@autoconf-name@"; ++my $autoheader = $ENV{'AUTOHEADER'} || "$scriptpath/@autoheader-name@"; ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $automake = $ENV{'AUTOMAKE'} || 'automake'; + my $aclocal = $ENV{'ACLOCAL'} || 'aclocal'; + my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize'; +diff --git a/bin/autoscan.in b/bin/autoscan.in +--- a/bin/autoscan.in ++++ b/bin/autoscan.in +@@ -27,10 +27,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -95,7 +98,8 @@ + my $log; + + # Autoconf and lib files. +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $autoconf = "$autom4te --language=autoconf"; + my @prepend_include; + my @include = ('@pkgdatadir@'); +diff --git a/bin/autoupdate.in b/bin/autoupdate.in +--- a/bin/autoupdate.in ++++ b/bin/autoupdate.in +@@ -28,10 +28,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -51,14 +54,15 @@ + use Autom4te::XFile; + + # Lib files. +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $autoconf = "$autom4te --language=autoconf"; + # We need to find m4sugar. + my @prepend_include; + my @include = ('@pkgdatadir@'); + my $force = 0; + # m4. +-my $m4 = $ENV{"M4"} || '@M4@'; ++my $m4 = $ENV{"M4"} || '/usr/bin/env m4'; + + + # $HELP +diff --git a/bin/ifnames.in b/bin/ifnames.in +--- a/bin/ifnames.in ++++ b/bin/ifnames.in +@@ -32,10 +32,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +diff --git a/lib/autom4te.in b/lib/autom4te.in +--- a/lib/autom4te.in ++++ b/lib/autom4te.in +@@ -115,7 +115,7 @@ + # This intermediate language is used by aclocal to build aclocal.m4. + + begin-language: "Autoconf-without-aclocal-m4" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: --cache=autom4te.cache + args: autoconf/autoconf.m4f + args: acsite.m4? +@@ -142,7 +142,7 @@ + ## -------- ## + + begin-language: "Autotest" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: autotest/autotest.m4f + args: package.m4? + args: local.at? +@@ -156,7 +156,7 @@ + ## ---- ## + + begin-language: "M4sh" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: m4sugar/m4sh.m4f + args: --mode 777 + args: --language M4sugar +@@ -168,6 +168,6 @@ + ## ------- ## + + begin-language: "M4sugar" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: m4sugar/m4sugar.m4f + end-language: "M4sugar" diff --git a/autoconf/all/patches/2.72-0003-disable-man-regeneration.patch b/autoconf/all/patches/2.72-0003-disable-man-regeneration.patch new file mode 100644 index 0000000..af2e738 --- /dev/null +++ b/autoconf/all/patches/2.72-0003-disable-man-regeneration.patch @@ -0,0 +1,12 @@ +--- Makefile.in ++++ Makefile.in +@@ -2171,9 +2171,2 @@ + .PHONY: install-data-hook install-data-hook-make-aux-scripts-executable + +-man/autoconf.1: $(common_dep) man/autoconf.w man/autoconf.x $(binsrcdir)/autoconf.in +-man/autoheader.1: $(common_dep) man/autoheader.w man/autoheader.x $(binsrcdir)/autoheader.in +-man/autom4te.1: $(common_dep) man/autom4te.w man/autom4te.x $(binsrcdir)/autom4te.in +-man/autoreconf.1: $(common_dep) man/autoreconf.w man/autoreconf.x $(binsrcdir)/autoreconf.in +-man/autoscan.1: $(common_dep) man/autoscan.w man/autoscan.x $(binsrcdir)/autoscan.in +-man/autoupdate.1: $(common_dep) man/autoupdate.w man/autoupdate.x $(binsrcdir)/autoupdate.in +-man/ifnames.1: $(common_dep) man/ifnames.w man/ifnames.x $(binsrcdir)/ifnames.in diff --git a/autoconf/all/test_package/Makefile.in b/autoconf/all/test_package/Makefile.in new file mode 100644 index 0000000..193ade8 --- /dev/null +++ b/autoconf/all/test_package/Makefile.in @@ -0,0 +1,14 @@ +# @configure_input@ + +SRCS = test_package_c.c test_package_cpp.cpp + +OBJS := $(patsubst %.c,%.@OBJEXT@,$(patsubst %.cpp,%.@OBJEXT@,$(SRCS))) + +test_package@EXEEXT@: $(OBJS) + @CXX@ @CXXFLAGS@ @LDFLAGS@ $^ -o $@ + +%.@OBJEXT@: %.cpp + @CXX@ @CXXFLAGS@ @CPPFLAGS@ -c $< @CC_MINUS_O@ $@ + +%.@OBJEXT@: %.c + @CC@ @CFLAGS@ @CPPFLAGS@ -c $< @CC_MINUS_O@ $@ diff --git a/autoconf/all/test_package/conanfile.py b/autoconf/all/test_package/conanfile.py new file mode 100644 index 0000000..540a389 --- /dev/null +++ b/autoconf/all/test_package/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import copy +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + win_bash = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def layout(self): + basic_layout(self) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.generate() + if is_msvc(self): + env = Environment() + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + env.vars(self).save_script("conanbuild_msvc") + + def build(self): + for src in ("configure.ac", "config.h.in", "Makefile.in", "test_package_c.c", "test_package_cpp.cpp"): + copy(self, src, self.source_folder, self.build_folder) + self.run("autoconf --verbose") + autotools = Autotools(self) + autotools.configure(build_script_folder=self.build_folder) + autotools.make() + + def test(self): + self.win_bash = None + if can_run(self): + bin_path = os.path.join(self.build_folder, "test_package") + self.run(bin_path, env="conanrun") diff --git a/autoconf/all/test_package/config.h.in b/autoconf/all/test_package/config.h.in new file mode 100644 index 0000000..93f81d1 --- /dev/null +++ b/autoconf/all/test_package/config.h.in @@ -0,0 +1,23 @@ +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Version number of package */ +#undef VERSION diff --git a/autoconf/all/test_package/configure.ac b/autoconf/all/test_package/configure.ac new file mode 100644 index 0000000..ae0a54a --- /dev/null +++ b/autoconf/all/test_package/configure.ac @@ -0,0 +1,25 @@ +# Must init the autoconf setup +# The first parameter is project name +# second is version number +# third is bug report address +AC_INIT([test_package], [1.0]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package_c.c]) + +# Store the auxiliary build tools (e.g., install-sh, config.sub, config.guess) +# in this dir (build-aux) + +AC_CONFIG_FILES(Makefile) +AC_CONFIG_HEADER([config.h]) + +AC_PROG_CC +AC_PROG_CXX + +AC_PROG_CC_C_O + +AC_MSG_NOTICE("ac_cv_prog_cc_${ac_cc} is $ac_cv_prog_cc_${ac_cc}") +AS_IF([eval test \$ac_cv_prog_cc_${ac_cc}_c_o = "yes"], + [AC_SUBST([CC_MINUS_O], ["-o"])],[AC_SUBST([CC_MINUS_O], [""])]) + +AC_OUTPUT diff --git a/autoconf/all/test_package/test_package_c.c b/autoconf/all/test_package/test_package_c.c new file mode 100644 index 0000000..cd3baf2 --- /dev/null +++ b/autoconf/all/test_package/test_package_c.c @@ -0,0 +1,8 @@ +#include "config.h" + +#include + +int hello_from_c(void) { + printf("Hello world (" PACKAGE_NAME ") from c!\n"); + return 0; +} diff --git a/autoconf/all/test_package/test_package_cpp.cpp b/autoconf/all/test_package/test_package_cpp.cpp new file mode 100644 index 0000000..01bf15d --- /dev/null +++ b/autoconf/all/test_package/test_package_cpp.cpp @@ -0,0 +1,17 @@ +#include "config.h" + +#include + +extern "C" { +int hello_from_c(void); +} + +void hello_from_cxx() { + std::cout << "Hello world (" PACKAGE_NAME ") from c++!\n"; +} + +int main() { + hello_from_cxx(); + hello_from_c(); + return 0; +} diff --git a/autoconf/all/test_v1_package/conanfile.py b/autoconf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..7098a4c --- /dev/null +++ b/autoconf/all/test_v1_package/conanfile.py @@ -0,0 +1,45 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conan.tools.files import copy +from conan.tools.microsoft import is_msvc +import contextlib +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + @contextlib.contextmanager + def _build_context(self): + if is_msvc(self): + with tools.vcvars(self): + with tools.environment_append({"CC": "cl -nologo", "CXX": "cl -nologo",}): + yield + else: + yield + + def build(self): + for src in ("configure.ac", "config.h.in", "Makefile.in", "test_package_c.c", "test_package_cpp.cpp"): + copy(self, src, os.path.join(self.source_folder, os.pardir, "test_package"), self.build_folder) + self.run("autoconf --verbose", win_bash=tools.os_info.is_windows) + self.run("{} --help".format(os.path.join(self.build_folder, "configure").replace("\\", "/")), + win_bash=tools.os_info.is_windows) + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + if is_msvc(self): + autotools.flags.append("-FS") + with self._build_context(): + autotools.configure() + autotools.make() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join(".", "test_package"), run_environment=True) diff --git a/autoconf/config.yml b/autoconf/config.yml new file mode 100644 index 0000000..946e15e --- /dev/null +++ b/autoconf/config.yml @@ -0,0 +1,5 @@ +versions: + "2.72": + folder: all + "2.71": + folder: all diff --git a/automake/all/conandata.yml b/automake/all/conandata.yml new file mode 100644 index 0000000..19afbb0 --- /dev/null +++ b/automake/all/conandata.yml @@ -0,0 +1,54 @@ +sources: + "1.16.5": + url: "https://ftp.gnu.org/gnu/automake/automake-1.16.5.tar.gz" + sha256: "07bd24ad08a64bc17250ce09ec56e921d6343903943e99ccf63bbf0705e34605" + "1.16.4": + url: "https://ftp.gnu.org/gnu/automake/automake-1.16.4.tar.gz" + sha256: "8a0f0be7aaae2efa3a68482af28e5872d8830b9813a6a932a2571eac63ca1794" + "1.16.3": + url: "https://ftp.gnu.org/gnu/automake/automake-1.16.3.tar.gz" + sha256: "ce010788b51f64511a1e9bb2a1ec626037c6d0e7ede32c1c103611b9d3cba65f" + "1.16.2": + url: "https://ftp.gnu.org/gnu/automake/automake-1.16.2.tar.gz" + sha256: "b2f361094b410b4acbf4efba7337bdb786335ca09eb2518635a09fb7319ca5c1" +patches: + "1.16.5": + - patch_file: "patches/0001-help2man-no-discard-stderr-1.16.5.patch" + patch_description: "help2man no discard stderr" + patch_type: "portability" + - patch_file: "patches/0002-no-perl-path-in-shebang-1.16.5.patch" + patch_description: "no perl path in shebang" + patch_type: "portability" + - patch_file: "patches/0003-relocatable-automake-1.16.5.patch" + patch_description: "relocatable automake" + patch_type: "portability" + "1.16.4": + - patch_file: "patches/0001-help2man-no-discard-stderr-1.16.4.patch" + patch_description: "help2man no discard stderr" + patch_type: "portability" + - patch_file: "patches/0002-no-perl-path-in-shebang-1.16.4.patch" + patch_description: "no perl path in shebang" + patch_type: "portability" + - patch_file: "patches/0003-relocatable-automake-1.16.4.patch" + patch_description: "relocatable automake" + patch_type: "portability" + "1.16.3": + - patch_file: "patches/0001-help2man-no-discard-stderr-1.16.3.patch" + patch_description: "help2man no discard stderr" + patch_type: "portability" + - patch_file: "patches/0002-no-perl-path-in-shebang-1.16.3.patch" + patch_description: "no perl path in shebang" + patch_type: "portability" + - patch_file: "patches/0003-relocatable-automake-1.16.3.patch" + patch_description: "relocatable automake" + patch_type: "portability" + "1.16.2": + - patch_file: "patches/0001-help2man-no-discard-stderr-1.16.2.patch" + patch_description: "help2man no discard stderr" + patch_type: "portability" + - patch_file: "patches/0002-no-perl-path-in-shebang-1.16.2.patch" + patch_description: "no perl path in shebang" + patch_type: "portability" + - patch_file: "patches/0003-relocatable-automake-1.16.2.patch" + patch_description: "relocatable automake" + patch_type: "portability" diff --git a/automake/all/conanfile.py b/automake/all/conanfile.py new file mode 100644 index 0000000..1d44aec --- /dev/null +++ b/automake/all/conanfile.py @@ -0,0 +1,133 @@ +import os + +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class AutomakeConan(ConanFile): + name = "automake" + description = ( + "Automake is a tool for automatically generating Makefile.in files" + " compliant with the GNU Coding Standards." + ) + license = ("GPL-2.0-or-later", "GPL-3.0-or-later") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/automake/" + topics = ("autotools", "configure", "build") + + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("autoconf/2.71") + # automake requires perl-Thread-Queue package + + def package_id(self): + del self.info.settings.arch + del self.info.settings.compiler + del self.info.settings.build_type + + def build_requirements(self): + if hasattr(self, "settings_build"): + self.tool_requires("autoconf/2.71") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--datarootdir=${prefix}/res", + ]) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if self.settings.os == "Windows": + # tracing using m4 on Windows returns Windows paths => use cygpath to convert to unix paths + ac_local_in = os.path.join(self.source_folder, "bin", "aclocal.in") + replace_in_file(self, ac_local_in, + " $map_traced_defs{$arg1} = $file;", + " $file = `cygpath -u $file`;\n" + " $file =~ s/^\\s+|\\s+$//g;\n" + " $map_traced_defs{$arg1} = $file;") + # handle relative paths during aclocal.m4 creation + replace_in_file(self, ac_local_in, "$map{$m} eq $map_traced_defs{$m}", + "abs_path($map{$m}) eq abs_path($map_traced_defs{$m})") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + @property + def _datarootdir(self): + return os.path.join(self.package_folder, "res") + + def package(self): + autotools = Autotools(self) + autotools.install() + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + rmdir(self, os.path.join(self._datarootdir, "info")) + rmdir(self, os.path.join(self._datarootdir, "man")) + rmdir(self, os.path.join(self._datarootdir, "doc")) + + # TODO: consider whether the following is still necessary on Windows + if self.settings.os == "Windows": + binpath = os.path.join(self.package_folder, "bin") + for filename in os.listdir(binpath): + fullpath = os.path.join(binpath, filename) + if not os.path.isfile(fullpath): + continue + os.rename(fullpath, fullpath + ".exe") + + @property + def _automake_libdir(self): + ver = Version(self.version) + return os.path.join(self._datarootdir, f"automake-{ver.major}.{ver.minor}") + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.resdirs = ["res"] + + # For consumers with new integrations (Conan 1 and 2 compatible): + compile_wrapper = os.path.join(self._automake_libdir, "compile") + lib_wrapper = os.path.join(self._automake_libdir, "ar-lib") + self.conf_info.define("user.automake:compile-wrapper", compile_wrapper) + self.conf_info.define("user.automake:lib-wrapper", lib_wrapper) + + # For legacy Conan 1.x consumers only: + self.user_info.compile = compile_wrapper + self.user_info.ar_lib = lib_wrapper + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/automake/all/patches/0001-help2man-no-discard-stderr-1.16.2.patch b/automake/all/patches/0001-help2man-no-discard-stderr-1.16.2.patch new file mode 100644 index 0000000..8caedb3 --- /dev/null +++ b/automake/all/patches/0001-help2man-no-discard-stderr-1.16.2.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index 670f97a..feb1085 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -699,7 +699,7 @@ man1_MANS = \ + update_mans = \ + $(AM_V_GEN): \ + && $(MKDIR_P) doc \ +- && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --output=$@ ++ && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --no-discard-stderr --output=$@ + + amhello_sources = \ + doc/amhello/configure.ac \ diff --git a/automake/all/patches/0001-help2man-no-discard-stderr-1.16.3.patch b/automake/all/patches/0001-help2man-no-discard-stderr-1.16.3.patch new file mode 100644 index 0000000..e6fc1e3 --- /dev/null +++ b/automake/all/patches/0001-help2man-no-discard-stderr-1.16.3.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index 3190a66..c599705 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -711,7 +711,7 @@ man1_MANS = \ + update_mans = \ + $(AM_V_GEN): \ + && $(MKDIR_P) doc \ +- && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --output=$@ ++ && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --no-discard-stderr --output=$@ + + checklinkx = $(top_srcdir)/contrib/checklinkx + # that 4-second sleep seems to be what gnu.org likes. diff --git a/automake/all/patches/0001-help2man-no-discard-stderr-1.16.4.patch b/automake/all/patches/0001-help2man-no-discard-stderr-1.16.4.patch new file mode 100644 index 0000000..aec1e1e --- /dev/null +++ b/automake/all/patches/0001-help2man-no-discard-stderr-1.16.4.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index bbe2d04..3a0f57e 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -703,7 +703,7 @@ man1_MANS = \ + update_mans = \ + $(AM_V_GEN): \ + && $(MKDIR_P) doc \ +- && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --output=$@ ++ && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --no-discard-stderr --output=$@ + + checklinkx = $(top_srcdir)/contrib/checklinkx + # that 4-second sleep seems to be what gnu.org likes. diff --git a/automake/all/patches/0001-help2man-no-discard-stderr-1.16.5.patch b/automake/all/patches/0001-help2man-no-discard-stderr-1.16.5.patch new file mode 100644 index 0000000..c593ef1 --- /dev/null +++ b/automake/all/patches/0001-help2man-no-discard-stderr-1.16.5.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index 18850e7..ae75282 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -703,7 +703,7 @@ man1_MANS = \ + update_mans = \ + $(AM_V_GEN): \ + && $(MKDIR_P) doc \ +- && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --output=$@ ++ && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --no-discard-stderr --output=$@ + + checklinkx = $(top_srcdir)/contrib/checklinkx + # that 4-second sleep seems to be what gnu.org likes. diff --git a/automake/all/patches/0002-no-perl-path-in-shebang-1.16.2.patch b/automake/all/patches/0002-no-perl-path-in-shebang-1.16.2.patch new file mode 100644 index 0000000..6293541 --- /dev/null +++ b/automake/all/patches/0002-no-perl-path-in-shebang-1.16.2.patch @@ -0,0 +1,46 @@ +diff --git a/Makefile.in b/Makefile.in +index feb1085..5d2f5cc 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -524,7 +524,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ +-PERL = @PERL@ ++PERL = /usr/bin/env perl + RELEASE_YEAR = @RELEASE_YEAR@ + SET_MAKE = @SET_MAKE@ + SHELL = @SHELL@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index 9a20325..0a4eac4 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -1,4 +1,4 @@ +-#!@PERL@ -w ++#!/usr/bin/env perl + # aclocal - create aclocal.m4 by scanning configure.ac -*- perl -*- + # @configure_input@ + # Copyright (C) 1996-2020 Free Software Foundation, Inc. +diff --git a/bin/automake.in b/bin/automake.in +index 212cb38..cb077a7 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -1,4 +1,4 @@ +-#!@PERL@ -w ++#!/usr/bin/env perl + # automake - create Makefile.in from Makefile.am -*- perl -*- + # @configure_input@ + # Copyright (C) 1994-2020 Free Software Foundation, Inc. +diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in +index dff88b7..20b012f 100644 +--- a/t/ax/test-defs.in ++++ b/t/ax/test-defs.in +@@ -97,7 +97,7 @@ SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL + # User can override various tools used. Prefer overriding specific for + # that automake testsuite, if they are available. + AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}} +-PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}} ++PERL=${AM_TESTSUITE_PERL-${PERL-'/usr/bin/env perl'}} + MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}} + YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}} + LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}} diff --git a/automake/all/patches/0002-no-perl-path-in-shebang-1.16.3.patch b/automake/all/patches/0002-no-perl-path-in-shebang-1.16.3.patch new file mode 100644 index 0000000..1a24e6d --- /dev/null +++ b/automake/all/patches/0002-no-perl-path-in-shebang-1.16.3.patch @@ -0,0 +1,46 @@ +diff --git a/Makefile.in b/Makefile.in +index c599705..8c18ed2 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -535,7 +535,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ +-PERL = @PERL@ ++PERL = /usr/bin/env perl + RELEASE_YEAR = @RELEASE_YEAR@ + SET_MAKE = @SET_MAKE@ + SHELL = @SHELL@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index ca2f963..8782f24 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -1,4 +1,4 @@ +-#!@PERL@ ++#!/usr/bin/env perl + # aclocal - create aclocal.m4 by scanning configure.ac -*- perl -*- + # @configure_input@ + # Copyright (C) 1996-2020 Free Software Foundation, Inc. +diff --git a/bin/automake.in b/bin/automake.in +index 31c7238..e41b1f5 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -1,4 +1,4 @@ +-#!@PERL@ ++#!/usr/bin/env perl + # automake - create Makefile.in from Makefile.am -*- perl -*- + # @configure_input@ + # Copyright (C) 1994-2020 Free Software Foundation, Inc. +diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in +index dff88b7..20b012f 100644 +--- a/t/ax/test-defs.in ++++ b/t/ax/test-defs.in +@@ -97,7 +97,7 @@ SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL + # User can override various tools used. Prefer overriding specific for + # that automake testsuite, if they are available. + AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}} +-PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}} ++PERL=${AM_TESTSUITE_PERL-${PERL-'/usr/bin/env perl'}} + MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}} + YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}} + LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}} diff --git a/automake/all/patches/0002-no-perl-path-in-shebang-1.16.4.patch b/automake/all/patches/0002-no-perl-path-in-shebang-1.16.4.patch new file mode 100644 index 0000000..e4e77c4 --- /dev/null +++ b/automake/all/patches/0002-no-perl-path-in-shebang-1.16.4.patch @@ -0,0 +1,46 @@ +diff --git a/Makefile.in b/Makefile.in +index 3a0f57e..4bdcf55 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -527,7 +527,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ +-PERL = @PERL@ ++PERL = /usr/bin/env perl + RELEASE_YEAR = @RELEASE_YEAR@ + SET_MAKE = @SET_MAKE@ + SHELL = @SHELL@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index f112447..a63ce4d 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -1,4 +1,4 @@ +-#!@PERL@ ++#!/usr/bin/env perl + # aclocal - create aclocal.m4 by scanning configure.ac -*- perl -*- + # @configure_input@ + # Copyright (C) 1996-2021 Free Software Foundation, Inc. +diff --git a/bin/automake.in b/bin/automake.in +index f04f5d5..4502558 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -1,4 +1,4 @@ +-#!@PERL@ ++#!/usr/bin/env perl + # automake - create Makefile.in from Makefile.am -*- perl -*- + # @configure_input@ + # Copyright (C) 1994-2021 Free Software Foundation, Inc. +diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in +index c404b0e..381d965 100644 +--- a/t/ax/test-defs.in ++++ b/t/ax/test-defs.in +@@ -97,7 +97,7 @@ SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL + # User can override various tools used. Prefer overriding specific for + # that automake testsuite, if they are available. + AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}} +-PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}} ++PERL=${AM_TESTSUITE_PERL-${PERL-'/usr/bin/env perl'}} + MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}} + YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}} + LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}} diff --git a/automake/all/patches/0002-no-perl-path-in-shebang-1.16.5.patch b/automake/all/patches/0002-no-perl-path-in-shebang-1.16.5.patch new file mode 100644 index 0000000..aa3b831 --- /dev/null +++ b/automake/all/patches/0002-no-perl-path-in-shebang-1.16.5.patch @@ -0,0 +1,46 @@ +diff --git a/Makefile.in b/Makefile.in +index ae75282..55844e7 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -527,7 +527,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ +-PERL = @PERL@ ++PERL = /usr/bin/env perl + RELEASE_YEAR = @RELEASE_YEAR@ + SET_MAKE = @SET_MAKE@ + SHELL = @SHELL@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index f112447..a63ce4d 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -1,4 +1,4 @@ +-#!@PERL@ ++#!/usr/bin/env perl + # aclocal - create aclocal.m4 by scanning configure.ac -*- perl -*- + # @configure_input@ + # Copyright (C) 1996-2021 Free Software Foundation, Inc. +diff --git a/bin/automake.in b/bin/automake.in +index 30babd6..d499bfd 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -1,4 +1,4 @@ +-#!@PERL@ ++#!/usr/bin/env perl + # automake - create Makefile.in from Makefile.am -*- perl -*- + # @configure_input@ + # Copyright (C) 1994-2021 Free Software Foundation, Inc. +diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in +index c404b0e..381d965 100644 +--- a/t/ax/test-defs.in ++++ b/t/ax/test-defs.in +@@ -97,7 +97,7 @@ SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL + # User can override various tools used. Prefer overriding specific for + # that automake testsuite, if they are available. + AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}} +-PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}} ++PERL=${AM_TESTSUITE_PERL-${PERL-'/usr/bin/env perl'}} + MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}} + YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}} + LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}} diff --git a/automake/all/patches/0003-relocatable-automake-1.16.2.patch b/automake/all/patches/0003-relocatable-automake-1.16.2.patch new file mode 100644 index 0000000..c7d66e2 --- /dev/null +++ b/automake/all/patches/0003-relocatable-automake-1.16.2.patch @@ -0,0 +1,106 @@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index 0a4eac4..487b93d 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -18,10 +18,13 @@ + + # Written by Tom Tromey , and + # Alexandre Duret-Lutz . ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + } + +@@ -61,9 +64,16 @@ $perl_threads = 0; + # @system_includes can be augmented with the 'dirlist' file or the + # ACLOCAL_PATH environment variable, and reset with the '--system-acdir' + # option. ++my $scriptpath = abs_path(dirname(__FILE__)); + my @user_includes = (); +-my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION); +-my @system_includes = ('@datadir@/aclocal'); ++my @automake_includes = ("$scriptpath/../res/aclocal-" . $APIVERSION); ++my @system_includes = ("$scriptpath/../res/aclocal"); ++my @conan_includes; ++foreach my $conandir (uniq(split(/[:;]/, $ENV{'AUTOMAKE_CONAN_INCLUDES'} || ""))) ++{ ++ push (@conan_includes, $conandir) if $conandir ne '' && -d $conandir; ++ ++} + + # Whether we should copy M4 file in $user_includes[0]. + my $install = 0; +@@ -445,6 +455,7 @@ sub scan_m4_files () + } + scan_m4_dirs (FT_AUTOMAKE, SCAN_M4_DIRS_ERROR, @automake_includes); + scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @system_includes); ++ scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @conan_includes); + + # Construct a new function that does the searching. We use a + # function (instead of just evaluating $search in the loop) so that +@@ -767,7 +778,7 @@ sub trace_used_macros () + # to silence m4_require warnings". + my $early_m4_code .= "m4_define([m4_require_silent_probe], [-])"; + +- my $traces = ($ENV{AUTOM4TE} || '@am_AUTOM4TE@'); ++ my $traces = ($ENV{AUTOM4TE} || '/usr/bin/env autom4te'); + $traces .= " --language Autoconf-without-aclocal-m4 "; + $traces = "echo '$early_m4_code' | $traces - "; + +diff --git a/bin/automake.in b/bin/automake.in +index cb077a7..676593c 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -23,10 +23,13 @@ + package Automake; + + use strict; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + + # Override SHELL. This is required on DJGPP so that system() uses +@@ -5243,7 +5246,7 @@ sub scan_autoconf_traces + sinclude => 1, + ); + +- my $traces = ($ENV{AUTOCONF} || '@am_AUTOCONF@') . " "; ++ my $traces = ($ENV{AUTOCONF} || '/usr/bin/env autoconf') . " "; + + # Use a separator unlikely to be used, not ':', the default, which + # has a precise meaning for AC_CONFIG_FILES and so on. +diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in +index f79b8cd..ed78dd2 100644 +--- a/lib/Automake/Config.in ++++ b/lib/Automake/Config.in +@@ -20,6 +20,8 @@ use strict; + + use 5.006; + require Exporter; ++use Cwd 'abs_path'; ++use File::Basename; + + our @ISA = qw (Exporter); + our @EXPORT = qw ($APIVERSION $PACKAGE $PACKAGE_BUGREPORT $VERSION +@@ -32,7 +34,8 @@ our $PACKAGE = '@PACKAGE@'; + our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@'; + our $VERSION = '@VERSION@'; + our $RELEASE_YEAR = '@RELEASE_YEAR@'; +-our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || "$scriptpath/../../@PACKAGE@-@APIVERSION@"; + + our $perl_threads = 0; + # We need at least this version for CLONE support. diff --git a/automake/all/patches/0003-relocatable-automake-1.16.3.patch b/automake/all/patches/0003-relocatable-automake-1.16.3.patch new file mode 100644 index 0000000..2c34ed4 --- /dev/null +++ b/automake/all/patches/0003-relocatable-automake-1.16.3.patch @@ -0,0 +1,106 @@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index 8782f24..263ebc2 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -22,10 +22,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + } + +@@ -64,9 +67,16 @@ $perl_threads = 0; + # @system_includes can be augmented with the 'dirlist' file or the + # ACLOCAL_PATH environment variable, and reset with the '--system-acdir' + # option. ++my $scriptpath = abs_path(dirname(__FILE__)); + my @user_includes = (); +-my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION); +-my @system_includes = ('@datadir@/aclocal'); ++my @automake_includes = ("$scriptpath/../res/aclocal-" . $APIVERSION); ++my @system_includes = ("$scriptpath/../res/aclocal"); ++my @conan_includes; ++foreach my $conandir (uniq(split(/[:;]/, $ENV{'AUTOMAKE_CONAN_INCLUDES'} || ""))) ++{ ++ push (@conan_includes, $conandir) if $conandir ne '' && -d $conandir; ++ ++} + + # Whether we should copy M4 file in $user_includes[0]. + my $install = 0; +@@ -448,6 +458,7 @@ sub scan_m4_files () + } + scan_m4_dirs (FT_AUTOMAKE, SCAN_M4_DIRS_ERROR, @automake_includes); + scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @system_includes); ++ scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @conan_includes); + + # Construct a new function that does the searching. We use a + # function (instead of just evaluating $search in the loop) so that +@@ -768,7 +779,7 @@ sub trace_used_macros () + # aclocal.m4 is not yet available. + local $ENV{WARNINGS} = 'none'; + +- my $traces = ($ENV{AUTOM4TE} || '@am_AUTOM4TE@'); ++ my $traces = ($ENV{AUTOM4TE} || '/usr/bin/env autom4te'); + $traces .= " --language Autoconf-without-aclocal-m4 "; + + # Support AC_CONFIG_MACRO_DIRS also with older autoconf. +diff --git a/bin/automake.in b/bin/automake.in +index e41b1f5..233a6a3 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -25,10 +25,13 @@ package Automake; + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + + # Override SHELL. This is required on DJGPP so that system() uses +@@ -5254,7 +5257,7 @@ sub scan_autoconf_traces + # and will see its warnings then. + local $ENV{WARNINGS} = 'none'; + +- my $traces = ($ENV{AUTOCONF} || '@am_AUTOCONF@') . " "; ++ my $traces = ($ENV{AUTOCONF} || '/usr/bin/env autoconf') . " "; + + # Use a separator unlikely to be used, not ':', the default, which + # has a precise meaning for AC_CONFIG_FILES and so on. +diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in +index d44e0ab..fba2b81 100644 +--- a/lib/Automake/Config.in ++++ b/lib/Automake/Config.in +@@ -20,6 +20,8 @@ package Automake::Config; + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + use Exporter; + +@@ -34,7 +36,8 @@ our $PACKAGE = '@PACKAGE@'; + our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@'; + our $VERSION = '@VERSION@'; + our $RELEASE_YEAR = '@RELEASE_YEAR@'; +-our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || "$scriptpath/../../@PACKAGE@-@APIVERSION@"; + + our $perl_threads = 0; + # We need at least this version for CLONE support. diff --git a/automake/all/patches/0003-relocatable-automake-1.16.4.patch b/automake/all/patches/0003-relocatable-automake-1.16.4.patch new file mode 100644 index 0000000..011c7dd --- /dev/null +++ b/automake/all/patches/0003-relocatable-automake-1.16.4.patch @@ -0,0 +1,106 @@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index a63ce4d..e82d65b 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -22,10 +22,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + } + +@@ -64,9 +67,16 @@ $perl_threads = 0; + # @system_includes can be augmented with the 'dirlist' file or the + # ACLOCAL_PATH environment variable, and reset with the '--system-acdir' + # option. ++my $scriptpath = abs_path(dirname(__FILE__)); + my @user_includes = (); +-my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION); +-my @system_includes = ('@datadir@/aclocal'); ++my @automake_includes = ("$scriptpath/../res/aclocal-" . $APIVERSION); ++my @system_includes = ("$scriptpath/../res/aclocal"); ++my @conan_includes; ++foreach my $conandir (uniq(split(/[:;]/, $ENV{'AUTOMAKE_CONAN_INCLUDES'} || ""))) ++{ ++ push (@conan_includes, $conandir) if $conandir ne '' && -d $conandir; ++ ++} + + # Whether we should copy M4 file in $user_includes[0]. + my $install = 0; +@@ -448,6 +458,7 @@ sub scan_m4_files () + } + scan_m4_dirs (FT_AUTOMAKE, SCAN_M4_DIRS_ERROR, @automake_includes); + scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @system_includes); ++ scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @conan_includes); + + # Construct a new function that does the searching. We use a + # function (instead of just evaluating $search in the loop) so that +@@ -768,7 +779,7 @@ sub trace_used_macros () + # aclocal.m4 is not yet available. + local $ENV{WARNINGS} = 'none'; + +- my $traces = ($ENV{AUTOM4TE} || '@am_AUTOM4TE@'); ++ my $traces = ($ENV{AUTOM4TE} || '/usr/bin/env autom4te'); + $traces .= " --language Autoconf-without-aclocal-m4 "; + + # Support AC_CONFIG_MACRO_DIRS also with older autoconf. +diff --git a/bin/automake.in b/bin/automake.in +index 4502558..6506946 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -25,10 +25,13 @@ package Automake; + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + + # Override SHELL. This is required on DJGPP so that system() uses +@@ -5280,7 +5283,7 @@ sub scan_autoconf_traces + # and will see its warnings then. + local $ENV{WARNINGS} = 'none'; + +- my $traces = ($ENV{AUTOCONF} || '@am_AUTOCONF@') . " "; ++ my $traces = ($ENV{AUTOCONF} || '/usr/bin/env autoconf') . " "; + + # Use a separator unlikely to be used, not ':', the default, which + # has a precise meaning for AC_CONFIG_FILES and so on. +diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in +index d529f1b..ca98604 100644 +--- a/lib/Automake/Config.in ++++ b/lib/Automake/Config.in +@@ -20,6 +20,8 @@ package Automake::Config; + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + use Exporter; + +@@ -34,7 +36,8 @@ our $PACKAGE = '@PACKAGE@'; + our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@'; + our $VERSION = '@VERSION@'; + our $RELEASE_YEAR = '@RELEASE_YEAR@'; +-our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || "$scriptpath/../../@PACKAGE@-@APIVERSION@"; + + our $perl_threads = 0; + # We need at least this version for CLONE support. diff --git a/automake/all/patches/0003-relocatable-automake-1.16.5.patch b/automake/all/patches/0003-relocatable-automake-1.16.5.patch new file mode 100644 index 0000000..56b752f --- /dev/null +++ b/automake/all/patches/0003-relocatable-automake-1.16.5.patch @@ -0,0 +1,107 @@ +diff --git a/bin/aclocal.in b/bin/aclocal.in +index a63ce4d..6224832 100644 +--- a/bin/aclocal.in ++++ b/bin/aclocal.in +@@ -22,10 +22,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + } + +@@ -64,9 +67,16 @@ $perl_threads = 0; + # @system_includes can be augmented with the 'dirlist' file or the + # ACLOCAL_PATH environment variable, and reset with the '--system-acdir' + # option. ++my $scriptpath = abs_path(dirname(__FILE__)); + my @user_includes = (); +-my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION); +-my @system_includes = ('@datadir@/aclocal'); ++my @automake_includes = ("$scriptpath/../res/aclocal-" . $APIVERSION); ++my @system_includes = ("$scriptpath/../res/aclocal"); ++my @conan_includes; ++foreach my $conandir (uniq(split(/[:;]/, $ENV{'AUTOMAKE_CONAN_INCLUDES'} || ""))) ++{ ++ push (@conan_includes, $conandir) if $conandir ne '' && -d $conandir; ++ ++} + + # Whether we should copy M4 file in $user_includes[0]. + my $install = 0; +@@ -448,6 +458,8 @@ sub scan_m4_files () + } + scan_m4_dirs (FT_AUTOMAKE, SCAN_M4_DIRS_ERROR, @automake_includes); + scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @system_includes); ++ scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @conan_includes); ++ + + # Construct a new function that does the searching. We use a + # function (instead of just evaluating $search in the loop) so that +@@ -768,7 +780,7 @@ sub trace_used_macros () + # aclocal.m4 is not yet available. + local $ENV{WARNINGS} = 'none'; + +- my $traces = ($ENV{AUTOM4TE} || '@am_AUTOM4TE@'); ++ my $traces = ($ENV{AUTOM4TE} || '/usr/bin/env autom4te'); + $traces .= " --language Autoconf-without-aclocal-m4 "; + + # Support AC_CONFIG_MACRO_DIRS also with older autoconf. +diff --git a/bin/automake.in b/bin/automake.in +index d499bfd..d4081c9 100644 +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -25,10 +25,13 @@ package Automake; + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ unshift (@INC, "$scriptpath/../res/@PACKAGE@-@APIVERSION@") + unless $ENV{AUTOMAKE_UNINSTALLED}; + + # Override SHELL. This is required on DJGPP so that system() uses +@@ -5280,7 +5283,7 @@ sub scan_autoconf_traces + # and will see its warnings then. + local $ENV{WARNINGS} = 'none'; + +- my $traces = ($ENV{AUTOCONF} || '@am_AUTOCONF@') . " "; ++ my $traces = ($ENV{AUTOCONF} || '/usr/bin/env autoconf') . " "; + + # Use a separator unlikely to be used, not ':', the default, which + # has a precise meaning for AC_CONFIG_FILES and so on. +diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in +index d529f1b..ca98604 100644 +--- a/lib/Automake/Config.in ++++ b/lib/Automake/Config.in +@@ -20,6 +20,8 @@ package Automake::Config; + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + use Exporter; + +@@ -34,7 +36,8 @@ our $PACKAGE = '@PACKAGE@'; + our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@'; + our $VERSION = '@VERSION@'; + our $RELEASE_YEAR = '@RELEASE_YEAR@'; +-our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || "$scriptpath/../../@PACKAGE@-@APIVERSION@"; + + our $perl_threads = 0; + # We need at least this version for CLONE support. diff --git a/automake/all/test_package/Makefile.am b/automake/all/test_package/Makefile.am new file mode 100644 index 0000000..655db7f --- /dev/null +++ b/automake/all/test_package/Makefile.am @@ -0,0 +1,4 @@ +# @configure_input@ + +bin_PROGRAMS = test_package +test_package_SOURCES = test_package.cpp diff --git a/automake/all/test_package/conanfile.py b/automake/all/test_package/conanfile.py new file mode 100644 index 0000000..26fd488 --- /dev/null +++ b/automake/all/test_package/conanfile.py @@ -0,0 +1,95 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import chdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path + + +required_conan_version = ">=1.53.0" + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + win_bash = True + + _default_cc = { + "gcc": "gcc", + "clang": "clang", + "Visual Studio": "cl -nologo", + "msvc": "cl -nologo", + "apple-clang": "clang", + } + + def _system_compiler(self, cxx=False): + system_cc = self._default_cc.get(str(self.settings.compiler)) + if system_cc and cxx: + if self.settings.compiler == "gcc": + system_cc = "g++" + elif "clang" in self.settings.compiler: + system_cc = "clang++" + return system_cc + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not self.conf.get( + "tools.microsoft.bash:path", check_type=str + ): + self.build_requires("msys2/cci.latest") + + def layout(self): + basic_layout(self, src_folder="src") + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + env = VirtualBuildEnv(self) + env.generate() + + env = Environment() + + compile_script = unix_path(self, + self.dependencies.build["automake"].conf_info.get("user.automake:compile-wrapper")) + + # define CC and CXX such that if the user hasn't already defined it + # via `tools.build:compiler_executables` or buildenv variables, + # we tell autotools to guess the name matching the current setting + # (otherwise it falls back to finding gcc first) + cc = self._system_compiler() + cxx = self._system_compiler(cxx=True) + if cc and cxx: + # Using shell parameter expansion + env.define("CC", f"${{CC-{cc}}}") + env.define("CXX", f"${{CXX-{cxx}}}") + + env.define("COMPILE", compile_script) + env.define("ACLOCAL_PATH", unix_path(self, os.path.join(self.source_folder))) + env.vars(self, scope="build").save_script("automake_build_test") + + def build(self): + # Test compilation through compile wrapper script + compiler = self._system_compiler() + source_file = unix_path(self, os.path.join(self.source_folder, "test_package_1.c")) + with chdir(self, self.build_folder): + self.run(f"$COMPILE {compiler} {source_file} -o script_test", env="conanbuild") + + # Build test project + autotools = Autotools(self) + autotools.autoreconf(args=["--debug"]) + autotools.configure() + autotools.make() + + def test(self): + if can_run(self): + with chdir(self, self.build_folder): + self.run("./script_test") + self.run("./test_package") diff --git a/automake/all/test_package/configure.ac b/automake/all/test_package/configure.ac new file mode 100644 index 0000000..8a7ae1d --- /dev/null +++ b/automake/all/test_package/configure.ac @@ -0,0 +1,28 @@ +AC_PREREQ([2.69]) +AC_INIT([test_package], [1.0]) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package.cpp]) + +AC_CANONICAL_HOST + +# Test includes of extra including directories using conan +AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) +AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) + +AC_CONFIG_HEADER([config.h]) + +# Check for CC and CXX compiler +AC_PROG_CC +AC_PROG_CXX +## We can add more checks in this section +# +## Tells automake to create a Makefile +## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html +AC_CONFIG_FILES([Makefile]) +# +## Generate the output +AC_OUTPUT +# diff --git a/automake/all/test_package/extra.m4 b/automake/all/test_package/extra.m4 new file mode 100644 index 0000000..69c85f5 --- /dev/null +++ b/automake/all/test_package/extra.m4 @@ -0,0 +1,14 @@ +dnl This file contains a macro to test adding extra include dirs using conan + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_PREREQ],[ + m4_define([CONAN_MACRO_VERSION], [1.3]) + m4_if(m4_version_compare(CONAN_MACRO_VERSION, [$1]), + -1, + [m4_fatal([extra.m4 version $1 or higher is required, but ]CONAN_MACRO_VERSION[ found])] + ) +])dnl AUTOMAKE_TEST_PACKAGE_PREREQ + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_HELLO],[ + echo "Hello world from the extra.m4 script!" + echo "My args were: $*" +])dnl diff --git a/automake/all/test_package/src/Makefile.am b/automake/all/test_package/src/Makefile.am new file mode 100644 index 0000000..655db7f --- /dev/null +++ b/automake/all/test_package/src/Makefile.am @@ -0,0 +1,4 @@ +# @configure_input@ + +bin_PROGRAMS = test_package +test_package_SOURCES = test_package.cpp diff --git a/automake/all/test_package/src/configure.ac b/automake/all/test_package/src/configure.ac new file mode 100644 index 0000000..8a7ae1d --- /dev/null +++ b/automake/all/test_package/src/configure.ac @@ -0,0 +1,28 @@ +AC_PREREQ([2.69]) +AC_INIT([test_package], [1.0]) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package.cpp]) + +AC_CANONICAL_HOST + +# Test includes of extra including directories using conan +AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) +AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) + +AC_CONFIG_HEADER([config.h]) + +# Check for CC and CXX compiler +AC_PROG_CC +AC_PROG_CXX +## We can add more checks in this section +# +## Tells automake to create a Makefile +## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html +AC_CONFIG_FILES([Makefile]) +# +## Generate the output +AC_OUTPUT +# diff --git a/automake/all/test_package/src/extra.m4 b/automake/all/test_package/src/extra.m4 new file mode 100644 index 0000000..69c85f5 --- /dev/null +++ b/automake/all/test_package/src/extra.m4 @@ -0,0 +1,14 @@ +dnl This file contains a macro to test adding extra include dirs using conan + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_PREREQ],[ + m4_define([CONAN_MACRO_VERSION], [1.3]) + m4_if(m4_version_compare(CONAN_MACRO_VERSION, [$1]), + -1, + [m4_fatal([extra.m4 version $1 or higher is required, but ]CONAN_MACRO_VERSION[ found])] + ) +])dnl AUTOMAKE_TEST_PACKAGE_PREREQ + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_HELLO],[ + echo "Hello world from the extra.m4 script!" + echo "My args were: $*" +])dnl diff --git a/automake/all/test_package/src/test_package.cpp b/automake/all/test_package/src/test_package.cpp new file mode 100644 index 0000000..ec5b5ab --- /dev/null +++ b/automake/all/test_package/src/test_package.cpp @@ -0,0 +1,9 @@ +#include "config.h" + +#include +#include + +int main() { + std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; + return EXIT_SUCCESS; +} diff --git a/automake/all/test_package/src/test_package_1.c b/automake/all/test_package/src/test_package_1.c new file mode 100644 index 0000000..9aaff6c --- /dev/null +++ b/automake/all/test_package/src/test_package_1.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + puts("test_package.c says 'Hello World'!\n"); + return EXIT_SUCCESS; +} diff --git a/automake/all/test_package/test_package.cpp b/automake/all/test_package/test_package.cpp new file mode 100644 index 0000000..ec5b5ab --- /dev/null +++ b/automake/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include "config.h" + +#include +#include + +int main() { + std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; + return EXIT_SUCCESS; +} diff --git a/automake/all/test_package/test_package_1.c b/automake/all/test_package/test_package_1.c new file mode 100644 index 0000000..9aaff6c --- /dev/null +++ b/automake/all/test_package/test_package_1.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + puts("test_package.c says 'Hello World'!\n"); + return EXIT_SUCCESS; +} diff --git a/automake/all/test_v1_package/Makefile.am b/automake/all/test_v1_package/Makefile.am new file mode 100644 index 0000000..655db7f --- /dev/null +++ b/automake/all/test_v1_package/Makefile.am @@ -0,0 +1,4 @@ +# @configure_input@ + +bin_PROGRAMS = test_package +test_package_SOURCES = test_package.cpp diff --git a/automake/all/test_v1_package/conanfile.py b/automake/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..8362800 --- /dev/null +++ b/automake/all/test_v1_package/conanfile.py @@ -0,0 +1,89 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conan.tools.microsoft import is_msvc +from contextlib import contextmanager +import os +import shutil + +required_conan_version = ">=1.45.0" + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp" + # DON'T COPY extra.m4 TO BUILD FOLDER!!! + test_type = "explicit" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + @contextmanager + def _build_context(self): + if is_msvc(self): + with tools.vcvars(self): + with tools.environment_append({"CC": "cl -nologo", "CXX": "cl -nologo",}): + yield + else: + yield + + _default_cc = { + "gcc": "gcc", + "clang": "clang", + "Visual Studio": "cl -nologo", + "apple-clang": "clang", + } + + @property + def _system_cc(self): + system_cc = os.environ.get("CC", None) + if not system_cc: + system_cc = self._default_cc.get(str(self.settings.compiler)) + return system_cc + + @property + def _user_info(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def _build_scripts(self): + """Test compile script of automake""" + compile_script = self._user_info["automake"].compile + ar_script = self._user_info["automake"].ar_lib + assert os.path.isfile(ar_script) + assert os.path.isfile(compile_script) + + if self._system_cc: + with tools.vcvars(self) if is_msvc(self) else tools.no_op(): + self.run("{} {} test_package_1.c -o script_test".format(tools.unix_path(compile_script), self._system_cc), win_bash=tools.os_info.is_windows) + + def _build_autotools(self): + """Test autoreconf + configure + make""" + with tools.environment_append({"AUTOMAKE_CONAN_INCLUDES": [tools.unix_path(self.source_folder)]}): + self.run("{} -fiv".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows) + self.run("{} --help".format(os.path.join(self.build_folder, "configure").replace("\\", "/")), win_bash=tools.os_info.is_windows) + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + with self._build_context(): + autotools.configure() + autotools.make() + + def build(self): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), self.build_folder) + + self._build_scripts() + self._build_autotools() + + def test(self): + if self._system_cc: + if not tools.cross_building(self): + self.run(os.path.join(".", "script_test"), run_environment=True) + + if not tools.cross_building(self): + self.run(os.path.join(".", "test_package"), run_environment=True) diff --git a/automake/all/test_v1_package/configure.ac b/automake/all/test_v1_package/configure.ac new file mode 100644 index 0000000..8a7ae1d --- /dev/null +++ b/automake/all/test_v1_package/configure.ac @@ -0,0 +1,28 @@ +AC_PREREQ([2.69]) +AC_INIT([test_package], [1.0]) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package.cpp]) + +AC_CANONICAL_HOST + +# Test includes of extra including directories using conan +AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) +AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) + +AC_CONFIG_HEADER([config.h]) + +# Check for CC and CXX compiler +AC_PROG_CC +AC_PROG_CXX +## We can add more checks in this section +# +## Tells automake to create a Makefile +## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html +AC_CONFIG_FILES([Makefile]) +# +## Generate the output +AC_OUTPUT +# diff --git a/automake/all/test_v1_package/extra.m4 b/automake/all/test_v1_package/extra.m4 new file mode 100644 index 0000000..69c85f5 --- /dev/null +++ b/automake/all/test_v1_package/extra.m4 @@ -0,0 +1,14 @@ +dnl This file contains a macro to test adding extra include dirs using conan + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_PREREQ],[ + m4_define([CONAN_MACRO_VERSION], [1.3]) + m4_if(m4_version_compare(CONAN_MACRO_VERSION, [$1]), + -1, + [m4_fatal([extra.m4 version $1 or higher is required, but ]CONAN_MACRO_VERSION[ found])] + ) +])dnl AUTOMAKE_TEST_PACKAGE_PREREQ + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_HELLO],[ + echo "Hello world from the extra.m4 script!" + echo "My args were: $*" +])dnl diff --git a/automake/all/test_v1_package/test_package.cpp b/automake/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000..cd8c2f2 --- /dev/null +++ b/automake/all/test_v1_package/test_package.cpp @@ -0,0 +1,9 @@ +#include "config.h" + +#include +#include + +int main(int argc, char** argv) { + std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; + return EXIT_SUCCESS; +} diff --git a/automake/all/test_v1_package/test_package_1.c b/automake/all/test_v1_package/test_package_1.c new file mode 100644 index 0000000..9aaff6c --- /dev/null +++ b/automake/all/test_v1_package/test_package_1.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + puts("test_package.c says 'Hello World'!\n"); + return EXIT_SUCCESS; +} diff --git a/automake/config.yml b/automake/config.yml new file mode 100644 index 0000000..020d6b5 --- /dev/null +++ b/automake/config.yml @@ -0,0 +1,9 @@ +versions: + "1.16.5": + folder: all + "1.16.4": + folder: all + "1.16.3": + folder: all + "1.16.2": + folder: all diff --git a/aws-c-auth/all/conandata.yml b/aws-c-auth/all/conandata.yml index 3f6bee7..0270101 100644 --- a/aws-c-auth/all/conandata.yml +++ b/aws-c-auth/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.7.8": + url: "https://github.com/awslabs/aws-c-auth/archive/v0.7.8.tar.gz" + sha256: "5db8ab91262b5c055e3634f2c9dc2bc1a3285c2dd5513fdcafcb3e79468dc7de" + "0.7.7": + url: "https://github.com/awslabs/aws-c-auth/archive/v0.7.7.tar.gz" + sha256: "ea3c9e75b59b36aaf9147deec655d1669f197745bbe914cd3b8e234740be29ba" "0.6.17": url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.17.tar.gz" sha256: "b43678ad3a779c9c7fccf8f931c162eaaf4d5d64d2955ac1fcfd32e538545c0f" @@ -14,3 +20,9 @@ sources: "0.6.0": url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.0.tar.gz" sha256: "5f5fff63110c3e8f619385ca563f77886bc101d3e054987eecbb87586e27b651" +patches: + "0.6.17": + - patch_file: "patches/0.6.17-0001-fix-macro-usage.patch" + patch_description: "Fix inconsistent usage of macros" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-auth/pull/181" diff --git a/aws-c-auth/all/conanfile.py b/aws-c-auth/all/conanfile.py index a490a56..edc8208 100644 --- a/aws-c-auth/all/conanfile.py +++ b/aws-c-auth/all/conanfile.py @@ -1,9 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir +from conan.tools.files import get, copy, rmdir, save, export_conandata_patches, apply_conandata_patches from conan.tools.scm import Version import os +import textwrap required_conan_version = ">=1.53.0" @@ -14,18 +15,10 @@ class AwsCAuth(ConanFile): "C99 library implementation of AWS client-side authentication: " "standard credentials providers and signing." ) - license = ("Apache-2.0",) + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-auth" - topics = ( - "aws", - "amazon", - "cloud", - "authentication", - "credentials", - "providers", - "signing", - ) + topics = ("aws", "amazon", "cloud", "authentication", "credentials", "providers", "signing") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -37,6 +30,9 @@ class AwsCAuth(ConanFile): "fPIC": True, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -51,48 +47,26 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires( - "aws-c-common/0.8.2@milvus/dev", - transitive_headers=True, - transitive_libs=True, - ) - self.requires("aws-c-cal/0.5.20@milvus/dev") - if Version(self.version) < "0.6.17": - self.requires( - "aws-c-io/0.10.20@milvus/dev", - transitive_headers=True, - transitive_libs=True, - ) - self.requires( - "aws-c-http/0.6.13@milvus/dev", - transitive_headers=True, - transitive_libs=True, - ) + if Version(self.version) <= "0.6.17": + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.5.13") + if Version(self.version) < "0.6.17": + self.requires("aws-c-io/0.10.20", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.6.13", transitive_headers=True) + else: + self.requires("aws-c-io/0.13.4", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.6.22", transitive_headers=True) + if Version(self.version) >= "0.6.5": + self.requires("aws-c-sdkutils/0.1.3", transitive_headers=True) else: - self.requires( - "aws-c-io/0.13.4@milvus/dev", - transitive_headers=True, - transitive_libs=True, - ) - self.requires( - "aws-c-http/0.6.22@milvus/dev", - transitive_headers=True, - transitive_libs=True, - ) - if Version(self.version) >= "0.6.5": - self.requires( - "aws-c-sdkutils/0.1.3@milvus/dev", - transitive_headers=True, - transitive_libs=True, - ) + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.6.9") + self.requires("aws-c-io/0.13.35", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.7.14", transitive_headers=True) + self.requires("aws-c-sdkutils/0.1.12", transitive_headers=True) def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -103,48 +77,45 @@ def generate(self): deps.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() def package(self): - copy( - self, - pattern="LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-auth")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-auth": "aws-c-auth::aws-c-auth"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-auth") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-auth") - # TODO: back to global scope once conan v1 support dropped - self.cpp_info.components["aws-c-auth-lib"].libs = ["aws-c-auth"] - self.cpp_info.components["aws-c-auth-lib"].requires = [ - "aws-c-common::aws-c-common-lib", - "aws-c-cal::aws-c-cal-lib", - "aws-c-io::aws-c-io-lib", - "aws-c-http::aws-c-http-lib", - ] - if Version(self.version) >= "0.6.5": - self.cpp_info.components["aws-c-auth-lib"].requires.append( - "aws-c-sdkutils::aws-c-sdkutils-lib" - ) - - # TODO: to remove once conan v1 support dropped - self.cpp_info.filenames["cmake_find_package"] = "aws-c-auth" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-auth" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-auth-lib"].names[ - "cmake_find_package" - ] = "aws-c-auth" - self.cpp_info.components["aws-c-auth-lib"].names[ - "cmake_find_package_multi" - ] = "aws-c-auth" - self.cpp_info.components["aws-c-auth-lib"].set_property( - "cmake_target_name", "AWS::aws-c-auth" - ) + self.cpp_info.libs = ["aws-c-auth"] + if self.options.shared: + self.cpp_info.defines.append("AWS_AUTH_USE_IMPORT_EXPORT") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/aws-c-auth/all/patches/0.6.17-0001-fix-macro-usage.patch b/aws-c-auth/all/patches/0.6.17-0001-fix-macro-usage.patch new file mode 100644 index 0000000..bed12b1 --- /dev/null +++ b/aws-c-auth/all/patches/0.6.17-0001-fix-macro-usage.patch @@ -0,0 +1,132 @@ +diff --git a/source/aws_signing.c b/source/aws_signing.c +index 940d7be..ecc1144 100644 +--- a/source/aws_signing.c ++++ b/source/aws_signing.c +@@ -2500,7 +2500,7 @@ int aws_verify_sigv4a_signing( + aws_credentials_release(signing_state->config.credentials); + signing_state->config.credentials = ecc_credentials; + if (signing_state->config.credentials == NULL) { +- AWS_LOGF_ERROR(AWS_LS_AUTH_SIGNING, "Unable to create ECC from provided credentials") ++ AWS_LOGF_ERROR(AWS_LS_AUTH_SIGNING, "Unable to create ECC from provided credentials"); + goto done; + } + } +diff --git a/source/credentials_provider_process.c b/source/credentials_provider_process.c +index 655df86..29f99d0 100644 +--- a/source/credentials_provider_process.c ++++ b/source/credentials_provider_process.c +@@ -187,7 +187,7 @@ static struct aws_string *s_get_command(struct aws_allocator *allocator, struct + if (!command_buf.len) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Failed to resolve credentials_process command during process credentials provider initialization.") ++ "Failed to resolve credentials_process command during process credentials provider initialization."); + goto on_finish; + } + +@@ -202,7 +202,7 @@ static struct aws_string *s_get_command(struct aws_allocator *allocator, struct + + AWS_LOGF_DEBUG( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Successfully loaded credentials_process command for process credentials provider.") ++ "Successfully loaded credentials_process command for process credentials provider."); + + on_finish: + aws_string_destroy(profile_name); +diff --git a/source/credentials_provider_sts_web_identity.c b/source/credentials_provider_sts_web_identity.c +index cb03cb5..c3e4697 100644 +--- a/source/credentials_provider_sts_web_identity.c ++++ b/source/credentials_provider_sts_web_identity.c +@@ -231,7 +231,7 @@ static bool s_parse_retryable_error_from_response(struct aws_allocator *allocato + if (xml_parser == NULL) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Failed to init xml parser for sts web identity credentials provider to parse error information.") ++ "Failed to init xml parser for sts web identity credentials provider to parse error information."); + return false; + } + bool get_retryable_error = false; +@@ -330,14 +330,14 @@ static struct aws_credentials *s_parse_credentials_from_response( + if (xml_parser == NULL) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Failed to init xml parser for sts web identity credentials provider to parse error information.") ++ "Failed to init xml parser for sts web identity credentials provider to parse error information."); + return NULL; + } + uint64_t now = UINT64_MAX; + if (aws_sys_clock_get_ticks(&now) != AWS_OP_SUCCESS) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Failed to get sys clock for sts web identity credentials provider to parse error information.") ++ "Failed to get sys clock for sts web identity credentials provider to parse error information."); + goto on_finish; + } + uint64_t now_seconds = aws_timestamp_convert(now, AWS_TIMESTAMP_NANOS, AWS_TIMESTAMP_SECS, NULL); +@@ -998,7 +998,7 @@ static struct sts_web_identity_parameters *s_parameters_new(struct aws_allocator + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, + "Failed to resolve either region, role arn or token file path during sts web identity provider " +- "initialization.") ++ "initialization."); + goto on_finish; + + } else { +@@ -1021,7 +1021,7 @@ static struct sts_web_identity_parameters *s_parameters_new(struct aws_allocator + aws_byte_buf_init_copy_from_cursor(¶meters->role_arn, allocator, aws_byte_cursor_from_string(role_arn))) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Failed to resolve role arn during sts web identity provider initialization.") ++ "Failed to resolve role arn during sts web identity provider initialization."); + goto on_finish; + } + +@@ -1031,7 +1031,7 @@ static struct sts_web_identity_parameters *s_parameters_new(struct aws_allocator + ¶meters->token_file_path, allocator, aws_byte_cursor_from_string(token_file_path))) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Failed to resolve token file path during sts web identity provider initialization.") ++ "Failed to resolve token file path during sts web identity provider initialization."); + goto on_finish; + } + +@@ -1047,7 +1047,7 @@ static struct sts_web_identity_parameters *s_parameters_new(struct aws_allocator + + AWS_LOGF_DEBUG( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Successfully loaded all required parameters for sts web identity credentials provider.") ++ "Successfully loaded all required parameters for sts web identity credentials provider."); + success = true; + + on_finish: +diff --git a/source/credentials_utils.c b/source/credentials_utils.c +index 061e26b..2cb61d6 100644 +--- a/source/credentials_utils.c ++++ b/source/credentials_utils.c +@@ -98,7 +98,7 @@ static bool s_parse_expiration_value_from_json_object( + + if (expiration_cursor.len == 0) { + AWS_LOGF_INFO( +- AWS_LS_AUTH_CREDENTIALS_PROVIDER, "Parsed a credentials json document with empty expiration.") ++ AWS_LS_AUTH_CREDENTIALS_PROVIDER, "Parsed a credentials json document with empty expiration."); + return false; + } + +@@ -211,7 +211,7 @@ struct aws_credentials *aws_parse_credentials_from_aws_json_object( + if (access_key_id_cursor.len == 0 || secrete_access_key_cursor.len == 0) { + AWS_LOGF_ERROR( + AWS_LS_AUTH_CREDENTIALS_PROVIDER, +- "Parsed an unexpected credentials json document, either access key, secret key is empty.") ++ "Parsed an unexpected credentials json document, either access key, secret key is empty."); + goto done; + } + +@@ -222,7 +222,7 @@ struct aws_credentials *aws_parse_credentials_from_aws_json_object( + aws_json_value_get_string(token, &session_token_cursor); + if (options->token_required && session_token_cursor.len == 0) { + AWS_LOGF_ERROR( +- AWS_LS_AUTH_CREDENTIALS_PROVIDER, "Parsed an unexpected credentials json document with empty token.") ++ AWS_LS_AUTH_CREDENTIALS_PROVIDER, "Parsed an unexpected credentials json document with empty token."); + goto done; + } + } diff --git a/aws-c-auth/config.yml b/aws-c-auth/config.yml index 503ab41..8edcc1f 100644 --- a/aws-c-auth/config.yml +++ b/aws-c-auth/config.yml @@ -1,4 +1,8 @@ versions: + "0.7.8": + folder: all + "0.7.7": + folder: all "0.6.17": folder: all "0.6.11": diff --git a/aws-c-cal/all/conandata.yml b/aws-c-cal/all/conandata.yml index e1b848e..0bf0d96 100644 --- a/aws-c-cal/all/conandata.yml +++ b/aws-c-cal/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.6.9": + url: "https://github.com/awslabs/aws-c-cal/archive/v0.6.9.tar.gz" + sha256: "46defd807034ca9d873cc1459bc60f0bb4662029f7120db1af464421907fb480" + "0.6.1": + url: "https://github.com/awslabs/aws-c-cal/archive/v0.6.1.tar.gz" + sha256: "52df95150a8548ac35a0e4b6f59fbdebff27e4124c0b7e5eaa969ed3ba62fc82" "0.5.20": url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.20.tar.gz" sha256: "acc352359bd06f8597415c366cf4ec4f00d0b0da92d637039a73323dd55b6cd0" @@ -14,10 +20,17 @@ sources: "0.5.12": url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.12.tar.gz" sha256: "350c29a288d5d498bd6574fca659cffc9453bf62691fbde5788399716c2bd132" - "0.5.11": - url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.11.tar.gz" - sha256: "ef46e121b2231a0b19afce8af4b32d77501df4d470e926990918456636cd83c0" patches: + "0.6.9": + - patch_file: "patches/0002-apple-corefoundation-0.6.9.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" + "0.6.1": + - patch_file: "patches/0002-apple-corefoundation-0.6.1.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" "0.5.20": - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" patch_description: "Link to CoreFoundation on Apple" @@ -44,9 +57,3 @@ patches: patch_description: "Link to CoreFoundation on Apple" patch_type: "backport" patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" - "0.5.11": - - patch_file: "patches/0001-use-openssl-cmake-imported-target.patch" - - patch_file: "patches/0002-apple-corefoundation-0.5.11.patch" - patch_description: "Link to CoreFoundation on Apple" - patch_type: "backport" - patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" diff --git a/aws-c-cal/all/conanfile.py b/aws-c-cal/all/conanfile.py index 767395c..82f0949 100644 --- a/aws-c-cal/all/conanfile.py +++ b/aws-c-cal/all/conanfile.py @@ -1,26 +1,22 @@ from conan import ConanFile from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save from conan.tools.scm import Version import os +import textwrap -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.53.0" class AwsCCal(ConanFile): name = "aws-c-cal" description = "Aws Crypto Abstraction Layer: Cross-Platform, C99 wrapper for cryptography primitives." - topics = ( - "aws", - "amazon", - "cloud", - "cal", - "crypt", - ) + topics = ("aws", "amazon", "cloud", "cal", "crypt", ) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-cal" - license = ("Apache-2.0",) + license = "Apache-2.0" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -33,11 +29,10 @@ class AwsCCal(ConanFile): @property def _needs_openssl(self): - return self.settings.os != "Windows" and not is_apple_os(self) + return not (self.settings.os == "Windows" or is_apple_os(self)) 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": @@ -45,34 +40,26 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if Version(self.version) <= "0.5.11": - self.requires("aws-c-common/0.6.11@milvus/dev") + if Version(self.version) <= "0.5.20": + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + elif Version(self.version) <= "0.6.1": + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) else: - self.requires("aws-c-common/0.8.2@milvus/dev") + # [>=0.9.7] + self.requires("aws-c-common/0.9.12", transitive_headers=True, transitive_libs=True) if self._needs_openssl: - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True, - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -89,81 +76,67 @@ def build(self): cmake.build() def package(self): - copy( - self, - "LICENSE", - src=self.source_folder, - dst=os.path.join(self.package_folder, "licenses"), - ) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-cal")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-cal": "aws-c-cal::aws-c-cal"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-cal") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-cal") - - self.cpp_info.filenames["cmake_find_package"] = "aws-c-cal" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-cal" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-cal-lib"].names[ - "cmake_find_package" - ] = "aws-c-cal" - self.cpp_info.components["aws-c-cal-lib"].names[ - "cmake_find_package_multi" - ] = "aws-c-cal" - self.cpp_info.components["aws-c-cal-lib"].set_property( - "cmake_target_name", "AWS::aws-c-cal" - ) - - self.cpp_info.components["aws-c-cal-lib"].libs = ["aws-c-cal"] - self.cpp_info.components["aws-c-cal-lib"].requires = [ - "aws-c-common::aws-c-common-lib" - ] + self.cpp_info.libs = ["aws-c-cal"] + self.cpp_info.requires = ["aws-c-common::aws-c-common"] + if self.options.shared: + self.cpp_info.defines.append("AWS_CAL_USE_IMPORT_EXPORT") if self.settings.os == "Windows": - self.cpp_info.components["aws-c-cal-lib"].system_libs.append("ncrypt") + self.cpp_info.system_libs.append("ncrypt") elif is_apple_os(self): - self.cpp_info.components["aws-c-cal-lib"].frameworks.extend( - ["CoreFoundation", "Security"] - ) + self.cpp_info.frameworks.extend(["CoreFoundation", "Security"]) elif self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.components["aws-c-cal-lib"].system_libs.append("dl") + self.cpp_info.system_libs.append("dl") - self.user_info.with_openssl = self._needs_openssl if self._needs_openssl: - self.cpp_info.components["aws-c-cal-lib"].requires.append("openssl::crypto") + self.cpp_info.requires.append("openssl::crypto") if not self.dependencies["openssl"].options.shared: # aws-c-cal does not statically link to openssl and searches dynamically for openssl symbols . # Mark these as undefined so the linker will include them. # This avoids dynamical look-up for a system crypto library. crypto_symbols = [ - "HMAC_Update", - "HMAC_Final", - "HMAC_Init_ex", + "HMAC_Update", "HMAC_Final", "HMAC_Init_ex", ] if Version(self.dependencies["openssl"].ref.version) >= "1.1": - crypto_symbols.extend( - [ - "HMAC_CTX_new", - "HMAC_CTX_free", - "HMAC_CTX_reset", - ] - ) + crypto_symbols.extend([ + "HMAC_CTX_new", "HMAC_CTX_free", "HMAC_CTX_reset", + ]) else: - crypto_symbols.extend( - [ - "HMAC_CTX_init", - "HMAC_CTX_cleanup", - "HMAC_CTX_reset", - ] - ) - crypto_link_flags = "-Wl," + ",".join( - f"-u{symbol}" for symbol in crypto_symbols - ) - self.cpp_info.components["aws-c-cal-lib"].exelinkflags.append( - crypto_link_flags - ) - self.cpp_info.components["aws-c-cal-lib"].sharedlinkflags.append( - crypto_link_flags - ) + crypto_symbols.extend([ + "HMAC_CTX_init", "HMAC_CTX_cleanup", "HMAC_CTX_reset", + ]) + crypto_link_flags = "-Wl," + ",".join(f"-u{symbol}" for symbol in crypto_symbols) + self.cpp_info.exelinkflags.append(crypto_link_flags) + self.cpp_info.sharedlinkflags.append(crypto_link_flags) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.1.patch b/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.1.patch new file mode 100644 index 0000000..616d825 --- /dev/null +++ b/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.1.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -84,7 +84,12 @@ elseif (APPLE) + message(FATAL_ERROR "Security Framework not found") + endif () + +- list(APPEND PLATFORM_LIBS "-framework Security") ++ find_library(COREFOUNDATION_LIB CoreFoundation) ++ if(NOT COREFOUNDATION_LIB) ++ message(FATAL_ERROR "CoreFoundation Framework not found") ++ endif() ++ ++ list(APPEND PLATFORM_LIBS "-framework Security -framework CoreFoundation") + endif() + else () + if (NOT BYO_CRYPTO) +--- a/source/darwin/securityframework_ecc.c ++++ b/source/darwin/securityframework_ecc.c +@@ -7,6 +7,7 @@ + #include + #include + ++#include + #include + #include + diff --git a/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.9.patch b/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.9.patch new file mode 100644 index 0000000..1059e3d --- /dev/null +++ b/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.9.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d57a3fd..7d1d5f2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -79,7 +79,11 @@ elseif (APPLE) + message(FATAL_ERROR "Security Framework not found") + endif () + +- list(APPEND PLATFORM_LIBS "-framework Security") ++ find_library(COREFOUNDATION_LIB CoreFoundation) ++ if(NOT COREFOUNDATION_LIB) ++ message(FATAL_ERROR "CoreFoundation Framework not found") ++ endif() ++ list(APPEND PLATFORM_LIBS "-framework Security -framework CoreFoundation") + endif() + else () + if (NOT BYO_CRYPTO) +diff --git a/source/darwin/securityframework_ecc.c b/source/darwin/securityframework_ecc.c +index adedadd..d34531e 100644 +--- a/source/darwin/securityframework_ecc.c ++++ b/source/darwin/securityframework_ecc.c +@@ -6,7 +6,7 @@ + + #include + #include +- ++#include + #include + #include + diff --git a/aws-c-cal/all/test_package/CMakeLists.txt b/aws-c-cal/all/test_package/CMakeLists.txt index 7ed07f4..a98182d 100644 --- a/aws-c-cal/all/test_package/CMakeLists.txt +++ b/aws-c-cal/all/test_package/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) find_package(aws-c-cal REQUIRED CONFIG) +find_package(aws-c-common REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-cal) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-cal AWS::aws-c-common) diff --git a/aws-c-cal/all/test_package/conanfile.py b/aws-c-cal/all/test_package/conanfile.py index 1b3c18e..fb5c5c0 100644 --- a/aws-c-cal/all/test_package/conanfile.py +++ b/aws-c-cal/all/test_package/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.tools.apple import is_apple_os from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -10,6 +11,10 @@ class TestPackageConan(ConanFile): generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" test_type = "explicit" + @property + def _needs_openssl(self): + return not (self.settings.os == "Windows" or is_apple_os(self)) + def layout(self): cmake_layout(self) @@ -25,7 +30,7 @@ def test(self): if can_run(self): stream = io.StringIO() bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(bin_path, env="conanrun", output=stream) + self.run(bin_path, stream, env="conanrun") self.output.info(stream.getvalue()) - if self.deps_user_info["aws-c-cal"].with_openssl == "True": + if self._needs_openssl: assert "found static libcrypto" in stream.getvalue() diff --git a/aws-c-cal/all/test_v1_package/CMakeLists.txt b/aws-c-cal/all/test_v1_package/CMakeLists.txt index 8a88842..0d20897 100644 --- a/aws-c-cal/all/test_v1_package/CMakeLists.txt +++ b/aws-c-cal/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-c-cal REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-cal) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/aws-c-cal/all/test_v1_package/conanfile.py b/aws-c-cal/all/test_v1_package/conanfile.py index ff0f4e1..e27da49 100644 --- a/aws-c-cal/all/test_v1_package/conanfile.py +++ b/aws-c-cal/all/test_v1_package/conanfile.py @@ -1,4 +1,5 @@ from conans import ConanFile, CMake, tools +from conan.tools.apple import is_apple_os import os import io @@ -7,6 +8,10 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" + @property + def _needs_openssl(self): + return not (self.settings.os == "Windows" or is_apple_os(self)) + def build(self): cmake = CMake(self) cmake.configure() @@ -16,7 +21,7 @@ def test(self): if not tools.cross_building(self): stream = io.StringIO() bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True, output=stream) + self.run(bin_path, stream, run_environment=True) self.output.info(stream.getvalue()) - if self.deps_user_info["aws-c-cal"].with_openssl == "True": + if self._needs_openssl: assert "found static libcrypto" in stream.getvalue() diff --git a/aws-c-cal/config.yml b/aws-c-cal/config.yml index f969df4..f62f168 100644 --- a/aws-c-cal/config.yml +++ b/aws-c-cal/config.yml @@ -1,4 +1,8 @@ versions: + "0.6.9": + folder: all + "0.6.1": + folder: all "0.5.20": folder: all "0.5.19": @@ -9,5 +13,3 @@ versions: folder: all "0.5.12": folder: all - "0.5.11": - folder: all diff --git a/aws-c-common/all/conandata.yml b/aws-c-common/all/conandata.yml index 773702b..0b34391 100644 --- a/aws-c-common/all/conandata.yml +++ b/aws-c-common/all/conandata.yml @@ -1,56 +1,36 @@ sources: + "0.9.12": + url: "https://github.com/awslabs/aws-c-common/archive/v0.9.12.tar.gz" + sha256: "10ef8f5629fb6ac24aa4893f3bb9a8480997e96a58c81043e019bf6b149f4332" + "0.9.6": + url: "https://github.com/awslabs/aws-c-common/archive/v0.9.6.tar.gz" + sha256: "5c30cc066a7f05fb8e4728f93aeed0e0e2698197a6df76237ac4e1200977d090" + "0.9.3": + url: "https://github.com/awslabs/aws-c-common/archive/v0.9.3.tar.gz" + sha256: "389eaac7f64d7d5a91ca3decad6810429eb5a65bbba54798b9beffcb4d1d1ed6" + "0.9.0": + url: "https://github.com/awslabs/aws-c-common/archive/v0.9.0.tar.gz" + sha256: "9b62ab1dcece3107810ea4f4511fe8e1e010a83cb0cb502b6ec685ce752a7b0c" + "0.8.23": + url: "https://github.com/awslabs/aws-c-common/archive/v0.8.23.tar.gz" + sha256: "67455d8149c74b1db3e4dd68db47dc7372de02dd78fbc620f9c7f0270d9d6018" "0.8.2": url: "https://github.com/awslabs/aws-c-common/archive/v0.8.2.tar.gz" sha256: "36edc6e486c43bbb34059dde227e872c0d41ab54f0b3609d38f188cfbbc6d1f8" "0.7.5": url: "https://github.com/awslabs/aws-c-common/archive/v0.7.5.tar.gz" sha256: "e34fd3d3d32e3597f572205aaabbe995e162f4015e14c7328987b596bd25812c" - "0.7.4": - url: "https://github.com/awslabs/aws-c-common/archive/v0.7.4.tar.gz" - sha256: "e9462a141b5db30006704f537d19b92357a59be38d590272e6118976b0356ccd" - "0.7.3": - url: "https://github.com/awslabs/aws-c-common/archive/v0.7.3.tar.gz" - sha256: "e4b80d368668814d9b76989fd2e3cd0fcf0be160bbb8bfeedf1f652e27f9c08c" - "0.7.2": - url: "https://github.com/awslabs/aws-c-common/archive/v0.7.2.tar.gz" - sha256: "455aed7447ed58eb7d5d3e8c952ed59f77c71dfed4115883e900f36d95f06dab" - "0.7.1": - url: "https://github.com/awslabs/aws-c-common/archive/v0.7.1.tar.gz" - sha256: "75c444a337e446e82d4f71c127118981656234b25cbdfd5913b8de713354fb43" - "0.7.0": - url: "https://github.com/awslabs/aws-c-common/archive/v0.7.0.tar.gz" - sha256: "a4e94d2c1d045a27467c9dfae51382f851a5223c3a0ecc15a96d1dba94f85ad6" "0.6.20": url: "https://github.com/awslabs/aws-c-common/archive/v0.6.20.tar.gz" sha256: "6eb0b806c78b36a32eec9bcba8d2833e3973491a29d46fe3d11edc3f8d3e7f73" - "0.6.19": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.19.tar.gz" - sha256: "91cb2b809687be19fce8d6ca03ddc00c78723854ead30dcb58bdc4172cb1796c" - "0.6.17": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.17.tar.gz" - sha256: "441156ecfabb84e41601d7173a7f88267f099899f0ae6091c3b745d9e02211f6" - "0.6.15": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.15.tar.gz" - sha256: "eb3ead3fb7a1f09c046393f776a96a0f50ae5f38c70d462273084280383669f1" - "0.6.14": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.14.tar.gz" - sha256: "1691c9dad5a0d236c2a0e351cc972231b176947e454c61d1c4b3ea4ab42f32e7" - "0.6.11": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.11.tar.gz" - sha256: "86159bd1128eee2813f705c275d319e14d1b77017fab46f6ca5dafcc66edaea9" - "0.6.9": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.9.tar.gz" - sha256: "928a3e36f24d1ee46f9eec360ec5cebfe8b9b8994fe39d4fa74ff51aebb12717" - "0.6.8": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.8.tar.gz" - sha256: "2997e851ed690a614507a43f4c393f45a198614d94da1660ecdf9b5a729535fc" - "0.6.7": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.7.tar.gz" - sha256: "643b35c62f948367f484f3a436bc37b5799538f47b08aa72deb3818b8bcdc631" "0.4.25": url: "https://github.com/awslabs/aws-c-common/archive/v0.4.25.tar.gz" sha256: "f85a8f74e42bd983a4615654457f8037876bc6b8dbf890e368bb516cbc2e9844" patches: "0.4.25": - patch_file: "patches/0001-disable-fPIC.patch" + patch_description: "Don't enable position independent code (will be handled by conan)" + patch_type: "conan" - patch_file: "patches/0002-no-warnings-as-errors.patch" + patch_description: "Don't make all warnings into errors" + patch_type: "portability" diff --git a/aws-c-common/all/conanfile.py b/aws-c-common/all/conanfile.py index 22976c3..4c7af96 100644 --- a/aws-c-common/all/conanfile.py +++ b/aws-c-common/all/conanfile.py @@ -2,10 +2,11 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os +import textwrap required_conan_version = ">=1.53.0" @@ -82,26 +83,44 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-common")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-common": "aws-c-common::aws-c-common"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-common") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-common") - - self.cpp_info.filenames["cmake_find_package"] = "aws-c-common" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-common" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-common-lib"].set_property("cmake_target_name", "AWS::aws-c-common") - self.cpp_info.components["aws-c-common-lib"].names["cmake_find_package"] = "aws-c-common" - self.cpp_info.components["aws-c-common-lib"].names["cmake_find_package_multi"] = "aws-c-common" - - self.cpp_info.components["aws-c-common-lib"].libs = ["aws-c-common"] + self.cpp_info.libs = ["aws-c-common"] + if self.options.shared: + self.cpp_info.defines.append("AWS_COMMON_USE_IMPORT_EXPORT") if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["aws-c-common-lib"].system_libs = ["dl", "m", "pthread", "rt"] + self.cpp_info.system_libs = ["dl", "m", "pthread", "rt"] elif self.settings.os == "Windows": - self.cpp_info.components["aws-c-common-lib"].system_libs = ["bcrypt", "ws2_32"] + self.cpp_info.system_libs = ["bcrypt", "ws2_32"] if Version(self.version) >= "0.6.13": - self.cpp_info.components["aws-c-common-lib"].system_libs.append("shlwapi") + self.cpp_info.system_libs.append("shlwapi") if not self.options.shared: if is_apple_os(self): - self.cpp_info.components["aws-c-common-lib"].frameworks = ["CoreFoundation"] - self.cpp_info.components["aws-c-common-lib"].builddirs.append(os.path.join("lib", "cmake")) + self.cpp_info.frameworks = ["CoreFoundation"] + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/aws-c-common/config.yml b/aws-c-common/config.yml index 5a8e794..0ba98ed 100644 --- a/aws-c-common/config.yml +++ b/aws-c-common/config.yml @@ -1,35 +1,19 @@ versions: - "0.8.2": + "0.9.12": folder: all - "0.7.5": + "0.9.6": folder: all - "0.7.4": + "0.9.3": folder: all - "0.7.3": + "0.9.0": folder: all - "0.7.2": + "0.8.23": folder: all - "0.7.1": + "0.8.2": folder: all - "0.7.0": + "0.7.5": folder: all "0.6.20": folder: all - "0.6.19": - folder: all - "0.6.17": - folder: all - "0.6.15": - folder: all - "0.6.14": - folder: all - "0.6.11": - folder: all - "0.6.9": - folder: all - "0.6.8": - folder: all - "0.6.7": - folder: all "0.4.25": folder: all diff --git a/aws-c-compression/all/conandata.yml b/aws-c-compression/all/conandata.yml index 1baf0be..d936f5e 100644 --- a/aws-c-compression/all/conandata.yml +++ b/aws-c-compression/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.17": + url: "https://github.com/awslabs/aws-c-compression/archive/v0.2.17.tar.gz" + sha256: "703d1671e395ea26f8b0b70d678ed471421685a89e127f8aa125e2b2ecedb0e0" "0.2.15": url: "https://github.com/awslabs/aws-c-compression/archive/v0.2.15.tar.gz" sha256: "11d58a229e2961b2b36493155a981dea2c8a0bc0d113b0073deb8c3189cfa04e" diff --git a/aws-c-compression/all/conanfile.py b/aws-c-compression/all/conanfile.py index 4988387..a6b8eb1 100644 --- a/aws-c-compression/all/conanfile.py +++ b/aws-c-compression/all/conanfile.py @@ -1,25 +1,21 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get, rmdir +from conan.tools.files import copy, get, rmdir, save +from conan.tools.scm import Version import os +import textwrap -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class AwsCCompression(ConanFile): name = "aws-c-compression" description = "C99 implementation of huffman encoding/decoding" - topics = ( - "aws", - "amazon", - "cloud", - "compression", - "huffman", - ) + topics = ("aws", "amazon", "cloud", "compression", "huffman", ) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-compression" - license = ("Apache-2.0",) - + license = "Apache-2.0" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,32 +32,21 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2@milvus/dev") + if Version(self.version) <= "0.2.15": + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + else: + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -76,36 +61,39 @@ def build(self): cmake.build() def package(self): - copy( - self, - "LICENSE", - src=self.source_folder, - dst=os.path.join(self.package_folder, "licenses"), - ) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-compression")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-compression": "aws-c-compression::aws-c-compression"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-compression") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-compression") - # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["aws-c-compression-lib"].libs = ["aws-c-compression"] + self.cpp_info.libs = ["aws-c-compression"] + if self.options.shared: + self.cpp_info.defines.append("AWS_COMPRESSION_USE_IMPORT_EXPORT") # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.filenames["cmake_find_package"] = "aws-c-compression" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-compression" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-compression-lib"].names[ - "cmake_find_package" - ] = "aws-c-compression" - self.cpp_info.components["aws-c-compression-lib"].names[ - "cmake_find_package_multi" - ] = "aws-c-compression" - self.cpp_info.components["aws-c-compression-lib"].set_property( - "cmake_target_name", "AWS::aws-c-compression" - ) - self.cpp_info.components["aws-c-compression-lib"].requires = [ - "aws-c-common::aws-c-common-lib" - ] + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/aws-c-compression/all/test_v1_package/CMakeLists.txt b/aws-c-compression/all/test_v1_package/CMakeLists.txt index e3ad596..0d20897 100644 --- a/aws-c-compression/all/test_v1_package/CMakeLists.txt +++ b/aws-c-compression/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-c-compression REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-compression) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/aws-c-compression/config.yml b/aws-c-compression/config.yml index 5a381bb..aae1816 100644 --- a/aws-c-compression/config.yml +++ b/aws-c-compression/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.17": + folder: all "0.2.15": folder: all "0.2.14": diff --git a/aws-c-event-stream/all/conandata.yml b/aws-c-event-stream/all/conandata.yml index 61428e9..dd1f673 100644 --- a/aws-c-event-stream/all/conandata.yml +++ b/aws-c-event-stream/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.3.2": + url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.3.2.tar.gz" + sha256: "3134b35a45e9f9d974c2b78ee44fd2ea0aebc04df80236b80692aa63bee2092e" + "0.3.1": + url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.3.1.tar.gz" + sha256: "bdbc420efc2572689fb167ac288e982a01224876eb79d80e2411fad4c43e9dc0" "0.2.15": url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.2.15.tar.gz" sha256: "4ff2ada07ede3c6afa4b8e6e20de541e717038307f29b38c27efa7c4d875ee26" diff --git a/aws-c-event-stream/all/conanfile.py b/aws-c-event-stream/all/conanfile.py index 0892ae7..e7d1df5 100644 --- a/aws-c-event-stream/all/conanfile.py +++ b/aws-c-event-stream/all/conanfile.py @@ -1,29 +1,21 @@ from conan import ConanFile -from conan.tools.files import ( - apply_conandata_patches, - export_conandata_patches, - get, - copy, - rmdir, -) -from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, save +from conan.tools.scm import Version import os +import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class AwsCEventStream(ConanFile): name = "aws-c-event-stream" description = "C99 implementation of the vnd.amazon.eventstream content-type" - license = ("Apache-2.0",) + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-event-stream" - topics = ( - "aws", - "eventstream", - "content", - ) + topics = ("aws", "eventstream", "content", ) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -43,38 +35,30 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-checksums/0.1.13@milvus/dev") - self.requires("aws-c-common/0.8.2@milvus/dev") + if Version(self.version) < "0.3.1": + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + self.requires("aws-checksums/0.1.13") + else: + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) + self.requires("aws-checksums/0.1.17") if Version(self.version) >= "0.2": if Version(self.version) < "0.2.11": - self.requires("aws-c-io/0.10.20@milvus/dev") + self.requires("aws-c-io/0.10.20") + elif Version(self.version) < "0.3.1": + self.requires("aws-c-io/0.13.4") else: - self.requires("aws-c-io/0.13.4@milvus/dev") + self.requires("aws-c-io/0.13.35") def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -92,38 +76,39 @@ def build(self): cmake.build() def package(self): - copy( - self, - pattern="LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() - rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-event-stream")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-event-stream": "aws-c-event-stream::aws-c-event-stream"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-event-stream") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-event-stream") - self.cpp_info.components["aws-c-event-stream-lib"].names[ - "cmake_find_package" - ] = "aws-c-event-stream" - self.cpp_info.components["aws-c-event-stream-lib"].names[ - "cmake_find_package_multi" - ] = "aws-c-event-stream" - self.cpp_info.components["aws-c-event-stream-lib"].libs = ["aws-c-event-stream"] - self.cpp_info.components["aws-c-event-stream-lib"].requires = [ - "aws-c-common::aws-c-common-lib", - "aws-checksums::aws-checksums", - ] - if Version(self.version) >= "0.2": - self.cpp_info.components["aws-c-event-stream-lib"].requires.append( - "aws-c-io::aws-c-io-lib" - ) - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "aws-c-event-stream" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-event-stream" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" + self.cpp_info.libs = ["aws-c-event-stream"] + if self.options.shared: + self.cpp_info.defines.append("AWS_EVENT_STREAM_USE_IMPORT_EXPORT") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/aws-c-event-stream/all/test_v1_package/CMakeLists.txt b/aws-c-event-stream/all/test_v1_package/CMakeLists.txt index 674dc4a..0d20897 100644 --- a/aws-c-event-stream/all/test_v1_package/CMakeLists.txt +++ b/aws-c-event-stream/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package C) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-c-event-stream REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-event-stream) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/aws-c-event-stream/config.yml b/aws-c-event-stream/config.yml index 96ac653..38b2276 100644 --- a/aws-c-event-stream/config.yml +++ b/aws-c-event-stream/config.yml @@ -1,4 +1,8 @@ versions: + "0.3.2": + folder: all + "0.3.1": + folder: all "0.2.15": folder: all "0.2.12": diff --git a/aws-c-http/all/conandata.yml b/aws-c-http/all/conandata.yml index 09a36b1..6ee734e 100644 --- a/aws-c-http/all/conandata.yml +++ b/aws-c-http/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.8.1": + url: "https://github.com/awslabs/aws-c-http/archive/v0.8.1.tar.gz" + sha256: "83fb47e2d7956469bb328f16dea96663e96f8f20dc60dc4e9676b82804588530" + "0.7.14": + url: "https://github.com/awslabs/aws-c-http/archive/v0.7.14.tar.gz" + sha256: "afb935395c93427ac0853d6363900a71816a0508f18c86e84da0e6ebe7271429" "0.6.22": url: "https://github.com/awslabs/aws-c-http/archive/v0.6.22.tar.gz" sha256: "a178fd04bd1618469cd21afc5b84cbe436d1f9d9e036fefbd3a8f00356da4d4c" diff --git a/aws-c-http/all/conanfile.py b/aws-c-http/all/conanfile.py index 23be37b..f931154 100644 --- a/aws-c-http/all/conanfile.py +++ b/aws-c-http/all/conanfile.py @@ -1,25 +1,21 @@ from conan import ConanFile -from conan.tools.scm import Version -from conan.tools.files import get, copy, rmdir from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rmdir, save +from conan.tools.scm import Version import os +import textwrap -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class AwsCHttp(ConanFile): name = "aws-c-http" description = "C99 implementation of the HTTP/1.1 and HTTP/2 specifications" - license = ("Apache-2.0",) + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-http" - topics = ( - "aws", - "amazon", - "cloud", - "http", - "http2", - ) + topics = ("aws", "amazon", "cloud", "http", "http2", ) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,37 +32,30 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2@milvus/dev") - self.requires("aws-c-compression/0.2.15@milvus/dev") - if Version(self.version) < "0.6.22": - self.requires("aws-c-io/0.10.20@milvus/dev") + if Version(self.version) <= "0.6.22": + self.requires("aws-c-compression/0.2.15") + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + else: + self.requires("aws-c-compression/0.2.17") + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) + + if Version(self.version) <= "0.6.13": + self.requires("aws-c-io/0.10.20", transitive_headers=True, transitive_libs=True) + elif Version(self.version) <= "0.6.22": + self.requires("aws-c-io/0.13.4", transitive_headers=True, transitive_libs=True) else: - self.requires("aws-c-io/0.13.4@milvus/dev") + self.requires("aws-c-io/0.13.35", transitive_headers=True, transitive_libs=True) def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -82,37 +71,39 @@ def build(self): cmake.build() def package(self): - copy( - self, - pattern="LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-http")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-http": "aws-c-http::aws-c-http"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-http") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-http") + self.cpp_info.libs = ["aws-c-http"] + if self.options.shared: + self.cpp_info.defines.append("AWS_HTTP_USE_IMPORT_EXPORT") - self.cpp_info.filenames["cmake_find_package"] = "aws-c-http" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-http" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - - self.cpp_info.components["aws-c-http-lib"].set_property( - "cmake_target_name", "AWS::aws-c-http" - ) - self.cpp_info.components["aws-c-http-lib"].names[ - "cmake_find_package" - ] = "aws-c-http" - self.cpp_info.components["aws-c-http-lib"].names[ - "cmake_find_package_multi" - ] = "aws-c-http" - self.cpp_info.components["aws-c-http-lib"].libs = ["aws-c-http"] - self.cpp_info.components["aws-c-http-lib"].requires = [ - "aws-c-common::aws-c-common-lib", - "aws-c-compression::aws-c-compression-lib", - "aws-c-io::aws-c-io-lib", - ] + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/aws-c-http/all/test_v1_package/CMakeLists.txt b/aws-c-http/all/test_v1_package/CMakeLists.txt index b3195e1..0d20897 100644 --- a/aws-c-http/all/test_v1_package/CMakeLists.txt +++ b/aws-c-http/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.1) - -project(test_package C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-c-http REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-http) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/aws-c-http/config.yml b/aws-c-http/config.yml index ab4b9f0..9ef9060 100644 --- a/aws-c-http/config.yml +++ b/aws-c-http/config.yml @@ -1,4 +1,8 @@ versions: + "0.8.1": + folder: all + "0.7.14": + folder: all "0.6.22": folder: all "0.6.13": diff --git a/aws-c-io/all/conandata.yml b/aws-c-io/all/conandata.yml index 4a9102a..1e15f1d 100644 --- a/aws-c-io/all/conandata.yml +++ b/aws-c-io/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.13.35": + url: "https://github.com/awslabs/aws-c-io/archive/v0.13.35.tar.gz" + sha256: "a9232dbbb3324de36a280859a4ea84dd2b75e47961805f1cffe0f3a7e1831711" + "0.13.32": + url: "https://github.com/awslabs/aws-c-io/archive/v0.13.32.tar.gz" + sha256: "2a6b18c544d014ca4f55cb96002dbbc1e52a2120541c809fa974cb0838ea72cc" "0.13.4": url: "https://github.com/awslabs/aws-c-io/archive/v0.13.4.tar.gz" sha256: "133bd0aa46caa2041962cd4f6d076209686ce2934af82f86d1a258df4cbdce8b" @@ -11,9 +17,3 @@ sources: "0.10.13": url: "https://github.com/awslabs/aws-c-io/archive/v0.10.13.tar.gz" sha256: "ee34a93190e35a5c372ba73661dd69c48986e051a4b26dedb62bc5aa78f1660f" - "0.10.9": - url: "https://github.com/awslabs/aws-c-io/archive/v0.10.9.tar.gz" - sha256: "c64464152abe8b7e23f10bc026ed54a15eaf0ec0aae625d28e2caf4489090327" - "0.10.5": - url: "https://github.com/awslabs/aws-c-io/archive/v0.10.5.tar.gz" - sha256: "59abd4606661790cc0b777807938f3134cce77c03383015781498cfbfd191811" diff --git a/aws-c-io/all/conanfile.py b/aws-c-io/all/conanfile.py index 656bf07..36c3965 100644 --- a/aws-c-io/all/conanfile.py +++ b/aws-c-io/all/conanfile.py @@ -1,25 +1,21 @@ from conan import ConanFile -from conan.tools.files import get, copy, rmdir -from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rmdir, save +from conan.tools.scm import Version import os +import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class AwsCIO(ConanFile): name = "aws-c-io" description = "IO and TLS for application protocols" - license = ("Apache-2.0",) + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-io" - topics = ( - "aws", - "amazon", - "cloud", - "io", - "tls", - ) + topics = ("aws", "amazon", "cloud", "io", "tls",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,18 +32,9 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") @@ -55,23 +42,18 @@ def layout(self): def requirements(self): # the versions of aws-c-common and aws-c-io are tied since aws-c-common/0.6.12 and aws-c-io/0.10.10 # Please refer https://github.com/conan-io/conan-center-index/issues/7763 - if Version(self.version) <= "0.10.9": - self.requires("aws-c-common/0.6.11@milvus/dev") - self.requires("aws-c-cal/0.5.11@milvus/dev") + if Version(self.version) <= "0.13.4": + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.5.13") else: - self.requires("aws-c-common/0.8.2@milvus/dev") - self.requires("aws-c-cal/0.5.20@milvus/dev") + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.6.9", transitive_headers=True, transitive_libs=True) if self.settings.os in ["Linux", "FreeBSD", "Android"]: - self.requires("s2n/1.3.31@milvus/dev") + self.requires("s2n/1.3.55") def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -87,47 +69,43 @@ def build(self): cmake.build() def package(self): - copy( - self, - pattern="LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-io")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-io": "aws-c-io::aws-c-io"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-io") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-io") - # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["aws-c-io-lib"].libs = ["aws-c-io"] + self.cpp_info.libs = ["aws-c-io"] + if self.options.shared: + self.cpp_info.defines.append("AWS_IO_USE_IMPORT_EXPORT") if self.settings.os == "Macos": - self.cpp_info.components["aws-c-io-lib"].frameworks.append("Security") + self.cpp_info.frameworks.append("Security") if self.settings.os == "Windows": - self.cpp_info.components["aws-c-io-lib"].system_libs = [ - "crypt32", - "secur32", - "shlwapi", - ] + self.cpp_info.system_libs = ["crypt32", "secur32", "shlwapi"] # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.filenames["cmake_find_package"] = "aws-c-io" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-io" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-io-lib"].names[ - "cmake_find_package" - ] = "aws-c-io" - self.cpp_info.components["aws-c-io-lib"].names[ - "cmake_find_package_multi" - ] = "aws-c-io" - self.cpp_info.components["aws-c-io-lib"].set_property( - "cmake_target_name", "AWS::aws-c-io" - ) - self.cpp_info.components["aws-c-io-lib"].requires = [ - "aws-c-cal::aws-c-cal-lib", - "aws-c-common::aws-c-common-lib", - ] - if self.settings.os in ["Linux", "FreeBSD", "Android"]: - self.cpp_info.components["aws-c-io-lib"].requires.append("s2n::s2n-lib") + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/aws-c-io/config.yml b/aws-c-io/config.yml index 6dca88e..8a602cc 100644 --- a/aws-c-io/config.yml +++ b/aws-c-io/config.yml @@ -1,4 +1,8 @@ versions: + "0.13.35": + folder: all + "0.13.32": + folder: all "0.13.4": folder: all "0.11.2": @@ -7,7 +11,3 @@ versions: folder: all "0.10.13": folder: all - "0.10.9": - folder: all - "0.10.5": - folder: all diff --git a/aws-c-mqtt/all/conandata.yml b/aws-c-mqtt/all/conandata.yml new file mode 100644 index 0000000..275052c --- /dev/null +++ b/aws-c-mqtt/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "0.9.10": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.9.10.tar.gz" + sha256: "a8f92cb045e2c1e0b7e87e5c43ca373eb020014b5d3ebd75ed67ffff430d9ab6" + "0.8.12": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.8.12.tar.gz" + sha256: "df02de478ab1806bb57bcb78e5faa21b567716dcb64f8a52ae90a2b84f43cba1" + "0.7.12": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.12.tar.gz" + sha256: "cf80f1b4f37aa8a6b8698315fae32cbf2bd944b67784f07b5762f392f18e64df" + "0.7.10": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.10.tar.gz" + sha256: "95667477e17bc99d49a1d6674d7fb98f9a0379b6966cb2ed4863152e959d9e8f" + "0.7.9": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.9.tar.gz" + sha256: "8556ae7c2b30ebb4ccb61becb120a848ea33315f7cf85436ebe5f21b75ab09c4" + "0.7.6": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.6.tar.gz" + sha256: "a02c0525f7ddcdc058cd9f507b2f3a8be0383fc946920ed32c9d780cc29703ac" diff --git a/aws-c-mqtt/all/conanfile.py b/aws-c-mqtt/all/conanfile.py new file mode 100644 index 0000000..4740c44 --- /dev/null +++ b/aws-c-mqtt/all/conanfile.py @@ -0,0 +1,107 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rmdir, save +from conan.tools.scm import Version + +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class AwsCMQTT(ConanFile): + name = "aws-c-mqtt" + description = "C99 implementation of the MQTT 3.1.1 specification." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/awslabs/aws-c-mqtt" + topics = ("aws", "amazon", "cloud", "mqtt") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) <= "0.7.12": + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.5.13") + self.requires("aws-c-io/0.10.20", transitive_headers=True) + self.requires("aws-c-http/0.6.13") + else: + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.6.9") + self.requires("aws-c-io/0.13.35", transitive_headers=True) + self.requires("aws-c-http/0.7.14") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-mqtt")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-mqtt": "aws-c-mqtt::aws-c-mqtt"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "aws-c-mqtt") + self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-mqtt") + self.cpp_info.libs = ["aws-c-mqtt"] + if self.options.shared: + self.cpp_info.defines.append("AWS_MQTT_USE_IMPORT_EXPORT") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/aws-c-mqtt/all/test_package/CMakeLists.txt b/aws-c-mqtt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..04c8de7 --- /dev/null +++ b/aws-c-mqtt/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(aws-c-mqtt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-mqtt) diff --git a/aws-c-mqtt/all/test_package/conanfile.py b/aws-c-mqtt/all/test_package/conanfile.py new file mode 100644 index 0000000..a9fb966 --- /dev/null +++ b/aws-c-mqtt/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/aws-c-mqtt/all/test_package/test_package.c b/aws-c-mqtt/all/test_package/test_package.c new file mode 100644 index 0000000..95b2eb7 --- /dev/null +++ b/aws-c-mqtt/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +int main() { + struct aws_allocator *allocator = aws_default_allocator(); + aws_mqtt_library_init(allocator); + aws_mqtt_library_clean_up(); + + return EXIT_SUCCESS; +} diff --git a/aws-c-mqtt/all/test_v1_package/CMakeLists.txt b/aws-c-mqtt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/aws-c-mqtt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/openblas/all/test_v1_package/conanfile.py b/aws-c-mqtt/all/test_v1_package/conanfile.py similarity index 100% rename from openblas/all/test_v1_package/conanfile.py rename to aws-c-mqtt/all/test_v1_package/conanfile.py diff --git a/aws-c-mqtt/config.yml b/aws-c-mqtt/config.yml new file mode 100644 index 0000000..788eecc --- /dev/null +++ b/aws-c-mqtt/config.yml @@ -0,0 +1,13 @@ +versions: + "0.9.10": + folder: all + "0.8.12": + folder: all + "0.7.12": + folder: all + "0.7.10": + folder: all + "0.7.9": + folder: all + "0.7.6": + folder: all diff --git a/aws-c-s3/all/conandata.yml b/aws-c-s3/all/conandata.yml index af6e82a..2433ee6 100644 --- a/aws-c-s3/all/conandata.yml +++ b/aws-c-s3/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.4.5": + url: "https://github.com/awslabs/aws-c-s3/archive/v0.4.5.tar.gz" + sha256: "c9b588f5761ae6754dab2b51124784be78887f054856f02e44b6e51c25873055" + "0.3.24": + url: "https://github.com/awslabs/aws-c-s3/archive/v0.3.24.tar.gz" + sha256: "09803db4af98bba0af263434e2de432cdccdb3ab709411abba8e05d34840f815" "0.1.49": url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.49.tar.gz" sha256: "71acbba41a02477a6c352172da561bc2138bf239b936490c773d7aaa83afc9ab" @@ -11,6 +17,3 @@ sources: "0.1.27": url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.27.tar.gz" sha256: "8fccbf967c3b29f0feaa1ba3de158b7ead805c3b4302c45b7cad3429f045920c" - "0.1.19": - url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.19.tar.gz" - sha256: "30e17e31eed18e8d621cd3d3978b2e6eeeee5557bfc3a9d701d0d3e1c4a8a74d" diff --git a/aws-c-s3/all/conanfile.py b/aws-c-s3/all/conanfile.py index 2506800..1813ec3 100644 --- a/aws-c-s3/all/conanfile.py +++ b/aws-c-s3/all/conanfile.py @@ -1,19 +1,21 @@ from conan import ConanFile -from conan.tools.files import get, copy, rmdir -from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rmdir, save +from conan.tools.scm import Version import os +import textwrap -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class AwsCS3(ConanFile): name = "aws-c-s3" description = "C99 implementation of the S3 client" - license = ("Apache-2.0",) + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-s3" topics = ("aws", "amazon", "cloud", "s3") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,42 +32,39 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2@milvus/dev") + if Version(self.version) < "0.3.24": + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.5.13") + else: + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.6.9") if Version(self.version) < "0.1.49": - self.requires("aws-c-io/0.10.20@milvus/dev") - self.requires("aws-c-http/0.6.13@milvus/dev") - self.requires("aws-c-auth/0.6.11@milvus/dev") + self.requires("aws-c-auth/0.6.11", transitive_headers=True) + self.requires("aws-c-http/0.6.13") + self.requires("aws-c-io/0.10.20", transitive_headers=True) + elif Version(self.version) < "0.3.24": + self.requires("aws-c-auth/0.6.17", transitive_headers=True) + self.requires("aws-c-http/0.6.22") + self.requires("aws-c-io/0.13.4", transitive_headers=True) else: - self.requires("aws-c-io/0.13.4@milvus/dev") - self.requires("aws-c-http/0.6.22@milvus/dev") - self.requires("aws-c-auth/0.6.17@milvus/dev") - if Version(self.version) >= "0.1.36": - self.requires("aws-checksums/0.1.13@milvus/dev") + self.requires("aws-c-auth/0.7.8", transitive_headers=True) + self.requires("aws-c-http/0.7.14") + self.requires("aws-c-io/0.13.35", transitive_headers=True) + if Version(self.version) >= "0.3.24": + self.requires("aws-checksums/0.1.17") + elif Version(self.version) >= "0.1.36": + self.requires("aws-checksums/0.1.13") def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -81,42 +80,39 @@ def build(self): cmake.build() def package(self): - copy( - self, - pattern="LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-s3")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-s3": "aws-c-s3::aws-c-s3"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-s3") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-s3") + self.cpp_info.libs = ["aws-c-s3"] + if self.options.shared: + self.cpp_info.defines.append("AWS_S3_USE_IMPORT_EXPORT") - self.cpp_info.filenames["cmake_find_package"] = "aws-c-s3" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-s3" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-s3-lib"].names[ - "cmake_find_package" - ] = "aws-c-s3" - self.cpp_info.components["aws-c-s3-lib"].names[ - "cmake_find_package_multi" - ] = "aws-c-s3" - self.cpp_info.components["aws-c-s3-lib"].set_property( - "cmake_target_name", "AWS::aws-c-s3" - ) - - self.cpp_info.components["aws-c-s3-lib"].libs = ["aws-c-s3"] - self.cpp_info.components["aws-c-s3-lib"].requires = [ - "aws-c-common::aws-c-common-lib", - "aws-c-io::aws-c-io-lib", - "aws-c-http::aws-c-http-lib", - "aws-c-auth::aws-c-auth-lib", - ] - if Version(self.version) >= "0.1.36": - self.cpp_info.components["aws-c-s3-lib"].requires.append( - "aws-checksums::aws-checksums-lib" - ) + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/aws-c-s3/all/test_v1_package/CMakeLists.txt b/aws-c-s3/all/test_v1_package/CMakeLists.txt index 0778b2e..0d20897 100644 --- a/aws-c-s3/all/test_v1_package/CMakeLists.txt +++ b/aws-c-s3/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-c-s3 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-s3) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/aws-c-s3/config.yml b/aws-c-s3/config.yml index 1820954..9dc59a1 100644 --- a/aws-c-s3/config.yml +++ b/aws-c-s3/config.yml @@ -1,4 +1,8 @@ versions: + "0.4.5": + folder: all + "0.3.24": + folder: all "0.1.49": folder: all "0.1.37": @@ -7,5 +11,3 @@ versions: folder: all "0.1.27": folder: all - "0.1.19": - folder: all diff --git a/aws-c-sdkutils/all/conandata.yml b/aws-c-sdkutils/all/conandata.yml index 7ec4906..4f2cc09 100644 --- a/aws-c-sdkutils/all/conandata.yml +++ b/aws-c-sdkutils/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.12": + url: "https://github.com/awslabs/aws-c-sdkutils/archive/v0.1.12.tar.gz" + sha256: "c876c3ce2918f1181c24829f599c8f06e29733f0bd6556d4c4fb523390561316" "0.1.3": url: "https://github.com/awslabs/aws-c-sdkutils/archive/v0.1.3.tar.gz" sha256: "13d99c0877424a8fad40f312762968012dd54ec60a4438fb601ee65ff8b2484b" diff --git a/aws-c-sdkutils/all/conanfile.py b/aws-c-sdkutils/all/conanfile.py index ba8f7ba..e2bfcef 100644 --- a/aws-c-sdkutils/all/conanfile.py +++ b/aws-c-sdkutils/all/conanfile.py @@ -1,18 +1,21 @@ from conan import ConanFile -from conan.tools.files import get, copy, rmdir from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rmdir, save +from conan.tools.scm import Version import os +import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class AwsCSDKUtils(ConanFile): name = "aws-c-sdkutils" description = "C99 library implementing AWS SDK specific utilities. Includes utilities for ARN parsing, reading AWS profiles, etc..." - license = ("Apache-2.0",) + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-sdkutils" topics = ("aws", "amazon", "cloud", "utility", "ARN") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,32 +32,21 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2@milvus/dev") + if Version(self.version) <= "0.1.3": + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) + else: + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -69,35 +61,39 @@ def build(self): cmake.build() def package(self): - copy( - self, - pattern="LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-sdkutils")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-sdkutils": "aws-c-sdkutils::aws-c-sdkutils"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-sdkutils") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-sdkutils") + self.cpp_info.libs = ["aws-c-sdkutils"] + if self.options.shared: + self.cpp_info.defines.append("AWS_SDKUTILS_USE_IMPORT_EXPORT") - self.cpp_info.filenames["cmake_find_package"] = "aws-c-sdkutils" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-sdkutils" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-sdkutils-lib"].names[ - "cmake_find_package" - ] = "aws-c-sdkutils" - self.cpp_info.components["aws-c-sdkutils-lib"].names[ - "cmake_find_package_multi" - ] = "aws-c-sdkutils" - self.cpp_info.components["aws-c-sdkutils-lib"].set_property( - "cmake_target_name", "AWS::aws-c-sdkutils" - ) - - self.cpp_info.components["aws-c-sdkutils-lib"].libs = ["aws-c-sdkutils"] - self.cpp_info.components["aws-c-sdkutils-lib"].requires = [ - "aws-c-common::aws-c-common-lib" - ] + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt b/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt index 6e620de..0d20897 100644 --- a/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt +++ b/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.1) - -project(test_package C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-c-sdkutils REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} AWS::aws-c-sdkutils) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/aws-c-sdkutils/config.yml b/aws-c-sdkutils/config.yml index b2ced6f..c2aa05a 100644 --- a/aws-c-sdkutils/config.yml +++ b/aws-c-sdkutils/config.yml @@ -1,4 +1,6 @@ versions: + "0.1.12": + folder: all "0.1.3": folder: all "0.1.2": diff --git a/aws-checksums/all/conandata.yml b/aws-checksums/all/conandata.yml index ddf66e3..9897086 100644 --- a/aws-checksums/all/conandata.yml +++ b/aws-checksums/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.17": + url: "https://github.com/awslabs/aws-checksums/archive/v0.1.17.tar.gz" + sha256: "83c1fbae826631361a529e9565e64a942c412baaec6b705ae5da3f056b97b958" "0.1.13": url: "https://github.com/awslabs/aws-checksums/archive/v0.1.13.tar.gz" sha256: "0f897686f1963253c5069a0e495b85c31635ba146cd3ac38cc2ea31eaf54694d" @@ -14,5 +17,11 @@ sources: patches: "0.1.5": - patch_file: "patches/0001-use-PROJECT_SOURCE_DIR.patch" + patch_description: "use PROJECT_NAME instead of CMAKE_PROJECT_NAME" + patch_type: "conan" - patch_file: "patches/0002-disable-overriding-fPIC.patch" + patch_description: "disable overriding -fPIC" + patch_type: "conan" - patch_file: "patches/0003-disable-building-tests.patch" + patch_description: "build no tests" + patch_type: "conan" diff --git a/aws-checksums/all/conanfile.py b/aws-checksums/all/conanfile.py index 0f94977..e2711f6 100644 --- a/aws-checksums/all/conanfile.py +++ b/aws-checksums/all/conanfile.py @@ -1,9 +1,12 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir, save +from conan.tools.scm import Version import os +import textwrap + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.52.0" class AwsChecksums(ConanFile): name = "aws-checksums" @@ -11,10 +14,11 @@ class AwsChecksums(ConanFile): "Cross-Platform HW accelerated CRC32c and CRC32 with fallback to efficient " "SW implementations. C interface with language bindings for each of our SDKs." ) - license = "Apache-2.0", + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-checksums" topics = ("aws", "checksum", ) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -34,28 +38,21 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2@milvus/dev") + if Version(self.version) < "0.1.17": + self.requires("aws-c-common/0.8.2") + else: + self.requires("aws-c-common/0.9.6", transitive_headers=True) def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -76,18 +73,34 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-checksums")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-checksums": "aws-checksums::aws-checksums"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-checksums") self.cpp_info.set_property("cmake_target_name", "AWS::aws-checksums") - # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["aws-checksums-lib"].libs = ["aws-checksums"] + self.cpp_info.libs = ["aws-checksums"] + if self.options.shared: + self.cpp_info.defines.append("AWS_CHECKSUMS_USE_IMPORT_EXPORT") # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.filenames["cmake_find_package"] = "aws-checksums" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-checksums" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-checksums-lib"].names["cmake_find_package"] = "aws-checksums" - self.cpp_info.components["aws-checksums-lib"].names["cmake_find_package_multi"] = "aws-checksums" - self.cpp_info.components["aws-checksums-lib"].set_property("cmake_target_name", "AWS::aws-checksums") - self.cpp_info.components["aws-checksums-lib"].requires = ["aws-c-common::aws-c-common-lib"] + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/aws-checksums/all/test_v1_package/CMakeLists.txt b/aws-checksums/all/test_v1_package/CMakeLists.txt index 915af9f..0d20897 100644 --- a/aws-checksums/all/test_v1_package/CMakeLists.txt +++ b/aws-checksums/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-checksums REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-checksums) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/aws-checksums/config.yml b/aws-checksums/config.yml index 55fedf4..efe23bd 100644 --- a/aws-checksums/config.yml +++ b/aws-checksums/config.yml @@ -1,4 +1,6 @@ versions: + "0.1.17": + folder: all "0.1.13": folder: all "0.1.12": diff --git a/aws-crt-cpp/all/conandata.yml b/aws-crt-cpp/all/conandata.yml index 5615e65..9126f56 100644 --- a/aws-crt-cpp/all/conandata.yml +++ b/aws-crt-cpp/all/conandata.yml @@ -1,7 +1,7 @@ sources: - "0.18.8": - url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.18.8.tar.gz" - sha256: "70ea622cf8c1a7028b24078e909ee5898990444436584178f58d61b50b5b197d" + "0.24.1": + url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.24.1.tar.gz" + sha256: "c627fbc76fc31332801e29872203a11ce0234b7c17e75811277aa913f1550d6f" "0.17.23": url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.17.23.tar.gz" sha256: "28061c3efa493519cfae46e4ea96389f03a81eeec7613d7da861dd8c5f4f6598" @@ -12,10 +12,13 @@ sources: url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.14.3.tar.gz" sha256: "3ea16c43e691bab0c373ba1ad072f6535390c516ebda658dfaf4d074d920e0fb" patches: - "0.18.8": - - patch_file: "patches/0.17.23-fix-cast-error.patch" + "0.24.1": + - patch_file: "patches/0.24.1-fix-cast-error.patch" patch_description: "fix const cast error" patch_type: "portability" + - patch_file: "patches/0.24.1-disable-sanitizers.patch" + patch_description: "disable sanitizers" + patch_type: "conan" "0.17.23": - patch_file: "patches/0.17.23-fix-cast-error.patch" patch_description: "fix const cast error" diff --git a/aws-crt-cpp/all/conanfile.py b/aws-crt-cpp/all/conanfile.py index 244f07b..459770a 100644 --- a/aws-crt-cpp/all/conanfile.py +++ b/aws-crt-cpp/all/conanfile.py @@ -1,16 +1,12 @@ from conan import ConanFile -from conan.tools.files import ( - apply_conandata_patches, - export_conandata_patches, - get, - copy, - rmdir, -) +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, save from conan.tools.build import check_min_cppstd +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os +import textwrap required_conan_version = ">=1.53.0" @@ -18,7 +14,7 @@ class AwsCrtCpp(ConanFile): name = "aws-crt-cpp" description = "C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++." - license = ("Apache-2.0",) + license = "Apache-2.0", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-crt-cpp" topics = ("aws", "amazon", "cloud", "wrapper") @@ -52,22 +48,29 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2@milvus/dev") - self.requires("aws-checksums/0.1.13@milvus/dev") + if Version(self.version) < "0.24.1": + self.requires("aws-c-cal/0.5.13", transitive_headers=True) + self.requires("aws-c-common/0.8.2", transitive_headers=True) + self.requires("aws-checksums/0.1.13") + else: + self.requires("aws-c-cal/0.6.9", transitive_headers=True) + self.requires("aws-c-common/0.9.6", transitive_headers=True) + self.requires("aws-checksums/0.1.17") if Version(self.version) < "0.17.29": - self.requires("aws-c-io/0.10.20@milvus/dev") - self.requires("aws-c-http/0.6.13@milvus/dev") - self.requires("aws-c-auth/0.6.11@milvus/dev") - self.requires("aws-c-s3/0.1.37@milvus/dev") - self.requires("aws-c-mqtt/0.7.10@milvus/dev") - self.requires("aws-c-event-stream/0.2.7@milvus/dev") + self.requires("aws-c-auth/0.6.11", transitive_headers=True) + self.requires("aws-c-event-stream/0.2.7") + self.requires("aws-c-http/0.6.13", transitive_headers=True) + self.requires("aws-c-io/0.10.20", transitive_headers=True) + self.requires("aws-c-mqtt/0.7.10", transitive_headers=True) + self.requires("aws-c-s3/0.1.37") else: - self.requires("aws-c-io/0.13.4@milvus/dev") - self.requires("aws-c-http/0.6.22@milvus/dev") - self.requires("aws-c-auth/0.6.17@milvus/dev") - self.requires("aws-c-s3/0.1.49@milvus/dev") - self.requires("aws-c-mqtt/0.7.12@milvus/dev") - self.requires("aws-c-event-stream/0.2.15@milvus/dev") + self.requires("aws-c-auth/0.7.8", transitive_headers=True) + self.requires("aws-c-event-stream/0.3.1") + self.requires("aws-c-http/0.7.14", transitive_headers=True) + self.requires("aws-c-io/0.13.35", transitive_headers=True) + self.requires("aws-c-mqtt/0.9.10", transitive_headers=True) + self.requires("aws-c-s3/0.3.24") + self.requires("aws-c-sdkutils/0.1.12") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -78,8 +81,10 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + if is_msvc(self): + tc.variables["AWS_STATIC_MSVC_RUNTIME_LIBRARY"] = is_msvc_static_runtime(self) tc.variables["BUILD_TESTING"] = False - tc.variables["BUILD_DEPS"] = False + tc.cache_variables["BUILD_DEPS"] = False tc.generate() deps = CMakeDeps(self) @@ -92,40 +97,39 @@ def build(self): cmake.build() def package(self): - copy( - self, - pattern="LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-crt-cpp")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-crt-cpp": "aws-crt-cpp::aws-crt-cpp"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-crt-cpp") self.cpp_info.set_property("cmake_target_name", "AWS::aws-crt-cpp") - - self.cpp_info.components["aws-crt-cpp-lib"].names[ - "cmake_find_package" - ] = "aws-crt-cpp" - self.cpp_info.components["aws-crt-cpp-lib"].names[ - "cmake_find_package_multi" - ] = "aws-crt-cpp" - self.cpp_info.components["aws-crt-cpp-lib"].libs = ["aws-crt-cpp"] - self.cpp_info.components["aws-crt-cpp-lib"].requires = [ - "aws-c-event-stream::aws-c-event-stream-lib", - "aws-c-common::aws-c-common-lib", - "aws-c-io::aws-c-io-lib", - "aws-c-http::aws-c-http-lib", - "aws-c-auth::aws-c-auth-lib", - "aws-c-mqtt::aws-c-mqtt-lib", - "aws-c-s3::aws-c-s3-lib", - "aws-checksums::aws-checksums-lib", - ] + self.cpp_info.libs = ["aws-crt-cpp"] + if self.options.shared: + self.cpp_info.defines.append("AWS_CRT_CPP_USE_IMPORT_EXPORT") # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "aws-crt-cpp" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-crt-cpp" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/aws-crt-cpp/all/patches/0.24.1-disable-sanitizers.patch b/aws-crt-cpp/all/patches/0.24.1-disable-sanitizers.patch new file mode 100644 index 0000000..bb37fbe --- /dev/null +++ b/aws-crt-cpp/all/patches/0.24.1-disable-sanitizers.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt.orig 2024-02-23 17:49:55 ++++ CMakeLists.txt 2024-02-23 17:50:20 +@@ -314,7 +314,7 @@ + aws_use_package(aws-c-event-stream) + aws_use_package(aws-c-s3) + +-aws_add_sanitizers(${PROJECT_NAME}) ++#aws_add_sanitizers(${PROJECT_NAME}) + + target_link_libraries(${PROJECT_NAME} PUBLIC ${DEP_AWS_LIBS}) + diff --git a/aws-crt-cpp/all/patches/0.24.1-fix-cast-error.patch b/aws-crt-cpp/all/patches/0.24.1-fix-cast-error.patch new file mode 100644 index 0000000..78b3163 --- /dev/null +++ b/aws-crt-cpp/all/patches/0.24.1-fix-cast-error.patch @@ -0,0 +1,13 @@ +diff --git a/source/io/TlsOptions.cpp b/source/io/TlsOptions.cpp +index 6077912..74a55c9 100644 +--- a/source/io/TlsOptions.cpp ++++ b/source/io/TlsOptions.cpp +@@ -219,7 +219,7 @@ namespace Aws + + if (m_slotId) + { +- options.slot_id = &(*m_slotId); ++ options.slot_id = const_cast(&(*m_slotId)); + } + + if (m_userPin) diff --git a/aws-crt-cpp/config.yml b/aws-crt-cpp/config.yml index a2a8f69..20f59bc 100644 --- a/aws-crt-cpp/config.yml +++ b/aws-crt-cpp/config.yml @@ -1,5 +1,5 @@ versions: - "0.18.8": + "0.24.1": folder: all "0.17.23": folder: all diff --git a/aws-sdk-cpp/all/CMakeLists.txt b/aws-sdk-cpp/all/CMakeLists.txt deleted file mode 100644 index d19ff91..0000000 --- a/aws-sdk-cpp/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -if(MSVC) - add_definitions(-D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING) -endif() - -add_subdirectory(source_subfolder) diff --git a/aws-sdk-cpp/all/conandata.yml b/aws-sdk-cpp/all/conandata.yml index 8abd96a..5818aef 100644 --- a/aws-sdk-cpp/all/conandata.yml +++ b/aws-sdk-cpp/all/conandata.yml @@ -10,29 +10,19 @@ sources: sha256: "5dd09baa28d3f6f4fb03fbba1a4269724d79bcca3d47752cd3e15caf97276bda" patches: "1.9.234": - - base_path: source_subfolder - patch_file: patches/1.9.234-0001-issue-1816.patch - - base_path: source_subfolder - patch_file: patches/1.9.234-0002-disable-sort-links.patch - - base_path: source_subfolder - patch_file: patches/1.9.100-0002-aws-plugin-conf.patch + - patch_file: patches/1.9.234-0001-issue-1816.patch + - patch_file: patches/1.9.234-0002-disable-sort-links.patch + - patch_file: patches/1.9.100-0002-aws-plugin-conf.patch + - patch_file: patches/1.8.130-0004-improve-pulseaudio-detection.patch "1.9.100": - - base_path: source_subfolder - patch_file: patches/1.9.100-0001-disable-sort-links.patch - - base_path: source_subfolder - patch_file: patches/1.9.100-0002-aws-plugin-conf.patch - - base_path: source_subfolder - patch_file: patches/1.9.100-0003-issue-1816.patch + - patch_file: patches/1.9.100-0001-disable-sort-links.patch + - patch_file: patches/1.9.100-0002-aws-plugin-conf.patch + - patch_file: patches/1.9.100-0003-issue-1816.patch + - patch_file: patches/1.8.130-0004-improve-pulseaudio-detection.patch "1.8.130": - - base_path: source_subfolder - patch_file: patches/1.8.130-0001-disable-sort-links.patch - - base_path: source_subfolder - patch_file: patches/1.8.130-0002-force-archive-directory-to-library-directory.patch - - base_path: source_subfolder - patch_file: patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch - - base_path: source_subfolder - patch_file: patches/1.8.130-0004-improve-pulseaudio-detection.patch - - base_path: source_subfolder - patch_file: patches/1.8.130-0005-aws-plugin-conf.patch - - base_path: source_subfolder - patch_file: patches/1.8.130-0006-issue-1816.patch + - patch_file: patches/1.8.130-0001-disable-sort-links.patch + - patch_file: patches/1.8.130-0002-force-archive-directory-to-library-directory.patch + - patch_file: patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch + - patch_file: patches/1.8.130-0004-improve-pulseaudio-detection.patch + - patch_file: patches/1.8.130-0005-aws-plugin-conf.patch + - patch_file: patches/1.8.130-0006-issue-1816.patch diff --git a/aws-sdk-cpp/all/conanfile.py b/aws-sdk-cpp/all/conanfile.py index 91c2066..678d3e3 100644 --- a/aws-sdk-cpp/all/conanfile.py +++ b/aws-sdk-cpp/all/conanfile.py @@ -1,11 +1,14 @@ import os -from conan.tools.files import rename -from conan.tools.microsoft import msvc_runtime_flag -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building, stdcpp_library +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.54.0" class AwsSdkCppConan(ConanFile): @@ -15,7 +18,7 @@ class AwsSdkCppConan(ConanFile): homepage = "https://github.com/aws/aws-sdk-cpp" description = "AWS SDK for C++" topics = ("aws", "cpp", "cross-platform", "amazon", "cloud") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" _sdks = ( "access-management", @@ -304,17 +307,7 @@ class AwsSdkCppConan(ConanFile): default_options["transfer"] = True default_options["text-to-speech"] = True - generators = "cmake", "cmake_find_package" short_paths = True - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] @property def _internal_requirements(self): @@ -329,35 +322,36 @@ def _internal_requirements(self): @property def _use_aws_crt_cpp(self): - return tools.Version(self.version) >= "1.9" + return Version(self.version) >= "1.9" def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if tools.Version(self.version) < "1.9": - delattr(self.options, "s3-crt") + if Version(self.version) < "1.9": + self.options.rm_safe("s3-crt") def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.6.19") + self.requires("aws-c-common/0.8.2") + self.requires("aws-c-event-stream/0.2.7") + self.requires("aws-checksums/0.1.13") if self._use_aws_crt_cpp: self.requires("aws-c-cal/0.5.13") self.requires("aws-c-http/0.6.13") self.requires("aws-c-io/0.10.20") - self.requires("aws-crt-cpp/0.17.23") - else: - self.requires("aws-c-event-stream/0.2.7") + self.requires("aws-crt-cpp/0.17.23", transitive_headers=True) if self.settings.os != "Windows": - self.requires("openssl/1.1.1n") - self.requires("libcurl/7.80.0") + self.requires("openssl/[>=1.1 <4]") + self.requires("libcurl/[>=7.78.0 <9]") if self.settings.os in ["Linux", "FreeBSD"]: if self.options.get_safe("text-to-speech"): self.requires("pulseaudio/14.2") @@ -365,21 +359,21 @@ def requirements(self): def validate(self): if (self.options.shared and self.settings.compiler == "gcc" - and tools.Version(self.settings.compiler.version) < "6.0"): + and Version(self.settings.compiler.version) < "6.0"): raise ConanInvalidConfiguration( "Doesn't support gcc5 / shared. " "See https://github.com/conan-io/conan-center-index/pull/4401#issuecomment-802631744" ) - if (tools.Version(self.version) < "1.9.234" + if (Version(self.version) < "1.9.234" and self.settings.compiler == "gcc" - and tools.Version(self.settings.compiler.version) >= "11.0" + and Version(self.settings.compiler.version) >= "11.0" and self.settings.build_type == "Release"): raise ConanInvalidConfiguration( "Versions prior to 1.9.234 don't support release builds on >= gcc 11 " "See https://github.com/aws/aws-sdk-cpp/issues/1505" ) if self._use_aws_crt_cpp: - if self._is_msvc and "MT" in msvc_runtime_flag(self): + if is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Static runtime is not working for more recent releases") else: if self.settings.os == "Macos" and self.settings.arch == "armv8": @@ -390,48 +384,60 @@ def validate(self): def package_id(self): for hl_comp in self._internal_requirements.keys(): - if getattr(self.options, hl_comp): + if getattr(self.info.options, hl_comp): for internal_requirement in self._internal_requirements[hl_comp]: setattr(self.info.options, internal_requirement, True) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) + def generate(self): + tc = CMakeToolchain(self) + # All option() are defined before project() in upstream CMakeLists, + # therefore we must use cache_variables build_only = ["core"] for sdk in self._sdks: if self.options.get_safe(sdk): build_only.append(sdk) - self._cmake.definitions["BUILD_ONLY"] = ";".join(build_only) + tc.cache_variables["BUILD_ONLY"] = ";".join(build_only) - self._cmake.definitions["ENABLE_UNITY_BUILD"] = True - self._cmake.definitions["ENABLE_TESTING"] = False - self._cmake.definitions["AUTORUN_UNIT_TESTS"] = False - self._cmake.definitions["BUILD_DEPS"] = False + tc.cache_variables["ENABLE_UNITY_BUILD"] = True + tc.cache_variables["ENABLE_TESTING"] = False + tc.cache_variables["AUTORUN_UNIT_TESTS"] = False + tc.cache_variables["BUILD_DEPS"] = False if self.settings.os != "Windows": - self._cmake.definitions["ENABLE_OPENSSL_ENCRYPTION"] = True - - self._cmake.definitions["MINIMIZE_SIZE"] = self.options.min_size - if self._is_msvc and not self._use_aws_crt_cpp: - self._cmake.definitions["FORCE_SHARED_CRT"] = "MD" in msvc_runtime_flag(self) - - if tools.cross_building(self): - self._cmake.definitions["CURL_HAS_H2_EXITCODE"] = "0" - self._cmake.definitions["CURL_HAS_H2_EXITCODE__TRYRUN_OUTPUT"] = "" - self._cmake.definitions["CURL_HAS_TLS_PROXY_EXITCODE"] = "0" - self._cmake.definitions["CURL_HAS_TLS_PROXY_EXITCODE__TRYRUN_OUTPUT"] = "" - self._cmake.configure() - return self._cmake + tc.cache_variables["ENABLE_OPENSSL_ENCRYPTION"] = True + + tc.cache_variables["MINIMIZE_SIZE"] = self.options.min_size + if is_msvc(self) and not self._use_aws_crt_cpp: + tc.cache_variables["FORCE_SHARED_CRT"] = not is_msvc_static_runtime(self) + + if cross_building(self): + tc.cache_variables["CURL_HAS_H2_EXITCODE"] = "0" + tc.cache_variables["CURL_HAS_H2_EXITCODE__TRYRUN_OUTPUT"] = "" + tc.cache_variables["CURL_HAS_TLS_PROXY_EXITCODE"] = "0" + tc.cache_variables["CURL_HAS_TLS_PROXY_EXITCODE__TRYRUN_OUTPUT"] = "" + if is_msvc(self): + tc.preprocessor_definitions["_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING"] = "1" + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Disable warnings as errors + replace_in_file( + self, os.path.join(self.source_folder, "cmake", "compiler_settings.cmake"), + 'list(APPEND AWS_COMPILER_WARNINGS "-Wall" "-Werror" "-pedantic" "-Wextra")', "", + ) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() @property @@ -449,44 +455,56 @@ def _create_project_cmake_module(self): "toolchains/pkg-config.pc.in", "aws-cpp-sdk-core/include/aws/core/VersionConfig.h" ]: - self.copy(file, src=self._source_subfolder, dst=self._res_folder) - tools.replace_in_file(os.path.join(self.package_folder, self._res_folder, file), "CMAKE_CURRENT_SOURCE_DIR", "AWS_NATIVE_SDK_ROOT", strict=False) + copy(self, file, src=self.source_folder, dst=os.path.join(self.package_folder, self._res_folder)) + replace_in_file( + self, os.path.join(self.package_folder, self._res_folder, file), + "CMAKE_CURRENT_SOURCE_DIR", "AWS_NATIVE_SDK_ROOT", + strict=False, + ) # avoid getting error from hook - with tools.chdir(os.path.join(self.package_folder, self._res_folder)): - rename(self, os.path.join("toolchains", "cmakeProjectConfig.cmake"), os.path.join("toolchains", "cmakeProjectConf.cmake")) - tools.replace_in_file(os.path.join("cmake", "utilities.cmake"), "cmakeProjectConfig.cmake", "cmakeProjectConf.cmake") + rename(self, os.path.join(self.package_folder, self._res_folder, "toolchains", "cmakeProjectConfig.cmake"), + os.path.join(self.package_folder, self._res_folder, "toolchains", "cmakeProjectConf.cmake")) + replace_in_file( + self, os.path.join(self.package_folder, self._res_folder, "cmake", "utilities.cmake"), + "cmakeProjectConfig.cmake", "cmakeProjectConf.cmake", + ) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - if self._is_msvc: - self.copy(pattern="*.lib", dst="lib", keep_path=False) - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.lib") + if is_msvc(self): + copy(self, "*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + rm(self, "*.lib", os.path.join(self.package_folder, "bin")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) self._create_project_cmake_module() def package_info(self): self.cpp_info.set_property("cmake_file_name", "AWSSDK") + sdk_plugin_conf = os.path.join(self._res_folder, "cmake", "sdk_plugin_conf.cmake") + self.cpp_info.set_property("cmake_build_modules", [sdk_plugin_conf]) + # core component self.cpp_info.components["core"].set_property("cmake_target_name", "AWS::aws-sdk-cpp-core") self.cpp_info.components["core"].set_property("pkg_config_name", "aws-sdk-cpp-core") self.cpp_info.components["core"].libs = ["aws-cpp-sdk-core"] - self.cpp_info.components["core"].requires = ["aws-c-common::aws-c-common-lib"] + self.cpp_info.components["core"].requires = [ + "aws-c-common::aws-c-common", + "aws-c-event-stream::aws-c-event-stream", + "aws-checksums::aws-checksums", + ] if self._use_aws_crt_cpp: self.cpp_info.components["core"].requires.extend([ - "aws-c-cal::aws-c-cal-lib", - "aws-c-http::aws-c-http-lib", - "aws-c-io::aws-c-io-lib", - "aws-crt-cpp::aws-crt-cpp-lib", + "aws-c-cal::aws-c-cal", + "aws-c-http::aws-c-http", + "aws-c-io::aws-c-io", + "aws-crt-cpp::aws-crt-cpp", ]) - else: - self.cpp_info.components["core"].requires.append("aws-c-event-stream::aws-c-event-stream-lib") # other components enabled_sdks = [sdk for sdk in self._sdks if self.options.get_safe(sdk)] @@ -500,8 +518,8 @@ def package_info(self): # TODO: there is no way to properly emulate COMPONENTS names for # find_package(AWSSDK COMPONENTS ) in set_property() # right now: see https://github.com/conan-io/conan/issues/10258 - self.cpp_info.components[sdk].set_property("cmake_target_name", "AWS::aws-sdk-cpp-{}".format(sdk)) - self.cpp_info.components[sdk].set_property("pkg_config_name", "aws-sdk-cpp-{}".format(sdk)) + self.cpp_info.components[sdk].set_property("cmake_target_name", f"AWS::aws-sdk-cpp-{sdk}") + self.cpp_info.components[sdk].set_property("pkg_config_name", f"aws-sdk-cpp-{sdk}") self.cpp_info.components[sdk].requires = ["core"] if sdk in self._internal_requirements: self.cpp_info.components[sdk].requires.extend(self._internal_requirements[sdk]) @@ -510,7 +528,7 @@ def package_info(self): # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.components[sdk].names["cmake_find_package"] = "aws-sdk-cpp-" + sdk self.cpp_info.components[sdk].names["cmake_find_package_multi"] = "aws-sdk-cpp-" + sdk - component_alias = "aws-sdk-cpp-{}_alias".format(sdk) # to emulate COMPONENTS names for find_package() + component_alias = f"aws-sdk-cpp-{sdk}_alias" # to emulate COMPONENTS names for find_package() self.cpp_info.components[component_alias].names["cmake_find_package"] = sdk self.cpp_info.components[component_alias].names["cmake_find_package_multi"] = sdk self.cpp_info.components[component_alias].requires = [sdk] @@ -534,9 +552,14 @@ def package_info(self): if self.options.get_safe("text-to-speech"): self.cpp_info.components["text-to-speech"].frameworks.append("CoreAudio") - lib_stdcpp = tools.stdcpp_library(self) - if lib_stdcpp: - self.cpp_info.components["core"].system_libs.append(lib_stdcpp) + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["core"].system_libs.append(libcxx) + + self.cpp_info.components["plugin_scripts"].requires = ["core"] + self.cpp_info.components["plugin_scripts"].builddirs.extend([ + os.path.join(self._res_folder, "cmake"), + os.path.join(self._res_folder, "toolchains")]) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "AWSSDK" @@ -545,9 +568,5 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "AWS" self.cpp_info.components["core"].names["cmake_find_package"] = "aws-sdk-cpp-core" self.cpp_info.components["core"].names["cmake_find_package_multi"] = "aws-sdk-cpp-core" - - self.cpp_info.components["plugin_scripts"].requires = ["core"] - self.cpp_info.components["plugin_scripts"].builddirs.extend([ - os.path.join(self._res_folder, "cmake"), - os.path.join(self._res_folder, "toolchains")]) - self.cpp_info.components["plugin_scripts"].build_modules.append(os.path.join(self._res_folder, "cmake", "sdk_plugin_conf.cmake")) + self.cpp_info.components["plugin_scripts"].build_modules["cmake_find_package"] = [sdk_plugin_conf] + self.cpp_info.components["plugin_scripts"].build_modules["cmake_find_package_multi"] = [sdk_plugin_conf] diff --git a/aws-sdk-cpp/all/patches/1.8.130-0004-improve-pulseaudio-detection.patch b/aws-sdk-cpp/all/patches/1.8.130-0004-improve-pulseaudio-detection.patch index 5a47717..9930b98 100644 --- a/aws-sdk-cpp/all/patches/1.8.130-0004-improve-pulseaudio-detection.patch +++ b/aws-sdk-cpp/all/patches/1.8.130-0004-improve-pulseaudio-detection.patch @@ -24,7 +24,7 @@ index b1054515d5..d1a34ddfc5 100644 message(STATUS "Pulse audio header files have been detected, included pulse audio as a possible sound driver implementation.") add_definitions("-DPULSE") - set(PLATFORM_LIBS ${PLATFORM_LIBS} pulse pulse-simple) -+ set(PLATFORM_LIBS ${PLATFORM_LIBS} "CONAN_PKG::pulseaudio") ++ set(PLATFORM_LIBS ${PLATFORM_LIBS} "pulseaudio::pulseaudio") else() message(WARNING "We've detected that you are building on linux, but the header files for pulseaudio are not available.\ If you are providing your own audio implementation or you will not be using the text-to-speech library, this is fine.\ diff --git a/aws-sdk-cpp/all/test_package/CMakeLists.txt b/aws-sdk-cpp/all/test_package/CMakeLists.txt index efb9a3d..dda85fd 100644 --- a/aws-sdk-cpp/all/test_package/CMakeLists.txt +++ b/aws-sdk-cpp/all/test_package/CMakeLists.txt @@ -1,13 +1,10 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(AWSSDK REQUIRED CONFIG) add_subdirectory(aws-sdk-cpp-plugin) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} aws-sdk-cpp-plugin) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE aws-sdk-cpp-plugin) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt b/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt index dddf745..37d0edc 100644 --- a/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt +++ b/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) add_project(aws-sdk-cpp-plugin "C++ AWS SDK plugin" AWS::aws-sdk-cpp-s3) @@ -8,7 +8,7 @@ include(GenerateExportHeader) generate_export_header(${PROJECT_NAME} BASE_NAME aws_sdk_cpp_plugin) target_include_directories(${PROJECT_NAME} PUBLIC $ $) target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_LIBS}) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) setup_install() diff --git a/aws-sdk-cpp/all/test_package/conanfile.py b/aws-sdk-cpp/all/test_package/conanfile.py index 38f4483..e845ae7 100644 --- a/aws-sdk-cpp/all/test_package/conanfile.py +++ b/aws-sdk-cpp/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/aws-sdk-cpp/all/test_v1_package/CMakeLists.txt b/aws-sdk-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/aws-sdk-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/aws-c-common/all/test_v1_package/conanfile.py b/aws-sdk-cpp/all/test_v1_package/conanfile.py similarity index 100% rename from aws-c-common/all/test_v1_package/conanfile.py rename to aws-sdk-cpp/all/test_v1_package/conanfile.py diff --git a/aws-sdk-cpp/config.yml b/aws-sdk-cpp/config.yml index cf3b080..3af5713 100644 --- a/aws-sdk-cpp/config.yml +++ b/aws-sdk-cpp/config.yml @@ -1,9 +1,7 @@ versions: - '1.9.234': - folder: 'all' - '1.9.100': - folder: 'all' - '1.8.186': - folder: 'all' - '1.8.130': - folder: 'all' + "1.9.234": + folder: "all" + "1.9.100": + folder: "all" + "1.8.130": + folder: "all" diff --git a/b2/config.yml b/b2/config.yml new file mode 100644 index 0000000..0e3bbe2 --- /dev/null +++ b/b2/config.yml @@ -0,0 +1,17 @@ +versions: + "4.8.2": + folder: portable + "4.9.6": + folder: portable + "4.10.0": + folder: portable + "4.10.1": + folder: portable + "5.0.0": + folder: portable + "5.1.0": + folder: portable + "5.2.0": + folder: portable + "5.2.1": + folder: portable diff --git a/b2/portable/conandata.yml b/b2/portable/conandata.yml new file mode 100644 index 0000000..18e6c7a --- /dev/null +++ b/b2/portable/conandata.yml @@ -0,0 +1,25 @@ +sources: + "4.8.2": + url: "https://github.com/bfgroup/b2/archive/4.8.2.tar.gz" + sha256: "220edfbd5022394c5dc264dfdd8bf6d3ec53b784db87461026bb23ea9d9ec4bd" + "4.9.6": + url: "https://github.com/bfgroup/b2/releases/download/4.9.6/b2-4.9.6.tar.bz2" + sha256: "10c1344c751fcf5a1f9ec6f52c02626cfbf78a4806f7817949b115e107bbbc5f" + "4.10.0": + url: "https://github.com/bfgroup/b2/releases/download/4.10.0/b2-4.10.0.tar.bz2" + sha256: "aee0185473141d4acb56e39c78758b1016e66393ea5ca86ef29403bd9258f2e2" + "4.10.1": + url: "https://github.com/bfgroup/b2/releases/download/4.10.1/b2-4.10.1.tar.bz2" + sha256: "d0818276955c3351eac26e4aa1e61046cfded88773232d76f2833c93bb917633" + "5.0.0": + url: "https://github.com/bfgroup/b2/releases/download/5.0.0/b2-5.0.0.tar.bz2" + sha256: "1ef867f7d374345a948baca025ed277dadda05a68439aa383a06aceb9911f7d3" + "5.1.0": + url: "https://github.com/bfgroup/b2/releases/download/5.1.0/b2-5.1.0.tar.bz2" + sha256: "8429a2e7c9c4484f6a4bd7fb18743f0ea1dba41eb024479a9b23381bcb813623" + "5.2.0": + url: "https://github.com/bfgroup/b2/releases/download/5.2.0/b2-5.2.0.tar.bz2" + sha256: "c27adfb4e667d748bb7d3e18657938fa8bcf185b74a29bf091113299f532ed6d" + "5.2.1": + url: "https://github.com/bfgroup/b2/releases/download/5.2.1/b2-5.2.1.tar.bz2" + sha256: "6428edec31731aa479b4e7d8f83898831a0919352ec7d7f9874145abe165a578" diff --git a/b2/portable/conanfile.py b/b2/portable/conanfile.py new file mode 100644 index 0000000..68803d2 --- /dev/null +++ b/b2/portable/conanfile.py @@ -0,0 +1,208 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import chdir, copy, get +from conan.tools.layout import basic_layout + +from contextlib import contextmanager +import os +from io import StringIO + +required_conan_version = ">=1.47.0" + + +class B2Conan(ConanFile): + name = "b2" + homepage = "https://www.bfgroup.xyz/b2/" + description = "B2 makes it easy to build C++ projects, everywhere." + topics = ("installer", "builder", "build", "build-system") + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch" + package_type = "application" + + ''' + * use_cxx_env: False, True + + Indicates if the build will use the CXX and + CXXFLAGS environment variables. The common use is to add additional flags + for building on specific platforms or for additional optimization options. + + * toolset: 'auto', 'cxx', 'cross-cxx', + 'acc', 'borland', 'clang', 'como', 'gcc-nocygwin', 'gcc', + 'intel-darwin', 'intel-linux', 'intel-win32', 'kcc', 'kylix', + 'mingw', 'mipspro', 'pathscale', 'pgi', 'qcc', 'sun', 'sunpro', + 'tru64cxx', 'vacpp', 'vc12', 'vc14', 'vc141', 'vc142', 'vc143' + + Specifies the toolset to use for building. The default of 'auto' detects + a usable compiler for building and should be preferred. The 'cxx' toolset + uses the 'CXX' and 'CXXFLAGS' solely for building. Using the 'cxx' + toolset will also turn on the 'use_cxx_env' option. And the 'cross-cxx' + toolset uses the 'BUILD_CXX' and 'BUILD_CXXFLAGS' vars. This frees the + 'CXX' and 'CXXFLAGS' variables for use in subprocesses. + ''' + options = { + 'use_cxx_env': [False, True], + 'toolset': [ + 'auto', 'cxx', 'cross-cxx', + 'acc', 'borland', 'clang', 'como', 'gcc-nocygwin', 'gcc', + 'intel-darwin', 'intel-linux', 'intel-win32', 'kcc', 'kylix', + 'mingw', 'mipspro', 'pathscale', 'pgi', 'qcc', 'sun', 'sunpro', + 'tru64cxx', 'vacpp', 'vc12', 'vc14', 'vc141', 'vc142', 'vc143', + ] + } + default_options = { + 'use_cxx_env': False, + 'toolset': 'auto' + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.options.use_cxx_env + del self.info.options.toolset + + if self._is_macos_intel_or_arm(self.info.settings): + self.info.settings.arch = "x86_64,armv8" + + def validate_build(self): + if hasattr(self, "settings_build") and cross_building(self) and not self._is_macos_intel_or_arm(self.settings): + raise ConanInvalidConfiguration(f"{self.ref} recipe doesn't support cross-build yet") + + def validate(self): + if (self.options.toolset == 'cxx' or self.options.toolset == 'cross-cxx') and not self.options.use_cxx_env: + raise ConanInvalidConfiguration( + "Option toolset 'cxx' and 'cross-cxx' requires 'use_cxx_env=True'") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _b2_dir(self): + return self.source_folder + + @property + def _b2_engine_dir(self): + return os.path.join(self._b2_dir, "src", "engine") + + @property + def _b2_output_dir(self): + return os.path.join(self.build_folder, "output") + + @property + def _pkg_bin_dir(self): + return os.path.join(self.package_folder, "bin") + + def _is_macos_intel_or_arm(self, settings): + return settings.os == "Macos" and settings.arch in ["x86_64", "armv8"] + + @contextmanager + def _bootstrap_env(self): + saved_env = dict(os.environ) + # Vcvars will change the directory after it runs in the situation when + # the user has previously run the VS command console inits. In that + # context it remembers the dir and resets it at each vcvars invocation. + os.environ.update({"VSCMD_START_DIR": os.getcwd()}) + if not self.options.use_cxx_env: + # To avoid using the CXX env vars we clear them out for the build. + os.environ.update({ + "CXX": "", + "CXXFLAGS": ""}) + try: + yield + finally: + os.environ.clear() + os.environ.update(saved_env) + + def _write_project_config(self, cxx): + with open(os.path.join(self.source_folder, "project-config.jam"), "w") as f: + f.write( + f"using {self.options.toolset} : : {cxx} ;\n" + ) + + def build(self): + # The order of the with:with: below is important. The first one changes + # the current dir. While the second does env changes that guarantees + # that dir doesn't change if/when vsvars runs to set the msvc compile + # env. + self.output.info("Build engine..") + command = "" + b2_toolset = self.options.toolset + use_windows_commands = os.name == 'nt' + if b2_toolset == 'auto': + if use_windows_commands: + # For windows auto detection it can evaluate to a msvc version + # that it's not aware of. Most likely because it's a future one + # that didn't exist when the build was written. This turns that + # into a generic msvc toolset build assuming it could work, + # since it's a better version. + with chdir(self, self._b2_engine_dir): + with self._bootstrap_env(): + buf = StringIO() + self.run('guess_toolset && set', buf) + guess_vars = map( + lambda x: x.strip(), buf.getvalue().split("\n")) + if "B2_TOOLSET=vcunk" in guess_vars: + b2_toolset = 'msvc' + for kv in guess_vars: + if kv.startswith("B2_TOOLSET_ROOT="): + b2_vcvars = os.path.join( + kv.split('=')[1].strip(), 'Auxiliary', 'Build', 'vcvars32.bat') + command += '"'+b2_vcvars+'" && ' + command += "build" if use_windows_commands else "./build.sh" + + cxxflags = "" + if self._is_macos_intel_or_arm(self.settings): + cxxflags += " -arch arm64 -arch x86_64" + + if self.options.use_cxx_env: + envvars = VirtualBuildEnv(self).vars() + + cxx_env = envvars.get("CXX") + if cxx_env: + command += f" --cxx={cxx_env}" + self._write_project_config(cxx_env) + + cxxflags_env = envvars.get("CXXFLAGS") + if cxxflags_env: + cxxflags = f"{cxxflags} {cxxflags_env}" + + if cxxflags: + command += f' --cxxflags="{cxxflags}"' + + if b2_toolset != 'auto': + command += " "+str(b2_toolset) + with chdir(self, self._b2_engine_dir): + with self._bootstrap_env(): + self.run(command) + + self.output.info("Install..") + command = os.path.join( + self._b2_engine_dir, "b2.exe" if use_windows_commands else "b2") + if b2_toolset not in ["auto", "cxx", "cross-cxx"]: + command += " toolset=" + str(b2_toolset) + full_command = \ + (f"{command} --ignore-site-config " + + f"--prefix={self._b2_output_dir} " + + "--abbreviate-paths " + + "install " + + "b2-install-layout=portable") + with chdir(self, self._b2_dir): + self.run(full_command) + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.LICENSE", src=self._b2_engine_dir, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*b2", dst=self._pkg_bin_dir, src=self._b2_output_dir) + copy(self, "*b2.exe", dst=self._pkg_bin_dir, src=self._b2_output_dir) + copy(self, "*.jam", dst=self._pkg_bin_dir, src=self._b2_output_dir) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(self._pkg_bin_dir) diff --git a/b2/portable/test_package/.gitignore b/b2/portable/test_package/.gitignore new file mode 100644 index 0000000..c97f963 --- /dev/null +++ b/b2/portable/test_package/.gitignore @@ -0,0 +1 @@ +*.sh diff --git a/b2/portable/test_package/conanfile.py b/b2/portable/test_package/conanfile.py new file mode 100644 index 0000000..270c3be --- /dev/null +++ b/b2/portable/test_package/conanfile.py @@ -0,0 +1,13 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + self.run("b2 -v") diff --git a/b2/portable/test_v1_package/conanfile.py b/b2/portable/test_v1_package/conanfile.py new file mode 100644 index 0000000..53ed1a9 --- /dev/null +++ b/b2/portable/test_v1_package/conanfile.py @@ -0,0 +1,8 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + self.run("b2 -v", run_environment=True) diff --git a/b2/standard/conandata.yml b/b2/standard/conandata.yml new file mode 100644 index 0000000..574deca --- /dev/null +++ b/b2/standard/conandata.yml @@ -0,0 +1,13 @@ +sources: + "4.0.0": + sha256: f59bd90bd4d68b44005a83a60d3d933d3768fc5a5b51e45a0462e6f4b81caa8a + url: https://github.com/bfgroup/b2/archive/4.0.0.tar.gz + "4.0.1": + sha256: ebdfb38b3938dba4c2548b2b7f4ca48e209beef9a376a78742bcd75769a9d68f + url: https://github.com/bfgroup/b2/archive/4.0.1.tar.gz + "4.1.0": + sha256: eb562b14677e3ad3619bb67e6be6ea97d5dbe34780bbc47bed4cdda3177835c8 + url: https://github.com/bfgroup/b2/archive/4.1.0.tar.gz + "4.2.0": + sha256: 00e3425e0419688ea61ecbbcd106ce168e334f0acdcc2f4a4ead084f03cd4b60 + url: https://github.com/bfgroup/b2/archive/4.2.0.tar.gz diff --git a/b2/standard/conanfile.py b/b2/standard/conanfile.py new file mode 100644 index 0000000..6eac8be --- /dev/null +++ b/b2/standard/conanfile.py @@ -0,0 +1,101 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class B2Conan(ConanFile): + name = "b2" + homepage = "https://www.bfgroup.xyz/b2/" + description = "B2 makes it easy to build C++ projects, everywhere." + topics = ("conan", "installer", "builder") + license = "BSL-1.0" + settings = "os", "arch" + url = "https://github.com/conan-io/conan-center-index" + + ''' + * use_cxx_env: False, True + + Indicates if the build will use the CXX and + CXXFLAGS environment variables. The common use is to add additional flags + for building on specific platforms or for additional optimization options. + + * toolset: 'auto', 'cxx', 'cross-cxx', + 'acc', 'borland', 'clang', 'como', 'gcc-nocygwin', 'gcc', + 'intel-darwin', 'intel-linux', 'intel-win32', 'kcc', 'kylix', + 'mingw', 'mipspro', 'pathscale', 'pgi', 'qcc', 'sun', 'sunpro', + 'tru64cxx', 'vacpp', 'vc12', 'vc14', 'vc141', 'vc142', 'vc143' + + Specifies the toolset to use for building. The default of 'auto' detects + a usable compiler for building and should be preferred. The 'cxx' toolset + uses the 'CXX' and 'CXXFLAGS' solely for building. Using the 'cxx' + toolset will also turn on the 'use_cxx_env' option. And the 'cross-cxx' + toolset uses the 'BUILD_CXX' and 'BUILD_CXXFLAGS' vars. This frees the + 'CXX' and 'CXXFLAGS' variables for use in subprocesses. + ''' + options = { + 'use_cxx_env': [False, True], + 'toolset': [ + 'auto', 'cxx', 'cross-cxx', + 'acc', 'borland', 'clang', 'como', 'gcc-nocygwin', 'gcc', + 'intel-darwin', 'intel-linux', 'intel-win32', 'kcc', 'kylix', + 'mingw', 'mipspro', 'pathscale', 'pgi', 'qcc', 'sun', 'sunpro', + 'tru64cxx', 'vacpp', 'vc12', 'vc14', 'vc141', 'vc142', 'vc143'] + } + default_options = { + 'use_cxx_env': False, + 'toolset': 'auto' + } + + def configure(self): + if (self.options.toolset == 'cxx' or self.options.toolset == 'cross-cxx') and not self.options.use_cxx_env: + raise ConanInvalidConfiguration( + "Option toolset 'cxx' and 'cross-cxx' requires 'use_cxx_env=True'") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + strip_root=True, destination="source") + + def build(self): + use_windows_commands = os.name == 'nt' + command = "build" if use_windows_commands else "./build.sh" + if self.options.toolset != 'auto': + command += " "+str(self.options.toolset) + build_dir = os.path.join(self.source_folder, "source") + engine_dir = os.path.join(build_dir, "src", "engine") + os.chdir(engine_dir) + with tools.environment_append({"VSCMD_START_DIR": os.curdir}): + if self.options.use_cxx_env: + # Allow use of CXX env vars. + self.run(command) + else: + # To avoid using the CXX env vars we clear them out for the build. + with tools.environment_append({"CXX": "", "CXXFLAGS": ""}): + self.run(command) + os.chdir(build_dir) + command = os.path.join( + engine_dir, "b2.exe" if use_windows_commands else "b2") + if self.options.toolset != 'auto': + full_command = "{0} --ignore-site-config --prefix=../output --abbreviate-paths" \ + " toolset={1} install".format(command, self.options.toolset) + else: + full_command = "{0} --ignore-site-config --prefix=../output --abbreviate-paths" \ + " install".format(command) + self.run(full_command) + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src="source") + self.copy(pattern="*b2", dst="bin", src="output/bin") + self.copy(pattern="*b2.exe", dst="bin", src="output/bin") + self.copy(pattern="*.jam", dst="bin/b2_src", + src="output/share/boost-build") + + def package_info(self): + self.cpp_info.bindirs = ["bin"] + self.env_info.path = [os.path.join( + self.package_folder, "bin")] + self.env_info.BOOST_BUILD_PATH = os.path.join( + self.package_folder, "bin", "b2_src", "src", "kernel") + + def package_id(self): + del self.info.options.use_cxx_env + del self.info.options.toolset diff --git a/b2/standard/test_package/conanfile.py b/b2/standard/test_package/conanfile.py new file mode 100644 index 0000000..24d8a01 --- /dev/null +++ b/b2/standard/test_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools +import os + + +class TestPackgeConan(ConanFile): + settings = "os", "arch" + + def test(self): + self.run("b2 -v", run_environment=True) diff --git a/benchmark/all/conandata.yml b/benchmark/all/conandata.yml new file mode 100644 index 0000000..102609d --- /dev/null +++ b/benchmark/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "1.8.4": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.4.tar.gz" + sha256: "3e7059b6b11fb1bbe28e33e02519398ca94c1818874ebed18e504dc6f709be45" + "1.8.3": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.3.tar.gz" + sha256: "6bc180a57d23d4d9515519f92b0c83d61b05b5bab188961f36ac7b06b0d9e9ce" + "1.8.2": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.2.tar.gz" + sha256: "2aab2980d0376137f969d92848fbb68216abb07633034534fc8c65cc4e7a0e93" + "1.8.1": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.1.tar.gz" + sha256: "e9ff65cecfed4f60c893a1e8a1ba94221fad3b27075f2f80f47eb424b0f8c9bd" + "1.8.0": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.0.tar.gz" + sha256: "ea2e94c24ddf6594d15c711c06ccd4486434d9cf3eca954e2af8a20c88f9f172" + "1.7.1": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.7.1.tar.gz" + sha256: "6430e4092653380d9dc4ccb45a1e2dc9259d581f4866dc0759713126056bc1d7" + "1.7.0": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.7.0.tar.gz" + sha256: "3aff99169fa8bdee356eaa1f691e835a6e57b1efeadb8a0f9f228531158246ac" + "1.6.2": + url: "https://github.com/google/benchmark/archive/v1.6.2.tar.gz" + sha256: "a9f77e6188c1cd4ebedfa7538bf5176d6acc72ead6f456919e5f464ef2f06158" + "1.6.1": + url: "https://github.com/google/benchmark/archive/v1.6.1.tar.gz" + sha256: "6132883bc8c9b0df5375b16ab520fac1a85dc9e4cf5be59480448ece74b278d4" + "1.6.0": + url: "https://github.com/google/benchmark/archive/v1.6.0.tar.gz" + sha256: "1f71c72ce08d2c1310011ea6436b31e39ccab8c2db94186d26657d41747c85d6" + "1.5.6": + url: "https://github.com/google/benchmark/archive/v1.5.6.tar.gz" + sha256: "789f85b4810d13ff803834ea75999e41b326405d83d6a538baf01499eda96102" diff --git a/benchmark/all/conanfile.py b/benchmark/all/conanfile.py new file mode 100644 index 0000000..65bfbc7 --- /dev/null +++ b/benchmark/all/conanfile.py @@ -0,0 +1,122 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class BenchmarkConan(ConanFile): + name = "benchmark" + description = "A microbenchmark support library." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index/" + homepage = "https://github.com/google/benchmark" + topics = ("google", "microbenchmark") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_lto": [True, False], + "enable_exceptions": [True, False], + "enable_libpfm": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_lto": False, + "enable_exceptions": True, + "enable_libpfm": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os != "Linux" or Version(self.version) < "1.5.4": + del self.options.enable_libpfm + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + check_min_vs(self, "190") + if Version(self.version) < "1.7.0" and is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support msvc shared builds") + + def requirements(self): + if self.options.get_safe("enable_libpfm"): + self.requires("libpfm4/4.13.0") + + def build_requirements(self): + if Version(self.version) >= "1.7.1": + self.tool_requires("cmake/[>=3.16.3 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BENCHMARK_ENABLE_TESTING"] = "OFF" + tc.variables["BENCHMARK_ENABLE_GTEST_TESTS"] = "OFF" + tc.variables["BENCHMARK_ENABLE_LTO"] = self.options.enable_lto + tc.variables["BENCHMARK_ENABLE_EXCEPTIONS"] = self.options.enable_exceptions + tc.variables["BENCHMARK_ENABLE_LIBPFM"] = self.options.get_safe("enable_libpfm", False) + if Version(self.version) >= "1.6.1": + tc.variables["BENCHMARK_ENABLE_WERROR"] = False + tc.variables["BENCHMARK_FORCE_WERROR"] = False + if self.settings.os != "Windows": + if cross_building(self): + tc.variables["HAVE_STD_REGEX"] = False + tc.variables["HAVE_POSIX_REGEX"] = False + tc.variables["HAVE_STEADY_CLOCK"] = False + tc.variables["BENCHMARK_USE_LIBCXX"] = self.settings.compiler.get_safe("libcxx") == "libc++" + else: + tc.variables["BENCHMARK_USE_LIBCXX"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "benchmark") + self.cpp_info.set_property("pkg_config_name", "benchmark") + + self.cpp_info.components["_benchmark"].set_property("cmake_target_name", "benchmark::benchmark") + self.cpp_info.components["_benchmark"].libs = ["benchmark"] + if Version(self.version) >= "1.7.0" and not self.options.shared: + self.cpp_info.components["_benchmark"].defines.append("BENCHMARK_STATIC_DEFINE") + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.components["_benchmark"].system_libs.extend(["pthread", "rt", "m"]) + elif self.settings.os == "Windows": + self.cpp_info.components["_benchmark"].system_libs.append("shlwapi") + elif self.settings.os == "SunOS": + self.cpp_info.components["_benchmark"].system_libs.append("kstat") + if self.options.get_safe("enable_libpfm"): + self.cpp_info.components["_benchmark"].requires.append("libpfm4::libpfm4") + + self.cpp_info.components["benchmark_main"].set_property("cmake_target_name", "benchmark::benchmark_main") + self.cpp_info.components["benchmark_main"].libs = ["benchmark_main"] + self.cpp_info.components["benchmark_main"].requires = ["_benchmark"] + + # workaround to have all components in CMakeDeps of downstream recipes + self.cpp_info.set_property("cmake_target_name", "benchmark::benchmark_main") diff --git a/benchmark/all/test_package/CMakeLists.txt b/benchmark/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..58358ea --- /dev/null +++ b/benchmark/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(benchmark REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE benchmark::benchmark benchmark::benchmark_main) diff --git a/benchmark/all/test_package/conanfile.py b/benchmark/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/benchmark/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/benchmark/all/test_package/test_package.cpp b/benchmark/all/test_package/test_package.cpp new file mode 100644 index 0000000..4fa7ec0 --- /dev/null +++ b/benchmark/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include "benchmark/benchmark.h" + +void BM_StringCreation(benchmark::State& state) { + while (state.KeepRunning()) + std::string empty_string; +} + +BENCHMARK(BM_StringCreation); + +void BM_StringCopy(benchmark::State& state) { + std::string x = "hello"; + while (state.KeepRunning()) + std::string copy(x); +} + +BENCHMARK(BM_StringCopy); + +BENCHMARK_MAIN(); diff --git a/benchmark/all/test_v1_package/CMakeLists.txt b/benchmark/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..925ecbe --- /dev/null +++ b/benchmark/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/benchmark/all/test_v1_package/conanfile.py b/benchmark/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..2490acf --- /dev/null +++ b/benchmark/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/benchmark/config.yml b/benchmark/config.yml new file mode 100644 index 0000000..1343007 --- /dev/null +++ b/benchmark/config.yml @@ -0,0 +1,23 @@ +versions: + "1.8.4": + folder: all + "1.8.3": + folder: all + "1.8.2": + folder: all + "1.8.1": + folder: all + "1.8.0": + folder: all + "1.7.1": + folder: all + "1.7.0": + folder: all + "1.6.2": + folder: all + "1.6.1": + folder: all + "1.6.0": + folder: all + "1.5.6": + folder: all diff --git a/bison/all/conandata.yml b/bison/all/conandata.yml new file mode 100644 index 0000000..5b0419b --- /dev/null +++ b/bison/all/conandata.yml @@ -0,0 +1,63 @@ +sources: + "3.8.2": + url: "https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.gz" + sha256: "06c9e13bdf7eb24d4ceb6b59205a4f67c2c7e7213119644430fe82fbd14a0abb" + "3.7.6": + url: "https://ftp.gnu.org/gnu/bison/bison-3.7.6.tar.gz" + sha256: "69dc0bb46ea8fc307d4ca1e0b61c8c355eb207d0b0c69f4f8462328e74d7b9ea" + "3.7.1": + url: "https://ftp.gnu.org/gnu/bison/bison-3.7.1.tar.gz" + sha256: "1dd952839cf0d5a8178c691eeae40dc48fa50d18dcce648b1ad9ae0195367d13" + "3.5.3": + url: "https://ftp.gnu.org/gnu/bison/bison-3.5.3.tar.gz" + sha256: "34e201d963156618a0ea5bc87220f660a1e08403dd3c7c7903d4f38db3f40039" +patches: + "3.8.2": + - patch_file: "patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + patch_description: "use O_TEXT instead of O_BINARY for pipe" + patch_type: "portability" + - patch_file: "patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + patch_description: "windows: open source file in binary mode" + patch_type: "portability" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + patch_description: "msvc: limit search range of _setmaxstdio" + patch_type: "portability" + "3.7.6": + - patch_file: "patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + patch_description: "use O_TEXT instead of O_BINARY for pipe" + patch_type: "portability" + - patch_file: "patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + patch_description: "windows: open source file in binary mode" + patch_type: "portability" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + patch_description: "msvc: limit search range of _setmaxstdio" + patch_type: "portability" + "3.7.1": + - patch_file: "patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + patch_description: "use O_TEXT instead of O_BINARY for pipe" + patch_type: "portability" + - patch_file: "patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + patch_description: "windows: open source file in binary mode" + patch_type: "portability" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + patch_description: "msvc: limit search range of _setmaxstdio" + patch_type: "portability" + - patch_file: "patches/0006-dont-link-bison-against-libreadline.patch" + patch_description: "Don't link bison against libreadline" + patch_type: "portability" + "3.5.3": + - patch_file: "patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + patch_description: "use O_TEXT instead of O_BINARY for pipe" + patch_type: "portability" + - patch_file: "patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + patch_description: "windows: open source file in binary mode" + patch_type: "portability" + - patch_file: "patches/0003-3.5.3-msvc-changes.patch" + patch_description: "windows: fix build" + patch_type: "portability" + - patch_file: "patches/0004-3.5.3-relocatable.patch" + patch_description: "Relocatable" + patch_type: "portability" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + patch_description: "msvc: limit search range of _setmaxstdio" + patch_type: "portability" diff --git a/bison/all/conanfile.py b/bison/all/conanfile.py new file mode 100644 index 0000000..98dd943 --- /dev/null +++ b/bison/all/conanfile.py @@ -0,0 +1,168 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +import os + +required_conan_version = ">=1.54.0" + + +class BisonConan(ConanFile): + name = "bison" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/bison/" + description = "Bison is a general-purpose parser generator" + topics = ("bison", "parser") + license = "GPL-3.0-or-later" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("m4/1.4.19") + + def validate(self): + if is_msvc(self) and self.version == "3.8.2": + raise ConanInvalidConfiguration( + f"{self.ref} is not yet ready for Visual Studio, use previous version " + "or open a pull request on https://github.com/conan-io/conan-center-index/pulls" + ) + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") + if self.settings.os != "Windows": + self.tool_requires("flex/2.6.4") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--enable-relocatable", + "--disable-nls", + "--datarootdir=${prefix}/res", + ]) + if self.settings.compiler == "apple-clang": + tc.configure_args.append("gl_cv_compiler_check_decl_option=") + if is_msvc(self): + # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug + # Visual Studio does not support the %n format flag: + # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions + # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string, + # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output. + tc.configure_args.extend([ + "gl_cv_func_printf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + ]) + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} lib") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + + makefile = os.path.join(self.source_folder, "Makefile.in") + yacc = os.path.join(self.source_folder, "src", "yacc.in") + + if self.settings.os == "Windows": + # replace embedded unix paths by windows paths + replace_in_file(self, makefile, + "echo '#define BINDIR \"$(bindir)\"';", + "echo '#define BINDIR \"$(shell cygpath -m \"$(bindir)\")\"';") + replace_in_file(self, makefile, + "echo '#define PKGDATADIR \"$(pkgdatadir)\"';", + "echo '#define PKGDATADIR \"$(shell cygpath -m \"$(pkgdatadir)\")\"';") + replace_in_file(self, makefile, + "echo '#define DATADIR \"$(datadir)\"';", + "echo '#define DATADIR \"$(shell cygpath -m \"$(datadir)\")\"';") + replace_in_file(self, makefile, + "echo '#define DATAROOTDIR \"$(datarootdir)\"';", + "echo '#define DATAROOTDIR \"$(shell cygpath -m \"$(datarootdir)\")\"';") + + replace_in_file(self, makefile, + "dist_man_MANS = $(top_srcdir)/doc/bison.1", + "dist_man_MANS =") + replace_in_file(self, yacc, "@prefix@", "$CONAN_BISON_ROOT") + replace_in_file(self, yacc, "@bindir@", "$CONAN_BISON_ROOT/bin") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.install() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + if is_msvc(self): + rename(self, os.path.join(self.package_folder, "lib", "liby.a"), + os.path.join(self.package_folder, "lib", "y.lib")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libs = ["y"] + self.cpp_info.resdirs = ["res"] + + bison_root = self.package_folder.replace("\\", "/") + self.buildenv_info.define_path("CONAN_BISON_ROOT", bison_root) + + pkgdir = os.path.join(self.package_folder, "res", "bison") + self.buildenv_info.define_path("BISON_PKGDATADIR", pkgdir) + + # yacc is a shell script, so requires a shell (such as bash) + yacc = os.path.join(self.package_folder, "bin", "yacc").replace("\\", "/") + self.conf_info.define("user.bison:yacc", yacc) + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.CONAN_BISON_ROOT = self.package_folder.replace("\\", "/") + self.env_info.BISON_PKGDATADIR = pkgdir + self.user_info.YACC = yacc diff --git a/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch b/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch new file mode 100644 index 0000000..b40517e --- /dev/null +++ b/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch @@ -0,0 +1,29 @@ +From dffa2a21edeba243ef76b75e0c2081ec15fe95bd Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Wed, 3 Apr 2019 19:48:12 +0700 +Subject: [PATCH 3/4] 0003 + +--- + lib/spawn-pipe.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/spawn-pipe.c b/lib/spawn-pipe.c +index 3af5167..09e9cad 100644 +--- a/lib/spawn-pipe.c ++++ b/lib/spawn-pipe.c +@@ -213,10 +213,10 @@ create_pipe (const char *progname, + xalloc_die (); + + if (pipe_stdout) +- if (pipe2_safer (ifd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ifd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + if (pipe_stdin) +- if (pipe2_safer (ofd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ofd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + /* Data flow diagram: + * +-- +2.7.4.windows.1 + diff --git a/bison/all/patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch b/bison/all/patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch new file mode 100644 index 0000000..9f229b7 --- /dev/null +++ b/bison/all/patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch @@ -0,0 +1,29 @@ +From dffa2a21edeba243ef76b75e0c2081ec15fe95bd Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Wed, 3 Apr 2019 19:48:12 +0700 +Subject: [PATCH 3/4] 0003 + +--- + lib/spawn-pipe.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/spawn-pipe.c b/lib/spawn-pipe.c +index 3af5167..09e9cad 100644 +--- a/lib/spawn-pipe.c ++++ b/lib/spawn-pipe.c +@@ -137,10 +137,10 @@ create_pipe (const char *progname, + prog_argv = prepare_spawn (prog_argv); + + if (pipe_stdout) +- if (pipe2_safer (ifd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ifd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + if (pipe_stdin) +- if (pipe2_safer (ofd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ofd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + /* Data flow diagram: + * +-- +2.7.4.windows.1 + diff --git a/bison/all/patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch b/bison/all/patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch new file mode 100644 index 0000000..faa2c49 --- /dev/null +++ b/bison/all/patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch @@ -0,0 +1,26 @@ +--- src/location.c ++++ src/location.c +@@ -268,6 +268,14 @@ caret_free (void) + static bool + caret_set_file (const char *file) + { ++#if defined(_WIN32) ++ /* ftell() is unusable on Windows in the face of text files ++ that use just LF and not Windows-style CR-LF as newlines ++ http://support.microsoft.com/kb/68337 */ ++ char fopen_mode[3] = "rb"; ++#else ++ char fopen_mode[2] = "r"; ++#endif + /* If a different file than before, close and let the rest open + the new one. */ + if (caret_info.pos.file && caret_info.pos.file != file) +@@ -278,7 +278,7 @@ caret_set_file (const char *file) + if (!caret_info.pos.file) + { + caret_info.pos.file = file; +- if ((caret_info.file = fopen (caret_info.pos.file, "r"))) ++ if ((caret_info.file = fopen (caret_info.pos.file, fopen_mode))) + { + /* If the file is not regular (imagine #line 1 "/dev/stdin" + in the input file for instance), don't try to quote the diff --git a/bison/all/patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch b/bison/all/patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch new file mode 100644 index 0000000..9737127 --- /dev/null +++ b/bison/all/patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch @@ -0,0 +1,26 @@ +--- src/location.c ++++ src/location.c +@@ -256,6 +256,14 @@ caret_free (void) + static bool + caret_set_file (const char *file) + { ++#if defined(_WIN32) ++ /* ftell() is unusable on Windows in the face of text files ++ that use just LF and not Windows-style CR-LF as newlines ++ http://support.microsoft.com/kb/68337 */ ++ char fopen_mode[3] = "rb"; ++#else ++ char fopen_mode[2] = "r"; ++#endif + /* If a different file than before, close and let the rest open + the new one. */ + if (caret_info.pos.file && caret_info.pos.file != file) +@@ -266,7 +266,7 @@ caret_set_file (const char *file) + if (!caret_info.pos.file) + { + caret_info.pos.file = file; +- if ((caret_info.file = fopen (caret_info.pos.file, "r"))) ++ if ((caret_info.file = fopen (caret_info.pos.file, fopen_mode))) + { + /* If the file is not regular (imagine #line 1 "/dev/stdin" + in the input file for instance), don't try to quote the diff --git a/bison/all/patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch b/bison/all/patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch new file mode 100644 index 0000000..2310d29 --- /dev/null +++ b/bison/all/patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch @@ -0,0 +1,26 @@ +--- src/location.c ++++ src/location.c +@@ -258,6 +258,14 @@ + static bool + caret_set_file (const char *file) + { ++#if defined(_WIN32) ++ /* ftell() is unusable on Windows in the face of text files ++ that use just LF and not Windows-style CR-LF as newlines ++ http://support.microsoft.com/kb/68337 */ ++ char fopen_mode[3] = "rb"; ++#else ++ char fopen_mode[2] = "r"; ++#endif + /* If a different file than before, close and let the rest open + the new one. */ + if (caret_info.pos.file && caret_info.pos.file != file) +@@ -268,7 +268,7 @@ + if (!caret_info.pos.file) + { + caret_info.pos.file = file; +- if ((caret_info.file = fopen (caret_info.pos.file, "r"))) ++ if ((caret_info.file = fopen (caret_info.pos.file, fopen_mode))) + { + /* If the file is not regular (imagine #line 1 "/dev/stdin" + in the input file for instance), don't try to quote the diff --git a/bison/all/patches/0003-3.5.3-msvc-changes.patch b/bison/all/patches/0003-3.5.3-msvc-changes.patch new file mode 100644 index 0000000..56aeeeb --- /dev/null +++ b/bison/all/patches/0003-3.5.3-msvc-changes.patch @@ -0,0 +1,261 @@ +src/parse-gram.y and src/scan-gram.l should be modified as well, +but aren't to avoid a dependency on a already-built flex and bison. + +--- src/location.c ++++ src/location.c +@@ -25,9 +25,13 @@ + #include + #include + #include /* fileno */ ++#ifndef _WIN32 + #include ++#endif + #include /* fstat */ ++#ifndef _WIN32 + #include ++#endif + + #ifdef WINSIZE_IN_PTEM + # include +--- src/parse-gram.c ++++ src/parse-gram.c +@@ -991,7 +991,7 @@ tron (yyo); + + case 43: /* "character literal" */ + #line 217 "src/parse-gram.y" +- { fputs (char_name (((*yyvaluep).CHAR)), yyo); } ++ { fputs (char_name (((*yyvaluep).CHAR_LITERAL)), yyo); } + #line 996 "src/parse-gram.c" + break; + +@@ -1027,7 +1027,7 @@ tron (yyo); + + case 56: /* "integer" */ + #line 234 "src/parse-gram.y" +- { fprintf (yyo, "%d", ((*yyvaluep).INT)); } ++ { fprintf (yyo, "%d", ((*yyvaluep).INTEGER)); } + #line 1032 "src/parse-gram.c" + break; + +@@ -2216,13 +2216,13 @@ yyreduce: + + case 12: + #line 330 "src/parse-gram.y" +- { expected_sr_conflicts = (yyvsp[0].INT); } ++ { expected_sr_conflicts = (yyvsp[0].INTEGER); } + #line 2221 "src/parse-gram.c" + break; + + case 13: + #line 331 "src/parse-gram.y" +- { expected_rr_conflicts = (yyvsp[0].INT); } ++ { expected_rr_conflicts = (yyvsp[0].INTEGER); } + #line 2227 "src/parse-gram.c" + break; + +@@ -2775,7 +2775,7 @@ yyreduce: + + case 102: + #line 679 "src/parse-gram.y" +- { grammar_current_rule_dprec_set ((yyvsp[0].INT), (yylsp[0])); } ++ { grammar_current_rule_dprec_set ((yyvsp[0].INTEGER), (yylsp[0])); } + #line 2780 "src/parse-gram.c" + break; + +@@ -2787,13 +2787,13 @@ yyreduce: + + case 104: + #line 683 "src/parse-gram.y" +- { grammar_current_rule_expect_sr ((yyvsp[0].INT), (yylsp[0])); } ++ { grammar_current_rule_expect_sr ((yyvsp[0].INTEGER), (yylsp[0])); } + #line 2792 "src/parse-gram.c" + break; + + case 105: + #line 685 "src/parse-gram.y" +- { grammar_current_rule_expect_rr ((yyvsp[0].INT), (yylsp[0])); } ++ { grammar_current_rule_expect_rr ((yyvsp[0].INTEGER), (yylsp[0])); } + #line 2798 "src/parse-gram.c" + break; + +@@ -2860,9 +2860,9 @@ yyreduce: + complain_indent (&loc, complaint, &indent, + _("definition of %s"), var); + } +- (yyval.id) = symbol_get (char_name ((yyvsp[0].CHAR)), (yylsp[0])); ++ (yyval.id) = symbol_get (char_name ((yyvsp[0].CHAR_LITERAL)), (yylsp[0])); + symbol_class_set ((yyval.id), token_sym, (yylsp[0]), false); +- symbol_user_token_number_set ((yyval.id), (yyvsp[0].CHAR), (yylsp[0])); ++ symbol_user_token_number_set ((yyval.id), (yyvsp[0].CHAR_LITERAL), (yylsp[0])); + } + #line 2868 "src/parse-gram.c" + break; +--- src/parse-gram.h ++++ src/parse-gram.h +@@ -122,7 +122,7 @@ extern int gram_debug; + BRACED_CODE = 40, + BRACED_PREDICATE = 41, + BRACKETED_ID = 42, +- CHAR = 43, ++ CHAR_LITERAL = 43, + COLON = 44, + EPILOGUE = 45, + EQUAL = 46, +@@ -135,7 +135,7 @@ extern int gram_debug; + TAG = 53, + TAG_ANY = 54, + TAG_NONE = 55, +- INT = 56, ++ INTEGER = 56, + PERCENT_PARAM = 57, + PERCENT_UNION = 58, + PERCENT_EMPTY = 59 +@@ -162,7 +162,7 @@ union GRAM_STYPE + /* code_props_type */ + code_props_type code_props_type; + /* "integer" */ +- int INT; ++ int INTEGER; + /* int.opt */ + int yytype_81; + /* named_ref.opt */ +@@ -226,7 +226,7 @@ union GRAM_STYPE + /* variable */ + uniqstr variable; + /* "character literal" */ +- unsigned char CHAR; ++ unsigned char CHAR_LITERAL; + /* value */ + value_type value; + #line 233 "src/parse-gram.h" +--- src/reader.c ++++ src/reader.c +@@ -803,7 +803,7 @@ check_and_convert_grammar (void) + + $accept: %start $end. */ + { +- symbol_list *p = symbol_list_sym_new (accept, empty_loc); ++ symbol_list *p = symbol_list_sym_new (bison_accept, empty_loc); + p->rhs_loc = grammar->rhs_loc; + p->next = symbol_list_sym_new (startsymbol, empty_loc); + p->next->next = symbol_list_sym_new (endtoken, empty_loc); +--- src/reduce.c ++++ src/reduce.c +@@ -160,9 +160,9 @@ inaccessable_symbols (void) + bitset Pp = bitset_create (nrules, BITSET_FIXED); + + /* If the start symbol isn't useful, then nothing will be useful. */ +- if (bitset_test (N, accept->content->number - ntokens)) ++ if (bitset_test (N, bison_accept->content->number - ntokens)) + { +- bitset_set (V, accept->content->number); ++ bitset_set (V, bison_accept->content->number); + + while (1) + { +@@ -301,7 +301,7 @@ nonterminals_reduce (void) + for (item_number *rhsp = rules[r].rhs; 0 <= *rhsp; ++rhsp) + if (ISVAR (*rhsp)) + *rhsp = symbol_number_as_item_number (nterm_map[*rhsp - ntokens]); +- accept->content->number = nterm_map[accept->content->number - ntokens]; ++ bison_accept->content->number = nterm_map[bison_accept->content->number - ntokens]; + } + + nsyms -= nuseless_nonterminals; +@@ -381,7 +381,7 @@ reduce_grammar (void) + { + reduce_print (); + +- if (!bitset_test (N, accept->content->number - ntokens)) ++ if (!bitset_test (N, bison_accept->content->number - ntokens)) + complain (&startsymbol_loc, fatal, + _("start symbol %s does not derive any sentence"), + startsymbol->tag); +--- src/scan-gram.c ++++ src/scan-gram.c +@@ -2223,12 +2223,12 @@ YY_RULE_SETUP + case 65: + YY_RULE_SETUP + #line 308 "/Users/akim/src/gnu/bison/src/scan-gram.l" +-RETURN_VALUE (INT, scan_integer (yytext, 10, *loc)); ++RETURN_VALUE (INTEGER, scan_integer (yytext, 10, *loc)); + YY_BREAK + case 66: + YY_RULE_SETUP + #line 309 "/Users/akim/src/gnu/bison/src/scan-gram.l" +-RETURN_VALUE (INT, scan_integer (yytext, 16, *loc)); ++RETURN_VALUE (INTEGER, scan_integer (yytext, 16, *loc)); + YY_BREAK + /* Identifiers may not start with a digit. Yet, don't silently + accept "1FOO" as "1 FOO". */ +@@ -2575,21 +2575,21 @@ YY_RULE_SETUP + { + STRING_FINISH; + loc->start = token_start; +- val->CHAR = last_string[0]; ++ val->CHAR_LITERAL = last_string[0]; + + /* FIXME: Eventually, make these errors. */ + if (last_string[0] == '\0') + { + complain (loc, Wother, _("empty character literal")); + /* '\0' seems dangerous even if we are about to complain. */ +- val->CHAR = '\''; ++ val->CHAR_LITERAL = '\''; + } + else if (last_string[1] != '\0') + complain (loc, Wother, + _("extra characters in character literal")); + STRING_FREE; + BEGIN INITIAL; +- return CHAR; ++ return CHAR_LITERAL; + } + YY_BREAK + case 95: +--- src/symtab.c ++++ src/symtab.c +@@ -52,7 +52,7 @@ static semantic_type **semantic_types_sorted = NULL; + symbol *errtoken = NULL; + symbol *undeftoken = NULL; + symbol *endtoken = NULL; +-symbol *accept = NULL; ++symbol *bison_accept = NULL; + symbol *startsymbol = NULL; + location startsymbol_loc; + +@@ -843,9 +843,9 @@ symbols_new (void) + symbol_free); + + /* Construct the accept symbol. */ +- accept = symbol_get ("$accept", empty_loc); +- accept->content->class = nterm_sym; +- accept->content->number = nvars++; ++ bison_accept = symbol_get ("$accept", empty_loc); ++ bison_accept->content->class = nterm_sym; ++ bison_accept->content->number = nvars++; + + /* Construct the error token */ + errtoken = symbol_get ("error", empty_loc); +--- src/symtab.h ++++ src/symtab.h +@@ -248,7 +248,7 @@ extern symbol *endtoken; + /** The genuine start symbol. + + $accept: start-symbol $end */ +-extern symbol *accept; ++extern symbol *bison_accept; + + /** The user start symbol. */ + extern symbol *startsymbol; +--- src/ielr.c ++++ src/ielr.c +@@ -429,7 +429,7 @@ + check all predecessors' goto follows for the LHS. */ + if (item_number_is_rule_number (ritem[s->items[item] - 2])) + { +- aver (lhs != accept->content->number); ++ aver (lhs != bison_accept->content->number); + for (state **predecessor = predecessors[s->number]; + *predecessor; + ++predecessor) diff --git a/bison/all/patches/0004-3.5.3-relocatable.patch b/bison/all/patches/0004-3.5.3-relocatable.patch new file mode 100644 index 0000000..991f41c --- /dev/null +++ b/bison/all/patches/0004-3.5.3-relocatable.patch @@ -0,0 +1,753 @@ +--- Makefile.in ++++ Makefile.in +@@ -637,10 +637,10 @@ am_src_bison_OBJECTS = src/bison-AnnotationList.$(OBJEXT) \ + src/bison-main.$(OBJEXT) src/bison-muscle-tab.$(OBJEXT) \ + src/bison-named-ref.$(OBJEXT) src/bison-nullable.$(OBJEXT) \ + src/bison-output.$(OBJEXT) src/bison-parse-gram.$(OBJEXT) \ +- src/bison-print-graph.$(OBJEXT) src/bison-print-xml.$(OBJEXT) \ +- src/bison-print.$(OBJEXT) src/bison-reader.$(OBJEXT) \ +- src/bison-reduce.$(OBJEXT) src/bison-relation.$(OBJEXT) \ +- src/bison-scan-code-c.$(OBJEXT) \ ++ src/bison-pathtools.$(OBJEXT) src/bison-print-graph.$(OBJEXT) \ ++ src/bison-print-xml.$(OBJEXT) src/bison-print.$(OBJEXT) \ ++ src/bison-reader.$(OBJEXT) src/bison-reduce.$(OBJEXT) \ ++ src/bison-relation.$(OBJEXT) src/bison-scan-code-c.$(OBJEXT) \ + src/bison-scan-gram-c.$(OBJEXT) \ + src/bison-scan-skel-c.$(OBJEXT) src/bison-state.$(OBJEXT) \ + src/bison-symlist.$(OBJEXT) src/bison-symtab.$(OBJEXT) \ +@@ -878,6 +878,7 @@ am__depfiles_remade = examples/c++/$(DEPDIR)/simple-simple.Po \ + src/$(DEPDIR)/bison-named-ref.Po \ + src/$(DEPDIR)/bison-nullable.Po src/$(DEPDIR)/bison-output.Po \ + src/$(DEPDIR)/bison-parse-gram.Po \ ++ src/$(DEPDIR)/bison-pathtools.Po \ + src/$(DEPDIR)/bison-print-graph.Po \ + src/$(DEPDIR)/bison-print-xml.Po src/$(DEPDIR)/bison-print.Po \ + src/$(DEPDIR)/bison-reader.Po src/$(DEPDIR)/bison-reduce.Po \ +@@ -3169,6 +3170,8 @@ src_bison_SOURCES = \ + src/output.c \ + src/output.h \ + src/parse-gram.y \ ++ src/pathtools.c \ ++ src/pathtools.h \ + src/print-graph.c \ + src/print-graph.h \ + src/print-xml.c \ +@@ -3992,6 +3995,8 @@ src/bison-output.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + src/bison-parse-gram.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) ++src/bison-pathtools.$(OBJEXT): src/$(am__dirstamp) \ ++ src/$(DEPDIR)/$(am__dirstamp) + src/bison-print-graph.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + src/bison-print-xml.$(OBJEXT): src/$(am__dirstamp) \ +@@ -4317,6 +4322,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-nullable.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-output.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-parse-gram.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-pathtools.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print-graph.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print-xml.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print.Po@am__quote@ # am--include-marker +@@ -7283,6 +7289,20 @@ src/bison-parse-gram.obj: src/parse-gram.c + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-parse-gram.obj `if test -f 'src/parse-gram.c'; then $(CYGPATH_W) 'src/parse-gram.c'; else $(CYGPATH_W) '$(srcdir)/src/parse-gram.c'; fi` + ++src/bison-pathtools.o: src/pathtools.c ++@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-pathtools.o -MD -MP -MF src/$(DEPDIR)/bison-pathtools.Tpo -c -o src/bison-pathtools.o `test -f 'src/pathtools.c' || echo '$(srcdir)/'`src/pathtools.c ++@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-pathtools.Tpo src/$(DEPDIR)/bison-pathtools.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/pathtools.c' object='src/bison-pathtools.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-pathtools.o `test -f 'src/pathtools.c' || echo '$(srcdir)/'`src/pathtools.c ++ ++src/bison-pathtools.obj: src/pathtools.c ++@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-pathtools.obj -MD -MP -MF src/$(DEPDIR)/bison-pathtools.Tpo -c -o src/bison-pathtools.obj `if test -f 'src/pathtools.c'; then $(CYGPATH_W) 'src/pathtools.c'; else $(CYGPATH_W) '$(srcdir)/src/pathtools.c'; fi` ++@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-pathtools.Tpo src/$(DEPDIR)/bison-pathtools.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/pathtools.c' object='src/bison-pathtools.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-pathtools.obj `if test -f 'src/pathtools.c'; then $(CYGPATH_W) 'src/pathtools.c'; else $(CYGPATH_W) '$(srcdir)/src/pathtools.c'; fi` ++ + src/bison-print-graph.o: src/print-graph.c + @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print-graph.o -MD -MP -MF src/$(DEPDIR)/bison-print-graph.Tpo -c -o src/bison-print-graph.o `test -f 'src/print-graph.c' || echo '$(srcdir)/'`src/print-graph.c + @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print-graph.Tpo src/$(DEPDIR)/bison-print-graph.Po +@@ -9079,6 +9099,7 @@ distclean: distclean-recursive + -rm -f src/$(DEPDIR)/bison-nullable.Po + -rm -f src/$(DEPDIR)/bison-output.Po + -rm -f src/$(DEPDIR)/bison-parse-gram.Po ++ -rm -f src/$(DEPDIR)/bison-pathtools.Po + -rm -f src/$(DEPDIR)/bison-print-graph.Po + -rm -f src/$(DEPDIR)/bison-print-xml.Po + -rm -f src/$(DEPDIR)/bison-print.Po +@@ -9464,6 +9485,7 @@ maintainer-clean: maintainer-clean-recursive + -rm -f src/$(DEPDIR)/bison-nullable.Po + -rm -f src/$(DEPDIR)/bison-output.Po + -rm -f src/$(DEPDIR)/bison-parse-gram.Po ++ -rm -f src/$(DEPDIR)/bison-pathtools.Po + -rm -f src/$(DEPDIR)/bison-print-graph.Po + -rm -f src/$(DEPDIR)/bison-print-xml.Po + -rm -f src/$(DEPDIR)/bison-print.Po +--- src/files.c ++++ src/files.c +@@ -1,4 +1,5 @@ + /* Open and close files for Bison. ++ rse-gram.Po + + Copyright (C) 1984, 1986, 1989, 1992, 2000-2015, 2018-2020 Free + Software Foundation, Inc. +@@ -35,6 +36,7 @@ + #include "files.h" + #include "getargs.h" + #include "gram.h" ++#include "pathtools.h" + + /* Initializing some values below (such SPEC_NAME_PREFIX to 'yy') is + tempting, but don't do that: for the time being our handling of the +@@ -417,7 +419,11 @@ pkgdatadir (void) + else + { + char const *cp = getenv ("BISON_PKGDATADIR"); +- return cp ? cp : relocate2 (PKGDATADIR, &relocate_buffer); ++ if (cp) { ++ return cp; ++ } ++ const char *_dir = single_path_relocation(BINDIR, PKGDATADIR); ++ return _dir; + } + } + +--- src/local.mk ++++ src/local.mk +@@ -71,6 +71,8 @@ src_bison_SOURCES = \ + src/output.c \ + src/output.h \ + src/parse-gram.y \ ++ src/pathtools.c \ ++ src/pathtools.h \ + src/print-graph.c \ + src/print-graph.h \ + src/print-xml.c \ +--- src/output.c ++++ src/output.c +@@ -21,6 +21,7 @@ + #include + #include "system.h" + ++#include + #include /* IS_PATH_WITH_DIR */ + #include + #include +@@ -41,6 +42,7 @@ + #include "scan-skel.h" + #include "symtab.h" + #include "tables.h" ++#include "pathtools.h" + + static struct obstack format_obstack; + +@@ -573,7 +575,7 @@ static void + output_skeleton (void) + { + /* Compute the names of the package data dir and skeleton files. */ +- char const *m4 = (m4 = getenv ("M4")) ? m4 : M4; ++ char const *m4 = (m4 = getenv ("M4")) ? m4 : "m4" EXEEXT; //single_path_relocation(BINDIR, M4); + char const *datadir = pkgdatadir (); + char *skeldir = xpath_join (datadir, "skeletons"); + char *m4sugar = xpath_join (datadir, "m4sugar/m4sugar.m4"); +--- /dev/null ++++ src/pathtools.c +@@ -0,0 +1,536 @@ ++/* ++ .Some useful path tools. ++ .ASCII only for now. ++ .Written by Ray Donnelly in 2014. ++ .Licensed under CC0 (and anything. ++ .else you need to license it under). ++ .No warranties whatsoever. ++ .email: . ++ */ ++ ++#include "config.h" ++#if defined(__APPLE__) ++#include ++#else ++#include ++#include ++#endif ++#include ++#include ++#include ++#if defined(__linux__) ++#include ++#endif ++#include ++ ++#ifndef PATH_MAX ++#define PATH_MAX 4096 ++#endif ++ ++/* If you don't define this, then get_executable_path() ++ can only use argv[0] which will often not work well */ ++#define IMPLEMENT_SYS_GET_EXECUTABLE_PATH ++ ++#if defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) ++#if defined(__linux__) ++/* Nothing needed, unistd.h is enough. */ ++#elif defined(__APPLE__) ++#include ++#elif defined(_WIN32) ++#define WIN32_MEAN_AND_LEAN ++#include ++#include ++#endif ++#endif /* defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) */ ++ ++#include "pathtools.h" ++ ++char * ++malloc_copy_string(char const * original) ++{ ++ char * result = (char *) malloc (sizeof (char*) * strlen (original)+1); ++ if (result != NULL) ++ { ++ strcpy (result, original); ++ } ++ return result; ++} ++ ++void ++sanitise_path(char * path) ++{ ++ size_t path_size = strlen (path); ++ ++ /* Replace any '\' with '/' */ ++ char * path_p = path; ++ while ((path_p = strchr (path_p, '\\')) != NULL) ++ { ++ *path_p = '/'; ++ } ++ /* Replace any '//' with '/' */ ++ path_p = path; ++ while ((path_p = strstr (path_p, "//")) != NULL) ++ { ++ memmove (path_p, path_p + 1, path_size--); ++ } ++ return; ++} ++ ++char * ++get_relative_path(char const * from_in, char const * to_in) ++{ ++ size_t from_size = (from_in == NULL) ? 0 : strlen (from_in); ++ size_t to_size = (to_in == NULL) ? 0 : strlen (to_in); ++ size_t max_size = (from_size + to_size) * 2 + 4; ++ char * scratch_space = (char *) alloca (from_size + 1 + to_size + 1 + max_size + max_size); ++ char * from; ++ char * to; ++ char * common_part; ++ char * result; ++ size_t count; ++ ++ /* No to, return "./" */ ++ if (to_in == NULL) ++ { ++ return malloc_copy_string ("./"); ++ } ++ ++ /* If alloca failed or no from was given return a copy of to */ ++ if ( from_in == NULL ++ || scratch_space == NULL ) ++ { ++ return malloc_copy_string (to_in); ++ } ++ ++ from = scratch_space; ++ strcpy (from, from_in); ++ to = from + from_size + 1; ++ strcpy (to, to_in); ++ common_part = to + to_size + 1; ++ result = common_part + max_size; ++ simplify_path (from); ++ simplify_path (to); ++ ++ result[0] = '\0'; ++ ++ size_t match_size_dirsep = 0; /* The match size up to the last /. Always wind back to this - 1 */ ++ size_t match_size = 0; /* The running (and final) match size. */ ++ size_t largest_size = (from_size > to_size) ? from_size : to_size; ++ int to_final_is_slash = (to[to_size-1] == '/') ? 1 : 0; ++ char from_c; ++ char to_c; ++ for (match_size = 0; match_size < largest_size; ++match_size) ++ { ++ /* To simplify the logic, always pretend the strings end with '/' */ ++ from_c = (match_size < from_size) ? from[match_size] : '/'; ++ to_c = (match_size < to_size) ? to[match_size] : '/'; ++ ++ if (from_c != to_c) ++ { ++ if (from_c != '\0' || to_c != '\0') ++ { ++ match_size = match_size_dirsep; ++ } ++ break; ++ } ++ else if (from_c == '/') ++ { ++ match_size_dirsep = match_size; ++ } ++ } ++ strncpy (common_part, from, match_size); ++ common_part[match_size] = '\0'; ++ from += match_size; ++ to += match_size; ++ size_t ndotdots = 0; ++ char const* from_last = from + strlen(from) - 1; ++ while ((from = strchr (from, '/')) && from != from_last) ++ { ++ ++ndotdots; ++ ++from; ++ } ++ for (count = 0; count < ndotdots; ++count) ++ { ++ strcat(result, "../"); ++ } ++ if (strlen(to) > 0) ++ { ++ strcat(result, to+1); ++ } ++ /* Make sure that if to ends with '/' result does the same, and ++ vice-versa. */ ++ size_t size_result = strlen(result); ++ if ((to_final_is_slash == 1) ++ && (!size_result || result[size_result-1] != '/')) ++ { ++ strcat (result, "/"); ++ } ++ else if (!to_final_is_slash ++ && size_result && result[size_result-1] == '/') ++ { ++ result[size_result-1] = '\0'; ++ } ++ ++ return malloc_copy_string (result); ++} ++ ++void ++simplify_path(char * path) ++{ ++ ssize_t n_toks = 1; /* in-case we need an empty initial token. */ ++ ssize_t i, j; ++ size_t tok_size; ++ size_t in_size = strlen (path); ++ int it_ended_with_a_slash = (path[in_size - 1] == '/') ? 1 : 0; ++ char * result = path; ++ sanitise_path(result); ++ char * result_p = result; ++ ++ do ++ { ++ ++n_toks; ++ ++result_p; ++ } while ((result_p = strchr (result_p, '/')) != NULL); ++ ++ result_p = result; ++ char ** toks = (char **) alloca (sizeof (char const*) * n_toks); ++ n_toks = 0; ++ do ++ { ++ if (result_p > result) ++ { ++ *result_p++ = '\0'; ++ } ++ else if (*result_p == '/') ++ { ++ /* A leading / creates an empty initial token. */ ++ toks[n_toks++] = result_p; ++ *result_p++ = '\0'; ++ } ++ toks[n_toks++] = result_p; ++ } while ((result_p = strchr (result_p, '/')) != NULL); ++ ++ /* Remove all non-leading '.' and any '..' we can match ++ with an earlier forward path (i.e. neither '.' nor '..') */ ++ for (i = 1; i < n_toks; ++i) ++ { ++ int removals[2] = { -1, -1 }; ++ if ( strcmp (toks[i], "." ) == 0) ++ { ++ removals[0] = i; ++ } ++ else if ( strcmp (toks[i], ".." ) == 0) ++ { ++ /* Search backwards for a forward path to collapse. ++ If none are found then the .. also stays. */ ++ for (j = i - 1; j > -1; --j) ++ { ++ if ( strcmp (toks[j], "." ) ++ && strcmp (toks[j], ".." ) ) ++ { ++ removals[0] = j; ++ removals[1] = i; ++ break; ++ } ++ } ++ } ++ for (j = 0; j < 2; ++j) ++ { ++ if (removals[j] >= 0) /* Can become -2 */ ++ { ++ --n_toks; ++ memmove (&toks[removals[j]], &toks[removals[j]+1], (n_toks - removals[j])*sizeof (char*)); ++ --i; ++ if (!j) ++ { ++ --removals[1]; ++ } ++ } ++ } ++ } ++ result_p = result; ++ for (i = 0; i < n_toks; ++i) ++ { ++ tok_size = strlen(toks[i]); ++ memcpy (result_p, toks[i], tok_size); ++ result_p += tok_size; ++ if ((!i || tok_size) && ((i < n_toks - 1) || it_ended_with_a_slash == 1)) ++ { ++ *result_p = '/'; ++ ++result_p; ++ } ++ } ++ *result_p = '\0'; ++} ++ ++/* Returns actual_to by calculating the relative path from -> to and ++ applying that to actual_from. An assumption that actual_from is a ++ dir is made, and it may or may not end with a '/' */ ++char const * ++get_relocated_path (char const * from, char const * to, char const * actual_from) ++{ ++ char const * relative_from_to = get_relative_path (from, to); ++ char * actual_to = (char *) malloc (strlen(actual_from) + 2 + strlen(relative_from_to)); ++ return actual_to; ++} ++ ++int ++get_executable_path(char const * argv0, char * result, ssize_t max_size) ++{ ++ char * system_result = (char *) alloca (max_size); ++ ssize_t system_result_size = -1; ++ ssize_t result_size = -1; ++ ++ if (system_result != NULL) ++ { ++#if defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) ++#if defined(__linux__) ++ system_result_size = readlink("/proc/self/exe", system_result, max_size); ++#elif defined(__APPLE__) ++ uint32_t bufsize = (uint32_t)max_size; ++ if (_NSGetExecutablePath(system_result, &bufsize) == 0) ++ { ++ system_result_size = (ssize_t)bufsize; ++ } ++#elif defined(_WIN32) ++ unsigned long bufsize = (unsigned long)max_size; ++ system_result_size = GetModuleFileNameA(NULL, system_result, bufsize); ++ if (system_result_size == 0 || system_result_size == (ssize_t)bufsize) ++ { ++ /* Error, possibly not enough space. */ ++ system_result_size = -1; ++ } ++ else ++ { ++ /* Early conversion to unix slashes instead of more changes ++ everywhere else .. */ ++ char * winslash; ++ system_result[system_result_size] = '\0'; ++ while ((winslash = strchr (system_result, '\\')) != NULL) ++ { ++ *winslash = '/'; ++ } ++ } ++#else ++#warning "Don't know how to get executable path on this system" ++#endif ++#endif /* defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) */ ++ } ++ /* Use argv0 as a default in-case of failure */ ++ if (system_result_size != -1) ++ { ++ strncpy (result, system_result, system_result_size); ++ result[system_result_size] = '\0'; ++ } ++ else ++ { ++ if (argv0 != NULL) ++ { ++ strncpy (result, argv0, max_size); ++ result[max_size-1] = '\0'; ++ } ++ else ++ { ++ result[0] = '\0'; ++ } ++ } ++ result_size = strlen (result); ++ return result_size; ++} ++ ++char const * ++strip_n_prefix_folders(char const * path, size_t n) ++{ ++ if (path == NULL) ++ { ++ return NULL; ++ } ++ ++ if (path[0] != '/') ++ { ++ return path; ++ } ++ ++ char const * last = path; ++ while (n-- && path != NULL) ++ { ++ last = path; ++ path = strchr (path + 1, '/'); ++ } ++ return (path == NULL) ? last : path; ++} ++ ++void ++strip_n_suffix_folders(char * path, size_t n) ++{ ++ if (path == NULL) ++ { ++ return; ++ } ++ while (n--) ++ { ++ if (strrchr (path + 1, '/')) ++ { ++ *strrchr (path + 1, '/') = '\0'; ++ } ++ else ++ { ++ return; ++ } ++ } ++ return; ++} ++ ++size_t ++split_path_list(char const * path_list, char split_char, char *** arr) ++{ ++ size_t path_count; ++ size_t path_list_size; ++ char const * path_list_p; ++ ++ path_list_p = path_list; ++ if (path_list == NULL || path_list[0] == '\0') ++ { ++ return 0; ++ } ++ path_list_size = strlen (path_list); ++ ++ path_count = 0; ++ do ++ { ++ ++path_count; ++ ++path_list_p; ++ } ++ while ((path_list_p = strchr (path_list_p, split_char)) != NULL); ++ ++ /* allocate everything in one go. */ ++ char * all_memory = (char *) malloc (sizeof (char *) * path_count + strlen(path_list) + 1); ++ if (all_memory == NULL) ++ return 0; ++ *arr = (char **)all_memory; ++ all_memory += sizeof (char *) * path_count; ++ ++ path_count = 0; ++ path_list_p = path_list; ++ char const * next_path_list_p = 0; ++ do ++ { ++ next_path_list_p = strchr (path_list_p, split_char); ++ if (next_path_list_p != NULL) ++ { ++ ++next_path_list_p; ++ } ++ size_t this_size = (next_path_list_p != NULL) ++ ? next_path_list_p - path_list_p - 1 ++ : &path_list[path_list_size] - path_list_p; ++ memcpy (all_memory, path_list_p, this_size); ++ all_memory[this_size] = '\0'; ++ (*arr)[path_count++] = all_memory; ++ all_memory += this_size + 1; ++ } while ((path_list_p = next_path_list_p) != NULL); ++ ++ return path_count; ++} ++ ++char * ++get_relocated_path_list(char const * from, char const * to_path_list) ++{ ++ char exe_path[32768]; ++ char * temp; ++ get_executable_path (NULL, &exe_path[0], sizeof (exe_path) / sizeof (exe_path[0])); ++ if ((temp = strrchr (exe_path, '/')) != NULL) ++ { ++ temp[1] = '\0'; ++ } ++ ++ char **arr = NULL; ++ /* Ask Alexey why he added this. Are we not 100% sure ++ that we're dealing with unix paths here? */ ++ char split_char = ':'; ++ if (strchr (to_path_list, ';')) ++ { ++ split_char = ';'; ++ } ++ size_t count = split_path_list (to_path_list, split_char, &arr); ++ int result_size = 1 + (count - 1); /* count - 1 is for ; delim. */ ++ size_t exe_path_size = strlen (exe_path); ++ size_t i; ++ /* Space required is: ++ count * (exe_path_size + strlen (rel_to_datadir)) ++ rel_to_datadir upper bound is: ++ (count * strlen (from)) + (3 * num_slashes (from)) ++ + strlen(arr[i]) + 1. ++ .. pathalogically num_slashes (from) is strlen (from) ++ (from = ////////) */ ++ size_t space_required = (count * (exe_path_size + 4 * strlen (from))) + count - 1; ++ for (i = 0; i < count; ++i) ++ { ++ space_required += strlen (arr[i]); ++ } ++ char * scratch = (char *) alloca (space_required); ++ if (scratch == NULL) ++ return NULL; ++ for (i = 0; i < count; ++i) ++ { ++ char * rel_to_datadir = get_relative_path (from, arr[i]); ++ scratch[0] = '\0'; ++ arr[i] = scratch; ++ strcat (scratch, exe_path); ++ strcat (scratch, rel_to_datadir); ++ simplify_path (arr[i]); ++ size_t arr_i_size = strlen (arr[i]); ++ result_size += arr_i_size; ++ scratch = arr[i] + arr_i_size + 1; ++ } ++ char * result = (char *) malloc (result_size); ++ if (result == NULL) ++ { ++ return NULL; ++ } ++ result[0] = '\0'; ++ for (i = 0; i < count; ++i) ++ { ++ strcat (result, arr[i]); ++ if (i != count-1) ++ { ++#if defined(_WIN32) ++ strcat (result, ";"); ++#else ++ strcat (result, ":"); ++#endif ++ } ++ } ++ free ((void*)arr); ++ return result; ++} ++ ++char * ++single_path_relocation(const char *from, const char *to) ++{ ++ char exe_path[PATH_MAX]; ++ get_executable_path (NULL, &exe_path[0], sizeof(exe_path)/sizeof(exe_path[0])); ++ if (strrchr (exe_path, '/') != NULL) ++ { ++ strrchr (exe_path, '/')[1] = '\0'; ++ } ++ char * rel_to_datadir = get_relative_path (from, to); ++ strcat (exe_path, rel_to_datadir); ++ simplify_path (&exe_path[0]); ++ return malloc_copy_string(exe_path); ++} ++ ++char * ++pathlist_relocation(const char *from_path, const char *to_path_list) ++{ ++ static char stored_path[PATH_MAX]; ++ static int stored = 0; ++ if (stored == 0) ++ { ++ char const * relocated = get_relocated_path_list(from_path, to_path_list); ++ strncpy (stored_path, relocated, PATH_MAX); ++ stored_path[PATH_MAX-1] = '\0'; ++ free ((void *)relocated); ++ stored = 1; ++ } ++ return stored_path; ++} +--- /dev/null ++++ src/pathtools.h +@@ -0,0 +1,53 @@ ++/* ++ .Some useful path tools. ++ .ASCII only for now. ++ .Written by Ray Donnelly in 2014. ++ .Licensed under CC0 (and anything. ++ .else you need to license it under). ++ .No warranties whatsoever. ++ .email: . ++ */ ++ ++#ifndef PATHTOOLS_H ++#define PATHTOOLS_H ++ ++#include ++#if defined(__APPLE__) ++#include ++#else ++#include ++#endif ++#include ++ ++char * malloc_copy_string(char const * original); ++ ++/* In-place replaces any '\' with '/' and any '//' with '/' */ ++void sanitise_path(char * path); ++ ++/* Uses a host OS specific function to determine the path of the executable, ++ if IMPLEMENT_SYS_GET_EXECUTABLE_PATH is defined, otherwise uses argv0. */ ++int get_executable_path(char const * argv0, char * result, ssize_t max_size); ++ ++/* Where possible, in-place removes occourances of '.' and 'path/..' */ ++void simplify_path(char * path); ++ ++/* Allocates (via malloc) and returns the path to get from from to to. */ ++char * get_relative_path(char const * from, char const * to); ++ ++size_t split_path_list(char const * path_list, char split_char, char *** arr); ++ ++/* Advances path along by the amount that removes n prefix folders. */ ++char const * ++strip_n_prefix_folders(char const * path, size_t n); ++ ++/* NULL terminates path to remove n suffix folders. */ ++void ++strip_n_suffix_folders(char * path, size_t n); ++ ++char const * get_relocated_path (char const * from, char const * to, char const * actual_from); ++char * get_relocated_path_list(char const * from, char const * to_path_list); ++ ++char * single_path_relocation(const char *from, const char *to); ++char * pathlist_relocation(const char *from_path, const char *to_path_list); ++ ++#endif /* PATHTOOLS_H */ +-- +2.21.1 + diff --git a/bison/all/patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch b/bison/all/patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch new file mode 100644 index 0000000..be69712 --- /dev/null +++ b/bison/all/patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch @@ -0,0 +1,38 @@ +This avoid showing a `Assertion Failed Dialog Box` during configure and running bison with the assertion failur: + +``` +Expression: new_maximum >= _IOB_ENTRIES && new_maximum <= _NHANDLE_ +``` + +msdn documentation of _setmaxstdio at +https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setmaxstdio + +Summary: +maximum of 8192 is a hard upper limit for the number of simultaneously open files accessed through the C run-time library. + +Kudos to @SSE4 for finding the rootcause at +https://github.com/conan-io/conan-center-index/pull/2334#issuecomment-668171405 + + +--- lib/getdtablesize.c ++++ lib/getdtablesize.c +@@ -79,12 +79,18 @@ getdtablesize (void) + freed when we call _setmaxstdio with the original value. */ + int orig_max_stdio = _getmaxstdio (); + unsigned int bound; +- for (bound = 0x10000; _setmaxstdio_nothrow (bound) < 0; bound = bound / 2) ++#ifdef _MSC_VER ++# define BOUND_START 0x2000 ++#else ++# define BOUND_START 0x10000 ++#endif ++ for (bound = BOUND_START; _setmaxstdio_nothrow (bound) < 0; bound = bound / 2) + ; + _setmaxstdio_nothrow (orig_max_stdio); + dtablesize = bound; + } + return dtablesize; ++#undef BOUND_START + } + + #else diff --git a/bison/all/patches/0006-dont-link-bison-against-libreadline.patch b/bison/all/patches/0006-dont-link-bison-against-libreadline.patch new file mode 100644 index 0000000..377c9d4 --- /dev/null +++ b/bison/all/patches/0006-dont-link-bison-against-libreadline.patch @@ -0,0 +1,14 @@ +build: don't link bison against libreadline +Reported by Paul Smith . +https://lists.gnu.org/r/bug-bison/2020-10/msg00001.html + +--- a/Makefile.in ++++ b/Makefile.in +@@ -3456,7 +3456,6 @@ + $(LIB_SETLOCALE_NULL) \ + $(LIBICONV) \ + $(LIBINTL) \ +- $(LIBREADLINE) \ + $(LIBTEXTSTYLE) + + @ENABLE_YACC_TRUE@nodist_bin_SCRIPTS = src/yacc diff --git a/bison/all/test_package/CMakeLists.txt b/bison/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..569311b --- /dev/null +++ b/bison/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(BISON REQUIRED) + +set(BISON_VARS + BISON_FOUND + BISON_EXECUTABLE + BISON_VERSION +) + +foreach(BISON_VAR ${BISON_VARS}) + message("${BISON_VAR}: ${${BISON_VAR}}") + if(NOT ${BISON_VAR}) + message(FATAL_ERROR "${BISON_VAR} NOT FOUND") + endif() +endforeach() + +bison_target(McParser mc_parser.yy "${CMAKE_CURRENT_BINARY_DIR}/mc_parser.cpp") +add_library(${PROJECT_NAME} STATIC ${BISON_McParser_OUTPUTS}) diff --git a/bison/all/test_package/conanfile.py b/bison/all/test_package/conanfile.py new file mode 100644 index 0000000..dd177dd --- /dev/null +++ b/bison/all/test_package/conanfile.py @@ -0,0 +1,38 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.microsoft import unix_path +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + win_bash = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def layout(self): + cmake_layout(self) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows": + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _mc_parser_source(self): + return os.path.join(self.source_folder, "mc_parser.yy") + + def test(self): + self.run("bison --version") + self.run("yacc --version") + self.run(f"bison -d {unix_path(self, self._mc_parser_source)}") diff --git a/bison/all/test_package/mc_parser.yy b/bison/all/test_package/mc_parser.yy new file mode 100644 index 0000000..f09b5cc --- /dev/null +++ b/bison/all/test_package/mc_parser.yy @@ -0,0 +1,42 @@ +%{ +#include +#include +#include +#include //-- I need this for atoi +using namespace std; + +int yylex(); +int yyerror(const char *p) { cerr << "Error!" << endl; return 42; } +%} + +%union { + int val; + char sym; +}; +%token NUM +%token OPA OPM LP RP STOP +%type exp term sfactor factor res + +%% +run: res run | res /* forces bison to process many stmts */ + +res: exp STOP { cout << $1 << endl; } + +exp: exp OPA term { $$ = ($2 == '+' ? $1 + $3 : $1 - $3); } +| term { $$ = $1; } + +term: term OPM factor { $$ = ($2 == '*' ? $1 * $3 : $1 / $3); } +| sfactor { $$ = $1; } + +sfactor: OPA factor { $$ = ($1 == '+' ? $2 : -$2); } +| factor { $$ = $1; } + +factor: NUM { $$ = $1; } +| LP exp RP { $$ = $2; } + +%% +int main() +{ + yyparse(); + return 0; +} diff --git a/bison/all/test_v1_package/CMakeLists.txt b/bison/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/bison/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/bison/all/test_v1_package/conanfile.py b/bison/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..99ccbfc --- /dev/null +++ b/bison/all/test_v1_package/conanfile.py @@ -0,0 +1,31 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + test_type = "explicit" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _mc_parser_source(self): + return os.path.join(self.source_folder, os.pardir, "test_package", "mc_parser.yy") + + def test(self): + self.run("bison --version") + self.run("yacc --version", win_bash=tools.os_info.is_windows) + self.run(f"bison -d {self._mc_parser_source}") diff --git a/bison/config.yml b/bison/config.yml new file mode 100644 index 0000000..7e22e45 --- /dev/null +++ b/bison/config.yml @@ -0,0 +1,9 @@ +versions: + "3.8.2": + folder: all + "3.7.6": + folder: all + "3.7.1": + folder: all + "3.5.3": + folder: all diff --git a/boost/all/conandata.yml b/boost/all/conandata.yml new file mode 100644 index 0000000..b60976c --- /dev/null +++ b/boost/all/conandata.yml @@ -0,0 +1,373 @@ +sources: + "1.85.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.85.0/boost_1_85_0.tar.bz2" + sha256: "7009fe1faa1697476bdc7027703a2badb84e849b7b0baad5086b087b971f8617" + "1.84.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.84.0/boost_1_84_0.tar.bz2" + sha256: "cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454" + "1.83.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.bz2" + sha256: "6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e" + "1.82.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.82.0/boost_1_82_0.tar.bz2" + sha256: "a6e1ab9b0860e6a2881dd7b21fe9f737a095e5f33a3a874afc6a345228597ee6" + "1.81.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.81.0/boost_1_81_0.tar.bz2" + sha256: "71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa" + "1.80.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.80.0/boost_1_80_0.tar.bz2" + sha256: "1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0" + "1.79.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2" + sha256: "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39" + "1.78.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.78.0/boost_1_78_0.tar.bz2" + sha256: "8681f175d4bdb26c52222665793eef08490d7758529330f98d3b29dd0735bccc" + "1.77.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.77.0/boost_1_77_0.tar.bz2" + sha256: "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854" + "1.76.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2" + sha256: "f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41" + "1.75.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.75.0/boost_1_75_0.tar.bz2" + sha256: "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb" + "1.74.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.74.0/boost_1_74_0.tar.bz2" + sha256: "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1" + "1.73.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.73.0/boost_1_73_0.tar.bz2" + sha256: "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402" + "1.72.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2" + sha256: "59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722" + "1.71.0": + url: "https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2" + sha256: "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee" +patches: + "1.85.0": + - patch_file: "patches/1.82.0-locale-iconv-library-option.patch" + patch_description: "Optional flag to specify iconv from either libc of libiconv" + patch_type: "conan" + - patch_file: "patches/1.85.0-container-aliasing-violation-fix.patch" + patch_description: "Fix aliasing violation in boost::container" + patch_type: "official" + patch_source: "https://github.com/boostorg/container/commit/20ad12f20e661978e90dc7f36d8ab8ac05e5a5a9" + "1.84.0": + - patch_file: "patches/1.82.0-locale-iconv-library-option.patch" + patch_description: "Optional flag to specify iconv from either libc of libiconv" + patch_type: "conan" + - patch_file: "patches/1.84.0-reimplement-string_set-as-any-string.patch" + patch_description: "Fix compilation with cppstd=20 on libcxx platforms (e.g. MacOS)" + patch_type: "official" + patch_source: "https://github.com/boostorg/locale/commit/c5e8f02c903696a213fc4b710f6740ccd1f07f4e" + "1.83.0": + - patch_file: "patches/1.82.0-locale-iconv-library-option.patch" + patch_description: "Optional flag to specify iconv from either libc of libiconv" + patch_type: "conan" + - patch_file: "patches/1.83.0-locale-msvc.patch" + patch_description: "Fix compilation on windows when NOMINMAX is not defined" + patch_type: "official" + patch_source: "https://github.com/boostorg/locale/pull/189" + "1.82.0": + - patch_file: "patches/1.82.0-locale-iconv-library-option.patch" + patch_description: "Optional flag to specify iconv from either libc of libiconv" + patch_type: "conan" + "1.81.0": + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.81.0-locale-fail-on-missing-backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + "1.80.0": + - patch_file: "patches/1.80.0-locale-fail-on-missing-backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch" + patch_description: "Directory iterators may fail to construct for a network share on Windows prior to 10" + patch_type: "official" + patch_source: "https://github.com/boostorg/filesystem/issues/245" + - patch_file: "patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch" + patch_description: 'On Windows, weakly_canonical fails to process paths that start with the "\\?\" prefix' + patch_type: "official" + patch_source: "https://github.com/boostorg/filesystem/issues/247" + - patch_file: "patches/1.80.0-0003-unordered-valid-after-move.patch" + patch_description: "Containers are not in a valid state after moving" + patch_type: "official" + patch_source: "https://github.com/boostorg/unordered/issues/139" + - patch_file: "patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch" + patch_description: "On POSIX systems that don't support *at APIs, compilation fails due to a missing include" + patch_type: "official" + patch_source: "https://github.com/boostorg/filesystem/issues/250" + - patch_file: "patches/1.80.0-0005-config-libcpp15.patch" + patch_description: "Support for libcpp15 which removes std::unary_function and std::binary_function." + patch_type: "portability" + patch_source: "https://www.boost.org/patches/1_80_0/0005-config-libcpp15.patch" + - patch_file: "patches/1.80.0-0006-unordered-msvc-rtcc.patch" + patch_description: "Fix MSVC /RTCc build runtime failures." + patch_type: "official" + patch_source: "https://www.boost.org/patches/1_80_0/0006-unordered-msvc-rtcc.patch" + "1.79.0": + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-fiber-mingw.patch" + patch_description: "fix layout=versioned for clang@Macos + mingw@Windows" + patch_type: "conan" + - patch_file: "patches/1.79.0-0001-json-array-erase-relocate.patch" + patch_description: "json::array::erase(it) seg fault on linux" + patch_type: "official" + patch_source: "https://github.com/boostorg/json/issues/692" + - patch_file: "patches/1.79.0-smart_ptr_cw_ppc_msync.patch" + patch_description: "Use msync for PowerPC architectures" + patch_type: "portability" + - patch_file: "patches/1.79.0-geometry_no_rtti.patch" + patch_description: "Fix access specifier preventing use of experimental iterators. Allow more granular control over enabled experimental features." + patch_type: "portability" + patch_source: "https://github.com/boostorg/geometry/discussions/1041" + "1.78.0": + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-fiber-mingw.patch" + patch_description: "fix layout=versioned for clang@Macos + mingw@Windows" + patch_type: "conan" + - patch_file: "patches/1.78.0-b2-fix-install.patch" + patch_description: "Don't skip install targets if there's no in ureqs" + patch_type: "official" + patch_source: "https://github.com/boostorg/build/pull/113" + "1.77.0": + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-fiber-mingw.patch" + patch_description: "fix layout=versioned for clang@Macos + mingw@Windows" + patch_type: "conan" + - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" + "1.76.0": + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.76.0-0001-fix-include-inside-boost-namespace.patch" + patch_description: "Fix #include inside boost namespace" + patch_type: "bugfix" + patch_source: "https://github.com/boostorg/math/pull/670" + - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" + "1.75.0": + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/python_base_prefix_since_1_74.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" + "1.74.0": + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/python_base_prefix_since_1_74.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" + "1.73.0": + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/python_base_prefix.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" + "1.72.0": + - patch_file: "patches/bcp_namespace_issues_1_72.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/python_base_prefix.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/solaris_pthread_data.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/0001-revert-cease-dependence-on-range.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_log_filesystem_no_deprecated_1_72.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" + "1.71.0": + - patch_file: "patches/bcp_namespace_issues_1_71.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/python_base_prefix.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/solaris_pthread_data.patch" + patch_description: "" + patch_type: "conan" + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.69.0-contract-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" + - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" diff --git a/boost/all/conanfile.py b/boost/all/conanfile.py new file mode 100644 index 0000000..3237b40 --- /dev/null +++ b/boost/all/conanfile.py @@ -0,0 +1,2046 @@ +from conan import ConanFile +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.apple import is_apple_os, to_apple_arch, XCRun +from conan.tools.build import build_jobs, check_min_cppstd, cross_building, valid_min_cppstd, supported_cppstd +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import ( + apply_conandata_patches, chdir, collect_libs, copy, export_conandata_patches, + get, mkdir, rename, replace_in_file, rm, rmdir, save +) +from conan.tools.gnu import AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, MSBuildToolchain, msvc_runtime_flag, VCVars +from conan.tools.scm import Version + +import glob +from io import StringIO +import os +import re +import shlex +import shutil +import sys +import yaml + +required_conan_version = ">=1.53.0" + +# When adding (or removing) an option, also add this option to the list in +# `rebuild-dependencies.yml` and re-run that script. +CONFIGURE_OPTIONS = ( + "atomic", + "charconv", + "chrono", + "cobalt", + "container", + "context", + "contract", + "coroutine", + "date_time", + "exception", + "fiber", + "filesystem", + "graph", + "graph_parallel", + "iostreams", + "json", + "locale", + "log", + "math", + "mpi", + "nowide", + "program_options", + "python", + "random", + "regex", + "serialization", + "stacktrace", + "system", + "test", + "thread", + "timer", + "type_erasure", + "url", + "wave", +) + + +class BoostConan(ConanFile): + name = "boost" + description = "Boost provides free peer-reviewed portable C++ source libraries" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.boost.org" + license = "BSL-1.0" + topics = ("libraries", "cpp") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + "error_code_header_only": [True, False], + "system_no_deprecated": [True, False], + "asio_no_deprecated": [True, False], + "filesystem_no_deprecated": [True, False], + "filesystem_use_std_fs": [True, False], + "filesystem_version": [None, "3", "4"], + "layout": ["system", "versioned", "tagged", "b2-default"], + "magic_autolink": [True, False], # enables BOOST_ALL_NO_LIB + "diagnostic_definitions": [True, False], # enables BOOST_LIB_DIAGNOSTIC + "python_executable": [None, "ANY"], # system default python installation is used, if None + "python_version": [None, "ANY"], # major.minor; computed automatically, if None + "namespace": ["ANY"], # custom boost namespace for bcp, e.g. myboost + "namespace_alias": [True, False], # enable namespace alias for bcp, boost=myboost + "multithreading": [True, False], # enables multithreading support + "numa": [True, False], + "zlib": [True, False], + "bzip2": [True, False], + "lzma": [True, False], + "zstd": [True, False], + "segmented_stacks": [True, False], + "debug_level": list(range(0, 14)), + "pch": [True, False], + "extra_b2_flags": [None, "ANY"], # custom b2 flags + "i18n_backend": ["iconv", "icu", None, "deprecated"], + "i18n_backend_iconv": ["libc", "libiconv", "off"], + "i18n_backend_icu": [True, False], + "visibility": ["global", "protected", "hidden"], + "addr2line_location": ["ANY"], + "with_stacktrace_backtrace": [True, False], + "buildid": [None, "ANY"], + "python_buildid": [None, "ANY"], + "system_use_utf8": [True, False], + } + options.update({f"without_{_name}": [True, False] for _name in CONFIGURE_OPTIONS}) + + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + "error_code_header_only": False, + "system_no_deprecated": False, + "asio_no_deprecated": False, + "filesystem_no_deprecated": False, + "filesystem_use_std_fs": False, + "filesystem_version": None, + "layout": "system", + "magic_autolink": False, + "diagnostic_definitions": False, + "python_executable": None, + "python_version": None, + "namespace": "boost", + "namespace_alias": False, + "multithreading": True, + "numa": True, + "zlib": True, + "bzip2": True, + "lzma": False, + "zstd": False, + "segmented_stacks": False, + "debug_level": 0, + "pch": True, + "extra_b2_flags": None, + "i18n_backend": "deprecated", + "i18n_backend_iconv": "libc", + "i18n_backend_icu": False, + "visibility": "hidden", + "addr2line_location": "/usr/bin/addr2line", + "with_stacktrace_backtrace": True, + "buildid": None, + "python_buildid": None, + "system_use_utf8": False, + } + default_options.update({f"without_{_name}": False for _name in CONFIGURE_OPTIONS}) + default_options.update({f"without_{_name}": True for _name in ("graph_parallel", "mpi", "python")}) + + short_paths = True + no_copy_source = True + _cached_dependencies = None + + def export(self): + copy(self, f"dependencies/{self._dependency_filename}", src=self.recipe_folder, dst=self.export_folder) + + def export_sources(self): + export_conandata_patches(self) + + def _cppstd_flag(self, compiler_cppstd=None): + """Return the flag for the given C++ standard and compiler""" + # TODO: Replace it by Conan tool when available: https://github.com/conan-io/conan/issues/12603 + compiler = self.settings.get_safe("compiler") + compiler_version = self.settings.get_safe("compiler.version") + cppstd = self.settings.get_safe("compiler.cppstd") or compiler_cppstd + if not compiler or not compiler_version or not cppstd: + return "" + + def _cppstd_gcc(gcc_version, cppstd): + """Return the flag for the given C++ standard and GCC version""" + cppstd_flags = {} + cppstd_flags.setdefault("98", "98" if gcc_version >= "3.4" else None) + cppstd_flags.setdefault("11", "11" if gcc_version >= "4.7" else "0x" if gcc_version >= "4.3" else None) + cppstd_flags.setdefault("14", "14" if gcc_version >= "4.9" else "1y" if gcc_version >= "4.8" else None) + cppstd_flags.setdefault("17", "17" if gcc_version >= "5.2" else "1z" if gcc_version >= "5" else None) + cppstd_flags.setdefault("20", "2a" if gcc_version >= "8" else "20" if gcc_version >= "12" else None) + cppstd_flags.setdefault("23", "2b" if gcc_version >= "11" else None) + return cppstd_flags.get(cppstd.lstrip("gnu")) + + def _cppstd_clang(clang_version, cppstd): + """Return the flag for the given C++ standard and Clang version""" + cppstd_flags = {} + cppstd_flags.setdefault("98", "98" if clang_version >= "2.1" else None) + cppstd_flags.setdefault("11", "11" if clang_version >= "3.1" else "0x" if clang_version >= "2.1" else None) + cppstd_flags.setdefault("14", "14" if clang_version >= "3.5" else "1y" if clang_version >= "3.4" else None) + cppstd_flags.setdefault("17", "17" if clang_version >= "5" else "1z" if clang_version >= "3.5" else None) + cppstd_flags.setdefault("20", "2a" if clang_version >= "6" else "20" if clang_version >= "12" else None) + cppstd_flags.setdefault("23", "2b" if clang_version >= "13" else "23" if clang_version >= "17" else None) + return cppstd_flags.get(cppstd.lstrip("gnu")) + + + def _cppstd_apple_clang(clang_version, cppstd): + """Return the flag for the given C++ standard and Apple Clang version""" + cppstd_flags = {} + cppstd_flags.setdefault("98", "98" if clang_version >= "4.0" else None) + cppstd_flags.setdefault("11", "11" if clang_version >= "4.0" else None) + cppstd_flags.setdefault("14", "14" if clang_version >= "6.1" else "1y" if clang_version >= "5.1" else None) + cppstd_flags.setdefault("17", "17" if clang_version >= "9.1" else "1z" if clang_version >= "6.1" else None) + cppstd_flags.setdefault("20", "20" if clang_version >= "13.0" else "2a" if clang_version >= "10.0" else None) + cppstd_flags.setdefault("23", "2b" if clang_version >= "13.0" else None) + return cppstd_flags.get(cppstd.lstrip("gnu")) + + def _cppstd_msvc(visual_version, cppstd): + """Return the flag for the given C++ standard and MSVC version""" + cppstd_flags = {} + cppstd_flags.setdefault("98", "98") + cppstd_flags.setdefault("11", "11") + cppstd_flags.setdefault("14", "14" if visual_version >= "190" else None) + cppstd_flags.setdefault("17", "17" if visual_version >= "191" else "latest" if visual_version >= "190" else None) + cppstd_flags.setdefault("20", "20" if visual_version >= "192" else "latest" if visual_version >= "191" else None) + cppstd_flags.setdefault("23", "latest" if visual_version >= "193" else None) + return cppstd_flags.get(cppstd) + + func = {"gcc": _cppstd_gcc, "clang": _cppstd_clang, "apple-clang": _cppstd_apple_clang, "msvc": _cppstd_msvc}.get(compiler) + flag = cppstd + if func: + flag = func(Version(compiler_version), str(cppstd)) + return flag + + @property + def _min_compiler_version_default_cxx11(self): + """ Minimum compiler version having c++ standard >= 11 + """ + return { + "gcc": 6, + "clang": 6, + "apple-clang": 99, # still uses C++98 by default. XCode does not reflect apple-clang + "Visual Studio": 14, # guess + "msvc": 190, # guess + }.get(str(self.settings.compiler)) + + @property + def _min_compiler_version_default_cxx14(self): + """ Minimum compiler version having c++ standard >= 14 + https://gcc.gnu.org/gcc-6/changes.html + https://releases.llvm.org/6.0.0/tools/clang/docs/ReleaseNotes.html#id9 + https://learn.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=msvc-150#remarks + """ + return { + "gcc": 6, + "clang": 6, + "apple-clang": 99, # still uses C++98 by default. XCode does not reflect apple-clang + "Visual Studio": 15, # guess + "msvc": 191, # guess + }.get(str(self.settings.compiler)) + + @property + def _min_compiler_version_default_cxx20(self): + return { + "gcc": 99, + "clang": 99, + "apple-clang": 99, + "Visual Studio": 99, + "msvc": 999, + }.get(str(self.settings.compiler)) + + @property + def _has_cppstd_11_supported(self): + cppstd = self.settings.compiler.get_safe("cppstd") + if cppstd: + return valid_min_cppstd(self, 11) + compiler_version = self._min_compiler_version_default_cxx11 + if compiler_version: + return (Version(self.settings.compiler.version) >= compiler_version) or "11" in supported_cppstd(self) + + @property + def _has_cppstd_14_supported(self): + cppstd = self.settings.compiler.get_safe("cppstd") + if cppstd: + return valid_min_cppstd(self, 14) + required_compiler_version = self._min_compiler_version_default_cxx14 + if required_compiler_version: + msvc_versions = {14: 190, 15: 191, 16: 192, 17: 193} + compiler_version = Version(self.settings.compiler.version) + is_visual_studio = str(self.settings.compiler) == "Visual Studio" + # supported_cppstd only supports msvc, but not Visual Studio as compiler + supported_cxx14 = "14" in supported_cppstd(self, "msvc", msvc_versions.get(compiler_version)) if is_visual_studio else "14" in supported_cppstd(self) + # supported_cppstd: lists GCC 5 due partial support for C++14, but not enough for Boost + return (compiler_version >= required_compiler_version) and supported_cxx14 + + @property + def _has_cppstd_20_supported(self): + cppstd = self.settings.compiler.get_safe("cppstd") + if cppstd: + return valid_min_cppstd(self, 20) + required_compiler_version = self._min_compiler_version_default_cxx20 + if required_compiler_version: + msvc_versions = {14: 190, 15: 191, 16: 192, 17: 193} + compiler_version = Version(self.settings.compiler.version) + is_visual_studio = str(self.settings.compiler) == "Visual Studio" + # supported_cppstd only supports msvc, but not Visual Studio as compiler + supported_cxx20 = "20" in supported_cppstd(self, "msvc", msvc_versions.get(compiler_version)) if is_visual_studio else "20" in supported_cppstd(self) + # We still dont have a compiler using C++20 by default + return (compiler_version >= required_compiler_version) or supported_cxx20 + + @property + def _has_coroutine_supported(self): + cppstd = self.settings.compiler.get_safe("cppstd") + cppstd_20_supported = True + if cppstd: + cppstd_20_supported = valid_min_cppstd(self, 20) + # https://en.cppreference.com/w/cpp/compiler_support#cpp20 + # https://releases.llvm.org/14.0.0/tools/clang/docs/ReleaseNotes.html#clang-format: before is experimental header + # https://gcc.gnu.org/gcc-10/changes.html: requires -fcoroutines + min_compiler_versions = { + "apple-clang": "12", + "clang": "14", + "gcc": "10", + "msvc": "192", + "Visual Studio": "16",} + required_compiler_version = min_compiler_versions.get(str(self.settings.compiler)) + if not required_compiler_version: + return cppstd_20_supported + return cppstd_20_supported and Version(self.settings.compiler.version) >= required_compiler_version + + @property + def _min_compiler_version_nowide(self): + # Nowide needs c++11 + swappable std::fstream + return { + "gcc": 4.8, + "clang": 5, + "Visual Studio": 14, # guess + "msvc": 190, # guess + }.get(str(self.settings.compiler)) + + @property + def _dependency_filename(self): + return f"dependencies-{self.version}.yml" + + @property + def _dependencies(self): + if self._cached_dependencies is None: + dependencies_filepath = os.path.join(self.recipe_folder, "dependencies", self._dependency_filename) + if not os.path.isfile(dependencies_filepath): + raise ConanException(f"Cannot find {dependencies_filepath}") + with open(dependencies_filepath, encoding='utf-8') as f: + self._cached_dependencies = yaml.safe_load(f) + return self._cached_dependencies + + def _all_dependent_modules(self, name): + dependencies = {name} + while True: + new_dependencies = set() + for dependency in dependencies: + new_dependencies.update(set(self._dependencies["dependencies"][dependency])) + new_dependencies.update(dependencies) + if len(new_dependencies) > len(dependencies): + dependencies = new_dependencies + else: + break + return dependencies + + def _all_super_modules(self, name): + dependencies = {name} + while True: + new_dependencies = set(dependencies) + for module in self._dependencies["dependencies"]: + if dependencies.intersection(set(self._dependencies["dependencies"][module])): + new_dependencies.add(module) + if len(new_dependencies) > len(dependencies): + dependencies = new_dependencies + else: + break + return dependencies + + @property + def _bcp_dir(self): + return "custom-boost" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" + + @property + def _python_executable(self): + """ + obtain full path to the python interpreter executable + :return: path to the python interpreter executable, either set by option, or system default + """ + exe = self.options.python_executable if self.options.python_executable else sys.executable + return str(exe).replace("\\", "/") + + @property + def _is_windows_platform(self): + return self.settings.os in ["Windows", "WindowsStore", "WindowsCE"] + + @property + def _is_apple_embedded_platform(self): + return self.settings.os in ["iOS", "watchOS", "tvOS"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + # Test whether all config_options from the yml are available in CONFIGURE_OPTIONS + for opt_name in self._configure_options: + if f"without_{opt_name}" not in self.options: + raise ConanException(f"{self._dependency_filename} has the configure options {opt_name} which is not available in conanfile.py") + + # stacktrace_backtrace not supported on Windows + if self.settings.os == "Windows": + del self.options.with_stacktrace_backtrace + + # nowide requires a c++11-able compiler + movable std::fstream: change default to not build on compiler with too old default c++ standard or too low compiler.cppstd + # json requires a c++11-able compiler: change default to not build on compiler with too old default c++ standard or too low compiler.cppstd + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 11): + self.options.without_fiber = True + self.options.without_nowide = True + self.options.without_json = True + self.options.without_url = True + else: + version_cxx11_standard_json = self._min_compiler_version_default_cxx11 + if version_cxx11_standard_json: + if not self._has_cppstd_11_supported: + self.options.without_fiber = True + self.options.without_json = True + self.options.without_nowide = True + self.options.without_url = True + else: + self.options.without_fiber = True + self.options.without_json = True + self.options.without_nowide = True + self.options.without_url = True + if Version(self.version) >= "1.85.0" and not self._has_cppstd_14_supported: + self.options.without_math = True + + # iconv is off by default on Windows and Solaris + if self._is_windows_platform or self.settings.os == "SunOS": + self.options.i18n_backend_iconv = "off" + elif is_apple_os(self): + self.options.i18n_backend_iconv = "libiconv" + elif self.settings.os == "Android": + # bionic provides iconv since API level 28 + api_level = self.settings.get_safe("os.api_level") + if api_level and Version(api_level) < "28": + self.options.i18n_backend_iconv = "libiconv" + + # Remove options not supported by this version of boost + for dep_name in CONFIGURE_OPTIONS: + if dep_name not in self._configure_options: + delattr(self.options, f"without_{dep_name}") + + def disable_math(): + super_modules = self._all_super_modules("math") + for smod in super_modules: + try: + setattr(self.options, f"without_{smod}", True) + except ConanException: + pass + + if Version(self.version) >= "1.76.0": + # Starting from 1.76.0, Boost.Math requires a c++11 capable compiler + # ==> disable it by default for older compilers or c++ standards + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 11): + disable_math() + else: + min_compiler_version = self._min_compiler_version_default_cxx11 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++11 by default") + elif not self._has_cppstd_11_supported: + disable_math() + # Boost.Math is not built when the compiler is GCC < 5 and uses C++11 + elif self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + disable_math() + + if Version(self.version) >= "1.79.0": + # Starting from 1.79.0, Boost.Wave requires a c++11 capable compiler + # ==> disable it by default for older compilers or c++ standards + + def disable_wave(): + super_modules = self._all_super_modules("wave") + for smod in super_modules: + try: + setattr(self.options, f"without_{smod}", True) + except ConanException: + pass + + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 11): + disable_wave() + else: + min_compiler_version = self._min_compiler_version_default_cxx11 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++11 by default") + elif not self._has_cppstd_11_supported: + disable_wave() + # Boost.Wave is not built when the compiler is GCC < 5 and uses C++11 + elif self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + disable_wave() + + if Version(self.version) >= "1.81.0": + # Starting from 1.81.0, Boost.Locale requires a c++11 capable compiler + # ==> disable it by default for older compilers or c++ standards + + def disable_locale(): + super_modules = self._all_super_modules("locale") + for smod in super_modules: + try: + setattr(self.options, f"without_{smod}", True) + except ConanException: + pass + + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 11): + disable_locale() + else: + min_compiler_version = self._min_compiler_version_default_cxx11 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++11 by default") + elif not self._has_cppstd_11_supported: + disable_locale() + # Boost.Locale is not built when the compiler is GCC < 5 and uses C++11 + elif self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + disable_locale() + + if Version(self.version) >= "1.84.0": + # Starting from 1.84.0, Boost.Cobalt requires a c++20 capable compiler + # ==> disable it by default for older compilers or c++ standards + + def disable_cobalt(): + super_modules = self._all_super_modules("cobalt") + for smod in super_modules: + try: + setattr(self.options, f"without_{smod}", True) + except ConanException: + pass + + if not self._has_coroutine_supported: + disable_cobalt() + elif self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 20): + disable_cobalt() + else: + min_compiler_version = self._min_compiler_version_default_cxx20 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++20 by default") + elif Version(self.settings.compiler.version) < min_compiler_version: + disable_cobalt() + + # FIXME: Compilation errors on msvc shared build for boost.fiber https://github.com/boostorg/fiber/issues/314 + if is_msvc(self): + self.options.without_fiber = True + + if Version(self.version) >= "1.85.0": + # Starting from 1.85.0, Boost.Math requires a c++14 capable compiler + # https://github.com/boostorg/math/blob/boost-1.85.0/README.md + # ==> disable it by default for older compilers or c++ standards + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 14): + disable_math() + else: + min_compiler_version = self._min_compiler_version_default_cxx14 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++14 by default") + elif not self._has_cppstd_14_supported: + disable_math() + + + @property + def _configure_options(self): + return self._dependencies["configure_options"] + + @property + def _fPIC(self): + return self.options.get_safe("fPIC", self.default_options["fPIC"]) + + @property + def _shared(self): + return self.options.get_safe("shared", self.default_options["shared"]) + + @property + def _stacktrace_addr2line_available(self): + if (self._is_apple_embedded_platform or self.settings.get_safe("os.subsystem") == "catalyst"): + # sandboxed environment - cannot launch external processes (like addr2line), system() function is forbidden + return False + return not self.options.header_only and not self.options.without_stacktrace and self.settings.os != "Windows" + + @property + def _stacktrace_from_exception_available(self): + if Version(self.version) >= "1.85.0": + return not self.options.header_only and not self.options.without_stacktrace and self.settings.os != "Windows" + + def configure(self): + if self.options.header_only: + self.options.rm_safe("shared") + self.options.rm_safe("fPIC") + elif self.options.shared: + self.options.rm_safe("fPIC") + + if self.options.i18n_backend != "deprecated": + self.output.warning("i18n_backend option is deprecated, do not use anymore.") + if self.options.i18n_backend == "iconv": + self.options.i18n_backend_iconv = "libiconv" + self.options.i18n_backend_icu = False + if self.options.i18n_backend == "icu": + self.options.i18n_backend_iconv = "off" + self.options.i18n_backend_icu = True + if self.options.i18n_backend == "None": + self.options.i18n_backend_iconv = "off" + self.options.i18n_backend_icu = False + if self.options.without_locale: + self.options.rm_safe("i18n_backend_iconv") + self.options.rm_safe("i18n_backend_icu") + + if not self.options.without_python: + if not self.options.python_version: + self.options.python_version = self._detect_python_version() + self.options.python_executable = self._python_executable + else: + self.options.rm_safe("python_buildid") + + if not self._stacktrace_addr2line_available: + self.options.rm_safe("addr2line_location") + + if self.options.get_safe("without_stacktrace", True): + self.options.rm_safe("with_stacktrace_backtrace") + + if self.options.layout == "b2-default": + self.options.layout = "versioned" if self.settings.os == "Windows" else "system" + + if self.options.without_fiber: + self.options.rm_safe("numa") + + # Use verbosity from [conf] if specified + verbosity = self.conf.get("tools.build:verbosity", default="quiet") + if verbosity == "verbose" and int(self.options.debug_level) < 2: + self.options.debug_level.value = 2 + + def layout(self): + basic_layout(self, src_folder="src") + + @property + def _cxx11_boost_libraries(self): + libraries = ["fiber", "json", "nowide", "url"] + if Version(self.version) >= "1.76.0": + libraries.append("math") + if Version(self.version) >= "1.79.0": + libraries.append("wave") + if Version(self.version) >= "1.81.0": + libraries.append("locale") + if Version(self.version) >= "1.84.0": + libraries.append("atomic") + libraries.append("filesystem") + libraries.append("log") + libraries.append("random") + libraries.append("stacktrace") + libraries.append("test") + libraries.append("thread") + if Version(self.version) >= "1.85.0": + libraries.append("system") + libraries.sort() + return list(filter(lambda library: f"without_{library}" in self.options, libraries)) + + @property + def _cxx14_boost_libraries(self): + libraries = [] + if Version(self.version) >= "1.85.0": + # https://github.com/boostorg/math/blob/develop/README.md#boost-math-library + libraries.append("math") + libraries.sort() + return list(filter(lambda library: f"without_{library}" in self.options, libraries)) + + @property + def _cxx20_boost_libraries(self): + libraries = [] + if Version(self.version) >= "1.84.0": + # https://github.com/boostorg/cobalt/blob/boost-1.84.0/build/Jamfile#L54 + libraries.append("cobalt") + libraries.sort() + return list(filter(lambda library: f"without_{library}" in self.options, libraries)) + + def validate(self): + if not self.options.multithreading: + # * For the reason 'thread' is deactivate look at https://stackoverflow.com/a/20991533 + # Look also on the comments of the answer for more details + # * Although the 'context' and 'atomic' library does not mention anything about threading, + # when being build the compiler uses the -pthread flag, which makes it quite dangerous + for lib in ["locale", "coroutine", "wave", "type_erasure", "fiber", "thread", "context", "atomic"]: + if not self.options.get_safe(f"without_{lib}"): + raise ConanInvalidConfiguration(f"Boost '{lib}' library requires multi threading") + + if is_msvc(self) and self._shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Boost can not be built as shared library with MT runtime.") + + # FIXME: In 1.84.0, there are compilation errors on msvc shared build for boost.fiber. https://github.com/boostorg/fiber/issues/314 + if Version(self.version) >= "1.84.0" and is_msvc(self) and self._shared and not self.options.without_fiber: + raise ConanInvalidConfiguration("Boost.fiber can not be built as shared library on MSVC.") + + if not self.options.without_locale and self.options.i18n_backend_iconv == "off" and \ + not self.options.i18n_backend_icu and not self._is_windows_platform: + raise ConanInvalidConfiguration( + "Boost.Locale library needs either iconv or ICU library to be built on non windows platforms" + ) + + if self._stacktrace_addr2line_available: + if not os.path.isabs(str(self.options.addr2line_location)): + raise ConanInvalidConfiguration("addr2line_location must be an absolute path to addr2line") + + # Check, when a boost module is enabled, whether the boost modules it depends on are enabled as well. + for mod_name, mod_deps in self._dependencies["dependencies"].items(): + if not self.options.get_safe(f"without_{mod_name}", True): + for mod_dep in mod_deps: + if self.options.get_safe(f"without_{mod_dep}", False): + raise ConanInvalidConfiguration(f"{mod_name} requires {mod_deps}: {mod_dep} is disabled") + + if not self.options.get_safe("without_nowide", True): + # nowide require a c++11-able compiler with movable std::fstream + mincompiler_version = self._min_compiler_version_nowide + if mincompiler_version and Version(self.settings.compiler.version) < mincompiler_version: + raise ConanInvalidConfiguration("This compiler is too old to build Boost.nowide.") + + for cxx_standard, boost_libraries, has_cppstd_supported in [ + (11, self._cxx11_boost_libraries, self._has_cppstd_11_supported), + (14, self._cxx14_boost_libraries, self._has_cppstd_14_supported), + (20, self._cxx20_boost_libraries, self._has_cppstd_20_supported)]: + if any([not self.options.get_safe(f"without_{library}", True) for library in boost_libraries]): + if (self.settings.compiler.get_safe("cppstd") and not valid_min_cppstd(self, cxx_standard)) or \ + not has_cppstd_supported: + raise ConanInvalidConfiguration( + f"Boost libraries {', '.join(boost_libraries)} requires a C++{cxx_standard} compiler. " + "Please, set compiler.cppstd or use a newer compiler version or disable from building." + ) + if not self.options.get_safe("without_cobalt", True) and not self._has_coroutine_supported: + raise ConanInvalidConfiguration("Boost.Cobalt requires a C++20 capable compiler. " + "Please, set compiler.cppstd and use a newer compiler version, or disable from building.") + + def _with_dependency(self, dependency): + """ + Return true when dependency is required according to the dependencies-x.y.z.yml file + """ + for name, reqs in self._dependencies["requirements"].items(): + if dependency in reqs: + if not self.options.get_safe(f"without_{name}", True): + return True + return False + + @property + def _with_zlib(self): + return not self.options.header_only and self._with_dependency("zlib") and self.options.zlib + + @property + def _with_bzip2(self): + return not self.options.header_only and self._with_dependency("bzip2") and self.options.bzip2 + + @property + def _with_lzma(self): + return not self.options.header_only and self._with_dependency("lzma") and self.options.lzma + + @property + def _with_zstd(self): + return not self.options.header_only and self._with_dependency("zstd") and self.options.zstd + + @property + def _with_icu(self): + return not self.options.header_only and self._with_dependency("icu") and self.options.get_safe("i18n_backend_icu") + + @property + def _with_iconv(self): + return not self.options.header_only and self._with_dependency("iconv") and self.options.get_safe("i18n_backend_iconv") == "libiconv" + + @property + def _with_stacktrace_backtrace(self): + return not self.options.header_only and self.options.get_safe("with_stacktrace_backtrace", False) + + def requirements(self): + if self._with_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self._with_bzip2: + self.requires("bzip2/1.0.8") + if self._with_lzma: + self.requires("xz_utils/5.4.4") + if self._with_zstd: + self.requires("zstd/1.5.5") + if self._with_stacktrace_backtrace: + self.requires("libbacktrace/cci.20210118", transitive_headers=True, transitive_libs=True) + + if self._with_icu: + self.requires("icu/73.2") + if self._with_iconv: + self.requires("libiconv/1.17") + + def package_id(self): + del self.info.options.i18n_backend + + if self.info.options.header_only: + self.info.clear() + else: + del self.info.options.debug_level + del self.info.options.filesystem_version + del self.info.options.pch + del self.info.options.python_executable # PATH to the interpreter is not important, only version matters + if self.info.options.without_python: + del self.info.options.python_version + + def build_requirements(self): + if not self.options.header_only: + self.tool_requires("b2/[>=5.2 <6]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + apply_conandata_patches(self) + + def generate(self): + if not self.options.header_only: + env = VirtualBuildEnv(self) + env.generate() + vc = VCVars(self) + vc.generate() + + ##################### BUILDING METHODS ########################### + + def _run_python_script(self, script): + """ + execute python one-liner script and return its output + :param script: string containing python script to be executed + :return: output of the python script execution, or None, if script has failed + """ + output = StringIO() + command = f'"{self._python_executable}" -c "{script}"' + self.output.info(f"running {command}") + try: + self.run(command, output, scope="run") + except ConanException: + self.output.info("(failed)") + return None + output = output.getvalue() + # Conan is broken when run_to_output = True + if "\n-----------------\n" in output: + output = output.split("\n-----------------\n", 1)[1] + output = output.strip() + return output if output != "None" else None + + def _get_python_path(self, name): + """ + obtain path entry for the python installation + :param name: name of the python config entry for path to be queried (such as "include", "platinclude", etc.) + :return: path entry from the sysconfig + """ + # https://docs.python.org/3/library/sysconfig.html + # https://docs.python.org/2.7/library/sysconfig.html + return self._run_python_script("from __future__ import print_function; " + "import sysconfig; " + f"print(sysconfig.get_path('{name}'))") + + def _get_python_sc_var(self, name): + """ + obtain value of python sysconfig variable + :param name: name of variable to be queried (such as LIBRARY or LDLIBRARY) + :return: value of python sysconfig variable + """ + return self._run_python_script("from __future__ import print_function; " + "import sysconfig; " + f"print(sysconfig.get_config_var('{name}'))") + + def _get_python_du_var(self, name): + """ + obtain value of python distutils sysconfig variable + (sometimes sysconfig returns empty values, while python.sysconfig provides correct values) + :param name: name of variable to be queried (such as LIBRARY or LDLIBRARY) + :return: value of python sysconfig variable + """ + return self._run_python_script("from __future__ import print_function; " + "import distutils.sysconfig as du_sysconfig; " + f"print(du_sysconfig.get_config_var('{name}'))") + + def _get_python_var(self, name): + """ + obtain value of python variable, either by sysconfig, or by distutils.sysconfig + :param name: name of variable to be queried (such as LIBRARY or LDLIBRARY) + :return: value of python sysconfig variable + + NOTE: distutils is deprecated and breaks the recipe since Python 3.10 + """ + python_version_parts = str(self.info.options.python_version).split('.') + python_major = int(python_version_parts[0]) + python_minor = int(python_version_parts[1]) + if(python_major >= 3 and python_minor >= 10): + return self._get_python_sc_var(name) + + return self._get_python_sc_var(name) or self._get_python_du_var(name) + + def _detect_python_version(self): + """ + obtain version of python interpreter + :return: python interpreter version, in format major.minor + """ + return self._run_python_script("from __future__ import print_function; " + "import sys; " + "print('{}.{}'.format(sys.version_info[0], sys.version_info[1]))") + + @property + def _python_version(self): + version = self._detect_python_version() + if self.options.python_version and version != self.options.python_version: + raise ConanInvalidConfiguration(f"detected python version {version} doesn't match conan option {self.options.python_version}") + return version + + @property + def _python_inc(self): + """ + obtain the result of the "sysconfig.get_python_inc()" call + :return: result of the "sysconfig.get_python_inc()" execution + """ + return self._run_python_script("from __future__ import print_function; " + "import sysconfig; " + "print(sysconfig.get_python_inc())") + + @property + def _python_abiflags(self): + """ + obtain python ABI flags, see https://www.python.org/dev/peps/pep-3149/ for the details + :return: the value of python ABI flags + """ + return self._run_python_script("from __future__ import print_function; " + "import sys; " + "print(getattr(sys, 'abiflags', ''))") + + @property + def _python_includes(self): + """ + attempt to find directory containing Python.h header file + :return: the directory with python includes + """ + include = self._get_python_path("include") + plat_include = self._get_python_path("platinclude") + include_py = self._get_python_var("INCLUDEPY") + include_dir = self._get_python_var("INCLUDEDIR") + python_inc = self._python_inc + + candidates = [include, + plat_include, + include_py, + include_dir, + python_inc] + for candidate in candidates: + if candidate: + python_h = os.path.join(candidate, 'Python.h') + self.output.info(f"checking {python_h}") + if os.path.isfile(python_h): + self.output.info(f"found Python.h: {python_h}") + return candidate.replace("\\", "/") + raise Exception("couldn't locate Python.h - make sure you have installed python development files") + + @property + def _python_library_dir(self): + """ + attempt to find python development library + :return: the full path to the python library to be linked with + """ + library = self._get_python_var("LIBRARY") + ldlibrary = self._get_python_var("LDLIBRARY") + libdir = self._get_python_var("LIBDIR") + multiarch = self._get_python_var("MULTIARCH") + masd = self._get_python_var("multiarchsubdir") + with_dyld = self._get_python_var("WITH_DYLD") + if libdir and multiarch and masd and not libdir.endswith(masd): + if masd.startswith(os.sep): + masd = masd[len(os.sep):] + self.output.warning(f"Python libdir candidate thingy: {libdir}") + libdir = os.path.join(libdir, masd) + + if not libdir: + libdest = self._get_python_var("LIBDEST") + libdir = os.path.join(os.path.dirname(libdest), "libs") + + candidates = [ldlibrary, library] + library_prefixes = [""] if is_msvc(self) else ["", "lib"] + library_suffixes = [".lib"] if is_msvc(self) else [".so", ".dll.a", ".a"] + if with_dyld: + library_suffixes.insert(0, ".dylib") + + python_version = self._python_version + python_version_no_dot = python_version.replace(".", "") + versions = ["", python_version, python_version_no_dot] + abiflags = self._python_abiflags + + for prefix in library_prefixes: + for suffix in library_suffixes: + for version in versions: + candidates.append(f"{prefix}python{version}{abiflags}{suffix}") + + for candidate in candidates: + if candidate: + python_lib = os.path.join(libdir, candidate) + self.output.info(f"checking {python_lib}") + if os.path.isfile(python_lib): + self.output.info(f"found python library: {python_lib}") + return libdir.replace("\\", "/") + raise ConanInvalidConfiguration("couldn't locate python libraries - make sure you have installed python development files") + + def _clean(self): + clean_dirs = [ + os.path.join(self.build_folder, "bin.v2"), + os.path.join(self.build_folder, "architecture"), + os.path.join(self.source_folder, self._bcp_dir), + os.path.join(self.source_folder, "dist", "bin"), + os.path.join(self.source_folder, "stage"), + os.path.join(self.source_folder, "tools", "build", "src", "engine", "bootstrap"), + os.path.join(self.source_folder, "tools", "build", "src", "engine", "bin.ntx86"), + os.path.join(self.source_folder, "tools", "build", "src", "engine", "bin.ntx86_64"), + ] + for d in clean_dirs: + if os.path.isdir(d): + self.output.warning(f"removing '{d}'") + shutil.rmtree(d) + + @property + def _b2_exe(self): + return "b2" + + @property + def _bcp_exe(self): + folder = os.path.join(self.source_folder, "dist", "bin") + return os.path.join(folder, "bcp") + + @property + def _use_bcp(self): + return self.options.namespace != "boost" + + @property + def _boost_build_dir(self): + return os.path.join(self.source_folder, "tools", "build") + + def _build_bcp(self): + folder = os.path.join(self.source_folder, "tools", "bcp") + with chdir(self, folder): + command = f"{self._b2_exe} -j{build_jobs(self)} --abbreviate-paths toolset={self._toolset}" + command += f" -d{self.options.debug_level}" + self.output.warning(command) + self.run(command) + + def _run_bcp(self): + with chdir(self, self.source_folder): + mkdir(self, self._bcp_dir) + namespace = f"--namespace={self.options.namespace}" + alias = "--namespace-alias" if self.options.namespace_alias else "" + boostdir = f"--boost={self.source_folder}" + libraries = {"build", "boost-build.jam", "boostcpp.jam", "boost_install", "headers"} + for d in os.listdir(os.path.join(self.source_folder, "boost")): + if os.path.isdir(os.path.join(self.source_folder, "boost", d)): + libraries.add(d) + for d in os.listdir(os.path.join(self.source_folder, "libs")): + if os.path.isdir(os.path.join(self.source_folder, "libs", d)): + libraries.add(d) + libraries = " ".join(libraries) + command = f"{self._bcp_exe} {namespace} {alias} {boostdir} {libraries} {self._bcp_dir}" + self.output.warning(command) + self.run(command) + + def build(self): + stacktrace_jamfile = os.path.join(self.source_folder, "libs", "stacktrace", "build", "Jamfile.v2") + if cross_building(self, skip_x64_x86=True): + # When cross building, do not attempt to run the test-executable (assume they work) + replace_in_file(self, stacktrace_jamfile, "$(>) > $(<)", "echo \"\" > $(<)", strict=False) + if self._with_stacktrace_backtrace and self.settings.os != "Windows" and not cross_building(self): + # When libbacktrace is shared, give extra help to the test-executable + linker_var = "DYLD_LIBRARY_PATH" if self.settings.os == "Macos" else "LD_LIBRARY_PATH" + libbacktrace_libdir = self.dependencies["libbacktrace"].cpp_info.aggregated_components().libdirs[0] + patched_run_rule = f"{linker_var}={libbacktrace_libdir} $(>) > $(<)" + replace_in_file(self, stacktrace_jamfile, "$(>) > $(<)", patched_run_rule, strict=False) + if self.dependencies["libbacktrace"].options.shared: + replace_in_file(self, stacktrace_jamfile, "static", "shared", strict=False) + + # Older clang releases require a thread_local variable to be initialized by a constant value + replace_in_file(self, os.path.join(self.source_folder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + "/* thread_local */", "thread_local", strict=False) + replace_in_file(self, os.path.join(self.source_folder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + "/* static __thread */", "static __thread", strict=False) + if self.settings.compiler == "apple-clang" or (self.settings.compiler == "clang" and Version(self.settings.compiler.version) < 6): + replace_in_file(self, os.path.join(self.source_folder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + "thread_local", "/* thread_local */") + replace_in_file(self, os.path.join(self.source_folder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + "static __thread", "/* static __thread */") + replace_in_file(self, os.path.join(self.source_folder, "tools", "build", "src", "tools", "gcc.jam"), + "local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;", + "local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux iphone appletv ] ;", + strict=False) + replace_in_file(self, os.path.join(self.source_folder, "tools", "build", "src", "tools", "gcc.jam"), + "local no-threading = android beos haiku sgi darwin vxworks ;", + "local no-threading = android beos haiku sgi darwin vxworks iphone appletv ;", + strict=False) + replace_in_file(self, os.path.join(self.source_folder, "libs", "fiber", "build", "Jamfile.v2"), + " @numa", + " shared:.//boost_fiber : @numa", + strict=False) + if self.settings.os == "Android": + # force versionless soname from boostorg/boost#206 + # this can be applied to all versions and it's easier with a replace + replace_in_file(self, os.path.join(self.source_folder, "boostcpp.jam"), + "! [ $(property-set).get ] in windows cygwin darwin aix &&", + "! [ $(property-set).get ] in windows cygwin darwin aix android &&", + strict=False) + + if self.options.header_only: + self.output.warning("Header only package, skipping build") + return + + self._clean() + + if self._use_bcp: + self._build_bcp() + self._run_bcp() + + self._create_user_config_jam(self._boost_build_dir) + + # JOIN ALL FLAGS + b2_flags = " ".join(self._build_flags) + full_command = f"{self._b2_exe} {b2_flags}" + # -d2 is to print more debug info and avoid travis timing out without output + sources = os.path.join(self.source_folder, self._bcp_dir) if self._use_bcp else self.source_folder + full_command += f' --debug-configuration --build-dir="{self.build_folder}"' + self.output.warning(full_command) + + # If sending a user-specified toolset to B2, setting the vcvars + # interferes with the compiler selection. + with chdir(self, sources): + # To show the libraries *1 + # self.run("%s --show-libraries" % b2_exe) + self.run(full_command) + + @property + def _b2_os(self): + return { + "Windows": "windows", + "WindowsStore": "windows", + "Linux": "linux", + "Android": "android", + "Macos": "darwin", + "iOS": "iphone", + "watchOS": "iphone", + "tvOS": "appletv", + "FreeBSD": "freebsd", + "SunOS": "solaris", + }.get(str(self.settings.os)) + + @property + def _b2_address_model(self): + if self.settings.arch in ("x86_64", "ppc64", "ppc64le", "mips64", "armv8", "armv8.3", "sparcv9"): + return "64" + + return "32" + + @property + def _b2_binary_format(self): + return { + "Windows": "pe", + "WindowsStore": "pe", + "Linux": "elf", + "Android": "elf", + "Macos": "mach-o", + "iOS": "mach-o", + "watchOS": "mach-o", + "tvOS": "mach-o", + "FreeBSD": "elf", + "SunOS": "elf", + }.get(str(self.settings.os)) + + @property + def _b2_architecture(self): + if str(self.settings.arch).startswith("x86"): + return "x86" + if str(self.settings.arch).startswith("ppc"): + return "power" + if str(self.settings.arch).startswith("arm"): + return "arm" + if str(self.settings.arch).startswith("sparc"): + return "sparc" + if str(self.settings.arch).startswith("mips64"): + return "mips64" + if str(self.settings.arch).startswith("mips"): + return "mips1" + if str(self.settings.arch).startswith("s390"): + return "s390x" + + return None + + @property + def _b2_abi(self): + if str(self.settings.arch).startswith("x86"): + return "ms" if str(self.settings.os) in ["Windows", "WindowsStore"] else "sysv" + if str(self.settings.arch).startswith("ppc"): + return "sysv" + if str(self.settings.arch).startswith("arm"): + return "aapcs" + if str(self.settings.arch).startswith("mips"): + return "o32" + + return None + + @property + def _gnu_cxx11_abi(self): + """Checks libcxx setting and returns value for the GNU C++11 ABI flag + _GLIBCXX_USE_CXX11_ABI= . Returns None if C++ library cannot be + determined. + """ + try: + if str(self.settings.compiler.libcxx) == "libstdc++": + return "0" + if str(self.settings.compiler.libcxx) == "libstdc++11": + return "1" + except ConanException: + pass + return None + + @property + def _build_flags(self): + flags = self._build_cross_flags + + # Stop at the first error. No need to continue building. + flags.append("-q") + + if self.options.get_safe("numa"): + flags.append("numa=on") + + # https://www.boost.org/doc/libs/1_70_0/libs/context/doc/html/context/architectures.html + if not self._is_apple_embedded_platform and self._b2_os: + flags.append(f"target-os={self._b2_os}") + if self._b2_architecture: + flags.append(f"architecture={self._b2_architecture}") + if self._b2_address_model: + flags.append(f"address-model={self._b2_address_model}") + if self._b2_binary_format: + flags.append(f"binary-format={self._b2_binary_format}") + if self._b2_abi: + flags.append(f"abi={self._b2_abi}") + + flags.append(f"--layout={self.options.layout}") + flags.append(f"--user-config={os.path.join(self._boost_build_dir, 'user-config.jam')}") + flags.append(f"-sNO_ZLIB={'0' if self._with_zlib else '1'}") + flags.append(f"-sNO_BZIP2={'0' if self._with_bzip2 else '1'}") + flags.append(f"-sNO_LZMA={'0' if self._with_lzma else '1'}") + flags.append(f"-sNO_ZSTD={'0' if self._with_zstd else '1'}") + + if self.options.get_safe("i18n_backend_icu"): + flags.append("boost.locale.icu=on") + else: + flags.append("boost.locale.icu=off") + flags.append("--disable-icu") + if self.options.get_safe("i18n_backend_iconv") in ["libc", "libiconv"]: + flags.append("boost.locale.iconv=on") + if self.options.get_safe("i18n_backend_iconv") == "libc": + flags.append("boost.locale.iconv.lib=libc") + else: + flags.append("boost.locale.iconv.lib=libiconv") + else: + flags.append("boost.locale.iconv=off") + flags.append("--disable-iconv") + + def add_defines(library): + for define in self.dependencies[library].cpp_info.aggregated_components().defines: + flags.append(f"define={define}") + + if self._with_zlib: + add_defines("zlib") + if self._with_bzip2: + add_defines("bzip2") + if self._with_lzma: + add_defines("xz_utils") + if self._with_zstd: + add_defines("zstd") + + for define in self.conf.get("tools.build:defines", default=[], check_type=list): + flags.append(f"define={define}") + + if is_msvc(self): + flags.append(f"runtime-link={'static' if is_msvc_static_runtime(self) else 'shared'}") + flags.append(f"runtime-debugging={'on' if 'd' in msvc_runtime_flag(self) else 'off'}") + + # For details https://boostorg.github.io/build/manual/master/index.html + flags.append(f"threading={'single' if not self.options.multithreading else 'multi'}") + flags.append(f"visibility={self.options.visibility}") + + flags.append(f"link={'shared' if self._shared else 'static'}") + if self.settings.build_type == "Debug": + flags.append("variant=debug") + else: + flags.append("variant=release") + + for libname in self._configure_options: + if not getattr(self.options, f"without_{libname}"): + flags.append(f"--with-{libname}") + + flags.append(f"toolset={self._toolset}") + + safe_cppstd = self.settings.get_safe("compiler.cppstd") + if safe_cppstd: + cppstd_version = self._cppstd_flag(safe_cppstd) + flags.append(f"cxxstd={cppstd_version}") + if "gnu" in safe_cppstd: + flags.append("cxxstd-dialect=gnu") + elif Version(self.version) >= "1.85.0" and self._has_cppstd_14_supported: + cppstd_version = self._cppstd_flag("14") + flags.append(f"cxxstd={cppstd_version}") + elif self._has_cppstd_11_supported: + cppstd_version = self._cppstd_flag("11") + flags.append(f"cxxstd={cppstd_version}") + + # LDFLAGS + link_flags = [] + + # CXX FLAGS + cxx_flags = [] + # fPIC DEFINITION + if self._fPIC: + cxx_flags.append("-fPIC") + if self.settings.build_type == "RelWithDebInfo": + if self.settings.compiler == "gcc" or "clang" in str(self.settings.compiler): + cxx_flags.append("-g") + elif is_msvc(self): + cxx_flags.append("/Z7") + + # Standalone toolchain fails when declare the std lib + if self.settings.os not in ("Android", "Emscripten"): + try: + if self._gnu_cxx11_abi: + flags.append(f"define=_GLIBCXX_USE_CXX11_ABI={self._gnu_cxx11_abi}") + + if self.settings.compiler in ("clang", "apple-clang"): + libcxx = { + "libstdc++11": "libstdc++", + }.get(str(self.settings.compiler.libcxx), str(self.settings.compiler.libcxx)) + cxx_flags.append(f"-stdlib={libcxx}") + link_flags.append(f"-stdlib={libcxx}") + except ConanException: + pass + + if self.options.error_code_header_only: + flags.append("define=BOOST_ERROR_CODE_HEADER_ONLY=1") + if self.options.system_no_deprecated: + flags.append("define=BOOST_SYSTEM_NO_DEPRECATED=1") + if self.options.asio_no_deprecated: + flags.append("define=BOOST_ASIO_NO_DEPRECATED=1") + if self.options.filesystem_no_deprecated: + flags.append("define=BOOST_FILESYSTEM_NO_DEPRECATED=1") + if self.options.filesystem_use_std_fs: + flags.append("define=BOOST_DLL_USE_STD_FS=1") + if self.options.system_use_utf8: + flags.append("define=BOOST_SYSTEM_USE_UTF8=1") + if self.options.segmented_stacks: + flags.extend(["segmented-stacks=on", + "define=BOOST_USE_SEGMENTED_STACKS=1", + "define=BOOST_USE_UCONTEXT=1"]) + flags.append("pch=on" if self.options.pch else "pch=off") + + if is_apple_os(self): + apple_min_version_flag = AutotoolsToolchain(self).apple_min_version_flag + if apple_min_version_flag: + cxx_flags.append(apple_min_version_flag) + link_flags.append(apple_min_version_flag) + os_subsystem = self.settings.get_safe("os.subsystem") + if os_subsystem == "catalyst": + cxx_flags.append("--target=arm64-apple-ios-macabi") + link_flags.append("--target=arm64-apple-ios-macabi") + + if self.settings.os == "iOS": + if self.options.multithreading: + cxx_flags.append("-DBOOST_SP_USE_SPINLOCK") + + if self.conf.get("tools.apple:enable_bitcode", check_type=bool): + cxx_flags.append("-fembed-bitcode") + if self._with_stacktrace_backtrace: + flags.append(f"-sLIBBACKTRACE_PATH={self.dependencies['libbacktrace'].package_folder}") + if self._stacktrace_from_exception_available and "x86" not in str(self.settings.arch): + # https://github.com/boostorg/stacktrace/blob/boost-1.85.0/src/from_exception.cpp#L29 + # This feature is guarded by BOOST_STACKTRACE_ALWAYS_STORE_IN_PADDING, but that is only enabled on x86. + flags.append("define=BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK=1") + if self._with_iconv: + flags.append(f"-sICONV_PATH={self.dependencies['libiconv'].package_folder}") + if self._with_icu: + flags.append(f"-sICU_PATH={self.dependencies['icu'].package_folder}") + if not self.dependencies["icu"].options.shared: + # Using ICU_OPTS to pass ICU system libraries is not possible due to Boost.Regex disallowing it. + icu_system_libs = self.dependencies["icu"].cpp_info.aggregated_components().system_libs + if is_msvc(self): + icu_ldflags = " ".join(f"{l}.lib" for l in icu_system_libs) + else: + icu_ldflags = " ".join(f"-l{l}" for l in icu_system_libs) + link_flags.append(icu_ldflags) + + link_flags = f'linkflags="{" ".join(link_flags)}"' + flags.append(link_flags) + + if self.options.get_safe("addr2line_location"): + cxx_flags.append(f"-DBOOST_STACKTRACE_ADDR2LINE_LOCATION={self.options.addr2line_location}") + + if not self.options.get_safe('without_cobalt', True) and \ + (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "10"): + cxx_flags.append("-fcoroutines") + + cxx_flags = f'cxxflags="{" ".join(cxx_flags)}"' + flags.append(cxx_flags) + + if self.options.buildid: + flags.append(f"--buildid={self.options.buildid}") + if not self.options.without_python and self.options.python_buildid: + flags.append(f"--python-buildid={self.options.python_buildid}") + + if self.options.extra_b2_flags: + flags.extend(shlex.split(str(self.options.extra_b2_flags))) + + flags.extend([ + "install", + f"--prefix={self.package_folder}", + f"-j{build_jobs(self)}", + "--abbreviate-paths", + f"-d{self.options.debug_level}", + ]) + return flags + + @property + def _build_cross_flags(self): + flags = [] + if not cross_building(self): + return flags + arch = self.settings.get_safe("arch") + self.output.info("Cross building, detecting compiler...") + + if arch.startswith("arm"): + if "hf" in arch: + flags.append("-mfloat-abi=hard") + elif self.settings.os == "Emscripten": + pass + elif arch in ["x86", "x86_64"]: + pass + elif arch.startswith("ppc"): + pass + elif arch.startswith("mips"): + pass + else: + self.output.warning(f"Unable to detect the appropriate ABI for {arch} architecture.") + self.output.info(f"Cross building flags: {flags}") + + return flags + + @property + def _ar(self): + ar = VirtualBuildEnv(self).vars().get("AR") + if ar: + return ar + if is_apple_os(self) and self.settings.compiler == "apple-clang": + return XCRun(self).ar + return None + + @property + def _ranlib(self): + ranlib = VirtualBuildEnv(self).vars().get("RANLIB") + if ranlib: + return ranlib + if is_apple_os(self) and self.settings.compiler == "apple-clang": + return XCRun(self).ranlib + return None + + @property + def _cxx(self): + compilers_by_conf = self.conf.get("tools.build:compiler_executables", default={}, check_type=dict) + cxx = compilers_by_conf.get("cpp") or VirtualBuildEnv(self).vars().get("CXX") + if cxx: + return cxx + if is_apple_os(self) and self.settings.compiler == "apple-clang": + return XCRun(self).cxx + compiler_version = str(self.settings.compiler.version) + major = compiler_version.split(".", maxsplit=1)[0] + if self.settings.compiler == "gcc": + return shutil.which(f"g++-{compiler_version}") or shutil.which(f"g++-{major}") or shutil.which("g++") or "" + if self.settings.compiler == "clang": + return shutil.which(f"clang++-{compiler_version}") or shutil.which(f"clang++-{major}") or shutil.which("clang++") or "" + return "" + + def _create_user_config_jam(self, folder): + self.output.warning("Patching user-config.jam") + + def create_library_config(deps_name, name): + aggregated_cpp_info = self.dependencies[deps_name].cpp_info.aggregated_components() + if len(aggregated_cpp_info.libs) == 0: + return "" + + includedir = aggregated_cpp_info.includedirs[0].replace("\\", "/") + includedir = f"\"{includedir}\"" + libdir = aggregated_cpp_info.libdirs[0].replace("\\", "/") + libdir = f"\"{libdir}\"" + lib = aggregated_cpp_info.libs[0] + version = self.dependencies[deps_name].ref.version + return f"\nusing {name} : {version} : " \ + f"{includedir} " \ + f"{libdir} " \ + f"{lib} ;" + + contents = "" + + if self._with_zlib: + contents += create_library_config("zlib", "zlib") + if self._with_bzip2: + contents += create_library_config("bzip2", "bzip2") + if self._with_lzma: + contents += create_library_config("xz_utils", "lzma") + if self._with_zstd: + contents += create_library_config("zstd", "zstd") + + if not self.options.without_python: + # https://www.boost.org/doc/libs/1_70_0/libs/python/doc/html/building/configuring_boost_build.html + contents += f'\nusing python : {self._python_version} : "{self._python_executable}" : "{self._python_includes}" : "{self._python_library_dir}" ;' + + if not self.options.without_mpi: + # https://www.boost.org/doc/libs/1_72_0/doc/html/mpi/getting_started.html + contents += "\nusing mpi ;" + + # Specify here the toolset with the binary if present if don't empty parameter : + contents += f'\nusing "{self._toolset}" : {self._toolset_version} : ' + + cxx_fwd_slahes = self._cxx.replace("\\", "/") + if cxx_fwd_slahes: + contents += f" \"{cxx_fwd_slahes}\"" + + if is_apple_os(self): + if self.settings.compiler == "apple-clang": + contents += f" -isysroot {XCRun(self).sdk_path}" + if self.settings.get_safe("arch"): + contents += f" -arch {to_apple_arch(self)}" + + contents += " : \n" + if self._ar: + ar_path = self._ar.replace("\\", "/") + contents += f'"{ar_path}" ' + if self._ranlib: + ranlib_path = self._ranlib.replace("\\", "/") + contents += f'"{ranlib_path}" ' + cxxflags = " ".join(self.conf.get("tools.build:cxxflags", default=[], check_type=list)) + " " + cflags = " ".join(self.conf.get("tools.build:cflags", default=[], check_type=list)) + " " + buildenv_vars = VirtualBuildEnv(self).vars() + cppflags = buildenv_vars.get("CPPFLAGS", "") + " " + ldflags = " ".join(self.conf.get("tools.build:sharedlinkflags", default=[], check_type=list)) + " " + asflags = buildenv_vars.get("ASFLAGS", "") + " " + + sysroot = self.conf.get("tools.build:sysroot") + if sysroot and not is_msvc(self): + sysroot = sysroot.replace("\\", "/") + sysroot = f'"{sysroot}"' if ' ' in sysroot else sysroot + cppflags += f"--sysroot={sysroot} " + ldflags += f"--sysroot={sysroot} " + + if self._with_stacktrace_backtrace: + backtrace_aggregated_cpp_info = self.dependencies["libbacktrace"].cpp_info.aggregated_components() + cppflags += " ".join(f"-I{p}" for p in backtrace_aggregated_cpp_info.includedirs) + " " + ldflags += " ".join(f"-L{p}" for p in backtrace_aggregated_cpp_info.libdirs) + " " + + if cxxflags.strip(): + contents += f'"{cxxflags.strip()}" ' + if cflags.strip(): + contents += f'"{cflags.strip()}" ' + if cppflags.strip(): + contents += f'"{cppflags.strip()}" ' + if ldflags.strip(): + contents += f'"{ldflags.strip()}" ' + if asflags.strip(): + contents += f'"{asflags.strip()}" ' + + if self._is_apple_embedded_platform: + contents += f'"{self._b2_os}" ' + + contents += " ;" + + self.output.warning(contents) + filename = f"{folder}/user-config.jam" + save(self, filename, contents) + + @property + def _toolset_version(self): + toolset = MSBuildToolchain(self).toolset + if toolset: + match = re.match(r"v(\d+)(\d)$", toolset) + if match: + return f"{match.group(1)}.{match.group(2)}" + return "" + + @property + def _toolset(self): + if is_msvc(self): + return "clang-win" if self.settings.compiler.get_safe("toolset") == "ClangCL" else "msvc" + if self.settings.os == "Windows" and self.settings.compiler == "clang": + return "clang-win" + if self.settings.os == "Emscripten" and self.settings.compiler == "clang": + return "emscripten" + if self.settings.compiler == "gcc" and is_apple_os(self): + return "darwin" + if self.settings.compiler == "apple-clang": + return "clang-darwin" + if self.settings.os == "Android" and self.settings.compiler == "clang": + return "clang-linux" + if self.settings.compiler in ["clang", "gcc"]: + return str(self.settings.compiler) + if self.settings.compiler == "sun-cc": + return "sunpro" + if "intel" in str(self.settings.compiler): + return { + "Macos": "intel-darwin", + "Windows": "intel-win", + "Linux": "intel-linux", + }[str(self.settings.os)] + + return str(self.settings.compiler) + + @property + def _toolset_tag(self): + # compiler | compiler.version | os | toolset_tag | remark + # ---------------+------------------+-------------+----------------+----------------------------- + # apple-clang | 12 | Macos | darwin12 | + # clang | 12 | Macos | clang-darwin12 | + # gcc | 11 | Linux | gcc8 | + # gcc | 8 | Windows | mgw8 | + # Visual Studio | 17 | Windows | vc142 | depends on compiler.toolset + compiler = { + "apple-clang": "", + "Visual Studio": "vc", + "msvc": "vc", + }.get(str(self.settings.compiler), str(self.settings.compiler)) + if (self.settings.compiler, self.settings.os) == ("gcc", "Windows"): + compiler = "mgw" + os_ = "" + if self.settings.os == "Macos": + os_ = "darwin" + if is_msvc(self): + toolset_version = self._toolset_version.replace(".", "") + else: + toolset_version = str(Version(self.settings.compiler.version).major) + + toolset_parts = [compiler, os_] + toolset_tag = "-".join(part for part in toolset_parts if part) + toolset_version + return toolset_tag + + #################################################################### + + def package(self): + # This stage/lib is in source_folder... Face palm, looks like it builds in build but then + # copy to source with the good lib name + copy(self, "LICENSE_1_0.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + if self.options.header_only: + copy(self, "*", src=os.path.join(self.source_folder, "boost"), + dst=os.path.join(self.package_folder, "include", "boost")) + + if self.settings.os == "Emscripten" and not self.options.header_only: + self._create_emscripten_libs() + + if is_msvc(self) and self._shared: + # Some boost releases contain both static and shared variants of some libraries (if shared=True) + all_libs = set(collect_libs(self, "lib")) + static_libs = set(l for l in all_libs if l.startswith("lib")) + shared_libs = all_libs.difference(static_libs) + static_libs = set(l[3:] for l in static_libs) + common_libs = static_libs.intersection(shared_libs) + for common_lib in common_libs: + common_lib_fullname = f"lib{common_lib}.lib" + self.output.info(f'Unlinking static duplicate library: {os.path.join(self.package_folder, "lib", common_lib_fullname)}') + os.unlink(os.path.join(self.package_folder, "lib", common_lib_fullname)) + + dll_pdbs = glob.glob(os.path.join(self.package_folder, "lib", "*.dll")) + \ + glob.glob(os.path.join(self.package_folder, "lib", "*.pdb")) + if dll_pdbs: + mkdir(self, os.path.join(self.package_folder, "bin")) + for bin_file in dll_pdbs: + rename(self, bin_file, os.path.join(self.package_folder, "bin", os.path.basename(bin_file))) + + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def _create_emscripten_libs(self): + # Boost Build doesn't create the libraries, but it gets close, + # leaving .bc files where the libraries would be. + staged_libs = os.path.join( + self.package_folder, "lib" + ) + if not os.path.exists(staged_libs): + self.output.warning(f"Lib folder doesn't exist, can't collect libraries: {staged_libs}") + return + for bc_file in os.listdir(staged_libs): + if bc_file.startswith("lib") and bc_file.endswith(".bc"): + a_file = bc_file[:-3] + ".a" + cmd = f"emar q {os.path.join(staged_libs, a_file)} {os.path.join(staged_libs, bc_file)}" + self.output.info(cmd) + self.run(cmd) + + @staticmethod + def _option_to_conan_requirement(name): + return { + "lzma": "xz_utils", + "iconv": "libiconv", + "python": None, # FIXME: change to cpython when it becomes available + }.get(name, name) + + def package_info(self): + self.env_info.BOOST_ROOT = self.package_folder + + self.cpp_info.set_property("cmake_file_name", "Boost") + self.cpp_info.filenames["cmake_find_package"] = "Boost" + self.cpp_info.filenames["cmake_find_package_multi"] = "Boost" + self.cpp_info.names["cmake_find_package"] = "Boost" + self.cpp_info.names["cmake_find_package_multi"] = "Boost" + + # - Use 'headers' component for all includes + defines + # - Use '_libboost' component to attach extra system_libs, ... + + self.cpp_info.components["headers"].libs = [] + self.cpp_info.components["headers"].libdirs = [] + self.cpp_info.components["headers"].set_property("cmake_target_name", "Boost::headers") + self.cpp_info.components["headers"].names["cmake_find_package"] = "headers" + self.cpp_info.components["headers"].names["cmake_find_package_multi"] = "headers" + self.cpp_info.components["headers"].names["pkg_config"] = "boost" + + if self.options.system_no_deprecated: + self.cpp_info.components["headers"].defines.append("BOOST_SYSTEM_NO_DEPRECATED") + + if self.options.asio_no_deprecated: + self.cpp_info.components["headers"].defines.append("BOOST_ASIO_NO_DEPRECATED") + + if self.options.filesystem_no_deprecated: + self.cpp_info.components["headers"].defines.append("BOOST_FILESYSTEM_NO_DEPRECATED") + + if self.options.filesystem_use_std_fs: + self.cpp_info.components["headers"].defines.append("BOOST_DLL_USE_STD_FS") + + if self.options.filesystem_version: + self.cpp_info.components["headers"].defines.append(f"BOOST_FILESYSTEM_VERSION={self.options.filesystem_version}") + + if self.options.segmented_stacks: + self.cpp_info.components["headers"].defines.extend(["BOOST_USE_SEGMENTED_STACKS", "BOOST_USE_UCONTEXT"]) + + if self.options.system_use_utf8: + self.cpp_info.components["headers"].defines.append("BOOST_SYSTEM_USE_UTF8") + + if self.options.buildid: + # If you built Boost using the --buildid option then set this macro to the same value + # as you passed to bjam. + # For example if you built using bjam address-model=64 --buildid=amd64 then compile your code with + # -DBOOST_LIB_BUILDID=amd64 to ensure the correct libraries are selected at link time. + self.cpp_info.components["headers"].defines.append(f"BOOST_LIB_BUILDID={self.options.buildid}") + + if not self.options.header_only: + if self.options.error_code_header_only: + self.cpp_info.components["headers"].defines.append("BOOST_ERROR_CODE_HEADER_ONLY") + + if self.options.layout == "versioned": + version = Version(self.version) + self.cpp_info.components["headers"].includedirs.append(os.path.join("include", f"boost-{version.major}_{version.minor}")) + + # Boost::boost is an alias of Boost::headers + self.cpp_info.components["_boost_cmake"].requires = ["headers"] + self.cpp_info.components["_boost_cmake"].set_property("cmake_target_name", "Boost::boost") + self.cpp_info.components["_boost_cmake"].names["cmake_find_package"] = "boost" + self.cpp_info.components["_boost_cmake"].names["cmake_find_package_multi"] = "boost" + if self.options.header_only: + self.cpp_info.components["_boost_cmake"].libdirs = [] + + if not self.options.header_only: + self.cpp_info.components["_libboost"].requires = ["headers"] + + self.cpp_info.components["diagnostic_definitions"].libs = [] + self.cpp_info.components["diagnostic_definitions"].set_property("cmake_target_name", "Boost::diagnostic_definitions") + self.cpp_info.components["diagnostic_definitions"].names["cmake_find_package"] = "diagnostic_definitions" + self.cpp_info.components["diagnostic_definitions"].names["cmake_find_package_multi"] = "diagnostic_definitions" + self.cpp_info.components["diagnostic_definitions"].names["pkg_config"] = "boost_diagnostic_definitions" # FIXME: disable on pkg_config + # I would assume headers also need the define BOOST_LIB_DIAGNOSTIC, as a header can trigger an autolink, + # and this definition triggers a print out of the library selected. See notes below on autolink and headers. + self.cpp_info.components["headers"].requires.append("diagnostic_definitions") + if self.options.diagnostic_definitions: + self.cpp_info.components["diagnostic_definitions"].defines = ["BOOST_LIB_DIAGNOSTIC"] + + self.cpp_info.components["disable_autolinking"].libs = [] + self.cpp_info.components["disable_autolinking"].set_property("cmake_target_name", "Boost::disable_autolinking") + self.cpp_info.components["disable_autolinking"].names["cmake_find_package"] = "disable_autolinking" + self.cpp_info.components["disable_autolinking"].names["cmake_find_package_multi"] = "disable_autolinking" + self.cpp_info.components["disable_autolinking"].names["pkg_config"] = "boost_disable_autolinking" # FIXME: disable on pkg_config + + # Even headers needs to know the flags for disabling autolinking ... + # magic_autolink is an option in the recipe, so if a consumer wants this version of boost, + # then they should not get autolinking. + # Note that autolinking can sneak in just by some file #including a header with (eg) boost/atomic.hpp, + # even if it doesn't use any part that requires linking with libboost_atomic in order to compile. + # So a boost-header-only library that links to Boost::headers needs to see BOOST_ALL_NO_LIB + # in order to avoid autolinking to libboost_atomic + + # This define is already imported into all of the _libboost libraries from this recipe anyway, + # so it would be better to be consistent and ensure ANYTHING using boost (headers or libs) has consistent #defines. + + # Same applies for for BOOST_AUTO_LINK_{layout}: + # consumer libs that use headers also need to know what is the layout/filename of the libraries. + # + # eg, if using the "tagged" naming scheme, and a header triggers an autolink, + # then that header's autolink request had better be configured to request the "tagged" library name. + # Otherwise, the linker will be looking for a (eg) "versioned" library name, and there will be a link error. + + # Note that "_libboost" requires "headers" so these defines will be applied to all the libraries too. + self.cpp_info.components["headers"].requires.append("disable_autolinking") + if is_msvc(self) or self._is_clang_cl: + if self.options.magic_autolink: + if self.options.layout == "system": + self.cpp_info.components["headers"].defines.append("BOOST_AUTO_LINK_SYSTEM") + elif self.options.layout == "tagged": + self.cpp_info.components["headers"].defines.append("BOOST_AUTO_LINK_TAGGED") + self.output.info("Enabled magic autolinking (smart and magic decisions)") + else: + # DISABLES AUTO LINKING! NO SMART AND MAGIC DECISIONS THANKS! + self.cpp_info.components["disable_autolinking"].defines = ["BOOST_ALL_NO_LIB"] + self.output.info("Disabled magic autolinking (smart and magic decisions)") + + self.cpp_info.components["dynamic_linking"].libs = [] + self.cpp_info.components["dynamic_linking"].set_property("cmake_target_name", "Boost::dynamic_linking") + self.cpp_info.components["dynamic_linking"].names["cmake_find_package"] = "dynamic_linking" + self.cpp_info.components["dynamic_linking"].names["cmake_find_package_multi"] = "dynamic_linking" + self.cpp_info.components["dynamic_linking"].names["pkg_config"] = "boost_dynamic_linking" # FIXME: disable on pkg_config + # A library that only links to Boost::headers can be linked into another library that links a Boost::library, + # so for this reasons, the header-only library should know the BOOST_ALL_DYN_LINK definition as it will likely + # change some important part of the boost code and cause linking errors downstream. + # This is in the same theme as the notes above, re autolinking. + self.cpp_info.components["headers"].requires.append("dynamic_linking") + if self._shared: + # A Boost::dynamic_linking cmake target does only make sense for a shared boost package + self.cpp_info.components["dynamic_linking"].defines = ["BOOST_ALL_DYN_LINK"] + + # https://www.boost.org/doc/libs/1_73_0/more/getting_started/windows.html#library-naming + # libsuffix for MSVC: + # - system: "" + # - versioned: "-vc142-mt-d-x64-1_74" + # - tagged: "-mt-d-x64" + libsuffix_lut = { + "system": "", + "versioned": "{toolset}{threading}{abi}{arch}{version}", + "tagged": "{threading}{abi}{arch}", + } + libsuffix_data = { + "toolset": f"-{self._toolset_tag}", + "threading": "-mt" if self.options.multithreading else "", + "abi": "", + "ach": "", + "version": "", + } + if is_msvc(self): # FIXME: mingw? + # FIXME: add 'y' when using cpython cci package and when python is built in debug mode + static_runtime_key = "s" if is_msvc_static_runtime(self) else "" + debug_runtime_key = "g" if "d" in msvc_runtime_flag(self) else "" + debug_key = "d" if self.settings.build_type == "Debug" else "" + abi = static_runtime_key + debug_runtime_key + debug_key + if abi: + libsuffix_data["abi"] = f"-{abi}" + else: + debug_tag = "d" if self.settings.build_type == "Debug" else "" + abi = debug_tag + if abi: + libsuffix_data["abi"] = f"-{abi}" + + if self._b2_architecture: + libsuffix_data["arch"] = f"-{self._b2_architecture[0]}{self._b2_address_model}" + version = Version(self.version) + if not version.patch or version.patch == "0": + libsuffix_data["version"] = f"-{version.major}_{version.minor}" + else: + libsuffix_data["version"] = f"-{version.major}_{version.minor}_{version.patch}" + libsuffix = libsuffix_lut[str(self.options.layout)].format(**libsuffix_data) + if libsuffix: + self.output.info(f"Library layout suffix: {repr(libsuffix)}") + + libformatdata = {} + if not self.options.without_python: + pyversion = Version(self._python_version) + libformatdata["py_major"] = pyversion.major + libformatdata["py_minor"] = pyversion.minor + + def add_libprefix(n): + """ On MSVC, static libraries are built with a 'lib' prefix. Some libraries do not support shared, so are always built as a static library. """ + libprefix = "" + if is_msvc(self) and (not self._shared or n in self._dependencies["static_only"]): + libprefix = "lib" + return libprefix + n + + all_detected_libraries = set(l[:-4] if l.endswith(".dll") else l for l in collect_libs(self)) + all_expected_libraries = set() + incomplete_components = [] + + def filter_transform_module_libraries(names): + libs = [] + for name in names: + if name in ("boost_stacktrace_windbg", "boost_stacktrace_windbg_cached") and self.settings.os != "Windows": + continue + if name in ("boost_math_c99l", "boost_math_tr1l") and str(self.settings.arch).startswith("ppc"): + continue + if name in ("boost_stacktrace_addr2line", "boost_stacktrace_backtrace", "boost_stacktrace_basic", "boost_stacktrace_from_exception",) and self.settings.os == "Windows": + continue + if name == "boost_stacktrace_addr2line" and not self._stacktrace_addr2line_available: + continue + if name == "boost_stacktrace_backtrace" and self.options.get_safe("with_stacktrace_backtrace") == False: + continue + if not self.options.get_safe("numa") and "_numa" in name: + continue + new_name = add_libprefix(name.format(**libformatdata)) + libsuffix + if self.options.namespace != 'boost': + new_name = new_name.replace("boost_", str(self.options.namespace) + "_") + if name.startswith("boost_python") or name.startswith("boost_numpy"): + if self.options.python_buildid: + new_name += f"-{self.options.python_buildid}" + if self.options.buildid: + new_name += f"-{self.options.buildid}" + libs.append(new_name) + return libs + + for module in self._dependencies["dependencies"].keys(): + missing_depmodules = list(depmodule for depmodule in self._all_dependent_modules(module) if self.options.get_safe(f"without_{depmodule}", False)) + if missing_depmodules: + continue + + module_libraries = filter_transform_module_libraries(self._dependencies["libs"][module]) + + # Don't create components for modules that should have libraries, but don't have (because of filter) + if self._dependencies["libs"][module] and not module_libraries: + continue + + all_expected_libraries = all_expected_libraries.union(module_libraries) + if set(module_libraries).difference(all_detected_libraries): + incomplete_components.append(module) + + # Starting v1.69.0 Boost.System is header-only. A stub library is + # still built for compatibility, but linking to it is no longer + # necessary. + # https://www.boost.org/doc/libs/1_75_0/libs/system/doc/html/system.html#changes_in_boost_1_69 + if module == "system": + module_libraries = [] + + self.cpp_info.components[module].libs = module_libraries + + self.cpp_info.components[module].requires = self._dependencies["dependencies"][module] + ["_libboost"] + self.cpp_info.components[module].set_property("cmake_target_name", "Boost::" + module) + self.cpp_info.components[module].names["cmake_find_package"] = module + self.cpp_info.components[module].names["cmake_find_package_multi"] = module + self.cpp_info.components[module].names["pkg_config"] = f"boost_{module}" + + # extract list of names of direct host dependencies to check for dependencies + # of components that exist in other packages + dependencies = [d.ref.name for d, _ in self.dependencies.direct_host.items()] + + for requirement in self._dependencies.get("requirements", {}).get(module, []): + if self.options.get_safe(requirement, None) == False: + continue + conan_requirement = self._option_to_conan_requirement(requirement) + if conan_requirement not in dependencies: + continue + if module == "locale" and requirement in ("icu", "iconv"): + if requirement == "icu" and not self._with_icu: + continue + if requirement == "iconv" and not self._with_iconv: + continue + self.cpp_info.components[module].requires.append(f"{conan_requirement}::{conan_requirement}") + + for incomplete_component in incomplete_components: + self.output.warning(f"Boost component '{incomplete_component}' is missing libraries. Try building boost with '-o boost:without_{incomplete_component}'. (Option is not guaranteed to exist)") + + non_used = all_detected_libraries.difference(all_expected_libraries) + if non_used: + raise ConanException(f"These libraries were built, but were not used in any boost module: {non_used}") + + non_built = all_expected_libraries.difference(all_detected_libraries) + if non_built: + raise ConanException(f"These libraries were expected to be built, but were not built: {non_built}") + + if not self.options.without_stacktrace: + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["stacktrace_basic"].system_libs.append("dl") + if self._stacktrace_addr2line_available: + self.cpp_info.components["stacktrace_addr2line"].system_libs.append("dl") + if self._with_stacktrace_backtrace: + self.cpp_info.components["stacktrace_backtrace"].system_libs.append("dl") + if self._stacktrace_from_exception_available: + self.cpp_info.components["stacktrace_from_exception"].system_libs.append("dl") + + if self._stacktrace_addr2line_available: + self.cpp_info.components["stacktrace_addr2line"].defines.extend([ + f"BOOST_STACKTRACE_ADDR2LINE_LOCATION=\"{self.options.addr2line_location}\"", + "BOOST_STACKTRACE_USE_ADDR2LINE", + ]) + + if self._with_stacktrace_backtrace: + self.cpp_info.components["stacktrace_backtrace"].defines.append("BOOST_STACKTRACE_USE_BACKTRACE") + self.cpp_info.components["stacktrace_backtrace"].requires.append("libbacktrace::libbacktrace") + + self.cpp_info.components["stacktrace_noop"].defines.append("BOOST_STACKTRACE_USE_NOOP") + + if self.settings.os == "Windows": + self.cpp_info.components["stacktrace_windbg"].defines.append("BOOST_STACKTRACE_USE_WINDBG") + self.cpp_info.components["stacktrace_windbg"].system_libs.extend(["ole32", "dbgeng"]) + self.cpp_info.components["stacktrace_windbg_cached"].defines.append("BOOST_STACKTRACE_USE_WINDBG_CACHED") + self.cpp_info.components["stacktrace_windbg_cached"].system_libs.extend(["ole32", "dbgeng"]) + elif is_apple_os(self) or self.settings.os == "FreeBSD": + self.cpp_info.components["stacktrace"].defines.append("BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED") + + if not self.options.without_python: + pyversion = Version(self._python_version) + self.cpp_info.components[f"python{pyversion.major}{pyversion.minor}"].requires = ["python"] + if not self._shared: + self.cpp_info.components["python"].defines.append("BOOST_PYTHON_STATIC_LIB") + + self.cpp_info.components[f"numpy{pyversion.major}{pyversion.minor}"].requires = ["numpy"] + + if is_msvc(self) or self._is_clang_cl: + # https://github.com/conan-community/conan-boost/issues/127#issuecomment-404750974 + self.cpp_info.components["_libboost"].system_libs.append("bcrypt") + elif self.settings.os == "Linux": + # https://github.com/conan-community/community/issues/135 + self.cpp_info.components["_libboost"].system_libs.append("rt") + if self.options.multithreading: + self.cpp_info.components["_libboost"].system_libs.append("pthread") + elif self.settings.os == "Emscripten": + if self.options.multithreading: + arch = str(self.settings.arch) + # https://emscripten.org/docs/porting/pthreads.html + # The documentation mentions that we should be using the "-s USE_PTHREADS=1" + # but it was causing problems with the target based configurations in conan + # So instead we are using the raw compiler flags (that are being activated + # from the aforementioned flag) + if arch.startswith("x86") or arch.startswith("wasm"): + self.cpp_info.components["_libboost"].cxxflags.append("-pthread") + self.cpp_info.components["_libboost"].sharedlinkflags.extend(["-pthread","--shared-memory"]) + self.cpp_info.components["_libboost"].exelinkflags.extend(["-pthread","--shared-memory"]) + elif self.settings.os == "iOS": + if self.options.multithreading: + # https://github.com/conan-io/conan-center-index/issues/3867 + # runtime crashes occur when using the default platform-specific reference counter/atomic + # https://github.com/boostorg/filesystem/issues/147 + # iOS should use spinlocks to avoid filesystem crashes + self.cpp_info.components["headers"].defines.append("BOOST_SP_USE_SPINLOCK") + else: + self.cpp_info.components["headers"].defines.extend(["BOOST_AC_DISABLE_THREADS", "BOOST_SP_DISABLE_THREADS"]) + + if not self.options.get_safe('without_cobalt', True) and \ + (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "10"): + self.cpp_info.components["cobalt"].cxxflags.append("-fcoroutines") + + #TODO: remove in the future, user_info deprecated in conan2, but kept for compatibility while recipe is cross-compatible. + self.user_info.stacktrace_addr2line_available = self._stacktrace_addr2line_available + self.conf_info.define("user.boost:stacktrace_addr2line_available", self._stacktrace_addr2line_available) diff --git a/boost/all/dependencies/dependencies-1.71.0.yml b/boost/all/dependencies/dependencies-1.71.0.yml new file mode 100644 index 0000000..9c2d0a8 --- /dev/null +++ b/boost/all/dependencies/dependencies-1.71.0.yml @@ -0,0 +1,269 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- locale +- log +- math +- mpi +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: + - thread + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: + - serialization + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - locale + - random + - regex + - system + - thread + log_setup: + - log + math: + - atomic + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - math + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.71.0 diff --git a/boost/all/dependencies/dependencies-1.72.0.yml b/boost/all/dependencies/dependencies-1.72.0.yml new file mode 100644 index 0000000..f0213a2 --- /dev/null +++ b/boost/all/dependencies/dependencies-1.72.0.yml @@ -0,0 +1,270 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- locale +- log +- math +- mpi +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: + - thread + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: + - serialization + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - locale + - random + - regex + - system + - thread + log_setup: + - log + math: + - atomic + - chrono + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - math + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.72.0 diff --git a/boost/all/dependencies/dependencies-1.73.0.yml b/boost/all/dependencies/dependencies-1.73.0.yml new file mode 100644 index 0000000..d26d67c --- /dev/null +++ b/boost/all/dependencies/dependencies-1.73.0.yml @@ -0,0 +1,274 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: + - thread + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: + - serialization + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - locale + - random + - regex + - system + - thread + log_setup: + - log + math: + - atomic + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - math + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.73.0 diff --git a/boost/all/dependencies/dependencies-1.74.0.yml b/boost/all/dependencies/dependencies-1.74.0.yml new file mode 100644 index 0000000..679e8d6 --- /dev/null +++ b/boost/all/dependencies/dependencies-1.74.0.yml @@ -0,0 +1,273 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: + - thread + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - locale + - random + - regex + - system + - thread + log_setup: + - log + math: + - atomic + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - math + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.74.0 diff --git a/boost/all/dependencies/dependencies-1.75.0.yml b/boost/all/dependencies/dependencies-1.75.0.yml new file mode 100644 index 0000000..4d24ca9 --- /dev/null +++ b/boost/all/dependencies/dependencies-1.75.0.yml @@ -0,0 +1,280 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: + - thread + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - exception + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - locale + - random + - regex + - system + - thread + log_setup: + - log + math: + - atomic + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - math + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.75.0 diff --git a/boost/all/dependencies/dependencies-1.76.0.yml b/boost/all/dependencies/dependencies-1.76.0.yml new file mode 100644 index 0000000..b404c36 --- /dev/null +++ b/boost/all/dependencies/dependencies-1.76.0.yml @@ -0,0 +1,279 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: + - thread + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - exception + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - locale + - random + - regex + - system + - thread + log_setup: + - log + math: + - atomic + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.76.0 diff --git a/boost/all/dependencies/dependencies-1.77.0.yml b/boost/all/dependencies/dependencies-1.77.0.yml new file mode 100644 index 0000000..921d8f4 --- /dev/null +++ b/boost/all/dependencies/dependencies-1.77.0.yml @@ -0,0 +1,277 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + - thread + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - exception + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.77.0 diff --git a/boost/all/dependencies/dependencies-1.78.0.yml b/boost/all/dependencies/dependencies-1.78.0.yml new file mode 100644 index 0000000..dd32072 --- /dev/null +++ b/boost/all/dependencies/dependencies-1.78.0.yml @@ -0,0 +1,276 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - exception + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.78.0 diff --git a/boost/all/dependencies/dependencies-1.79.0.yml b/boost/all/dependencies/dependencies-1.79.0.yml new file mode 100644 index 0000000..ddef536 --- /dev/null +++ b/boost/all/dependencies/dependencies-1.79.0.yml @@ -0,0 +1,276 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - exception + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.79.0 diff --git a/boost/all/dependencies/dependencies-1.80.0.yml b/boost/all/dependencies/dependencies-1.80.0.yml new file mode 100644 index 0000000..4cabd8c --- /dev/null +++ b/boost/all/dependencies/dependencies-1.80.0.yml @@ -0,0 +1,275 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.80.0 diff --git a/boost/all/dependencies/dependencies-1.81.0.yml b/boost/all/dependencies/dependencies-1.81.0.yml new file mode 100644 index 0000000..838c68b --- /dev/null +++ b/boost/all/dependencies/dependencies-1.81.0.yml @@ -0,0 +1,280 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- url +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + url: + - system + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + url: + - boost_url + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.81.0 diff --git a/boost/all/dependencies/dependencies-1.82.0.yml b/boost/all/dependencies/dependencies-1.82.0.yml new file mode 100644 index 0000000..02d6958 --- /dev/null +++ b/boost/all/dependencies/dependencies-1.82.0.yml @@ -0,0 +1,280 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- url +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + url: + - system + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + url: + - boost_url + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.82.0 diff --git a/boost/all/dependencies/dependencies-1.83.0.yml b/boost/all/dependencies/dependencies-1.83.0.yml new file mode 100644 index 0000000..7200adb --- /dev/null +++ b/boost/all/dependencies/dependencies-1.83.0.yml @@ -0,0 +1,278 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- url +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: [] + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + url: + - system + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + url: + - boost_url + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.83.0 diff --git a/boost/all/dependencies/dependencies-1.84.0.yml b/boost/all/dependencies/dependencies-1.84.0.yml new file mode 100644 index 0000000..064fb7b --- /dev/null +++ b/boost/all/dependencies/dependencies-1.84.0.yml @@ -0,0 +1,283 @@ +configure_options: +- atomic +- chrono +- cobalt +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- url +- wave +dependencies: + atomic: [] + chrono: + - system + cobalt: + - container + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - system + locale: + - thread + log: + - atomic + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: [] + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + url: + - system + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + cobalt: + - boost_cobalt + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + url: + - boost_url + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.84.0 diff --git a/boost/all/dependencies/dependencies-1.85.0.yml b/boost/all/dependencies/dependencies-1.85.0.yml new file mode 100644 index 0000000..2306346 --- /dev/null +++ b/boost/all/dependencies/dependencies-1.85.0.yml @@ -0,0 +1,291 @@ +configure_options: +- atomic +- charconv +- chrono +- cobalt +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- url +- wave +dependencies: + atomic: [] + charconv: [] + chrono: + - system + cobalt: + - container + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - system + locale: + - thread + log: + - atomic + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_from_exception: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: [] + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + url: + - system + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + charconv: + - boost_charconv + chrono: + - boost_chrono + cobalt: + - boost_cobalt + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_from_exception: + - boost_stacktrace_from_exception + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + url: + - boost_url + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.85.0 diff --git a/boost/all/patches/0001-revert-cease-dependence-on-range.patch b/boost/all/patches/0001-revert-cease-dependence-on-range.patch new file mode 100644 index 0000000..fd06919 --- /dev/null +++ b/boost/all/patches/0001-revert-cease-dependence-on-range.patch @@ -0,0 +1,49 @@ +From 188eac4acf37313fcec27d7b266c6517b99ed23d Mon Sep 17 00:00:00 2001 +From: Oliver Kowalke +Date: Sun, 1 Dec 2019 20:40:28 +0100 +Subject: [PATCH] Revert "Cease dependence on Range" + +This reverts commit 0c556bb59241e682bbcd3f572815149c5a9b17db. + +see #44 (One test fails to compile after boostorg/coroutine submodule updated) +--- + boost/coroutine/asymmetric_coroutine.hpp | 12 +++--------- + 1 file changed, 3 insertions(+), 9 deletions(-) + +diff --git a/boost/coroutine/asymmetric_coroutine.hpp b/boost/coroutine/asymmetric_coroutine.hpp +index f2ae16f..78b1842 100644 +--- a/boost/coroutine/asymmetric_coroutine.hpp ++++ b/boost/coroutine/asymmetric_coroutine.hpp +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -2390,19 +2391,12 @@ end( push_coroutine< R > & c) + + } + +-// forward declaration of Boost.Range traits to break dependency on it +-template +-struct range_mutable_iterator; +- +-template +-struct range_const_iterator; +- + template< typename Arg > +-struct range_mutable_iterator< coroutines::push_coroutine< Arg >, void > ++struct range_mutable_iterator< coroutines::push_coroutine< Arg > > + { typedef typename coroutines::push_coroutine< Arg >::iterator type; }; + + template< typename R > +-struct range_mutable_iterator< coroutines::pull_coroutine< R >, void > ++struct range_mutable_iterator< coroutines::pull_coroutine< R > > + { typedef typename coroutines::pull_coroutine< R >::iterator type; }; + + } +-- +2.21.0 + diff --git a/boost/all/patches/1.69.0-contract-no-system.patch b/boost/all/patches/1.69.0-contract-no-system.patch new file mode 100644 index 0000000..d98fe7b --- /dev/null +++ b/boost/all/patches/1.69.0-contract-no-system.patch @@ -0,0 +1,11 @@ +This library links to boost_system, even though that library is header-only. +--- libs/contract/build/Jamfile.v2 ++++ libs/contract/build/Jamfile.v2 +@@ -18,5 +18,5 @@ + ; + + # If lib as header-only, none of following will be used. +-lib boost_contract : contract.cpp : shared /boost//system ; +-lib boost_contract : contract.cpp : static /boost//system ; ++lib boost_contract : contract.cpp : shared ; ++lib boost_contract : contract.cpp : static ; diff --git a/boost/all/patches/1.69.0-locale-no-system.patch b/boost/all/patches/1.69.0-locale-no-system.patch new file mode 100644 index 0000000..a2ca64e --- /dev/null +++ b/boost/all/patches/1.69.0-locale-no-system.patch @@ -0,0 +1,12 @@ +This library links to boost_system, even though that library is header-only. +--- libs/locale/build/Jamfile.v2 ++++ libs/locale/build/Jamfile.v2 +@@ -410,7 +410,7 @@ + result += util/gregorian.cpp ; + } + +- result += ../../system/build//boost_system ; ++ + + + if "$(flags-only)" = "flags" diff --git a/boost/all/patches/1.69.0-random-no-system.patch b/boost/all/patches/1.69.0-random-no-system.patch new file mode 100644 index 0000000..ad03e39 --- /dev/null +++ b/boost/all/patches/1.69.0-random-no-system.patch @@ -0,0 +1,11 @@ +This library links to boost_system, even though that library is header-only. +--- libs/random/build/Jamfile.v2 ++++ libs/random/build/Jamfile.v2 +@@ -13,6 +13,6 @@ + : usage-requirements shared:BOOST_RANDOM_DYN_LINK + ; + +-lib boost_random : [ glob *.cpp ] /boost//system ; ++lib boost_random : [ glob *.cpp ] ; + + boost-install boost_random ; diff --git a/boost/all/patches/1.69.0-type_erasure-no-system.patch b/boost/all/patches/1.69.0-type_erasure-no-system.patch new file mode 100644 index 0000000..c3b7cde --- /dev/null +++ b/boost/all/patches/1.69.0-type_erasure-no-system.patch @@ -0,0 +1,9 @@ +This library links to boost_system, even though that library is header-only. +--- libs/type_erasure/build/Jamfile.v2 ++++ libs/type_erasure/build/Jamfile.v2 +@@ -12,4 +12,4 @@ + : usage-requirements shared:BOOST_TYPE_ERASURE_DYN_LINK + ; + +-lib boost_type_erasure : dynamic_binding.cpp /boost//thread /boost//system ; ++lib boost_type_erasure : dynamic_binding.cpp /boost//thread ; diff --git a/boost/all/patches/1.75.0-boost_build-with-newer-b2.patch b/boost/all/patches/1.75.0-boost_build-with-newer-b2.patch new file mode 100644 index 0000000..4c22c74 --- /dev/null +++ b/boost/all/patches/1.75.0-boost_build-with-newer-b2.patch @@ -0,0 +1,51 @@ +--- tools/build/src/build/configure.jam.orig 2020-12-03 00:02:49.000000000 -0500 ++++ tools/build/src/build/configure.jam 2022-01-28 20:32:41.260634800 -0500 +@@ -454,7 +454,7 @@ + return [ find-builds-raw $(p) : $(ps) : $(what) : + $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) : + $(10) : $(11) : $(12) : $(13) : $(14) : $(15) : +- $(16) : $(17) : $(18) : $(19) ] ; ++ $(16) : $(17) : $(18) ] ; + } + + +@@ -518,7 +518,7 @@ + { + local project = [ project.current ] ; + self.message = $(message) ; +- for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ++ for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 + { + local name = [ CALC $(i) - 1 ] ; + self.targets.$(name) = $($(i)[1]) ; +@@ -537,7 +537,7 @@ + } + rule all-properties ( ) + { +- local i = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; ++ local i = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ; + return $(self.props.$(i)) ; + } + rule check ( properties * ) +@@ -559,9 +559,7 @@ + : $(self.targets.14) $(self.what.14) + : $(self.targets.15) $(self.what.15) + : $(self.targets.16) $(self.what.16) +- : $(self.targets.17) $(self.what.17) +- : $(self.targets.18) $(self.what.18) +- : $(self.targets.19) $(self.what.19) ] ; ++ : $(self.targets.17) $(self.what.17) ] ; + if $(self.props.$(i)) + { + return [ property.evaluate-conditionals-in-context $(self.props.$(i)) : $(properties) ] ; +--- tools/build/src/util/indirect.jam.orig 2020-12-03 00:02:49.000000000 -0500 ++++ tools/build/src/util/indirect.jam 2022-01-28 20:32:41.249509200 -0500 +@@ -102,7 +102,7 @@ + { + return [ modules.call-in [ get-module $(r) ] : [ get-rule $(r) ] $(args) : + $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) : $(10) : $(11) : +- $(12) : $(13) : $(14) : $(15) : $(16) : $(17) : $(18) : $(19) ] ; ++ $(12) : $(13) : $(14) : $(15) : $(16) : $(17) : $(18) ] ; + } + + diff --git a/boost/all/patches/1.76.0-0001-fix-include-inside-boost-namespace.patch b/boost/all/patches/1.76.0-0001-fix-include-inside-boost-namespace.patch new file mode 100644 index 0000000..c06566b --- /dev/null +++ b/boost/all/patches/1.76.0-0001-fix-include-inside-boost-namespace.patch @@ -0,0 +1,33 @@ +From 1ec5c98d80de97f9e962c5627e1a0e6096099894 Mon Sep 17 00:00:00 2001 +From: Daniel Scharrer +Date: Wed, 28 Jul 2021 19:56:31 +0200 +Subject: [PATCH] Fix #include inside boost namespace + +The existing code fails to build if was not already included. +--- + boost/math/tools/mp.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/boost/math/tools/mp.hpp b/boost/math/tools/mp.hpp +index 35565646f..dc8440988 100644 +--- a/boost/math/tools/mp.hpp ++++ b/boost/math/tools/mp.hpp +@@ -13,6 +13,7 @@ + + #include + #include ++#include + + namespace boost { namespace math { namespace tools { namespace meta_programming { + +@@ -338,7 +339,6 @@ using mp_remove_if_q = mp_remove_if; + // Index sequence + // Use C++14 index sequence if available + #if defined(__cpp_lib_integer_sequence) && (__cpp_lib_integer_sequence >= 201304) +-#include + template + using index_sequence = std::index_sequence; + +-- +2.39.1 + diff --git a/boost/all/patches/1.77.0-boost_build-with-newer-b2.patch b/boost/all/patches/1.77.0-boost_build-with-newer-b2.patch new file mode 100644 index 0000000..bdc7476 --- /dev/null +++ b/boost/all/patches/1.77.0-boost_build-with-newer-b2.patch @@ -0,0 +1,51 @@ +--- tools/build/src/build/configure.jam.orig 2021-08-05 05:42:46.000000000 -0400 ++++ tools/build/src/build/configure.jam 2022-01-28 19:55:37.960877600 -0500 +@@ -467,7 +467,7 @@ + return [ find-builds-raw $(p) : $(ps) : $(what) : + $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) : + $(10) : $(11) : $(12) : $(13) : $(14) : $(15) : +- $(16) : $(17) : $(18) : $(19) ] ; ++ $(16) : $(17) : $(18) ] ; + } + + +@@ -531,7 +531,7 @@ + { + local project = [ project.current ] ; + self.message = $(message) ; +- for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ++ for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 + { + local name = [ CALC $(i) - 1 ] ; + self.targets.$(name) = $($(i)[1]) ; +@@ -550,7 +550,7 @@ + } + rule all-properties ( ) + { +- local i = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; ++ local i = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ; + return $(self.props.$(i)) ; + } + rule check ( properties * ) +@@ -572,9 +572,7 @@ + : $(self.targets.14) $(self.what.14) + : $(self.targets.15) $(self.what.15) + : $(self.targets.16) $(self.what.16) +- : $(self.targets.17) $(self.what.17) +- : $(self.targets.18) $(self.what.18) +- : $(self.targets.19) $(self.what.19) ] ; ++ : $(self.targets.17) $(self.what.17) ] ; + if $(self.props.$(i)) + { + return [ property.evaluate-conditionals-in-context $(self.props.$(i)) : $(properties) ] ; +--- tools/build/src/util/indirect.jam.orig 2021-08-05 05:42:46.000000000 -0400 ++++ tools/build/src/util/indirect.jam 2021-12-02 01:48:03.000000000 -0500 +@@ -102,7 +102,7 @@ + { + return [ modules.call-in [ get-module $(r) ] : [ get-rule $(r) ] $(args) : + $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) : $(10) : $(11) : +- $(12) : $(13) : $(14) : $(15) : $(16) : $(17) : $(18) : $(19) ] ; ++ $(12) : $(13) : $(14) : $(15) : $(16) : $(17) : $(18) ] ; + } + + .parts_regex = "^([^@]*)@" "([^%]*)%" "([^%]+)$" ; diff --git a/boost/all/patches/1.77.0-fiber-mingw.patch b/boost/all/patches/1.77.0-fiber-mingw.patch new file mode 100644 index 0000000..5bf3800 --- /dev/null +++ b/boost/all/patches/1.77.0-fiber-mingw.patch @@ -0,0 +1,20 @@ +--- libs/fiber/src/numa/windows/pin_thread.cpp ++++ libs/fiber/src/numa/windows/pin_thread.cpp +@@ -23,7 +23,7 @@ + + BOOST_FIBERS_DECL + void pin_thread( std::uint32_t cpuid) { +- pin_thread( cpuid, ::GetCurrentThread() ); ++ pin_thread( cpuid, reinterpret_cast< std::thread::native_handle_type >(::GetCurrentThread())); + } + + BOOST_FIBERS_DECL +@@ -37,7 +37,7 @@ + uint32_t id = cpuid % 64; + // set the bit mask of the logical CPU + affinity.Mask = static_cast< KAFFINITY >( 1) << id; +- if ( BOOST_UNLIKELY( 0 == ::SetThreadGroupAffinity( h, & affinity, nullptr) ) ) { ++ if ( BOOST_UNLIKELY( 0 == ::SetThreadGroupAffinity( reinterpret_cast< HANDLE >(h), & affinity, nullptr) ) ) { + throw std::system_error( + std::error_code( ::GetLastError(), std::system_category() ), + "::SetThreadiGroupAffinity() failed"); diff --git a/boost/all/patches/1.77.0-type_erasure-no-system.patch b/boost/all/patches/1.77.0-type_erasure-no-system.patch new file mode 100644 index 0000000..71aac77 --- /dev/null +++ b/boost/all/patches/1.77.0-type_erasure-no-system.patch @@ -0,0 +1,11 @@ +This library links to boost_system, even though that library is header-only. +--- libs/type_erasure/build/Jamfile.v2 ++++ libs/type_erasure/build/Jamfile.v2 +@@ -12,6 +12,6 @@ + : usage-requirements shared:BOOST_TYPE_ERASURE_DYN_LINK + ; + +-lib boost_type_erasure : dynamic_binding.cpp /boost//thread /boost//system ; ++lib boost_type_erasure : dynamic_binding.cpp /boost//thread ; + + boost-install boost_type_erasure ; diff --git a/boost/all/patches/1.78.0-b2-fix-install.patch b/boost/all/patches/1.78.0-b2-fix-install.patch new file mode 100644 index 0000000..ac0ed81 --- /dev/null +++ b/boost/all/patches/1.78.0-b2-fix-install.patch @@ -0,0 +1,62 @@ +--- tools/build/src/tools/stage.jam 2021-12-09 16:30:45.956457531 +0300 ++++ tools/build/src/tools/stage.jam 2021-12-09 16:30:45.952457519 +0300 +@@ -476,10 +476,14 @@ class install-target-class : basic-targe + } + DELETE_MODULE $(result) ; + return [ sequence.unique $(result2) ] ; + } + ++ rule skip-from-usage-requirements ( ) ++ { ++ } ++ + # Returns true iff 'type' is subtype of some element of 'types-to-include'. + # + local rule include-type ( type : types-to-include * ) + { + local found ; + +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ tools/build/test/install_build_no.py 2021-12-09 16:30:45.953457522 +0300 +@@ -0,0 +1,26 @@ ++#!/usr/bin/python ++ ++# Copyright 2021 Dmitry Arkhipov (grisumbras@gmail.com) ++# Distributed under the Boost Software License, Version 1.0. ++# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) ++ ++# Check that no in usage-requirements of dependencies does not affect ++# install rule, i.e. a skipped installed target does not affect insallation of ++# other targets. ++ ++import BoostBuild ++ ++t = BoostBuild.Tester() ++ ++t.write("a.cpp", "int main() {}\n") ++ ++t.write("jamroot.jam", """ ++make x : : maker : no ; ++exe a : a.cpp ; ++install install : x a ; ++""") ++ ++t.run_build_system() ++t.expect_addition("install/a.exe") ++ ++t.cleanup() + +--- tools/build/test/test_all.py 2021-12-09 16:30:45.956457531 +0300 ++++ tools/build/test/test_all.py 2021-12-09 16:30:45.953457522 +0300 +@@ -248,10 +248,11 @@ tests = ["abs_workdir", + "implicit_dependency", + "indirect_conditional", + "inherit_toolset", + "inherited_dependency", + "inline", ++ "install_build_no", + "libjpeg", + "liblzma", + "libpng", + "libtiff", + "libzstd", diff --git a/boost/all/patches/1.79.0-0001-json-array-erase-relocate.patch b/boost/all/patches/1.79.0-0001-json-array-erase-relocate.patch new file mode 100644 index 0000000..d322b64 --- /dev/null +++ b/boost/all/patches/1.79.0-0001-json-array-erase-relocate.patch @@ -0,0 +1,49 @@ +diff -ur boost/json/impl/array.ipp boost/json/impl/array.ipp +--- boost/json/impl/array.ipp 2022-04-06 17:02:43.000000000 -0400 ++++ boost/json/impl/array.ipp 2022-04-13 20:55:20.464359478 -0400 +@@ -491,8 +491,11 @@ + auto const p = &(*t_)[0] + + (pos - &(*t_)[0]); + destroy(p, p + 1); +- relocate(p, p + 1, 1); + --t_->size; ++ if(t_->size > 0) ++ relocate(p, p + 1, ++ t_->size - (p - ++ &(*t_)[0])); + return p; + } + +diff -ur libs/json/test/array.cpp libs/json/test/array.cpp +--- libs/json/test/array.cpp 2022-04-06 17:02:43.000000000 -0400 ++++ libs/json/test/array.cpp 2022-04-13 20:53:32.671782680 -0400 +@@ -1270,6 +1270,21 @@ + } + + void ++ testIssue692() ++ { ++ array a; ++ object obj; ++ obj["test1"] = "hello"; ++ a.push_back(obj); ++ a.push_back(obj); ++ a.push_back(obj); ++ a.push_back(obj); ++ a.push_back(obj); ++ while(a.size()) ++ a.erase(a.begin()); ++ } ++ ++ void + run() + { + testDestroy(); +@@ -1283,6 +1298,7 @@ + testExceptions(); + testEquality(); + testHash(); ++ testIssue692(); + } + }; + diff --git a/boost/all/patches/1.79.0-geometry_no_rtti.patch b/boost/all/patches/1.79.0-geometry_no_rtti.patch new file mode 100644 index 0000000..15e7b06 --- /dev/null +++ b/boost/all/patches/1.79.0-geometry_no_rtti.patch @@ -0,0 +1,169 @@ +From 379f0c364a5ef3e6d57021ab815ea603ab3f1178 Mon Sep 17 00:00:00 2001 +From: Adam Wulkiewicz +Date: Tue, 19 Jul 2022 22:52:09 +0200 +Subject: [PATCH] [index] Fix and improve rtree experimental features + +Fix access specifier preventing use of experimental iterators. +Allow more granular control over enabled experimental features. +--- + .../geometry/index/distance_predicates.hpp | 12 +++++++++--- + include/boost/geometry/index/predicates.hpp | 16 +++++++++++----- + include/boost/geometry/index/rtree.hpp | 18 ++++++++++++++---- + 3 files changed, 34 insertions(+), 12 deletions(-) + +diff --git a/boost/geometry/index/distance_predicates.hpp b/boost/geometry/index/distance_predicates.hpp +index 59b32af4753..00fc663cb38 100644 +--- a/boost/geometry/index/distance_predicates.hpp ++++ b/boost/geometry/index/distance_predicates.hpp +@@ -2,7 +2,7 @@ + // + // Spatial index distance predicates, calculators and checkers used in nearest neighbor query + // +-// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. ++// Copyright (c) 2011-2022 Adam Wulkiewicz, Lodz, Poland. + // + // Use, modification and distribution is subject to the Boost Software License, + // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +@@ -11,6 +11,12 @@ + #ifndef BOOST_GEOMETRY_INDEX_DISTANCE_PREDICATES_HPP + #define BOOST_GEOMETRY_INDEX_DISTANCE_PREDICATES_HPP + ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES ++#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES ++#endif ++#endif ++ + #include + + /*! +@@ -21,7 +27,7 @@ namespace boost { namespace geometry { namespace index { + + // relations generators + +-#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES + + /*! + \brief Generate to_nearest() relationship. +@@ -91,7 +97,7 @@ detail::to_furthest to_furthest(T const& v) + return detail::to_furthest(v); + } + +-#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES + + // distance predicates generators + +diff --git a/boost/geometry/index/predicates.hpp b/boost/geometry/index/predicates.hpp +index 6da0d0ec5d0..3678188dcd1 100644 +--- a/boost/geometry/index/predicates.hpp ++++ b/boost/geometry/index/predicates.hpp +@@ -2,7 +2,7 @@ + // + // Spatial query predicates + // +-// Copyright (c) 2011-2018 Adam Wulkiewicz, Lodz, Poland. ++// Copyright (c) 2011-2022 Adam Wulkiewicz, Lodz, Poland. + // + // This file was modified by Oracle on 2019-2021. + // Modifications copyright (c) 2019-2021 Oracle and/or its affiliates. +@@ -15,6 +15,12 @@ + #ifndef BOOST_GEOMETRY_INDEX_PREDICATES_HPP + #define BOOST_GEOMETRY_INDEX_PREDICATES_HPP + ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES ++#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES ++#endif ++#endif ++ + #include + #include + +@@ -212,7 +218,7 @@ overlaps(Geometry const& g) + >(g); + } + +-#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES + + /*! + \brief Generate \c touches() predicate. +@@ -240,7 +246,7 @@ touches(Geometry const& g) + >(g); + } + +-#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES + + /*! + \brief Generate \c within() predicate. +@@ -343,7 +349,7 @@ nearest(Geometry const& geometry, std::size_t k) + return detail::predicates::nearest(geometry, k); + } + +-#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES + + /*! + \brief Generate path() predicate. +@@ -373,7 +379,7 @@ path(SegmentOrLinestring const& linestring, std::size_t k) + return detail::predicates::path(linestring, k); + } + +-#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES + + namespace detail { namespace predicates { + +diff --git a/boost/geometry/index/rtree.hpp b/boost/geometry/index/rtree.hpp +index af3b6f4ee07..6bb34faf6e9 100644 +--- a/boost/geometry/index/rtree.hpp ++++ b/boost/geometry/index/rtree.hpp +@@ -3,7 +3,7 @@ + // R-tree implementation + // + // Copyright (c) 2008 Federico J. Fernandez. +-// Copyright (c) 2011-2019 Adam Wulkiewicz, Lodz, Poland. ++// Copyright (c) 2011-2022 Adam Wulkiewicz, Lodz, Poland. + // Copyright (c) 2020 Caian Benedicto, Campinas, Brazil. + // + // This file was modified by Oracle on 2019-2021. +@@ -90,7 +90,15 @@ + #include + + #ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL +-// serialization ++#ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_SERIALIZATION ++#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_SERIALIZATION ++#endif ++#ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_ITERATORS ++#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_ITERATORS ++#endif ++#endif ++ ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_SERIALIZATION + #include + #endif + +@@ -312,7 +320,7 @@ class rtree + typedef typename members_holder::allocator_traits_type allocator_traits_type; + + friend class detail::rtree::utilities::view; +-#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_SERIALIZATION + friend class detail::rtree::private_view; + friend class detail::rtree::const_private_view; + #endif +@@ -1184,7 +1192,9 @@ class rtree + detail::rtree::iterators::distance_query_iterator + >; + +-#ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL ++#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_ITERATORS ++public: ++#else + private: + #endif + /*! diff --git a/boost/all/patches/1.79.0-smart_ptr_cw_ppc_msync.patch b/boost/all/patches/1.79.0-smart_ptr_cw_ppc_msync.patch new file mode 100644 index 0000000..61770f8 --- /dev/null +++ b/boost/all/patches/1.79.0-smart_ptr_cw_ppc_msync.patch @@ -0,0 +1,25 @@ +diff --git a/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp b/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +index 81387ce..58a69e6 100644 +--- a/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp ++++ b/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +@@ -35,8 +35,6 @@ BOOST_PRAGMA_MESSAGE("Using CodeWarrior/PowerPC sp_counted_base") + + #endif + +-BOOST_SP_OBSOLETE() +- + namespace boost + { + +@@ -64,7 +62,11 @@ inline long atomic_decrement( register long * pw ) + + asm + { ++#if defined(__PPCZen__) || defined(__PPCe500__) || defined(__PPCe500v2__) ++ msync ++#else + sync ++#endif + + loop: + diff --git a/boost/all/patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch b/boost/all/patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch new file mode 100644 index 0000000..0d28b86 --- /dev/null +++ b/boost/all/patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch @@ -0,0 +1,31 @@ +commit 9c9d127bddc2b72187c57f4933c49666255d7a4f +Author: Olavo Belloc +Date: Mon Aug 8 10:54:02 2022 +0200 + + Limit the buffer size for compatibility with previous versions of Windows + + The reported error was reproduced on Windows 7 and 8.1, but not on an early + version of Windows 10 (2004). + + Closes https://github.com/boostorg/filesystem/pull/246. + Likely fixes https://github.com/boostorg/filesystem/issues/245. + +diff --git a/libs/filesystem/src/directory.cpp b/libs/filesystem/src/directory.cpp +index 6a3e1dc..9334893 100644 +--- a/libs/filesystem/src/directory.cpp ++++ b/libs/filesystem/src/directory.cpp +@@ -599,9 +599,12 @@ extra_data_format g_extra_data_format = file_directory_information_format; + * \brief Extra buffer size for GetFileInformationByHandleEx-based or NtQueryDirectoryFile-based directory iterator. + * + * Must be large enough to accommodate at least one FILE_DIRECTORY_INFORMATION or *_DIR_INFO struct and one filename. +- * NTFS, VFAT, exFAT support filenames up to 255 UTF-16/UCS-2 characters. ReFS supports filenames up to 32768 UTF-16 characters. ++ * NTFS, VFAT, exFAT and ReFS support filenames up to 255 UTF-16/UCS-2 characters. (For ReFS, there is no information ++ * on the on-disk format, and it is possible that it supports longer filenames, up to 32768 UTF-16/UCS-2 characters.) ++ * The buffer cannot be larger than 64k, because up to Windows 8.1, NtQueryDirectoryFile and GetFileInformationByHandleEx ++ * fail with ERROR_INVALID_PARAMETER when trying to retrieve the filenames from a network share. + */ +-BOOST_CONSTEXPR_OR_CONST std::size_t dir_itr_extra_size = sizeof(file_id_extd_dir_info) + 65536u; ++BOOST_CONSTEXPR_OR_CONST std::size_t dir_itr_extra_size = 65536u; + + inline system::error_code dir_itr_close(dir_itr_imp& imp) BOOST_NOEXCEPT + { diff --git a/boost/all/patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch b/boost/all/patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch new file mode 100644 index 0000000..9312059 --- /dev/null +++ b/boost/all/patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch @@ -0,0 +1,171 @@ +commit 476ca7b6c1d37a5d796f8525813a9a64c9e54ffc +Author: Andrey Semashev +Date: Wed Aug 10 04:57:21 2022 +0300 + + Fix weakly_canonical on Windows with long paths prefix. + + During its operation, weakly_canonical would call status() on the path + consisting only from the root name of the input path. This would fail + with ERROR_INVALID_FUNCTION if the root name starts with the "\\?\" prefix, + as the root name path is not absolute. + + To fix this, we don't check the status of the root name path (which is + not the correct check anyways as it tests the current directory on the + corresponding drive for existence, which is not what we want). Additionally, + avoid calling status() on the paths containing dot and dot-dot elements + during the weakly_canonical execution for the same reason - the "\\?\" + prefix disables most of the path processing in Windows APIs, including + dot and dot-dot elements resolution. + + Fixes https://github.com/boostorg/filesystem/issues/247. + +diff --git a/libs/filesystem/src/operations.cpp b/libs/filesystem/src/operations.cpp +index dd636e9..ca2fff3 100644 +--- a/libs/filesystem/src/operations.cpp ++++ b/libs/filesystem/src/operations.cpp +@@ -4434,7 +4434,7 @@ path weakly_canonical(path const& p, path const& base, system::error_code* ec) + path head(p); + for (; !head.empty(); --itr) + { +- file_status head_status = detail::status_impl(head, &local_ec); ++ file_status head_status(detail::status_impl(head, &local_ec)); + if (BOOST_UNLIKELY(head_status.type() == fs::status_error)) + { + if (!ec) +@@ -4450,32 +4450,83 @@ path weakly_canonical(path const& p, path const& base, system::error_code* ec) + head.remove_filename(); + } + ++ if (head.empty()) ++ return p.lexically_normal(); ++ ++ path const& dot_p = dot_path(); ++ path const& dot_dot_p = dot_dot_path(); ++ + #else + +- // On Windows, filesystem APIs such as GetFileAttributesW perform lexical path normalization internally. +- // As a result, a path like "c:\a\.." can be reported as present even if "c:\a" is not. This would break +- // canonical, as symlink_status that it calls internally would report an error that the file at the intermediate +- // path does not exist. To avoid this, scan the initial path in the forward direction. +- // Also, operate on paths with preferred separators. This can be important on Windows since GetFileAttributesW, +- // which is called in status() may return "file not found" for paths to network shares and mounted cloud +- // storages that have forward slashes as separators. ++ // On Windows, filesystem APIs such as GetFileAttributesW and CreateFileW perform lexical path normalization ++ // internally. As a result, a path like "c:\a\.." can be reported as present even if "c:\a" is not. This would ++ // break canonical, as symlink_status that it calls internally would report an error that the file at the ++ // intermediate path does not exist. To avoid this, scan the initial path in the forward direction. ++ // Also, operate on paths with preferred separators. This can be important on Windows since GetFileAttributesW ++ // or CreateFileW, which is called in status() may return "file not found" for paths to network shares and ++ // mounted cloud storages that have forward slashes as separators. ++ // Also, avoid querying status of the root name such as \\?\c: as CreateFileW returns ERROR_INVALID_FUNCTION for ++ // such path. Querying the status of a root name such as c: is also not right as this path refers to the current ++ // directory on drive C:, which is not what we want to test for existence anyway. + path::iterator itr(p.begin()); + path head; +- for (; itr != p_end; ++itr) ++ if (p.has_root_name()) + { +- path const& p_elem = *itr; +- if (p_elem.size() == 1u && detail::is_directory_separator(p_elem.native()[0])) ++ BOOST_ASSERT(itr != p_end); ++ head = *itr; ++ ++itr; ++ } ++ ++ if (p.has_root_directory()) ++ { ++ BOOST_ASSERT(itr != p_end); ++ // Convert generic separator returned by the iterator for the root directory to ++ // the preferred separator. ++ head += path::preferred_separator; ++ ++itr; ++ } ++ ++ if (!head.empty()) ++ { ++ file_status head_status(detail::status_impl(head, &local_ec)); ++ if (BOOST_UNLIKELY(head_status.type() == fs::status_error)) + { +- // Convert generic separator returned by the iterator for the root directory to +- // the preferred separator. +- head += path::preferred_separator; ++ if (!ec) ++ BOOST_FILESYSTEM_THROW(filesystem_error("boost::filesystem::weakly_canonical", head, local_ec)); ++ ++ *ec = local_ec; ++ return path(); + } +- else ++ ++ if (head_status.type() == fs::file_not_found) ++ { ++ // If the root path does not exist then no path element exists ++ return p.lexically_normal(); ++ } ++ } ++ ++ path const& dot_p = dot_path(); ++ path const& dot_dot_p = dot_dot_path(); ++ for (; itr != p_end; ++itr) ++ { ++ path const& p_elem = *itr; ++ ++ // Avoid querying status of paths containing dot and dot-dot elements, as this will break ++ // if the root name starts with "\\?\". ++ if (p_elem == dot_p) ++ continue; ++ ++ if (p_elem == dot_dot_p) + { +- head /= p_elem; ++ if (head.has_relative_path()) ++ head.remove_filename(); ++ ++ continue; + } + +- file_status head_status = detail::status_impl(head, &local_ec); ++ head /= p_elem; ++ ++ file_status head_status(detail::status_impl(head, &local_ec)); + if (BOOST_UNLIKELY(head_status.type() == fs::status_error)) + { + if (!ec) +@@ -4492,33 +4543,22 @@ path weakly_canonical(path const& p, path const& base, system::error_code* ec) + } + } + ++ if (head.empty()) ++ return p.lexically_normal(); ++ + #endif + +- path const& dot_p = dot_path(); +- path const& dot_dot_p = dot_dot_path(); + path tail; + bool tail_has_dots = false; + for (; itr != p_end; ++itr) + { + path const& tail_elem = *itr; +-#if defined(BOOST_WINDOWS_API) +- if (tail_elem.size() == 1u && detail::is_directory_separator(tail_elem.native()[0])) +- { +- // Convert generic separator returned by the iterator for the root directory to +- // the preferred separator. +- tail += path::preferred_separator; +- continue; +- } +-#endif + tail /= tail_elem; + // for a later optimization, track if any dot or dot-dot elements are present + if (!tail_has_dots && (tail_elem == dot_p || tail_elem == dot_dot_p)) + tail_has_dots = true; + } + +- if (head.empty()) +- return p.lexically_normal(); +- + head = detail::canonical(head, base, &local_ec); + if (BOOST_UNLIKELY(!!local_ec)) + { diff --git a/boost/all/patches/1.80.0-0003-unordered-valid-after-move.patch b/boost/all/patches/1.80.0-0003-unordered-valid-after-move.patch new file mode 100644 index 0000000..4245f23 --- /dev/null +++ b/boost/all/patches/1.80.0-0003-unordered-valid-after-move.patch @@ -0,0 +1,175 @@ +diff -urN a/boost/unordered/detail/fca.hpp b/boost/unordered/detail/fca.hpp +--- a/boost/unordered/detail/fca.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/detail/fca.hpp 2022-08-24 19:44:43.139787681 -0400 +@@ -646,7 +646,7 @@ + + size_type bucket_count() const { return size_; } + +- iterator begin() const { return ++at(size_); } ++ iterator begin() const { return size_ == 0 ? end() : ++at(size_); } + + iterator end() const + { +@@ -660,6 +660,10 @@ + + local_iterator begin(size_type n) const + { ++ if (size_ == 0) { ++ return this->end(n); ++ } ++ + return local_iterator( + (buckets + static_cast(n))->next); + } +@@ -670,12 +674,16 @@ + + iterator at(size_type n) const + { +- std::size_t const N = group::N; ++ if (size_ > 0) { ++ std::size_t const N = group::N; + +- iterator pbg(buckets + static_cast(n), +- groups + static_cast(n / N)); ++ iterator pbg(buckets + static_cast(n), ++ groups + static_cast(n / N)); + +- return pbg; ++ return pbg; ++ } else { ++ return this->end(); ++ } + } + + span raw() +diff -urN a/boost/unordered/detail/implementation.hpp b/boost/unordered/detail/implementation.hpp +--- a/boost/unordered/detail/implementation.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/detail/implementation.hpp 2022-08-24 19:44:43.139787681 -0400 +@@ -2054,12 +2054,14 @@ + + std::size_t bucket_size(std::size_t index) const + { +- bucket_iterator itb = buckets_.at(index); +- node_pointer n = itb->next; + std::size_t count = 0; +- while (n) { +- ++count; +- n = n->next; ++ if (size_ > 0) { ++ bucket_iterator itb = buckets_.at(index); ++ node_pointer n = itb->next; ++ while (n) { ++ ++count; ++ n = n->next; ++ } + } + return count; + } +@@ -2420,11 +2422,14 @@ + node_pointer find_node_impl( + Key const& x, bucket_iterator itb) const + { +- key_equal const& pred = this->key_eq(); +- node_pointer p = itb->next; +- for (; p; p = p->next) { +- if (pred(x, extractor::extract(p->value()))) { +- break; ++ node_pointer p = node_pointer(); ++ if (itb != buckets_.end()) { ++ key_equal const& pred = this->key_eq(); ++ p = itb->next; ++ for (; p; p = p->next) { ++ if (pred(x, extractor::extract(p->value()))) { ++ break; ++ } + } + } + return p; +@@ -2453,11 +2458,13 @@ + inline iterator transparent_find( + Key const& k, Hash const& h, Pred const& pred) const + { +- std::size_t const key_hash = h(k); +- bucket_iterator itb = buckets_.at(buckets_.position(key_hash)); +- for (node_pointer p = itb->next; p; p = p->next) { +- if (BOOST_LIKELY(pred(k, extractor::extract(p->value())))) { +- return iterator(p, itb); ++ if (size_ > 0) { ++ std::size_t const key_hash = h(k); ++ bucket_iterator itb = buckets_.at(buckets_.position(key_hash)); ++ for (node_pointer p = itb->next; p; p = p->next) { ++ if (BOOST_LIKELY(pred(k, extractor::extract(p->value())))) { ++ return iterator(p, itb); ++ } + } + } + +@@ -2467,11 +2474,13 @@ + template + node_pointer* find_prev(Key const& key, bucket_iterator itb) + { +- key_equal pred = this->key_eq(); +- for (node_pointer* pp = boost::addressof(itb->next); *pp; +- pp = boost::addressof((*pp)->next)) { +- if (pred(key, extractor::extract((*pp)->value()))) { +- return pp; ++ if (size_ > 0) { ++ key_equal pred = this->key_eq(); ++ for (node_pointer* pp = boost::addressof(itb->next); *pp; ++ pp = boost::addressof((*pp)->next)) { ++ if (pred(key, extractor::extract((*pp)->value()))) { ++ return pp; ++ } + } + } + typedef node_pointer* node_pointer_pointer; +diff -urN a/boost/unordered/unordered_map.hpp b/boost/unordered/unordered_map.hpp +--- a/boost/unordered/unordered_map.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/unordered_map.hpp 2022-08-24 19:44:43.139787681 -0400 +@@ -2069,6 +2069,10 @@ + template + float unordered_map::load_factor() const BOOST_NOEXCEPT + { ++ if (table_.size_ == 0) { ++ return 0.0f; ++ } ++ + BOOST_ASSERT(table_.bucket_count() != 0); + return static_cast(table_.size_) / + static_cast(table_.bucket_count()); +@@ -2506,6 +2510,10 @@ + template + float unordered_multimap::load_factor() const BOOST_NOEXCEPT + { ++ if (table_.size_ == 0) { ++ return 0.0f; ++ } ++ + BOOST_ASSERT(table_.bucket_count() != 0); + return static_cast(table_.size_) / + static_cast(table_.bucket_count()); +diff -urN a/boost/unordered/unordered_set.hpp b/boost/unordered/unordered_set.hpp +--- a/boost/unordered/unordered_set.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/unordered_set.hpp 2022-08-24 19:44:43.139787681 -0400 +@@ -1586,6 +1586,10 @@ + template + float unordered_set::load_factor() const BOOST_NOEXCEPT + { ++ if (table_.size_ == 0) { ++ return 0.0f; ++ } ++ + BOOST_ASSERT(table_.bucket_count() != 0); + return static_cast(table_.size_) / + static_cast(table_.bucket_count()); +@@ -1986,6 +1990,10 @@ + template + float unordered_multiset::load_factor() const BOOST_NOEXCEPT + { ++ if (table_.size_ == 0) { ++ return 0.0f; ++ } ++ + BOOST_ASSERT(table_.bucket_count() != 0); + return static_cast(table_.size_) / + static_cast(table_.bucket_count()); diff --git a/boost/all/patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch b/boost/all/patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch new file mode 100644 index 0000000..dfa4438 --- /dev/null +++ b/boost/all/patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch @@ -0,0 +1,21 @@ +commit 5864f397ccad30f6e73221b90bdac57a303b9752 +Author: Andrey Semashev +Date: Fri Aug 12 12:59:56 2022 +0300 + + Fixed a missing include on POSIX systems that don't support *at APIs. + + Fixes https://github.com/boostorg/filesystem/issues/250. + +diff --git a/libs/filesystem/src/operations.cpp b/libs/filesystem/src/operations.cpp +index ca2fff3..e22967e 100644 +--- a/libs/filesystem/src/operations.cpp ++++ b/libs/filesystem/src/operations.cpp +@@ -70,7 +70,7 @@ + + #include + #include +-#if _POSIX_C_SOURCE < 200809L ++#if !defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS) + #include + #endif + #include diff --git a/boost/all/patches/1.80.0-0005-config-libcpp15.patch b/boost/all/patches/1.80.0-0005-config-libcpp15.patch new file mode 100644 index 0000000..1e84702 --- /dev/null +++ b/boost/all/patches/1.80.0-0005-config-libcpp15.patch @@ -0,0 +1,16 @@ +--- a/boost/config/stdlib/libcpp.hpp 2022-08-03 22:47:07.000000000 -0400 ++++ b/boost/config/stdlib/libcpp.hpp 2022-09-16 22:16:17.044119011 -0400 +@@ -168,4 +168,13 @@ + # define BOOST_NO_CXX14_HDR_SHARED_MUTEX + #endif + ++#if _LIBCPP_VERSION >= 15000 ++// ++// Unary function is now deprecated in C++11 and later: ++// ++#if __cplusplus >= 201103L ++#define BOOST_NO_CXX98_FUNCTION_BASE ++#endif ++#endif ++ + // --- end --- diff --git a/boost/all/patches/1.80.0-0006-unordered-msvc-rtcc.patch b/boost/all/patches/1.80.0-0006-unordered-msvc-rtcc.patch new file mode 100644 index 0000000..ff13301 --- /dev/null +++ b/boost/all/patches/1.80.0-0006-unordered-msvc-rtcc.patch @@ -0,0 +1,18 @@ +--- a/boost/unordered/detail/prime_fmod.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/detail/prime_fmod.hpp 2022-12-14 01:45:27.368620146 -0500 +@@ -117,9 +117,15 @@ + #if defined(BOOST_UNORDERED_FCA_HAS_64B_SIZE_T) + std::size_t sizes_under_32bit = inv_sizes32_len; + if (BOOST_LIKELY(size_index < sizes_under_32bit)) { ++#if defined(__MSVC_RUNTIME_CHECKS) ++ return fast_modulo( ++ boost::uint32_t(hash & 0xffffffffu) + boost::uint32_t(hash >> 32), ++ inv_sizes32[size_index], boost::uint32_t(sizes[size_index])); ++#else + return fast_modulo( + boost::uint32_t(hash) + boost::uint32_t(hash >> 32), + inv_sizes32[size_index], boost::uint32_t(sizes[size_index])); ++#endif + } else { + return positions[size_index - sizes_under_32bit](hash); + } diff --git a/boost/all/patches/1.80.0-locale-fail-on-missing-backend.patch b/boost/all/patches/1.80.0-locale-fail-on-missing-backend.patch new file mode 100644 index 0000000..e352396 --- /dev/null +++ b/boost/all/patches/1.80.0-locale-fail-on-missing-backend.patch @@ -0,0 +1,84 @@ +diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2 +index 3c517c884..0f521dbcf 100644 +--- a/libs/locale/build/Jamfile.v2 ++++ b/libs/locale/build/Jamfile.v2 +@@ -20,6 +20,7 @@ project /boost/locale + # Features + + feature.feature boost.locale.iconv : on off : optional propagated ; ++feature.feature boost.locale.iconv.lib : libc libiconv : optional propagated ; + feature.feature boost.locale.icu : on off : optional propagated ; + feature.feature boost.locale.posix : on off : optional propagated ; + feature.feature boost.locale.std : on off : optional propagated ; +@@ -29,7 +30,8 @@ feature.feature boost.locale.winapi : on off : optional propagated ; + + ## iconv + +-exe has_iconv : $(TOP)/build/has_iconv.cpp ; ++obj has_iconv_libc_obj : $(TOP)/build/has_iconv.cpp ; ++exe has_iconv : has_iconv_libc_obj ; + explicit has_iconv ; + + ICONV_PATH = [ modules.peek : ICONV_PATH ] ; +@@ -43,7 +45,8 @@ lib iconv + + explicit iconv ; + +-exe has_external_iconv : $(TOP)/build/has_iconv.cpp iconv ; ++obj has_iconv_libc_ext : $(TOP)/build/has_iconv.cpp iconv ; ++exe has_external_iconv : has_iconv_libc_ext iconv ; + explicit has_external_iconv ; + + exe accepts_shared_option : $(TOP)/build/option.cpp +@@ -230,10 +233,37 @@ rule configure-full ( properties * : flags-only ) + if [ configure.builds has_iconv : $(properties) : "iconv (libc)" ] + { + found-iconv = true ; +- } else if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] ++ if libiconv in $(properties) ++ { ++ if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] ++ { ++ result += iconv ; ++ } ++ else ++ { ++ EXIT "- Boost.Locale found iconv (libc) instead of iconv (separate) library to be built." ; ++ } ++ } ++ } ++ else if libc in $(properties) + { +- found-iconv = true ; +- result += iconv ; ++ EXIT "- Boost.Locale failed to find iconv (libc) library to be built." ; ++ } ++ else ++ { ++ if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] ++ { ++ found-iconv = true ; ++ result += iconv ; ++ } ++ else if libiconv in $(properties) ++ { ++ EXIT "- Boost.Locale failed to find iconv (separate) library to be built." ; ++ } ++ } ++ if ! $(found-iconv) ++ { ++ EXIT "- Boost.Locale failed to find iconv library to be built." ; + } + } + if $(found-iconv) +@@ -273,6 +303,10 @@ rule configure-full ( properties * : flags-only ) + /boost/thread//boost_thread + ; + } ++ else ++ { ++ EXIT "- Boost.Locale failed to find ICU library to be built." ; ++ } + } + + if ! $(found-iconv) && ! $(found-icu) && ! windows in $(properties) && ! cygwin in $(properties) diff --git a/boost/all/patches/1.81.0-locale-fail-on-missing-backend.patch b/boost/all/patches/1.81.0-locale-fail-on-missing-backend.patch new file mode 100644 index 0000000..80b22dd --- /dev/null +++ b/boost/all/patches/1.81.0-locale-fail-on-missing-backend.patch @@ -0,0 +1,12 @@ +diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2 +index f1321db3..36899cdc 100644 +--- a/libs/locale/build/Jamfile.v2 ++++ b/libs/locale/build/Jamfile.v2 +@@ -22,6 +22,7 @@ project /boost/locale + # Features + + feature.feature boost.locale.iconv : on off : optional propagated ; ++feature.feature boost.locale.iconv.lib : libc libiconv : optional propagated ; + feature.feature boost.locale.icu : on off : optional propagated ; + feature.feature boost.locale.posix : on off : optional propagated ; + feature.feature boost.locale.std : on off : optional propagated ; diff --git a/boost/all/patches/1.82.0-locale-iconv-library-option.patch b/boost/all/patches/1.82.0-locale-iconv-library-option.patch new file mode 100644 index 0000000..80b22dd --- /dev/null +++ b/boost/all/patches/1.82.0-locale-iconv-library-option.patch @@ -0,0 +1,12 @@ +diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2 +index f1321db3..36899cdc 100644 +--- a/libs/locale/build/Jamfile.v2 ++++ b/libs/locale/build/Jamfile.v2 +@@ -22,6 +22,7 @@ project /boost/locale + # Features + + feature.feature boost.locale.iconv : on off : optional propagated ; ++feature.feature boost.locale.iconv.lib : libc libiconv : optional propagated ; + feature.feature boost.locale.icu : on off : optional propagated ; + feature.feature boost.locale.posix : on off : optional propagated ; + feature.feature boost.locale.std : on off : optional propagated ; diff --git a/boost/all/patches/1.83.0-locale-msvc.patch b/boost/all/patches/1.83.0-locale-msvc.patch new file mode 100644 index 0000000..acb9510 --- /dev/null +++ b/boost/all/patches/1.83.0-locale-msvc.patch @@ -0,0 +1,22 @@ +From 0552ffc29ff11e4fe130b7143ea6ac2bee7b15c6 Mon Sep 17 00:00:00 2001 +From: wevsty +Date: Sat, 12 Aug 2023 22:13:48 +0800 +Subject: [PATCH] fix build error on MSVC + +--- + boost/locale/util/string.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/boost/locale/util/string.hpp b/boost/locale/util/string.hpp +index 9ab9521c..ba066bd4 100644 +--- a/boost/locale/util/string.hpp ++++ b/boost/locale/util/string.hpp +@@ -38,7 +38,7 @@ namespace boost { namespace locale { namespace util { + /// Cast an unsigned char to a (possibly signed) char avoiding implementation defined behavior + constexpr char to_char(unsigned char c) + { +- return static_cast((c - std::numeric_limits::min()) + std::numeric_limits::min()); ++ return static_cast((c - (std::numeric_limits::min)()) + (std::numeric_limits::min)()); + } + + }}} // namespace boost::locale::util diff --git a/boost/all/patches/1.84.0-reimplement-string_set-as-any-string.patch b/boost/all/patches/1.84.0-reimplement-string_set-as-any-string.patch new file mode 100644 index 0000000..1539372 --- /dev/null +++ b/boost/all/patches/1.84.0-reimplement-string_set-as-any-string.patch @@ -0,0 +1,337 @@ +Fixes compilation with cppstd=20 on MacOS + +From c5e8f02c903696a213fc4b710f6740ccd1f07f4e Mon Sep 17 00:00:00 2001 +From: Alexander Grund +Date: Sun, 3 Dec 2023 20:06:27 +0100 +Subject: [PATCH] Reimplement `string_set` as `any_string` + +Use a better name for a type-erased string implemented using +`dynamic_cast` instead of storing&comparing the `typeid` of the char +type used. +This is a workaround for missing typeinfo for `char8_t` on e.g. libc++ +on FreeBSD 13.1. +It also simplifies memory management size calc/copy implementation. +--- + boost/locale/detail/any_string.hpp | 71 ++++++++++++++++++++++ + boost/locale/formatting.hpp | 51 ++-------------- + libs/locale/src/boost/locale/formatting.cpp | 45 -------------- + libs/locale/test/test_ios_info.cpp | 64 +++++++++++++++---- + 4 files changed, 127 insertions(+), 104 deletions(-) + create mode 100644 boost/locale/detail/any_string.hpp + +diff --git a/boost/locale/detail/any_string.hpp b/boost/locale/detail/any_string.hpp +new file mode 100644 +index 00000000..c0cc7ffb +--- /dev/null ++++ b/boost/locale/detail/any_string.hpp +@@ -0,0 +1,71 @@ ++// ++// Copyright (c) 2023 Alexander Grund ++// ++// Distributed under the Boost Software License, Version 1.0. ++// https://www.boost.org/LICENSE_1_0.txt ++ ++#ifndef BOOST_LOCALE_DETAIL_ANY_STRING_HPP_INCLUDED ++#define BOOST_LOCALE_DETAIL_ANY_STRING_HPP_INCLUDED ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/// \cond INTERNAL ++namespace boost { namespace locale { namespace detail { ++ /// Type-erased std::basic_string ++ class any_string { ++ struct BOOST_SYMBOL_VISIBLE base { ++ virtual ~base() = default; ++ virtual base* clone() const = 0; ++ ++ protected: ++ base() = default; ++ base(const base&) = default; ++ base(base&&) = delete; ++ base& operator=(const base&) = default; ++ base& operator=(base&&) = delete; ++ }; ++ template ++ struct BOOST_SYMBOL_VISIBLE impl : base { ++ explicit impl(const boost::basic_string_view value) : s(value) {} ++ impl* clone() const override { return new impl(*this); } ++ std::basic_string s; ++ }; ++ ++ std::unique_ptr s_; ++ ++ public: ++ any_string() = default; ++ any_string(const any_string& other) : s_(other.s_ ? other.s_->clone() : nullptr) {} ++ any_string(any_string&&) = default; ++ any_string& operator=(any_string other) // Covers the copy and move assignment ++ { ++ s_.swap(other.s_); ++ return *this; ++ } ++ ++ template ++ void set(const boost::basic_string_view s) ++ { ++ BOOST_ASSERT(!s.empty()); ++ s_.reset(new impl(s)); ++ } ++ ++ template ++ std::basic_string get() const ++ { ++ if(!s_) ++ throw std::bad_cast(); ++ return dynamic_cast&>(*s_).s; ++ } ++ }; ++ ++}}} // namespace boost::locale::detail ++ ++/// \endcond ++ ++#endif +diff --git a/boost/locale/formatting.hpp b/boost/locale/formatting.hpp +index d14e6f69..e3c8619e 100644 +--- a/boost/locale/formatting.hpp ++++ b/boost/locale/formatting.hpp +@@ -8,15 +8,13 @@ + #ifndef BOOST_LOCALE_FORMATTING_HPP_INCLUDED + #define BOOST_LOCALE_FORMATTING_HPP_INCLUDED + ++#include + #include +-#include +-#include + #include + #include + #include + #include + #include +-#include + + #ifdef BOOST_MSVC + # pragma warning(push) +@@ -130,13 +128,13 @@ namespace boost { namespace locale { + template + void date_time_pattern(const std::basic_string& str) + { +- date_time_pattern_set().set(str); ++ datetime_.set(str); + } + /// Get date/time pattern (strftime like) + template + std::basic_string date_time_pattern() const + { +- return date_time_pattern_set().get(); ++ return datetime_.get(); + } + + /// \cond INTERNAL +@@ -144,51 +142,10 @@ namespace boost { namespace locale { + /// \endcond + + private: +- class string_set; +- +- const string_set& date_time_pattern_set() const; +- string_set& date_time_pattern_set(); +- +- class BOOST_LOCALE_DECL string_set { +- public: +- string_set(); +- ~string_set(); +- string_set(const string_set& other); +- string_set& operator=(string_set other); +- void swap(string_set& other); +- +- template +- void set(const boost::basic_string_view s) +- { +- BOOST_ASSERT(!s.empty()); +- delete[] ptr; +- ptr = nullptr; +- type = &typeid(Char); +- size = sizeof(Char) * s.size(); +- ptr = size ? new char[size] : nullptr; +- memcpy(ptr, s.data(), size); +- } +- +- template +- std::basic_string get() const +- { +- if(type == nullptr || *type != typeid(Char)) +- throw std::bad_cast(); +- std::basic_string result(size / sizeof(Char), Char(0)); +- memcpy(&result.front(), ptr, size); +- return result; +- } +- +- private: +- const std::type_info* type; +- size_t size; +- char* ptr; +- }; +- + uint64_t flags_; + int domain_id_; + std::string time_zone_; +- string_set datetime_; ++ detail::any_string datetime_; + }; + + /// \brief This namespace includes all manipulators that can be used on IO streams +diff --git a/src/boost/locale/shared/formatting.cpp b/src/boost/locale/shared/formatting.cpp +index 489d1fd5..457ba782 100644 +--- a/libs/locale/src/boost/locale/shared/formatting.cpp ++++ b/libs/locale/src/boost/locale/shared/formatting.cpp +@@ -7,43 +7,8 @@ + #include + #include + #include "boost/locale/shared/ios_prop.hpp" +-#include +-#include + + namespace boost { namespace locale { +- +- ios_info::string_set::string_set() : type(nullptr), size(0), ptr(nullptr) {} +- ios_info::string_set::~string_set() +- { +- delete[] ptr; +- } +- ios_info::string_set::string_set(const string_set& other) +- { +- if(other.ptr != nullptr) { +- ptr = new char[other.size]; +- size = other.size; +- type = other.type; +- memcpy(ptr, other.ptr, size); +- } else { +- ptr = nullptr; +- size = 0; +- type = nullptr; +- } +- } +- +- void ios_info::string_set::swap(string_set& other) +- { +- std::swap(type, other.type); +- std::swap(size, other.size); +- std::swap(ptr, other.ptr); +- } +- +- ios_info::string_set& ios_info::string_set::operator=(string_set other) +- { +- swap(other); +- return *this; +- } +- + ios_info::ios_info() : flags_(0), domain_id_(0), time_zone_(time_zone::global()) {} + + ios_info::~ios_info() = default; +@@ -105,16 +70,6 @@ namespace boost { namespace locale { + return time_zone_; + } + +- const ios_info::string_set& ios_info::date_time_pattern_set() const +- { +- return datetime_; +- } +- +- ios_info::string_set& ios_info::date_time_pattern_set() +- { +- return datetime_; +- } +- + ios_info& ios_info::get(std::ios_base& ios) + { + return impl::ios_prop::get(ios); +diff --git a/libs/locale/test/test_ios_info.cpp b/libs/locale/test/test_ios_info.cpp +index 9b63aaed..79179a8f 100644 +--- a/libs/locale/test/test_ios_info.cpp ++++ b/libs/locale/test/test_ios_info.cpp +@@ -105,18 +105,6 @@ void test_member_methods() + + info.date_time_pattern(std::string("Pattern")); + TEST_EQ(info.date_time_pattern(), "Pattern"); +- +- info.date_time_pattern(ascii_to("WChar Pattern")); +- TEST_EQ(info.date_time_pattern(), ascii_to("WChar Pattern")); +- TEST_THROWS(info.date_time_pattern(), std::bad_cast); +- +- info.date_time_pattern(ascii_to("Char16 Pattern")); +- TEST_THROWS(info.date_time_pattern(), std::bad_cast); +- TEST_EQ(info.date_time_pattern(), ascii_to("Char16 Pattern")); +- +- info.date_time_pattern(ascii_to("Char32 Pattern")); +- TEST_THROWS(info.date_time_pattern(), std::bad_cast); +- TEST_EQ(info.date_time_pattern(), ascii_to("Char32 Pattern")); + } + } + +@@ -212,8 +200,60 @@ void test_manipulators() + TEST_EQ(info2.date_time_pattern(), L"My TZ"); + } + ++void test_any_string() ++{ ++ boost::locale::detail::any_string s; ++ TEST_THROWS(s.get(), std::bad_cast); ++ TEST_THROWS(s.get(), std::bad_cast); ++ ++ s.set("Char Pattern"); ++ TEST_EQ(s.get(), "Char Pattern"); ++ TEST_THROWS(s.get(), std::bad_cast); ++ ++ s.set(ascii_to("WChar Pattern")); ++ TEST_EQ(s.get(), ascii_to("WChar Pattern")); ++ TEST_THROWS(s.get(), std::bad_cast); ++ ++ s.set(ascii_to("Char16 Pattern")); ++ TEST_EQ(s.get(), ascii_to("Char16 Pattern")); ++ TEST_THROWS(s.get(), std::bad_cast); ++ ++ s.set(ascii_to("Char32 Pattern")); ++ TEST_EQ(s.get(), ascii_to("Char32 Pattern")); ++ TEST_THROWS(s.get(), std::bad_cast); ++ ++#ifndef BOOST_LOCALE_NO_CXX20_STRING8 ++ s.set(ascii_to("Char8 Pattern")); ++ TEST_EQ(s.get(), ascii_to("Char8 Pattern")); ++ TEST_THROWS(s.get(), std::bad_cast); ++#endif ++ ++ boost::locale::detail::any_string s1, s2, empty; ++ s1.set("Char"); ++ s2.set(ascii_to("WChar")); ++ // Copy ctor ++ boost::locale::detail::any_string s3(s1); ++ TEST_EQ(s3.get(), "Char"); ++ TEST_EQ(s1.get(), "Char"); ++ // Ensure deep copy ++ s3.set("Foo"); ++ TEST_EQ(s3.get(), "Foo"); ++ TEST_EQ(s1.get(), "Char"); ++ // Copy assign ++ s3 = s2; ++ TEST_EQ(s3.get(), ascii_to("WChar")); ++ TEST_EQ(s2.get(), ascii_to("WChar")); ++ // Move assign ++ s3 = std::move(s1); ++ TEST_EQ(s3.get(), "Char"); ++ // From empty ++ s3 = empty; ++ TEST_THROWS(s3.get(), std::bad_cast); ++} ++ + void test_main(int /*argc*/, char** /*argv*/) + { ++ test_any_string(); + test_member_methods(); + test_manipulators(); + } diff --git a/boost/all/patches/1.85.0-container-aliasing-violation-fix.patch b/boost/all/patches/1.85.0-container-aliasing-violation-fix.patch new file mode 100644 index 0000000..aa3c821 --- /dev/null +++ b/boost/all/patches/1.85.0-container-aliasing-violation-fix.patch @@ -0,0 +1,417 @@ +From a92131b34b78f7f010881750ecb8b4ce274511d2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= +Date: Sun, 28 Apr 2024 23:29:59 +0200 +Subject: [PATCH 1/1] Remove UB in flat_map implementation when the + implementation has a movable std::pair + +--- + boost/container/allocator_traits.hpp | 144 +++++++++++++++++- + boost/container/detail/construct_in_place.hpp | 36 ++++- + boost/container/flat_map.hpp | 67 ++++++-- + 3 files changed, 229 insertions(+), 18 deletions(-) + +diff --git a/boost/container/allocator_traits.hpp b/boost/container/allocator_traits.hpp +index cdb6683e8..8e2fafa7f 100644 +--- a/boost/container/allocator_traits.hpp ++++ b/boost/container/allocator_traits.hpp +@@ -32,6 +32,8 @@ + #include + #include //is_empty + #include ++#include ++#include + #ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP + #include + #endif +@@ -81,6 +83,144 @@ + + namespace boost { + namespace container { ++namespace dtl { ++ ++#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) ++ ++template ++BOOST_CONTAINER_FORCEINLINE void construct_type(T *p, BOOST_FWD_REF(Args) ...args) ++{ ++ ::new((void*)p, boost_container_new_t()) T(::boost::forward(args)...); ++} ++ ++template < class Pair, class KeyType, class ... Args> ++typename dtl::enable_if< dtl::is_pair, void >::type ++construct_type ++ (Pair* p, try_emplace_t, BOOST_FWD_REF(KeyType) k, BOOST_FWD_REF(Args) ...args) ++{ ++ construct_type(dtl::addressof(p->first), ::boost::forward(k)); ++ BOOST_CONTAINER_TRY{ ++ construct_type(dtl::addressof(p->second), ::boost::forward(args)...); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename Pair::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++#else ++ ++#define BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPEJ(N) \ ++template\ ++BOOST_CONTAINER_FORCEINLINE \ ++ typename dtl::disable_if_c::value, void >::type \ ++construct_type(T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ ++{\ ++ ::new((void*)p, boost_container_new_t()) T( BOOST_MOVE_FWD##N );\ ++}\ ++// ++BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPEJ) ++#undef BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPEJ ++ ++#define BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPE(N) \ ++template < class Pair, class KeyType BOOST_MOVE_I##N BOOST_MOVE_CLASS##N>\ ++typename dtl::enable_if< dtl::is_pair, void >::type construct_type\ ++ (Pair* p, try_emplace_t, BOOST_FWD_REF(KeyType) k BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ ++{\ ++ construct_type(dtl::addressof(p->first), ::boost::forward(k));\ ++ BOOST_CONTAINER_TRY{\ ++ construct_type(dtl::addressof(p->second) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\ ++ }\ ++ BOOST_CONTAINER_CATCH(...) {\ ++ typedef typename Pair::first_type first_type;\ ++ dtl::addressof(p->first)->~first_type();\ ++ BOOST_CONTAINER_RETHROW\ ++ }\ ++ BOOST_CONTAINER_CATCH_END\ ++}\ ++// ++BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPE) ++#undef BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPE ++ ++#endif ++ ++template ++inline ++typename dtl::enable_if, void >::type ++construct_type(T* p) ++{ ++ dtl::construct_type(dtl::addressof(p->first)); ++ BOOST_CONTAINER_TRY{ ++ dtl::construct_type(dtl::addressof(p->second)); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename T::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++ ++template ++inline ++typename dtl::enable_if_c ++ < dtl::is_pair::value ++ , void >::type ++construct_type(T* p, U &u) ++{ ++ dtl::construct_type(dtl::addressof(p->first), u.first); ++ BOOST_CONTAINER_TRY{ ++ dtl::construct_type(dtl::addressof(p->second), u.second); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename T::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++template ++inline ++typename dtl::enable_if_c ++ < dtl::is_pair::type>::value && ++ !boost::move_detail::is_reference::value //This is needed for MSVC10 and ambiguous overloads ++ , void >::type ++construct_type(T* p, BOOST_RV_REF(U) u) ++{ ++ dtl::construct_type(dtl::addressof(p->first), ::boost::move(u.first)); ++ BOOST_CONTAINER_TRY{ ++ dtl::construct_type(dtl::addressof(p->second), ::boost::move(u.second)); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename T::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++template ++inline ++typename dtl::enable_if, void >::type ++construct_type(T* p, BOOST_FWD_REF(U) x, BOOST_FWD_REF(V) y) ++{ ++ dtl::construct_type(dtl::addressof(p->first), ::boost::forward(x)); ++ BOOST_CONTAINER_TRY{ ++ dtl::construct_type(dtl::addressof(p->second), ::boost::forward(y)); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename T::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++} //namespace dtl + + #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED + +@@ -419,7 +559,7 @@ struct allocator_traits + + template + inline static void priv_construct(dtl::false_type, Allocator &, T *p, BOOST_FWD_REF(Args) ...args) +- { ::new((void*)p, boost_container_new_t()) T(::boost::forward(args)...); } ++ { dtl::construct_type(p, ::boost::forward(args)...); } + #else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + public: + +@@ -450,7 +590,7 @@ struct allocator_traits + \ + template\ + inline static void priv_construct(dtl::false_type, Allocator &, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ +- { ::new((void*)p, boost_container_new_t()) T(BOOST_MOVE_FWD##N); }\ ++ { dtl::construct_type(p BOOST_MOVE_I##N BOOST_MOVE_FWD##N); }\ + // + BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_PRIV_CONSTRUCT_IMPL) + #undef BOOST_CONTAINER_ALLOCATOR_TRAITS_PRIV_CONSTRUCT_IMPL +diff --git a/boost/container/detail/construct_in_place.hpp b/boost/container/detail/construct_in_place.hpp +index d824d814a..bfdf05c2e 100644 +--- a/boost/container/detail/construct_in_place.hpp ++++ b/boost/container/detail/construct_in_place.hpp +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + namespace boost { + namespace container { +@@ -62,9 +63,42 @@ BOOST_CONTAINER_FORCEINLINE void construct_in_place(Allocator &a, T *dest, empla + + //Assignment + ++template ++BOOST_CONTAINER_FORCEINLINE ++ typename dtl::disable_if_c ++ < dtl::is_pair::type>::value ++ && dtl::is_pair::type>::value ++ , void>::type ++assign_in_place_ref(T &t, BOOST_FWD_REF(U) u) ++{ t = ::boost::forward(u); } ++ ++template ++BOOST_CONTAINER_FORCEINLINE ++ typename dtl::enable_if_c ++ < dtl::is_pair::type>::value ++ && dtl::is_pair::type>::value ++ , void>::type ++assign_in_place_ref(T &t, const U &u) ++{ ++ assign_in_place_ref(t.first, u.first); ++ assign_in_place_ref(t.second, u.second); ++} ++ ++template ++BOOST_CONTAINER_FORCEINLINE ++ typename dtl::enable_if_c ++ < dtl::is_pair::type>::value ++ && dtl::is_pair::type>::value ++ , void>::type ++assign_in_place_ref(T &t, BOOST_RV_REF(U) u) ++{ ++ assign_in_place_ref(t.first, ::boost::move(u.first)); ++ assign_in_place_ref(t.second, ::boost::move(u.second)); ++} ++ + template + BOOST_CONTAINER_FORCEINLINE void assign_in_place(DstIt dest, InpIt source) +-{ *dest = *source; } ++{ assign_in_place_ref(*dest, *source); } + + template + BOOST_CONTAINER_FORCEINLINE void assign_in_place(DstIt dest, value_init_construct_iterator) +diff --git a/boost/container/flat_map.hpp b/boost/container/flat_map.hpp +index b092fb212..e4843f566 100644 +--- a/boost/container/flat_map.hpp ++++ b/boost/container/flat_map.hpp +@@ -48,6 +48,11 @@ + #include + #endif + ++#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) ++#define BOOST_CONTAINER_STD_PAIR_IS_MOVABLE ++#endif ++ ++ + namespace boost { + namespace container { + +@@ -58,21 +63,37 @@ class flat_multimap; + + namespace dtl{ + ++#if defined(BOOST_CONTAINER_STD_PAIR_IS_MOVABLE) + template + BOOST_CONTAINER_FORCEINLINE static D &force(S &s) +-{ return *move_detail::force_ptr(&s); } ++{ return s; } + + template + BOOST_CONTAINER_FORCEINLINE static const D &force(const S &s) +-{ return *move_detail::force_ptr(&s); } ++{ return s; } ++ ++template ++BOOST_CONTAINER_FORCEINLINE static D force_copy(D s) ++{ return s; } ++ ++#else //!BOOST_CONTAINER_DOXYGEN_INVOKED ++ ++template ++BOOST_CONTAINER_FORCEINLINE static D &force(S &s) ++{ return *move_detail::launder_cast(&s); } ++ ++template ++BOOST_CONTAINER_FORCEINLINE static const D &force(const S &s) ++{ return *move_detail::launder_cast(&s); } + + template + BOOST_CONTAINER_FORCEINLINE static D force_copy(const S &s) + { +- const D *const vp = move_detail::force_ptr(&s); ++ const D *const vp = move_detail::launder_cast(&s); + D ret_val(*vp); + return ret_val; + } ++#endif //BOOST_CONTAINER_DOXYGEN_INVOKED + + } //namespace dtl{ + +@@ -118,18 +139,27 @@ class flat_map + private: + BOOST_COPYABLE_AND_MOVABLE(flat_map) + //This is the tree that we should store if pair was movable ++ typedef std::pair std_pair_t; + typedef dtl::flat_tree< +- std::pair, ++ std_pair_t, + dtl::select1st, + Compare, + AllocatorOrContainer> tree_t; + + //This is the real tree stored here. It's based on a movable pair ++ typedef dtl::pair dtl_pair_t; ++ ++ #ifdef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE ++ typedef std_pair_t impl_pair_t; ++ #else ++ typedef dtl_pair_t impl_pair_t; ++ #endif ++ + typedef dtl::flat_tree< +- dtl::pair, ++ impl_pair_t, + dtl::select1st, + Compare, +- typename dtl::container_or_allocator_rebind >::type ++ typename dtl::container_or_allocator_rebind::type + > impl_tree_t; + impl_tree_t m_flat_tree; // flat tree representing flat_map + +@@ -851,7 +881,7 @@ class flat_map + //! @copydoc ::boost::container::flat_set::nth(size_type) const + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + const_iterator nth(size_type n) const BOOST_NOEXCEPT_OR_NOTHROW +- { return dtl::force_copy(m_flat_tree.nth(n)); } ++ { return dtl::force_copy(m_flat_tree.nth(n)); } + + //! @copydoc ::boost::container::flat_set::index_of(iterator) + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline +@@ -1099,7 +1129,7 @@ class flat_map + template + inline BOOST_CONTAINER_DOC1ST + ( std::pair +- , typename dtl::enable_if_c::value ++ , typename dtl::enable_if_c::value + BOOST_MOVE_I std::pair >::type) + insert(BOOST_FWD_REF(Pair) x) + { +@@ -1153,7 +1183,7 @@ class flat_map + template + inline BOOST_CONTAINER_DOC1ST + ( iterator +- , typename dtl::enable_if_c::value ++ , typename dtl::enable_if_c::value + BOOST_MOVE_I iterator>::type) + insert(const_iterator p, BOOST_FWD_REF(Pair) x) + { +@@ -1777,17 +1807,24 @@ class flat_multimap + #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED + private: + BOOST_COPYABLE_AND_MOVABLE(flat_multimap) ++ typedef std::pair std_pair_t; + typedef dtl::flat_tree< +- std::pair, ++ std_pair_t, + dtl::select1st, + Compare, + AllocatorOrContainer> tree_t; + //This is the real tree stored here. It's based on a movable pair ++ typedef dtl::pair dtl_pair_t; ++ #ifdef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE ++ typedef std_pair_t impl_pair_t; ++ #else ++ typedef dtl_pair_t impl_pair_t; ++ #endif + typedef dtl::flat_tree< +- dtl::pair, ++ impl_pair_t, + dtl::select1st, + Compare, +- typename dtl::container_or_allocator_rebind >::type ++ typename dtl::container_or_allocator_rebind::type + > impl_tree_t; + impl_tree_t m_flat_tree; // flat tree representing flat_map + +@@ -2388,7 +2425,7 @@ class flat_multimap + //! @copydoc ::boost::container::flat_set::nth(size_type) const + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + const_iterator nth(size_type n) const BOOST_NOEXCEPT_OR_NOTHROW +- { return dtl::force_copy(m_flat_tree.nth(n)); } ++ { return dtl::force_copy(m_flat_tree.nth(n)); } + + //! @copydoc ::boost::container::flat_set::index_of(iterator) + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline +@@ -2477,7 +2514,7 @@ class flat_multimap + template + inline BOOST_CONTAINER_DOC1ST + ( iterator +- , typename dtl::enable_if_c::value ++ , typename dtl::enable_if_c::value + BOOST_MOVE_I iterator >::type) + insert(BOOST_FWD_REF(Pair) x) + { return dtl::force_copy(m_flat_tree.emplace_equal(boost::forward(x))); } +@@ -2514,7 +2551,7 @@ class flat_multimap + template + inline BOOST_CONTAINER_DOC1ST + ( iterator +- , typename dtl::enable_if_c::value ++ , typename dtl::enable_if_c::value + BOOST_MOVE_I iterator>::type) + insert(const_iterator p, BOOST_FWD_REF(Pair) x) + { +-- +2.31.1 + diff --git a/boost/all/patches/bcp_namespace_issues_1_71.patch b/boost/all/patches/bcp_namespace_issues_1_71.patch new file mode 100644 index 0000000..94e748e --- /dev/null +++ b/boost/all/patches/bcp_namespace_issues_1_71.patch @@ -0,0 +1,33 @@ +From d0586e88122f41cd5ac9666db70c37d6f0fc7480 Mon Sep 17 00:00:00 2001 +From: Peter Dimov +Date: Sun, 26 May 2019 18:49:12 +0300 +Subject: [PATCH] Fix `bcp --namespace` issues + +--- + Jamroot | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Jamroot b/Jamroot +index e0d7c90f51d..4e913c2b3f3 100644 +--- a/Jamroot ++++ b/Jamroot +@@ -140,7 +140,8 @@ import "class" : new ; + import property-set ; + import threadapi-feature ; + import option ; +-import tools/boost_install/boost-install ; ++# Backslash because of `bcp --namespace` ++import tools/boost\_install/boost-install ; + + path-constant BOOST_ROOT : . ; + constant BOOST_VERSION : 1.71.0 ; +@@ -311,8 +312,8 @@ rule boost-install ( libraries * ) + # stage and install targets via boost-install, above. + rule boost-lib ( name : sources * : requirements * : default-build * : usage-requirements * ) + { ++ autolink = shared:BOOST_$(name:U)_DYN_LINK=1 ; + name = boost_$(name) ; +- autolink = shared:$(name:U)_DYN_LINK=1 ; + lib $(name) + : $(sources) + : $(requirements) $(autolink) diff --git a/boost/all/patches/bcp_namespace_issues_1_72.patch b/boost/all/patches/bcp_namespace_issues_1_72.patch new file mode 100644 index 0000000..5ffe1ec --- /dev/null +++ b/boost/all/patches/bcp_namespace_issues_1_72.patch @@ -0,0 +1,33 @@ +From d0586e88122f41cd5ac9666db70c37d6f0fc7480 Mon Sep 17 00:00:00 2001 +From: Peter Dimov +Date: Sun, 26 May 2019 18:49:12 +0300 +Subject: [PATCH] Fix `bcp --namespace` issues + +--- + Jamroot | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Jamroot b/Jamroot +index e0d7c90f51d..4e913c2b3f3 100644 +--- a/Jamroot ++++ b/Jamroot +@@ -140,7 +140,8 @@ import "class" : new ; + import property-set ; + import threadapi-feature ; + import option ; +-import tools/boost_install/boost-install ; ++# Backslash because of `bcp --namespace` ++import tools/boost\_install/boost-install ; + + path-constant BOOST_ROOT : . ; + constant BOOST_VERSION : 1.72.0 ; +@@ -311,8 +312,8 @@ rule boost-install ( libraries * ) + # stage and install targets via boost-install, above. + rule boost-lib ( name : sources * : requirements * : default-build * : usage-requirements * ) + { ++ autolink = shared:BOOST_$(name:U)_DYN_LINK=1 ; + name = boost_$(name) ; +- autolink = shared:$(name:U)_DYN_LINK=1 ; + lib $(name) + : $(sources) + : $(requirements) $(autolink) diff --git a/boost/all/patches/boost_1_77_mpi_check.patch b/boost/all/patches/boost_1_77_mpi_check.patch new file mode 100644 index 0000000..59e5030 --- /dev/null +++ b/boost/all/patches/boost_1_77_mpi_check.patch @@ -0,0 +1,24 @@ +diff -ru a/tools/build/src/tools/mpi.jam b/tools/build/src/tools/mpi.jam +--- a/tools/build/src/tools/mpi.jam 2019-12-10 01:20:16.000000000 +0100 ++++ b/tools/build/src/tools/mpi.jam 2020-09-02 13:17:22.942349254 +0200 +@@ -66,6 +66,8 @@ + import type ; + import path ; + ++import errors ; ++ + # Make this module a project + project.initialize $(__name__) ; + project mpi ; +@@ -538,6 +540,11 @@ + # Set up the "mpi" alias + alias mpi : : : : $(options) ; + } ++ ++ if ! $(.configured) ++ { ++ errors.user-error "MPI not configured" ; ++ } + } + + # States whether MPI has bee configured diff --git a/boost/all/patches/boost_build_qcc_fix_debug_build_parameter.patch b/boost/all/patches/boost_build_qcc_fix_debug_build_parameter.patch new file mode 100644 index 0000000..5e6c660 --- /dev/null +++ b/boost/all/patches/boost_build_qcc_fix_debug_build_parameter.patch @@ -0,0 +1,22 @@ +diff --git a/tools/build/src/tools/qcc.jam b/tools/build/src/tools/qcc.jam +index 155b1ac3..64274e65 100644 +--- a/tools/build/src/tools/qcc.jam ++++ b/tools/build/src/tools/qcc.jam +@@ -48,7 +48,7 @@ generators.register-c-compiler qcc.compile.asm : ASM : OBJ : qcc ; + + + # Declare flags for compilation. +-toolset.flags qcc.compile OPTIONS on : -gstabs+ ; ++toolset.flags qcc.compile OPTIONS on : -g ; + + # Declare flags and action for compilation. + toolset.flags qcc.compile OPTIONS off : -O0 ; +@@ -164,7 +164,7 @@ generators.override qcc.searched-lib-generator : searched-lib-generator ; + + # Declare flags for linking. + # First, the common flags. +-toolset.flags qcc.link OPTIONS on : -gstabs+ ; ++toolset.flags qcc.link OPTIONS on : -g ; + toolset.flags qcc.link OPTIONS on : -p ; + toolset.flags qcc.link OPTIONS ; + toolset.flags qcc.link LINKPATH ; diff --git a/boost/all/patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch b/boost/all/patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch new file mode 100644 index 0000000..29b744e --- /dev/null +++ b/boost/all/patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch @@ -0,0 +1,22 @@ +diff --git a/tools/build/src/tools/qcc.jam b/tools/build/src/tools/qcc.jam +index 740e907..b0653f1 100644 +--- a/tools/build/src/tools/qcc.jam ++++ b/tools/build/src/tools/qcc.jam +@@ -86,7 +86,7 @@ local rule check-target-platform + } + + # Declare flags for compilation. +-toolset.flags qcc.compile OPTIONS on : -gstabs+ ; ++toolset.flags qcc.compile OPTIONS on : -g ; + + # Declare flags and action for compilation. + toolset.flags qcc.compile OPTIONS off : -O0 ; +@@ -216,7 +216,7 @@ generators.override qcc.searched-lib-generator : searched-lib-generator ; + + # Declare flags for linking. + # First, the common flags. +-toolset.flags qcc.link OPTIONS on : -gstabs+ ; ++toolset.flags qcc.link OPTIONS on : -g ; + toolset.flags qcc.link OPTIONS on : -p ; + toolset.flags qcc.link OPTIONS ; + toolset.flags qcc.link LINKPATH ; diff --git a/boost/all/patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch b/boost/all/patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch new file mode 100644 index 0000000..dffef67 --- /dev/null +++ b/boost/all/patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch @@ -0,0 +1,20 @@ +diff --git a/boost/core/uncaught_exceptions.hpp b/boost/core/uncaught_exceptions.hpp +index c39120b..436717f 100644 +--- a/boost/core/uncaught_exceptions.hpp ++++ b/boost/core/uncaught_exceptions.hpp +@@ -56,10 +56,15 @@ + // On Linux with clang and libc++ and on OS X, there is a version of cxxabi.h from libc++abi that doesn't declare __cxa_get_globals, but provides __cxa_uncaught_exceptions. + // The function only appeared in version _LIBCPPABI_VERSION >= 1002 of the library. Unfortunately, there are linking errors about undefined reference to __cxa_uncaught_exceptions + // on Ubuntu Trusty and OS X, so we avoid using it and forward-declare __cxa_get_globals instead. ++// On QNX SDP 7.0 (QCC 5.4.0), there are multiple cxxabi.h, one from glibcxx from gcc and another from libc++abi from LLVM. Which one is included will be determined by the qcc ++// command line arguments (-V and/or -Y; http://www.qnx.com/developers/docs/7.0.0/#com.qnx.doc.neutrino.utilities/topic/q/qcc.html). The LLVM libc++abi is missing the declaration ++// of __cxa_get_globals but it is also patched by QNX developers to not define _LIBCPPABI_VERSION. Older QNX SDP versions, up to and including 6.6, don't provide LLVM and libc++abi. ++// See https://github.com/boostorg/core/issues/59. + #if !defined(__FreeBSD__) && \ + ( \ + (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) < 407) || \ + defined(__OpenBSD__) || \ ++ (defined(__QNXNTO__) && !defined(__GLIBCXX__) && !defined(__GLIBCPP__)) || \ + defined(_LIBCPPABI_VERSION) \ + ) + namespace __cxxabiv1 { diff --git a/boost/all/patches/boost_locale_fail_on_missing_backend.patch b/boost/all/patches/boost_locale_fail_on_missing_backend.patch new file mode 100644 index 0000000..f1a0b79 --- /dev/null +++ b/boost/all/patches/boost_locale_fail_on_missing_backend.patch @@ -0,0 +1,60 @@ +diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2 +index 578e722..b715f59 100644 +--- a/libs/locale/build/Jamfile.v2 ++++ b/libs/locale/build/Jamfile.v2 +@@ -17,6 +17,7 @@ import feature ; + # Features + + feature.feature boost.locale.iconv : on off : optional propagated ; ++feature.feature boost.locale.iconv.lib : libc libiconv : optional propagated ; + feature.feature boost.locale.icu : on off : optional propagated ; + feature.feature boost.locale.posix : on off : optional propagated ; + feature.feature boost.locale.std : on off : optional propagated ; +@@ -217,6 +217,21 @@ rule configure-full ( properties * : flags-only ) + if [ configure.builds has_iconv : $(properties) : "iconv (libc)" ] + { + found-iconv = true ; ++ if libiconv in $(properties) ++ { ++ if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] ++ { ++ result += iconv ; ++ } ++ else ++ { ++ EXIT "- Boost.Locale found iconv (libc) instead of iconv (separate) library to be built." ; ++ } ++ } ++ } ++ else if libc in $(properties) ++ { ++ EXIT "- Boost.Locale failed to find iconv (libc) library to be built." ; + } + else + { +@@ -225,6 +234,14 @@ rule configure-full ( properties * : flags-only ) + found-iconv = true ; + result += iconv ; + } ++ else if libiconv in $(properties) ++ { ++ EXIT "- Boost.Locale failed to find iconv (separate) library to be built." ; ++ } ++ } ++ if ! $(found-iconv) ++ { ++ EXIT "- Boost.Locale failed to find iconv library to be built." ; + } + } + if $(found-iconv) +@@ -265,6 +282,10 @@ rule configure-full ( properties * : flags-only ) + ../../thread/build//boost_thread + ; + } ++ else ++ { ++ EXIT "- Boost.Locale failed to find ICU library to be built." ; ++ } + + } + diff --git a/boost/all/patches/boost_log_filesystem_no_deprecated_1_72.patch b/boost/all/patches/boost_log_filesystem_no_deprecated_1_72.patch new file mode 100644 index 0000000..bb01094 --- /dev/null +++ b/boost/all/patches/boost_log_filesystem_no_deprecated_1_72.patch @@ -0,0 +1,13 @@ +diff --git a/libs/log/src/text_file_backend.cpp b/libs/log/src/text_file_backend.cpp +index 50cef3b..d5fd02e 100644 +--- a/libs/log/src/text_file_backend.cpp ++++ b/libs/log/src/text_file_backend.cpp +@@ -39,6 +39,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include diff --git a/boost/all/patches/boost_mpi_check.patch b/boost/all/patches/boost_mpi_check.patch new file mode 100644 index 0000000..af7e45f --- /dev/null +++ b/boost/all/patches/boost_mpi_check.patch @@ -0,0 +1,24 @@ +diff -ru a/tools/build/src/tools/mpi.jam b/tools/build/src/tools/mpi.jam +--- a/tools/build/src/tools/mpi.jam 2019-12-10 01:20:16.000000000 +0100 ++++ b/tools/build/src/tools/mpi.jam 2020-09-02 13:17:22.942349254 +0200 +@@ -66,6 +66,8 @@ + import type ; + import path ; + ++import errors ; ++ + # Make this module a project + project.initialize $(__name__) ; + project mpi ; +@@ -539,6 +541,11 @@ + # Set up the "mpi" alias + alias mpi : : : : $(options) ; + } ++ ++ if ! $(.configured) ++ { ++ errors.user-error "MPI not configured" ; ++ } + } + + # States whether MPI has bee configured diff --git a/boost/all/patches/python_base_prefix.patch b/boost/all/patches/python_base_prefix.patch new file mode 100644 index 0000000..47371cb --- /dev/null +++ b/boost/all/patches/python_base_prefix.patch @@ -0,0 +1,25 @@ +diff -ru a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam +--- a/tools/build/src/tools/python.jam ++++ b/tools/build/src/tools/python.jam +@@ -746,7 +746,7 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : + { + # Values to be extracted from python's sys module. These will be set by + # the probe rule, above, using Jam's dynamic scoping. +- local sys-elements = version platform prefix exec_prefix executable ; ++ local sys-elements = version platform base_prefix base_exec_prefix executable ; + local sys.$(sys-elements) ; + + # Compute the string Python's sys.platform needs to match. If not +@@ -786,10 +786,10 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : + { + debug-message ...requested configuration matched! ; + +- exec-prefix = $(sys.exec_prefix) ; ++ exec-prefix = $(sys.base_exec_prefix) ; + + compute-default-paths $(target-os) : $(sys.version) : +- $(sys.prefix) : $(sys.exec_prefix) ; ++ $(sys.base_prefix) : $(sys.base_exec_prefix) ; + + version = $(sys.version) ; + interpreter-cmd ?= $(cmd) ; diff --git a/boost/all/patches/python_base_prefix_since_1_74.patch b/boost/all/patches/python_base_prefix_since_1_74.patch new file mode 100644 index 0000000..2267fe4 --- /dev/null +++ b/boost/all/patches/python_base_prefix_since_1_74.patch @@ -0,0 +1,26 @@ +diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam +index cf8c379..3e3f095 100644 +--- a/tools/build/src/tools/python.jam ++++ b/tools/build/src/tools/python.jam +@@ -749,7 +749,7 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : + { + # Values to be extracted from python's sys module. These will be set by + # the probe rule, above, using Jam's dynamic scoping. +- local sys-elements = version platform prefix exec_prefix executable ; ++ local sys-elements = version platform base_prefix base_exec_prefix executable ; + local sys.$(sys-elements) ; + + # Compute the string Python's sys.platform needs to match. If not +@@ -789,10 +789,10 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : + { + debug-message ...requested configuration matched! ; + +- exec-prefix = $(sys.exec_prefix) ; ++ exec-prefix = $(sys.base_exec_prefix) ; + + compute-default-paths $(target-os) : $(sys.version) : +- $(sys.prefix) : $(sys.exec_prefix) ; ++ $(sys.base_prefix) : $(sys.base_exec_prefix) ; + + version = $(sys.version) ; + interpreter-cmd ?= $(cmd) ; diff --git a/boost/all/patches/solaris_pthread_data.patch b/boost/all/patches/solaris_pthread_data.patch new file mode 100644 index 0000000..ea5e4d7 --- /dev/null +++ b/boost/all/patches/solaris_pthread_data.patch @@ -0,0 +1,13 @@ +diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp +index aefbeb4..bc9b136 100644 +--- a/boost/thread/pthread/thread_data.hpp ++++ b/boost/thread/pthread/thread_data.hpp +@@ -57,7 +57,7 @@ namespace boost + #else + std::size_t page_size = ::sysconf( _SC_PAGESIZE); + #endif +-#if PTHREAD_STACK_MIN > 0 ++#ifdef PTHREAD_STACK_MIN + if (size Path: + return self.tmppath / "boost" + + def do_git_update(self) -> None: + if not self.boost_path.exists(): + with chdir(self, self.tmppath): + print("Cloning boost git") + subprocess.check_call(["git", "clone", "--", self.git_url, "boost"]) + with chdir(self, self.boost_path): + print("Checking out current master") + subprocess.check_call(["git", "checkout", "origin/master"]) + print("Removing master branch") + subprocess.check_call(["git", "branch", "-D", "master"]) + else: + with chdir(self, self.boost_path): + print("Updating git repo") + subprocess.check_call(["git", "fetch", "origin"]) + print("Removing all local changes to git repo") + subprocess.check_call(["git", "reset", "--hard", "HEAD"]) + print("Checking out current master") + subprocess.check_call(["git", "checkout", "origin/master"]) + + def do_git_submodule_update(self): + with chdir(self, self.boost_path): + if not self.unsafe: + # De-init + init to make sure that boostdep won't detect a new or removed boost library + print("De-init git submodules") + subprocess.check_call(["git", "submodule", "deinit", "--all", "-f"]) + + try: + print(f"Checking out version {self.boost_version}") + subprocess.check_call(["git", "checkout", f"boost-{self.boost_version}"]) + except subprocess.CalledProcessError: + print(f"version {self.boost_version} does not exist") + raise + + print("Re-init git submodules") + subprocess.check_call(["git", "submodule", "update", "--init"]) + + print("Removing unknown files/directories") + subprocess.check_call(["git", "clean", "-d", "-f"]) + + def do_install_boostdep(self): + with chdir(self, self.boost_path): + print(f"Installing boostdep/{self.boostdep_version}") + cmd = ["conan", "install", "--tool-requires", f"boostdep/{self.boostdep_version}", "--format", "json", "-vquiet"] + info = json.loads(subprocess.check_output(cmd)) + self._boostdep = Path(info["graph"]["nodes"]["1"]["package_folder"]) / "bin" / "boostdep" + + _GREP_IGNORE_PREFIX = ("#", "\"") + _GREP_IGNORE_PARTS = ("boost", "<", ">") + + @classmethod + def _grep_libs(cls, regex, text): + res = set() + for m in re.finditer(regex, text, flags=re.MULTILINE): + # If text before main capture group contains a string or a comment => ignore + ignore = False + for ign in cls._GREP_IGNORE_PREFIX: + if ign in m.group(1): + ignore = True + if ignore: + continue + l = m.group(2).lower() + ignore = False + for ign in cls._GREP_IGNORE_PARTS: + if ign in l: + ignore = True + if ignore: + continue + res.add(l) + return list(res) + + def _grep_requirements(self, component: str) -> List[str]: + jam = self.boost_path / "libs" / component / "build" / "Jamfile.v2" + if not jam.is_file(): + jam = self.boost_path / "libs" / component / "build" / "Jamfile" + if not jam.is_file(): + log.warning("Can't find Jamfile for %s. Unable to determine dependencies.", component) + return [] + contents = jam.open().read() + + using = self._grep_libs("\n(.*)using\\s+([^ ;:]+)\\s*", contents) + libs = self._grep_libs("\n(.*)\\s(?:searched-)?lib\\s+([^ \t\n;:]+)", contents) + + requirements = using + libs + return requirements + + def _sort_requirements(self, requirements: List[str]) -> Tuple[List[str], Dict[str, List[str]], List[str]]: + conan_requirements = set() + system_libs = {} + unknown_libs = set() + + for req in requirements: + if req in LINUX_SYSTEM_LIBS: + system_libs.setdefault("linux", []).append(req) + continue + if req in WINDOWS_SYSTEM_LIBS: + system_libs.setdefault("windows", []).append(req) + continue + added = False + for conan_req in CONAN_REQUIREMENTS: + if conan_req in req: + conan_requirements.add(conan_req) + added = True + if added: + continue + unknown_libs.add(req) + return list(conan_requirements), system_libs, list(unknown_libs) + + def do_boostdep_collect(self) -> BoostDependencies: + with chdir(self, self.boost_path): + buildables = subprocess.check_output([self._boostdep, "--list-buildable"], text=True) + buildables = buildables.splitlines() + log.debug("`boostdep --list--buildable` returned these buildables: %s", buildables) + + # modules = subprocess.check_output([self._boostdep_path, "--list-modules"]) + # modules = modules.decode().splitlines() + + dependency_tree = {} + buildable_dependencies = subprocess.check_output([self._boostdep, "--list-buildable-dependencies"], text=True) + log.debug("boostdep --list-buildable-dependencies returns: %s", buildable_dependencies) + for line in buildable_dependencies.splitlines(): + if re.match(r"^[\s]*#.*", line): + continue + match = re.match(r"([\S]+)\s*=\s*([^;]+)\s*;\s*", line) + if not match: + continue + master = match.group(1) + dependencies = re.split(r"\s+", match.group(2).strip()) + dependency_tree[master] = dependencies + + log.debug("Using `boostdep --track-sources`, the following dependency tree was calculated:") + log.debug(pprint.pformat(dependency_tree)) + + filtered_dependency_tree = {k: [d for d in v if d in buildables] for k, v in dependency_tree.items() if k in buildables} + + configure_options = [] + for conf_option in CONFIGURE_OPTIONS: + if conf_option in filtered_dependency_tree: + configure_options.append(conf_option) + else: + log.warning("option %s not available in %s", conf_option, self.boost_version) + + log.debug("Following config_options remain: %s", configure_options) + + requirements = {} + for conf_option in configure_options: + reqs = self._grep_requirements(conf_option) + conan_requirements, system_libs, unknown_libs = self._sort_requirements(reqs) + if system_libs: + log.warning("Module '%s' (%s) has system libraries: %s", conf_option, self.boost_version, system_libs) + if unknown_libs: + log.warning("Module '%s' (%s) has unknown libs: %s", conf_option, self.boost_version, unknown_libs) + if conan_requirements: + requirements[conf_option] = conan_requirements + + boost_dependencies = BoostDependencies( + export=BoostDependenciesExport( + version=self.boost_version, + configure_options=configure_options, + dependencies=filtered_dependency_tree, + requirements=requirements, + static_only=[], + ), + buildables=buildables, + ) + + return boost_dependencies + + @staticmethod + def detect_cycles(tree: Dict[str, List[str]]) -> Dict[str, List[str]]: + tree = {k: v[:] for k, v in tree.items()} + while tree: + nodeps = set(k for k, v in tree.items() if not v) + if not nodeps: + return tree + tree = {k: [d for d in v if d not in nodeps] for k, v in tree.items() if k not in nodeps} + return {} + + def _fix_dependencies(self, deptree: Dict[str, List[str]]) -> Dict[str, List[str]]: + try: + # python does not depend on graph + deptree["python"].remove("graph") + except (KeyError, ValueError): + pass + + try: + # graph does not depend on graph_parallel + deptree["graph"].remove("graph_parallel") + except (KeyError, ValueError): + pass + + try: + # mpi does not depend on python + deptree["mpi"].remove("python") + except (KeyError, ValueError): + pass + + if "mpi_python" in deptree and "python" not in deptree["mpi_python"]: + deptree["mpi_python"].append("python") + + # Break random/math dependency cycle + try: + deptree["math"].remove("random") + except ValueError: + pass + + remaining_tree = self.detect_cycles(deptree) + if remaining_tree: + raise Exception(f"Dependency cycle detected. Remaining tree: {remaining_tree}") + return deptree + + @staticmethod + def _boostify_library(lib: str) -> str: + return f"boost_{lib}" + + def do_create_libraries(self, boost_dependencies: BoostDependencies): + libraries = {} + module_provides_extra = {} + + # Look for the names of libraries in Jam build files + for buildable in boost_dependencies.buildables: + construct_jam = lambda jam_ext : self.boost_path / "libs" / buildable / "build" / f"Jamfile{jam_ext}" + try: + buildable_jam = next(construct_jam(jam_ext) for jam_ext in ("", ".v2") if construct_jam(jam_ext).is_file()) + except StopIteration: + raise Exception(f"Cannot find jam build file for {buildable}") + jam_text = buildable_jam.read_text() + buildable_libs = re.findall("[ \n](boost-)?lib ([a-zA-Z0-9_]+)[ \n]", jam_text) + buildable_libs = set(f"boost_{lib}" if lib_prefix else lib for lib_prefix, lib in buildable_libs) + buildable_libs = set(l[len("boost_"):] for l in buildable_libs if l.startswith("boost_")) # list(filter(lambda l: l.startswith("boost"), buildable_libs)) + + if not buildable_libs: + # Some boost releases support multiple python versions + if buildable == "python": + buildable_libs.add("python") + if not buildable_libs: + raise Exception(f"Cannot find any library for buildable {buildable}") + + if buildable in buildable_libs: + libraries[buildable] = [f"boost_{buildable}"] + buildable_libs.remove(buildable) + else: + libraries[buildable] = [] + module_provides_extra[buildable] = buildable_libs + for buildable_dep in buildable_libs: + boost_dependencies.export.dependencies[buildable_dep] = [buildable] + libraries[buildable_dep] = [f"boost_{buildable_dep}"] + + # Boost.Test: unit_test_framework depends on all libraries of Boost.Test + if "unit_test_framework" in boost_dependencies.export.dependencies and "test" in module_provides_extra: + boost_dependencies.export.dependencies["unit_test_framework"].extend(module_provides_extra["test"].difference({"unit_test_framework"})) + + # python and numpy have a version suffix. Add it here. + if "python" in libraries: + if len(libraries["python"]) != 1: + raise Exception("Boost.Python should provide exactly one library") + libraries["python"][0] += "{py_major}{py_minor}" + if "numpy" in libraries: + if len(libraries["numpy"]) != 1: + raise Exception("Boost.Numpy should provide exactly one library") + libraries["numpy"][0] += "{py_major}{py_minor}" + + boost_dependencies.export.libs = libraries + boost_dependencies.export.static_only = [ + "boost_exception", + "boost_test_exec_monitor", + ] + + return boost_dependencies + + @property + def _outputpath(self) -> Path: + return self.outputdir / f"dependencies-{self.boost_version}.yml" + + @classmethod + def _sort_item(cls, item): + if isinstance(item, dict): + items = sorted(item.items()) + new_items = [] + for item in sorted(items): + new_items.append((item[0], cls._sort_item(item[1]))) + return dict(new_items) + elif isinstance(item, tuple): + return tuple(cls._sort_item(e) for e in sorted(item)) + elif isinstance(item, list): + return list(cls._sort_item(e) for e in sorted(item)) + else: + return item + + def do_create_dependency_file(self) -> None: + tree = self.do_boostdep_collect() + tree = self.do_create_libraries(tree) + + tree.export.dependencies = self._fix_dependencies(tree.export.dependencies) + + data = dataclasses.asdict(tree.export) + if self.unsafe: + data["UNSAFE"] = "!DO NOT COMMIT! !THIS FILE IS GENERATED WITH THE UNSAFE OPTION ENABLED!" + + data = self._sort_item(data) + + print(f"Creating {self.outputdir}") + with self._outputpath.open("w") as fout: + yaml.dump(data, fout) + + +def main(args=None) -> int: + parser = argparse.ArgumentParser() + parser.add_argument("--verbose", dest="verbose", action="store_true", help="verbose output") + parser.add_argument("-t", dest="tmppath", help="temporary folder where to clone boost (default is system temporary folder)") + parser.add_argument("-d", dest="boostdep_version", default="1.82.0", type=str, help="boostdep version") + parser.add_argument("-u", dest="git_url", default=BOOST_GIT_URL, help="boost git url") + parser.add_argument("-U", dest="git_update", action="store_true", help="update the git repo") + parser.add_argument("-o", dest="outputdir", default=None, type=Path, help="output dependency dir") + parser.add_argument("-x", dest="unsafe", action="store_true", help="unsafe fast(er) operation") + + version_group = parser.add_mutually_exclusive_group(required=True) + version_group.add_argument("-v", dest="boost_version", help="boost version") + version_group.add_argument("-A", dest="boost_version", action="store_const", const=None, help="All boost versions") + ns = parser.parse_args(args) + + logging.basicConfig(format="[%(levelname)s] %(message)s") + if ns.verbose: + log.setLevel(logging.DEBUG) + + if not ns.tmppath: + ns.tmppath = Path(tempfile.gettempdir()) + print(f"Temporary folder is {ns.tmppath}") + if not ns.outputdir: + ns.outputdir = Path("dependencies") + print(f"Dependencies folder is {ns.outputdir}") + + ns.outputdir.mkdir(exist_ok=True) + + git_update_done = False + + if ns.boost_version is None: + conan_data = yaml.safe_load(Path("conandata.yml").open()) + boost_versions = list(conan_data["sources"].keys()) + else: + boost_versions = [ns.boost_version] + + for boost_version in boost_versions: + print(f"Starting {boost_version}") + boost_collector = BoostDependencyBuilder( + boost_version=boost_version, + boostdep_version=ns.boostdep_version, + git_url=ns.git_url, + outputdir=ns.outputdir, + tmppath=ns.tmppath, + unsafe=ns.unsafe, + ) + + if not ns.git_update and not boost_collector.boost_path.exists(): + log.error("Boost directory does not exist. Re-execute this script with -U to run 'git update'.") + return 1 + + if ns.git_update and not git_update_done: + boost_collector.do_git_update() + git_update_done = True + + boost_collector.do_git_submodule_update() + + boost_collector.do_install_boostdep() + + boost_collector.do_create_dependency_file() + return 0 + + +if __name__ == "__main__": + import sys + sys.exit(main()) diff --git a/boost/all/test_package/CMakeLists.txt b/boost/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..07afcb4 --- /dev/null +++ b/boost/all/test_package/CMakeLists.txt @@ -0,0 +1,170 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +if(UNIX AND NOT APPLE) + # use RPATH instead of RUNPATH so that + # transitive dependencies can be located + add_link_options("LINKER:--disable-new-dtags") +endif() + +include(CTest) +enable_testing() + +if(BOOST_NAMESPACE) + add_definitions("-DBOOST_NAMESPACE=${BOOST_NAMESPACE}") +endif() + +if(NOT HEADER_ONLY) + if(WITH_RANDOM) + find_package(Boost COMPONENTS random REQUIRED) + add_executable(random_exe random.cpp) + target_link_libraries(random_exe PRIVATE Boost::random) + add_test(NAME boost_random COMMAND random_exe) + endif() + + if(WITH_REGEX) + find_package(Boost COMPONENTS regex REQUIRED) + add_executable(regex_exe regex.cpp) + target_link_libraries(regex_exe PRIVATE Boost::regex) + set_property(TARGET regex_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_regex COMMAND regex_exe) + endif() + + if(WITH_TEST) + find_package(Boost COMPONENTS unit_test_framework REQUIRED) + add_executable(test_exe test.cpp) + target_link_libraries(test_exe PRIVATE Boost::unit_test_framework) + set_property(TARGET test_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_test COMMAND test_exe) + endif() + + if(WITH_COROUTINE) + find_package(Boost COMPONENTS coroutine REQUIRED) + add_executable(coroutine_exe coroutine.cpp) + target_link_libraries(coroutine_exe PRIVATE Boost::coroutine) + set_property(TARGET coroutine_exe PROPERTY CXX_STANDARD 11) + add_test(NAME coroutine_test COMMAND coroutine_exe) + endif() + + if(WITH_CHRONO) + find_package(Boost COMPONENTS chrono REQUIRED) + add_executable(chrono_exe chrono.cpp) + target_link_libraries(chrono_exe PRIVATE Boost::chrono) + set_property(TARGET chrono_exe PROPERTY CXX_STANDARD 11) + add_test(NAME chrono_test COMMAND chrono_exe) + endif() + + if(WITH_FIBER) + find_package(Boost COMPONENTS fiber REQUIRED) + add_executable(fiber_exe fiber.cpp) + target_link_libraries(fiber_exe PRIVATE Boost::fiber) + set_property(TARGET fiber_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_fiber COMMAND fiber_exe) + endif() + + if(WITH_JSON) + find_package(Boost COMPONENTS json REQUIRED) + add_executable(json_exe json.cpp) + target_link_libraries(json_exe PRIVATE Boost::json) + set_property(TARGET json_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_json COMMAND json_exe) + endif() + + if(WITH_NOWIDE) + find_package(Boost COMPONENTS nowide REQUIRED) + add_executable(nowide_exe nowide.cpp) + target_link_libraries(nowide_exe PRIVATE Boost::nowide) + set_property(TARGET nowide_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_nowide COMMAND nowide_exe ${CMAKE_CURRENT_SOURCE_DIR}/conanfile.py) + endif() + + if(WITH_LOCALE) + find_package(Boost COMPONENTS locale REQUIRED) + add_executable(locale_exe locale.cpp) + target_link_libraries(locale_exe PRIVATE Boost::locale) + set_property(TARGET locale_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_locale COMMAND locale_exe) + endif() + + if(WITH_STACKTRACE_ADDR2LINE) + find_package(Boost COMPONENTS stacktrace REQUIRED) + add_executable(stacktrace_addr2line_exe stacktrace.cpp) + target_compile_definitions(stacktrace_addr2line_exe PRIVATE TEST_STACKTRACE_IMPL=1) + target_link_libraries(stacktrace_addr2line_exe PRIVATE Boost::stacktrace_addr2line) + set_property(TARGET stacktrace_addr2line_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_stacktrace_addr2line COMMAND stacktrace_addr2line_exe) + endif() + + if(WITH_STACKTRACE_BACKTRACE) + add_executable(stacktrace_backtrace_exe stacktrace.cpp) + target_compile_definitions(stacktrace_backtrace_exe PRIVATE TEST_STACKTRACE_IMPL=2) + target_link_libraries(stacktrace_backtrace_exe PRIVATE Boost::stacktrace_backtrace) + set_property(TARGET stacktrace_backtrace_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_stacktrace_backtrace COMMAND stacktrace_backtrace_exe) + endif() + + if(WITH_STACKTRACE) + find_package(Boost COMPONENTS stacktrace REQUIRED) + + add_executable(stacktrace_noop_exe stacktrace.cpp) + target_compile_definitions(stacktrace_noop_exe PRIVATE TEST_STACKTRACE_IMPL=4) + target_link_libraries(stacktrace_noop_exe PRIVATE Boost::stacktrace_noop) + set_property(TARGET stacktrace_noop_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_stacktrace_noop COMMAND stacktrace_noop_exe) + + if(WIN32) + add_executable(stacktrace_windbg_exe stacktrace.cpp) + target_compile_definitions(stacktrace_windbg_exe PRIVATE TEST_STACKTRACE_IMPL=5) + target_link_libraries(stacktrace_windbg_exe PRIVATE Boost::stacktrace_windbg) + set_property(TARGET stacktrace_windbg_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_stacktrace_windbg COMMAND stacktrace_windbg_exe) + + add_executable(stacktrace_windbg_cached_exe stacktrace.cpp) + target_compile_definitions(stacktrace_windbg_cached_exe PRIVATE TEST_STACKTRACE_IMPL=6) + target_link_libraries(stacktrace_windbg_cached_exe PRIVATE Boost::stacktrace_windbg_cached) + set_property(TARGET stacktrace_windbg_cached_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_stacktrace_windbg_cached COMMAND stacktrace_windbg_cached_exe) + else() + add_executable(stacktrace_basic_exe stacktrace.cpp) + target_compile_definitions(stacktrace_basic_exe PRIVATE TEST_STACKTRACE_IMPL=3) + target_link_libraries(stacktrace_basic_exe PRIVATE Boost::stacktrace_basic) + set_property(TARGET stacktrace_basic_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_stacktrace_basic COMMAND stacktrace_basic_exe) + endif() + endif() + + if(WITH_PYTHON) + find_package(Boost COMPONENTS python REQUIRED) + add_library(hello_ext MODULE python.cpp) + set_property(TARGET hello_ext PROPERTY PREFIX "") + + find_package(Python ${PYTHON_VERSION_TO_SEARCH} COMPONENTS Interpreter Development NumPy REQUIRED) + + target_link_libraries(hello_ext PRIVATE Boost::python Python::Python) + if(WIN32) + set_target_properties(hello_ext PROPERTIES SUFFIX ".pyd") + endif() + add_test(NAME boost_python COMMAND Python::Interpreter "${CMAKE_CURRENT_SOURCE_DIR}/python.py") + set_property(TEST boost_python PROPERTY ENVIRONMENT "PYTHONPATH=$") + + add_executable(numpy_exe numpy.cpp) + target_link_libraries(numpy_exe PRIVATE Boost::numpy Python::Python Python::NumPy) + add_test(NAME boost_numpy COMMAND numpy_exe) + set_property(TEST boost_numpy PROPERTY ENVIRONMENT "PYTHONPATH=${Python_SITELIB}") + endif() + + if(WITH_URL) + find_package(Boost COMPONENTS url REQUIRED) + add_executable(url_exe url.cpp) + target_link_libraries(url_exe PRIVATE Boost::url) + set_property(TARGET url_exe PROPERTY CXX_STANDARD 11) + add_test(NAME boost_url COMMAND url_exe) + endif() + +endif() + +# Test header-only target +find_package(Boost REQUIRED) +add_executable(lambda_exe lambda.cpp) +target_link_libraries(lambda_exe PRIVATE Boost::headers) +add_test(NAME boost_boost COMMAND lambda_exe) diff --git a/boost/all/test_package/chrono.cpp b/boost/all/test_package/chrono.cpp new file mode 100644 index 0000000..0127868 --- /dev/null +++ b/boost/all/test_package/chrono.cpp @@ -0,0 +1,21 @@ +// This comes from the following Boost example: +// https://www.boost.org/doc/libs/1_72_0/doc/html/chrono/users_guide.html#chrono.users_guide.examples +#include +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +int main() +{ + boost::chrono::system_clock::time_point start = boost::chrono::system_clock::now(); + + for ( long i = 0; i < 10000000; ++i ) + std::sqrt( 123.456L ); // burn some time + + boost::chrono::duration sec = boost::chrono::system_clock::now() - start; + std::cout << "took " << sec.count() << " seconds\n"; + return 0; +} diff --git a/boost/all/test_package/conanfile.py b/boost/all/test_package/conanfile.py new file mode 100644 index 0000000..de19d7a --- /dev/null +++ b/boost/all/test_package/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import chdir + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def _boost_option(self, name, default): + try: + return getattr(self.dependencies["boost"].options, name, default) + except (AttributeError, ConanException): + return default + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["HEADER_ONLY"] = self.dependencies["boost"].options.header_only + if not self.dependencies["boost"].options.header_only: + tc.cache_variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared + tc.cache_variables["WITH_PYTHON"] = not self.dependencies["boost"].options.without_python + if not self.dependencies["boost"].options.without_python: + pyversion = self.dependencies["boost"].options.python_version + tc.cache_variables["PYTHON_VERSION_TO_SEARCH"] = pyversion + tc.cache_variables["Python_EXECUTABLE"] = self.dependencies["boost"].options.python_executable + tc.cache_variables["WITH_RANDOM"] = not self.dependencies["boost"].options.without_random + tc.cache_variables["WITH_REGEX"] = not self.dependencies["boost"].options.without_regex + tc.cache_variables["WITH_TEST"] = not self.dependencies["boost"].options.without_test + tc.cache_variables["WITH_COROUTINE"] = not self.dependencies["boost"].options.without_coroutine + tc.cache_variables["WITH_CHRONO"] = not self.dependencies["boost"].options.without_chrono + tc.cache_variables["WITH_FIBER"] = not self.dependencies["boost"].options.without_fiber + tc.cache_variables["WITH_LOCALE"] = not self.dependencies["boost"].options.without_locale + tc.cache_variables["WITH_NOWIDE"] = not self._boost_option("without_nowide", True) + tc.cache_variables["WITH_JSON"] = not self._boost_option("without_json", True) + tc.cache_variables["WITH_STACKTRACE"] = not self.dependencies["boost"].options.without_stacktrace + tc.cache_variables["WITH_STACKTRACE_ADDR2LINE"] = self.dependencies["boost"].conf_info.get("user.boost:stacktrace_addr2line_available") + tc.cache_variables["WITH_STACKTRACE_BACKTRACE"] = self._boost_option("with_stacktrace_backtrace", False) + tc.cache_variables["WITH_URL"] = not self._boost_option("without_url", True) + if self.dependencies["boost"].options.namespace != 'boost' and not self.dependencies["boost"].options.namespace_alias: + tc.cache_variables['BOOST_NAMESPACE'] = self.dependencies["boost"].options.namespace + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not can_run(self): + return + with chdir(self, self.folders.build_folder): + # When boost and its dependencies are built as shared libraries, + # the test executables need to locate them. Typically the + # `conanrun` env should be enough, but this may cause problems on macOS + # where the CMake installation has dependencies on Apple-provided + # system libraries that are incompatible with Conan-provided ones. + # When `conanrun` is enabled, DYLD_LIBRARY_PATH will also apply + # to ctest itself. Given that CMake already embeds RPATHs by default, + # we can bypass this by using the `conanbuild` environment on + # non-Windows platforms, while still retaining the correct behaviour. + env = "conanrun" if self.settings.os == "Windows" else "conanbuild" + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", env=env) diff --git a/boost/all/test_package/coroutine.cpp b/boost/all/test_package/coroutine.cpp new file mode 100644 index 0000000..06e901c --- /dev/null +++ b/boost/all/test_package/coroutine.cpp @@ -0,0 +1,23 @@ +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +using namespace boost::coroutines; + +void cooperative(coroutine::push_type &sink) +{ + std::cout << "Hello"; + sink(); + std::cout << "world"; +} + +int main() +{ + coroutine::pull_type source(cooperative); + std::cout << ", "; + source(); + std::cout << "!\n"; +} diff --git a/boost/all/test_package/fiber.cpp b/boost/all/test_package/fiber.cpp new file mode 100644 index 0000000..6a0165c --- /dev/null +++ b/boost/all/test_package/fiber.cpp @@ -0,0 +1,134 @@ +// Copyright Nat Goodspeed + Oliver Kowalke 2015. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +static std::size_t fiber_count{ 0 }; +static std::mutex mtx_count{}; +static boost::fibers::condition_variable_any cnd_count{}; +typedef std::unique_lock< std::mutex > lock_type; + +/***************************************************************************** + * example fiber function + *****************************************************************************/ +//[fiber_fn_ws +void whatevah( char me) { + try { + std::thread::id my_thread = std::this_thread::get_id(); /**< get ID of initial thread >*/ + { + std::ostringstream buffer; + buffer << "fiber " << me << " started on thread " << my_thread << '\n'; + std::cout << buffer.str() << std::flush; + } + for ( unsigned i = 0; i < 10; ++i) { /**< loop ten times >*/ + boost::this_fiber::yield(); /**< yield to other fibers >*/ + std::thread::id new_thread = std::this_thread::get_id(); /**< get ID of current thread >*/ + if ( new_thread != my_thread) { /**< test if fiber was migrated to another thread >*/ + my_thread = new_thread; + std::ostringstream buffer; + buffer << "fiber " << me << " switched to thread " << my_thread << '\n'; + std::cout << buffer.str() << std::flush; + } + } + } catch ( ... ) { + } + lock_type lk( mtx_count); + if ( 0 == --fiber_count) { /**< Decrement fiber counter for each completed fiber. >*/ + lk.unlock(); + cnd_count.notify_all(); /**< Notify all fibers waiting on `cnd_count`. >*/ + } +} +//] + +/***************************************************************************** + * example thread function + *****************************************************************************/ +//[thread_fn_ws +void thread( boost::fibers::detail::thread_barrier * b) { + std::ostringstream buffer; + buffer << "thread started " << std::this_thread::get_id() << std::endl; + std::cout << buffer.str() << std::flush; + boost::fibers::use_scheduling_algorithm< boost::fibers::algo::shared_work >(); /**< + Install the scheduling algorithm `boost::fibers::algo::shared_work` in order to + join the work sharing. + >*/ + b->wait(); /**< sync with other threads: allow them to start processing >*/ + lock_type lk( mtx_count); + cnd_count.wait( lk, [](){ return 0 == fiber_count; } ); /**< + Suspend main fiber and resume worker fibers in the meanwhile. + Main fiber gets resumed (e.g returns from `condition_variable_any::wait()`) + if all worker fibers are complete. + >*/ + BOOST_ASSERT( 0 == fiber_count); +} +//] + +/***************************************************************************** + * main() + *****************************************************************************/ +int main( int argc, char *argv[]) { + std::cout << "main thread started " << std::this_thread::get_id() << std::endl; + //[main_ws + boost::fibers::use_scheduling_algorithm< boost::fibers::algo::shared_work >(); /*< + Install the scheduling algorithm `boost::fibers::algo::shared_work` in the main thread + too, so each new fiber gets launched into the shared pool. + >*/ + + for ( char c : std::string("abcdefghijklmnopqrstuvwxyz")) { /*< + Launch a number of worker fibers; each worker fiber picks up a character + that is passed as parameter to fiber-function `whatevah`. + Each worker fiber gets detached. + >*/ + boost::fibers::fiber([c](){ whatevah( c); }).detach(); + ++fiber_count; /*< Increment fiber counter for each new fiber. >*/ + } + boost::fibers::detail::thread_barrier b( 4); + std::thread threads[] = { /*< + Launch a couple of threads that join the work sharing. + >*/ + std::thread( thread, & b), + std::thread( thread, & b), + std::thread( thread, & b) + }; + b.wait(); /*< sync with other threads: allow them to start processing >*/ + { + lock_type/*< `lock_type` is typedef'ed as __unique_lock__< [@http://en.cppreference.com/w/cpp/thread/mutex `std::mutex`] > >*/ lk( mtx_count); + cnd_count.wait( lk, [](){ return 0 == fiber_count; } ); /*< + Suspend main fiber and resume worker fibers in the meanwhile. + Main fiber gets resumed (e.g returns from `condition_variable_any::wait()`) + if all worker fibers are complete. + >*/ + } /*< + Releasing lock of mtx_count is required before joining the threads, otherwise + the other threads would be blocked inside condition_variable::wait() and + would never return (deadlock). + >*/ + BOOST_ASSERT( 0 == fiber_count); + for ( std::thread & t : threads) { /*< wait for threads to terminate >*/ + t.join(); + } + //] + std::cout << "done." << std::endl; + return EXIT_SUCCESS; +} diff --git a/boost/all/test_package/json.cpp b/boost/all/test_package/json.cpp new file mode 100644 index 0000000..3670a3d --- /dev/null +++ b/boost/all/test_package/json.cpp @@ -0,0 +1,23 @@ +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +using namespace boost::json; + +#include +#include + +int main() { + object obj; + obj[ "pi" ] = 3.141; + obj[ "happy" ] = true; + obj[ "name" ] = "Boost"; + obj[ "nothing" ] = nullptr; + obj[ "answer" ].emplace_object()["everything"] = 42; + obj[ "list" ] = { 1, 0, 2 }; + obj[ "object" ] = { {"currency", "USD"}, {"value", 42.99} }; + std::string s = serialize(obj); + std::cout << s << '\n'; +} diff --git a/boost/all/test_package/lambda.cpp b/boost/all/test_package/lambda.cpp new file mode 100644 index 0000000..0b35eec --- /dev/null +++ b/boost/all/test_package/lambda.cpp @@ -0,0 +1,21 @@ +#include +#include +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +int main(int argc, const char * const argv[]) +{ + using namespace boost::lambda; + + std::vector values; + for (int i = 1; i < argc; ++i) + values.push_back(atoi(argv[i])); + + std::for_each(values.begin(), values.end(), std::cout << _1 * 3 << " " ); + + return 0; +} diff --git a/boost/all/test_package/locale.cpp b/boost/all/test_package/locale.cpp new file mode 100644 index 0000000..b21f162 --- /dev/null +++ b/boost/all/test_package/locale.cpp @@ -0,0 +1,61 @@ +// +// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +#include +#include +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +int main() +{ + using namespace boost::locale; + generator gen; + std::locale::global(gen("")); + std::cout.imbue(std::locale()); + // Setup environment + boost::locale::date_time now; + date_time start=now; + // Set the first day of the first month of this year + start.set(period::month(),now.minimum(period::month())); + start.set(period::day(),start.minimum(period::day())); + int current_year = period::year(now); + // Display current year + std::cout << format("{1,ftime='%Y'}") % now << std::endl; + // + // Run forward untill current year is the date + // + for(now=start; period::year(now) == current_year;) { + // Print heading of month + if(calendar().is_gregorian()) + std::cout << format("{1,ftime='%B'}") % now <>' +#include + +#include +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +int main(int argc,char **argv) +{ + boost::nowide::args a(argc,argv); // Fix arguments - make them UTF-8 + if(argc!=2) { + boost::nowide::cerr << "Usage: file_name" << std::endl; // Unicode aware console + return 1; + } + boost::nowide::ifstream f(argv[1]); // argv[1] - is UTF-8 + if(!f) { + // the console can display UTF-8 + boost::nowide::cerr << "Can't open " << argv[1] << std::endl; + return 1; + } + int total_lines = 0; + while(f) { + if(f.get() == '\n') + total_lines++; + } + f.close(); + // the console can display UTF-8 + boost::nowide::cout << "File " << argv[1] << " has " << total_lines << " lines" << std::endl; + return 0; +} diff --git a/boost/all/test_package/numpy.cpp b/boost/all/test_package/numpy.cpp new file mode 100644 index 0000000..184d107 --- /dev/null +++ b/boost/all/test_package/numpy.cpp @@ -0,0 +1,28 @@ +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +namespace p = boost::python; +namespace np = boost::python::numpy; + +int main(int argc, char **argv) +{ + Py_Initialize(); + np::initialize(); + + p::tuple shape = p::make_tuple(3, 3); + np::dtype dtype = np::dtype::get_builtin(); + np::ndarray a = np::zeros(shape, dtype); + + np::ndarray b = np::empty(shape,dtype); + + std::cout << "Original array:\n" << p::extract(p::str(a)) << std::endl; + + // Reshape the array into a 1D array + a = a.reshape(p::make_tuple(9)); + // Print it again. + std::cout << "Reshaped array:\n" << p::extract(p::str(a)) << std::endl; +} diff --git a/boost/all/test_package/python.cpp b/boost/all/test_package/python.cpp new file mode 100644 index 0000000..f10411c --- /dev/null +++ b/boost/all/test_package/python.cpp @@ -0,0 +1,16 @@ +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +char const* greet() +{ + return "hello, world!!!!!"; +} + +BOOST_PYTHON_MODULE(hello_ext) +{ + using namespace boost::python; + def("greet", greet); +} diff --git a/boost/all/test_package/python.py b/boost/all/test_package/python.py new file mode 100644 index 0000000..f2e0911 --- /dev/null +++ b/boost/all/test_package/python.py @@ -0,0 +1,8 @@ +import hello_ext + +txt = hello_ext.greet() +print(txt) + +if txt != "hello, world!!!!!": + raise Exception("did not expect this!") + diff --git a/boost/all/test_package/random.cpp b/boost/all/test_package/random.cpp new file mode 100644 index 0000000..c78d082 --- /dev/null +++ b/boost/all/test_package/random.cpp @@ -0,0 +1,24 @@ +// This comes from the following Boost example: +// https://www.boost.org/doc/libs/1_71_0/doc/html/boost_random/tutorial.html +#include +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +int main() { + std::string chars( + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "1234567890" + "!@#$%^&*()" + "`~-_=+[{]}\\|;:'\",<.>/? "); + boost::random::random_device rng; + boost::random::uniform_int_distribution<> index_dist(0, chars.size() - 1); + for(int i = 0; i < 8; ++i) { + std::cout << chars[index_dist(rng)]; + } + std::cout << std::endl; +} diff --git a/boost/all/test_package/regex.cpp b/boost/all/test_package/regex.cpp new file mode 100644 index 0000000..416c10b --- /dev/null +++ b/boost/all/test_package/regex.cpp @@ -0,0 +1,20 @@ +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +int main(int argc, const char * const argv[]) +{ + std::string line; + boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" ); + + std::vector values; + for (int i = 1; i < argc; ++i) { + const std::string word(argv[i]); + boost::smatch matches; + if (boost::regex_match(line, matches, pat)) + std::cout << matches[2] << std::endl; + } +} diff --git a/boost/all/test_package/stacktrace.cpp b/boost/all/test_package/stacktrace.cpp new file mode 100644 index 0000000..4ff17e1 --- /dev/null +++ b/boost/all/test_package/stacktrace.cpp @@ -0,0 +1,130 @@ +#include + +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +void f3() { + std::cout << "==start stacktrace==\n" << boost::stacktrace::stacktrace() << "==end stacktrace==\n"; +} + +void f2() { + f3(); +} + +void f1() { + f2(); +} + +#define TEST_STACKTRACE_ADDR2LINE 1 +#define TEST_STACKTRACE_BACKTRACE 2 +#define TEST_STACKTRACE_BASIC 3 +#define TEST_STACKTRACE_NOOP 4 +#define TEST_STACKTRACE_WINDBG 5 +#define TEST_STACKTRACE_WINDBG_CACHED 6 + +static const char *stacktrace_impls[] = { + "addr2line", + "backtrace", + "basic", + "noop", + "windbg", + "windbg_cached", +}; + +bool check_used_defined() +{ + bool success = true; +#if TEST_STACKTRACE_IMPL == TEST_STACKTRACE_ADDR2LINE +# if !defined(BOOST_STACKTRACE_USE_ADDR2LINE) + std::cerr << "testing stacktrace_addr2line but BOOST_STACKTRACE_USE_ADDR2LINE not defined\n"; + success = false; +# endif +#endif +#if TEST_STACKTRACE_IMPL == TEST_STACKTRACE_BACKTRACE +# if !defined(BOOST_STACKTRACE_USE_BACKTRACE) + std::cerr << "testing stacktrace_backtrace but BOOST_STACKTRACE_USE_BACKTRACE not defined\n"; + success = false; +# endif +#endif +#if TEST_STACKTRACE_IMPL == TEST_STACKTRACE_NOOP +# if !defined(BOOST_STACKTRACE_USE_NOOP) + std::cerr << "testing stacktrace_noop but BOOST_STACKTRACE_USE_NOOP not defined\n"; + success = false; +# endif +#endif +#if TEST_STACKTRACE_IMPL == TEST_STACKTRACE_WINDBG +# if !defined(BOOST_STACKTRACE_USE_WINDBG) + std::cerr << "testing stacktrace_windbg but BOOST_STACKTRACE_USE_WINDBG not defined\n"; + success = false; +# endif +#endif +#if TEST_STACKTRACE_IMPL == TEST_STACKTRACE_WINDBG_CACHED +# if !defined(BOOST_STACKTRACE_USE_WINDBG_CACHED) + std::cerr << "testing stacktrace_windbg_cached but BOOST_STACKTRACE_USE_WINDBG_CACHED not defined\n"; + success = false; +# endif +#endif + return success; +} + +bool check_unused_undefined() +{ + bool success = true; +# if defined(BOOST_STACKTRACE_USE_ADDR2LINE) +# if TEST_STACKTRACE_IMPL != TEST_STACKTRACE_ADDR2LINE + std::cerr << "BOOST_STACKTRACE_USE_ADDR2LINE defined but not testing stacktrace_addr2line\n"; + success = false; +# endif +# if !defined(BOOST_STACKTRACE_ADDR2LINE_LOCATION) + std::cerr << "error: BOOST_STACKTRACE_ADDR2LINE_LOCATION not defined\n"; + success = false; +# endif +# endif +# if defined(BOOST_STACKTRACE_USE_BACKTRACE) +# if TEST_STACKTRACE_IMPL != TEST_STACKTRACE_BACKTRACE + std::cerr << "BOOST_STACKTRACE_USE_BACKTRACE defined but not testing stacktrace_backtrace\n"; + success = false; +# endif +# endif +# if defined(BOOST_STACKTRACE_USE_NOOP) +# if TEST_STACKTRACE_IMPL != TEST_STACKTRACE_NOOP + std::cerr << "BOOST_STACKTRACE_USE_NOOP defined but not testing stacktrace_noop\n"; + success = false; +# endif +# endif +# if defined(BOOST_STACKTRACE_USE_WINDBG) +# if TEST_STACKTRACE_IMPL != TEST_STACKTRACE_WINDBG + std::cerr << "BOOST_STACKTRACE_USE_WINDBG defined but not testing stacktrace_windbg\n"; + success = false; +# endif +# endif +# if defined(BOOST_STACKTRACE_USE_WINDBG_CACHED) +# if TEST_STACKTRACE_IMPL != TEST_STACKTRACE_WINDBG_CACHED + std::cerr << "BOOST_STACKTRACE_USE_WINDBG_CACHED defined but not testing stacktrace_windbg_cached\n"; + success = false; +# endif +# endif + return success; +} + +int main() { + int res = 0; + +#if !defined TEST_STACKTRACE_IMPL + std::cerr << "TEST_STACKTRACE_IMPL not defined!\n"; + res = 1; +#else + std::cerr << "Testing stacktrace_" << stacktrace_impls[TEST_STACKTRACE_IMPL-1] << "...\n"; + if (!check_unused_undefined()) { + res = 1; + } + if (!check_used_defined()) { + res = 1; + } +#endif + f1(); + return res; +} diff --git a/boost/all/test_package/test.cpp b/boost/all/test_package/test.cpp new file mode 100644 index 0000000..764730e --- /dev/null +++ b/boost/all/test_package/test.cpp @@ -0,0 +1,7 @@ +#define BOOST_TEST_MODULE Test +#include "boost/test/unit_test.hpp" + +BOOST_AUTO_TEST_CASE( free_test_function ) +{ + BOOST_TEST( true /* test assertion */ ); +} diff --git a/boost/all/test_package/url.cpp b/boost/all/test_package/url.cpp new file mode 100644 index 0000000..dd65390 --- /dev/null +++ b/boost/all/test_package/url.cpp @@ -0,0 +1,14 @@ +// +// Copyright (c) 2022 alandefreitas (alandefreitas@gmail.com) +// +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt +// + +#include +#include + +int main() { + assert(sizeof(boost::urls::url) > 0); + return 0; +} diff --git a/boost/all/test_v1_package/CMakeLists.txt b/boost/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..c23ed5c --- /dev/null +++ b/boost/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_v1_package) + +enable_testing() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/boost/all/test_v1_package/conanfile.py b/boost/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..4bdbddf --- /dev/null +++ b/boost/all/test_v1_package/conanfile.py @@ -0,0 +1,52 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def _boost_option(self, name, default): + try: + return getattr(self.options["boost"], name, default) + except (AttributeError, ConanException): + return default + + def build(self): + # FIXME: tools.vcvars added for clang-cl. Remove once conan supports clang-cl properly. (https://github.com/conan-io/conan-center-index/pull/1453) + with tools.vcvars(self.settings) if (self.settings.os == "Windows" and self.settings.compiler == "clang") else tools.no_op(): + cmake = CMake(self) + cmake.definitions["HEADER_ONLY"] = self.options["boost"].header_only + if not self.options["boost"].header_only: + cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared + cmake.definitions["WITH_PYTHON"] = not self.options["boost"].without_python + if not self.options["boost"].without_python: + pyversion = tools.Version(self.options["boost"].python_version) + cmake.definitions["PYTHON_VERSION_TO_SEARCH"] = pyversion + cmake.definitions["Python_EXECUTABLE"] = self.options["boost"].python_executable + cmake.definitions["WITH_RANDOM"] = not self.options["boost"].without_random + cmake.definitions["WITH_REGEX"] = not self.options["boost"].without_regex + cmake.definitions["WITH_TEST"] = not self.options["boost"].without_test + cmake.definitions["WITH_COROUTINE"] = not self.options["boost"].without_coroutine + cmake.definitions["WITH_CHRONO"] = not self.options["boost"].without_chrono + cmake.definitions["WITH_FIBER"] = not self.options["boost"].without_fiber + cmake.definitions["WITH_LOCALE"] = not self.options["boost"].without_locale + cmake.definitions["WITH_NOWIDE"] = not self._boost_option("without_nowide", True) + cmake.definitions["WITH_JSON"] = not self._boost_option("without_json", True) + cmake.definitions["WITH_STACKTRACE"] = not self.options["boost"].without_stacktrace + cmake.definitions["WITH_STACKTRACE_ADDR2LINE"] = self.deps_user_info["boost"].stacktrace_addr2line_available + cmake.definitions["WITH_STACKTRACE_BACKTRACE"] = self._boost_option("with_stacktrace_backtrace", False) + cmake.definitions["WITH_URL"] = not self._boost_option("without_url", True) + if self.options["boost"].namespace != 'boost' and not self.options["boost"].namespace_alias: + cmake.definitions['BOOST_NAMESPACE'] = self.options["boost"].namespace + cmake.configure() + # Disable parallel builds because c3i (=conan-center's test/build infrastructure) seems to choke here + cmake.parallel = False + cmake.build() + + def test(self): + if tools.cross_building(self): + return + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", run_environment=True) + diff --git a/boost/config.yml b/boost/config.yml new file mode 100644 index 0000000..3363c84 --- /dev/null +++ b/boost/config.yml @@ -0,0 +1,31 @@ +versions: + "1.85.0": + folder: all + "1.84.0": + folder: all + "1.83.0": + folder: all + "1.82.0": + folder: all + "1.81.0": + folder: all + "1.80.0": + folder: all + "1.79.0": + folder: all + "1.78.0": + folder: all + "1.77.0": + folder: all + "1.76.0": + folder: all + "1.75.0": + folder: all + "1.74.0": + folder: all + "1.73.0": + folder: all + "1.72.0": + folder: all + "1.71.0": + folder: all diff --git a/bzip2/all/CMakeLists.txt b/bzip2/all/CMakeLists.txt new file mode 100644 index 0000000..cce959a --- /dev/null +++ b/bzip2/all/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.4) +project(bzip2 LANGUAGES C) + +include(GNUInstallDirs) + +option(BZ2_BUILD_EXE "Build bzip2 command-line utility" ON) + +add_library( + bz2 + ${BZ2_SRC_DIR}/blocksort.c + ${BZ2_SRC_DIR}/bzlib.c + ${BZ2_SRC_DIR}/compress.c + ${BZ2_SRC_DIR}/crctable.c + ${BZ2_SRC_DIR}/decompress.c + ${BZ2_SRC_DIR}/huffman.c + ${BZ2_SRC_DIR}/randtable.c +) + +target_include_directories(bz2 PUBLIC ${BZ2_SRC_DIR}) +set_target_properties( + bz2 + PROPERTIES + PUBLIC_HEADER "${BZ2_SRC_DIR}/bzlib.h" + SOVERSION ${BZ2_VERSION_MAJOR} + VERSION ${BZ2_VERSION_STRING} + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +install( + TARGETS bz2 + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) + +if(BZ2_BUILD_EXE) + add_executable(bzip2 ${BZ2_SRC_DIR}/bzip2.c) + target_link_libraries(bzip2 PRIVATE bz2) + install(TARGETS bzip2 DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() diff --git a/bzip2/all/conandata.yml b/bzip2/all/conandata.yml new file mode 100644 index 0000000..01ba013 --- /dev/null +++ b/bzip2/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.8": + url: "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" + sha256: "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" + "1.0.6": + url: "https://sourceware.org/pub/bzip2/bzip2-1.0.6.tar.gz" + sha256: "a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd" +patches: + "1.0.6": + - patch_file: "patches/0001-fix-sys-stat-include.patch" diff --git a/bzip2/all/conanfile.py b/bzip2/all/conanfile.py new file mode 100644 index 0000000..2a39045 --- /dev/null +++ b/bzip2/all/conanfile.py @@ -0,0 +1,106 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class Bzip2Conan(ConanFile): + name = "bzip2" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sourceware.org/bzip2" + license = "bzip2-1.0.8" + description = "bzip2 is a free and open-source file compression program that uses the Burrows Wheeler algorithm." + topics = ("data-compressor", "file-compression") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_executable": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_executable": True, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + self.license = f"bzip2-{self.version}" + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.compiler.rm_safe("libcxx") + self.settings.compiler.rm_safe("cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BZ2_BUILD_EXE"] = self.options.build_executable + tc.variables["BZ2_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["BZ2_VERSION_MAJOR"] = Version(self.version).major + tc.variables["BZ2_VERSION_STRING"] = self.version + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent(f"""\ + set(BZIP2_NEED_PREFIX TRUE) + set(BZIP2_FOUND TRUE) + if(NOT DEFINED BZIP2_INCLUDE_DIRS AND DEFINED BZip2_INCLUDE_DIRS) + set(BZIP2_INCLUDE_DIRS ${{BZip2_INCLUDE_DIRS}}) + endif() + if(NOT DEFINED BZIP2_INCLUDE_DIR AND DEFINED BZip2_INCLUDE_DIR) + set(BZIP2_INCLUDE_DIR ${{BZip2_INCLUDE_DIR}}) + endif() + if(NOT DEFINED BZIP2_LIBRARIES AND DEFINED BZip2_LIBRARIES) + set(BZIP2_LIBRARIES ${{BZip2_LIBRARIES}}) + endif() + set(BZIP2_VERSION_STRING "{self.version}") + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "BZip2") + self.cpp_info.set_property("cmake_target_name", "BZip2::BZip2") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.libs = ["bz2"] + + self.cpp_info.names["cmake_find_package"] = "BZip2" + self.cpp_info.names["cmake_find_package_multi"] = "BZip2" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + if self.options.build_executable: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/bzip2/all/patches/0001-fix-sys-stat-include.patch b/bzip2/all/patches/0001-fix-sys-stat-include.patch new file mode 100644 index 0000000..6c79502 --- /dev/null +++ b/bzip2/all/patches/0001-fix-sys-stat-include.patch @@ -0,0 +1,11 @@ +--- a/bzip2.c ++++ b/bzip2.c +@@ -128,7 +128,7 @@ + #if BZ_LCCWIN32 + # include + # include +-# include ++# include + + # define NORETURN /**/ + # define PATH_SEP '\\' diff --git a/bzip2/all/test_package/CMakeLists.txt b/bzip2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..364bed2 --- /dev/null +++ b/bzip2/all/test_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(BZip2 REQUIRED) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE BZip2::BZip2) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindBZip2.html are properly defined +set(_custom_vars + BZIP2_FOUND + BZIP2_NEED_PREFIX + BZIP2_INCLUDE_DIRS + BZIP2_INCLUDE_DIR + BZIP2_LIBRARIES + BZIP2_VERSION_STRING +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/bzip2/all/test_package/conanfile.py b/bzip2/all/test_package/conanfile.py new file mode 100644 index 0000000..8a5bb47 --- /dev/null +++ b/bzip2/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/bzip2/all/test_package/test_package.c b/bzip2/all/test_package/test_package.c new file mode 100644 index 0000000..fb91334 --- /dev/null +++ b/bzip2/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include +#include +#include "bzlib.h" + + +int main(void) { + char buffer [256] = {0}; + unsigned int size = 256; + const char* version = BZ2_bzlibVersion(); + printf("Bzip2 version: %s\n", version); + BZ2_bzBuffToBuffCompress(buffer, &size, "conan-package-manager", 21, 1, 0, 1); + printf("Bzip2 compressed: %s\n", buffer); + return EXIT_SUCCESS; +} diff --git a/bzip2/all/test_v1_package/CMakeLists.txt b/bzip2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/bzip2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/bzip2/all/test_v1_package/conanfile.py b/bzip2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..19e6a0c --- /dev/null +++ b/bzip2/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/bzip2/config.yml b/bzip2/config.yml new file mode 100644 index 0000000..09dfd19 --- /dev/null +++ b/bzip2/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.8": + folder: all + "1.0.6": + folder: all diff --git a/c-ares/all/conandata.yml b/c-ares/all/conandata.yml new file mode 100644 index 0000000..4707b2b --- /dev/null +++ b/c-ares/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "1.32.2": + url: "https://github.com/c-ares/c-ares/releases/download/v1.32.2/c-ares-1.32.2.tar.gz" + sha256: "072ff6b30b9682d965b87eb9b77851dc1cd8e6d8090f6821a56bd8fa89595061" + "1.32.1": + url: "https://github.com/c-ares/c-ares/releases/download/v1.32.1/c-ares-1.32.1.tar.gz" + sha256: "63be2c4ee121faa47e9766f735b4cde750fff2c563f81c11e572d3dc6401e5e7" + "1.31.0": + url: "https://github.com/c-ares/c-ares/releases/download/v1.31.0/c-ares-1.31.0.tar.gz" + sha256: "0167a33dba96ca8de29f3f598b1e6cabe531799269fd63d0153aa0e6f5efeabd" + "1.30.0": + url: "https://github.com/c-ares/c-ares/releases/download/v1.30.0/c-ares-1.30.0.tar.gz" + sha256: "4fea312112021bcef081203b1ea020109842feb58cd8a36a3d3f7e0d8bc1138c" + "1.28.1": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_28_1/c-ares-1.28.1.tar.gz" + sha256: "675a69fc54ddbf42e6830bc671eeb6cd89eeca43828eb413243fd2c0a760809d" + "1.27.0": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_27_0/c-ares-1.27.0.tar.gz" + sha256: "0a72be66959955c43e2af2fbd03418e82a2bd5464604ec9a62147e37aceb420b" + "1.26.0": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_26_0/c-ares-1.26.0.tar.gz" + sha256: "bed58c4f02b009080ebda6c2467ba469722ac6aebbf4497dc44a83d8c6194e50" + # keep 1.25.0 for libnghttp2, trantor, libcoro + "1.25.0": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_25_0/c-ares-1.25.0.tar.gz" + sha256: "71832b93a48f5ff579c505f4869120c14e57b783275367207f1a98314aa724e5" + # keep 1.19.1 for grpc + "1.19.1": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_19_1/c-ares-1.19.1.tar.gz" + sha256: "321700399b72ed0e037d0074c629e7741f6b2ec2dda92956abe3e9671d3e268e" diff --git a/c-ares/all/conanfile.py b/c-ares/all/conanfile.py new file mode 100644 index 0000000..6356287 --- /dev/null +++ b/c-ares/all/conanfile.py @@ -0,0 +1,97 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, rm, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class CAresConan(ConanFile): + name = "c-ares" + description = "A C library for asynchronous DNS requests" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://c-ares.haxx.se/" + topics = ("dns", "resolver", "async") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "tools": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CARES_STATIC"] = not self.options.shared + tc.variables["CARES_SHARED"] = self.options.shared + tc.variables["CARES_BUILD_TESTS"] = False + tc.variables["CARES_MSVC_STATIC_RUNTIME"] = False + tc.variables["CARES_BUILD_TOOLS"] = self.options.tools + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "*LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "c-ares") + self.cpp_info.set_property("cmake_target_name", "c-ares::cares") + self.cpp_info.set_property("pkg_config_name", "libcares") + + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["cares"].libs = collect_libs(self) + if not self.options.shared: + self.cpp_info.components["cares"].defines.append("CARES_STATICLIB") + if self.settings.os == "Linux": + self.cpp_info.components["cares"].system_libs.append("rt") + if Version(self.version) >= "1.23.0": + self.cpp_info.components["cares"].system_libs.append("pthread") + elif self.settings.os == "Windows": + self.cpp_info.components["cares"].system_libs.extend(["ws2_32", "advapi32"]) + self.cpp_info.components["cares"].system_libs.append("iphlpapi") + elif is_apple_os(self): + self.cpp_info.components["cares"].system_libs.append("resolv") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["pkg_config"] = "libcares" + self.cpp_info.components["cares"].names["cmake_find_package"] = "cares" + self.cpp_info.components["cares"].names["cmake_find_package_multi"] = "cares" + self.cpp_info.components["cares"].names["pkg_config"] = "libcares" + self.cpp_info.components["cares"].set_property("cmake_target_name", "c-ares::cares") + self.cpp_info.components["cares"].set_property("pkg_config_name", "libcares") + if self.options.tools: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/c-ares/all/test_package/CMakeLists.txt b/c-ares/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..18c37b0 --- /dev/null +++ b/c-ares/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(c-ares REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE c-ares::cares) diff --git a/c-ares/all/test_package/conanfile.py b/c-ares/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/c-ares/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/c-ares/all/test_package/test_package.c b/c-ares/all/test_package/test_package.c new file mode 100644 index 0000000..0636b1f --- /dev/null +++ b/c-ares/all/test_package/test_package.c @@ -0,0 +1,110 @@ +#include +#include +#include +#include +#include +#include + + +#if !defined(WIN32) || defined(WATT32) + #include + #include + #include + #include + #include +#else + #include +#endif + +#ifdef __MINGW32__ + const char* inet_ntop(int af, const void* src, char* dst, int cnt) { + struct sockaddr_in srcaddr; + memset(&srcaddr, 0, sizeof(struct sockaddr_in)); + memcpy(&(srcaddr.sin_addr), src, sizeof(srcaddr.sin_addr)); + + srcaddr.sin_family = af; + if (WSAAddressToString((struct sockaddr*) &srcaddr, sizeof(struct sockaddr_in), 0, dst, (LPDWORD) &cnt) != 0) { + DWORD rv = WSAGetLastError(); + return NULL; + } + return dst; + } +#endif // __MINGW32__ + +static void +state_cb(void *data, int s, int read, int write) +{ + printf("Change state fd %d read:%d write:%d\n", s, read, write); +} + + +static void +callback(void *arg, int status, int timeouts, struct hostent *host) +{ + + if(!host || status != ARES_SUCCESS){ + printf("Failed to lookup %s\n", ares_strerror(status)); + return; + } + + printf("Found address name %s\n", host->h_name); + char ip[INET6_ADDRSTRLEN]; + int i = 0; + + for (i = 0; host->h_addr_list[i]; ++i) { + inet_ntop(host->h_addrtype, host->h_addr_list[i], ip, sizeof(ip)); + printf("%s\n", ip); + } +} + +static void +wait_ares(ares_channel channel) +{ + for(;;){ + struct timeval *tvp, tv; + fd_set read_fds, write_fds; + int nfds; + + FD_ZERO(&read_fds); + FD_ZERO(&write_fds); + nfds = ares_fds(channel, &read_fds, &write_fds); + if(nfds == 0){ + break; + } + tvp = ares_timeout(channel, NULL, &tv); + select(nfds, &read_fds, &write_fds, NULL, tvp); + ares_process(channel, &read_fds, &write_fds); + } +} + +int +main(void) +{ + ares_channel channel; + int status; + struct ares_options options; + int optmask = 0; + + #ifdef WIN32 + WORD wVersionRequested = MAKEWORD(2, 2); + WSADATA wsaData; + WSAStartup(wVersionRequested, &wsaData); + #endif + + status = ares_library_init(ARES_LIB_INIT_ALL); + if (status != ARES_SUCCESS){ + printf("ares_library_init: %s\n", ares_strerror(status)); + return 1; + } + + status = ares_init_options(&channel, &options, optmask); + if(status != ARES_SUCCESS) { + printf("ares_init_options: %s\n", ares_strerror(status)); + return 1; + } + + wait_ares(channel); + ares_destroy(channel); + ares_library_cleanup(); + return 0; +} diff --git a/c-ares/all/test_v1_package/CMakeLists.txt b/c-ares/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..925ecbe --- /dev/null +++ b/c-ares/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/c-ares/all/test_v1_package/conanfile.py b/c-ares/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/c-ares/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/c-ares/config.yml b/c-ares/config.yml new file mode 100644 index 0000000..fa9c8c2 --- /dev/null +++ b/c-ares/config.yml @@ -0,0 +1,19 @@ +versions: + "1.32.2": + folder: all + "1.32.1": + folder: all + "1.31.0": + folder: all + "1.30.0": + folder: all + "1.28.1": + folder: all + "1.27.0": + folder: all + "1.26.0": + folder: all + "1.25.0": + folder: all + "1.19.1": + folder: all diff --git a/cmake/3.x.x/conandata.yml b/cmake/3.x.x/conandata.yml new file mode 100644 index 0000000..da33ab4 --- /dev/null +++ b/cmake/3.x.x/conandata.yml @@ -0,0 +1,25 @@ +sources: + "3.19.8": + url: https://github.com/Kitware/CMake/releases/download/v3.19.8/cmake-3.19.8.tar.gz + sha256: 09b4fa4837aae55c75fb170f6a6e2b44818deba48335d1969deddfbb34e30369 + "3.20.6": + url: https://github.com/Kitware/CMake/releases/download/v3.20.6/cmake-3.20.6.tar.gz + sha256: a0bd485e1a38dd13c0baec89d5f4adbf61c7fd32fddb38eabc69a75bc0b65d72 + "3.21.7": + url: https://github.com/Kitware/CMake/releases/download/v3.21.7/cmake-3.21.7.tar.gz + sha256: 3523c4a5afc61ac3d7c92835301cdf092129c9b672a6ee17e68c92e928c1375a + "3.22.6": + url: https://github.com/Kitware/CMake/releases/download/v3.22.6/cmake-3.22.6.tar.gz + sha256: 73933163670ea4ea95c231549007b0c7243282293506a2cf4443714826ad5ec3 + "3.23.5": + url: "https://github.com/Kitware/CMake/releases/download/v3.23.5/cmake-3.23.5.tar.gz" + sha256: "f2944cde7a140b992ba5ccea2009a987a92413762250de22ebbace2319a0f47d" + "3.24.3": + url: "https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3.tar.gz" + sha256: "b53aa10fa82bff84ccdb59065927b72d3bee49f4d86261249fc0984b3b367291" + "3.25.2": + url: "https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2.tar.gz" + sha256: "c026f22cb931dd532f648f087d587f07a1843c6e66a3dfca4fb0ea21944ed33c" + "3.26.4": + url: "https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4.tar.gz" + sha256: "313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208" diff --git a/cmake/3.x.x/conanfile.py b/cmake/3.x.x/conanfile.py new file mode 100644 index 0000000..042191e --- /dev/null +++ b/cmake/3.x.x/conanfile.py @@ -0,0 +1,166 @@ +from conan import ConanFile +from conan.tools.files import chdir, copy, rmdir, get, save, load +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.build import build_jobs, cross_building, check_min_cppstd +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration + +import os +import json + +required_conan_version = ">=1.51.0" + +class CMakeConan(ConanFile): + name = "cmake" + package_type = "application" + description = "Conan installer for CMake" + topics = ("cmake", "build", "installer") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Kitware/CMake" + license = "BSD-3-Clause" + settings = "os", "arch", "compiler", "build_type" + + options = { + "with_openssl": [True, False], + "bootstrap": [True, False], + } + default_options = { + "with_openssl": True, + "bootstrap": False, + } + + def config_options(self): + if self.settings.os == "Windows": + self.options.with_openssl = False + + def requirements(self): + if self.options.get_safe("with_openssl", default=False): + self.requires("openssl/[>=1.1 <4]") + + def validate_build(self): + if self.settings.os == "Windows" and self.options.bootstrap: + raise ConanInvalidConfiguration("CMake does not support bootstrapping on Windows") + + minimal_cpp_standard = "11" + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, minimal_cpp_standard) + + minimal_version = { + "gcc": "4.8", + "clang": "3.3", + "apple-clang": "9", + "Visual Studio": "14", + "msvc": "190", + } + + compiler = str(self.settings.compiler) + if compiler not in minimal_version: + self.output.warning( + f"{self.name} recipe lacks information about the {compiler} compiler standard version support") + self.output.warning( + f"{self.name} requires a compiler that supports at least C++{minimal_cpp_standard}") + return + + version = Version(self.settings.compiler.version) + if version < minimal_version[compiler]: + raise ConanInvalidConfiguration( + f"{self.name} requires a compiler that supports at least C++{minimal_cpp_standard}") + + def validate(self): + if self.settings.os == "Macos" and self.settings.arch == "x86": + raise ConanInvalidConfiguration("CMake does not support x86 for macOS") + + def layout(self): + if self.options.bootstrap: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + rmdir(self, os.path.join(self.source_folder, "Tests", "RunCMake", "find_package")) + + def generate(self): + if self.options.bootstrap: + tc = AutotoolsToolchain(self) + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + bootstrap_cmake_options = ["--"] + bootstrap_cmake_options.append(f'-DCMAKE_CXX_STANDARD={"11" if not self.settings.compiler.cppstd else self.settings.compiler.cppstd}') + if self.settings.os == "Linux": + if self.options.with_openssl: + openssl = self.dependencies["openssl"] + bootstrap_cmake_options.append("-DCMAKE_USE_OPENSSL=ON") + bootstrap_cmake_options.append(f'-DOPENSSL_USE_STATIC_LIBS={"FALSE" if openssl.options.shared else "TRUE"}') + bootstrap_cmake_options.append(f'-DOPENSSL_ROOT_DIR={openssl.package_path}') + else: + bootstrap_cmake_options.append("-DCMAKE_USE_OPENSSL=OFF") + save(self, "bootstrap_args", json.dumps({"bootstrap_cmake_options": ' '.join(arg for arg in bootstrap_cmake_options)})) + else: + tc = CMakeToolchain(self) + # Disabling testing because CMake tests build can fail in Windows in some cases + tc.variables["BUILD_TESTING"] = False + if not self.settings.compiler.cppstd: + tc.variables["CMAKE_CXX_STANDARD"] = 11 + tc.variables["CMAKE_BOOTSTRAP"] = False + if self.settings.os == "Linux": + tc.variables["CMAKE_USE_OPENSSL"] = self.options.with_openssl + if self.options.with_openssl: + openssl = self.dependencies["openssl"] + tc.variables["OPENSSL_USE_STATIC_LIBS"] = not openssl.options.shared + if cross_building(self): + tc.variables["HAVE_POLL_FINE_EXITCODE"] = '' + tc.variables["HAVE_POLL_FINE_EXITCODE__TRYRUN_OUTPUT"] = '' + # TODO: Remove after fixing https://github.com/conan-io/conan-center-index/issues/13159 + # C3I workaround to force CMake to choose the highest version of + # the windows SDK available in the system + if is_msvc(self) and not self.conf.get("tools.cmake.cmaketoolchain:system_version"): + tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0" + tc.generate() + tc = CMakeDeps(self) + # CMake try_compile failure: https://github.com/conan-io/conan-center-index/pull/16073#discussion_r1110037534 + tc.set_property("openssl", "cmake_find_mode", "module") + tc.generate() + + + def build(self): + if self.options.bootstrap: + toolchain_file_content = json.loads(load(self, os.path.join(self.generators_folder, "bootstrap_args"))) + bootstrap_cmake_options = toolchain_file_content.get("bootstrap_cmake_options") + with chdir(self, self.source_folder): + self.run(f'./bootstrap --prefix="" --parallel={build_jobs(self)} {bootstrap_cmake_options}') + autotools = Autotools(self) + autotools.make() + else: + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "Copyright.txt", self.source_folder, os.path.join(self.package_folder, "licenses"), keep_path=False) + if self.options.bootstrap: + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "doc")) + + def package_id(self): + del self.info.settings.compiler + del self.info.options.bootstrap + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + # Needed for compatibility with v1.x - Remove when 2.0 becomes the default + bindir = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bindir}") + self.env_info.PATH.append(bindir) diff --git a/cmake/3.x.x/test_package/conanfile.py b/cmake/3.x.x/test_package/conanfile.py new file mode 100644 index 0000000..df50a01 --- /dev/null +++ b/cmake/3.x.x/test_package/conanfile.py @@ -0,0 +1,24 @@ +from six import StringIO +from conan import ConanFile +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + output = StringIO() + # Third arg to self.run renamed "stdout" in Conan 2.0 but 1.x linter doesn't like it + self.run("cmake --version", output) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + tokens = re.split('[@#]', self.tested_reference_str) + require_version = tokens[0].split("/", 1)[1] + self.output.info("Expected version: {}".format(require_version)) + assert_cmake_version = "cmake version %s" % require_version + assert(assert_cmake_version in output_str) diff --git a/cmake/3.x.x/test_v1_package/conanfile.py b/cmake/3.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000..df9415b --- /dev/null +++ b/cmake/3.x.x/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +import os +from six import StringIO +from conan import ConanFile +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + output = StringIO() + self.run("cmake --version", output=output, run_environment=False) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + tokens = re.split('[@#]', self.tested_reference_str) + require_version = tokens[0].split("/", 1)[1] + self.output.info("Expected version: {}".format(require_version)) + assert_cmake_version = "cmake version %s" % require_version + assert(assert_cmake_version in output_str) diff --git a/cmake/binary/conandata.yml b/cmake/binary/conandata.yml new file mode 100644 index 0000000..7959b73 --- /dev/null +++ b/cmake/binary/conandata.yml @@ -0,0 +1,480 @@ +sources: + "3.30.1": + Linux: + armv8: + url: "https://cmake.org/files/v3.30/cmake-3.30.1-linux-aarch64.tar.gz" + sha256: "ad234996f8750f11d7bd0d17b03f55c434816adf1f1671aab9e8bab21a43286a" + x86_64: + url: "https://cmake.org/files/v3.30/cmake-3.30.1-linux-x86_64.tar.gz" + sha256: "ac31f077ef3378641fa25a3cb980d21b2f083982d3149a8f2eb9154f2b53696b" + Macos: + universal: + url: "https://cmake.org/files/v3.30/cmake-3.30.1-macos10.10-universal.tar.gz" + sha256: "4c1beda2bb2ab830f22fdb29aa6cc844f9b0eb32cca0fb4f01b407688944d181" + Windows: + armv8: + url: "https://cmake.org/files/v3.30/cmake-3.30.1-windows-arm64.zip" + sha256: "02b433f70aa549449be2d53046d0179590bf3b6290d9fda3fbbb23f96a4f2802" + x86_64: + url: "https://cmake.org/files/v3.30/cmake-3.30.1-windows-x86_64.zip" + sha256: "cf7788ff9d92812da194847d4ec874fc576f34079987d0f20c96cd09e2a16220" + "3.30.0": + Linux: + armv8: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-linux-aarch64.tar.gz" + sha256: "3db7f12dadc91be9b30f0e5a71038c51d7f5b7cc03e32625621a052e9996bef0" + x86_64: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-linux-x86_64.tar.gz" + sha256: "09846a3858583f38189b59177586adf125a08c15f3cddcaf7d7d7081ac86969f" + Macos: + universal: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-macos10.10-universal.tar.gz" + sha256: "54f237212362efa3f192508eeb25d98f2150779ed45c46a77fe356597c3d2749" + Windows: + armv8: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-windows-arm64.zip" + sha256: "cb8fb65a8f523daa0ce6c531407ae10fcab8d0eefe18a6ef9fb718c54307d6e3" + x86_64: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-windows-x86_64.zip" + sha256: "f8d2da0eaf3bab9cf065e97bd6d8e1819886f8671d3d4c7bb93cb774123fa448" + "3.29.7": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.7-linux-aarch64.tar.gz" + sha256: "ee8cf1ceaef011578ec070c13471c4b26e87f065315155e11177063b0743da68" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.7-linux-x86_64.tar.gz" + sha256: "fb0837495a3a1d044f5101d0a76d294c825ff85c10a32c42d7167604278344f7" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.7-macos10.10-universal.tar.gz" + sha256: "3a148e37bf57c419e40817d6208916a33eff8c1757b0947d9991eca902916559" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.7-windows-arm64.zip" + sha256: "ae87f2ff173deeb3ae8891d31c8f92ebabab8a4c29a074c5c5d39b38dde706d2" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.7-windows-x86_64.zip" + sha256: "3d9580b54faa0651f4cb0bccdff222bd123366b35a8b1051ee33a64915384ee4" + "3.29.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-linux-aarch64.tar.gz" + sha256: "4d6b0a551db9da7a034a09372f716cf2094413d7fd8a787051854154b0b3b343" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-linux-x86_64.tar.gz" + sha256: "28fef61e64840b784da6db35218fd3ae179ff8bf0be1c8a9d075d6185a0e4fdc" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-macos10.10-universal.tar.gz" + sha256: "a65f9e66c63bb79f3b6f00e4b67367b6f6c40030ee41cf06580818a74a84b3e9" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-windows-arm64.zip" + sha256: "8f0df498d8b1a076fc9305dde5a06427262a0476e89d4c670a49147b0bc30761" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-windows-x86_64.zip" + sha256: "5c648eac06c33477e510bae14ce1f969e9abb38992b71f245633b182fccb474d" + "3.29.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-linux-aarch64.tar.gz" + sha256: "6eb655ee89c50611f2370c5a3293bd2fe1920b73dff50b71fb3357d56a9d28d8" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-linux-x86_64.tar.gz" + sha256: "92629f95e15e7c2e88726c57a984ffdc5cf248e354f7ab791bc86d2ad513903e" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-macos10.10-universal.tar.gz" + sha256: "a110d173ab839854fc0b19b9f29f213c1112106e2858c1a1fe7973d4bb13a536" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-windows-arm64.zip" + sha256: "9c67d16560125ebf1278ef1b3072914a60bff780522b28c0096f364f775a8e55" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-windows-x86_64.zip" + sha256: "f85db8361cb7eb11ceb6b2f1ee42bec7234bb8d9e487ea78c00de64771768d92" + "3.29.4": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-linux-aarch64.tar.gz" + sha256: "9210619e7907b14858178743d5b7ba70ce846d98a6a65bcdbd83c08b932ba6a5" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-linux-x86_64.tar.gz" + sha256: "64e5473169dd43055fbf2c138cae6e5ec10f30a0606d24f12078e68466320cf4" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-macos10.10-universal.tar.gz" + sha256: "44a59c584122676463bf5bdd2c7dee2ac02944e065a71cc30c57541a20d3465c" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-windows-arm64.zip" + sha256: "16ce291dd34189a60d7add96b4148adfdbb46b6b2478086cb43abe2e5ff34ad3" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-windows-x86_64.zip" + sha256: "1c8bfbc5537553edccded62f8f03475a161280c1b64f54c887824c6eb4e773ff" + "3.29.3": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-linux-aarch64.tar.gz" + sha256: "ae61d262b2771ba9cbdf1eeac288e64d6510d2f0417d2d92e27807d269ac90fa" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-linux-x86_64.tar.gz" + sha256: "90b543a30220401db0e08347af067545be158ce89ffb09b7df1516cda8617329" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-macos10.10-universal.tar.gz" + sha256: "1a7ecdd1dc8baaede55d1011f60b5871ff908fa640f7e96ab5520f38ef97bba0" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-windows-arm64.zip" + sha256: "8d7d65e46a45bdbf8b4416d29ef6ad9a80f0b26afb5d6afab358e34b1b30a556" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-windows-x86_64.zip" + sha256: "6423ed300e6aa1b15c4aeae9a7399157f53fc84a2fb7242ca64c8dfd83e5f8a6" + "3.29.2": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-linux-aarch64.tar.gz" + sha256: "ca883c6dc3ce9eebd833804f0f940ecbbff603520cfd169ee58916dbbc23c2b8" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-linux-x86_64.tar.gz" + sha256: "0416c70cf88e8f92efcbfe292e181bc09ead7d70e29ab37b697522c01121eab5" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-macos10.10-universal.tar.gz" + sha256: "0b542389345b28d2f73122b72ec9b899947e643fd86cf8f42bae2718884d2ad3" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-windows-arm64.zip" + sha256: "5b16a0db4966c04582c40131038de49d5b0161fcd950dc9e955753dfab858882" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-windows-x86_64.zip" + sha256: "86b5de51f60a0e9d62be4d8ca76ea467d154083d356fcc9af1409606be341cd8" + "3.29.0": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-linux-aarch64.tar.gz" + sha256: "2cb768a14b28a4478bb931d917dbc419305b82433bdecc046df98e7c336225fa" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-linux-x86_64.tar.gz" + sha256: "f06258f52c5649752dfb10c4c2e1d8167c760c8826f078c6f5c332fa9d976bf8" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-macos10.10-universal.tar.gz" + sha256: "868f356c56a3c35e8f39f0d4fb7e579cb2eb0ac06c26520d6a203d91bdc7ad09" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-windows-arm64.zip" + sha256: "e5bea5c45b61f105429fc664364c5280acd40770cc74235b79e7422f608a9849" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-windows-x86_64.zip" + sha256: "9ab28eba1ab7911a0e57ab274f5990a283fffa1d22eb711792d5562e5869f9ef" + "3.28.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-linux-aarch64.tar.gz" + sha256: "7909cc2128ce9442c63ce674a0bfb0e4f4ce04cef667d887e15ad5670d594ba7" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-linux-x86_64.tar.gz" + sha256: "931e3c0d546ee03ca72bb147ccd9b49e3b6252f765f66bf21b9d165519940458" + Macos: + universal: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-macos10.10-universal.tar.gz" + sha256: "cbda8e719b3239e304b339cdd90e946c09dac5ad2d57c93bf1b1d3914685d9a7" + Windows: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-windows-arm64.zip" + sha256: "63e4ebd2dadb5ad63faaf4ed38db40d3fec92d1b050d2a4e69011ea3ee699d29" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-windows-x86_64.zip" + sha256: "a8f2e684ead94a64fd3517a38857a5b3f7f8d68d15c49ca1143d18797eaf9cac" + "3.28.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-linux-aarch64.tar.gz" + sha256: "5b4a86b456058266bd4caa9c59187fab4b1ace823acdd9741d2d24fed5a4f50b" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-linux-x86_64.tar.gz" + sha256: "c5460b8a0ecfea7c0ac99d78427e19409ea9133e29a604e1f8c0e6806a8f6934" + Macos: + universal: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-macos10.10-universal.tar.gz" + sha256: "62956bf3c26b396cee20dddf2914d63d882cff4245e13c29c72f7841c03d56e4" + Windows: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-windows-arm64.zip" + sha256: "47056df28bc543c528f85f15c46180dbed750e5ebd0180f936a2e3ee22ddea56" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-windows-x86_64.zip" + sha256: "0fbea146a782e4b82a799384a2109e46ce27f3ad70c30d3f8c9ef751e1e28040" + "3.28.1": + Linux: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.1-linux-aarch64.tar.gz" + sha256: "e84d88e46ed8c85fbe259bcd4ca07df7a928df87e84013e0da34d91b01a25d71" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.1-linux-x86_64.tar.gz" + sha256: "f76398c24362ad87bad1a3d6f1e8f4377632b5b1c360c4ba1fd7cd205fd9d8d4" + Macos: + universal: + url: "https://cmake.org/files/v3.28/cmake-3.28.1-macos10.10-universal.tar.gz" + sha256: "f2d296294921b209d9c7edbc12ce175e00644fcabba362b6a24c32b0a4624a9a" + Windows: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.1-windows-arm64.zip" + sha256: "a839b8d32c11b24f078142b5b8c3361a955ebc65788f0f0353b2121fe2f74e49" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.1-windows-x86_64.zip" + sha256: "671332249bc7cc7424523d6c2b5edd3e3de90a43b8b82e8782f42da4fe4c562d" + "3.27.9": + Linux: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.9-linux-aarch64.tar.gz" + sha256: "11bf3d30697df465cdf43664a9473a586f010c528376a966fd310a3a22082461" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.9-linux-x86_64.tar.gz" + sha256: "72b01478eeb312bf1a0136208957784fe55a7b587f8d9f9142a7fc9b0b9e9a28" + Macos: + universal: + url: "https://cmake.org/files/v3.27/cmake-3.27.9-macos10.10-universal.tar.gz" + sha256: "2ced09b99b265d18c5e215984e5898b7e3a0cc7a1293c3f3b45e4bec87a46814" + Windows: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.9-windows-arm64.zip" + sha256: "bca795134956264ede142f79aa513476985f4f410f6501a727d602760e9212dd" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.9-windows-x86_64.zip" + sha256: "c14e8b5d1c7be0baf0e7936ce8b5a39c5ee3450b14d7e3b32435083eddd9aff7" + "3.27.7": + Linux: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.7-linux-aarch64.tar.gz" + sha256: "f40ec1b7d41e94efd6c79cf0b7fc45ed6068543af0fea47b0c9fbf2b1b1b3fbc" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.7-linux-x86_64.tar.gz" + sha256: "a8c92ecb139bcc7a1f92a8108179bd1d021bdb158a5ee759cba6d60010b83ae9" + Macos: + universal: + url: "https://cmake.org/files/v3.27/cmake-3.27.7-macos10.10-universal.tar.gz" + sha256: "4a366d07fbe0be7e1efcf0dbd743d09a5dc6609da79035e4036b12296ec679cf" + Windows: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.7-windows-arm64.zip" + sha256: "d9b19fd6830510022156621042759af2374111dc4f431b58c8828a17a68633dc" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.7-windows-x86_64.zip" + sha256: "5588e50030cda3e6fa96724444d8539916ac808d78d608cda6ae6ff7c4c4c9c8" + "3.27.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.6-linux-aarch64.tar.gz" + sha256: "811e5040ad7f3fb4924a875373d2a1a174a01400233a81a638a989157438a5e3" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.6-linux-x86_64.tar.gz" + sha256: "26373a283daa8490d772dc8a179450cd6d391cb2a9db8d4242fe09e361efc42e" + Macos: + universal: + url: "https://cmake.org/files/v3.27/cmake-3.27.6-macos10.10-universal.tar.gz" + sha256: "3977258c8d30f03f6506fdb12dac9b8570db7d5e54f541285ee540de433a9cff" + Windows: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.6-windows-arm64.zip" + sha256: "980b7e532d77bfb4e5814c76403242c503019f1c0699440220cf2d527c8ff350" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.6-windows-x86_64.zip" + sha256: "f013a0cca091aa953f9a60a99292ec7a20ae3f9ceb05cb5c08ebe164097c526f" + "3.27.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.5-linux-aarch64.tar.gz" + sha256: "2ffaf176d0f93c332abaffbf3ce82fc8c90e49e0fcee8dc16338bcfbb150ead7" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.5-linux-x86_64.tar.gz" + sha256: "138c68addae825b16ed78d792dafef5e0960194833f48bd77e7e0429c6bc081c" + Macos: + universal: + url: "https://cmake.org/files/v3.27/cmake-3.27.5-macos10.10-universal.tar.gz" + sha256: "1f776640e6ad35b2b3fe2ab5e39cff363b2c3034ecb56e45597402b7bf010e47" + Windows: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.5-windows-arm64.zip" + sha256: "3fcc84d34e3213b0e4261295eaddfc645685ab366dc570421555e7f3d3080d3a" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.5-windows-x86_64.zip" + sha256: "1e8e06c8ecf63d5f213019e1cd39ea41a6cf952db5f2c8e69b8e47f5bc302684" + "3.27.4": + Linux: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.4-linux-aarch64.tar.gz" + sha256: "45538d394bd4ef2a423fa78dff5cad16bcf437a4a6dc655e999177170632b039" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.4-linux-x86_64.tar.gz" + sha256: "186c53121cf6ef4e48b51e88690e6ef84f268611064a42e5a2e829c3d6b2efde" + Macos: + universal: + url: "https://cmake.org/files/v3.27/cmake-3.27.4-macos10.10-universal.tar.gz" + sha256: "1fa092bad6daf9715c6d72ff766813fd3423427696042a74f2208a2b4704ac1c" + Windows: + armv8: + url: "https://cmake.org/files/v3.27/cmake-3.27.4-windows-arm64.zip" + sha256: "6c1df7ad85ed902ad615cd0c05bca0d3c9c3f67b3980ca9dd2e39b0821d50937" + x86_64: + url: "https://cmake.org/files/v3.27/cmake-3.27.4-windows-x86_64.zip" + sha256: "e5e060756444d0b2070328a8821c1ceb62bd6d267aae61bfff06f96c7ec943a6" + "3.26.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.26/cmake-3.26.6-linux-aarch64.tar.gz" + sha256: "7b91a212b9e8ca38c1482ae40ff2d3e33e9d1c7b337b39f74bd4f34fd070bb1d" + x86_64: + url: "https://cmake.org/files/v3.26/cmake-3.26.6-linux-x86_64.tar.gz" + sha256: "2dd48ccd3e3d872ee4cc916f3f4e24812612421007e895f82bf9fc7e49831d62" + Macos: + universal: + url: "https://cmake.org/files/v3.26/cmake-3.26.6-macos10.10-universal.tar.gz" + sha256: "7a4500989351e1319bb86802ead09a13d2394636efeb5da6d78212e12f2cb961" + Windows: + armv8: + url: "https://cmake.org/files/v3.26/cmake-3.26.6-windows-arm64.zip" + sha256: "16cf13c42d3f4d63ad1d61d0333b6101c0e88f893ac39f435ef472b46f50e9b2" + x86_64: + url: "https://cmake.org/files/v3.26/cmake-3.26.6-windows-x86_64.zip" + sha256: "07b1c4cae3182ca1782a4d9775b5e5d164b475eb010e1dd98ce0c206c38fa73d" + "3.26.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.26/cmake-3.26.5-linux-aarch64.tar.gz" + sha256: "737b990dcbc71f060b75193b2ddd5cf9d18c199e7a94c7169c80cf9314fe714a" + x86_64: + url: "https://cmake.org/files/v3.26/cmake-3.26.5-linux-x86_64.tar.gz" + sha256: "130941ae3ffe4a9ee3395514787115a273a8d1ce15cb971494bb45f7e58bb3c3" + Macos: + universal: + url: "https://cmake.org/files/v3.26/cmake-3.26.5-macos10.10-universal.tar.gz" + sha256: "30ff04703b5973414decde82860045afdf88e6da381aca6aeb2d625b05f53f2d" + Windows: + armv8: + url: "https://cmake.org/files/v3.26/cmake-3.26.5-windows-arm64.zip" + sha256: "1d5dd0e8a316290944e3c84bd6950df7ff650c5edde311af8903e88cb6cbc0ae" + x86_64: + url: "https://cmake.org/files/v3.26/cmake-3.26.5-windows-x86_64.zip" + sha256: "b95d6d8113593e001ae64df615358ea47185ad52a79d0c420332e052bd30c283" + "3.25.3": + Linux: + armv8: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-linux-aarch64.tar.gz" + sha256: "cd6e853639f858569e22e6298f009eb24b4702c51c0d5bc1cb36c688f7ce246d" + x86_64: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-linux-x86_64.tar.gz" + sha256: "d4d2ba83301b215857d3b6590cd4434a414fa151c5807693abe587bd6c03581e" + Macos: + universal: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-macos10.10-universal.tar.gz" + sha256: "ea37a83cd329224c38a1938d2cf7b2656ad971dea9cf759238652746213661f8" + Windows: + armv8: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-windows-arm64.zip" + sha256: "3498fea26257eebfbfc89ed17963f3d8d83c19362b90fb23517842de777a522a" + x86_64: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-windows-x86_64.zip" + sha256: "d129425d569140b729210f3383c246dec19c4183f7d0afae1837044942da3b4b" + "3.24.4": + Linux: + armv8: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-linux-aarch64.tar.gz" + sha256: "86f823f2636bf715af89da10e04daa476755a799d451baee66247846e95d7bee" + x86_64: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-linux-x86_64.tar.gz" + sha256: "cac77d28fb8668c179ac02c283b058aeb846fe2133a57d40b503711281ed9f19" + Macos: + universal: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-macos10.10-universal.tar.gz" + sha256: "3cda3995d6ea06a9d05dfaac633006754d6df5d80cd3d08bf4c284507a550496" + Windows: + armv8: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-windows-arm64.zip" + sha256: "55e81f0c95b06a4435b708cdee7d5739e38cc29c909d3d3134c1a3117e09b965" + x86_64: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-windows-x86_64.zip" + sha256: "c135c7ab78143c46e6686b1e9652bc1dd07e0cf71fd4decee777cdca77019c39" + "3.23.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.23/cmake-3.23.5-linux-aarch64.tar.gz" + sha256: "dcf25a81de6bd4e646389a0635b050ed04d0f27e4f07ae22d975391f38f3c4b8" + x86_64: + url: "https://cmake.org/files/v3.23/cmake-3.23.5-linux-x86_64.tar.gz" + sha256: "bbd7ad93d2a14ed3608021a9466ae63db76a24efd1fae7a5f7798c1de7ab9344" + Macos: + universal: + url: "https://cmake.org/files/v3.23/cmake-3.23.5-macos10.10-universal.tar.gz" + sha256: "d3b44c59e72ef9cc13f7a4642de56e69b1b33fc3a6bb003b59b7f2036ace7e03" + Windows: + x86_64: + url: "https://cmake.org/files/v3.23/cmake-3.23.5-windows-x86_64.zip" + sha256: "51c75f93ebfe295701df205e5e78808b1e707996b26b5c26c3f680ab7b543881" + "3.22.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.22/cmake-3.22.6-linux-aarch64.tar.gz" + sha256: "79be85d3e76565faacd60695cee11d030f7e7dd8691476144fa25eb93dbd0397" + x86_64: + url: "https://cmake.org/files/v3.22/cmake-3.22.6-linux-x86_64.tar.gz" + sha256: "09e1b34026c406c5bf4d1b053eadb3a8519cb360e37547ebf4b70ab766d94fbc" + Macos: + universal: + url: "https://cmake.org/files/v3.22/cmake-3.22.6-macos10.10-universal.tar.gz" + sha256: "873d296000b2fbd5cd306a3455fddc254b485cad988c67bf4ee0ba4fd7a1e057" + Windows: + x86_64: + url: "https://cmake.org/files/v3.22/cmake-3.22.6-windows-x86_64.zip" + sha256: "48bcc3e71e918b72e2682f9ca9d44dd6c416379071c1ecb530d0633374f91f15" + "3.21.7": + Linux: + armv8: + url: "https://cmake.org/files/v3.21/cmake-3.21.7-linux-aarch64.tar.gz" + sha256: "fa7e82170391c71dcc958ff57a63e9d6be9742a8b85a8b1386da9e571980474a" + x86_64: + url: "https://cmake.org/files/v3.21/cmake-3.21.7-linux-x86_64.tar.gz" + sha256: "f84e209d903a96e54f398bb8760693969b13fc50bce2f8278a9ee9dca01406b2" + Macos: + universal: + url: "https://cmake.org/files/v3.21/cmake-3.21.7-macos10.10-universal.tar.gz" + sha256: "d79775e35efca40ff1d213155c2d5e2e028d0ce376c5089c97f2fe3c6133af1d" + Windows: + x86_64: + url: "https://cmake.org/files/v3.21/cmake-3.21.7-windows-x86_64.zip" + sha256: "4c4840e2dc2bf82e8a16081ff506bba54f3a228b91ce36317129fed4035ef2e3" + "3.20.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.20/cmake-3.20.6-linux-aarch64.tar.gz" + sha256: "9ac2035174d3c62827c85fb052372d70cf35fb565e8d47b8241fbe451c29b2f2" + x86_64: + url: "https://cmake.org/files/v3.20/cmake-3.20.6-linux-x86_64.tar.gz" + sha256: "458777097903b0f35a0452266b923f0a2f5b62fe331e636e2dcc4b636b768e36" + Macos: + universal: + url: "https://cmake.org/files/v3.20/cmake-3.20.6-macos10.10-universal.tar.gz" + sha256: "e75e95c10089b54fe0a7dfb369a87214e8a0ffb46d0fcf6a9678b38140dba983" + Windows: + x86_64: + url: "https://cmake.org/files/v3.20/cmake-3.20.6-windows-x86_64.zip" + sha256: "f240a38c964712aac474644b3ba21bdc2b4e8d5e31179f67bd2e6f45fa349419" + "3.19.8": + Linux: + armv8: + url: "https://cmake.org/files/v3.19/cmake-3.19.8-Linux-aarch64.tar.gz" + sha256: "807f5afb2a560e00af9640e496d5673afefc2888bf0ed076412884a5ebb547a1" + x86_64: + url: "https://cmake.org/files/v3.19/cmake-3.19.8-Linux-x86_64.tar.gz" + sha256: "db0d7d225150dd6e08ce54995e671f9b4801b8e93e22df1eef52339f6bbbecd9" + Macos: + universal: + url: "https://cmake.org/files/v3.19/cmake-3.19.8-macos10.10-universal.tar.gz" + sha256: "ea82f1a7c77d4d2a09ae6c80cbb5e419560bfe371f40b605d13ff1a861d7d6e1" + Windows: + x86_64: + url: "https://cmake.org/files/v3.19/cmake-3.19.8-win64-x64.zip" + sha256: "2a30877a3d6b50da305b289f4d1c03befdfaeb2edba02a563c681e883d810380" diff --git a/cmake/binary/conanfile.py b/cmake/binary/conanfile.py new file mode 100644 index 0000000..13c7ebe --- /dev/null +++ b/cmake/binary/conanfile.py @@ -0,0 +1,66 @@ +import os + +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + + +required_conan_version = ">=1.51.0" + +class CMakeConan(ConanFile): + name = "cmake" + package_type = "application" + description = "CMake, the cross-platform, open-source build system." + topics = ("build", "installer") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Kitware/CMake" + license = "BSD-3-Clause" + settings = "os", "arch" + + def validate(self): + if self.settings.arch not in ["x86_64", "armv8"]: + raise ConanInvalidConfiguration("CMake binaries are only provided for x86_64 and armv8 architectures") + + if self.settings.os == "Windows" and self.settings.arch == "armv8" and Version(self.version) < "3.24": + raise ConanInvalidConfiguration("CMake only supports ARM64 binaries on Windows starting from 3.24") + + def build(self): + arch = str(self.settings.arch) if self.settings.os != "Macos" else "universal" + get(self, **self.conan_data["sources"][self.version][str(self.settings.os)][arch], + destination=self.source_folder, strip_root=True) + + def package_id(self): + if self.info.settings.os == "Macos": + del self.info.settings.arch + + def package(self): + copy(self, "*", src=self.build_folder, dst=self.package_folder) + + if self.settings.os == "Macos": + docs_folder = os.path.join(self.build_folder, "CMake.app", "Contents", "doc", "cmake") + else: + docs_folder = os.path.join(self.build_folder, "doc", "cmake") + + copy(self, "Copyright.txt", src=docs_folder, dst=os.path.join(self.package_folder, "licenses"), keep_path=False) + + if self.settings.os != "Macos": + # Remove unneeded folders (also cause long paths on Windows) + # Note: on macOS we don't want to modify the bundle contents + # to preserve signature validation + rmdir(self, os.path.join(self.package_folder, "doc")) + rmdir(self, os.path.join(self.package_folder, "man")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os == "Macos": + bindir = os.path.join(self.package_folder, "CMake.app", "Contents", "bin") + self.cpp_info.bindirs = [bindir] + else: + bindir = os.path.join(self.package_folder, "bin") + + # Needed for compatibility with v1.x - Remove when 2.0 becomes the default + self.output.info(f"Appending PATH environment variable: {bindir}") + self.env_info.PATH.append(bindir) diff --git a/cmake/binary/test_package/conanfile.py b/cmake/binary/test_package/conanfile.py new file mode 100644 index 0000000..1c9cda0 --- /dev/null +++ b/cmake/binary/test_package/conanfile.py @@ -0,0 +1,23 @@ +from six import StringIO +from conan import ConanFile +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + output = StringIO() + self.run("cmake --version", output) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + tokens = re.split('[@#]', self.tested_reference_str) + require_version = tokens[0].split("/", 1)[1] + self.output.info("Expected version: {}".format(require_version)) + assert_cmake_version = "cmake version %s" % require_version + assert(assert_cmake_version in output_str) diff --git a/cmake/binary/test_v1_package/conanfile.py b/cmake/binary/test_v1_package/conanfile.py new file mode 100644 index 0000000..df9415b --- /dev/null +++ b/cmake/binary/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +import os +from six import StringIO +from conan import ConanFile +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + output = StringIO() + self.run("cmake --version", output=output, run_environment=False) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + tokens = re.split('[@#]', self.tested_reference_str) + require_version = tokens[0].split("/", 1)[1] + self.output.info("Expected version: {}".format(require_version)) + assert_cmake_version = "cmake version %s" % require_version + assert(assert_cmake_version in output_str) diff --git a/cmake/config.yml b/cmake/config.yml new file mode 100644 index 0000000..1f33473 --- /dev/null +++ b/cmake/config.yml @@ -0,0 +1,53 @@ +versions: + "3.30.1": + folder: "binary" + "3.30.0": + folder: "binary" + "3.29.7": + folder: "binary" + "3.29.6": + folder: "binary" + "3.29.5": + folder: "binary" + "3.29.4": + folder: "binary" + "3.29.3": + folder: "binary" + "3.29.2": + folder: "binary" + "3.29.0": + folder: "binary" + "3.28.6": + folder: "binary" + "3.28.5": + folder: "binary" + "3.28.1": + folder: "binary" + "3.27.9": + folder: "binary" + "3.27.7": + folder: "binary" + "3.27.6": + folder: "binary" + "3.27.5": + folder: "binary" + "3.27.4": + folder: "binary" + "3.26.6": + folder: "binary" + "3.26.5": + folder: "binary" + "3.25.3": + folder: "binary" + "3.24.4": + folder: "binary" + "3.23.5": + folder: "binary" + "3.22.6": + folder: "binary" + "3.21.7": + folder: "binary" + "3.20.6": + folder: "binary" + "3.19.8": + folder: "binary" diff --git a/crc32c/all/conandata.yml b/crc32c/all/conandata.yml new file mode 100644 index 0000000..58186e6 --- /dev/null +++ b/crc32c/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1.2": + url: "https://github.com/google/crc32c/archive/1.1.2.tar.gz" + sha256: "ac07840513072b7fcebda6e821068aa04889018f24e10e46181068fb214d7e56" + "1.1.1": + url: https://github.com/google/crc32c/archive/refs/tags/1.1.1.tar.gz + sha256: "a6533f45b1670b5d59b38a514d82b09c6fb70cc1050467220216335e873074e8" diff --git a/crc32c/all/conanfile.py b/crc32c/all/conanfile.py new file mode 100644 index 0000000..826861f --- /dev/null +++ b/crc32c/all/conanfile.py @@ -0,0 +1,85 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class crc32cConan(ConanFile): + name = "crc32c" + description = "CRC32C implementation with support for CPU-specific acceleration instructions" + topics = ("crc32c", "crc") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/crc32c" + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return "11" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.variables["CRC32C_BUILD_TESTS"] = False + tc.variables["CRC32C_BUILD_BENCHMARKS"] = False + tc.variables["CRC32C_INSTALL"] = True + tc.variables["CRC32C_USE_GLOG"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Crc32c") + self.cpp_info.set_property("cmake_target_name", "Crc32c::crc32c") + + # TODO: back to global scope once cmake_find_package* generators removed + self.cpp_info.components["_crc32c"].libs = ["crc32c"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Crc32c" + self.cpp_info.names["cmake_find_package_multi"] = "Crc32c" + self.cpp_info.components["_crc32c"].names["cmake_find_package"] = "crc32c" + self.cpp_info.components["_crc32c"].names["cmake_find_package_multi"] = "crc32c" + self.cpp_info.components["_crc32c"].set_property("cmake_target_name", "Crc32c::crc32c") diff --git a/crc32c/all/test_package/CMakeLists.txt b/crc32c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..4bb96eb --- /dev/null +++ b/crc32c/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Crc32c CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Crc32c::crc32c) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/crc32c/all/test_package/conanfile.py b/crc32c/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/crc32c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/crc32c/all/test_package/test_package.cpp b/crc32c/all/test_package/test_package.cpp new file mode 100644 index 0000000..53499dc --- /dev/null +++ b/crc32c/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include "crc32c/crc32c.h" + + +int main() { + const std::uint8_t buffer[] = {0, 0, 0, 0}; + std::uint32_t result; + + // Process a raw buffer. + result = crc32c::Crc32c(buffer, 4); + std::cout << result << '\n'; + + // Process a std::string. + std::string string; + string.resize(4); + result = crc32c::Crc32c(string); + std::cout << result << '\n'; + + return 0; +} diff --git a/crc32c/all/test_v1_package/CMakeLists.txt b/crc32c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/crc32c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/crc32c/all/test_v1_package/conanfile.py b/crc32c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..968e0fc --- /dev/null +++ b/crc32c/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join(".", "bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/crc32c/config.yml b/crc32c/config.yml new file mode 100644 index 0000000..be8fcc0 --- /dev/null +++ b/crc32c/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.2": + folder: "all" + "1.1.1": + folder: "all" diff --git a/cyrus-sasl/all/conandata.yml b/cyrus-sasl/all/conandata.yml new file mode 100644 index 0000000..d24e337 --- /dev/null +++ b/cyrus-sasl/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.1.28": + url: "https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-2.1.28/cyrus-sasl-2.1.28.tar.gz" + sha256: "7ccfc6abd01ed67c1a0924b353e526f1b766b21f42d4562ee635a8ebfc5bb38c" + "2.1.27": + url: "https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-2.1.27/cyrus-sasl-2.1.27.tar.gz" + sha256: "26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5" diff --git a/cyrus-sasl/all/conanfile.py b/cyrus-sasl/all/conanfile.py new file mode 100644 index 0000000..78ec1f2 --- /dev/null +++ b/cyrus-sasl/all/conanfile.py @@ -0,0 +1,258 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rm, rmdir, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path, is_msvc, MSBuildDeps, MSBuildToolchain, MSBuild +import os + +required_conan_version = ">=1.54.0" + + +class CyrusSaslConan(ConanFile): + name = "cyrus-sasl" + license = "BSD-4-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.cyrusimap.org/sasl/" + description = ( + "This is the Cyrus SASL API implementation. " + "It can be used on the client or server side " + "to provide authentication and authorization services." + ) + topics = ("sasl", "authentication", "authorization") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openssl": [True, False], + "with_cram": [True, False], + "with_digest": [True, False], + "with_scram": [True, False], + "with_otp": [True, False], + "with_krb4": [True, False], + "with_gssapi": [True, False], + "with_plain": [True, False], + "with_anon": [True, False], + "with_postgresql": [True, False], + "with_mysql": [True, False], + "with_sqlite3": [True, False], + "with_saslauthd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openssl": True, + "with_cram": True, + "with_digest": True, + "with_scram": True, + "with_otp": True, + "with_krb4": True, + "with_gssapi": False, # FIXME: should be True + "with_plain": True, + "with_anon": True, + "with_postgresql": False, + "with_mysql": False, + "with_sqlite3": False, + "with_saslauthd": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + # saslauthd doesn't compile on Windows + # https://www.cyrusimap.org/sasl/sasl/windows.html#install-windows + del self.options.with_saslauthd + if is_msvc(self): + # always required + del self.options.with_openssl + # not used + del self.options.with_postgresql + del self.options.with_mysql + del self.options.with_sqlite3 + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if is_msvc(self) or self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.get_safe("with_postgresql"): + self.requires("libpq/15.4") + if self.options.get_safe("with_mysql"): + self.requires("libmysqlclient/8.1.0") + if self.options.get_safe("with_sqlite3"): + self.requires("sqlite3/3.44.2") + + def validate(self): + if is_msvc(self) and not self.options.shared: + raise ConanInvalidConfiguration("Static library output is not supported when building with MSVC") + if self.options.with_gssapi: + raise ConanInvalidConfiguration( + f"{self.name}:with_gssapi=True requires krb5 recipe, not yet available in conan-center", + ) + + def build_requirements(self): + if not is_msvc(self): + self.tool_requires("gnu-config/cci.20210814") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _generate_autotools(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + rootpath_no = lambda v, req: unix_path(self, self.dependencies[req].package_folder) if v else "no" + tc.configure_args.extend([ + "--disable-sample", + "--disable-macos-framework", + "--with-dblib=none", + "--with-openssl={}".format(yes_no(self.options.with_openssl)), + "--enable-digest={}".format(yes_no(self.options.with_digest)), + "--enable-scram={}".format(yes_no(self.options.with_scram)), + "--enable-otp={}".format(yes_no(self.options.with_otp)), + "--enable-krb4={}".format(yes_no(self.options.with_krb4)), + "--enable-gssapi={}".format(yes_no(self.options.with_gssapi)), + "--enable-plain={}".format(yes_no(self.options.with_plain)), + "--enable-anon={}".format(yes_no(self.options.with_anon)), + "--enable-sql={}".format( + yes_no(self.options.with_postgresql or self.options.with_mysql or self.options.with_sqlite3), + ), + "--with-pgsql={}".format(rootpath_no(self.options.with_postgresql, "libpq")), + "--with-mysql={}".format(rootpath_no(self.options.with_mysql, "libmysqlclient")), + "--without-sqlite", + "--with-sqlite3={}".format(rootpath_no(self.options.with_sqlite3, "sqlite3")), + "--with-saslauthd={}".format(yes_no(self.options.with_saslauthd)), + ]) + if self.options.with_gssapi: + tc.configure_args.append("--with-gss_impl=mit") + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + def _patch_sources_autotools(self): + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), + src=os.path.dirname(gnu_config), + dst=os.path.join(self.source_folder, "config")) + + def _build_autotools(self): + self._patch_sources_autotools() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + @property + def _msbuild_configuration(self): + return "Debug" if self.settings.build_type == "Debug" else "Release" + + def _generate_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._msbuild_configuration + # disable OpenSSL 3 warnings, which get raised as errors + tc.cxxflags.append("/wo4996") + tc.generate() + + deps = MSBuildDeps(self) + deps.configuration = self._msbuild_configuration + deps.generate() + + def _patch_sources_msvc(self): + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + platform_toolset = MSBuildToolchain(self).toolset + import_conan_generators = "" + for props_file in ["conantoolchain.props", "conandeps.props"]: + props_path = os.path.join(self.generators_folder, props_file) + if os.path.exists(props_path): + import_conan_generators += f"" + for vcxproj_file in self.source_path.joinpath("win32").glob("*.vcxproj"): + replace_in_file(self, vcxproj_file, + "v140", + f"{platform_toolset}") + replace_in_file(self, vcxproj_file, "8.1", "") + if props_path: + replace_in_file(self, vcxproj_file, + '', + f'{import_conan_generators}') + replace_in_file(self, os.path.join(self.source_folder, "win32", "openssl.props"), + "libeay32.lib;", "") + # https://github.com/cyrusimap/cyrus-sasl/issues/730 + copy(self, "md5global.h", + src=os.path.join(self.source_folder, "win32", "include"), + dst=os.path.join(self.source_folder, "include")) + + def _build_msvc(self): + self._patch_sources_msvc() + msbuild = MSBuild(self) + msbuild.build_type = self._msbuild_configuration + msbuild.build(sln=os.path.join(self.source_folder, "win32", "cyrus-sasl-common.sln")) + msbuild.build(sln=os.path.join(self.source_folder, "win32", "cyrus-sasl-core.sln")) + # TODO: add sasldb support + # msbuild.build(sln=os.path.join(self.source_folder, "win32", "cyrus-sasl-sasldb.sln")) + if self.options.with_gssapi: + msbuild.build(sln=os.path.join(self.source_folder, "win32", "cyrus-sasl-gssapiv2.sln")) + + def generate(self): + if is_msvc(self): + self._generate_msvc() + else: + self._generate_autotools() + + def build(self): + if is_msvc(self): + self._build_msvc() + else: + self._build_autotools() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, "*/sasl2.lib", os.path.join(self.source_folder, "win32"), os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*/sasl2.dll", os.path.join(self.source_folder, "win32"), os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "*.h", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include", "sasl")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libsasl2") + self.cpp_info.libs = ["sasl2"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["resolv"] + if self.options.with_saslauthd: + self.cpp_info.system_libs.append("crypt") + elif is_msvc(self): + self.cpp_info.system_libs = ["ws2_32"] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/cyrus-sasl/all/test_package/CMakeLists.txt b/cyrus-sasl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..b50bb40 --- /dev/null +++ b/cyrus-sasl/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(cyrus-sasl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE cyrus-sasl::cyrus-sasl) diff --git a/cyrus-sasl/all/test_package/conanfile.py b/cyrus-sasl/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/cyrus-sasl/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/cyrus-sasl/all/test_package/test_package.c b/cyrus-sasl/all/test_package/test_package.c new file mode 100644 index 0000000..8851f18 --- /dev/null +++ b/cyrus-sasl/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include + +#include + +int main(int argc, char *argv[]) +{ + const char *implementation, *version; + sasl_version_info(&implementation, &version, NULL, NULL, NULL, NULL); + printf("--------------------------->Tests are done.<--------------------------\n"); + printf("SASL Using implementation: %s, version: %s\n", implementation, version); + printf("//////////////////////////////////////////////////////////////////////\n"); + return 0; +} diff --git a/cyrus-sasl/all/test_v1_package/CMakeLists.txt b/cyrus-sasl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/cyrus-sasl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/cyrus-sasl/all/test_v1_package/conanfile.py b/cyrus-sasl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..e0a8588 --- /dev/null +++ b/cyrus-sasl/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/cyrus-sasl/config.yml b/cyrus-sasl/config.yml new file mode 100644 index 0000000..85cdd65 --- /dev/null +++ b/cyrus-sasl/config.yml @@ -0,0 +1,5 @@ +versions: + "2.1.28": + folder: "all" + "2.1.27": + folder: "all" diff --git a/double-conversion/all/conandata.yml b/double-conversion/all/conandata.yml new file mode 100644 index 0000000..be979eb --- /dev/null +++ b/double-conversion/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "3.3.0": + url: "https://github.com/google/double-conversion/archive/refs/tags/v3.3.0.tar.gz" + sha256: "04ec44461850abbf33824da84978043b22554896b552c5fd11a9c5ae4b4d296e" + "3.2.1": + url: "https://github.com/google/double-conversion/archive/v3.2.1.tar.gz" + sha256: "e40d236343cad807e83d192265f139481c51fc83a1c49e406ac6ce0a0ba7cd35" + "3.2.0": + url: "https://github.com/google/double-conversion/archive/v3.2.0.tar.gz" + sha256: "3dbcdf186ad092a8b71228a5962009b5c96abde9a315257a3452eb988414ea3b" + "3.1.7": + url: "https://github.com/google/double-conversion/archive/v3.1.7.tar.gz" + sha256: "a0204d6ab48223f2c8f53a932014e7f245125e7a5267764b1fbeebe4fa0ee8b9" + "3.1.6": + url: https://github.com/google/double-conversion/archive/v3.1.6.tar.gz + sha256: 8a79e87d02ce1333c9d6c5e47f452596442a343d8c3e9b234e8a62fce1b1d49c + "3.1.5": + url: "https://github.com/google/double-conversion/archive/v3.1.5.tar.gz" + sha256: "a63ecb93182134ba4293fd5f22d6e08ca417caafa244afaa751cbfddf6415b13" + "3.1.4": + url: "https://github.com/google/double-conversion/archive/v3.1.4.tar.gz" + sha256: "95004b65e43fefc6100f337a25da27bb99b9ef8d4071a36a33b5e83eb1f82021" diff --git a/double-conversion/all/conanfile.py b/double-conversion/all/conanfile.py new file mode 100644 index 0000000..9abd55f --- /dev/null +++ b/double-conversion/all/conanfile.py @@ -0,0 +1,66 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, rm +from conan.tools.microsoft import check_min_vs +import os + +required_conan_version = ">=1.54.0" + + +class DoubleConversionConan(ConanFile): + name = "double-conversion" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/double-conversion" + description = "Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles." + license = "BSD-3-Clause" + topics = ("google", "decimal-binary", "conversion") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + check_min_vs(self, "190") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "double-conversion") + self.cpp_info.set_property("cmake_target_name", "double-conversion::double-conversion") + self.cpp_info.libs = ["double-conversion"] diff --git a/double-conversion/all/test_package/CMakeLists.txt b/double-conversion/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..cdc70c7 --- /dev/null +++ b/double-conversion/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(double-conversion REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE double-conversion::double-conversion) diff --git a/double-conversion/all/test_package/conanfile.py b/double-conversion/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/double-conversion/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/double-conversion/all/test_package/test_package.cpp b/double-conversion/all/test_package/test_package.cpp new file mode 100644 index 0000000..c026f07 --- /dev/null +++ b/double-conversion/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include "double-conversion/diy-fp.h" +#include "double-conversion/utils.h" +#include "double-conversion/ieee.h" + +#ifndef UINT64_2PART_C +#define UINT64_2PART_C(a, b) DOUBLE_CONVERSION_UINT64_2PART_C(a, b) +#endif + +int main() { + uint64_t ordered = UINT64_2PART_C(0x01234567, 89ABCDEF); + std::cout << "A value: " << double_conversion::Double(ordered).value() << std::endl; + return 0; +} diff --git a/double-conversion/all/test_v1_package/CMakeLists.txt b/double-conversion/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/double-conversion/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/double-conversion/all/test_v1_package/conanfile.py b/double-conversion/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/double-conversion/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/double-conversion/config.yml b/double-conversion/config.yml new file mode 100644 index 0000000..0b99892 --- /dev/null +++ b/double-conversion/config.yml @@ -0,0 +1,15 @@ +versions: + "3.3.0": + folder: all + "3.2.1": + folder: all + "3.2.0": + folder: all + "3.1.7": + folder: all + "3.1.6": + folder: all + "3.1.5": + folder: all + "3.1.4": + folder: all diff --git a/flex/all/conandata.yml b/flex/all/conandata.yml new file mode 100644 index 0000000..590bff3 --- /dev/null +++ b/flex/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.6.4": + sha256: "e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995" + url: "https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz" +patches: + "2.6.4": + - patch_file: patches/darwin-newer-versions.patch + patch_description: "missing linker flags skipped due to a problem in configure." + patch_source: "https://github.com/westes/flex/issues/509" + patch_type: "portability" diff --git a/flex/all/conanfile.py b/flex/all/conanfile.py new file mode 100644 index 0000000..1a19a7b --- /dev/null +++ b/flex/all/conanfile.py @@ -0,0 +1,99 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.files import get, rmdir, copy, rm, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import AutotoolsToolchain, Autotools + +required_conan_version = ">=1.53.0" + + +class FlexConan(ConanFile): + name = "flex" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/westes/flex" + description = "Flex, the fast lexical analyzer generator" + topics = ("lex", "lexer", "lexical analyzer generator") + license = "BSD-2-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def export_sources(self): + export_conandata_patches(self) + + def requirements(self): + # Flex requires M4 to be compiled. If consumer does not have M4 + # installed, Conan will need to know that Flex requires it. + self.requires("m4/1.4.19") + + def build_requirements(self): + self.tool_requires("m4/1.4.19") + if hasattr(self, "settings_build") and cross_building(self): + self.tool_requires(f"{self.name}/{self.version}") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Flex package is not compatible with Windows. " + "Consider using winflexbison instead.") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def generate(self): + at = AutotoolsToolchain(self) + at.configure_args.extend([ + "--disable-nls", + "--disable-bootstrap", + "HELP2MAN=/bin/true", + "M4=m4", + # https://github.com/westes/flex/issues/247 + "ac_cv_func_malloc_0_nonnull=yes", "ac_cv_func_realloc_0_nonnull=yes", + # https://github.com/easybuilders/easybuild-easyconfigs/pull/5792 + "ac_cv_func_reallocarray=no", + ]) + at.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["fl"] + self.cpp_info.system_libs = ["m"] + # Avoid CMakeDeps messing with Conan targets + self.cpp_info.set_property("cmake_find_mode", "none") + + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + lex_path = os.path.join(bindir, "flex").replace("\\", "/") + self.output.info("Setting LEX environment variable: {}".format(lex_path)) + self.env_info.LEX = lex_path diff --git a/flex/all/patches/darwin-newer-versions.patch b/flex/all/patches/darwin-newer-versions.patch new file mode 100644 index 0000000..d0a7b83 --- /dev/null +++ b/flex/all/patches/darwin-newer-versions.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index d88c47c..827c01a 100755 +--- a/configure ++++ b/configure +@@ -6842,7 +6842,7 @@ $as_echo "$lt_cv_ld_force_load" >&6; } + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; +- 10.*) ++ *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; diff --git a/flex/all/test_package/CMakeLists.txt b/flex/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..1c6f9d4 --- /dev/null +++ b/flex/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(FLEX REQUIRED) +flex_target(flex_scanner basic_nr.l ${PROJECT_BINARY_DIR}/basic_nr.cpp) + +add_executable(${PROJECT_NAME} basic_nr.cpp) +target_include_directories(${PROJECT_NAME} PRIVATE ${FLEX_INCLUDE_DIRS}) +target_link_libraries(${PROJECT_NAME} PRIVATE ${FLEX_LIBRARIES}) diff --git a/flex/all/test_package/basic_nr.l b/flex/all/test_package/basic_nr.l new file mode 100644 index 0000000..71fa5d6 --- /dev/null +++ b/flex/all/test_package/basic_nr.l @@ -0,0 +1,89 @@ +/* + * This file is part of flex. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +%option C++ noyywrap + +%{ +int mylineno = 0; +%} + +string \"[^\n"]+\" + +ws [ \t]+ + +alpha [A-Za-z] +dig [0-9] +name ({alpha}|{dig}|\$)({alpha}|{dig}|\_|\.|\-|\/|\$)* +num1 [-+]?{dig}+\.?([eE][-+]?{dig}+)? +num2 [-+]?{dig}*\.{dig}+([eE][-+]?{dig}+)? +number {num1}|{num2} + +%% + +{ws} /* skip blanks and tabs */ + +"/*" { + int c; + + while((c = yyinput()) != 0) + { + if(c == '\n') + ++mylineno; + + else if(c == '*') + { + if((c = yyinput()) == '/') + break; + else + unput(c); + } + } + } + +{number} std::cout << "number " << YYText() << '\n'; + +\n mylineno++; + +{name} std::cout << "name " << YYText() << '\n'; + +{string} std::cout << "string " << YYText() << '\n'; + +%% + +extern "C" { + int yylex() {return 0;} +} + +#include + +int main( int argc, const char *argv[]) { + if (argc < 2) { + fprintf(stderr, "Need an argument\n"); + return 1; + } + std::ifstream ifs(argv[1]); + FlexLexer *lexer = new yyFlexLexer(ifs, std::cout); + while(lexer->yylex() != 0) + ; + return 0; +} diff --git a/flex/all/test_package/basic_nr.txt b/flex/all/test_package/basic_nr.txt new file mode 100644 index 0000000..3dca798 --- /dev/null +++ b/flex/all/test_package/basic_nr.txt @@ -0,0 +1,6 @@ +/* this is a multi line comment +still in the comment +and done */ +foo = "bar" +num = 43 +setting = false diff --git a/flex/all/test_package/conanfile.py b/flex/all/test_package/conanfile.py new file mode 100644 index 0000000..4270466 --- /dev/null +++ b/flex/all/test_package/conanfile.py @@ -0,0 +1,50 @@ +import os +import re +from io import StringIO + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "VirtualBuildEnv", "VirtualRunEnv", "CMakeDeps" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def _assert_expected_version(self): + + def tested_reference_version(): + tokens = re.split('[@#]', self.tested_reference_str) + return tokens[0].split("/", 1)[1] + + output = StringIO() + self.run("flex --version", output) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + expected_version = tested_reference_version() + self.output.info("Expected version: {}".format(expected_version)) + assert_flex_version = "flex {}".format(expected_version) + assert(assert_flex_version in output_str) + + def build(self): + # Let's check flex version installed + self._assert_expected_version() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + txt_file = os.path.join(self.source_folder, "basic_nr.txt") + self.run(f"{bin_path} {txt_file}", env="conanrun") diff --git a/flex/all/test_v1_package/CMakeLists.txt b/flex/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..b93b03c --- /dev/null +++ b/flex/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(FLEX REQUIRED) +flex_target(flex_scanner basic_nr.l ${PROJECT_BINARY_DIR}/basic_nr.cpp) + +add_executable(${PROJECT_NAME} basic_nr.cpp) +target_include_directories(${PROJECT_NAME} PRIVATE ${FLEX_INCLUDE_DIRS}) +target_link_libraries(${PROJECT_NAME} PRIVATE ${FLEX_LIBRARIES}) diff --git a/flex/all/test_v1_package/basic_nr.l b/flex/all/test_v1_package/basic_nr.l new file mode 100644 index 0000000..71fa5d6 --- /dev/null +++ b/flex/all/test_v1_package/basic_nr.l @@ -0,0 +1,89 @@ +/* + * This file is part of flex. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +%option C++ noyywrap + +%{ +int mylineno = 0; +%} + +string \"[^\n"]+\" + +ws [ \t]+ + +alpha [A-Za-z] +dig [0-9] +name ({alpha}|{dig}|\$)({alpha}|{dig}|\_|\.|\-|\/|\$)* +num1 [-+]?{dig}+\.?([eE][-+]?{dig}+)? +num2 [-+]?{dig}*\.{dig}+([eE][-+]?{dig}+)? +number {num1}|{num2} + +%% + +{ws} /* skip blanks and tabs */ + +"/*" { + int c; + + while((c = yyinput()) != 0) + { + if(c == '\n') + ++mylineno; + + else if(c == '*') + { + if((c = yyinput()) == '/') + break; + else + unput(c); + } + } + } + +{number} std::cout << "number " << YYText() << '\n'; + +\n mylineno++; + +{name} std::cout << "name " << YYText() << '\n'; + +{string} std::cout << "string " << YYText() << '\n'; + +%% + +extern "C" { + int yylex() {return 0;} +} + +#include + +int main( int argc, const char *argv[]) { + if (argc < 2) { + fprintf(stderr, "Need an argument\n"); + return 1; + } + std::ifstream ifs(argv[1]); + FlexLexer *lexer = new yyFlexLexer(ifs, std::cout); + while(lexer->yylex() != 0) + ; + return 0; +} diff --git a/flex/all/test_v1_package/basic_nr.txt b/flex/all/test_v1_package/basic_nr.txt new file mode 100644 index 0000000..3dca798 --- /dev/null +++ b/flex/all/test_v1_package/basic_nr.txt @@ -0,0 +1,6 @@ +/* this is a multi line comment +still in the comment +and done */ +foo = "bar" +num = 43 +setting = false diff --git a/flex/all/test_v1_package/conanfile.py b/flex/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..4d0b7ff --- /dev/null +++ b/flex/all/test_v1_package/conanfile.py @@ -0,0 +1,47 @@ +import os +import re +from io import StringIO + +from conans import ConanFile, tools, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def _assert_expected_version(self): + + def tested_reference_version(): + tokens = re.split('[@#]', self.tested_reference_str) + return tokens[0].split("/", 1)[1] + + output = StringIO() + self.run(f"flex --version", output, run_environment=False) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + expected_version = tested_reference_version() + self.output.info("Expected version: {}".format(expected_version)) + assert_flex_version = "flex {}".format(expected_version) + assert(assert_flex_version in output_str) + + def build(self): + # Let's check flex version installed + self._assert_expected_version() + # FIXME: CMake legacy is not working as expected when cross-compiling + if not tools.cross_building(self, skip_x64_x86=True): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + bin_path = os.path.join("bin", "test_package") + txt_file = os.path.join(self.source_folder, "basic_nr.txt") + self.run(f"{bin_path} {txt_file}", run_environment=True) diff --git a/flex/config.yml b/flex/config.yml new file mode 100644 index 0000000..1d8c5a5 --- /dev/null +++ b/flex/config.yml @@ -0,0 +1,3 @@ +versions: + "2.6.4": + folder: all diff --git a/fmt/all/conandata.yml b/fmt/all/conandata.yml new file mode 100644 index 0000000..5ec660a --- /dev/null +++ b/fmt/all/conandata.yml @@ -0,0 +1,49 @@ +sources: + "11.0.2": + url: "https://github.com/fmtlib/fmt/releases/download/11.0.2/fmt-11.0.2.zip" + sha256: "40fc58bebcf38c759e11a7bd8fdc163507d2423ef5058bba7f26280c5b9c5465" + "11.0.1": + url: "https://github.com/fmtlib/fmt/releases/download/11.0.1/fmt-11.0.1.zip" + sha256: "62ca45531814109b5d6cef0cf2fd17db92c32a30dd23012976e768c685534814" + "11.0.0": + url: "https://github.com/fmtlib/fmt/releases/download/11.0.0/fmt-11.0.0.zip" + sha256: "583ce480ef07fad76ef86e1e2a639fc231c3daa86c4aa6bcba524ce908f30699" + "10.2.1": + url: "https://github.com/fmtlib/fmt/releases/download/10.2.1/fmt-10.2.1.zip" + sha256: "312151a2d13c8327f5c9c586ac6cf7cddc1658e8f53edae0ec56509c8fa516c9" + "10.2.0": + url: "https://github.com/fmtlib/fmt/releases/download/10.2.0/fmt-10.2.0.zip" + sha256: "8a942861a94f8461a280f823041cde8f620a6d8b0e0aacc98c15bb5a9dd92399" + "10.1.1": + url: "https://github.com/fmtlib/fmt/releases/download/10.1.1/fmt-10.1.1.zip" + sha256: "b84e58a310c9b50196cda48d5678d5fa0849bca19e5fdba6b684f0ee93ed9d1b" + "10.1.0": + url: "https://github.com/fmtlib/fmt/releases/download/10.1.0/fmt-10.1.0.zip" + sha256: "d725fa83a8b57a3cedf238828fa6b167f963041e8f9f7327649bddc68ae316f4" + "10.0.0": + url: "https://github.com/fmtlib/fmt/releases/download/10.0.0/fmt-10.0.0.zip" + sha256: "4943cb165f3f587f26da834d3056ee8733c397e024145ca7d2a8a96bb71ac281" + "9.1.0": + url: "https://github.com/fmtlib/fmt/releases/download/9.1.0/fmt-9.1.0.zip" + sha256: "cceb4cb9366e18a5742128cb3524ce5f50e88b476f1e54737a47ffdf4df4c996" + "9.0.0": + url: "https://github.com/fmtlib/fmt/releases/download/9.0.0/fmt-9.0.0.zip" + sha256: "fc96dd2d2fdf2bded630787adba892c23cb9e35c6fd3273c136b0c57d4651ad6" + "8.1.1": + url: "https://github.com/fmtlib/fmt/releases/download/8.1.1/fmt-8.1.1.zip" + sha256: "23778bad8edba12d76e4075da06db591f3b0e3c6c04928ced4a7282ca3400e5d" + "8.0.1": + url: "https://github.com/fmtlib/fmt/releases/download/8.0.1/fmt-8.0.1.zip" + sha256: "a627a56eab9554fc1e5dd9a623d0768583b3a383ff70a4312ba68f94c9d415bf" + "7.1.3": + url: "https://github.com/fmtlib/fmt/releases/download/7.1.3/fmt-7.1.3.zip" + sha256: "5d98c504d0205f912e22449ecdea776b78ce0bb096927334f80781e720084c9f" + "6.2.1": + url: "https://github.com/fmtlib/fmt/releases/download/6.2.1/fmt-6.2.1.zip" + sha256: "94fea742ddcccab6607b517f6e608b1e5d63d712ddbc5982e44bafec5279881a" + "5.3.0": + url: "https://github.com/fmtlib/fmt/releases/download/5.3.0/fmt-5.3.0.zip" + sha256: "4c0741e10183f75d7d6f730b8708a99b329b2f942dad5a9da3385ab92bb4a15c" +patches: + "5.3.0": + - patch_file: "patches/fix-install-5.3.0.patch" diff --git a/fmt/all/conanfile.py b/fmt/all/conanfile.py new file mode 100644 index 0000000..86da321 --- /dev/null +++ b/fmt/all/conanfile.py @@ -0,0 +1,155 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" + + +class FmtConan(ConanFile): + name = "fmt" + description = "A safe and fast alternative to printf and IOStreams." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/fmtlib/fmt" + topics = ("format", "iostream", "printf") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "header_only": [True, False], + "shared": [True, False], + "fPIC": [True, False], + "with_fmt_alias": [True, False], + "with_os_api": [True, False], + "with_unicode": [True, False], + } + default_options = { + "header_only": False, + "shared": False, + "fPIC": True, + "with_fmt_alias": False, + "with_os_api": True, + "with_unicode": True, + } + + @property + def _has_with_os_api_option(self): + return Version(self.version) >= "7.0.0" + + @property + def _has_with_unicode_option(self): + return Version(self.version) >= "11.0.0" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self._has_with_os_api_option: + del self.options.with_os_api + elif str(self.settings.os) == "baremetal": + self.options.with_os_api = False + if not self._has_with_unicode_option: + del self.options.with_unicode + + def configure(self): + if self.options.header_only: + self.options.rm_safe("fPIC") + self.options.rm_safe("shared") + self.options.rm_safe("with_os_api") + elif self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + else: + del self.info.options.with_fmt_alias + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not self.options.header_only: + tc = CMakeToolchain(self) + tc.cache_variables["FMT_DOC"] = False + tc.cache_variables["FMT_TEST"] = False + tc.cache_variables["FMT_INSTALL"] = True + tc.cache_variables["FMT_LIB_DIR"] = "lib" + if self._has_with_os_api_option: + tc.cache_variables["FMT_OS"] = bool(self.options.with_os_api) + if self._has_with_unicode_option: + tc.cache_variables["FMT_UNICODE"] = bool(self.options.with_unicode) + tc.generate() + + def build(self): + apply_conandata_patches(self) + if not self.options.header_only: + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + if Version(self.version) < "10.2.0": + copy(self, pattern="*LICENSE.rst", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + else: + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.options.header_only: + copy(self, pattern="*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "res")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + target = "fmt-header-only" if self.options.header_only else "fmt" + self.cpp_info.set_property("cmake_file_name", "fmt") + self.cpp_info.set_property("cmake_target_name", f"fmt::{target}") + self.cpp_info.set_property("pkg_config_name", "fmt") + + if self.options.get_safe("with_unicode") and is_msvc(self): + self.cpp_info.components["_fmt"].cxxflags.append("/utf-8") + + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + if self.options.with_fmt_alias: + self.cpp_info.components["_fmt"].defines.append("FMT_STRING_ALIAS=1") + + if self.options.header_only: + self.cpp_info.components["_fmt"].defines.append("FMT_HEADER_ONLY=1") + self.cpp_info.components["_fmt"].libdirs = [] + self.cpp_info.components["_fmt"].bindirs = [] + else: + postfix = "d" if self.settings.build_type == "Debug" else "" + libname = "fmt" + postfix + self.cpp_info.components["_fmt"].libs = [libname] + if self.settings.os == "Linux": + self.cpp_info.components["_fmt"].system_libs.extend(["m"]) + if self.options.shared: + self.cpp_info.components["_fmt"].defines.append("FMT_SHARED") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "fmt" + self.cpp_info.names["cmake_find_package_multi"] = "fmt" + self.cpp_info.names["pkg_config"] = "fmt" + self.cpp_info.components["_fmt"].names["cmake_find_package"] = target + self.cpp_info.components["_fmt"].names["cmake_find_package_multi"] = target + self.cpp_info.components["_fmt"].set_property("cmake_target_name", f"fmt::{target}") diff --git a/fmt/all/patches/fix-install-5.3.0.patch b/fmt/all/patches/fix-install-5.3.0.patch new file mode 100644 index 0000000..b478cc0 --- /dev/null +++ b/fmt/all/patches/fix-install-5.3.0.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -235,7 +235,9 @@ if (FMT_INSTALL) + + # Install the library and headers. + install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name} +- DESTINATION ${FMT_LIB_DIR}) ++ LIBRARY DESTINATION ${FMT_LIB_DIR} ++ ARCHIVE DESTINATION ${FMT_LIB_DIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + install(FILES $ DESTINATION ${FMT_LIB_DIR} OPTIONAL) + install(FILES ${FMT_HEADERS} DESTINATION ${FMT_INC_DIR}) diff --git a/fmt/all/test_package/CMakeLists.txt b/fmt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..98b2373 --- /dev/null +++ b/fmt/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(fmt REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_compile_features(test_package PRIVATE cxx_std_14) +if(FMT_HEADER_ONLY) + target_link_libraries(test_package PRIVATE fmt::fmt-header-only) +else() + target_link_libraries(test_package PRIVATE fmt::fmt) +endif() + +add_executable(test_ranges test_ranges.cpp) +target_compile_features(test_ranges PRIVATE cxx_std_14) +if(FMT_HEADER_ONLY) + target_link_libraries(test_ranges PRIVATE fmt::fmt-header-only) +else() + target_link_libraries(test_ranges PRIVATE fmt::fmt) +endif() diff --git a/fmt/all/test_package/conanfile.py b/fmt/all/test_package/conanfile.py new file mode 100644 index 0000000..943effe --- /dev/null +++ b/fmt/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FMT_HEADER_ONLY"] = self.dependencies[self.tested_reference_str].options.header_only + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") + self.run(os.path.join(self.cpp.build.bindirs[0], "test_ranges"), env="conanrun") diff --git a/fmt/all/test_package/test_package.cpp b/fmt/all/test_package/test_package.cpp new file mode 100644 index 0000000..c8074af --- /dev/null +++ b/fmt/all/test_package/test_package.cpp @@ -0,0 +1,60 @@ +#include +#include +#include +#include +#include +#include + + +#include +#include +#include +#include + + +void vreport(const char *format, fmt::format_args args) { + fmt::vprint(format, args); +} + +template +void report(const char *format, const Args & ... args) { + vreport(format, fmt::make_format_args(args...)); +} + +class Date { + int year_, month_, day_; + public: + Date(int year, int month, int day) : year_(year), month_(month), day_(day) {} + + friend std::ostream &operator<<(std::ostream &os, const Date &d) { + return os << d.year_ << '-' << d.month_ << '-' << d.day_; + } +}; + +#if FMT_VERSION >= 90000 +namespace fmt { + template <> struct formatter : ostream_formatter {}; +} +#endif + +int main() { + const std::string thing("World"); + fmt::print("PRINT: Hello {}!\n", thing); + + const std::string formatted = fmt::format("{0}{1}{0}", "abra", "cad"); + fmt::print("{}\n", formatted); + + fmt::memory_buffer buf; + fmt::format_to(std::back_inserter(buf), "{}", 2.7182818); + fmt::print("Euler number: {}\n", fmt::to_string(buf)); + + fmt::print("The date is {}\n", Date(2012, 12, 9)); + + report("{} {} {}\n", "Conan", 42, 3.14159); + + fmt::print(std::cout, "{} {}\n", "Magic number", 42); + + fmt::print(fg(fmt::color::aqua), "Bincrafters\n"); + + return EXIT_SUCCESS; +} diff --git a/fmt/all/test_package/test_ranges.cpp b/fmt/all/test_package/test_ranges.cpp new file mode 100644 index 0000000..b808d69 --- /dev/null +++ b/fmt/all/test_package/test_ranges.cpp @@ -0,0 +1,11 @@ +#include +#include +#include "fmt/ranges.h" + +int main() { + std::vector numbers; + fmt::format_to(std::back_inserter(numbers), "{}{}{}", 1, 2, 3); + const std::string str_numbers = fmt::format("{}", numbers); + fmt::print("numbers: {}\n", str_numbers); + return EXIT_SUCCESS; +} diff --git a/openblas/all/test_v1_package/CMakeLists.txt b/fmt/all/test_v1_package/CMakeLists.txt similarity index 80% rename from openblas/all/test_v1_package/CMakeLists.txt rename to fmt/all/test_v1_package/CMakeLists.txt index 366ab20..91630d7 100644 --- a/openblas/all/test_v1_package/CMakeLists.txt +++ b/fmt/all/test_v1_package/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.15) project(test_package) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ diff --git a/fmt/all/test_v1_package/conanfile.py b/fmt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..f99cfc8 --- /dev/null +++ b/fmt/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["FMT_HEADER_ONLY"] = self.options["fmt"].header_only + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) + self.run(os.path.join("bin", "test_ranges"), run_environment=True) diff --git a/fmt/config.yml b/fmt/config.yml new file mode 100644 index 0000000..22c1067 --- /dev/null +++ b/fmt/config.yml @@ -0,0 +1,31 @@ +versions: + "11.0.2": + folder: all + "11.0.1": + folder: all + "11.0.0": + folder: all + "10.2.1": + folder: all + "10.2.0": + folder: all + "10.1.1": + folder: all + "10.1.0": + folder: all + "10.0.0": + folder: all + "9.1.0": + folder: all + "9.0.0": + folder: all + "8.1.1": + folder: all + "8.0.1": + folder: all + "7.1.3": + folder: all + "6.2.1": + folder: all + "5.3.0": + folder: all diff --git a/folly/all/CMakeLists.txt b/folly/all/CMakeLists.txt index 3f6a2fc..61f3d3b 100644 --- a/folly/all/CMakeLists.txt +++ b/folly/all/CMakeLists.txt @@ -1,4 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(cmake_wrapper) +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + add_subdirectory("source_subfolder") diff --git a/folly/all/conandata.yml b/folly/all/conandata.yml index 4cea346..8fcc894 100644 --- a/folly/all/conandata.yml +++ b/folly/all/conandata.yml @@ -1,4 +1,56 @@ sources: - '2023.02.24': - url: 'https://github.com/milvus-io/folly/archive/refs/tags/v2023.02.24.tar.gz' - sha256: '301c240639749ea62a1746363d624f8a46ffe5070bab950f1091ac77147b048b' + "2019.10.21.00": + url: "https://github.com/facebook/folly/archive/v2019.10.21.00.tar.gz" + sha256: "6efcc2b2090691a9fe3d339c433d102d6399bbdc6dc4893080d59f15f648f393" + "2020.08.10.00": + url: "https://github.com/facebook/folly/archive/v2020.08.10.00.tar.gz" + sha256: "e81140d04a4e89e3f848e528466a9b3d3ae37d7eeb9e65467fca50d70918eef6" + "2022.01.31.00": + url: "https://github.com/facebook/folly/archive/v2022.01.31.00.tar.gz" + sha256: "d764b9a7832d967bb7cfea4bcda15d650315aa4d559fde1da2a52b015cd88b9c" +patches: + "2019.10.21.00": + - patch_file: "patches/0001-find-packages.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-compiler-flags.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-boost-shared-ptr.patch" + base_path: "source_subfolder" + - patch_file: "patches/0004-disable-posix-names.patch" + base_path: "source_subfolder" + - patch_file: "patches/0005-include-atomic.patch" + base_path: "source_subfolder" + - patch_file: "patches/0006-duplicate-hash.patch" + base_path: "source_subfolder" + - patch_file: "patches/0007-allow-builtins.patch" + base_path: "source_subfolder" + - patch_file: "patches/0013-include-bit.patch" + base_path: "source_subfolder" + - patch_file: "patches/0020-include-ssizet.patch" + base_path: "source_subfolder" + "2020.08.10.00": + - patch_file: "patches/0008-find-packages.patch" + base_path: "source_subfolder" + - patch_file: "patches/0009-ill-formed-atomic-copy.patch" + base_path: "source_subfolder" + - patch_file: "patches/0010-duplicate-hash.patch" + base_path: "source_subfolder" + - patch_file: "patches/0011-disable-logger-example.patch" + base_path: "source_subfolder" + - patch_file: "patches/0012-compiler-flags.patch" + base_path: "source_subfolder" + - patch_file: "patches/0014-find-librt.patch" + base_path: "source_subfolder" + - patch_file: "patches/0015-benchmark-format-macros.patch" + base_path: "source_subfolder" + "2022.01.31.00": + - patch_file: "patches/0016-find-packages.patch" + base_path: "source_subfolder" + - patch_file: "patches/0017-compiler-flags.patch" + base_path: "source_subfolder" + - patch_file: "patches/0018-find-glog.patch" + base_path: "source_subfolder" + - patch_file: "patches/0019-exclude-example.patch" + base_path: "source_subfolder" + - patch_file: "patches/0022-fix-windows-minmax.patch" + base_path: "source_subfolder" diff --git a/folly/all/conanfile.py b/folly/all/conanfile.py index a2f2750..06dc696 100755 --- a/folly/all/conanfile.py +++ b/folly/all/conanfile.py @@ -1,11 +1,11 @@ from conan.tools.microsoft import is_msvc, msvc_runtime_flag -from conan.tools.build import can_run, check_min_cppstd +from conan.tools.build import can_run from conan.tools.scm import Version from conan.tools import files from conan import ConanFile -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conans import CMake, tools from conan.errors import ConanInvalidConfiguration -from conans import tools +import functools import os required_conan_version = ">=1.45.0" @@ -23,9 +23,15 @@ class FollyConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "use_sse4_2": [True, False], + "use_sse4_2" : [True, False], } - default_options = {"shared": False, "fPIC": True, "use_sse4_2": True} + default_options = { + "shared": False, + "fPIC": True, + "use_sse4_2" : False + } + + generators = "cmake", "cmake_find_package" @property def _source_subfolder(self): @@ -37,68 +43,57 @@ def _minimum_cpp_standard(self): @property def _minimum_compilers_version(self): - return ( - { - "Visual Studio": "15", - "gcc": "5", - "clang": "6", - "apple-clang": "8", - } - if self._minimum_cpp_standard == 14 - else { - "gcc": "7", - "Visual Studio": "16", - "clang": "6", - "apple-clang": "10", - } - ) + return { + "Visual Studio": "15", + "gcc": "5", + "clang": "6", + "apple-clang": "8", + } if self._minimum_cpp_standard == 14 else { + "gcc": "7", + "Visual Studio": "16", + "clang": "6", + "apple-clang": "10", + } def export_sources(self): self.copy("CMakeLists.txt") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + def config_options(self): if self.settings.os == "Windows": - try: - del self.options.fPIC - except Exception: - pass - if str(self.settings.arch) not in ["x86", "x86_64"]: + del self.options.fPIC + + if str(self.settings.arch) not in ['x86', 'x86_64']: del self.options.use_sse4_2 def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + del self.options.fPIC def requirements(self): - self.requires("boost/1.80.0") + self.requires("boost/1.78.0") self.requires("bzip2/1.0.8") - self.requires("double-conversion/3.2.1") + self.requires("double-conversion/3.2.0") self.requires("gflags/2.2.2") - self.requires("glog/0.6.0") + self.requires("glog/0.4.0") self.requires("libevent/2.1.12") self.requires("openssl/1.1.1q") - self.requires("lz4/1.9.4") + self.requires("lz4/1.9.3") self.requires("snappy/1.1.9") - self.requires("zlib/1.2.13") + self.requires("zlib/1.2.12") self.requires("zstd/1.5.2") if not is_msvc(self): self.requires("libdwarf/20191104") - self.requires("libsodium/cci.20220430") + self.requires("libsodium/1.0.18") self.requires("xz_utils/5.2.5") # FIXME: Causing compilation issues on clang: self.requires("jemalloc/5.2.1") if self.settings.os == "Linux": self.requires("libiberty/9.1.0") - self.requires("libunwind/1.6.2") - if ( - Version(self.version) >= "2020.08.10.00" - and Version(self.version) < "2022.01.31.00" - ): + self.requires("libunwind/1.5.0") + if Version(self.version) >= "2020.08.10.00": self.requires("fmt/7.1.3") - if Version(self.version) >= "2022.01.31.00": - self.requires("fmt/8.0.1") # Folly bumpup fmt to 8.0.1 in v2022.01.31.00 @property def _required_boost_components(self): @@ -106,166 +101,99 @@ def _required_boost_components(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._minimum_cpp_standard) + tools.check_min_cppstd(self, self._minimum_cpp_standard) min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) if not min_version: - self.output.warn( - "{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler - ) - ) + self.output.warn("{} recipe lacks information about the {} compiler support.".format(self.name, self.settings.compiler)) else: if Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration( - "{} requires C++{} support. The current compiler {} {} does not support it.".format( - self.name, - self._minimum_cpp_standard, - self.settings.compiler, - self.settings.compiler.version, - ) - ) + raise ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format( + self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) if Version(self.version) < "2022.01.31.00" and self.settings.os != "Linux": - raise ConanInvalidConfiguration( - "Conan support for non-Linux platforms starts with Folly version 2022.01.31.00" - ) + raise ConanInvalidConfiguration("Conan support for non-Linux platforms starts with Folly version 2022.01.31.00") - # if self.settings.os == "Macos" and self.settings.arch != "x86_64": - # raise ConanInvalidConfiguration("Conan currently requires a 64bit target architecture for Folly on Macos") + if self.settings.os == "Macos" and self.settings.arch != "x86_64": + raise ConanInvalidConfiguration("Conan currently requires a 64bit target architecture for Folly on Macos") if self.settings.os == "Windows" and self.settings.arch != "x86_64": - raise ConanInvalidConfiguration( - "Folly requires a 64bit target architecture on Windows" - ) + raise ConanInvalidConfiguration("Folly requires a 64bit target architecture on Windows") if self.settings.os in ["Macos", "Windows"] and self.options.shared: - raise ConanInvalidConfiguration( - "Folly could not be built on {} as shared library".format( - self.settings.os - ) - ) - - if ( - Version(self.version) >= "2020.08.10.00" - and self.settings.compiler == "clang" - and self.options.shared - ): - raise ConanInvalidConfiguration( - "Folly could not be built by clang as a shared library" - ) + raise ConanInvalidConfiguration("Folly could not be built on {} as shared library".format(self.settings.os)) + + if Version(self.version) == "2020.08.10.00" and self.settings.compiler == "clang" and self.options.shared: + raise ConanInvalidConfiguration("Folly could not be built by clang as a shared library") if self.options["boost"].header_only: - raise ConanInvalidConfiguration( - "Folly could not be built with a header only Boost" - ) - - miss_boost_required_comp = any( - getattr(self.options["boost"], "without_{}".format(boost_comp), True) - for boost_comp in self._required_boost_components - ) + raise ConanInvalidConfiguration("Folly could not be built with a header only Boost") + + miss_boost_required_comp = any(getattr(self.options["boost"], "without_{}".format(boost_comp), True) for boost_comp in self._required_boost_components) if miss_boost_required_comp: - raise ConanInvalidConfiguration( - "Folly requires these boost components: {}".format( - ", ".join(self._required_boost_components) - ) - ) + raise ConanInvalidConfiguration("Folly requires these boost components: {}".format(", ".join(self._required_boost_components))) min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) if not min_version: - self.output.warn( - "{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler - ) - ) + self.output.warn("{} recipe lacks information about the {} compiler support.".format(self.name, self.settings.compiler)) else: if Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration( - "{} requires C++{} support. The current compiler {} {} does not support it.".format( - self.name, - self._minimum_cpp_standard, - self.settings.compiler, - self.settings.compiler.version, - ) - ) - - if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in [ - "x86", - "x86_64", - ]: - raise ConanInvalidConfiguration( - f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs." - ) + raise ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format( + self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) + + if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']: + raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.") + + # FIXME: Freeze max. CMake version at 3.16.2 to fix the Linux build + def build_requirements(self): + self.build_requires("cmake/3.16.9") def source(self): - files.get( - self, - **self.conan_data["sources"][self.version], - destination=self._source_subfolder, - strip_root=True, - ) - - def layout(self): - cmake_layout(self) - - def generate(self): - tc = CMakeToolchain(self) + files.get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) if can_run(self): - tc.variables["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE"] = "0" - tc.variables["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE__TRYRUN_OUTPUT"] = "" - tc.variables["FOLLY_HAVE_LINUX_VDSO_EXITCODE"] = "0" - tc.variables["FOLLY_HAVE_LINUX_VDSO_EXITCODE__TRYRUN_OUTPUT"] = "" - tc.variables["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE"] = "0" - tc.variables["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE__TRYRUN_OUTPUT"] = "" - tc.variables["HAVE_VSNPRINTF_ERRORS_EXITCODE"] = "0" - tc.variables["HAVE_VSNPRINTF_ERRORS_EXITCODE__TRYRUN_OUTPUT"] = "" - - if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in [ - "x86", - "x86_64", - ]: - tc.preprocessor_definitions["FOLLY_SSE"] = "4" - tc.preprocessor_definitions["FOLLY_SSE_MINOR"] = "2" + cmake.definitions["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE"] = "0" + cmake.definitions["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE__TRYRUN_OUTPUT"] = "" + cmake.definitions["FOLLY_HAVE_LINUX_VDSO_EXITCODE"] = "0" + cmake.definitions["FOLLY_HAVE_LINUX_VDSO_EXITCODE__TRYRUN_OUTPUT"] = "" + cmake.definitions["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE"] = "0" + cmake.definitions["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE__TRYRUN_OUTPUT"] = "" + cmake.definitions["HAVE_VSNPRINTF_ERRORS_EXITCODE"] = "0" + cmake.definitions["HAVE_VSNPRINTF_ERRORS_EXITCODE__TRYRUN_OUTPUT"] = "" + + if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ['x86', 'x86_64']: + # in folly, if simd >=sse4.2, we also needs -mfma flag to avoid compiling error. if not is_msvc(self): - tc.variables["CMAKE_C_FLAGS"] = "-mfma" - tc.variables["CMAKE_CXX_FLAGS"] = "-mfma" + cmake.definitions["CMAKE_C_FLAGS"] = "-mfma" + cmake.definitions["CMAKE_CXX_FLAGS"] = "-mfma" else: - tc.variables["CMAKE_C_FLAGS"] = "/arch:FMA" - tc.variables["CMAKE_CXX_FLAGS"] = "/arch:FMA" + cmake.definitions["CMAKE_C_FLAGS"] = "/arch:FMA" + cmake.definitions["CMAKE_CXX_FLAGS"] = "/arch:FMA" - tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe( - "fPIC", True - ) - # Relocatable shared lib on Macos - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) cxx_std_flag = tools.cppstd_flag(self.settings) - cxx_std_value = ( - cxx_std_flag.split("=")[1] - if cxx_std_flag - else "c++{}".format(self._minimum_cpp_standard) - ) - tc.variables["CXX_STD"] = cxx_std_value - if is_msvc(self): - tc.variables["MSVC_LANGUAGE_VERSION"] = cxx_std_value - tc.variables["MSVC_ENABLE_ALL_WARNINGS"] = False - tc.variables["MSVC_USE_STATIC_RUNTIME"] = "MT" in msvc_runtime_flag(self) - - tc.generate() - - deps = CMakeDeps(self) - deps.generate() + cxx_std_value = cxx_std_flag.split('=')[1] if cxx_std_flag else "c++{}".format(self._minimum_cpp_standard) + cmake.definitions["CXX_STD"] = cxx_std_value + if is_msvc: + cmake.definitions["MSVC_LANGUAGE_VERSION"] = cxx_std_value + cmake.definitions["MSVC_ENABLE_ALL_WARNINGS"] = False + cmake.definitions["MSVC_USE_STATIC_RUNTIME"] = "MT" in msvc_runtime_flag(self) + cmake.configure() + return cmake + def build(self): - files.apply_conandata_patches(self) - cmake = CMake(self) - cmake.configure() + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() cmake.build() def package(self): self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = CMake(self) + cmake = self._configure_cmake() cmake.install() files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) @@ -275,11 +203,12 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "Folly::folly") self.cpp_info.set_property("pkg_config_name", "libfolly") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed if Version(self.version) == "2019.10.21.00": self.cpp_info.components["libfolly"].libs = [ "follybenchmark", "folly_test_util", - "folly", + "folly" ] elif Version(self.version) >= "2020.08.10.00": if self.settings.os == "Linux": @@ -289,22 +218,17 @@ def package_info(self): "folly_exception_tracer_base", "folly_test_util", "follybenchmark", - "folly", + "folly" ] else: self.cpp_info.components["libfolly"].libs = [ "folly_test_util", "follybenchmark", - "folly", + "folly" ] self.cpp_info.components["libfolly"].requires = [ - "boost::context", - "boost::filesystem", - "boost::program_options", - "boost::regex", - "boost::system", - "boost::thread", + "boost::boost", "bzip2::bzip2", "double-conversion::double-conversion", "gflags::gflags", @@ -316,53 +240,34 @@ def package_info(self): "zlib::zlib", "zstd::zstd", "libsodium::libsodium", - "xz_utils::xz_utils", + "xz_utils::xz_utils" ] if not is_msvc(self): self.cpp_info.components["libfolly"].requires.append("libdwarf::libdwarf") if self.settings.os == "Linux": - self.cpp_info.components["libfolly"].requires.extend( - ["libiberty::libiberty", "libunwind::libunwind"] - ) - self.cpp_info.components["libfolly"].system_libs.extend( - ["pthread", "dl", "rt"] - ) + self.cpp_info.components["libfolly"].requires.extend(["libiberty::libiberty", "libunwind::libunwind"]) + self.cpp_info.components["libfolly"].system_libs.extend(["pthread", "dl", "rt"]) if Version(self.version) >= "2020.08.10.00": self.cpp_info.components["libfolly"].requires.append("fmt::fmt") if self.settings.os == "Linux": - self.cpp_info.components["libfolly"].defines.extend( - ["FOLLY_HAVE_ELF", "FOLLY_HAVE_DWARF"] - ) + self.cpp_info.components["libfolly"].defines.extend(["FOLLY_HAVE_ELF", "FOLLY_HAVE_DWARF"]) elif self.settings.os == "Windows": - self.cpp_info.components["libfolly"].system_libs.extend( - ["ws2_32", "iphlpapi", "crypt32"] - ) - - if ( - self.settings.os == "Linux" - and self.settings.compiler == "clang" - and self.settings.compiler.libcxx == "libstdc++" - ) or ( - self.settings.os == "Macos" - and self.settings.compiler == "apple-clang" - and Version(self.settings.compiler.version.value) == "9.0" - and self.settings.compiler.libcxx == "libc++" - ): + self.cpp_info.components["libfolly"].system_libs.extend(["ws2_32", "iphlpapi", "crypt32"]) + + if (self.settings.os == "Linux" and self.settings.compiler == "clang" and + self.settings.compiler.libcxx == "libstdc++") or \ + (self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and + Version(self.settings.compiler.version.value) == "9.0" and self.settings.compiler.libcxx == "libc++"): self.cpp_info.components["libfolly"].system_libs.append("atomic") - if ( - self.settings.os == "Macos" - and self.settings.compiler == "apple-clang" - and Version(self.settings.compiler.version.value) >= "11.0" - ) or ( - self.settings.os == "Macos" - and self.settings.compiler == "clang" - and Version(self.settings.compiler.version.value) >= "11.0" - ): + if self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": self.cpp_info.components["libfolly"].system_libs.append("c++abi") + if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ['x86', 'x86_64']: + self.cpp_info.components["libfolly"].defines = ["FOLLY_SSE=4", "FOLLY_SSE_MINOR=2"] + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed self.cpp_info.filenames["cmake_find_package"] = "folly" self.cpp_info.filenames["cmake_find_package_multi"] = "folly" @@ -371,131 +276,32 @@ def package_info(self): self.cpp_info.names["pkg_config"] = "libfolly" self.cpp_info.components["libfolly"].names["cmake_find_package"] = "folly" self.cpp_info.components["libfolly"].names["cmake_find_package_multi"] = "folly" - - self.cpp_info.components["libfolly"].set_property( - "cmake_target_name", "Folly::folly" - ) + self.cpp_info.components["libfolly"].set_property("cmake_target_name", "Folly::folly") self.cpp_info.components["libfolly"].set_property("pkg_config_name", "libfolly") if Version(self.version) >= "2019.10.21.00": - # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed - self.cpp_info.components["follybenchmark"].names[ - "cmake_find_package" - ] = "follybenchmark" - self.cpp_info.components["follybenchmark"].names[ - "cmake_find_package_multi" - ] = "follybenchmark" - self.cpp_info.components["folly_test_util"].names[ - "cmake_find_package" - ] = "folly_test_util" - self.cpp_info.components["folly_test_util"].names[ - "cmake_find_package_multi" - ] = "folly_test_util" - - self.cpp_info.components["follybenchmark"].set_property( - "cmake_target_name", "Folly::follybenchmark" - ) - self.cpp_info.components["follybenchmark"].set_property( - "pkg_config_name", "libfollybenchmark" - ) + self.cpp_info.components["follybenchmark"].set_property("cmake_target_name", "Folly::follybenchmark") + self.cpp_info.components["follybenchmark"].set_property("pkg_config_name", "libfollybenchmark") self.cpp_info.components["follybenchmark"].libs = ["follybenchmark"] self.cpp_info.components["follybenchmark"].requires = ["libfolly"] - self.cpp_info.components["folly_test_util"].set_property( - "cmake_target_name", "Folly::folly_test_util" - ) - self.cpp_info.components["folly_test_util"].set_property( - "pkg_config_name", "libfolly_test_util" - ) + self.cpp_info.components["folly_test_util"].set_property("cmake_target_name", "Folly::folly_test_util") + self.cpp_info.components["folly_test_util"].set_property("pkg_config_name", "libfolly_test_util") self.cpp_info.components["folly_test_util"].libs = ["folly_test_util"] self.cpp_info.components["folly_test_util"].requires = ["libfolly"] if Version(self.version) >= "2020.08.10.00" and self.settings.os == "Linux": - # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed - self.cpp_info.components["folly_exception_tracer_base"].names[ - "cmake_find_package" - ] = "folly_exception_tracer_base" - self.cpp_info.components["folly_exception_tracer_base"].names[ - "cmake_find_package_multi" - ] = "folly_exception_tracer_base" - self.cpp_info.components["folly_exception_tracer"].names[ - "cmake_find_package" - ] = "folly_exception_tracer" - self.cpp_info.components["folly_exception_tracer"].names[ - "cmake_find_package_multi" - ] = "folly_exception_tracer" - self.cpp_info.components["folly_exception_counter"].names[ - "cmake_find_package" - ] = "folly_exception_counter" - self.cpp_info.components["folly_exception_counter"].names[ - "cmake_find_package_multi" - ] = "folly_exception_counter" - - self.cpp_info.components["folly_exception_tracer_base"].set_property( - "cmake_target_name", "Folly::folly_exception_tracer_base" - ) - self.cpp_info.components["folly_exception_tracer_base"].set_property( - "pkg_config_name", "libfolly_exception_tracer_base" - ) - self.cpp_info.components["folly_exception_tracer_base"].libs = [ - "folly_exception_tracer_base" - ] - self.cpp_info.components["folly_exception_tracer_base"].requires = [ - "libfolly" - ] - - self.cpp_info.components["folly_exception_tracer"].set_property( - "cmake_target_name", "Folly::folly_exception_tracer" - ) - self.cpp_info.components["folly_exception_tracer"].set_property( - "pkg_config_name", "libfolly_exception_tracer" - ) - self.cpp_info.components["folly_exception_tracer"].libs = [ - "folly_exception_tracer" - ] - self.cpp_info.components["folly_exception_tracer"].requires = [ - "folly_exception_tracer_base" - ] - - self.cpp_info.components["folly_exception_counter"].set_property( - "cmake_target_name", "Folly::folly_exception_counter" - ) - self.cpp_info.components["folly_exception_counter"].set_property( - "pkg_config_name", "libfolly_exception_counter" - ) - self.cpp_info.components["folly_exception_counter"].libs = [ - "folly_exception_counter" - ] - self.cpp_info.components["folly_exception_counter"].requires = [ - "folly_exception_tracer" - ] - - # Folly release every two weeks and it is hard to maintain cmake scripts. - # This script is used to fix CMake/folly-deps.cmake. - # I attach it here for convenience. All the 00xx-find-packages.patches are generated by this script - # ```shell - # sed -i 's/^find_package(Boost.*$/find_package(Boost /' CMake/folly-deps.cmake - # sed -i 's/DoubleConversion MODULE/double-conversion /ig' CMake/folly-deps.cmake - # sed -i 's/DOUBLE_CONVERSION/double-conversion/ig' CMake/folly-deps.cmake - # sed -i 's/^find_package(Gflags.*$/find_package(gflags REQUIRED)/g' CMake/folly-deps.cmake - # sed -i 's/LIBGFLAGS_FOUND/gflags_FOUND/g' CMake/folly-deps.cmake - # sed -i 's/[^_]LIBGFLAGS_LIBRARY/{gflags_LIBRARIES/' CMake/folly-deps.cmake - # sed -i 's/[^_]LIBGFLAGS_INCLUDE/{gflags_INCLUDE/' CMake/folly-deps.cmake - # sed -i 's/find_package(Glog MODULE)/find_package(glog REQUIRED)/g' CMake/folly-deps.cmake - # sed -i 's/GLOG_/glog_/g' CMake/folly-deps.cmake - # sed -i 's/find_package(LibEvent MODULE/find_package(Libevent /' CMake/folly-deps.cmake - # sed -i 's/LIBEVENT_/Libevent_/ig' CMake/folly-deps.cmake - # sed -i 's/OPENSSL_LIB/OpenSSL_LIB/g' CMake/folly-deps.cmake - # sed -i 's/OPENSSL_INCLUDE/OpenSSL_INCLUDE/g' CMake/folly-deps.cmake - # sed -i 's/BZIP2_/BZip2_/g' CMake/folly-deps.cmake - # sed -i 's/(LZ4/(lz4/g' CMake/folly-deps.cmake - # sed -i 's/LZ4_/lz4_/g' CMake/folly-deps.cmake - # sed -i 's/Zstd /zstd /g' CMake/folly-deps.cmake - # sed -i 's/ZSTD_/zstd_/g' CMake/folly-deps.cmake - # sed -i 's/(LibDwarf/(libdwarf/g' CMake/folly-deps.cmake - # sed -i 's/LIBDWARF_/libdwarf_/g' CMake/folly-deps.cmake - # sed -i 's/Libiberty/libiberty/g' CMake/folly-deps.cmake - # sed -i 's/Libsodium/libsodium/ig' CMake/folly-deps.cmake - # sed -i 's/LibUnwind/libunwind/g' CMake/folly-deps.cmake - # sed -i 's/LibUnwind_/libunwind_/ig' CMake/folly-deps.cmake - # ``` + self.cpp_info.components["folly_exception_tracer_base"].set_property("cmake_target_name", "Folly::folly_exception_tracer_base") + self.cpp_info.components["folly_exception_tracer_base"].set_property("pkg_config_name", "libfolly_exception_tracer_base") + self.cpp_info.components["folly_exception_tracer_base"].libs = ["folly_exception_tracer_base"] + self.cpp_info.components["folly_exception_tracer_base"].requires = ["libfolly"] + + self.cpp_info.components["folly_exception_tracer"].set_property("cmake_target_name", "Folly::folly_exception_tracer") + self.cpp_info.components["folly_exception_tracer"].set_property("pkg_config_name", "libfolly_exception_tracer") + self.cpp_info.components["folly_exception_tracer"].libs = ["folly_exception_tracer"] + self.cpp_info.components["folly_exception_tracer"].requires = ["folly_exception_tracer_base"] + + self.cpp_info.components["folly_exception_counter"].set_property("cmake_target_name", "Folly::folly_exception_counter") + self.cpp_info.components["folly_exception_counter"].set_property("pkg_config_name", "libfolly_exception_counter") + self.cpp_info.components["folly_exception_counter"].libs = ["folly_exception_counter"] + self.cpp_info.components["folly_exception_counter"].requires = ["folly_exception_tracer"] diff --git a/folly/all/patches/0001-find-packages.patch b/folly/all/patches/0001-find-packages.patch new file mode 100644 index 0000000..4cee77c --- /dev/null +++ b/folly/all/patches/0001-find-packages.patch @@ -0,0 +1,93 @@ +diff --git a/CMake/FindLibsodium.cmake b/CMake/FindLibsodium.cmake +index 18d4d0c..2b3cd2a 100644 +--- a/CMake/FindLibsodium.cmake ++++ b/CMake/FindLibsodium.cmake +@@ -15,7 +15,7 @@ + find_path(LIBSODIUM_INCLUDE_DIR NAMES sodium.h) + mark_as_advanced(LIBSODIUM_INCLUDE_DIR) + +-find_library(LIBSODIUM_LIBRARY NAMES sodium) ++find_library(LIBSODIUM_LIBRARY NAMES sodium libsodium PATHS ${CONAN_LIBSODIUM_ROOT}) + mark_as_advanced(LIBSODIUM_LIBRARY) + + include(FindPackageHandleStandardArgs) +diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake +index 048e1cd..da3ab8e 100644 +--- a/CMake/folly-deps.cmake ++++ b/CMake/folly-deps.cmake +@@ -36,19 +36,19 @@ find_package(DoubleConversion MODULE REQUIRED) + list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) + +-find_package(Gflags MODULE) +-set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) +-list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBGFLAGS_LIBRARY}) +-list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR}) +- +-find_package(Glog MODULE) ++find_package(gflags MODULE REQUIRED) ++set(FOLLY_HAVE_LIBGFLAGS ${GFLAGS_FOUND}) ++list(APPEND FOLLY_LINK_LIBRARIES ${CONAN_LIBS_GFLAGS}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${CONAN_INCLUDE_DIRS_GFLAGS}) ++list(APPEND CMAKE_REQUIRED_LIBRARIES ${gflags_LIBRARY}) ++list(APPEND CMAKE_REQUIRED_INCLUDES ${gflags_INCLUDE_DIR}) ++ ++find_package(glog MODULE) + set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND}) + list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR}) + +-find_package(LibEvent MODULE REQUIRED) ++find_package(Libevent MODULE REQUIRED) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) + +diff --git a/build/fbcode_builder/CMake/FindGflags.cmake b/build/fbcode_builder/CMake/FindGflags.cmake +index 246ceac..385605e 100644 +--- a/build/fbcode_builder/CMake/FindGflags.cmake ++++ b/build/fbcode_builder/CMake/FindGflags.cmake +@@ -48,8 +48,13 @@ if (gflags_FOUND) + else() + FIND_PATH(LIBGFLAGS_INCLUDE_DIR gflags/gflags.h) + +- FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflagsd gflags_staticd) +- FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags gflags_static) ++ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") ++ FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflagsd gflags_nothreads_staticd gflags_nothreads_static_debug PATHS ${CONAN_GFLAGS_ROOT}) ++ FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags gflags_nothreads_static PATHS ${CONAN_GFLAGS_ROOT}) ++ else() ++ FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflags gflags_nothreads_debug PATHS ${CONAN_GFLAGS_ROOT}) ++ FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags_nothreads gflags PATHS ${CONAN_GFLAGS_ROOT}) ++ endif() + + INCLUDE(SelectLibraryConfigurations) + SELECT_LIBRARY_CONFIGURATIONS(LIBGFLAGS) +diff --git a/build/fbcode_builder/CMake/FindGlog.cmake b/build/fbcode_builder/CMake/FindGlog.cmake +index a589b2e..15aef75 100644 +--- a/build/fbcode_builder/CMake/FindGlog.cmake ++++ b/build/fbcode_builder/CMake/FindGlog.cmake +@@ -8,8 +8,7 @@ + + include(FindPackageHandleStandardArgs) + +-find_library(GLOG_LIBRARY glog +- PATHS ${GLOG_LIBRARYDIR}) ++find_library(GLOG_LIBRARY glog glogd PATHS ${CONAN_GLOG_ROOT}) + + find_path(GLOG_INCLUDE_DIR glog/logging.h + PATHS ${GLOG_INCLUDEDIR}) +diff --git a/build/fbcode_builder/CMake/FindLibEvent.cmake b/build/fbcode_builder/CMake/FindLibEvent.cmake +index dd11ebd..9ef0807 100644 +--- a/build/fbcode_builder/CMake/FindLibEvent.cmake ++++ b/build/fbcode_builder/CMake/FindLibEvent.cmake +@@ -50,7 +50,7 @@ if (TARGET event) + endif() + else() + find_path(LIBEVENT_INCLUDE_DIR event.h PATHS ${LibEvent_INCLUDE_PATHS}) +- find_library(LIBEVENT_LIB NAMES event PATHS ${LibEvent_LIB_PATHS}) ++ find_library(LIBEVENT_LIB NAMES event libevent PATHS ${CONAN_LIBEVENT_ROOT}) + + if (LIBEVENT_LIB AND LIBEVENT_INCLUDE_DIR) + set(LibEvent_FOUND TRUE) diff --git a/folly/all/patches/0002-compiler-flags.patch b/folly/all/patches/0002-compiler-flags.patch new file mode 100644 index 0000000..b9213ff --- /dev/null +++ b/folly/all/patches/0002-compiler-flags.patch @@ -0,0 +1,24 @@ +diff --git a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake +index 7fba75f..019d30f 100644 +--- a/CMake/FollyCompilerUnix.cmake ++++ b/CMake/FollyCompilerUnix.cmake +@@ -28,9 +28,9 @@ set( + ) + mark_as_advanced(CXX_STD) + +-set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra") ++set(CMAKE_CXX_FLAGS_COMMON "-Wall -Wextra") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}") +-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3") ++set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON}") + + # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") +@@ -44,7 +44,6 @@ function(apply_folly_compile_options_to_target THETARGET) + ) + target_compile_options(${THETARGET} + PRIVATE +- -g + -std=${CXX_STD} + -finput-charset=UTF-8 + -fsigned-char diff --git a/folly/all/patches/0003-boost-shared-ptr.patch b/folly/all/patches/0003-boost-shared-ptr.patch new file mode 100644 index 0000000..7608d6b --- /dev/null +++ b/folly/all/patches/0003-boost-shared-ptr.patch @@ -0,0 +1,24 @@ +diff --git a/folly/portability/PThread.cpp b/folly/portability/PThread.cpp +index f8cd6d4..0908668 100644 +--- a/folly/portability/PThread.cpp ++++ b/folly/portability/PThread.cpp +@@ -18,7 +18,9 @@ + + #if !FOLLY_HAVE_PTHREAD && defined(_WIN32) + #include // @manual +- ++#include ++#include ++#include + #include + + #include +@@ -683,7 +685,7 @@ int pthread_setspecific(pthread_key_t key, const void* value) { + // function, which we don't want to do. + boost::detail::set_tss_data( + realKey, +- boost::shared_ptr(), ++ 0,0, + const_cast(value), + false); + return 0; diff --git a/folly/all/patches/0004-disable-posix-names.patch b/folly/all/patches/0004-disable-posix-names.patch new file mode 100644 index 0000000..9efd4e2 --- /dev/null +++ b/folly/all/patches/0004-disable-posix-names.patch @@ -0,0 +1,27 @@ +diff --git a/folly/portability/Windows.h b/folly/portability/Windows.h +index f7990ca..b22fac5 100644 +--- a/folly/portability/Windows.h ++++ b/folly/portability/Windows.h +@@ -26,16 +26,12 @@ + // These have to be this way because we define our own versions + // of close(), because the normal Windows versions don't handle + // sockets at all. +-#ifndef __STDC__ +-/* nolint */ +-#define __STDC__ 1 +-#include // @manual nolint +-#include // @manual nolint +-#undef __STDC__ +-#else +-#include // @manual nolint +-#include // @manual nolint +-#endif ++#include ++#pragma push_macro("_CRT_INTERNAL_NONSTDC_NAMES") ++#define _CRT_INTERNAL_NONSTDC_NAMES 0 ++#include ++#include ++#pragma pop_macro("_CRT_INTERNAL_NONSTDC_NAMES") + + #if defined(min) || defined(max) + #error Windows.h needs to be included by this header, or else NOMINMAX needs \ diff --git a/folly/all/patches/0005-include-atomic.patch b/folly/all/patches/0005-include-atomic.patch new file mode 100644 index 0000000..0eb9382 --- /dev/null +++ b/folly/all/patches/0005-include-atomic.patch @@ -0,0 +1,12 @@ +diff --git a/folly/portability/PThread.cpp b/folly/portability/PThread.cpp +index 2891c4c..7c98975 100644 +--- a/folly/portability/PThread.cpp ++++ b/folly/portability/PThread.cpp +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #include + #include diff --git a/folly/all/patches/0006-duplicate-hash.patch b/folly/all/patches/0006-duplicate-hash.patch new file mode 100644 index 0000000..f8905d0 --- /dev/null +++ b/folly/all/patches/0006-duplicate-hash.patch @@ -0,0 +1,13 @@ +diff --git a/folly/hash/Hash.h b/folly/hash/Hash.h +index 33fa553..4266cf1 100644 +--- a/folly/hash/Hash.h ++++ b/folly/hash/Hash.h +@@ -730,7 +730,7 @@ struct TupleHasher<0, Ts...> { + + // Custom hash functions. + namespace std { +-#if FOLLY_SUPPLY_MISSING_INT128_TRAITS ++#if 0 + template <> + struct hash<__int128> : folly::detail::integral_hasher<__int128> {}; + diff --git a/folly/all/patches/0007-allow-builtins.patch b/folly/all/patches/0007-allow-builtins.patch new file mode 100644 index 0000000..de09722 --- /dev/null +++ b/folly/all/patches/0007-allow-builtins.patch @@ -0,0 +1,128 @@ +diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h +index 971cb8819..e68de4456 100644 +--- a/folly/portability/Builtins.h ++++ b/folly/portability/Builtins.h +@@ -41,7 +41,6 @@ FOLLY_ALWAYS_INLINE void __builtin___clear_cache(char* begin, char* end) { + } + } + +-#if !defined(_MSC_VER) || (_MSC_VER < 1923) + FOLLY_ALWAYS_INLINE int __builtin_clz(unsigned int x) { + unsigned long index; + return int(_BitScanReverse(&index, (unsigned long)x) ? 31 - index : 32); +@@ -93,7 +92,6 @@ FOLLY_ALWAYS_INLINE int __builtin_ctzll(unsigned long long x) { + return int(_BitScanForward64(&index, x) ? index : 64); + } + #endif +-#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) + + FOLLY_ALWAYS_INLINE int __builtin_ffs(int x) { + unsigned long index; +@@ -119,15 +117,12 @@ FOLLY_ALWAYS_INLINE int __builtin_popcount(unsigned int x) { + return int(__popcnt(x)); + } + +-#if !defined(_MSC_VER) || (_MSC_VER < 1923) + FOLLY_ALWAYS_INLINE int __builtin_popcountl(unsigned long x) { + static_assert(sizeof(x) == 4, ""); + return int(__popcnt(x)); + } +-#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) + #endif + +-#if !defined(_MSC_VER) || (_MSC_VER < 1923) + #if defined(_M_IX86) + FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt((unsigned int)(x >> 32))) + +@@ -138,7 +133,6 @@ FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt64(x)); + } + #endif +-#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) + + FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { + // I really hope frame is zero... +-- + +diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h +index e68de4456..30caf4003 100644 +--- a/folly/portability/Builtins.h ++++ b/folly/portability/Builtins.h +@@ -16,7 +16,7 @@ + + #pragma once + +-#if defined(_WIN32) && !defined(__clang__) ++#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__clang__) + #include + #include + #include +-- +see https://github.com/facebook/folly/issues/1412 +diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h +index 30caf4003..e8ef97266 100644 +--- a/folly/portability/Builtins.h ++++ b/folly/portability/Builtins.h +@@ -22,6 +22,14 @@ + #include + #include + ++// MSVC had added support for __builtin_clz etc. in 16.3 (1923) but it will be ++// removed in 16.8 (1928). ++#if (_MSC_VER >= 1923) && (_MSC_VER < 1928) ++#define FOLLY_DETAILFOLLY_DETAIL_MSC_BUILTIN_SUPPORT 1 ++#else ++#define FOLLY_DETAILFOLLY_DETAIL_MSC_BUILTIN_SUPPORT 0 ++#endif ++ + namespace folly { + namespace portability { + namespace detail { +@@ -41,6 +49,7 @@ FOLLY_ALWAYS_INLINE void __builtin___clear_cache(char* begin, char* end) { + } + } + ++#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + FOLLY_ALWAYS_INLINE int __builtin_clz(unsigned int x) { + unsigned long index; + return int(_BitScanReverse(&index, (unsigned long)x) ? 31 - index : 32); +@@ -92,6 +101,7 @@ FOLLY_ALWAYS_INLINE int __builtin_ctzll(unsigned long long x) { + return int(_BitScanForward64(&index, x) ? index : 64); + } + #endif ++#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + + FOLLY_ALWAYS_INLINE int __builtin_ffs(int x) { + unsigned long index; +@@ -117,12 +127,15 @@ FOLLY_ALWAYS_INLINE int __builtin_popcount(unsigned int x) { + return int(__popcnt(x)); + } + ++#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + FOLLY_ALWAYS_INLINE int __builtin_popcountl(unsigned long x) { + static_assert(sizeof(x) == 4, ""); + return int(__popcnt(x)); + } ++#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + #endif + ++#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + #if defined(_M_IX86) + FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt((unsigned int)(x >> 32))) + +@@ -133,6 +146,7 @@ FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt64(x)); + } + #endif ++#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + + FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { + // I really hope frame is zero... +@@ -141,3 +155,5 @@ FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { + return _ReturnAddress(); + } + #endif ++ ++#undef FOLLY_DETAIL_MSC_BUILTIN_SUPPORT +-- + diff --git a/folly/all/patches/0008-find-packages.patch b/folly/all/patches/0008-find-packages.patch new file mode 100644 index 0000000..3329a68 --- /dev/null +++ b/folly/all/patches/0008-find-packages.patch @@ -0,0 +1,73 @@ +diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake +index 3169b972d52..23dc6d509b1 100644 +--- a/CMake/folly-deps.cmake ++++ b/CMake/folly-deps.cmake +@@ -46,11 +46,11 @@ find_package(Boost 1.51.0 MODULE + list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS}) + +-find_package(DoubleConversion MODULE REQUIRED) ++find_package(double-conversion MODULE REQUIRED) + list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) + +-find_package(Gflags MODULE) ++find_package(gflags MODULE) + set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) + if(LIBGFLAGS_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) +@@ -59,12 +59,12 @@ if(LIBGFLAGS_FOUND) + list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR}) + endif() + +-find_package(Glog MODULE) ++find_package(glog MODULE) + set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND}) + list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR}) + +-find_package(LibEvent MODULE REQUIRED) ++find_package(Libevent MODULE REQUIRED) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) + +@@ -96,14 +96,14 @@ if (LIBLZMA_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) + endif() + +-find_package(LZ4 MODULE) ++find_package(lz4 MODULE) + set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) + if (LZ4_FOUND) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) + list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) + endif() + +-find_package(Zstd MODULE) ++find_package(zstd MODULE) + set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) + if(ZSTD_FOUND) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) +@@ -117,11 +117,11 @@ if (SNAPPY_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) + endif() + +-find_package(LibDwarf) ++find_package(libdwarf) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) + +-find_package(Libiberty) ++find_package(libiberty) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) + +@@ -133,7 +133,7 @@ find_package(LibUring) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS}) + +-find_package(Libsodium) ++find_package(libsodium) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) + diff --git a/folly/all/patches/0009-ill-formed-atomic-copy.patch b/folly/all/patches/0009-ill-formed-atomic-copy.patch new file mode 100644 index 0000000..58f9522 --- /dev/null +++ b/folly/all/patches/0009-ill-formed-atomic-copy.patch @@ -0,0 +1,13 @@ +diff --git a/folly/fibers/SemaphoreBase.cpp b/folly/fibers/SemaphoreBase.cpp +index 06e9ecc7111..77e2da75c18 100644 +--- a/folly/fibers/SemaphoreBase.cpp ++++ b/folly/fibers/SemaphoreBase.cpp +@@ -170,7 +170,7 @@ namespace { + class FutureWaiter final : public fibers::Baton::Waiter { + public: + explicit FutureWaiter(int64_t tokens) +- : semaphoreWaiter(SemaphoreBase::Waiter(tokens)) { ++ : semaphoreWaiter(tokens) { + semaphoreWaiter.baton.setWaiter(*this); + } + diff --git a/folly/all/patches/0010-duplicate-hash.patch b/folly/all/patches/0010-duplicate-hash.patch new file mode 100644 index 0000000..69268c6 --- /dev/null +++ b/folly/all/patches/0010-duplicate-hash.patch @@ -0,0 +1,13 @@ +diff --git a/folly/hash/Hash.h b/folly/hash/Hash.h +index a8a50e8e8dc..d7a3da8e61f 100644 +--- a/folly/hash/Hash.h ++++ b/folly/hash/Hash.h +@@ -733,7 +733,7 @@ struct TupleHasher<0, Ts...> { + + // Custom hash functions. + namespace std { +-#if FOLLY_SUPPLY_MISSING_INT128_TRAITS ++#if 0 + template <> + struct hash<__int128> : folly::detail::integral_hasher<__int128> {}; + diff --git a/folly/all/patches/0011-disable-logger-example.patch b/folly/all/patches/0011-disable-logger-example.patch new file mode 100644 index 0000000..fa20905 --- /dev/null +++ b/folly/all/patches/0011-disable-logger-example.patch @@ -0,0 +1,12 @@ +diff --git a/folly/CMakeLists.txt b/folly/CMakeLists.txt +index 08de7daf20f..cdc1f03bf46 100644 +--- a/folly/CMakeLists.txt ++++ b/folly/CMakeLists.txt +@@ -27,7 +27,6 @@ install( + ) + + add_subdirectory(experimental/exception_tracer) +-add_subdirectory(logging/example) + + if (PYTHON_EXTENSIONS) + # Create tree of symbolic links in structure required for successful diff --git a/folly/all/patches/0012-compiler-flags.patch b/folly/all/patches/0012-compiler-flags.patch new file mode 100644 index 0000000..358500a --- /dev/null +++ b/folly/all/patches/0012-compiler-flags.patch @@ -0,0 +1,24 @@ +diff --git a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake +index 8dcaf141a3a..200fe8d3798 100644 +--- a/CMake/FollyCompilerUnix.cmake ++++ b/CMake/FollyCompilerUnix.cmake +@@ -28,9 +28,9 @@ set( + ) + mark_as_advanced(CXX_STD) + +-set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra") ++set(CMAKE_CXX_FLAGS_COMMON "-Wall -Wextra") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}") +-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3") ++set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON}") + + # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") +@@ -43,7 +43,6 @@ function(apply_folly_compile_options_to_target THETARGET) + ) + target_compile_options(${THETARGET} + PRIVATE +- -g + -std=${CXX_STD} + -finput-charset=UTF-8 + -fsigned-char diff --git a/folly/all/patches/0013-include-bit.patch b/folly/all/patches/0013-include-bit.patch new file mode 100644 index 0000000..1a8ac24 --- /dev/null +++ b/folly/all/patches/0013-include-bit.patch @@ -0,0 +1,13 @@ +--- a/folly/lang/Bits.h ++++ b/folly/lang/Bits.h +@@ -64,6 +64,10 @@ + #include + #include + ++#if __has_include() && __cpp_lib_bit_cast ++#include ++#endif ++ + namespace folly { + + #if __cpp_lib_bit_cast diff --git a/folly/all/patches/0014-find-librt.patch b/folly/all/patches/0014-find-librt.patch new file mode 100644 index 0000000..90a1f0f --- /dev/null +++ b/folly/all/patches/0014-find-librt.patch @@ -0,0 +1,18 @@ +diff --git a/CMake/FollyConfigChecks.cmake b/CMake/FollyConfigChecks.cmake +index 6b8b308c7..908d72d51 100644 +--- a/CMake/FollyConfigChecks.cmake ++++ b/CMake/FollyConfigChecks.cmake +@@ -83,6 +83,13 @@ string(REGEX REPLACE + CMAKE_REQUIRED_FLAGS + "${CMAKE_REQUIRED_FLAGS}") + ++if (CMAKE_SYSTEM_NAME STREQUAL "Linux") ++ find_library(LIBRT rt) ++ if (LIBRT) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES "rt") ++ endif() ++endif() ++ + check_symbol_exists(pthread_atfork pthread.h FOLLY_HAVE_PTHREAD_ATFORK) + + # Unfortunately check_symbol_exists() does not work for memrchr(): diff --git a/folly/all/patches/0015-benchmark-format-macros.patch b/folly/all/patches/0015-benchmark-format-macros.patch new file mode 100644 index 0000000..14f8b20 --- /dev/null +++ b/folly/all/patches/0015-benchmark-format-macros.patch @@ -0,0 +1,15 @@ +diff --git a/folly/Benchmark.cpp b/folly/Benchmark.cpp +index 389ee46a1..390b7674b 100644 +--- a/folly/Benchmark.cpp ++++ b/folly/Benchmark.cpp +@@ -16,6 +16,10 @@ + + // @author Andrei Alexandrescu (andrei.alexandrescu@fb.com) + ++#ifndef __STDC_FORMAT_MACROS ++#define __STDC_FORMAT_MACROS 1 ++#endif ++ + #include + + #include diff --git a/folly/all/patches/0016-find-packages.patch b/folly/all/patches/0016-find-packages.patch new file mode 100644 index 0000000..c6cd14f --- /dev/null +++ b/folly/all/patches/0016-find-packages.patch @@ -0,0 +1,80 @@ +diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake +index 9c9d9ea60..e78611542 100644 +--- a/CMake/folly-deps.cmake ++++ b/CMake/folly-deps.cmake +@@ -48,25 +48,25 @@ find_package(Boost 1.51.0 MODULE + list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS}) + +-find_package(DoubleConversion MODULE REQUIRED) ++find_package(double-conversion MODULE REQUIRED) + list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) + +-find_package(Gflags MODULE) +-set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) +-if(LIBGFLAGS_FOUND) +- list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) +- set(FOLLY_LIBGFLAGS_LIBRARY ${LIBGFLAGS_LIBRARY}) +- set(FOLLY_LIBGFLAGS_INCLUDE ${LIBGFLAGS_INCLUDE_DIR}) ++find_package(gflags MODULE) ++set(FOLLY_HAVE_LIBGFLAGS ${gflags_FOUND}) ++if(gflags_FOUND) ++ list(APPEND FOLLY_LINK_LIBRARIES ${gflags_LIBRARIES}) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIRS}) ++ set(FOLLY_LIBGFLAGS_LIBRARY ${gflags_LIBRARIES}) ++ set(FOLLY_LIBGFLAGS_INCLUDE ${gflags_INCLUDE_DIRS}) + endif() + +-find_package(Glog MODULE) ++find_package(glog MODULE) + set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND}) + list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR}) + +-find_package(LibEvent MODULE REQUIRED) ++find_package(Libevent MODULE REQUIRED) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) + +@@ -104,14 +104,14 @@ if (LIBLZMA_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) + endif() + +-find_package(LZ4 MODULE) ++find_package(lz4 MODULE) + set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) + if (LZ4_FOUND) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) + list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) + endif() + +-find_package(Zstd MODULE) ++find_package(zstd MODULE) + set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) + if(ZSTD_FOUND) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) +@@ -125,11 +125,11 @@ if (SNAPPY_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) + endif() + +-find_package(LibDwarf) ++find_package(libdwarf) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) + +-find_package(Libiberty) ++find_package(libiberty) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) + +@@ -141,7 +141,7 @@ find_package(LibUring) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS}) + +-find_package(Libsodium) ++find_package(libsodium) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) + diff --git a/folly/all/patches/0017-compiler-flags.patch b/folly/all/patches/0017-compiler-flags.patch new file mode 100644 index 0000000..1290e80 --- /dev/null +++ b/folly/all/patches/0017-compiler-flags.patch @@ -0,0 +1,24 @@ +diff --git a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake +index 8dcaf14..200fe8d 100644 +--- a/CMake/FollyCompilerUnix.cmake ++++ b/CMake/FollyCompilerUnix.cmake +@@ -28,9 +28,9 @@ set( + ) + mark_as_advanced(CXX_STD) + +-set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra") ++set(CMAKE_CXX_FLAGS_COMMON "-Wall -Wextra") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}") +-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3") ++set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON}") + + # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") +@@ -43,7 +43,6 @@ function(apply_folly_compile_options_to_target THETARGET) + ) + target_compile_options(${THETARGET} + PRIVATE +- -g + -std=${CXX_STD} + -finput-charset=UTF-8 + -fsigned-char diff --git a/folly/all/patches/0018-find-glog.patch b/folly/all/patches/0018-find-glog.patch new file mode 100644 index 0000000..b2d17ad --- /dev/null +++ b/folly/all/patches/0018-find-glog.patch @@ -0,0 +1,16 @@ +diff --git a/build/fbcode_builder/CMake/FindGlog.cmake b/build/fbcode_builder/CMake/FindGlog.cmake +index 752647c..aa2fa1c 100644 +--- a/build/fbcode_builder/CMake/FindGlog.cmake ++++ b/build/fbcode_builder/CMake/FindGlog.cmake +@@ -10,9 +10,9 @@ include(FindPackageHandleStandardArgs) + include(SelectLibraryConfigurations) + + find_library(GLOG_LIBRARY_RELEASE glog +- PATHS ${GLOG_LIBRARYDIR}) ++ PATHS ${CONAN_GLOG_ROOT}) + find_library(GLOG_LIBRARY_DEBUG glogd +- PATHS ${GLOG_LIBRARYDIR}) ++ PATHS ${CONAN_GLOG_ROOT}) + + find_path(GLOG_INCLUDE_DIR glog/logging.h + PATHS ${GLOG_INCLUDEDIR}) diff --git a/folly/all/patches/0019-exclude-example.patch b/folly/all/patches/0019-exclude-example.patch new file mode 100644 index 0000000..d2afb31 --- /dev/null +++ b/folly/all/patches/0019-exclude-example.patch @@ -0,0 +1,12 @@ +diff --git a/folly/CMakeLists.txt b/folly/CMakeLists.txt +index 883f27c..2d2086f 100644 +--- a/folly/CMakeLists.txt ++++ b/folly/CMakeLists.txt +@@ -28,7 +28,6 @@ install( + ) + + add_subdirectory(experimental/exception_tracer) +-add_subdirectory(logging/example) + + if (PYTHON_EXTENSIONS) + # Create tree of symbolic links in structure required for successful diff --git a/folly/all/patches/0020-include-ssizet.patch b/folly/all/patches/0020-include-ssizet.patch new file mode 100644 index 0000000..0575fec --- /dev/null +++ b/folly/all/patches/0020-include-ssizet.patch @@ -0,0 +1,12 @@ +diff --git a/folly/executors/ExecutorWithPriority.h b/folly/executors/ExecutorWithPriority.h +index b95a6c4..18b8110 100644 +--- a/folly/executors/ExecutorWithPriority.h ++++ b/folly/executors/ExecutorWithPriority.h +@@ -18,6 +18,7 @@ + + #include + #include ++#include + + namespace folly { + diff --git a/folly/all/patches/0021-typedef-clockid.patch b/folly/all/patches/0021-typedef-clockid.patch new file mode 100644 index 0000000..fb46c05 --- /dev/null +++ b/folly/all/patches/0021-typedef-clockid.patch @@ -0,0 +1,12 @@ +diff --git a/folly/portability/Time.h b/folly/portability/Time.h +index 994a09e5d70..e4f0d101ca9 100644 +--- a/folly/portability/Time.h ++++ b/folly/portability/Time.h +@@ -49,7 +49,6 @@ + #define CLOCK_PROCESS_CPUTIME_ID 2 + #define CLOCK_THREAD_CPUTIME_ID 3 + +-typedef uint8_t clockid_t; + extern "C" int clock_gettime(clockid_t clk_id, struct timespec* ts); + extern "C" int clock_getres(clockid_t clk_id, struct timespec* ts); + #endif diff --git a/folly/all/patches/0022-fix-windows-minmax.patch b/folly/all/patches/0022-fix-windows-minmax.patch new file mode 100644 index 0000000..1fc69a4 --- /dev/null +++ b/folly/all/patches/0022-fix-windows-minmax.patch @@ -0,0 +1,12 @@ +diff --git a/CMake/FollyCompilerMSVC.cmake b/CMake/FollyCompilerMSVC.cmake +index ec2ce1a1d..16deda71c 100644 +--- a/CMake/FollyCompilerMSVC.cmake ++++ b/CMake/FollyCompilerMSVC.cmake +@@ -289,6 +289,7 @@ function(apply_folly_compile_options_to_target THETARGET) + # And the extra defines: + target_compile_definitions(${THETARGET} + PUBLIC ++ NOMINMAX + _CRT_NONSTDC_NO_WARNINGS # Don't deprecate posix names of functions. + _CRT_SECURE_NO_WARNINGS # Don't deprecate the non _s versions of various standard library functions, because safety is for chumps. + _SCL_SECURE_NO_WARNINGS # Don't deprecate the non _s versions of various standard library functions, because safety is for chumps. diff --git a/folly/all/test_package/CMakeLists.txt b/folly/all/test_package/CMakeLists.txt index a56a9ae..6a9df4e 100644 --- a/folly/all/test_package/CMakeLists.txt +++ b/folly/all/test_package/CMakeLists.txt @@ -3,10 +3,11 @@ project(test_package CXX) find_package(folly REQUIRED CONFIG) - add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} - Folly::folly) + Folly::folly + Folly::follybenchmark) + if (${FOLLY_VERSION} VERSION_LESS "2021.07.20.00") set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/folly/all/test_package/CMakeUserPresets.json b/folly/all/test_package/CMakeUserPresets.json deleted file mode 100644 index be988f0..0000000 --- a/folly/all/test_package/CMakeUserPresets.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 4, - "vendor": { - "conan": {} - }, - "include": [ - "/Users/jiaoew/workspace/conanfiles/folly/all/test_package/build/generators/CMakePresets.json" - ] -} \ No newline at end of file diff --git a/folly/config.yml b/folly/config.yml index 850f503..6a14a27 100644 --- a/folly/config.yml +++ b/folly/config.yml @@ -1,3 +1,7 @@ versions: - '2023.02.24': - folder: all + "2019.10.21.00": + folder: all + "2020.08.10.00": + folder: all + "2022.01.31.00": + folder: all diff --git a/gflags/all/conandata.yml b/gflags/all/conandata.yml new file mode 100644 index 0000000..f438b0b --- /dev/null +++ b/gflags/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.2.2": + sha256: 34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf + url: https://github.com/gflags/gflags/archive/v2.2.2.tar.gz diff --git a/gflags/all/conanfile.py b/gflags/all/conanfile.py new file mode 100644 index 0000000..985562e --- /dev/null +++ b/gflags/all/conanfile.py @@ -0,0 +1,109 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, rmdir, save +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class GflagsConan(ConanFile): + name = "gflags" + description = "The gflags package contains a C++ library that implements commandline flags processing" + topics = ("cli", "flags", "commandline") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/gflags/gflags" + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "nothreads": [True, False], + "namespace": ["ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "nothreads": True, + "namespace": "gflags", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["BUILD_gflags_LIB"] = not self.options.nothreads + tc.variables["BUILD_gflags_nothreads_LIB"] = self.options.nothreads + tc.variables["BUILD_PACKAGING"] = False + tc.variables["BUILD_TESTING"] = False + tc.variables["INSTALL_HEADERS"] = True + tc.variables["INSTALL_SHARED_LIBS"] = self.options.shared + tc.variables["INSTALL_STATIC_LIBS"] = not self.options.shared + tc.variables["REGISTER_BUILD_DIR"] = False + tc.variables["REGISTER_INSTALL_PREFIX"] = False + tc.variables["GFLAGS_NAMESPACE"] = self.options.namespace + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"gflags": "gflags::gflags"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "gflags") + self.cpp_info.set_property("cmake_target_name", "gflags::gflags") + self.cpp_info.set_property("cmake_target_aliases", ["gflags"]) + self.cpp_info.set_property("pkg_config_name", "gflags") + self.cpp_info.libs = collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["shlwapi"]) + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "m"]) + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/gflags/all/test_package/CMakeLists.txt b/gflags/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..5b23a3a --- /dev/null +++ b/gflags/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(gflags REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gflags::gflags) diff --git a/gflags/all/test_package/conanfile.py b/gflags/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/gflags/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/gflags/all/test_package/test_package.cpp b/gflags/all/test_package/test_package.cpp new file mode 100644 index 0000000..52d36fe --- /dev/null +++ b/gflags/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +DEFINE_bool(big_menu, true, "Include 'advanced' options in the menu listing"); +DEFINE_string(languages, "english,french,german", + "comma-separated list of languages to offer in the 'lang' menu"); + +int main(int argc, char **argv) { + GFLAGS_NAMESPACE::ShowUsageWithFlags(argv[0]); + GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &argv, true); + return 0; +} diff --git a/gflags/all/test_v1_package/CMakeLists.txt b/gflags/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/gflags/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/gflags/all/test_v1_package/conanfile.py b/gflags/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/gflags/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/gflags/config.yml b/gflags/config.yml new file mode 100644 index 0000000..6d6cfc6 --- /dev/null +++ b/gflags/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.2": + folder: all diff --git a/glog/all/conandata.yml b/glog/all/conandata.yml new file mode 100644 index 0000000..620508c --- /dev/null +++ b/glog/all/conandata.yml @@ -0,0 +1,21 @@ +sources: + "0.7.1": + url: "https://github.com/google/glog/archive/refs/tags/v0.7.1.tar.gz" + sha256: "00e4a87e87b7e7612f519a41e491f16623b12423620006f59f5688bfd8d13b08" + "0.7.0": + url: "https://github.com/google/glog/archive/refs/tags/v0.7.0.tar.gz" + sha256: "375106b5976231b92e66879c1a92ce062923b9ae573c42b56ba28b112ee4cc11" + "0.6.0": + url: "https://github.com/google/glog/archive/refs/tags/v0.6.0.tar.gz" + sha256: "8a83bf982f37bb70825df71a9709fa90ea9f4447fb3c099e1d720a439d88bad6" + "0.5.0": + url: "https://github.com/google/glog/archive/refs/tags/v0.5.0.tar.gz" + sha256: "eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5" + "0.4.0": + url: "https://github.com/google/glog/archive/v0.4.0.tar.gz" + sha256: "f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c" +patches: + "0.5.0": + - patch_file: "patches/0001-fix-msvc-snprintf.patch" + patch_description: "Use stdio.h instead of cstdio.h for snprintf" + patch_type: "conan" diff --git a/glog/all/conanfile.py b/glog/all/conanfile.py new file mode 100644 index 0000000..3b6d58c --- /dev/null +++ b/glog/all/conanfile.py @@ -0,0 +1,161 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd +import os + +required_conan_version = ">=1.54.0" + + +class GlogConan(ConanFile): + name = "glog" + description = "Google logging library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/glog/" + topics = ("logging",) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_gflags": [True, False], + "with_threads": [True, False], + "with_unwind": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_gflags": True, + "with_threads": True, + "with_unwind": True, + } + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os not in ["Linux", "FreeBSD"] or Version(self.version) < "0.5.0": + del self.options.with_unwind + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if self.options.with_gflags: + self.options["gflags"].shared = self.options.shared + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_gflags: + self.requires("gflags/2.2.2", transitive_headers=True, transitive_libs=True) + # 0.4.0 requires libunwind unconditionally + if self.options.get_safe("with_unwind") or (Version(self.version) < "0.5.0" and self.settings.os in ["Linux", "FreeBSD"]): + self.requires("libunwind/1.8.0", transitive_headers=True, transitive_libs=True) + + def validate(self): + if Version(self.version) < "0.7.0": + return + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def build_requirements(self): + if Version(self.version) >= "0.7.0": + self.tool_requires("cmake/[>=3.22 <4]") + elif Version(self.version) >= "0.6.0": + self.tool_requires("cmake/[>=3.16 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = VirtualBuildEnv(self) + tc.generate() + + tc = CMakeToolchain(self) + tc.variables["WITH_GFLAGS"] = self.options.with_gflags + tc.variables["WITH_THREADS"] = self.options.with_threads + if Version(self.version) >= "0.5.0": + tc.variables["WITH_PKGCONFIG"] = True + if self.settings.os == "Emscripten": + tc.variables["WITH_SYMBOLIZE"] = False + tc.variables["HAVE_SYSCALL_H"] = False + tc.variables["HAVE_SYS_SYSCALL_H"] = False + else: + tc.variables["WITH_SYMBOLIZE"] = True + tc.variables["WITH_UNWIND"] = self.options.get_safe("with_unwind", default=False) + tc.variables["BUILD_TESTING"] = False + tc.variables["WITH_GTEST"] = False + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # do not force PIC + if Version(self.version) <= "0.5.0": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set_target_properties (glog PROPERTIES POSITION_INDEPENDENT_CODE ON)", + "") + # INFO: avoid "CONAN_LIB::gflags_gflags_nothreads_RELEASE" but the target was not found. + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "determine_gflags_namespace", + "# determine_gflags_namespace") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "glog") + self.cpp_info.set_property("cmake_target_name", "glog::glog") + self.cpp_info.set_property("pkg_config_name", "libglog") + postfix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = ["glog" + postfix] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["dbghelp"] + self.cpp_info.defines = ["GLOG_NO_ABBREVIATED_SEVERITIES"] + decl = "__declspec(dllimport)" if self.options.shared else "" + self.cpp_info.defines.append(f"GOOGLE_GLOG_DLL_DECL={decl}") + if self.options.with_gflags and not self.options.shared: + self.cpp_info.defines.extend(["GFLAGS_DLL_DECLARE_FLAG=", "GFLAGS_DLL_DEFINE_FLAG="]) + if Version(self.version) >= "0.7.0": + self.cpp_info.defines.extend(["GLOG_USE_GLOG_EXPORT="]) diff --git a/glog/all/patches/0001-fix-msvc-snprintf.patch b/glog/all/patches/0001-fix-msvc-snprintf.patch new file mode 100644 index 0000000..c92d98c --- /dev/null +++ b/glog/all/patches/0001-fix-msvc-snprintf.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -141,7 +141,7 @@ check_cxx_compiler_flag (-Wunnamed-type-template-args + + # NOTE: Cannot use check_function_exists here since >=vc-14.0 can define + # snprintf as an inline function +-check_symbol_exists (snprintf cstdio HAVE_SNPRINTF) ++check_symbol_exists (snprintf stdio.h HAVE_SNPRINTF) + + check_library_exists (dbghelp UnDecorateSymbolName "" HAVE_DBGHELP) + diff --git a/glog/all/test_package/CMakeLists.txt b/glog/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..846b06b --- /dev/null +++ b/glog/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(glog REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE glog::glog) +if (glog_VERSION VERSION_GREATER_EQUAL "0.7.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/glog/all/test_package/conanfile.py b/glog/all/test_package/conanfile.py new file mode 100644 index 0000000..8a5bb47 --- /dev/null +++ b/glog/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/glog/all/test_package/test_package.cpp b/glog/all/test_package/test_package.cpp new file mode 100644 index 0000000..10542f4 --- /dev/null +++ b/glog/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char** argv) { + google::InitGoogleLogging(argv[0]); + LOG(INFO) << "It works"; + return 0; +} diff --git a/glog/all/test_v1_package/CMakeLists.txt b/glog/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/glog/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/glog/all/test_v1_package/conanfile.py b/glog/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..2490acf --- /dev/null +++ b/glog/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/glog/config.yml b/glog/config.yml new file mode 100644 index 0000000..3e17ace --- /dev/null +++ b/glog/config.yml @@ -0,0 +1,11 @@ +versions: + "0.7.1": + folder: all + "0.7.0": + folder: all + "0.6.0": + folder: all + "0.5.0": + folder: all + "0.4.0": + folder: all diff --git a/gnu-config/all/conandata.yml b/gnu-config/all/conandata.yml new file mode 100644 index 0000000..c49d54a --- /dev/null +++ b/gnu-config/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "cci.20210814": + url: "http://git.savannah.gnu.org/cgit/config.git/snapshot/config-191bcb948f7191c36eefe634336f5fc5c0c4c2be.tar.gz" + sha256: "302e5e7f3c4996976c58efde8b2f28f71d51357e784330eeed738e129300dc33" + "cci.20201022": + url: "http://git.savannah.gnu.org/cgit/config.git/snapshot/config-1c4398015583eb77bc043234f5734be055e64bea.tar.gz" + sha256: "339eb64757bf5af9e23ca15daa136acdd9d778753377190ce17fba7e1b222aff" +patches: + "cci.20210814": + - patch_file: "patches/cci.20210814-0001-tvos-support.patch" + patch_description: "add support to tvOS" + patch_type: "portability" diff --git a/gnu-config/all/conanfile.py b/gnu-config/all/conanfile.py new file mode 100644 index 0000000..ad0c56a --- /dev/null +++ b/gnu-config/all/conanfile.py @@ -0,0 +1,66 @@ +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.files import copy, get, load, save, apply_conandata_patches, export_conandata_patches +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + + +class GnuConfigConan(ConanFile): + name = "gnu-config" + description = "The GNU config.guess and config.sub scripts" + homepage = "https://savannah.gnu.org/projects/config/" + url = "https://github.com/conan-io/conan-center-index" + topics = ("gnu", "config", "autotools", "canonical", "host", "build", "target", "triplet") + license = "GPL-3.0-or-later", "autoconf-special-exception" + package_type = "build-scripts" + os = "arch", "compiler", "build_type", "arch" + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def _extract_license(self): + txt_lines = load(self, os.path.join(self.source_folder, "config.guess")).splitlines() + start_index = None + end_index = None + for line_i, line in enumerate(txt_lines): + if start_index is None: + if "This file is free" in line: + start_index = line_i + if end_index is None: + if "Please send patches" in line: + end_index = line_i + if not all((start_index, end_index)): + raise ConanException("Failed to extract the license") + return "\n".join(txt_lines[start_index:end_index]) + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "COPYING"), self._extract_license()) + copy(self, "config.guess", src=self.source_folder, dst=os.path.join(self.package_folder, "bin")) + copy(self, "config.sub", src=self.source_folder, dst=os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + bin_path = os.path.join(self.package_folder, "bin") + self.conf_info.define("user.gnu-config:config_guess", os.path.join(bin_path, "config.guess")) + self.conf_info.define("user.gnu-config:config_sub", os.path.join(bin_path, "config.sub")) + + # TODO: to remove in conan v2 + self.user_info.CONFIG_GUESS = os.path.join(bin_path, "config.guess") + self.user_info.CONFIG_SUB = os.path.join(bin_path, "config.sub") + self.env_info.PATH.append(bin_path) diff --git a/gnu-config/all/patches/cci.20210814-0001-tvos-support.patch b/gnu-config/all/patches/cci.20210814-0001-tvos-support.patch new file mode 100644 index 0000000..64667f1 --- /dev/null +++ b/gnu-config/all/patches/cci.20210814-0001-tvos-support.patch @@ -0,0 +1,11 @@ +--- config.sub ++++ config.sub +@@ -1723,7 +1723,7 @@ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ +- | os9* | macos* | osx* | ios* \ ++ | os9* | macos* | osx* | ios* | tvos* | watchos* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ diff --git a/gnu-config/all/test_package/conanfile.py b/gnu-config/all/test_package/conanfile.py new file mode 100644 index 0000000..93cb4f7 --- /dev/null +++ b/gnu-config/all/test_package/conanfile.py @@ -0,0 +1,21 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + win_bash = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def test(self): + self.run("config.guess") + self.run("config.sub --version") diff --git a/gnu-config/all/test_v1_package/conanfile.py b/gnu-config/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..f98dcb1 --- /dev/null +++ b/gnu-config/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +from conans import ConanFile, tools +from conans.errors import ConanException + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + def test(self): + self.run("config.guess", run_environment=True, win_bash=tools.os_info.is_windows) + try: + triplet = tools.get_gnu_triplet(str(self.settings.os), str(self.settings.arch), str(self.settings.compiler)) + self.run(f"config.sub {triplet}", run_environment=True, win_bash=tools.os_info.is_windows) + except ConanException: + self.output.info("Current configuration is not supported by GNU config.\nIgnoring...") diff --git a/gnu-config/config.yml b/gnu-config/config.yml new file mode 100644 index 0000000..cf1827d --- /dev/null +++ b/gnu-config/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20210814": + folder: "all" + "cci.20201022": + folder: "all" diff --git a/google-cloud-cpp/2.x/components_2_12_0.py b/google-cloud-cpp/2.x/components_2_12_0.py new file mode 100644 index 0000000..943f334 --- /dev/null +++ b/google-cloud-cpp/2.x/components_2_12_0.py @@ -0,0 +1,411 @@ +# Automatically generated by /usr/local/google/home/coryan/cci-develop/recipes/google-cloud-cpp/2.x/extract_dependencies.py DO NOT EDIT +DEPENDENCIES = { + "accessapproval_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "accesscontextmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "advisorynotifications_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "aiplatform_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_interval_protos', 'type_money_protos'], + "alloydb_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "apigateway_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "apigeeconnect_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "apikeys_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "appengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "artifactregistry_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "asset_protos": ['accesscontextmanager_protos', 'api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'osconfig_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_expr_protos', 'type_timeofday_protos'], + "assuredworkloads_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "automl_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "baremetalsolution_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "batch_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "beyondcorp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "cloud_bigquery_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos', 'type_expr_protos'], + "bigtable_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "billing_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos', 'type_money_protos'], + "binaryauthorization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "certificatemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "channel_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_decimal_protos', 'type_money_protos', 'type_postal_address_protos'], + "cloudbuild_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "cloud_common_common_protos": ['api_field_behavior_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "composer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "confidentialcomputing_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "connectors_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "contactcenterinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "container_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'], + "containeranalysis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "contentwarehouse_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'documentai_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_date_protos', 'type_datetime_protos', 'type_expr_protos', 'type_interval_protos', 'type_money_protos', 'type_postal_address_protos'], + "datacatalog_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "datamigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "dataplex_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "dataproc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "datastream_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "deploy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "cloud_dialogflow_v2_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "dialogflow_cx_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "dlp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "documentai_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_date_protos', 'type_datetime_protos', 'type_money_protos', 'type_postal_address_protos'], + "domains_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_money_protos', 'type_postal_address_protos'], + "edgecontainer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "essentialcontacts_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "eventarc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'], + "filestore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'cloud_common_common_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "functions_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "gameservices_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkebackup_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkehub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkemulticloud_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "grafeas_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "iam_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "iap_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "ids_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "iot_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "kms_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "language_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "logging_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "logging_type_type_protos": ['grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "managedidentities_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "memcache_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "monitoring_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_calendar_period_protos'], + "networkconnectivity_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networkmanagement_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networkservices_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "notebooks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "optimization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "orgpolicy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_expr_protos'], + "osconfig_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "oslogin_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "policytroubleshooter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "privateca_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "profiler_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "pubsub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "recaptchaenterprise_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "recommender_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_money_protos'], + "redis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "resourcemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "resourcesettings_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "retail_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "run_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "scheduler_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "secretmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "securitycenter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "servicecontrol_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'protobuf::libprotobuf', 'rpc_context_attribute_context_protos', 'rpc_status_protos'], + "servicedirectory_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "servicemanagement_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_config_change_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_resource_protos', 'api_service_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "serviceusage_protos": ['api_annotations_protos', 'api_auth_protos', 'api_client_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "shell_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "spanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "cloud_speech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "storage_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos'], + "storageinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos'], + "storagetransfer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_timeofday_protos'], + "support_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "talent_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos', 'type_money_protos', 'type_postal_address_protos', 'type_timeofday_protos'], + "tasks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "cloud_texttospeech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "timeseriesinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "tpu_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "devtools_cloudtrace_v2_trace_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "translate_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "video_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_datetime_protos'], + "videointelligence_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "vision_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_latlng_protos'], + "vmmigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos'], + "vmwareengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "vpcaccess_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "webrisk_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "websecurityscanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "workflows_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "workstations_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "api_annotations_protos": ['api_http_protos'], + "api_auth_protos": ['api_annotations_protos'], + "api_billing_protos": ['api_annotations_protos', 'api_metric_protos'], + "api_client_protos": ['api_launch_stage_protos'], + "api_distribution_protos": ['api_annotations_protos'], + "api_endpoint_protos": ['api_annotations_protos'], + "api_log_protos": ['api_label_protos'], + "api_logging_protos": ['api_annotations_protos', 'api_label_protos'], + "api_metric_protos": ['api_label_protos', 'api_launch_stage_protos'], + "api_monitored_resource_protos": ['api_label_protos', 'api_launch_stage_protos'], + "api_monitoring_protos": ['api_annotations_protos'], + "api_quota_protos": ['api_annotations_protos'], + "api_service_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_resource_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos'], + "api_usage_protos": ['api_annotations_protos', 'api_visibility_protos'], + "devtools_cloudtrace_v2_tracing_protos": ['api_client_protos', 'api_field_behavior_protos', 'devtools_cloudtrace_v2_trace_protos', 'devtools_cloudtrace_v2_trace_protos', 'rpc_status_protos'], +} + +PROTO_COMPONENTS = { + "accessapproval_protos", + "accesscontextmanager_protos", + "advisorynotifications_protos", + "aiplatform_protos", + "alloydb_protos", + "api_annotations_protos", + "api_auth_protos", + "api_backend_protos", + "api_billing_protos", + "api_client_protos", + "api_config_change_protos", + "api_context_protos", + "api_control_protos", + "api_distribution_protos", + "api_documentation_protos", + "api_endpoint_protos", + "api_field_behavior_protos", + "api_http_protos", + "api_httpbody_protos", + "api_label_protos", + "api_launch_stage_protos", + "api_log_protos", + "api_logging_protos", + "api_metric_protos", + "api_monitored_resource_protos", + "api_monitoring_protos", + "api_quota_protos", + "api_resource_protos", + "api_routing_protos", + "api_service_protos", + "api_source_info_protos", + "api_system_parameter_protos", + "api_usage_protos", + "api_visibility_protos", + "apigateway_protos", + "apigeeconnect_protos", + "apikeys_protos", + "appengine_protos", + "artifactregistry_protos", + "asset_protos", + "assuredworkloads_protos", + "automl_protos", + "baremetalsolution_protos", + "batch_protos", + "beyondcorp_protos", + "bigtable_protos", + "billing_protos", + "binaryauthorization_protos", + "certificatemanager_protos", + "channel_protos", + "cloud_bigquery_protos", + "cloud_common_common_protos", + "cloud_dialogflow_v2_protos", + "cloud_speech_protos", + "cloud_texttospeech_protos", + "cloudbuild_protos", + "composer_protos", + "confidentialcomputing_protos", + "connectors_protos", + "contactcenterinsights_protos", + "container_protos", + "containeranalysis_protos", + "contentwarehouse_protos", + "datacatalog_protos", + "datamigration_protos", + "dataplex_protos", + "dataproc_protos", + "datastream_protos", + "deploy_protos", + "devtools_cloudtrace_v2_trace_protos", + "devtools_cloudtrace_v2_tracing_protos", + "devtools_source_v1_source_context_protos", + "dialogflow_cx_protos", + "dlp_protos", + "documentai_protos", + "domains_protos", + "edgecontainer_protos", + "essentialcontacts_protos", + "eventarc_protos", + "filestore_protos", + "functions_protos", + "gameservices_protos", + "gkebackup_protos", + "gkehub_protos", + "gkemulticloud_protos", + "grafeas_protos", + "iam_protos", + "iam_v1_iam_policy_protos", + "iam_v1_options_protos", + "iam_v1_policy_protos", + "iap_protos", + "ids_protos", + "iot_protos", + "kms_protos", + "language_protos", + "logging_protos", + "logging_type_type_protos", + "longrunning_operations_protos", + "managedidentities_protos", + "memcache_protos", + "monitoring_protos", + "networkconnectivity_protos", + "networkmanagement_protos", + "networkservices_protos", + "notebooks_protos", + "optimization_protos", + "orgpolicy_protos", + "osconfig_protos", + "oslogin_protos", + "policytroubleshooter_protos", + "privateca_protos", + "profiler_protos", + "pubsub_protos", + "recaptchaenterprise_protos", + "recommender_protos", + "redis_protos", + "resourcemanager_protos", + "resourcesettings_protos", + "retail_protos", + "rpc_code_protos", + "rpc_context_attribute_context_protos", + "rpc_error_details_protos", + "rpc_status_protos", + "run_protos", + "scheduler_protos", + "secretmanager_protos", + "securitycenter_protos", + "servicecontrol_protos", + "servicedirectory_protos", + "servicemanagement_protos", + "serviceusage_protos", + "shell_protos", + "spanner_protos", + "storage_protos", + "storageinsights_protos", + "storagetransfer_protos", + "support_protos", + "talent_protos", + "tasks_protos", + "timeseriesinsights_protos", + "tpu_protos", + "translate_protos", + "type_calendar_period_protos", + "type_color_protos", + "type_date_protos", + "type_datetime_protos", + "type_dayofweek_protos", + "type_decimal_protos", + "type_expr_protos", + "type_interval_protos", + "type_latlng_protos", + "type_money_protos", + "type_postal_address_protos", + "type_timeofday_protos", + "video_protos", + "videointelligence_protos", + "vision_protos", + "vmmigration_protos", + "vmwareengine_protos", + "vpcaccess_protos", + "webrisk_protos", + "websecurityscanner_protos", + "workflows_protos", + "workstations_protos" +} + +COMPONENTS = { + "accessapproval", + "accesscontextmanager", + "advisorynotifications", + "aiplatform", + "alloydb", + "apigateway", + "apigeeconnect", + "apikeys", + "appengine", + "artifactregistry", + "asset", + "assuredworkloads", + "automl", + "baremetalsolution", + "batch", + "beyondcorp", + "bigquery", + "bigtable", + "billing", + "binaryauthorization", + "certificatemanager", + "channel", + "cloudbuild", + "composer", + "confidentialcomputing", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "contentwarehouse", + "datacatalog", + "datamigration", + "dataplex", + "dataproc", + "datastream", + "deploy", + "dialogflow_cx", + "dialogflow_es", + "dlp", + "documentai", + "domains", + "edgecontainer", + "essentialcontacts", + "eventarc", + "filestore", + "functions", + "gameservices", + "gkebackup", + "gkehub", + "gkemulticloud", + "iam", + "iap", + "ids", + "iot", + "kms", + "language", + "logging", + "managedidentities", + "memcache", + "monitoring", + "networkconnectivity", + "networkmanagement", + "networkservices", + "notebooks", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policytroubleshooter", + "privateca", + "profiler", + "pubsub", + "recaptchaenterprise", + "recommender", + "redis", + "resourcemanager", + "resourcesettings", + "retail", + "run", + "scheduler", + "secretmanager", + "securitycenter", + "servicecontrol", + "servicedirectory", + "servicemanagement", + "serviceusage", + "shell", + "spanner", + "speech", + "storage", + "storageinsights", + "storagetransfer", + "support", + "talent", + "tasks", + "texttospeech", + "timeseriesinsights", + "tpu", + "trace", + "translate", + "video", + "videointelligence", + "vision", + "vmmigration", + "vmwareengine", + "vpcaccess", + "webrisk", + "websecurityscanner", + "workflows", + "workstations" +} diff --git a/google-cloud-cpp/2.x/components_2_15_1.py b/google-cloud-cpp/2.x/components_2_15_1.py new file mode 100644 index 0000000..6de02bc --- /dev/null +++ b/google-cloud-cpp/2.x/components_2_15_1.py @@ -0,0 +1,441 @@ +# Automatically generated by /usr/local/google/home/coryan/cci-develop/recipes/google-cloud-cpp/2.x/extract_dependencies.py DO NOT EDIT +DEPENDENCIES = { + "accessapproval_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "accesscontextmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "advisorynotifications_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "aiplatform_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_interval_protos', 'type_money_protos'], + "alloydb_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "apigateway_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "apigeeconnect_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "apikeys_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "appengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "artifactregistry_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "asset_protos": ['accesscontextmanager_protos', 'api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'osconfig_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_expr_protos', 'type_timeofday_protos'], + "assuredworkloads_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "automl_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "baremetalsolution_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "batch_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "beyondcorp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "bigquery_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos', 'type_expr_protos'], + "bigtable_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "billing_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos', 'type_money_protos'], + "binaryauthorization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "certificatemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "channel_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_decimal_protos', 'type_money_protos', 'type_postal_address_protos'], + "cloudbuild_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "commerce_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "cloud_common_common_protos": ['api_field_behavior_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "composer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "confidentialcomputing_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "connectors_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "contactcenterinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "container_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'], + "containeranalysis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "contentwarehouse_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'documentai_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_date_protos', 'type_datetime_protos', 'type_expr_protos', 'type_interval_protos', 'type_money_protos', 'type_postal_address_protos'], + "datacatalog_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "datafusion_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "datamigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "dataplex_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "dataproc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "datastore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "datastream_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "deploy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "dialogflow_cx_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "dialogflow_es_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "discoveryengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "dlp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "documentai_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_date_protos', 'type_datetime_protos', 'type_money_protos', 'type_postal_address_protos'], + "domains_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_money_protos', 'type_postal_address_protos'], + "edgecontainer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "essentialcontacts_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "eventarc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'], + "filestore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'cloud_common_common_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "functions_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "gkebackup_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkehub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkemulticloud_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "grafeas_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "iam_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "iam_v2_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "iap_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "ids_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "kms_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "language_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "logging_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "logging_type_protos": ['grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "managedidentities_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "memcache_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "metastore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos'], + "migrationcenter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_money_protos'], + "monitoring_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_calendar_period_protos'], + "networkconnectivity_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networkmanagement_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networksecurity_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networkservices_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "notebooks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "optimization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "orgpolicy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_expr_protos'], + "osconfig_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "oslogin_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "policysimulator_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_expr_protos'], + "policytroubleshooter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'iam_v2_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "privateca_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "profiler_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "pubsub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "rapidmigrationassessment_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "recaptchaenterprise_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "recommender_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_money_protos'], + "redis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "resourcemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "resourcesettings_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "retail_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "run_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "scheduler_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "secretmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "securitycenter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "servicecontrol_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'protobuf::libprotobuf', 'rpc_context_attribute_context_protos', 'rpc_status_protos'], + "servicedirectory_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "servicemanagement_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_config_change_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_policy_protos', 'api_quota_protos', 'api_resource_protos', 'api_service_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "serviceusage_protos": ['api_annotations_protos', 'api_auth_protos', 'api_client_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "shell_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "spanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "speech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "storage_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos'], + "storageinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos'], + "storagetransfer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_timeofday_protos'], + "support_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "talent_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos', 'type_money_protos', 'type_postal_address_protos', 'type_timeofday_protos'], + "tasks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "texttospeech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "timeseriesinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "tpu_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "trace_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "translate_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "video_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_datetime_protos'], + "videointelligence_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "vision_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_latlng_protos'], + "vmmigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos'], + "vmwareengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "vpcaccess_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "webrisk_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "websecurityscanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "workflows_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "workstations_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "api_annotations_protos": ['api_http_protos'], + "api_auth_protos": ['api_annotations_protos'], + "api_billing_protos": ['api_annotations_protos', 'api_metric_protos'], + "api_client_protos": ['api_launch_stage_protos'], + "api_distribution_protos": ['api_annotations_protos'], + "api_endpoint_protos": ['api_annotations_protos'], + "api_log_protos": ['api_label_protos'], + "api_logging_protos": ['api_annotations_protos', 'api_label_protos'], + "api_metric_protos": ['api_label_protos', 'api_launch_stage_protos'], + "api_monitored_resource_protos": ['api_label_protos', 'api_launch_stage_protos'], + "api_monitoring_protos": ['api_annotations_protos'], + "api_quota_protos": ['api_annotations_protos'], + "api_service_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_resource_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos'], + "api_usage_protos": ['api_annotations_protos', 'api_visibility_protos'], + "iam_credentials_v1_common_protos": ['api_field_behavior_protos', 'api_resource_protos'], + "iam_credentials_v1_iamcredentials_protos": ['api_annotations_protos', 'api_client_protos', 'iam_credentials_v1_common_protos'], + "iam_v1_iam_policy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_resource_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos'], + "iam_v1_options_protos": ['api_annotations_protos'], + "iam_v1_policy_protos": ['api_annotations_protos', 'type_expr_protos'], +} + +PROTO_COMPONENTS = { + "accessapproval_protos", + "accesscontextmanager_protos", + "advisorynotifications_protos", + "aiplatform_protos", + "alloydb_protos", + "api_annotations_protos", + "api_auth_protos", + "api_backend_protos", + "api_billing_protos", + "api_client_protos", + "api_config_change_protos", + "api_context_protos", + "api_control_protos", + "api_distribution_protos", + "api_documentation_protos", + "api_endpoint_protos", + "api_field_behavior_protos", + "api_http_protos", + "api_httpbody_protos", + "api_label_protos", + "api_launch_stage_protos", + "api_log_protos", + "api_logging_protos", + "api_metric_protos", + "api_monitored_resource_protos", + "api_monitoring_protos", + "api_policy_protos", + "api_quota_protos", + "api_resource_protos", + "api_routing_protos", + "api_service_protos", + "api_source_info_protos", + "api_system_parameter_protos", + "api_usage_protos", + "api_visibility_protos", + "apigateway_protos", + "apigeeconnect_protos", + "apikeys_protos", + "appengine_protos", + "artifactregistry_protos", + "asset_protos", + "assuredworkloads_protos", + "automl_protos", + "baremetalsolution_protos", + "batch_protos", + "beyondcorp_protos", + "bigquery_protos", + "bigtable_protos", + "billing_protos", + "binaryauthorization_protos", + "certificatemanager_protos", + "channel_protos", + "cloud_common_common_protos", + "cloudbuild_protos", + "commerce_protos", + "composer_protos", + "confidentialcomputing_protos", + "connectors_protos", + "contactcenterinsights_protos", + "container_protos", + "containeranalysis_protos", + "contentwarehouse_protos", + "datacatalog_protos", + "datafusion_protos", + "datamigration_protos", + "dataplex_protos", + "dataproc_protos", + "datastore_protos", + "datastream_protos", + "deploy_protos", + "devtools_source_v1_source_context_protos", + "dialogflow_cx_protos", + "dialogflow_es_protos", + "discoveryengine_protos", + "dlp_protos", + "documentai_protos", + "domains_protos", + "edgecontainer_protos", + "essentialcontacts_protos", + "eventarc_protos", + "filestore_protos", + "functions_protos", + "gkebackup_protos", + "gkehub_protos", + "gkemulticloud_protos", + "grafeas_protos", + "iam_credentials_v1_common_protos", + "iam_credentials_v1_iamcredentials_protos", + "iam_protos", + "iam_v1_iam_policy_protos", + "iam_v1_options_protos", + "iam_v1_policy_protos", + "iam_v2_protos", + "iap_protos", + "ids_protos", + "kms_protos", + "language_protos", + "logging_protos", + "logging_type_protos", + "logging_type_type_protos", + "longrunning_operations_protos", + "managedidentities_protos", + "memcache_protos", + "metastore_protos", + "migrationcenter_protos", + "monitoring_protos", + "networkconnectivity_protos", + "networkmanagement_protos", + "networksecurity_protos", + "networkservices_protos", + "notebooks_protos", + "optimization_protos", + "orgpolicy_protos", + "osconfig_protos", + "oslogin_protos", + "policysimulator_protos", + "policytroubleshooter_protos", + "privateca_protos", + "profiler_protos", + "pubsub_protos", + "rapidmigrationassessment_protos", + "recaptchaenterprise_protos", + "recommender_protos", + "redis_protos", + "resourcemanager_protos", + "resourcesettings_protos", + "retail_protos", + "rpc_code_protos", + "rpc_context_attribute_context_protos", + "rpc_error_details_protos", + "rpc_status_protos", + "run_protos", + "scheduler_protos", + "secretmanager_protos", + "securitycenter_protos", + "servicecontrol_protos", + "servicedirectory_protos", + "servicemanagement_protos", + "serviceusage_protos", + "shell_protos", + "spanner_protos", + "speech_protos", + "storage_protos", + "storageinsights_protos", + "storagetransfer_protos", + "support_protos", + "talent_protos", + "tasks_protos", + "texttospeech_protos", + "timeseriesinsights_protos", + "tpu_protos", + "trace_protos", + "translate_protos", + "type_calendar_period_protos", + "type_color_protos", + "type_date_protos", + "type_datetime_protos", + "type_dayofweek_protos", + "type_decimal_protos", + "type_expr_protos", + "type_interval_protos", + "type_latlng_protos", + "type_money_protos", + "type_postal_address_protos", + "type_timeofday_protos", + "video_protos", + "videointelligence_protos", + "vision_protos", + "vmmigration_protos", + "vmwareengine_protos", + "vpcaccess_protos", + "webrisk_protos", + "websecurityscanner_protos", + "workflows_protos", + "workstations_protos" +} + +COMPONENTS = { + "accessapproval", + "accesscontextmanager", + "advisorynotifications", + "aiplatform", + "alloydb", + "apigateway", + "apigeeconnect", + "apikeys", + "appengine", + "artifactregistry", + "asset", + "assuredworkloads", + "automl", + "baremetalsolution", + "batch", + "beyondcorp", + "bigquery", + "bigtable", + "billing", + "binaryauthorization", + "certificatemanager", + "channel", + "cloudbuild", + "commerce", + "composer", + "confidentialcomputing", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "contentwarehouse", + "datacatalog", + "datafusion", + "datamigration", + "dataplex", + "dataproc", + "datastore", + "datastream", + "deploy", + "dialogflow_cx", + "dialogflow_es", + "discoveryengine", + "dlp", + "documentai", + "domains", + "edgecontainer", + "essentialcontacts", + "eventarc", + "filestore", + "functions", + "gkebackup", + "gkehub", + "gkemulticloud", + "iam", + "iap", + "ids", + "kms", + "language", + "logging", + "managedidentities", + "memcache", + "metastore", + "migrationcenter", + "monitoring", + "networkconnectivity", + "networkmanagement", + "networksecurity", + "networkservices", + "notebooks", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policysimulator", + "policytroubleshooter", + "privateca", + "profiler", + "pubsub", + "rapidmigrationassessment", + "recaptchaenterprise", + "recommender", + "redis", + "resourcemanager", + "resourcesettings", + "retail", + "run", + "scheduler", + "secretmanager", + "securitycenter", + "servicecontrol", + "servicedirectory", + "servicemanagement", + "serviceusage", + "shell", + "spanner", + "speech", + "storage", + "storageinsights", + "storagetransfer", + "support", + "talent", + "tasks", + "texttospeech", + "timeseriesinsights", + "tpu", + "trace", + "translate", + "video", + "videointelligence", + "vision", + "vmmigration", + "vmwareengine", + "vpcaccess", + "webrisk", + "websecurityscanner", + "workflows", + "workstations" +} diff --git a/google-cloud-cpp/2.x/components_2_19_0.py b/google-cloud-cpp/2.x/components_2_19_0.py new file mode 100644 index 0000000..704bb08 --- /dev/null +++ b/google-cloud-cpp/2.x/components_2_19_0.py @@ -0,0 +1,695 @@ +# Automatically generated by /usr/local/google/home/coryan/cci-develop/recipes/google-cloud-cpp/2.x/extract_dependencies.py DO NOT EDIT +DEPENDENCIES = { + "accessapproval_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "accesscontextmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "advisorynotifications_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "aiplatform_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_interval_protos', 'type_money_protos'], + "alloydb_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "apigateway_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "apigeeconnect_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "apikeys_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "appengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "artifactregistry_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "asset_protos": ['accesscontextmanager_protos', 'api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'osconfig_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_expr_protos', 'type_timeofday_protos'], + "assuredworkloads_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "automl_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "baremetalsolution_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "batch_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "beyondcorp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "bigquery_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos', 'type_expr_protos'], + "bigtable_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "billing_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos', 'type_money_protos'], + "binaryauthorization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "certificatemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "channel_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_decimal_protos', 'type_money_protos', 'type_postal_address_protos'], + "cloudbuild_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "commerce_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "cloud_common_common_protos": ['api_field_behavior_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "composer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "confidentialcomputing_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "config_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "connectors_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "contactcenterinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "container_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'], + "containeranalysis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "contentwarehouse_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'documentai_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_date_protos', 'type_datetime_protos', 'type_expr_protos', 'type_interval_protos', 'type_money_protos', 'type_postal_address_protos'], + "datacatalog_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "datafusion_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "datamigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "dataplex_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "dataproc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_interval_protos'], + "datastore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "datastream_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "deploy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "dialogflow_cx_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "dialogflow_es_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "discoveryengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "dlp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "documentai_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_date_protos', 'type_datetime_protos', 'type_money_protos', 'type_postal_address_protos'], + "domains_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_money_protos', 'type_postal_address_protos'], + "edgecontainer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "edgenetwork_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "essentialcontacts_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "eventarc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'], + "filestore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'cloud_common_common_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "functions_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "gkebackup_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkehub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkemulticloud_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "grafeas_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "iam_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "iam_v2_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "iap_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "ids_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "kms_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "language_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "logging_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "logging_type_protos": ['grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "managedidentities_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "memcache_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "metastore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos'], + "migrationcenter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_money_protos'], + "monitoring_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_calendar_period_protos'], + "netapp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networkconnectivity_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networkmanagement_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networksecurity_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networkservices_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "notebooks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "optimization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "orgpolicy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_expr_protos'], + "osconfig_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "oslogin_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "policysimulator_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_expr_protos'], + "policytroubleshooter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'iam_v2_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "privateca_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "profiler_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "pubsub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "rapidmigrationassessment_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "recaptchaenterprise_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "recommender_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_money_protos'], + "redis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "resourcemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "resourcesettings_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "retail_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "run_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "scheduler_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "secretmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "securesourcemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "securitycenter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "servicecontrol_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'protobuf::libprotobuf', 'rpc_context_attribute_context_protos', 'rpc_status_protos'], + "servicedirectory_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "servicemanagement_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_config_change_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_policy_protos', 'api_quota_protos', 'api_resource_protos', 'api_service_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "serviceusage_protos": ['api_annotations_protos', 'api_auth_protos', 'api_client_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_resource_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "shell_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "spanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "speech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "sql_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "storage_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos'], + "storageinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos'], + "storagetransfer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_timeofday_protos'], + "support_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "talent_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos', 'type_money_protos', 'type_postal_address_protos', 'type_timeofday_protos'], + "tasks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "telcoautomation_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "texttospeech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "timeseriesinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "tpu_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "trace_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "translate_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "video_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_datetime_protos'], + "videointelligence_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "vision_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_latlng_protos'], + "vmmigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos'], + "vmwareengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "vpcaccess_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "webrisk_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "websecurityscanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "workflows_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "workstations_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "api_annotations_protos": ['api_http_protos'], + "api_auth_protos": ['api_annotations_protos'], + "api_billing_protos": ['api_annotations_protos', 'api_metric_protos'], + "api_client_protos": ['api_launch_stage_protos'], + "api_distribution_protos": ['api_annotations_protos'], + "api_endpoint_protos": ['api_annotations_protos'], + "api_log_protos": ['api_label_protos'], + "api_logging_protos": ['api_annotations_protos', 'api_label_protos'], + "api_metric_protos": ['api_label_protos', 'api_launch_stage_protos'], + "api_monitored_resource_protos": ['api_label_protos', 'api_launch_stage_protos'], + "api_monitoring_protos": ['api_annotations_protos'], + "api_quota_protos": ['api_annotations_protos'], + "api_service_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_resource_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos'], + "api_usage_protos": ['api_annotations_protos', 'api_visibility_protos'], + "iam_credentials_v1_common_protos": ['api_field_behavior_protos', 'api_resource_protos'], + "iam_credentials_v1_iamcredentials_protos": ['api_annotations_protos', 'api_client_protos', 'iam_credentials_v1_common_protos'], + "iam_v1_iam_policy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_resource_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos'], + "iam_v1_options_protos": ['api_annotations_protos'], + "iam_v1_policy_protos": ['api_annotations_protos', 'type_expr_protos'], + "compute_internal_protos": ["protobuf::libprotobuf"], + "cloud_extended_operations_protos": ["protobuf::libprotobuf"], + "compute_accelerator_types_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_addresses_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_autoscalers_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_backend_buckets_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_backend_services_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_disk_types_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_disks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_external_vpn_gateways_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_firewall_policies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_firewalls_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_forwarding_rules_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_global_addresses_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_global_forwarding_rules_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_global_network_endpoint_groups_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_global_operations_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_global_organization_operations_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_global_public_delegated_prefixes_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_health_checks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_http_health_checks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_https_health_checks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_image_family_views_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_images_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_instance_group_managers_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_instance_groups_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_instance_templates_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_instances_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_interconnect_attachments_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_interconnect_locations_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_interconnects_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_license_codes_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_licenses_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_machine_images_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_machine_types_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_network_attachments_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_network_edge_security_services_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_network_endpoint_groups_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_network_firewall_policies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_networks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_node_groups_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_node_templates_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_node_types_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_packet_mirrorings_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_projects_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_public_advertised_prefixes_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_public_delegated_prefixes_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_autoscalers_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_backend_services_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_commitments_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_disk_types_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_disks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_health_check_services_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_health_checks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_instance_group_managers_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_instance_groups_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_instance_templates_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_instances_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_network_endpoint_groups_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_network_firewall_policies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_notification_endpoints_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_operations_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_security_policies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_ssl_certificates_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_ssl_policies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_subnetworks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_grpc_proxies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_http_proxies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_https_proxies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_instances_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_pools_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_ssl_proxies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_tcp_proxies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_vpn_gateways_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_url_maps_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_vpn_gateways_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_vpn_tunnels_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_zone_operations_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_zones_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], +} + +PROTO_COMPONENTS = { + "accessapproval_protos", + "accesscontextmanager_protos", + "advisorynotifications_protos", + "aiplatform_protos", + "alloydb_protos", + "api_annotations_protos", + "api_auth_protos", + "api_backend_protos", + "api_billing_protos", + "api_client_protos", + "api_config_change_protos", + "api_context_protos", + "api_control_protos", + "api_distribution_protos", + "api_documentation_protos", + "api_endpoint_protos", + "api_field_behavior_protos", + "api_http_protos", + "api_httpbody_protos", + "api_label_protos", + "api_launch_stage_protos", + "api_log_protos", + "api_logging_protos", + "api_metric_protos", + "api_monitored_resource_protos", + "api_monitoring_protos", + "api_policy_protos", + "api_quota_protos", + "api_resource_protos", + "api_routing_protos", + "api_service_protos", + "api_source_info_protos", + "api_system_parameter_protos", + "api_usage_protos", + "api_visibility_protos", + "apigateway_protos", + "apigeeconnect_protos", + "apikeys_protos", + "appengine_protos", + "artifactregistry_protos", + "asset_protos", + "assuredworkloads_protos", + "automl_protos", + "baremetalsolution_protos", + "batch_protos", + "beyondcorp_protos", + "bigquery_protos", + "bigtable_protos", + "billing_protos", + "binaryauthorization_protos", + "certificatemanager_protos", + "channel_protos", + "cloud_common_common_protos", + "cloud_extended_operations_protos", + "cloudbuild_protos", + "commerce_protos", + "composer_protos", + "compute_accelerator_types_protos", + "compute_addresses_protos", + "compute_autoscalers_protos", + "compute_backend_buckets_protos", + "compute_backend_services_protos", + "compute_disk_types_protos", + "compute_disks_protos", + "compute_external_vpn_gateways_protos", + "compute_firewall_policies_protos", + "compute_firewalls_protos", + "compute_forwarding_rules_protos", + "compute_global_addresses_protos", + "compute_global_forwarding_rules_protos", + "compute_global_network_endpoint_groups_protos", + "compute_global_operations_protos", + "compute_global_organization_operations_protos", + "compute_global_public_delegated_prefixes_protos", + "compute_health_checks_protos", + "compute_http_health_checks_protos", + "compute_https_health_checks_protos", + "compute_image_family_views_protos", + "compute_images_protos", + "compute_instance_group_managers_protos", + "compute_instance_groups_protos", + "compute_instance_templates_protos", + "compute_instances_protos", + "compute_interconnect_attachments_protos", + "compute_interconnect_locations_protos", + "compute_interconnects_protos", + "compute_internal_protos", + "compute_license_codes_protos", + "compute_licenses_protos", + "compute_machine_images_protos", + "compute_machine_types_protos", + "compute_network_attachments_protos", + "compute_network_edge_security_services_protos", + "compute_network_endpoint_groups_protos", + "compute_network_firewall_policies_protos", + "compute_networks_protos", + "compute_node_groups_protos", + "compute_node_templates_protos", + "compute_node_types_protos", + "compute_packet_mirrorings_protos", + "compute_projects_protos", + "compute_public_advertised_prefixes_protos", + "compute_public_delegated_prefixes_protos", + "compute_region_autoscalers_protos", + "compute_region_backend_services_protos", + "compute_region_commitments_protos", + "compute_region_disk_types_protos", + "compute_region_disks_protos", + "compute_region_health_check_services_protos", + "compute_region_health_checks_protos", + "compute_region_instance_group_managers_protos", + "compute_region_instance_groups_protos", + "compute_region_instance_templates_protos", + "compute_region_instances_protos", + "compute_region_network_endpoint_groups_protos", + "compute_region_network_firewall_policies_protos", + "compute_region_notification_endpoints_protos", + "compute_region_operations_protos", + "compute_region_security_policies_protos", + "compute_region_ssl_certificates_protos", + "compute_ssl_policies_protos", + "compute_subnetworks_protos", + "compute_target_grpc_proxies_protos", + "compute_target_http_proxies_protos", + "compute_target_https_proxies_protos", + "compute_target_instances_protos", + "compute_target_pools_protos", + "compute_target_ssl_proxies_protos", + "compute_target_tcp_proxies_protos", + "compute_target_vpn_gateways_protos", + "compute_url_maps_protos", + "compute_vpn_gateways_protos", + "compute_vpn_tunnels_protos", + "compute_zone_operations_protos", + "compute_zones_protos", + "confidentialcomputing_protos", + "config_protos", + "connectors_protos", + "contactcenterinsights_protos", + "container_protos", + "containeranalysis_protos", + "contentwarehouse_protos", + "datacatalog_protos", + "datafusion_protos", + "datamigration_protos", + "dataplex_protos", + "dataproc_protos", + "datastore_protos", + "datastream_protos", + "deploy_protos", + "devtools_source_v1_source_context_protos", + "dialogflow_cx_protos", + "dialogflow_es_protos", + "discoveryengine_protos", + "dlp_protos", + "documentai_protos", + "domains_protos", + "edgecontainer_protos", + "edgenetwork_protos", + "essentialcontacts_protos", + "eventarc_protos", + "filestore_protos", + "functions_protos", + "gkebackup_protos", + "gkehub_protos", + "gkemulticloud_protos", + "grafeas_protos", + "iam_credentials_v1_common_protos", + "iam_credentials_v1_iamcredentials_protos", + "iam_protos", + "iam_v1_iam_policy_protos", + "iam_v1_options_protos", + "iam_v1_policy_protos", + "iam_v2_protos", + "iap_protos", + "ids_protos", + "kms_protos", + "language_protos", + "logging_protos", + "logging_type_protos", + "logging_type_type_protos", + "longrunning_operations_protos", + "managedidentities_protos", + "memcache_protos", + "metastore_protos", + "migrationcenter_protos", + "monitoring_protos", + "netapp_protos", + "networkconnectivity_protos", + "networkmanagement_protos", + "networksecurity_protos", + "networkservices_protos", + "notebooks_protos", + "optimization_protos", + "orgpolicy_protos", + "osconfig_protos", + "oslogin_protos", + "policysimulator_protos", + "policytroubleshooter_protos", + "privateca_protos", + "profiler_protos", + "pubsub_protos", + "rapidmigrationassessment_protos", + "recaptchaenterprise_protos", + "recommender_protos", + "redis_protos", + "resourcemanager_protos", + "resourcesettings_protos", + "retail_protos", + "rpc_code_protos", + "rpc_context_attribute_context_protos", + "rpc_error_details_protos", + "rpc_status_protos", + "run_protos", + "scheduler_protos", + "secretmanager_protos", + "securesourcemanager_protos", + "securitycenter_protos", + "servicecontrol_protos", + "servicedirectory_protos", + "servicemanagement_protos", + "serviceusage_protos", + "shell_protos", + "spanner_protos", + "speech_protos", + "sql_protos", + "storage_protos", + "storageinsights_protos", + "storagetransfer_protos", + "support_protos", + "talent_protos", + "tasks_protos", + "telcoautomation_protos", + "texttospeech_protos", + "timeseriesinsights_protos", + "tpu_protos", + "trace_protos", + "translate_protos", + "type_calendar_period_protos", + "type_color_protos", + "type_date_protos", + "type_datetime_protos", + "type_dayofweek_protos", + "type_decimal_protos", + "type_expr_protos", + "type_interval_protos", + "type_latlng_protos", + "type_money_protos", + "type_postal_address_protos", + "type_timeofday_protos", + "video_protos", + "videointelligence_protos", + "vision_protos", + "vmmigration_protos", + "vmwareengine_protos", + "vpcaccess_protos", + "webrisk_protos", + "websecurityscanner_protos", + "workflows_protos", + "workstations_protos" +} + +COMPONENTS = { + "accessapproval", + "accesscontextmanager", + "advisorynotifications", + "aiplatform", + "alloydb", + "apigateway", + "apigeeconnect", + "apikeys", + "appengine", + "artifactregistry", + "asset", + "assuredworkloads", + "automl", + "baremetalsolution", + "batch", + "beyondcorp", + "bigquery", + "bigtable", + "billing", + "binaryauthorization", + "certificatemanager", + "channel", + "cloudbuild", + "commerce", + "composer", + "compute_accelerator_types", + "compute_addresses", + "compute_autoscalers", + "compute_backend_buckets", + "compute_backend_services", + "compute_disk_types", + "compute_disks", + "compute_external_vpn_gateways", + "compute_firewall_policies", + "compute_firewalls", + "compute_forwarding_rules", + "compute_global_addresses", + "compute_global_forwarding_rules", + "compute_global_network_endpoint_groups", + "compute_global_operations", + "compute_global_organization_operations", + "compute_global_public_delegated_prefixes", + "compute_health_checks", + "compute_http_health_checks", + "compute_https_health_checks", + "compute_image_family_views", + "compute_images", + "compute_instance_group_managers", + "compute_instance_groups", + "compute_instance_templates", + "compute_instances", + "compute_interconnect_attachments", + "compute_interconnect_locations", + "compute_interconnects", + "compute_license_codes", + "compute_licenses", + "compute_machine_images", + "compute_machine_types", + "compute_network_attachments", + "compute_network_edge_security_services", + "compute_network_endpoint_groups", + "compute_network_firewall_policies", + "compute_networks", + "compute_node_groups", + "compute_node_templates", + "compute_node_types", + "compute_packet_mirrorings", + "compute_projects", + "compute_public_advertised_prefixes", + "compute_public_delegated_prefixes", + "compute_region_autoscalers", + "compute_region_backend_services", + "compute_region_commitments", + "compute_region_disk_types", + "compute_region_disks", + "compute_region_health_check_services", + "compute_region_health_checks", + "compute_region_instance_group_managers", + "compute_region_instance_groups", + "compute_region_instance_templates", + "compute_region_instances", + "compute_region_network_endpoint_groups", + "compute_region_network_firewall_policies", + "compute_region_notification_endpoints", + "compute_region_operations", + "compute_region_security_policies", + "compute_region_ssl_certificates", + "compute_ssl_policies", + "compute_subnetworks", + "compute_target_grpc_proxies", + "compute_target_http_proxies", + "compute_target_https_proxies", + "compute_target_instances", + "compute_target_pools", + "compute_target_ssl_proxies", + "compute_target_tcp_proxies", + "compute_target_vpn_gateways", + "compute_url_maps", + "compute_vpn_gateways", + "compute_vpn_tunnels", + "compute_zone_operations", + "compute_zones", + "confidentialcomputing", + "config", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "contentwarehouse", + "datacatalog", + "datafusion", + "datamigration", + "dataplex", + "dataproc", + "datastore", + "datastream", + "deploy", + "dialogflow_cx", + "dialogflow_es", + "discoveryengine", + "dlp", + "documentai", + "domains", + "edgecontainer", + "edgenetwork", + "essentialcontacts", + "eventarc", + "filestore", + "functions", + "gkebackup", + "gkehub", + "gkemulticloud", + "iam", + "iap", + "ids", + "kms", + "language", + "logging", + "managedidentities", + "memcache", + "metastore", + "migrationcenter", + "monitoring", + "netapp", + "networkconnectivity", + "networkmanagement", + "networksecurity", + "networkservices", + "notebooks", + "oauth2", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policysimulator", + "policytroubleshooter", + "privateca", + "profiler", + "pubsub", + "rapidmigrationassessment", + "recaptchaenterprise", + "recommender", + "redis", + "resourcemanager", + "resourcesettings", + "retail", + "run", + "scheduler", + "secretmanager", + "securesourcemanager", + "securitycenter", + "servicecontrol", + "servicedirectory", + "servicemanagement", + "serviceusage", + "shell", + "spanner", + "speech", + "sql", + "storage", + "storageinsights", + "storagetransfer", + "support", + "talent", + "tasks", + "telcoautomation", + "texttospeech", + "timeseriesinsights", + "tpu", + "trace", + "translate", + "video", + "videointelligence", + "vision", + "vmmigration", + "vmwareengine", + "vpcaccess", + "webrisk", + "websecurityscanner", + "workflows", + "workstations" +} diff --git a/google-cloud-cpp/2.x/conandata.yml b/google-cloud-cpp/2.x/conandata.yml new file mode 100644 index 0000000..79eb43c --- /dev/null +++ b/google-cloud-cpp/2.x/conandata.yml @@ -0,0 +1,26 @@ +sources: + "2.12.0": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.12.0.tar.gz" + sha256: "8cda870803925c62de8716a765e03eb9d34249977e5cdb7d0d20367e997a55e2" + "2.15.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.15.1.tar.gz" + sha256: "47a5c6beff48625fa1b65b1ddc575247def80c88d29062c66d463172280d3959" + "2.19.0": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.19.0.tar.gz" + sha256: "63f009092afd900cb812050bcecf607e37d762ac911e0bcbf4af9a432da91890" +patches: + "2.12.0": + - patch_file: "patches/2.12.0/001-use-conan-msvc-runtime.patch" + patch_description: "Let Conan select the MSVC runtime" + patch_type: conan + "2.15.1": + - patch_file: "patches/2.15.1/001-use-conan-msvc-runtime.patch" + patch_description: "Let Conan select the MSVC runtime" + patch_type: conan + "2.19.0": + - patch_file: "patches/2.19.0/001-use-conan-msvc-runtime.patch" + patch_description: "Let Conan select the MSVC runtime" + patch_type: conan + - patch_file: "patches/2.19.0/002-add-find-package-threads.patch" + patch_description: "Missing find_package() in CMake files" + patch_type: conan diff --git a/google-cloud-cpp/2.x/conanfile.py b/google-cloud-cpp/2.x/conanfile.py new file mode 100644 index 0000000..18e1843 --- /dev/null +++ b/google-cloud-cpp/2.x/conanfile.py @@ -0,0 +1,387 @@ +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +# Load the generated component dependency information. +# +# `google-cloud-cpp` has well over 200 components. Conan cannot use the CMake +# files generated by `google-cloud-cpp`. Manually maintaining this dependency +# information is error prone and fairly tedious. A helper script in this +# directory reproduces the algorithms used by `google-cloud-cpp` to generate its +# dependency information. With each new revision of `google-cloud-cpp` the +# script will be used to generate a new file with the component dependency +# information. The expectation is that maintaining this script will be easier +# than writing long lists of dependencies by hand. +import components_2_12_0 +import components_2_15_1 +import components_2_19_0 + +required_conan_version = ">=1.56.0" + + +class GoogleCloudCppConan(ConanFile): + name = "google-cloud-cpp" + description = "C++ Client Libraries for Google Cloud Services" + license = "Apache-2.0" + topics = ( + "google", + "cloud", + "google-cloud-storage", + "google-cloud-platform", + "google-cloud-pubsub", + "google-cloud-spanner", + "google-cloud-bigtable", + ) + homepage = "https://github.com/googleapis/google-cloud-cpp" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + exports = ["components_2_12_0.py", + "components_2_15_1.py", + "components_2_19_0.py", + ] + + short_paths = True + + _GA_COMPONENTS = { + '2.12.0': components_2_12_0.COMPONENTS, + '2.15.1': components_2_15_1.COMPONENTS, + '2.19.0': components_2_19_0.COMPONENTS, + } + _PROTO_COMPONENTS = { + '2.12.0': components_2_12_0.PROTO_COMPONENTS, + '2.15.1': components_2_15_1.PROTO_COMPONENTS, + '2.19.0': components_2_19_0.PROTO_COMPONENTS, + } + _PROTO_COMPONENT_DEPENDENCIES = { + "2.12.0": components_2_12_0.DEPENDENCIES, + "2.15.1": components_2_15_1.DEPENDENCIES, + "2.19.0": components_2_19_0.DEPENDENCIES, + } + # Some components require custom dependency definitions. + _REQUIRES_CUSTOM_DEPENDENCIES = { + "bigquery", "bigtable", "iam", "oauth2", "pubsub", "spanner", "storage", + } + + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.options["protobuf"].shared = True + self.options["grpc"].shared = True + + def validate(self): + # As-of 2022-03, google-cloud-cpp only supports "Visual Studio >= 2019", + # and Visual Studio < 2019 is out of mainline support. + # The wikipedia page says this maps to 192* for the MSVC version: + # https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B + check_min_vs(self, "192") + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") + + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration( + "Recipe not prepared for cross-building (yet)" + ) + + if str(self.version) not in self._GA_COMPONENTS: + print(f"{type(self.version)} {self.version}") + raise ConanInvalidConfiguration( + f"The components are unknown for version {self.version}. Expected one of {self._GA_COMPONENTS.keys()}" + ) + + if str(self.version) not in self._PROTO_COMPONENTS: + raise ConanInvalidConfiguration( + f"The proto components are unknown for version {self.version}. Expected one of {self._PROTO_COMPONENTS.keys()}" + ) + + if str(self.version) not in self._PROTO_COMPONENT_DEPENDENCIES: + raise ConanInvalidConfiguration( + f"The inter-component components are unknown for version {self.version}. Expected one of {self._PROTO_COMPONENT_DEPENDENCIES.keys()}" + ) + + if ( + self.settings.compiler == "clang" + and Version(self.settings.compiler.version) < "6.0" + ): + raise ConanInvalidConfiguration("Clang version must be at least 6.0.") + + if self.settings.compiler.cppstd: + check_min_cppstd(self, 14) + + if ( + self.settings.compiler == "gcc" + and Version(self.settings.compiler.version) < "5.4" + ): + raise ConanInvalidConfiguration("Building requires GCC >= 5.4") + + if self.info.options.shared and \ + (not self.dependencies["protobuf"].options.shared or \ + not self.dependencies["grpc"].options.shared): + raise ConanInvalidConfiguration( + "If built as shared, protobuf, and grpc must be shared as well." + " Please, use `protobuf/*:shared=True`, and `grpc/*:shared=True`.") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def requirements(self): + # These must remain pinned in conan index. + self.requires("protobuf/3.21.12", transitive_headers=True) + self.requires("abseil/20230125.3", transitive_headers=True) + self.requires("grpc/1.54.3", transitive_headers=True) + self.requires("nlohmann_json/3.11.3") + self.requires("crc32c/1.1.2") + # The rest require less pinning. + self.requires("libcurl/[>=7.78 <9]") + self.requires("openssl/[>=1.1 <4]") + self.requires("zlib/[>=1.2.11 <2]") + + def build_requirements(self): + # For the `grpc-cpp-plugin` executable, and indirectly `protoc` + if not self._is_legacy_one_profile: + self.tool_requires("grpc/") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK"] = False + tc.variables["GOOGLE_CLOUD_CPP_ENABLE_WERROR"] = False + tc.variables["GOOGLE_CLOUD_CPP_ENABLE"] = ",".join(self._components()) + tc.generate() + VirtualBuildEnv(self).generate() + if self._is_legacy_one_profile: + VirtualRunEnv(self).generate(scope="build") + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # This was informed by comments in the grpc port. On macOS `Make` will + # run commands via `/bin/sh`. `/bin/sh` is subject to System Integrity + # Protections. In particular, the system will purge the DYLD_LIBRARY_PATH + # enviroment variables: + # https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html + settings_build = getattr(self, "settings_build", self.settings) + if settings_build.os == "Macos": + if Version(self.version) < '2.12.0': + replace_in_file(self, os.path.join(self.source_folder, "cmake/CompileProtos.cmake"), + "$", + '${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}" $') + else: + replace_in_file(self, os.path.join(self.source_folder, "cmake/CompileProtos.cmake"), + "${Protobuf_PROTOC_EXECUTABLE} ARGS", + '${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}" ${Protobuf_PROTOC_EXECUTABLE} ARGS') + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def _generate_proto_requires(self, component): + deps = self._PROTO_COMPONENT_DEPENDENCIES.get(self.version, dict()) + return deps.get(component, []) + + _SKIPPED_COMPONENTS = { + # Some protos do not compile due to inconvenient system macros clashing + # with proto enum values. Protobuf can workaround these problems, but + # the current version in Conan index (protobuf/3.21.4) do not contain + # the fixes for these cases. + # TODO - review after protobuf >= 4.23.x + 'asset', + 'channel', + 'storagetransfer', + # TODO - certificatemanager crashes the gRPC code generator. Add it back + # after gRPC >= 1.53.x + 'certificatemanager', + } + + def _components(self): + result = self._GA_COMPONENTS.get(str(self.version), []).copy() + for c in self._SKIPPED_COMPONENTS: + result.remove(c) + # TODO - these do not build on Android due to conflicts between OS + # macros and Proto enums. Revisit after Protobuf >= 4.23.x + if self.settings.os == "Android": + result.remove('accesscontextmanager') + result.remove('talent') + return result + + def _proto_components(self): + result = self._PROTO_COMPONENTS.get(self.version, []).copy() + for c in self._SKIPPED_COMPONENTS: + result.remove(c + '_protos') + # TODO - these do not build on Android due to conflicts between OS + # macros and Proto enums. Revisit after Protobuf >= 4.23.x + if self.settings.os == "Android": + result.remove('accesscontextmanager_protos') + result.remove('talent_protos') + if Version(self.version) >= '2.15.1': + # This was converted to an interface library starting on 2.15.1 + result.remove('logging_type_type_protos') + # These were removed (as they are not used) starting on 2.15.1 + result.remove('devtools_source_v1_source_context_protos') + return result + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, path=os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, path=os.path.join(self.package_folder, "lib", "pkgconfig")) + + def _add_proto_component(self, component): + self.cpp_info.components[component].requires = self._generate_proto_requires(component) + self.cpp_info.components[component].libs = [f"google_cloud_cpp_{component}"] + self.cpp_info.components[component].names["pkg_config"] = f"google_cloud_cpp_{component}" + + def _add_grpc_component(self, component, protos, extra=None): + SHARED_REQUIRES=["grpc_utils", "common", "grpc::grpc++", "grpc::_grpc", "protobuf::libprotobuf", "abseil::absl_memory"] + self.cpp_info.components[component].requires = (extra or []) + [protos] + SHARED_REQUIRES + self.cpp_info.components[component].libs = [f"google_cloud_cpp_{component}"] + self.cpp_info.components[component].names["pkg_config"] = f"google_cloud_cpp_{component}" + + # The compute librar(ies) do not use gRPC, and they have many components + # with dependencies between them + def _add_compute_component(self, component, protos): + SHARED_REQUIRES=["rest_protobuf_internal", "rest_internal", "common"] + # Common components shared by other compute components + COMPUTE_COMMON_COMPONENTS = [ + 'compute_global_operations', + 'compute_global_organization_operations', + 'compute_region_operations', + 'compute_zone_operations', + ] + requires = [protos] + if component not in COMPUTE_COMMON_COMPONENTS: + requires = requires + COMPUTE_COMMON_COMPONENTS + self.cpp_info.components[component].requires = requires + SHARED_REQUIRES + self.cpp_info.components[component].libs = [f"google_cloud_cpp_{component}"] + self.cpp_info.components[component].names["pkg_config"] = f"google_cloud_cpp_{component}" + + def package_info(self): + self.cpp_info.components["common"].requires = ["abseil::absl_any", "abseil::absl_flat_hash_map", "abseil::absl_memory", "abseil::absl_optional", "abseil::absl_time"] + self.cpp_info.components["common"].libs = ["google_cloud_cpp_common"] + self.cpp_info.components["common"].names["pkg_config"] = "google_cloud_cpp_common" + + self.cpp_info.components["rest_internal"].requires = ["common", "libcurl::libcurl", "openssl::ssl", "openssl::crypto", "zlib::zlib"] + self.cpp_info.components["rest_internal"].libs = ["google_cloud_cpp_rest_internal"] + self.cpp_info.components["rest_internal"].names["pkg_config"] = "google_cloud_cpp_rest_internal" + + # A small number of gRPC-generated stubs are used directly in the common components + # shared by all gRPC-based libraries. These must be defined without reference to `grpc_utils`. + if Version(self.version) >= '2.15.1': + GRPC_UTILS_REQUIRED_PROTOS = { + "iam_credentials_v1_iamcredentials_protos", + "iam_v1_policy_protos", + "longrunning_operations_protos", + "rpc_error_details_protos", + "rpc_status_protos", + } + else: + GRPC_UTILS_REQUIRED_PROTOS = { + "iam_protos", + "longrunning_operations_protos", + "rpc_error_details_protos", + "rpc_status_protos", + } + for component in GRPC_UTILS_REQUIRED_PROTOS: + self._add_proto_component(component) + + self.cpp_info.components["grpc_utils"].requires = list(GRPC_UTILS_REQUIRED_PROTOS) + ["common", "abseil::absl_function_ref", "abseil::absl_memory", "abseil::absl_time", "grpc::grpc++", "grpc::_grpc"] + self.cpp_info.components["grpc_utils"].libs = ["google_cloud_cpp_grpc_utils"] + self.cpp_info.components["grpc_utils"].names["pkg_config"] = "google_cloud_cpp_grpc_utils" + + for component in self._proto_components(): + if Version(self.version) >= '2.15.1' and component == 'storage_protos': + # Starting with v2.15.1 the `storage_protos` are compiled only + # when needed. They are not used in Conan because they are only + # needed for an experimental library, supporting an allow-listed + # service. + continue + if component not in GRPC_UTILS_REQUIRED_PROTOS: + self._add_proto_component(component) + + # Interface libraries for backwards compatibility + if Version(self.version) < '2.15.1': + self.cpp_info.components["dialogflow_es_protos"].requires = ["cloud_dialogflow_v2_protos"] + self.cpp_info.components["logging_type_protos"].requires = ["logging_type_type_protos"] + self.cpp_info.components["speech_protos"].requires = ["cloud_speech_protos"] + self.cpp_info.components["texttospeech_protos"].requires = ["cloud_texttospeech_protos"] + self.cpp_info.components["trace_protos"].requires = [ + "devtools_cloudtrace_v2_trace_protos", + "devtools_cloudtrace_v2_tracing_protos", + ] + self._add_grpc_component("bigquery", "cloud_bigquery_protos") + else: + self.cpp_info.components["cloud_bigquery_protos"].requires = ["bigquery_protos"] + self.cpp_info.components["cloud_dialogflow_v2_protos"].requires = ["dialogflow_es_protos"] + self.cpp_info.components["cloud_speech_protos"].requires = ["speech_protos"] + self.cpp_info.components["cloud_texttospeech_protos"].requires = ["texttospeech_protos"] + self.cpp_info.components["devtools_cloudtrace_v2_trace_protos"].requires = ["trace_protos"] + self.cpp_info.components["devtools_cloudtrace_v2_tracing_protos"].requires = ["trace_protos"] + self.cpp_info.components["logging_type_type_protos"].requires = ["logging_type_protos"] + + for component in self._components(): + protos=f"{component}_protos" + # bigquery proto library predates the adoption of more consistent naming + if component == 'bigquery' and Version(self.version) < '2.15.1': + self._add_proto_component("cloud_bigquery_protos") + self._add_grpc_component(component, "cloud_bigquery_protos") + continue + if component == 'dialogflow_es' and Version(self.version) < '2.15.1': + self._add_proto_component("cloud_dialogflow_v2_protos") + self._add_grpc_component(component, "cloud_dialogflow_v2_protos") + continue + # `compute` components do not depend on gRPC + if component.startswith("compute_"): + self._add_compute_component(component, protos) + continue + # `storage` is the only component that does not depend on a matching `*_protos` library + if component in self._REQUIRES_CUSTOM_DEPENDENCIES: + continue + self._add_grpc_component(component, protos) + + self._add_grpc_component("bigtable", "bigtable_protos") + self._add_grpc_component("iam", "iam_protos") + self._add_grpc_component("pubsub", "pubsub_protos", ["abseil::absl_flat_hash_map"]) + self._add_grpc_component("spanner", "spanner_protos", ["abseil::absl_fixed_array", "abseil::absl_numeric", "abseil::absl_strings", "abseil::absl_time"]) + + if Version(self.version) >= '2.19.0': + self.cpp_info.components["rest_protobuf_internal"].requires = ["rest_internal", "grpc_utils", "common"] + self.cpp_info.components["rest_protobuf_internal"].libs = ["google_cloud_cpp_rest_protobuf_internal"] + self.cpp_info.components["rest_protobuf_internal"].names["pkg_config"] = "google_cloud_cpp_rest_protobuf_internal" + # The `google-cloud-cpp::compute` interface library groups all the compute + # libraries in a single target. + self.cpp_info.components["compute"].requires = [c for c in self._components() if c.startswith("compute_")] + # The `google-cloud-cpp::oauth2` library does not depend on gRPC or any protos. + self.cpp_info.components["oauth2"].requires = ["rest_internal", "common", "nlohmann_json::nlohmann_json", "libcurl::libcurl", "openssl::ssl", "openssl::crypto", "zlib::zlib"] + self.cpp_info.components["oauth2"].libs = ["google_cloud_cpp_oauth2"] + self.cpp_info.components["oauth2"].names["pkg_config"] = "google_cloud_cpp_oauth2" + + self.cpp_info.components["storage"].requires = ["rest_internal", "common", "nlohmann_json::nlohmann_json", "abseil::absl_memory", "abseil::absl_strings", "abseil::absl_str_format", "abseil::absl_time", "abseil::absl_variant", "crc32c::crc32c", "libcurl::libcurl", "openssl::ssl", "openssl::crypto", "zlib::zlib"] + self.cpp_info.components["storage"].libs = ["google_cloud_cpp_storage"] + self.cpp_info.components["storage"].names["pkg_config"] = "google_cloud_cpp_storage" diff --git a/google-cloud-cpp/2.x/extract_dependencies.py b/google-cloud-cpp/2.x/extract_dependencies.py new file mode 100755 index 0000000..95720c5 --- /dev/null +++ b/google-cloud-cpp/2.x/extract_dependencies.py @@ -0,0 +1,287 @@ +#!/usr/bin/env python3 + +import argparse +import glob +import os + +"""Extract google-cloud-cpp's component dependency info for use in Conan. + +google-cloud-cpp builds a number (about 100) of libraries from proto files. +These libraries have dependencies between them. In Conan, one cannot use the +dependencies preserved in the *-config.cmake files generated by the package, so +we have to reconstruct the dependencies here. + +Fortunately, google-cloud-cpp uses a number of *.deps files to keep these +dependencies. We just need to reimplement their algorithm to load these files +and convert them to CMake dependencies. + +The *.deps files themselves are generated (and committed to GitHub) from +Bazel rules. +""" + +# Used in _generate_proto_requires(): common requirements +_PROTO_DEPS_COMMON_REQUIRES = {"grpc::grpc++", "grpc::_grpc", "protobuf::libprotobuf"} + +# Used in _generate_proto_requires(): the *.deps files are generated from +# Bazel and contain a few targets that do not exit (nor do they need to +# exist) in CMake. +_PROTO_DEPS_REMOVED_TARGETS = { + "cloud_kms_v1_kms_protos", + "cloud_orgpolicy_v1_orgpolicy_protos", + "cloud_oslogin_common_common_protos", + "cloud_recommender_v1_recommender_protos", + "identity_accesscontextmanager_type_type_protos", +} + +# Used in _generate_proto_requires(): the *.deps files are generated from +# Bazel and contain a few targets that have incorrect names for CMake. +_PROTO_DEPS_REPLACED_TARGETS = { + "grafeas_v1_grafeas_protos": "grafeas_protos", + "identity_accesscontextmanager_v1_accesscontextmanager_protos": "accesscontextmanager_protos", + "cloud_osconfig_v1_osconfig_protos": "osconfig_protos", + "devtools_source_v1_source_protos": "devtools_source_v1_source_context_protos", + "cloud_documentai_v1_documentai_protos": "documentai_protos", + "iam_v2_policy_protos": "iam_v2_protos", +} + +# A few *.deps files use ad-hoc naming. +_PROTO_DEPS_REPLACED_NAMES = { + "common": "cloud_common_common", +} + +# A few *.deps files are not used. +_PROTO_DEPS_UNUSED = { + "iam_policy", +} + +# A few _protos libraries were introduced before `google-cloud-cpp` adopted +# more consistent naming. +_PROTO_BASE_COMPONENTS = { + "api_service_protos", + "api_visibility_protos", + "api_monitoring_protos", + "type_date_protos", + "api_control_protos", + "api_client_protos", + "api_annotations_protos", + "api_httpbody_protos", + "iam_v1_policy_protos", + "api_auth_protos", + "api_resource_protos", + "api_billing_protos", + "api_quota_protos", + "api_source_info_protos", + "api_backend_protos", + "type_datetime_protos", + "iam_v1_options_protos", + "api_endpoint_protos", + "api_launch_stage_protos", + "api_documentation_protos", + "devtools_source_v1_source_context_protos", + "type_color_protos", + "api_distribution_protos", + "api_config_change_protos", + "iam_v1_iam_policy_protos", + "type_expr_protos", + "api_routing_protos", + "api_usage_protos", + "type_calendar_period_protos", + "rpc_code_protos", + "api_system_parameter_protos", + "cloud_common_common_protos", + "type_postal_address_protos", + "type_latlng_protos", + "type_dayofweek_protos", + "api_monitored_resource_protos", + "type_money_protos", + "api_metric_protos", + "api_label_protos", + "api_log_protos", + "grafeas_protos", + "api_http_protos", + "type_timeofday_protos", + "api_field_behavior_protos", + "api_context_protos", + "api_logging_protos", + "iam_credentials_v1_common_protos", + "iam_credentials_v1_iamcredentials_protos", +} + +# A list of experimental components used when `google-cloud-cpp` does not +# provide an easy-to-use list. +_DEFAULT_EXPERIMENTAL_COMPONENTS = { + "apikeys", + "pubsublite", +} + +# `google-cloud-cpp` managems these dependencies using CMake code. +_HARD_CODED_DEPENDENCIES = { + "api_annotations_protos": ["api_http_protos"], + "api_auth_protos": ["api_annotations_protos"], + "api_client_protos": ["api_launch_stage_protos"], + "api_metric_protos": ["api_launch_stage_protos", "api_label_protos"], + "api_billing_protos": ["api_annotations_protos", "api_metric_protos"], + "api_distribution_protos": ["api_annotations_protos"], + "api_endpoint_protos": ["api_annotations_protos"], + "api_log_protos": ["api_label_protos"], + "api_logging_protos": ["api_annotations_protos", "api_label_protos"], + "api_monitored_resource_protos": ["api_launch_stage_protos", "api_label_protos"], + "api_monitoring_protos": ["api_annotations_protos"], + "api_quota_protos": ["api_annotations_protos"], + "api_usage_protos": ["api_annotations_protos", "api_visibility_protos"], + "api_service_protos": [ + "api_annotations_protos", + "api_auth_protos", + "api_backend_protos", + "api_billing_protos", + "api_client_protos", + "api_context_protos", + "api_control_protos", + "api_documentation_protos", + "api_endpoint_protos", + "api_http_protos", + "api_label_protos", + "api_log_protos", + "api_logging_protos", + "api_metric_protos", + "api_monitored_resource_protos", + "api_monitoring_protos", + "api_quota_protos", + "api_resource_protos", + "api_source_info_protos", + "api_system_parameter_protos", + "api_usage_protos", + ], + "iam_v1_options_protos": ["api_annotations_protos"], + "iam_v1_policy_protos": ["api_annotations_protos", "type_expr_protos"], + "iam_v1_iam_policy_protos": [ + "api_annotations_protos", + "api_client_protos", + "api_field_behavior_protos", + "api_resource_protos", + "iam_v1_options_protos", + "iam_v1_policy_protos", + ], + "iam_credentials_v1_common_protos": [ + "api_field_behavior_protos", + "api_resource_protos", + ], + "iam_credentials_v1_iamcredentials_protos": [ + "api_annotations_protos", + "api_client_protos", + "iam_credentials_v1_common_protos", + ], +} + + +def _components(source_folder): + libraries = os.path.join(source_folder, "libraries.bzl") + # Use the hard-coded list because the `google-cloud-cpp` does not provide + # an easy way to get all the components. + if not os.path.exists(libraries): + raise Exception("Missing 'libraries.bzl' file") + # The `libraries.bzl` file is a Starlark file that simply defines some + # variables listing all GA, experimental, and "transition", components. + # We want both the GA and transition components, the latter are components + # that recently transitioned from experimental to GA. + g = dict() + with open(libraries) as f: + exec(compile(f.read(), libraries, "exec"), g) + return ( + g["GOOGLE_CLOUD_CPP_GA_LIBRARIES"] + g["GOOGLE_CLOUD_CPP_TRANSITION_LIBRARIES"] + ) + + +def _experimental_components(source_folder): + libraries = os.path.join(source_folder, "libraries.bzl") + # Use the hard-coded list because the `google-cloud-cpp` does not provide + # an easy way to get all the components. + if not os.path.exists(libraries): + return _DEFAULT_EXPERIMENTAL_COMPONENTS + # The `libraries.bzl` file is a Starlark file that simply defines some + # variables listing all GA, experimental, and "transition", components. + # We want to return any experimental components, the caller will skip them + # as they are not built by Conan. + g = dict() + with open(libraries) as f: + exec(compile(f.read(), libraries, "exec"), g) + return g["GOOGLE_CLOUD_CPP_EXPERIMENTAL_LIBRARIES"] + + +def _generate_proto_requires(depfile): + """Load the dependencies for a single google-cloud-cpp::*-protos library.""" + requires = [] + with open(depfile, "r", encoding="utf-8") as f: + for line in f.readlines(): + line = line.strip() + line = line.replace(":", "_") + line = line.replace("_proto", "_protos") + line = line.replace("@com_google_googleapis//", "") + line = line.replace("google/", "") + line = line.replace("/", "_") + if line in _PROTO_DEPS_REMOVED_TARGETS: + continue + line = _PROTO_DEPS_REPLACED_TARGETS.get(line, line) + requires.append(line) + return list(_PROTO_DEPS_COMMON_REQUIRES) + requires + + +def main(): + """Generate a python file representing the google-cloud-cpp proto deps.""" + parser = argparse.ArgumentParser(description=(__doc__)) + parser.add_argument( + "-s", + "--source-folder", + help="a directory where `google-cloud-cpp` source has been extracted", + ) + args = parser.parse_args() + source_folder = vars(args)["source_folder"] + deps_folder = os.path.join(source_folder, "external", "googleapis", "protodeps") + print("# Automatically generated by %s DO NOT EDIT" % __file__) + print("DEPENDENCIES = {") + proto_components = _PROTO_BASE_COMPONENTS.copy() + files = sorted(glob.glob(os.path.join(deps_folder, "*.deps"))) + experimental = set(_experimental_components(source_folder)) + components = set(_components(source_folder)) + for filename in files: + component = os.path.basename(filename).replace(".deps", "") + component = _PROTO_DEPS_REPLACED_NAMES.get(component, component) + if component in experimental or component in _PROTO_DEPS_UNUSED: + # Experimental components have an associated *_protos, component. + # The Conan package only compiles the GA components, so we need + # to skip these. + continue + if component == "compute": + # `compute` does not use gRPC or the `*.deps` files. + continue + component = component + "_protos" + deps = _generate_proto_requires(filename) + proto_components.add(component) + proto_components.update(deps) + print(f' "{component}": {sorted(deps)},') + for component in sorted(_HARD_CODED_DEPENDENCIES.keys()): + deps = _HARD_CODED_DEPENDENCIES[component] + proto_components.add(component) + proto_components.update(deps) + print(f' "{component}": {sorted(deps)},') + print(f' "compute_internal_protos": ["protobuf::libprotobuf"],') + print(f' "cloud_extended_operations_protos": ["protobuf::libprotobuf"],') + proto_components.add("compute_internal_protos") + proto_components.add("cloud_extended_operations_protos") + for component in sorted(components): + if not component.startswith("compute_"): + continue + proto_components.add(component + "_protos") + print(f' "{component}_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"],') + print("}") + proto_components = proto_components - _PROTO_DEPS_COMMON_REQUIRES + names = ['"%s"' % c for c in proto_components] + joined = ",\n ".join(sorted(names)) + print(f"\nPROTO_COMPONENTS = {{\n {joined}\n}}") + names = ['"%s"' % c for c in components] + joined = ",\n ".join(sorted(names)) + print(f"\nCOMPONENTS = {{\n {joined}\n}}") + + +if __name__ == "__main__": + main() diff --git a/google-cloud-cpp/all/patches/2.5.0/003-use-conan-msvc-runtime.patch b/google-cloud-cpp/2.x/patches/2.12.0/001-use-conan-msvc-runtime.patch similarity index 83% rename from google-cloud-cpp/all/patches/2.5.0/003-use-conan-msvc-runtime.patch rename to google-cloud-cpp/2.x/patches/2.12.0/001-use-conan-msvc-runtime.patch index 875dd10..bfefce3 100644 --- a/google-cloud-cpp/all/patches/2.5.0/003-use-conan-msvc-runtime.patch +++ b/google-cloud-cpp/2.x/patches/2.12.0/001-use-conan-msvc-runtime.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 236c6e1..f961398 100644 +index faab325a..657abd4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -68,7 +68,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") +@@ -53,7 +53,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") endif () list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) @@ -11,10 +11,10 @@ index 236c6e1..f961398 100644 option(GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK "If enabled, check that the user has defined OPENSSL_ROOT_DIR on macOS" diff --git a/cmake/GoogleCloudCppCommon.cmake b/cmake/GoogleCloudCppCommon.cmake -index 057fe6b..dbffd7b 100644 +index b487a1bc..880c98fe 100644 --- a/cmake/GoogleCloudCppCommon.cmake +++ b/cmake/GoogleCloudCppCommon.cmake -@@ -21,9 +21,6 @@ get_filename_component(GOOGLE_CLOUD_CPP_SUBPROJECT +@@ -17,9 +17,6 @@ # Get the destination directories based on the GNU recommendations. include(GNUInstallDirs) @@ -25,7 +25,7 @@ index 057fe6b..dbffd7b 100644 include(EnableWerror) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt -index 0cb7a9a..d9016a0 100644 +index 0cb7a9ae..d9016a0b 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -14,9 +14,6 @@ @@ -39,10 +39,10 @@ index 0cb7a9a..d9016a0 100644 target_link_libraries(gcs2cbt google-cloud-cpp::bigtable google-cloud-cpp::storage google-cloud-cpp::grpc_utils) diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt -index 28bf016..c281ce8 100644 +index 03535ff8..2b05c214 100644 --- a/external/googleapis/CMakeLists.txt +++ b/external/googleapis/CMakeLists.txt -@@ -103,8 +103,6 @@ if (PROTO_INCLUDE_DIR) +@@ -157,8 +157,6 @@ if (PROTO_INCLUDE_DIR) list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") endif () diff --git a/google-cloud-cpp/2.x/patches/2.15.1/001-use-conan-msvc-runtime.patch b/google-cloud-cpp/2.x/patches/2.15.1/001-use-conan-msvc-runtime.patch new file mode 100644 index 0000000..f1d07df --- /dev/null +++ b/google-cloud-cpp/2.x/patches/2.15.1/001-use-conan-msvc-runtime.patch @@ -0,0 +1,53 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 66e3e7c3..32e64b5d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,7 +53,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + endif () + + list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) +-include(SelectMSVCRuntime) + + option(GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK + "If enabled, check that the user has defined OPENSSL_ROOT_DIR on macOS" +diff --git a/cmake/GoogleCloudCppCommon.cmake b/cmake/GoogleCloudCppCommon.cmake +index b487a1bc..880c98fe 100644 +--- a/cmake/GoogleCloudCppCommon.cmake ++++ b/cmake/GoogleCloudCppCommon.cmake +@@ -17,9 +17,6 @@ + # Get the destination directories based on the GNU recommendations. + include(GNUInstallDirs) + +-# Pick the right MSVC runtime libraries. +-include(SelectMSVCRuntime) +- + # Enable Werror + include(EnableWerror) + +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index ec8b7395..91a7b32d 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -20,9 +20,6 @@ if (NOT GOOGLE_CLOUD_CPP_ENABLE_EXAMPLES) + return() + endif () + +-# Pick the right MSVC runtime libraries. +-include(SelectMSVCRuntime) +- + if (bigtable IN_LIST GOOGLE_CLOUD_CPP_ENABLE AND storage IN_LIST + GOOGLE_CLOUD_CPP_ENABLE) + add_executable(gcs2cbt gcs2cbt.cc) +diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt +index 15dcc92f..b6146bfe 100644 +--- a/external/googleapis/CMakeLists.txt ++++ b/external/googleapis/CMakeLists.txt +@@ -163,8 +163,6 @@ externalproject_add( + + google_cloud_cpp_find_proto_include_dir(PROTO_INCLUDE_DIR) + +-include(SelectMSVCRuntime) +- + google_cloud_cpp_add_protos_property() + + function (external_googleapis_short_name var proto) diff --git a/google-cloud-cpp/2.x/patches/2.19.0/001-use-conan-msvc-runtime.patch b/google-cloud-cpp/2.x/patches/2.19.0/001-use-conan-msvc-runtime.patch new file mode 100644 index 0000000..9262229 --- /dev/null +++ b/google-cloud-cpp/2.x/patches/2.19.0/001-use-conan-msvc-runtime.patch @@ -0,0 +1,53 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aebfc6b1..f1c4f196 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,7 +53,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + endif () + + list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) +-include(SelectMSVCRuntime) + + option(GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK + "If enabled, check that the user has defined OPENSSL_ROOT_DIR on macOS" +diff --git a/cmake/GoogleCloudCppCommon.cmake b/cmake/GoogleCloudCppCommon.cmake +index b487a1bc..880c98fe 100644 +--- a/cmake/GoogleCloudCppCommon.cmake ++++ b/cmake/GoogleCloudCppCommon.cmake +@@ -17,9 +17,6 @@ + # Get the destination directories based on the GNU recommendations. + include(GNUInstallDirs) + +-# Pick the right MSVC runtime libraries. +-include(SelectMSVCRuntime) +- + # Enable Werror + include(EnableWerror) + +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index ce44aafe..cdaba904 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -20,9 +20,6 @@ if (NOT GOOGLE_CLOUD_CPP_ENABLE_EXAMPLES) + return() + endif () + +-# Pick the right MSVC runtime libraries. +-include(SelectMSVCRuntime) +- + if (bigtable IN_LIST GOOGLE_CLOUD_CPP_ENABLE AND storage IN_LIST + GOOGLE_CLOUD_CPP_ENABLE) + add_executable(gcs2cbt gcs2cbt.cc) +diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt +index c3df633c..6a85dfe8 100644 +--- a/external/googleapis/CMakeLists.txt ++++ b/external/googleapis/CMakeLists.txt +@@ -163,8 +163,6 @@ externalproject_add( + + google_cloud_cpp_find_proto_include_dir(PROTO_INCLUDE_DIR) + +-include(SelectMSVCRuntime) +- + google_cloud_cpp_add_protos_property() + + function (external_googleapis_short_name var proto) diff --git a/google-cloud-cpp/2.x/patches/2.19.0/002-add-find-package-threads.patch b/google-cloud-cpp/2.x/patches/2.19.0/002-add-find-package-threads.patch new file mode 100644 index 0000000..5eee169 --- /dev/null +++ b/google-cloud-cpp/2.x/patches/2.19.0/002-add-find-package-threads.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f1c4f196..53497f0a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -187,6 +187,7 @@ add_custom_target(google-cloud-cpp-protos) + add_custom_target(doxygen-docs) + add_custom_target(all-docfx) + ++find_package(Threads REQUIRED) + find_package(absl CONFIG REQUIRED) + if (GOOGLE_CLOUD_CPP_ENABLE_GRPC) + find_package(gRPC REQUIRED QUIET) diff --git a/google-cloud-cpp/2.x/test_package/CMakeLists.txt b/google-cloud-cpp/2.x/test_package/CMakeLists.txt new file mode 100644 index 0000000..a3c3a27 --- /dev/null +++ b/google-cloud-cpp/2.x/test_package/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.10...3.24) +project(google-cloud-cpp-test CXX) + +find_package(google-cloud-cpp CONFIG REQUIRED) + +# There are too many libraries to test them all. We +# should pick what we test with a view to detecting +# the most common packaging problems. + +set(tests + # Bigtable, Pub/Sub and Spanner have signficant amounts of + # custom code and thus some amount of ad-hoc dependencies on + # absl::* components. + "bigtable" "pubsub" "spanner" + # Storage has custom code and does not depend on gRPC or Protobuf. + "storage" + # Speech is a good model for most other libraries. + "speech") +if (WITH_COMPUTE) + # Compute does not use gRPC and has a different structure from most + # libraries. + list(APPEND tests "compute") +endif () + +foreach(component IN LISTS tests) + add_executable("${component}" "${component}.cpp") + target_compile_features("${component}" PRIVATE cxx_std_14) + target_link_libraries("${component}" google-cloud-cpp::${component}) +endforeach() diff --git a/google-cloud-cpp/all/test_package/bigtable.cpp b/google-cloud-cpp/2.x/test_package/bigtable.cpp similarity index 100% rename from google-cloud-cpp/all/test_package/bigtable.cpp rename to google-cloud-cpp/2.x/test_package/bigtable.cpp diff --git a/google-cloud-cpp/2.x/test_package/compute.cpp b/google-cloud-cpp/2.x/test_package/compute.cpp new file mode 100644 index 0000000..59d7b98 --- /dev/null +++ b/google-cloud-cpp/2.x/test_package/compute.cpp @@ -0,0 +1,12 @@ +#include + +int main(int argc, char *argv[]) { + if (argc != 1) { + std::cerr << "Usage: compute\n"; + return 1; + } + std::cout << "Testing google-cloud-cpp::compute library " << google::cloud::version_string() << "\n"; + namespace disks = ::google::cloud::compute_disks_v1; + auto client = disks::DisksClient(disks::MakeDisksConnectionRest()); + return 0; +} diff --git a/google-cloud-cpp/2.x/test_package/conanfile.py b/google-cloud-cpp/2.x/test_package/conanfile.py new file mode 100644 index 0000000..a1ab26b --- /dev/null +++ b/google-cloud-cpp/2.x/test_package/conanfile.py @@ -0,0 +1,59 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.build import can_run +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.scm import Version + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + + def layout(self): + cmake_layout(self) + + def _supports_compute(self): + if not hasattr(self, "dependencies"): + # This is typically a Conan v1 build. We skip the test for compute + # because it is difficult to establish the `google-cloud-cpp` + # version, and Conan v1 is being retired, and the support is tested + # as part of the Conan v2 build. + return False + return Version(self.dependencies["google-cloud-cpp"].ref.version) >= "2.19.0" + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_COMPUTE"] = self._supports_compute() + tc.generate() + if self._is_legacy_one_profile: + VirtualRunEnv(self).generate(scope="build") + else: + VirtualBuildEnv(self).generate() + # Environment so that the compiled test executable can load shared libraries + VirtualRunEnv(self).generate(scope="run") + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not can_run(self): + return + for test in ["bigtable", "pubsub", "spanner", "speech", "storage"]: + cmd = os.path.join(self.cpp.build.bindir, test) + self.run(cmd, env="conanrun") + if self._supports_compute(): + cmd = os.path.join(self.cpp.build.bindir, "compute") + self.run(cmd, env="conanrun") diff --git a/google-cloud-cpp/all/test_package/pubsub.cpp b/google-cloud-cpp/2.x/test_package/pubsub.cpp similarity index 100% rename from google-cloud-cpp/all/test_package/pubsub.cpp rename to google-cloud-cpp/2.x/test_package/pubsub.cpp diff --git a/google-cloud-cpp/all/test_package/spanner.cpp b/google-cloud-cpp/2.x/test_package/spanner.cpp similarity index 100% rename from google-cloud-cpp/all/test_package/spanner.cpp rename to google-cloud-cpp/2.x/test_package/spanner.cpp diff --git a/google-cloud-cpp/all/test_package/speech.cpp b/google-cloud-cpp/2.x/test_package/speech.cpp similarity index 100% rename from google-cloud-cpp/all/test_package/speech.cpp rename to google-cloud-cpp/2.x/test_package/speech.cpp diff --git a/google-cloud-cpp/2.x/test_package/storage.cpp b/google-cloud-cpp/2.x/test_package/storage.cpp new file mode 100644 index 0000000..ae43da9 --- /dev/null +++ b/google-cloud-cpp/2.x/test_package/storage.cpp @@ -0,0 +1,18 @@ +#include +#include + +int main(int argc, char* argv[]) { + if (argc != 1) { + std::cerr << "Usage: storage\n"; + return 1; + } + + // Create aliases to make the code easier to read. + namespace gcs = google::cloud::storage; + + // Create a client to communicate with Google Cloud Storage. This client + // uses the default configuration for authentication and project id. + std::cout << "Testing google-cloud-cpp::storage library " << google::cloud::version_string() << "\n"; + auto client = gcs::Client(); + return 0; +} diff --git a/google-cloud-cpp/all/test_v1_package/CMakeLists.txt b/google-cloud-cpp/2.x/test_v1_package/CMakeLists.txt similarity index 100% rename from google-cloud-cpp/all/test_v1_package/CMakeLists.txt rename to google-cloud-cpp/2.x/test_v1_package/CMakeLists.txt diff --git a/google-cloud-cpp/all/test_v1_package/conanfile.py b/google-cloud-cpp/2.x/test_v1_package/conanfile.py similarity index 80% rename from google-cloud-cpp/all/test_v1_package/conanfile.py rename to google-cloud-cpp/2.x/test_v1_package/conanfile.py index d22dc29..35fbd17 100644 --- a/google-cloud-cpp/all/test_v1_package/conanfile.py +++ b/google-cloud-cpp/2.x/test_v1_package/conanfile.py @@ -1,6 +1,6 @@ import os -from conans import ConanFile, CMake, tools +from conans import ConanFile, CMake from conan.tools.build import can_run @@ -16,6 +16,6 @@ def build(self): def test(self): if not can_run(self): return - for test in ["storage"]: + for test in ["bigtable", "pubsub", "spanner", "speech", "storage"]: cmd = os.path.join("bin", test) self.run(cmd, run_environment=True) diff --git a/google-cloud-cpp/all/CMakeLists.txt b/google-cloud-cpp/all/CMakeLists.txt new file mode 100644 index 0000000..a342eb1 --- /dev/null +++ b/google-cloud-cpp/all/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.4) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +if(MSVC) + add_definitions("-D_SILENCE_CXX20_REL_OPS_DEPRECATION_WARNING") + add_definitions("-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING") +endif() + +add_subdirectory("source_subfolder") diff --git a/google-cloud-cpp/all/conan_cmake_project_include.cmake b/google-cloud-cpp/all/conan_cmake_project_include.cmake deleted file mode 100644 index 17098fd..0000000 --- a/google-cloud-cpp/all/conan_cmake_project_include.cmake +++ /dev/null @@ -1,10 +0,0 @@ -find_package(googleapis CONFIG REQUIRED) -if (NOT ("${googleapis_RES_DIRS_RELEASE}" STREQUAL "")) - set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_RELEASE}") -elseif (NOT ("${googleapis_RES_DIRS_RELWITHDEBINFO}" STREQUAL "")) - set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_RELWITHDEBINFO}") -elseif (NOT ("${googleapis_RES_DIRS_MINSIZEREL}" STREQUAL "")) - set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_MINSIZEREL}") -elseif (NOT ("${googleapis_RES_DIRS_DEBUG}" STREQUAL "")) - set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_DEBUG}") -endif () diff --git a/google-cloud-cpp/all/conandata.yml b/google-cloud-cpp/all/conandata.yml index 94473c6..a410b93 100644 --- a/google-cloud-cpp/all/conandata.yml +++ b/google-cloud-cpp/all/conandata.yml @@ -1,16 +1,23 @@ sources: - "2.5.0": - url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.5.0.tar.gz" - sha256: "ac93ef722d08bfb220343bde2f633c7c11f15e34ec3ecd0a57dbd3ff729cc3a6" + "1.26.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.26.1.tar.gz" + sha256: "83108515fc59c72cdb87f178712256f4b0098e1ca5dc6f64c2c20dd2f1e1559d" + "1.27.0": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.27.0.tar.gz" + sha256: "84a7ac7b63db986bb737462e374c11fc6f35f6020ccaacec1d0e4d61ec929528" + "1.30.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.30.1.tar.gz" + sha256: "b651a58cb44bd715f0cb8e42c7ea58490b3e768a35ede01d798b983eef88e143" + "1.31.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.31.1.tar.gz" + sha256: "dc7cbf95b506a84b48cf71e0462985d262183edeaabdacaaee2109852394a609" + "1.40.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.40.1.tar.gz" + sha256: "fb62f0e7dc964c5d3cd0d85977b85f3e0e7dce97e9029abf9c32ecc29db07043" patches: - "2.5.0": - - patch_file: "patches/2.5.0/001-use-googleapis-conan-package.patch" - patch_description: "Use Conan package for googleapis" - patch_type: conan - - patch_file: "patches/2.5.0/002-interface-library-properties.patch" - patch_source: https://github.com/googleapis/google-cloud-cpp/pull/10636 - patch_description: "Fix problems with INTERFACE proto libraries" - patch_type: backport - - patch_file: "patches/2.5.0/003-use-conan-msvc-runtime.patch" - patch_description: "Let Conan select the MSVC runtime" - patch_type: conan + "1.26.1": + - patch_file: "patches/0001-googleapis-folder.patch" + base_path: "source_subfolder" + "1.27.0": + - patch_file: "patches/0001-googleapis-folder.patch" + base_path: "source_subfolder" diff --git a/google-cloud-cpp/all/conanfile.py b/google-cloud-cpp/all/conanfile.py index dc19a49..30fac00 100644 --- a/google-cloud-cpp/all/conanfile.py +++ b/google-cloud-cpp/all/conanfile.py @@ -1,39 +1,41 @@ import os +import textwrap +import functools -from conan import ConanFile -from conan.tools.build import check_min_cppstd, cross_building -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.env import VirtualRunEnv, VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir -from conan.tools.microsoft import check_min_vs, is_msvc -from conan.tools.scm import Version -from conan.errors import ConanInvalidConfiguration - -required_conan_version = ">=1.56.0" +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +required_conan_version = ">=1.33.0" class GoogleCloudCppConan(ConanFile): name = "google-cloud-cpp" description = "C++ Client Libraries for Google Cloud Services" license = "Apache-2.0" - topics = ( - "google", - "cloud", - "google-cloud-storage", - "google-cloud-platform", - ) + topics = "google", "cloud", "google-cloud-storage", "google-cloud-platform", "google-cloud-pubsub", "google-cloud-spanner", "google-cloud-bigtable" homepage = "https://github.com/googleapis/google-cloud-cpp" url = "https://github.com/conan-io/conan-center-index" - package_type = "library" + generators = "cmake", "cmake_find_package_multi", "cmake_find_package" settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } short_paths = True + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" def export_sources(self): - copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) - export_conandata_patches(self) + self.copy("CMakeLists.txt") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) def config_options(self): if self.settings.os == "Windows": @@ -41,193 +43,332 @@ def config_options(self): def configure(self): if self.options.shared: - self.options.rm_safe("fPIC") - self.options["protobuf"].shared = True - self.options["googleapis"].shared = True - self.options["grpc-proto"].shared = True - self.options["grpc"].shared = True - + del self.options.fPIC + def validate(self): - # As-of 2022-03, google-cloud-cpp only supports "Visual Studio >= 2019", - # and Visual Studio < 2019 is out of mainline support. - # The wikipedia page says this maps to 192* for the MSVC version: - # https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B - check_min_vs(self, "192") - if is_msvc(self) and self.info.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") - - if hasattr(self, "settings_build") and cross_building(self): - raise ConanInvalidConfiguration( - "Recipe not prepared for cross-building (yet)" - ) - - if ( - self.settings.compiler == "clang" - and Version(self.settings.compiler.version) < "6.0" - ): - raise ConanInvalidConfiguration("Clang version must be at least 6.0.") + if self.settings.os == 'Windows' and self.options.shared: + raise ConanInvalidConfiguration("Fails to compile for Windows as a DLL") - if self.settings.compiler.cppstd: - check_min_cppstd(self, 14) + if hasattr(self, "settings_build") and tools.cross_building(self): + raise ConanInvalidConfiguration("Recipe not prepared for cross-building (yet)") - if ( - self.settings.compiler == "gcc" - and Version(self.settings.compiler.version) < "5.4" - ): - raise ConanInvalidConfiguration("Building requires GCC >= 5.4") + if tools.Version(self.version) >= "1.30.0": + if self.settings.compiler == 'clang' and tools.Version(self.settings.compiler.version) < "6.0": + raise ConanInvalidConfiguration("Clang version must be at least 6.0.") - if self.info.options.shared and \ - (not self.dependencies["protobuf"].options.shared or \ - not self.dependencies["googleapis"].options.shared or \ - not self.dependencies["grpc-proto"].options.shared or \ - not self.dependencies["grpc"].options.shared): - raise ConanInvalidConfiguration( - "If built as shared, protobuf, googleapis, grpc-proto, and grpc must be shared as well." - " Please, use `protobuf/*:shared=True`, `googleapis/*:shared=True`, `grpc-proto/*:shared=True`," - " and `grpc/*:shared=True`", - ) + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) - def layout(self): - cmake_layout(self, src_folder="src") + if self.settings.compiler == 'gcc' and tools.Version(self.settings.compiler.version) < "5.4": + raise ConanInvalidConfiguration("Building requires GCC >= 5.4") + if self.settings.compiler == 'clang' and tools.Version(self.settings.compiler.version) < "3.8": + raise ConanInvalidConfiguration("Building requires clang >= 3.8") + if self.settings.compiler == 'Visual Studio' and tools.Version(self.settings.compiler.version) < "16": + raise ConanInvalidConfiguration("Building requires VS >= 2019") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) def requirements(self): - self.requires("protobuf/3.21.4", transitive_headers=True) - self.requires("grpc/1.50.1", transitive_headers=True) - self.requires("nlohmann_json/3.10.0") - self.requires("crc32c/1.1.1") - self.requires("abseil/20220623.0", transitive_headers=True) - self.requires("libcurl/7.88.1") - self.requires("openssl/[>=1.1 <4]") - self.requires("zlib/1.2.13") - # `google-cloud-cpp` contains code generated from the proto files. - # Working with older versions of these protos almost always will fail, as - # at least some of the RPCs included in the GRPC-generator stubs will be - # missing. - # Working with newer versions of these protos almost always will work. There - # are very few breaking changes on the proto files. - self.requires(f"googleapis/{self._GOOGLEAPIS_VERSIONS[self.version]}", transitive_headers=True) - - def build_requirements(self): - # For the grpc-cpp-plugin executable - self.tool_requires("grpc/1.50.1") - - def generate(self): - tc = CMakeToolchain(self) - tc.cache_variables["CMAKE_PROJECT_google-cloud-cpp_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") - tc.variables["BUILD_TESTING"] = False - tc.variables["GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK"] = False - tc.variables["GOOGLE_CLOUD_CPP_ENABLE"] = ",".join(self._components()) - tc.generate() - VirtualRunEnv(self).generate(scope="build") - deps = CMakeDeps(self) - deps.generate() + self.requires('protobuf/3.20.0') + self.requires('grpc/1.45.2') + self.requires('nlohmann_json/3.10.5') + self.requires('crc32c/1.1.2') + self.requires('abseil/20211102.0') + self.requires('libcurl/7.80.0') + self.requires('openssl/1.1.1n') + # TODO: Add googleapis once it is available in CCI (now it is embedded) + + @functools.lru_cache(1) + def _configure_cmake(self): + # Do not build in parallel for certain configurations, it fails writting/reading files at the same time + parallel = not (self.settings.compiler == "Visual Studio" and self.settings.compiler.version == "16" and self.version in ["1.31.1", "1.30.1"]) + cmake = CMake(self, parallel=parallel) + cmake.definitions["BUILD_TESTING"] = 0 + + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK"] = False + + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_BIGTABLE"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_BIGQUERY"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_SPANNER"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_STORAGE"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_FIRESTORE"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_PUBSUB"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_IAM"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_LOGGING"] = True + cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_GENERATOR"] = True + + cmake.configure() + return cmake def _patch_sources(self): - apply_conandata_patches(self) - # This was informed by comments in the grpc port. On macOS `Make` will - # run commands via `/bin/sh`. `/bin/sh` is subject to System Integrity - # Protections. In particular, the system will purge the DYLD_LIBRARY_PATH - # enviroment variables: - # https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html - settings_build = getattr(self, "settings_build", self.settings) - if settings_build.os == "Macos": - replace_in_file(self, os.path.join(self.source_folder, "cmake/CompileProtos.cmake"), - "$", - '${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}" $') + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + if tools.Version(self.version) < "1.33.0": + # Do not override CMAKE_CXX_STANDARD if provided + tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + textwrap.dedent("""\ + set(CMAKE_CXX_STANDARD + 11 + CACHE STRING "Configure the C++ standard version for all targets.")"""), + textwrap.dedent("""\ + if(NOT "${CMAKE_CXX_STANDARD}") + set(CMAKE_CXX_STANDARD 11 CACHE STRING "Configure the C++ standard version for all targets.") + endif() + """)) def build(self): self._patch_sources() - cmake = CMake(self) - cmake.configure() + cmake = self._configure_cmake() cmake.build() - _GOOGLEAPIS_VERSIONS = { - "2.5.0": "cci.20221108", - } - - _GA_COMPONENTS_BASE = {"iam", "storage"} - _GA_COMPONENTS_VERSION = { - '2.5.0': { - "iam", - "storage", - }, - } - - def _components(self): - result = self._GA_COMPONENTS_BASE - for v in sorted(self._GA_COMPONENTS_VERSION.keys()): - if v > Version(self): - break - result = result.union(self._GA_COMPONENTS_VERSION[v]) - # Some protos do not compile due to inconvenient system macros clashing with proto enum values. - # Protobuf can workaround these problems, but the current version in Conan index (protobuf/3.21.4) - # do not contain the fixes for these cases. - # TODO - review after protobuf >= 3.22.x - # Some of the macros are platform specific. - return result - def package(self): - copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - cmake = CMake(self) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() cmake.install() - rmdir(self, path=os.path.join(self.package_folder, "lib", "cmake")) - rmdir(self, path=os.path.join(self.package_folder, "lib", "pkgconfig")) - - def _add_proto_component(self, component): - PROTOS_SHARED_REQUIRES=["googleapis::googleapis", "grpc::grpc++", "protobuf::libprotobuf"] - self.cpp_info.components[component].requires = PROTOS_SHARED_REQUIRES - self.cpp_info.components[component].libs = [f"google_cloud_cpp_{component}"] - self.cpp_info.components[component].names["pkg_config"] = f"google_cloud_cpp_{component}" - - def _add_grpc_component(self, component, protos, extra=None): - SHARED_REQUIRES=["grpc_utils", "common", "grpc::grpc++", "protobuf::libprotobuf", "abseil::absl_memory"] - self.cpp_info.components[component].requires = (extra or []) + [protos] + SHARED_REQUIRES - self.cpp_info.components[component].libs = [f"google_cloud_cpp_{component}"] - self.cpp_info.components[component].names["pkg_config"] = f"google_cloud_cpp_{component}" + tools.rmdir(os.path.join(self.package_folder, 'lib', "cmake")) + tools.rmdir(os.path.join(self.package_folder, 'lib', 'pkgconfig')) def package_info(self): self.cpp_info.components["common"].requires = ["abseil::absl_any", "abseil::absl_flat_hash_map", "abseil::absl_memory", "abseil::absl_optional", "abseil::absl_time"] self.cpp_info.components["common"].libs = ["google_cloud_cpp_common"] self.cpp_info.components["common"].names["pkg_config"] = "google_cloud_cpp_common" - self.cpp_info.components["rest_internal"].requires = ["common", "libcurl::libcurl", "openssl::ssl", "openssl::crypto", "zlib::zlib"] - self.cpp_info.components["rest_internal"].libs = ["google_cloud_cpp_rest_internal"] - self.cpp_info.components["rest_internal"].names["pkg_config"] = "google_cloud_cpp_common" + self.cpp_info.components["experimental-bigquery"].requires = ["grpc_utils", "common", "cloud_bigquery_protos"] + self.cpp_info.components["experimental-bigquery"].libs = ["google_cloud_cpp_bigquery"] + self.cpp_info.components["experimental-bigquery"].names["pkg_config"] = "google_cloud_cpp_bigquery" + + self.cpp_info.components["bigtable"].requires = ["abseil::absl_memory", "bigtable_protos", "common", "grpc_utils", "grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["bigtable"].libs = ["google_cloud_cpp_bigtable"] + self.cpp_info.components["bigtable"].names["pkg_config"] = "google_cloud_cpp_bigtable" + + if tools.Version(self.version) < "1.40.1": # FIXME: Probably this library was removed before + self.cpp_info.components["experimental-firestore"].requires = ["common"] + self.cpp_info.components["experimental-firestore"].libs = ["google_cloud_cpp_firestore"] + self.cpp_info.components["experimental-firestore"].names["pkg_config"] = "google_cloud_cpp_firestore" + + self.cpp_info.components["bigtable_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "iam_v1_iam_policy_protos", "iam_v1_policy_protos", "longrunning_operations_protos", "rpc_status_protos", "api_auth_protos"] + self.cpp_info.components["bigtable_protos"].libs = ["google_cloud_cpp_bigtable_protos"] + self.cpp_info.components["bigtable_protos"].names["pkg_config"] = "google_cloud_cpp_bigtable_protos" + + self.cpp_info.components["cloud_bigquery_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "iam_v1_iam_policy_protos", "iam_v1_policy_protos", "rpc_status_protos", "api_http_protos"] + self.cpp_info.components["cloud_bigquery_protos"].libs = ["google_cloud_cpp_cloud_bigquery_protos"] + self.cpp_info.components["cloud_bigquery_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_bigquery_protos" + + self.cpp_info.components["cloud_speech_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "longrunning_operations_protos", "rpc_status_protos"] + self.cpp_info.components["cloud_speech_protos"].libs = ["google_cloud_cpp_cloud_speech_protos"] + self.cpp_info.components["cloud_speech_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_speech_protos" + + self.cpp_info.components["cloud_texttospeech_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos"] + self.cpp_info.components["cloud_texttospeech_protos"].libs = ["google_cloud_cpp_cloud_texttospeech_protos"] + self.cpp_info.components["cloud_texttospeech_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_texttospeech_protos" + + self.cpp_info.components["iam_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos"] + self.cpp_info.components["iam_protos"].libs = ["google_cloud_cpp_iam_protos"] + self.cpp_info.components["iam_protos"].names["pkg_config"] = "google_cloud_cpp_iam_protos" + + self.cpp_info.components["pubsub_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos"] + self.cpp_info.components["pubsub_protos"].libs = ["google_cloud_cpp_pubsub_protos"] + self.cpp_info.components["pubsub_protos"].names["pkg_config"] = "google_cloud_cpp_pubsub_protos" + + self.cpp_info.components["spanner_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "iam_v1_iam_policy_protos", "iam_v1_policy_protos", "longrunning_operations_protos", "rpc_status_protos"] + self.cpp_info.components["spanner_protos"].libs = ["google_cloud_cpp_spanner_protos"] + self.cpp_info.components["spanner_protos"].names["pkg_config"] = "google_cloud_cpp_spanner_protos" + + self.cpp_info.components["storage_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "iam_v1_iam_policy_protos", "iam_v1_policy_protos"] + self.cpp_info.components["storage_protos"].libs = ["google_cloud_cpp_storage_protos"] + self.cpp_info.components["storage_protos"].names["pkg_config"] = "google_cloud_cpp_storage_protos" + + self.cpp_info.components["longrunning_operations_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "rpc_status_protos"] + self.cpp_info.components["longrunning_operations_protos"].libs = ["google_cloud_cpp_longrunning_operations_protos"] + self.cpp_info.components["longrunning_operations_protos"].names["pkg_config"] = "google_cloud_cpp_longrunning_operations_protos" + + self.cpp_info.components["api_http_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_http_protos"].libs = ["google_cloud_cpp_api_http_protos"] + self.cpp_info.components["api_http_protos"].names["pkg_config"] = "google_cloud_cpp_api_http_protos" + + self.cpp_info.components["api_annotations_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_http_protos"] + self.cpp_info.components["api_annotations_protos"].libs = ["google_cloud_cpp_api_annotations_protos"] + self.cpp_info.components["api_annotations_protos"].names["pkg_config"] = "google_cloud_cpp_api_annotations_protos" + + self.cpp_info.components["api_auth_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos"] + self.cpp_info.components["api_auth_protos"].libs = ["google_cloud_cpp_api_auth_protos"] + self.cpp_info.components["api_auth_protos"].names["pkg_config"] = "google_cloud_cpp_api_auth_protos" + + self.cpp_info.components["api_client_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_client_protos"].libs = ["google_cloud_cpp_api_client_protos"] + self.cpp_info.components["api_client_protos"].names["pkg_config"] = "google_cloud_cpp_api_client_protos" + + self.cpp_info.components["api_distribution_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_distribution_protos"].libs = ["google_cloud_cpp_api_distribution_protos"] + self.cpp_info.components["api_distribution_protos"].names["pkg_config"] = "google_cloud_cpp_api_distribution_protos" + + self.cpp_info.components["api_field_behavior_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_field_behavior_protos"].libs = ["google_cloud_cpp_api_field_behavior_protos"] + self.cpp_info.components["api_field_behavior_protos"].names["pkg_config"] = "google_cloud_cpp_api_field_behavior_protos" + + self.cpp_info.components["api_label_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_label_protos"].libs = ["google_cloud_cpp_api_label_protos"] + self.cpp_info.components["api_label_protos"].names["pkg_config"] = "google_cloud_cpp_api_label_protos" + + self.cpp_info.components["api_launch_stage_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_launch_stage_protos"].libs = ["google_cloud_cpp_api_launch_stage_protos"] + self.cpp_info.components["api_launch_stage_protos"].names["pkg_config"] = "google_cloud_cpp_api_launch_stage_protos" + + self.cpp_info.components["api_metric_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_launch_stage_protos", "api_label_protos"] + self.cpp_info.components["api_metric_protos"].libs = ["google_cloud_cpp_api_metric_protos"] + self.cpp_info.components["api_metric_protos"].names["pkg_config"] = "google_cloud_cpp_api_metric_protos" + + self.cpp_info.components["api_monitored_resource_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_launch_stage_protos", "api_label_protos"] + self.cpp_info.components["api_monitored_resource_protos"].libs = ["google_cloud_cpp_api_monitored_resource_protos"] + self.cpp_info.components["api_monitored_resource_protos"].names["pkg_config"] = "google_cloud_cpp_api_monitored_resource_protos" + + self.cpp_info.components["api_resource_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["api_resource_protos"].libs = ["google_cloud_cpp_api_resource_protos"] + self.cpp_info.components["api_resource_protos"].names["pkg_config"] = "google_cloud_cpp_api_resource_protos" + + self.cpp_info.components["devtools_cloudtrace_v2_trace_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_field_behavior_protos", "api_resource_protos", "rpc_status_protos"] + self.cpp_info.components["devtools_cloudtrace_v2_trace_protos"].libs = ["google_cloud_cpp_devtools_cloudtrace_v2_trace_protos"] + self.cpp_info.components["devtools_cloudtrace_v2_trace_protos"].names["pkg_config"] = "google_cloud_cpp_devtools_cloudtrace_v2_trace_protos" + + self.cpp_info.components["devtools_cloudtrace_v2_tracing_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "devtools_cloudtrace_v2_trace_protos", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "rpc_status_protos"] + self.cpp_info.components["devtools_cloudtrace_v2_tracing_protos"].libs = ["google_cloud_cpp_devtools_cloudtrace_v2_tracing_protos"] + self.cpp_info.components["devtools_cloudtrace_v2_tracing_protos"].names["pkg_config"] = "google_cloud_cpp_devtools_cloudtrace_v2_tracing_protos" + + cmp_logging_type_type_protos = None + if tools.Version(self.version) < "1.40.1": # FIXME: Probably this library was removed before + cmp_logging_type_type_protos = "logging_type_protos" + self.cpp_info.components[cmp_logging_type_type_protos].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos"] + self.cpp_info.components[cmp_logging_type_type_protos].libs = ["google_cloud_cpp_logging_type_protos"] + self.cpp_info.components[cmp_logging_type_type_protos].names["pkg_config"] = "google_cloud_cpp_logging_type_protos" + else: + cmp_logging_type_type_protos = "logging_type_type_protos" + self.cpp_info.components[cmp_logging_type_type_protos].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos"] + self.cpp_info.components[cmp_logging_type_type_protos].libs = ["google_cloud_cpp_logging_type_type_protos"] + self.cpp_info.components[cmp_logging_type_type_protos].names["pkg_config"] = "google_cloud_cpp_logging_type_type_protos" + + self.cpp_info.components["logging_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_distribution_protos", "api_field_behavior_protos", "api_metric_protos", "api_monitored_resource_protos", "api_resource_protos", cmp_logging_type_type_protos, "rpc_status_protos"] + self.cpp_info.components["logging_protos"].libs = ["google_cloud_cpp_logging_protos"] + self.cpp_info.components["logging_protos"].names["pkg_config"] = "google_cloud_cpp_logging_protos" + + self.cpp_info.components["monitoring_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_distribution_protos", "api_field_behavior_protos", "api_label_protos", "api_launch_stage_protos", "api_metric_protos", "api_monitored_resource_protos", "api_resource_protos", "rpc_status_protos", "type_calendar_period_protos"] + self.cpp_info.components["monitoring_protos"].libs = ["google_cloud_cpp_monitoring_protos"] + self.cpp_info.components["monitoring_protos"].names["pkg_config"] = "google_cloud_cpp_monitoring_protos" + + self.cpp_info.components["iam_v1_options_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos"] + self.cpp_info.components["iam_v1_options_protos"].libs = ["google_cloud_cpp_iam_v1_options_protos"] + self.cpp_info.components["iam_v1_options_protos"].names["pkg_config"] = "google_cloud_cpp_iam_v1_options_protos" + + self.cpp_info.components["iam_v1_policy_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "type_expr_protos"] + self.cpp_info.components["iam_v1_policy_protos"].libs = ["google_cloud_cpp_iam_v1_policy_protos"] + self.cpp_info.components["iam_v1_policy_protos"].names["pkg_config"] = "google_cloud_cpp_iam_v1_policy_protos" + + self.cpp_info.components["iam_v1_iam_policy_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "iam_v1_options_protos", "iam_v1_policy_protos"] + self.cpp_info.components["iam_v1_iam_policy_protos"].libs = ["google_cloud_cpp_iam_v1_iam_policy_protos"] + self.cpp_info.components["iam_v1_iam_policy_protos"].names["pkg_config"] = "google_cloud_cpp_iam_v1_iam_policy_protos" + + self.cpp_info.components["rpc_error_details_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["rpc_error_details_protos"].libs = ["google_cloud_cpp_rpc_error_details_protos"] + self.cpp_info.components["rpc_error_details_protos"].names["pkg_config"] = "google_cloud_cpp_rpc_error_details_protos" + + self.cpp_info.components["rpc_status_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "rpc_error_details_protos"] + self.cpp_info.components["rpc_status_protos"].libs = ["google_cloud_cpp_rpc_status_protos"] + self.cpp_info.components["rpc_status_protos"].names["pkg_config"] = "google_cloud_cpp_rpc_status_protos" + + self.cpp_info.components["type_calendar_period_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_calendar_period_protos"].libs = ["google_cloud_cpp_type_calendar_period_protos"] + self.cpp_info.components["type_calendar_period_protos"].names["pkg_config"] = "google_cloud_cpp_type_calendar_period_protos" + + self.cpp_info.components["type_color_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_color_protos"].libs = ["google_cloud_cpp_type_color_protos"] + self.cpp_info.components["type_color_protos"].names["pkg_config"] = "google_cloud_cpp_type_color_protos" + + self.cpp_info.components["type_date_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_date_protos"].libs = ["google_cloud_cpp_type_date_protos"] + self.cpp_info.components["type_date_protos"].names["pkg_config"] = "google_cloud_cpp_type_date_protos" + + self.cpp_info.components["type_datetime_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_datetime_protos"].libs = ["google_cloud_cpp_type_datetime_protos"] + self.cpp_info.components["type_datetime_protos"].names["pkg_config"] = "google_cloud_cpp_type_datetime_protos" + + self.cpp_info.components["type_dayofweek_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_dayofweek_protos"].libs = ["google_cloud_cpp_type_dayofweek_protos"] + self.cpp_info.components["type_dayofweek_protos"].names["pkg_config"] = "google_cloud_cpp_type_dayofweek_protos" + + self.cpp_info.components["type_expr_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_expr_protos"].libs = ["google_cloud_cpp_type_expr_protos"] + self.cpp_info.components["type_expr_protos"].names["pkg_config"] = "google_cloud_cpp_type_expr_protos" + + self.cpp_info.components["type_fraction_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_fraction_protos"].libs = ["google_cloud_cpp_type_fraction_protos"] + self.cpp_info.components["type_fraction_protos"].names["pkg_config"] = "google_cloud_cpp_type_fraction_protos" + + self.cpp_info.components["type_interval_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_interval_protos"].libs = ["google_cloud_cpp_type_interval_protos"] + self.cpp_info.components["type_interval_protos"].names["pkg_config"] = "google_cloud_cpp_type_interval_protos" + + self.cpp_info.components["type_latlng_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_latlng_protos"].libs = ["google_cloud_cpp_type_latlng_protos"] + self.cpp_info.components["type_latlng_protos"].names["pkg_config"] = "google_cloud_cpp_type_latlng_protos" + + self.cpp_info.components["type_localized_text_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_localized_text_protos"].libs = ["google_cloud_cpp_type_localized_text_protos"] + self.cpp_info.components["type_localized_text_protos"].names["pkg_config"] = "google_cloud_cpp_type_localized_text_protos" + + self.cpp_info.components["type_money_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_money_protos"].libs = ["google_cloud_cpp_type_money_protos"] + self.cpp_info.components["type_money_protos"].names["pkg_config"] = "google_cloud_cpp_type_money_protos" + + self.cpp_info.components["type_month_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_month_protos"].libs = ["google_cloud_cpp_type_month_protos"] + self.cpp_info.components["type_month_protos"].names["pkg_config"] = "google_cloud_cpp_type_month_protos" + + self.cpp_info.components["type_phone_number_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_phone_number_protos"].libs = ["google_cloud_cpp_type_phone_number_protos"] + self.cpp_info.components["type_phone_number_protos"].names["pkg_config"] = "google_cloud_cpp_type_phone_number_protos" + + self.cpp_info.components["type_postal_address_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_postal_address_protos"].libs = ["google_cloud_cpp_type_postal_address_protos"] + self.cpp_info.components["type_postal_address_protos"].names["pkg_config"] = "google_cloud_cpp_type_postal_address_protos" + + self.cpp_info.components["type_quaternion_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_quaternion_protos"].libs = ["google_cloud_cpp_type_quaternion_protos"] + self.cpp_info.components["type_quaternion_protos"].names["pkg_config"] = "google_cloud_cpp_type_quaternion_protos" + + self.cpp_info.components["type_timeofday_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] + self.cpp_info.components["type_timeofday_protos"].libs = ["google_cloud_cpp_type_timeofday_protos"] + self.cpp_info.components["type_timeofday_protos"].names["pkg_config"] = "google_cloud_cpp_type_timeofday_protos" + + self.cpp_info.components["cloud_dialogflow_v2_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "longrunning_operations_protos", "rpc_status_protos", "type_latlng_protos"] + self.cpp_info.components["cloud_dialogflow_v2_protos"].libs = ["google_cloud_cpp_cloud_dialogflow_v2_protos"] + self.cpp_info.components["cloud_dialogflow_v2_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_dialogflow_v2_protos" - # A small number of gRPC-generated stubs are used directly in the common components - # shared by all gRPC-based libraries. These bust be defined without reference to `grpc_utils`. - GRPC_UTILS_REQUIRED_PROTOS=["iam_protos", "longrunning_operations_protos", "rpc_error_details_protos", "rpc_status_protos"] - for component in GRPC_UTILS_REQUIRED_PROTOS: - self._add_proto_component(component) + if tools.Version(self.version) < "1.40.1": # FIXME: Probably this library was removed before + self.cpp_info.components["cloud_dialogflow_v2beta1_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "longrunning_operations_protos", "rpc_status_protos", "type_latlng_protos"] + self.cpp_info.components["cloud_dialogflow_v2beta1_protos"].libs = ["google_cloud_cpp_cloud_dialogflow_v2beta1_protos"] + self.cpp_info.components["cloud_dialogflow_v2beta1_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_dialogflow_v2beta1_protos" - self.cpp_info.components["grpc_utils"].requires = GRPC_UTILS_REQUIRED_PROTOS + ["common", "abseil::absl_function_ref", "abseil::absl_memory", "abseil::absl_time", "grpc::grpc++"] + self.cpp_info.components["grpc_utils"].requires = ["abseil::absl_function_ref", "abseil::absl_memory", "abseil::absl_time", "rpc_status_protos", "common", "grpc::grpc++", "grpc::grpc"] self.cpp_info.components["grpc_utils"].libs = ["google_cloud_cpp_grpc_utils"] self.cpp_info.components["grpc_utils"].names["pkg_config"] = "google_cloud_cpp_grpc_utils" - for component in self._components(): - # bigquery proto library predates the adoption of more consistent naming - if component == 'bigquery': - self._add_proto_component("cloud_bigquery_protos") - self._add_grpc_component(component, "cloud_bigquery_protos") - continue - if component == 'dialogflow_es': - self._add_proto_component("cloud_dialogflow_v2_protos") - self._add_grpc_component(component, "cloud_dialogflow_v2_protos") - continue - # `storage` is the only component that does not depend on a matching `*_protos` library - protos=f"{component}_protos" - if component != 'storage' and component not in GRPC_UTILS_REQUIRED_PROTOS: - self._add_proto_component(protos) - # The components in self._GA_COMPONENTS_BASE are hand-crafted and need custom - # definitions (see below) - if component in self._GA_COMPONENTS_BASE: - continue - self._add_grpc_component(component, protos) - - self._add_grpc_component("iam", "iam_protos") - self.cpp_info.components["storage"].requires = ["rest_internal", "common", "nlohmann_json::nlohmann_json", "abseil::absl_memory", "abseil::absl_strings", "abseil::absl_str_format", "abseil::absl_time", "abseil::absl_variant", "crc32c::crc32c", "libcurl::libcurl", "openssl::ssl", "openssl::crypto", "zlib::zlib"] + self.cpp_info.components["experimental-iam"].requires = ["grpc_utils", "common", "iam_protos"] + self.cpp_info.components["experimental-iam"].libs = ["google_cloud_cpp_iam"] + self.cpp_info.components["experimental-iam"].names["pkg_config"] = "google_cloud_cpp_iam" + + self.cpp_info.components["experimental-logging"].requires = ["grpc_utils", "common", "logging_protos"] + self.cpp_info.components["experimental-logging"].libs = ["google_cloud_cpp_logging"] + self.cpp_info.components["experimental-logging"].names["pkg_config"] = "google_cloud_cpp_logging" + + self.cpp_info.components["pubsub"].requires = ["grpc_utils", "common", "pubsub_protos", "abseil::absl_flat_hash_map"] + self.cpp_info.components["pubsub"].libs = ["google_cloud_cpp_pubsub"] + self.cpp_info.components["pubsub"].names["pkg_config"] = "google_cloud_cpp_pubsub" + + self.cpp_info.components["spanner"].requires = ["abseil::absl_fixed_array", "abseil::absl_memory", "abseil::absl_numeric", "abseil::absl_strings", "abseil::absl_time", "grpc_utils", "common", "spanner_protos"] + self.cpp_info.components["spanner"].libs = ["google_cloud_cpp_spanner"] + self.cpp_info.components["spanner"].names["pkg_config"] = "google_cloud_cpp_spanner" + + self.cpp_info.components["storage"].requires = ["abseil::absl_memory", "abseil::absl_strings", "abseil::absl_str_format", "abseil::absl_time", "abseil::absl_variant", "common", "nlohmann_json::nlohmann_json", "crc32c::crc32c", "libcurl::libcurl", "openssl::ssl", "openssl::crypto"] self.cpp_info.components["storage"].libs = ["google_cloud_cpp_storage"] self.cpp_info.components["storage"].names["pkg_config"] = "google_cloud_cpp_storage" diff --git a/google-cloud-cpp/all/patches/0001-googleapis-folder.patch b/google-cloud-cpp/all/patches/0001-googleapis-folder.patch new file mode 100644 index 0000000..0fc76ca --- /dev/null +++ b/google-cloud-cpp/all/patches/0001-googleapis-folder.patch @@ -0,0 +1,22 @@ +diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt +index c3f1ef1..fb65356 100644 +--- a/external/googleapis/CMakeLists.txt ++++ b/external/googleapis/CMakeLists.txt +@@ -25,7 +25,7 @@ set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256 + "6762083f829f998c3971efa2ba858c21d4ac4ba77feb9650bad7d358e3add2a5") + + set(EXTERNAL_GOOGLEAPIS_SOURCE +- "${CMAKE_BINARY_DIR}/external/googleapis/src/googleapis_download") ++ "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") + + set(EXTERNAL_GOOGLEAPIS_PROTO_FILES + "google/api/http.proto" +@@ -161,7 +161,7 @@ include(ExternalProject) + ExternalProject_Add( + googleapis_download + EXCLUDE_FROM_ALL ON +- PREFIX "${CMAKE_BINARY_DIR}/external/googleapis" ++ PREFIX "${PROJECT_BINARY_DIR}/external/googleapis" + URL ${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL} + URL_HASH SHA256=${GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256} + PATCH_COMMAND diff --git a/google-cloud-cpp/all/patches/2.5.0/001-use-googleapis-conan-package.patch b/google-cloud-cpp/all/patches/2.5.0/001-use-googleapis-conan-package.patch deleted file mode 100644 index 4473724..0000000 --- a/google-cloud-cpp/all/patches/2.5.0/001-use-googleapis-conan-package.patch +++ /dev/null @@ -1,1279 +0,0 @@ -diff --git a/cmake/CompileProtos.cmake b/cmake/CompileProtos.cmake -index 366edba..4eb5ea3 100644 ---- a/cmake/CompileProtos.cmake -+++ b/cmake/CompileProtos.cmake -@@ -362,20 +362,10 @@ function (google_cloud_cpp_proto_library libname) - return() - endif () - -- if (${_opt_LOCAL_INCLUDE}) -- google_cloud_cpp_generate_proto( -- proto_sources ${_opt_UNPARSED_ARGUMENTS} LOCAL_INCLUDE -- PROTO_PATH_DIRECTORIES ${_opt_PROTO_PATH_DIRECTORIES}) -- else () -- google_cloud_cpp_generate_proto( -- proto_sources ${_opt_UNPARSED_ARGUMENTS} PROTO_PATH_DIRECTORIES -- ${_opt_PROTO_PATH_DIRECTORIES}) -- endif () -- - add_library(${libname} ${proto_sources}) - set_property(TARGET ${libname} PROPERTY PROTO_SOURCES - ${_opt_UNPARSED_ARGUMENTS}) -- target_link_libraries(${libname} PUBLIC gRPC::grpc++ gRPC::grpc -+ target_link_libraries(${libname} PUBLIC gRPC::grpc++ gRPC::grpc googleapis::googleapis - protobuf::libprotobuf) - # We want to treat the generated code as "system" headers so they get - # ignored by the more aggressive warnings. -diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt -index ad2bd4b..28bf016 100644 ---- a/external/googleapis/CMakeLists.txt -+++ b/external/googleapis/CMakeLists.txt -@@ -16,24 +16,6 @@ - - include(GoogleapisConfig) - --set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL -- "https://github.com/googleapis/googleapis/archive/${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA}.tar.gz" -- "https://storage.googleapis.com/cloud-cpp-community-archive/com_google_googleapis/${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA}.tar.gz" --) --set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL_HASH -- "${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256}") --if (GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL) -- set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL -- ${GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL}) --endif () --if (GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL_HASH) -- set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL_HASH -- "${GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL_HASH}") --endif () -- --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") -- - set(EXTERNAL_GOOGLEAPIS_PROTO_FILES - # cmake-format: sort - "google/api/annotations.proto" -@@ -113,32 +95,6 @@ foreach (file IN LISTS protolists) - endforeach () - endforeach () - --include(ExternalProject) -- --externalproject_add( -- googleapis_download -- EXCLUDE_FROM_ALL ON -- PREFIX "${PROJECT_BINARY_DIR}/external/googleapis" -- URL ${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL} -- URL_HASH SHA256=${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL_HASH} -- PATCH_COMMAND -- "" -- # ~~~ -- # Scaffolding for patching googleapis after download. For example: -- # PATCH_COMMAND -- # patch -- # -p1 -- # --input=/workspace/external/googleapis.patch -- # NOTE: This should only be used while developing with a new -- # protobuf message. No changes to `PATCH_COMMAND` should ever be -- # committed to the main branch. -- # ~~~ -- CONFIGURE_COMMAND "" -- BUILD_COMMAND "" -- INSTALL_COMMAND "" -- BUILD_BYPRODUCTS ${EXTERNAL_GOOGLEAPIS_BYPRODUCTS} -- LOG_DOWNLOAD OFF) -- - # Sometimes (this happens often with vcpkg) protobuf is installed in a non- - # standard directory. We need to find out where, and then add that directory to - # the search path for protos. -@@ -187,7 +143,6 @@ function (external_googleapis_add_library proto) - endfunction () - - function (external_googleapis_set_version_and_alias short_name) -- add_dependencies("google_cloud_cpp_${short_name}" googleapis_download) - set_target_properties( - "google_cloud_cpp_${short_name}" - PROPERTIES EXPORT_NAME google-cloud-cpp::${short_name} -diff --git a/google/cloud/accessapproval/CMakeLists.txt b/google/cloud/accessapproval/CMakeLists.txt -index 43af932..e297251 100644 ---- a/google/cloud/accessapproval/CMakeLists.txt -+++ b/google/cloud/accessapproval/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::accessapproval_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/accesscontextmanager/CMakeLists.txt b/google/cloud/accesscontextmanager/CMakeLists.txt -index 9ff4ce8..3c96472 100644 ---- a/google/cloud/accesscontextmanager/CMakeLists.txt -+++ b/google/cloud/accesscontextmanager/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::accesscontextmanager_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/apigateway/CMakeLists.txt b/google/cloud/apigateway/CMakeLists.txt -index 5764bd3..517eb1e 100644 ---- a/google/cloud/apigateway/CMakeLists.txt -+++ b/google/cloud/apigateway/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::apigateway_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/apigeeconnect/CMakeLists.txt b/google/cloud/apigeeconnect/CMakeLists.txt -index 17bd60f..af353aa 100644 ---- a/google/cloud/apigeeconnect/CMakeLists.txt -+++ b/google/cloud/apigeeconnect/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::apigeeconnect_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/apikeys/CMakeLists.txt b/google/cloud/apikeys/CMakeLists.txt -index 9359474..6410175 100644 ---- a/google/cloud/apikeys/CMakeLists.txt -+++ b/google/cloud/apikeys/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::apikeys_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/appengine/CMakeLists.txt b/google/cloud/appengine/CMakeLists.txt -index 154a058..6136505 100644 ---- a/google/cloud/appengine/CMakeLists.txt -+++ b/google/cloud/appengine/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::appengine_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/artifactregistry/CMakeLists.txt b/google/cloud/artifactregistry/CMakeLists.txt -index 43d5f07..53184d4 100644 ---- a/google/cloud/artifactregistry/CMakeLists.txt -+++ b/google/cloud/artifactregistry/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::artifactregistry_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/asset/CMakeLists.txt b/google/cloud/asset/CMakeLists.txt -index dc33c07..6924523 100644 ---- a/google/cloud/asset/CMakeLists.txt -+++ b/google/cloud/asset/CMakeLists.txt -@@ -31,8 +31,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/assuredworkloads/CMakeLists.txt b/google/cloud/assuredworkloads/CMakeLists.txt -index a081c00..01332c6 100644 ---- a/google/cloud/assuredworkloads/CMakeLists.txt -+++ b/google/cloud/assuredworkloads/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::assuredworkloads_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/automl/CMakeLists.txt b/google/cloud/automl/CMakeLists.txt -index c890e5e..f711f54 100644 ---- a/google/cloud/automl/CMakeLists.txt -+++ b/google/cloud/automl/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::automl_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/baremetalsolution/CMakeLists.txt b/google/cloud/baremetalsolution/CMakeLists.txt -index df02616..f4cbee4 100644 ---- a/google/cloud/baremetalsolution/CMakeLists.txt -+++ b/google/cloud/baremetalsolution/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::baremetalsolution_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/batch/CMakeLists.txt b/google/cloud/batch/CMakeLists.txt -index 03a1a3d..9645386 100644 ---- a/google/cloud/batch/CMakeLists.txt -+++ b/google/cloud/batch/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::batch_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/beyondcorp/CMakeLists.txt b/google/cloud/beyondcorp/CMakeLists.txt -index e8eea05..24b9a98 100644 ---- a/google/cloud/beyondcorp/CMakeLists.txt -+++ b/google/cloud/beyondcorp/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::beyondcorp_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/billing/CMakeLists.txt b/google/cloud/billing/CMakeLists.txt -index 54c45e6..4c928e6 100644 ---- a/google/cloud/billing/CMakeLists.txt -+++ b/google/cloud/billing/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::billing_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/binaryauthorization/CMakeLists.txt b/google/cloud/binaryauthorization/CMakeLists.txt -index 9f8cd45..48363e2 100644 ---- a/google/cloud/binaryauthorization/CMakeLists.txt -+++ b/google/cloud/binaryauthorization/CMakeLists.txt -@@ -32,8 +32,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/certificatemanager/CMakeLists.txt b/google/cloud/certificatemanager/CMakeLists.txt -index 84a25b0..f4bae6d 100644 ---- a/google/cloud/certificatemanager/CMakeLists.txt -+++ b/google/cloud/certificatemanager/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::certificatemanager_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/channel/CMakeLists.txt b/google/cloud/channel/CMakeLists.txt -index ed6967b..ac19559 100644 ---- a/google/cloud/channel/CMakeLists.txt -+++ b/google/cloud/channel/CMakeLists.txt -@@ -35,8 +35,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::channel_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/cloudbuild/CMakeLists.txt b/google/cloud/cloudbuild/CMakeLists.txt -index 8f30f40..04d6a82 100644 ---- a/google/cloud/cloudbuild/CMakeLists.txt -+++ b/google/cloud/cloudbuild/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::cloudbuild_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/composer/CMakeLists.txt b/google/cloud/composer/CMakeLists.txt -index cde8542..c9af9d1 100644 ---- a/google/cloud/composer/CMakeLists.txt -+++ b/google/cloud/composer/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::composer_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/connectors/CMakeLists.txt b/google/cloud/connectors/CMakeLists.txt -index aef9110..cfd986f 100644 ---- a/google/cloud/connectors/CMakeLists.txt -+++ b/google/cloud/connectors/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::connectors_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/contactcenterinsights/CMakeLists.txt b/google/cloud/contactcenterinsights/CMakeLists.txt -index 03b74ed..3f8831c 100644 ---- a/google/cloud/contactcenterinsights/CMakeLists.txt -+++ b/google/cloud/contactcenterinsights/CMakeLists.txt -@@ -30,8 +30,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/container/CMakeLists.txt b/google/cloud/container/CMakeLists.txt -index 20a6c8b..dedca21 100644 ---- a/google/cloud/container/CMakeLists.txt -+++ b/google/cloud/container/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::container_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/containeranalysis/CMakeLists.txt b/google/cloud/containeranalysis/CMakeLists.txt -index 7548de3..e2486d2 100644 ---- a/google/cloud/containeranalysis/CMakeLists.txt -+++ b/google/cloud/containeranalysis/CMakeLists.txt -@@ -30,8 +30,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/datacatalog/CMakeLists.txt b/google/cloud/datacatalog/CMakeLists.txt -index 7e80060..dd20ab2 100644 ---- a/google/cloud/datacatalog/CMakeLists.txt -+++ b/google/cloud/datacatalog/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::datacatalog_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/datamigration/CMakeLists.txt b/google/cloud/datamigration/CMakeLists.txt -index ee95f1a..1772e90 100644 ---- a/google/cloud/datamigration/CMakeLists.txt -+++ b/google/cloud/datamigration/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::datamigration_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dataplex/CMakeLists.txt b/google/cloud/dataplex/CMakeLists.txt -index c83e390..079242e 100644 ---- a/google/cloud/dataplex/CMakeLists.txt -+++ b/google/cloud/dataplex/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dataplex_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dataproc/CMakeLists.txt b/google/cloud/dataproc/CMakeLists.txt -index ed180ca..e8c5912 100644 ---- a/google/cloud/dataproc/CMakeLists.txt -+++ b/google/cloud/dataproc/CMakeLists.txt -@@ -32,8 +32,6 @@ find_package(absl CONFIG REQUIRED) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/datastream/CMakeLists.txt b/google/cloud/datastream/CMakeLists.txt -index 7ecfd1f..2a7c100 100644 ---- a/google/cloud/datastream/CMakeLists.txt -+++ b/google/cloud/datastream/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::datastream_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/debugger/CMakeLists.txt b/google/cloud/debugger/CMakeLists.txt -index 8c299f3..3fae60d 100644 ---- a/google/cloud/debugger/CMakeLists.txt -+++ b/google/cloud/debugger/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::debugger_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/deploy/CMakeLists.txt b/google/cloud/deploy/CMakeLists.txt -index 73c0d68..9181cb8 100644 ---- a/google/cloud/deploy/CMakeLists.txt -+++ b/google/cloud/deploy/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::deploy_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dialogflow_cx/CMakeLists.txt b/google/cloud/dialogflow_cx/CMakeLists.txt -index 90c70e3..4aead59 100644 ---- a/google/cloud/dialogflow_cx/CMakeLists.txt -+++ b/google/cloud/dialogflow_cx/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dialogflow_cx_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dialogflow_es/CMakeLists.txt b/google/cloud/dialogflow_es/CMakeLists.txt -index 0ddf345..fad8716 100644 ---- a/google/cloud/dialogflow_es/CMakeLists.txt -+++ b/google/cloud/dialogflow_es/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dialogflow_es_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dlp/CMakeLists.txt b/google/cloud/dlp/CMakeLists.txt -index 67c6329..f6eaa27 100644 ---- a/google/cloud/dlp/CMakeLists.txt -+++ b/google/cloud/dlp/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dlp_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/documentai/CMakeLists.txt b/google/cloud/documentai/CMakeLists.txt -index 00bc94b..42fd1e1 100644 ---- a/google/cloud/documentai/CMakeLists.txt -+++ b/google/cloud/documentai/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::documentai_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/edgecontainer/CMakeLists.txt b/google/cloud/edgecontainer/CMakeLists.txt -index 4cacb9a..08a2f2e 100644 ---- a/google/cloud/edgecontainer/CMakeLists.txt -+++ b/google/cloud/edgecontainer/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::edgecontainer_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/eventarc/CMakeLists.txt b/google/cloud/eventarc/CMakeLists.txt -index d5e2854..fe37f94 100644 ---- a/google/cloud/eventarc/CMakeLists.txt -+++ b/google/cloud/eventarc/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::eventarc_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/filestore/CMakeLists.txt b/google/cloud/filestore/CMakeLists.txt -index 1f5a0e8..0ae2d00 100644 ---- a/google/cloud/filestore/CMakeLists.txt -+++ b/google/cloud/filestore/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::filestore_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/functions/CMakeLists.txt b/google/cloud/functions/CMakeLists.txt -index ec9ebcd..50d9fc7 100644 ---- a/google/cloud/functions/CMakeLists.txt -+++ b/google/cloud/functions/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::functions_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/gameservices/CMakeLists.txt b/google/cloud/gameservices/CMakeLists.txt -index 30d81ff..0b9cf8c 100644 ---- a/google/cloud/gameservices/CMakeLists.txt -+++ b/google/cloud/gameservices/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::gameservices_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/gkehub/CMakeLists.txt b/google/cloud/gkehub/CMakeLists.txt -index 1747a18..d71c854 100644 ---- a/google/cloud/gkehub/CMakeLists.txt -+++ b/google/cloud/gkehub/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::gkehub_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/grafeas/CMakeLists.txt b/google/cloud/grafeas/CMakeLists.txt -index 2ed9350..33ba5fd 100644 ---- a/google/cloud/grafeas/CMakeLists.txt -+++ b/google/cloud/grafeas/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::grafeas_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/iap/CMakeLists.txt b/google/cloud/iap/CMakeLists.txt -index a22e9b0..4c78edb 100644 ---- a/google/cloud/iap/CMakeLists.txt -+++ b/google/cloud/iap/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::iap_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/ids/CMakeLists.txt b/google/cloud/ids/CMakeLists.txt -index 4724bf2..fc73ea3 100644 ---- a/google/cloud/ids/CMakeLists.txt -+++ b/google/cloud/ids/CMakeLists.txt -@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::ids_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/iot/CMakeLists.txt b/google/cloud/iot/CMakeLists.txt -index 3619b82..1874025 100644 ---- a/google/cloud/iot/CMakeLists.txt -+++ b/google/cloud/iot/CMakeLists.txt -@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::iot_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/kms/CMakeLists.txt b/google/cloud/kms/CMakeLists.txt -index 14a2ef3..59a3596 100644 ---- a/google/cloud/kms/CMakeLists.txt -+++ b/google/cloud/kms/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::kms_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/language/CMakeLists.txt b/google/cloud/language/CMakeLists.txt -index 123ef3c..add8dbc 100644 ---- a/google/cloud/language/CMakeLists.txt -+++ b/google/cloud/language/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::language_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/managedidentities/CMakeLists.txt b/google/cloud/managedidentities/CMakeLists.txt -index 674ce03..b5e4bfa 100644 ---- a/google/cloud/managedidentities/CMakeLists.txt -+++ b/google/cloud/managedidentities/CMakeLists.txt -@@ -31,8 +31,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::managedidentities_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/memcache/CMakeLists.txt b/google/cloud/memcache/CMakeLists.txt -index 8a0ad6b..2fafadc 100644 ---- a/google/cloud/memcache/CMakeLists.txt -+++ b/google/cloud/memcache/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::memcache_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/monitoring/CMakeLists.txt b/google/cloud/monitoring/CMakeLists.txt -index e021974..346a1a6 100644 ---- a/google/cloud/monitoring/CMakeLists.txt -+++ b/google/cloud/monitoring/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::monitoring_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/networkconnectivity/CMakeLists.txt b/google/cloud/networkconnectivity/CMakeLists.txt -index 4ca5e45..ffe44d2 100644 ---- a/google/cloud/networkconnectivity/CMakeLists.txt -+++ b/google/cloud/networkconnectivity/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::networkconnectivity_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/networkmanagement/CMakeLists.txt b/google/cloud/networkmanagement/CMakeLists.txt -index 3fe12a5..d94db72 100644 ---- a/google/cloud/networkmanagement/CMakeLists.txt -+++ b/google/cloud/networkmanagement/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::networkmanagement_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/notebooks/CMakeLists.txt b/google/cloud/notebooks/CMakeLists.txt -index 4cc76ea..2508e4b 100644 ---- a/google/cloud/notebooks/CMakeLists.txt -+++ b/google/cloud/notebooks/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::notebooks_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/optimization/CMakeLists.txt b/google/cloud/optimization/CMakeLists.txt -index 474c28a..e37eb3f 100644 ---- a/google/cloud/optimization/CMakeLists.txt -+++ b/google/cloud/optimization/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::optimization_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/orgpolicy/CMakeLists.txt b/google/cloud/orgpolicy/CMakeLists.txt -index b6935e6..8fe4286 100644 ---- a/google/cloud/orgpolicy/CMakeLists.txt -+++ b/google/cloud/orgpolicy/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::orgpolicy_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/osconfig/CMakeLists.txt b/google/cloud/osconfig/CMakeLists.txt -index 7b5dfe5..19f88a1 100644 ---- a/google/cloud/osconfig/CMakeLists.txt -+++ b/google/cloud/osconfig/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::osconfig_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/oslogin/CMakeLists.txt b/google/cloud/oslogin/CMakeLists.txt -index 1092f6f..87410cf 100644 ---- a/google/cloud/oslogin/CMakeLists.txt -+++ b/google/cloud/oslogin/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::oslogin_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/policytroubleshooter/CMakeLists.txt b/google/cloud/policytroubleshooter/CMakeLists.txt -index aa934d5..9f0bb42 100644 ---- a/google/cloud/policytroubleshooter/CMakeLists.txt -+++ b/google/cloud/policytroubleshooter/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::policytroubleshooter_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/privateca/CMakeLists.txt b/google/cloud/privateca/CMakeLists.txt -index 5ba62ac..b47750d 100644 ---- a/google/cloud/privateca/CMakeLists.txt -+++ b/google/cloud/privateca/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::privateca_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/profiler/CMakeLists.txt b/google/cloud/profiler/CMakeLists.txt -index b1388dc..d2fe3b2 100644 ---- a/google/cloud/profiler/CMakeLists.txt -+++ b/google/cloud/profiler/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::profiler_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/pubsublite/CMakeLists.txt b/google/cloud/pubsublite/CMakeLists.txt -index 12b2b33..2ec80d0 100644 ---- a/google/cloud/pubsublite/CMakeLists.txt -+++ b/google/cloud/pubsublite/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::pubsublite_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/recommender/CMakeLists.txt b/google/cloud/recommender/CMakeLists.txt -index b44cd96..26fdfb5 100644 ---- a/google/cloud/recommender/CMakeLists.txt -+++ b/google/cloud/recommender/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::recommender_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/redis/CMakeLists.txt b/google/cloud/redis/CMakeLists.txt -index 9387bbd..c3bbd0e 100644 ---- a/google/cloud/redis/CMakeLists.txt -+++ b/google/cloud/redis/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::redis_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/resourcemanager/CMakeLists.txt b/google/cloud/resourcemanager/CMakeLists.txt -index d445a8f..2689c33 100644 ---- a/google/cloud/resourcemanager/CMakeLists.txt -+++ b/google/cloud/resourcemanager/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::resourcemanager_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/resourcesettings/CMakeLists.txt b/google/cloud/resourcesettings/CMakeLists.txt -index afac58e..c0b4359 100644 ---- a/google/cloud/resourcesettings/CMakeLists.txt -+++ b/google/cloud/resourcesettings/CMakeLists.txt -@@ -32,8 +32,6 @@ find_package(absl CONFIG REQUIRED) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/retail/CMakeLists.txt b/google/cloud/retail/CMakeLists.txt -index cbda24a..da3b066 100644 ---- a/google/cloud/retail/CMakeLists.txt -+++ b/google/cloud/retail/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::retail_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/run/CMakeLists.txt b/google/cloud/run/CMakeLists.txt -index f771798..7906713 100644 ---- a/google/cloud/run/CMakeLists.txt -+++ b/google/cloud/run/CMakeLists.txt -@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::run_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/scheduler/CMakeLists.txt b/google/cloud/scheduler/CMakeLists.txt -index d4e2310..eeaae20 100644 ---- a/google/cloud/scheduler/CMakeLists.txt -+++ b/google/cloud/scheduler/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::scheduler_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/secretmanager/CMakeLists.txt b/google/cloud/secretmanager/CMakeLists.txt -index f33f9bf..949f929 100644 ---- a/google/cloud/secretmanager/CMakeLists.txt -+++ b/google/cloud/secretmanager/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::secretmanager_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/securitycenter/CMakeLists.txt b/google/cloud/securitycenter/CMakeLists.txt -index e482223..bad25ac 100644 ---- a/google/cloud/securitycenter/CMakeLists.txt -+++ b/google/cloud/securitycenter/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::securitycenter_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/servicecontrol/CMakeLists.txt b/google/cloud/servicecontrol/CMakeLists.txt -index b2f6362..c1c55f3 100644 ---- a/google/cloud/servicecontrol/CMakeLists.txt -+++ b/google/cloud/servicecontrol/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::servicecontrol_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/servicedirectory/CMakeLists.txt b/google/cloud/servicedirectory/CMakeLists.txt -index a66c216..527201a 100644 ---- a/google/cloud/servicedirectory/CMakeLists.txt -+++ b/google/cloud/servicedirectory/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::servicedirectory_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/servicemanagement/CMakeLists.txt b/google/cloud/servicemanagement/CMakeLists.txt -index 96b1a0b..c9981ae 100644 ---- a/google/cloud/servicemanagement/CMakeLists.txt -+++ b/google/cloud/servicemanagement/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::servicemanagement_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/serviceusage/CMakeLists.txt b/google/cloud/serviceusage/CMakeLists.txt -index f9b199a..fddb936 100644 ---- a/google/cloud/serviceusage/CMakeLists.txt -+++ b/google/cloud/serviceusage/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::serviceusage_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/shell/CMakeLists.txt b/google/cloud/shell/CMakeLists.txt -index 178b8bc..a7181f6 100644 ---- a/google/cloud/shell/CMakeLists.txt -+++ b/google/cloud/shell/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::shell_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/speech/CMakeLists.txt b/google/cloud/speech/CMakeLists.txt -index 4cc2e0a..3f52437 100644 ---- a/google/cloud/speech/CMakeLists.txt -+++ b/google/cloud/speech/CMakeLists.txt -@@ -39,8 +39,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::speech_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/storagetransfer/CMakeLists.txt b/google/cloud/storagetransfer/CMakeLists.txt -index fd8a5ae..163e9b4 100644 ---- a/google/cloud/storagetransfer/CMakeLists.txt -+++ b/google/cloud/storagetransfer/CMakeLists.txt -@@ -38,8 +38,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::storagetransfer_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/talent/CMakeLists.txt b/google/cloud/talent/CMakeLists.txt -index 574023e..405dc48 100644 ---- a/google/cloud/talent/CMakeLists.txt -+++ b/google/cloud/talent/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::talent_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/tasks/CMakeLists.txt b/google/cloud/tasks/CMakeLists.txt -index 3b5678e..026f9b1 100644 ---- a/google/cloud/tasks/CMakeLists.txt -+++ b/google/cloud/tasks/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::tasks_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/texttospeech/CMakeLists.txt b/google/cloud/texttospeech/CMakeLists.txt -index 0fdc54a..840e8d4 100644 ---- a/google/cloud/texttospeech/CMakeLists.txt -+++ b/google/cloud/texttospeech/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::texttospeech_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/tpu/CMakeLists.txt b/google/cloud/tpu/CMakeLists.txt -index 2666b6b..cdaf519 100644 ---- a/google/cloud/tpu/CMakeLists.txt -+++ b/google/cloud/tpu/CMakeLists.txt -@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::tpu_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/trace/CMakeLists.txt b/google/cloud/trace/CMakeLists.txt -index 99a04f5..80d4c1b 100644 ---- a/google/cloud/trace/CMakeLists.txt -+++ b/google/cloud/trace/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::trace_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/translate/CMakeLists.txt b/google/cloud/translate/CMakeLists.txt -index f8a0394..6a44718 100644 ---- a/google/cloud/translate/CMakeLists.txt -+++ b/google/cloud/translate/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::translate_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/video/CMakeLists.txt b/google/cloud/video/CMakeLists.txt -index b1b2628..df98ae4 100644 ---- a/google/cloud/video/CMakeLists.txt -+++ b/google/cloud/video/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::video_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/videointelligence/CMakeLists.txt b/google/cloud/videointelligence/CMakeLists.txt -index 1963d27..4638ddc 100644 ---- a/google/cloud/videointelligence/CMakeLists.txt -+++ b/google/cloud/videointelligence/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::videointelligence_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/vision/CMakeLists.txt b/google/cloud/vision/CMakeLists.txt -index b23e737..004b803 100644 ---- a/google/cloud/vision/CMakeLists.txt -+++ b/google/cloud/vision/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vision_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/vmmigration/CMakeLists.txt b/google/cloud/vmmigration/CMakeLists.txt -index aa88701..e799a3b 100644 ---- a/google/cloud/vmmigration/CMakeLists.txt -+++ b/google/cloud/vmmigration/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vmmigration_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/vmwareengine/CMakeLists.txt b/google/cloud/vmwareengine/CMakeLists.txt -index 55adb2f..79c0f53 100644 ---- a/google/cloud/vmwareengine/CMakeLists.txt -+++ b/google/cloud/vmwareengine/CMakeLists.txt -@@ -38,8 +38,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vmwareengine_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/vpcaccess/CMakeLists.txt b/google/cloud/vpcaccess/CMakeLists.txt -index 5ce47b7..dc7454e 100644 ---- a/google/cloud/vpcaccess/CMakeLists.txt -+++ b/google/cloud/vpcaccess/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vpcaccess_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/webrisk/CMakeLists.txt b/google/cloud/webrisk/CMakeLists.txt -index 5be0ce7..5d3123f 100644 ---- a/google/cloud/webrisk/CMakeLists.txt -+++ b/google/cloud/webrisk/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::webrisk_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/websecurityscanner/CMakeLists.txt b/google/cloud/websecurityscanner/CMakeLists.txt -index e21608e..c95230e 100644 ---- a/google/cloud/websecurityscanner/CMakeLists.txt -+++ b/google/cloud/websecurityscanner/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::websecurityscanner_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/workflows/CMakeLists.txt b/google/cloud/workflows/CMakeLists.txt -index 76c239a..aef6492 100644 ---- a/google/cloud/workflows/CMakeLists.txt -+++ b/google/cloud/workflows/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::workflows_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") diff --git a/google-cloud-cpp/all/patches/2.5.0/002-interface-library-properties.patch b/google-cloud-cpp/all/patches/2.5.0/002-interface-library-properties.patch deleted file mode 100644 index 6800c78..0000000 --- a/google-cloud-cpp/all/patches/2.5.0/002-interface-library-properties.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/cmake/CompileProtos.cmake b/cmake/CompileProtos.cmake -index 4eb5ea3..9de47cd 100644 ---- a/cmake/CompileProtos.cmake -+++ b/cmake/CompileProtos.cmake -@@ -315,6 +315,10 @@ include(GNUInstallDirs) - - # Install headers for a C++ proto library. - function (google_cloud_cpp_install_proto_library_headers target) -+ get_target_property(type ${target} TYPE) -+ if ("${type}" STREQUAL "INTERFACE_LIBRARY") -+ return() -+ endif () - get_target_property(target_sources ${target} SOURCES) - foreach (header ${target_sources}) - # Skip anything that is not a header file. -@@ -332,6 +336,10 @@ endfunction () - - # Install protos for a C++ proto library. - function (google_cloud_cpp_install_proto_library_protos target source_dir) -+ get_target_property(type ${target} TYPE) -+ if ("${type}" STREQUAL "INTERFACE_LIBRARY") -+ return() -+ endif () - get_target_property(target_protos ${target} PROTO_SOURCES) - foreach (header ${target_protos}) - # Skip anything that is not a header file. -diff --git a/google/cloud/dialogflow_es/CMakeLists.txt b/google/cloud/dialogflow_es/CMakeLists.txt -index fad8716..cc44723 100644 ---- a/google/cloud/dialogflow_es/CMakeLists.txt -+++ b/google/cloud/dialogflow_es/CMakeLists.txt -@@ -35,7 +35,12 @@ endif () - - include(CompileProtos) - add_library(google_cloud_cpp_dialogflow_es_protos INTERFACE) --external_googleapis_set_version_and_alias(dialogflow_es_protos) -+set_target_properties( -+ google_cloud_cpp_dialogflow_es_protos -+ PROPERTIES EXPORT_NAME google-cloud-cpp::dialogflow_es_protos) -+add_library(google-cloud-cpp::dialogflow_es_protos ALIAS -+ google_cloud_cpp_dialogflow_es_protos) -+ - target_link_libraries( - google_cloud_cpp_dialogflow_es_protos - PUBLIC diff --git a/google-cloud-cpp/all/test_package/CMakeLists.txt b/google-cloud-cpp/all/test_package/CMakeLists.txt index fb836ee..a657ae7 100644 --- a/google-cloud-cpp/all/test_package/CMakeLists.txt +++ b/google-cloud-cpp/all/test_package/CMakeLists.txt @@ -1,20 +1,14 @@ -cmake_minimum_required(VERSION 3.10...3.24) -project(google-cloud-cpp-test CXX) +cmake_minimum_required(VERSION 3.5) +project(google-cloud-cpp-storage-quickstart CXX C) -find_package(google-cloud-cpp CONFIG REQUIRED) +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) -# There are too many libraries to test them all. We -# should pick what we test with a view to detecting -# the most common packaging problems. +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) -# Bigtable, Pub/Sub and Spanner have signficant amounts of -# custom code and thus some amount of ad-hoc dependencies on -# absl::* components. -# Storage has custom code and does not depend on gRPC or Protobuf. -# Speech is a good model for most other libraries. -#foreach(component IN ITEMS "bigtable" "pubsub" "spanner" "speech" "storage") -foreach(component IN ITEMS "storage") - add_executable("${component}" "${component}.cpp") - target_compile_features("${component}" PRIVATE cxx_std_14) - target_link_libraries("${component}" google-cloud-cpp::${component}) -endforeach() +find_package(google-cloud-cpp REQUIRED) + +# Once the packages are found, define the targets. +add_executable(storage storage.cpp) +target_link_libraries(storage google-cloud-cpp::storage) diff --git a/google-cloud-cpp/all/test_package/CMakeUserPresets.json b/google-cloud-cpp/all/test_package/CMakeUserPresets.json deleted file mode 100644 index 45812a7..0000000 --- a/google-cloud-cpp/all/test_package/CMakeUserPresets.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 4, - "vendor": { - "conan": {} - }, - "include": [ - "/home/zhanglu/github/bugfix/conanfiles/google-cloud-cpp/all/test_package/build/Release/generators/CMakePresets.json" - ] -} \ No newline at end of file diff --git a/google-cloud-cpp/all/test_package/conanfile.py b/google-cloud-cpp/all/test_package/conanfile.py index 08c97a1..39f0d11 100644 --- a/google-cloud-cpp/all/test_package/conanfile.py +++ b/google-cloud-cpp/all/test_package/conanfile.py @@ -1,28 +1,9 @@ +from conans import ConanFile, CMake, tools import os -from conan import ConanFile -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.build import can_run -from conan.tools.env import VirtualRunEnv - class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - def layout(self): - cmake_layout(self) - - def generate(self): - tc = CMakeToolchain(self) - tc.generate() - # Environment so that the compiled test executable can load shared libraries - runenv = VirtualRunEnv(self) - runenv.generate(scope="run") - deps = CMakeDeps(self) - deps.generate() + generators = "cmake", "cmake_find_package" def build(self): cmake = CMake(self) @@ -30,8 +11,6 @@ def build(self): cmake.build() def test(self): - if not can_run(self): - return - for test in ["storage"]: - cmd = os.path.join(self.cpp.build.bindir, test) - self.run(cmd, env="conanrun") + if not tools.cross_building(self): + bin_path = os.path.join("bin", "storage") + self.run("%s bucket_name" % bin_path, run_environment=True) diff --git a/google-cloud-cpp/all/test_package/storage.cpp b/google-cloud-cpp/all/test_package/storage.cpp index ae43da9..1cd9a7f 100644 --- a/google-cloud-cpp/all/test_package/storage.cpp +++ b/google-cloud-cpp/all/test_package/storage.cpp @@ -1,18 +1,24 @@ -#include +#include "google/cloud/storage/client.h" #include int main(int argc, char* argv[]) { - if (argc != 1) { - std::cerr << "Usage: storage\n"; + if (argc != 2) { + std::cerr << "Missing bucket name.\n"; + std::cerr << "Usage: quickstart \n"; return 1; } + std::string const bucket_name = argv[1]; // Create aliases to make the code easier to read. namespace gcs = google::cloud::storage; // Create a client to communicate with Google Cloud Storage. This client // uses the default configuration for authentication and project id. - std::cout << "Testing google-cloud-cpp::storage library " << google::cloud::version_string() << "\n"; - auto client = gcs::Client(); - return 0; + google::cloud::StatusOr client = + gcs::Client::CreateDefaultClient(); + if (!client) { + std::cerr << "Failed to create Storage Client, status=" << client.status() + << "\n"; + return 0; + } } diff --git a/google-cloud-cpp/config.yml b/google-cloud-cpp/config.yml index 5cfb6fa..bb19be7 100644 --- a/google-cloud-cpp/config.yml +++ b/google-cloud-cpp/config.yml @@ -1,3 +1,17 @@ versions: - "2.5.0": + "1.26.1": folder: "all" + "1.27.0": + folder: "all" + "1.30.1": + folder: "all" + "1.31.1": + folder: "all" + "1.40.1": + folder: "all" + "2.12.0": + folder: "2.x" + "2.15.1": + folder: "2.x" + "2.19.0": + folder: "2.x" diff --git a/googleapis/all/conan.lock b/googleapis/all/conan.lock deleted file mode 100644 index 6dbba1a..0000000 --- a/googleapis/all/conan.lock +++ /dev/null @@ -1,35 +0,0 @@ -{ - "graph_lock": { - "nodes": { - "0": { - "ref": "googleapis/cci.20221108", - "options": "fPIC=True\nshared=False\nprotobuf:debug_suffix=True\nprotobuf:fPIC=True\nprotobuf:lite=False\nprotobuf:shared=False\nprotobuf:with_rtti=True\nprotobuf:with_zlib=True\nzlib:fPIC=True\nzlib:shared=False", - "requires": [ - "1" - ], - "path": "conanfile.py", - "context": "host" - }, - "1": { - "ref": "protobuf/3.21.9", - "options": "debug_suffix=True\nfPIC=True\nlite=False\nshared=False\nwith_rtti=True\nwith_zlib=True\nzlib:fPIC=True\nzlib:shared=False", - "package_id": "bd2be2a8b53548ddd6c9941d952979f99c859162", - "prev": "0", - "requires": [ - "2" - ], - "context": "host" - }, - "2": { - "ref": "zlib/1.2.13", - "options": "fPIC=True\nshared=False", - "package_id": "f568eec00a82af2100dc006430c1be98df6d77fa", - "prev": "0", - "context": "host" - } - }, - "revisions_enabled": false - }, - "version": "0.4", - "profile_host": "[settings]\narch=armv8\narch_build=armv8\nbuild_type=Release\ncompiler=clang\ncompiler.cppstd=17\ncompiler.libcxx=libc++\ncompiler.version=15\nos=Macos\nos_build=Macos\n[options]\n[build_requires]\n[env]\nCC=/usr/local/opt/llvm/bin/clang\nCXX=/usr/local/opt/llvm/bin/clang++" -} \ No newline at end of file diff --git a/googleapis/all/conanbuildinfo.txt b/googleapis/all/conanbuildinfo.txt deleted file mode 100644 index 3e3a832..0000000 --- a/googleapis/all/conanbuildinfo.txt +++ /dev/null @@ -1,190 +0,0 @@ -[includedirs] -/Users/jiaoew/.conan/data/protobuf/3.21.9/_/_/package/bd2be2a8b53548ddd6c9941d952979f99c859162/include -/Users/jiaoew/.conan/data/zlib/1.2.13/_/_/package/f568eec00a82af2100dc006430c1be98df6d77fa/include - -[libdirs] -/Users/jiaoew/.conan/data/protobuf/3.21.9/_/_/package/bd2be2a8b53548ddd6c9941d952979f99c859162/lib -/Users/jiaoew/.conan/data/zlib/1.2.13/_/_/package/f568eec00a82af2100dc006430c1be98df6d77fa/lib - -[bindirs] -/Users/jiaoew/.conan/data/protobuf/3.21.9/_/_/package/bd2be2a8b53548ddd6c9941d952979f99c859162/bin - -[resdirs] - - -[builddirs] -/Users/jiaoew/.conan/data/protobuf/3.21.9/_/_/package/bd2be2a8b53548ddd6c9941d952979f99c859162/lib/cmake/protobuf -/Users/jiaoew/.conan/data/zlib/1.2.13/_/_/package/f568eec00a82af2100dc006430c1be98df6d77fa/ - -[libs] -protoc -protobuf -z - -[system_libs] - - -[defines] - - -[cppflags] - - -[cxxflags] - - -[cflags] - - -[sharedlinkflags] - - -[exelinkflags] - - -[sysroot] - - -[frameworks] - - -[frameworkdirs] - - - -[includedirs_protobuf] -/Users/jiaoew/.conan/data/protobuf/3.21.9/_/_/package/bd2be2a8b53548ddd6c9941d952979f99c859162/include - -[libdirs_protobuf] -/Users/jiaoew/.conan/data/protobuf/3.21.9/_/_/package/bd2be2a8b53548ddd6c9941d952979f99c859162/lib - -[bindirs_protobuf] -/Users/jiaoew/.conan/data/protobuf/3.21.9/_/_/package/bd2be2a8b53548ddd6c9941d952979f99c859162/bin - -[resdirs_protobuf] - - -[builddirs_protobuf] -/Users/jiaoew/.conan/data/protobuf/3.21.9/_/_/package/bd2be2a8b53548ddd6c9941d952979f99c859162/lib/cmake/protobuf - -[libs_protobuf] -protoc -protobuf - -[system_libs_protobuf] - - -[defines_protobuf] - - -[cppflags_protobuf] - - -[cxxflags_protobuf] - - -[cflags_protobuf] - - -[sharedlinkflags_protobuf] - - -[exelinkflags_protobuf] - - -[sysroot_protobuf] - - -[frameworks_protobuf] - - -[frameworkdirs_protobuf] - - -[rootpath_protobuf] -/Users/jiaoew/.conan/data/protobuf/3.21.9/_/_/package/bd2be2a8b53548ddd6c9941d952979f99c859162 - -[name_protobuf] -protobuf - -[version_protobuf] -3.21.9 - -[generatornames_protobuf] -pkg_config=protobuf_full_package - -[generatorfilenames_protobuf] -cmake_find_package=Protobuf -cmake_find_package_multi=protobuf - - -[includedirs_zlib] -/Users/jiaoew/.conan/data/zlib/1.2.13/_/_/package/f568eec00a82af2100dc006430c1be98df6d77fa/include - -[libdirs_zlib] -/Users/jiaoew/.conan/data/zlib/1.2.13/_/_/package/f568eec00a82af2100dc006430c1be98df6d77fa/lib - -[bindirs_zlib] - - -[resdirs_zlib] - - -[builddirs_zlib] -/Users/jiaoew/.conan/data/zlib/1.2.13/_/_/package/f568eec00a82af2100dc006430c1be98df6d77fa/ - -[libs_zlib] -z - -[system_libs_zlib] - - -[defines_zlib] - - -[cppflags_zlib] - - -[cxxflags_zlib] - - -[cflags_zlib] - - -[sharedlinkflags_zlib] - - -[exelinkflags_zlib] - - -[sysroot_zlib] - - -[frameworks_zlib] - - -[frameworkdirs_zlib] - - -[rootpath_zlib] -/Users/jiaoew/.conan/data/zlib/1.2.13/_/_/package/f568eec00a82af2100dc006430c1be98df6d77fa - -[name_zlib] -zlib - -[version_zlib] -1.2.13 - -[generatornames_zlib] -cmake_find_package=ZLIB -cmake_find_package_multi=ZLIB - -[generatorfilenames_zlib] - - - -[USER_protobuf] -[USER_zlib] -[ENV_protobuf] -PATH=["/Users/jiaoew/.conan/data/protobuf/3.21.9/_/_/package/bd2be2a8b53548ddd6c9941d952979f99c859162/bin"] -[ENV_zlib] \ No newline at end of file diff --git a/googleapis/all/conandata.yml b/googleapis/all/conandata.yml index d67e778..1c14a17 100644 --- a/googleapis/all/conandata.yml +++ b/googleapis/all/conandata.yml @@ -7,6 +7,9 @@ # (master branch) https://github.com/grpc/grpc/blob/master/CMakeLists.txt#L347 sources: + "cci.20230501": + url: "https://github.com/googleapis/googleapis/archive/2da477b6a72168c65fdb4245530cfa702cc4b029.tar.gz" + sha256: "3e48e5833fcd2e1fcb8b6a5b7a88e18503b670e8636b868cdb5ac32e00fbdafb" "cci.20221108": url: "https://github.com/googleapis/googleapis/archive/67b2d7c2fb11188776bc398f02c67fccd8187502.zip" sha256: "cca450c34e3a8adc03364686d44748f362e4a9af6d3ef32b918f2d5483a3025e" diff --git a/googleapis/all/conanfile.py b/googleapis/all/conanfile.py index f710156..7d10eb1 100644 --- a/googleapis/all/conanfile.py +++ b/googleapis/all/conanfile.py @@ -1,20 +1,20 @@ -import os import functools import glob -from io import StringIO +import os from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd -from conan.tools.cmake import cmake_layout, CMake -from conan.tools.files import apply_conandata_patches, copy, get, export_conandata_patches, copy +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get from conan.tools.microsoft import is_msvc from conan.tools.scm import Version - from helpers import parse_proto_libraries -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.60.0 <2 || >=2.0.5" + class GoogleAPIS(ConanFile): name = "googleapis" @@ -25,70 +25,70 @@ class GoogleAPIS(ConanFile): homepage = "https://github.com/googleapis/googleapis" topics = "google", "protos", "api" settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain" options = { "shared": [True, False], - "fPIC": [True, False] - } + "fPIC": [True, False], + } default_options = { "shared": False, - "fPIC": True - } + "fPIC": True, + } exports = "helpers.py" short_paths = True + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + def export_sources(self): copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=os.path.join(self.export_sources_folder, "src")) export_conandata_patches(self) - def source(self): - get(self, **self.conan_data["sources"][str(self.version)], destination=self.source_folder, strip_root=True) - def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") - def layout(self): - cmake_layout(self, src_folder="src") - def configure(self): if self.options.shared: self.options.rm_safe("fPIC") self.options["protobuf"].shared = True + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # https://github.com/conan-io/conan-center-index/pull/15601#issuecomment-1493086506 + self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True) + def validate(self): - if self.settings.compiler.cppstd: + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "5": raise ConanInvalidConfiguration("Build with GCC 5 fails") if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration("Source code generated from protos is missing some export macro") - if self.options.shared and not self.dependencies["protobuf"].options.shared: + if self.options.shared and not self.dependencies.host["protobuf"].options.shared: raise ConanInvalidConfiguration("If built as shared, protobuf must be shared as well. Please, use `protobuf:shared=True`") - @property - def _cmake_new_enough(self): - try: - import re - output = StringIO() - self.run("cmake --version", output=output) - m = re.search(r'cmake version (\d+)\.(\d+)\.(\d+)', output.getvalue()) - major, minor = int(m.group(1)), int(m.group(2)) - assert major >= 3 and minor >= 20 - except: - return False - else: - return True - - def requirements(self): - self.requires('protobuf/3.21.4', transitive_headers=True) - def build_requirements(self): - self.build_requires('protobuf/3.21.4') + if not self._is_legacy_one_profile: + self.tool_requires("protobuf/") + # CMake >= 3.20 is required. There is a proto with dots in the name 'k8s.min.proto' and CMake fails to generate project files - if not self._cmake_new_enough: - self.build_requires('cmake/3.23.5') + self.tool_requires("cmake/[>=3.20 <4]") + + def source(self): + get(self, **self.conan_data["sources"][str(self.version)], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + if self._is_legacy_one_profile: + VirtualRunEnv(self).generate(scope="build") + tc = CMakeToolchain(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() @functools.lru_cache(1) def _parse_proto_libraries(self): @@ -125,8 +125,9 @@ def deactivate_library(key): all_dict[key].is_used = False # - Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs: GID_MAX # Patched here: https://github.com/protocolbuffers/protobuf/commit/f138d5de2535eb7dd7c8d0ad5eb16d128ab221fd - # as of 3.21.4 issue still exist - if Version(self.dependencies["protobuf"].ref.version) <= "3.21.5" and self.settings.os == "Macos" or \ + # https://github.com/conan-io/conan-center-index/pull/16034/files#r1159042324 + # This was fixed in the v22 release which starts at 4.22 for the C++ library + if Version(self.dependencies["protobuf"].ref.version) <= "3.21.9" and self.settings.os == "Macos" or \ self.settings.os == "Android": deactivate_library("//google/storagetransfer/v1:storagetransfer_proto") deactivate_library("//google/storagetransfer/v1:storagetransfer_cc_proto") @@ -151,6 +152,14 @@ def deactivate_library(key): deactivate_library("//google/cloud/talent/v4:talent_cc_proto") deactivate_library("//google/cloud/asset/v1:asset_proto") deactivate_library("//google/cloud/asset/v1:asset_cc_proto") + # This fails to build on Windows. It is arguably a missing feature of + # Protobuf. + # https://github.com/protocolbuffers/protobuf/issues/12774 + # Fortunately this library is not used by any downstream packages + # (grpc-protos, or google-cloud-cpp), and it is only "beta" at the + # moment. Simply disable it for now. + deactivate_library("//google/cloud/lifesciences/v2beta:lifesciences_proto") + deactivate_library("//google/cloud/lifesciences/v2beta:lifesciences_cc_proto") return proto_libraries @@ -187,9 +196,6 @@ def package(self): interface = 'LIB' if lib.srcs else 'INTERFACE' f.write(f"{lib.cmake_target} {interface} {','.join(lib.cmake_deps)}\n") - def package_id(self): - self.info.requires["protobuf"].full_package_mode() - def package_info(self): with open(os.path.join(self.package_folder, self._DEPS_FILE), "r", encoding="utf-8") as f: for line in f.read().splitlines(): @@ -198,6 +204,6 @@ def package_info(self): self.cpp_info.components[name].resdirs = ["res"] if libtype == 'LIB': self.cpp_info.components[name].libs = [name] - self.cpp_info.components[name].names["pkg_config"] = name - if self.settings.os == "Linux": + self.cpp_info.components[name].set_property("pkg_config_name", name) + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components[name].system_libs.extend(["m"]) diff --git a/googleapis/all/conaninfo.txt b/googleapis/all/conaninfo.txt deleted file mode 100644 index 3bb3519..0000000 --- a/googleapis/all/conaninfo.txt +++ /dev/null @@ -1,47 +0,0 @@ -[settings] - arch=armv8 - build_type=Release - compiler=clang - compiler.cppstd=17 - compiler.libcxx=libc++ - compiler.version=15 - os=Macos - -[requires] - protobuf/3.21.9:bd2be2a8b53548ddd6c9941d952979f99c859162 - -[options] - fPIC=True - shared=False - -[full_settings] - arch=armv8 - build_type=Release - compiler=clang - compiler.cppstd=17 - compiler.libcxx=libc++ - compiler.version=15 - os=Macos - -[full_requires] - protobuf/3.21.9:bd2be2a8b53548ddd6c9941d952979f99c859162 - zlib/1.2.13:f568eec00a82af2100dc006430c1be98df6d77fa - -[full_options] - fPIC=True - shared=False - protobuf:debug_suffix=True - protobuf:fPIC=True - protobuf:lite=False - protobuf:shared=False - protobuf:with_rtti=True - protobuf:with_zlib=True - zlib:fPIC=True - zlib:shared=False - -[recipe_hash] - - -[env] - CC=/usr/local/opt/llvm/bin/clang - CXX=/usr/local/opt/llvm/bin/clang++ diff --git a/googleapis/all/graph_info.json b/googleapis/all/graph_info.json deleted file mode 100644 index 70ac3b1..0000000 --- a/googleapis/all/graph_info.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "options": [ - [ - "fPIC", - "True" - ], - [ - "shared", - "False" - ], - [ - "protobuf:debug_suffix", - "True" - ], - [ - "protobuf:fPIC", - "True" - ], - [ - "protobuf:lite", - "False" - ], - [ - "protobuf:shared", - "False" - ], - [ - "protobuf:with_rtti", - "True" - ], - [ - "protobuf:with_zlib", - "True" - ], - [ - "zlib:fPIC", - "True" - ], - [ - "zlib:shared", - "False" - ] - ], - "root": { - "name": "googleapis", - "version": "cci.20221108", - "user": null, - "channel": null - } -} \ No newline at end of file diff --git a/googleapis/all/helpers.py b/googleapis/all/helpers.py index fdfd77c..268a136 100644 --- a/googleapis/all/helpers.py +++ b/googleapis/all/helpers.py @@ -113,8 +113,12 @@ def parsing_sources(line): proto_library.srcs.append(proto_path) def parsing_deps(line): + # Remove any comments + line = line.split('#', 1)[0].strip() line = line.strip(",").strip("\"") - if line.startswith("@com_google_protobuf//:"): + if line == '': + pass + elif line.startswith("@com_google_protobuf//:"): proto_library.deps.add("protobuf::libprotobuf") elif line.startswith("@com_google_googleapis//"): proto_library.deps.add(line[len("@com_google_googleapis"):]) @@ -131,7 +135,7 @@ def collecting_items(collection, line): line = line.strip(",").strip("\"") collection.append(line) - with open(filename, 'r', encoding="utf-8") as f: + with open(filename, 'r', encoding='utf-8') as f: action = None parsing_variable = None variables = {} diff --git a/googleapis/all/test_package/CMakeLists.txt b/googleapis/all/test_package/CMakeLists.txt index d676bb7..aba09b4 100644 --- a/googleapis/all/test_package/CMakeLists.txt +++ b/googleapis/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package CXX) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(googleapis REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE googleapis::googleapis) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/googleapis/all/test_package/CMakeUserPresets.json b/googleapis/all/test_package/CMakeUserPresets.json deleted file mode 100644 index 042385a..0000000 --- a/googleapis/all/test_package/CMakeUserPresets.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 4, - "vendor": { - "conan": {} - }, - "include": [ - "/Users/jiaoew/workspace/conan-center-index/recipes/googleapis/all/test_package/build/Release/generators/CMakePresets.json" - ] -} \ No newline at end of file diff --git a/googleapis/all/test_package/conanfile.py b/googleapis/all/test_package/conanfile.py index 58019cb..bb39603 100644 --- a/googleapis/all/test_package/conanfile.py +++ b/googleapis/all/test_package/conanfile.py @@ -1,23 +1,21 @@ import os + from conan import ConanFile -from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) - - def generate(self): - tc = CMakeToolchain(self) - tc.generate() + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/googleapis/all/test_v1_package/CMakeLists.txt b/googleapis/all/test_v1_package/CMakeLists.txt index d1b58c8..0d20897 100644 --- a/googleapis/all/test_v1_package/CMakeLists.txt +++ b/googleapis/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(googleapis REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE googleapis::googleapis) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/googleapis/config.yml b/googleapis/config.yml index 6656d26..dd90503 100644 --- a/googleapis/config.yml +++ b/googleapis/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20230501": + folder: all "cci.20221108": folder: all "cci.20220711": diff --git a/grpc/all/cmake/grpc_plugin_template.cmake.in b/grpc/all/cmake/grpc_plugin_template.cmake.in new file mode 100644 index 0000000..5ab1d94 --- /dev/null +++ b/grpc/all/cmake/grpc_plugin_template.cmake.in @@ -0,0 +1,31 @@ +if(NOT TARGET @target_name@) + # Find @executable_name@ + ## Workaround for legacy "cmake" generator in case of cross-build + if(CMAKE_CROSSCOMPILING) + find_program(@find_program_variable@ + NAMES @executable_name@ + PATHS ENV PATH + NO_DEFAULT_PATH + ) + endif() + ## And here this will work fine with "CMakeToolchain" (for native & cross-build) + ## and legacy "cmake" generator in case of native build + if(NOT @find_program_variable@) + find_program(@find_program_variable@ NAMES @executable_name@) + endif() + ## Last resort: we search in package folder directly + if(NOT @find_program_variable@) + find_program(@find_program_variable@ + NAMES @executable_name@ + PATHS "${CMAKE_CURRENT_LIST_DIR}/@relative_path@bin/" + NO_DEFAULT_PATH + ) + endif() + + # Define @target_name@ imported target + if(@find_program_variable@) + get_filename_component(@find_program_variable@ "${@find_program_variable@}" ABSOLUTE) + add_executable(@target_name@ IMPORTED) + set_property(TARGET @target_name@ PROPERTY IMPORTED_LOCATION ${@find_program_variable@}) + endif() +endif() diff --git a/grpc/all/conan_cmake_project_include.cmake b/grpc/all/conan_cmake_project_include.cmake new file mode 100644 index 0000000..0d23c71 --- /dev/null +++ b/grpc/all/conan_cmake_project_include.cmake @@ -0,0 +1,4 @@ +# TODO: move to a patch? It avoids link errors while resolving abseil symbols with gcc +if (TARGET check_epollexclusive) + set_target_properties(check_epollexclusive PROPERTIES LINKER_LANGUAGE CXX) +endif() diff --git a/grpc/all/conandata.yml b/grpc/all/conandata.yml new file mode 100644 index 0000000..bf4e54a --- /dev/null +++ b/grpc/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.65.0": + url: "https://github.com/grpc/grpc/archive/v1.65.0.tar.gz" + sha256: "ebc3acfde70cfae3f4f04b8dbb72259540cb1dc427be362569fbc2607dabfe39" + "1.54.3": + url: "https://github.com/grpc/grpc/archive/v1.54.3.tar.gz" + sha256: "17e4e1b100657b88027721220cbfb694d86c4b807e9257eaf2fb2d273b41b1b1" + "1.50.1": + url: "https://github.com/grpc/grpc/archive/v1.50.1.tar.gz" + sha256: "fb1ed98eb3555877d55eb2b948caca44bc8601c6704896594de81558639709ef" + "1.50.0": + url: "https://github.com/grpc/grpc/archive/v1.50.0.tar.gz" + sha256: "76900ab068da86378395a8e125b5cc43dfae671e09ff6462ddfef18676e2165a" +patches: + "1.54.3": + - patch_file: "patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch" + patch_type: "backport" + patch_source: "https://github.com/grpc/grpc/commit/5c3400e8dc08d0810e3301d7e8cd8a718c82eeed" + "1.50.1": + - patch_file: "patches/v1.50.x/001-disable-cppstd-override.patch" + "1.50.0": + - patch_file: "patches/v1.50.x/001-disable-cppstd-override.patch" diff --git a/grpc/all/conanfile.py b/grpc/all/conanfile.py new file mode 100644 index 0000000..e8ae71a --- /dev/null +++ b/grpc/all/conanfile.py @@ -0,0 +1,367 @@ +import os +import yaml + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building, valid_min_cppstd, check_min_cppstd +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.60.0 <2 || >=2.0.5" + + +class GrpcConan(ConanFile): + name = "grpc" + description = "Google's RPC (remote procedure call) library and framework." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/grpc/grpc" + topics = ("rpc",) + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "codegen": [True, False], + "csharp_ext": [True, False], + "cpp_plugin": [True, False], + "csharp_plugin": [True, False], + "node_plugin": [True, False], + "objective_c_plugin": [True, False], + "php_plugin": [True, False], + "python_plugin": [True, False], + "ruby_plugin": [True, False], + "secure": [True, False], + "with_libsystemd": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "codegen": True, + "csharp_ext": False, + "cpp_plugin": True, + "csharp_plugin": True, + "node_plugin": True, + "objective_c_plugin": True, + "php_plugin": True, + "python_plugin": True, + "ruby_plugin": True, + "secure": False, + "with_libsystemd": True + } + + short_paths = True + _target_info = None + + @property + def _grpc_plugin_template(self): + return "grpc_plugin_template.cmake.in" + + @property + def _cxxstd_required(self): + return 14 if Version(self.version) >= "1.47" else 11 + + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + + @property + def _supports_libsystemd(self): + return self.settings.os in ["Linux", "FreeBSD"] and Version(self.version) >= "1.52" + + def export(self): + copy(self, f"target_info/grpc_{self.version}.yml", src=self.recipe_folder, dst=self.export_folder) + + def export_sources(self): + copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + copy(self, f"cmake/{self._grpc_plugin_template}", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self._supports_libsystemd: + del self.options.with_libsystemd + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.options["protobuf"].shared = True + + if cross_building(self): + self.options["grpc"].shared = True + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # abseil is public. See https://github.com/conan-io/conan-center-index/pull/17284#issuecomment-1526082638 + if Version(self.version) >= "1.62.0": + self.requires("protobuf/5.27.0", transitive_headers=True) + self.requires("abseil/[>=20240116.1 <20240117.0]", transitive_headers=True) + else: + self.requires("abseil/[>=20230125.3 <=20230802.1]", transitive_headers=True) + self.requires("protobuf/3.21.12", transitive_headers=True) + self.requires("c-ares/[>=1.19.1 <2]") + self.requires("openssl/[>=1.1 <4]") + self.requires("re2/20230301") + self.requires("zlib/[>=1.2.11 <2]") + if self.options.get_safe("with_libsystemd"): + self.requires("libsystemd/255") + + def package_id(self): + del self.info.options.secure + + def validate(self): + check_min_vs(self, "190") + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") + + if Version(self.version) >= "1.47" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "6": + raise ConanInvalidConfiguration("GCC older than 6 is not supported") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._cxxstd_required) + + if self.options.shared and not self.dependencies.host["protobuf"].options.shared: + raise ConanInvalidConfiguration( + "If built as shared protobuf must be shared as well. " + "Please, use `protobuf:shared=True`.", + ) + + def build_requirements(self): + if not self._is_legacy_one_profile: + self.tool_requires("protobuf/") + if cross_building(self): + # when cross compiling we need pre compiled grpc plugins for protoc + self.tool_requires(f"grpc/{self.version}") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + # Set up environment so that we can run grpc-cpp-plugin at build time + VirtualBuildEnv(self).generate() + if self._is_legacy_one_profile: + VirtualRunEnv(self).generate(scope="build") + + # This doesn't work yet as one would expect, because the install target builds everything + # and we need the install target because of the generated CMake files + # + # enable_mobile=False # Enables iOS and Android support + # + # cmake.definitions["CONAN_ENABLE_MOBILE"] = "ON" if self.options.csharp_ext else "OFF" + tc = CMakeToolchain(self) + + tc.cache_variables["CMAKE_PROJECT_grpc_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") + + tc.cache_variables["gRPC_BUILD_CODEGEN"] = self.options.codegen + tc.cache_variables["gRPC_BUILD_CSHARP_EXT"] = self.options.csharp_ext + tc.cache_variables["gRPC_BUILD_TESTS"] = "OFF" + + # We need the generated cmake/ files (bc they depend on the list of targets, which is dynamic) + tc.cache_variables["gRPC_INSTALL"] = True + tc.cache_variables["gRPC_INSTALL_SHAREDIR"] = "res/grpc" + + # tell grpc to use the find_package versions + tc.cache_variables["gRPC_ZLIB_PROVIDER"] = "package" + tc.cache_variables["gRPC_CARES_PROVIDER"] = "package" + tc.cache_variables["gRPC_RE2_PROVIDER"] = "package" + tc.cache_variables["gRPC_SSL_PROVIDER"] = "package" + tc.cache_variables["gRPC_PROTOBUF_PROVIDER"] = "package" + tc.cache_variables["gRPC_ABSL_PROVIDER"] = "package" + + tc.cache_variables["gRPC_BUILD_GRPC_CPP_PLUGIN"] = self.options.cpp_plugin + tc.cache_variables["gRPC_BUILD_GRPC_CSHARP_PLUGIN"] = self.options.csharp_plugin + tc.cache_variables["gRPC_BUILD_GRPC_NODE_PLUGIN"] = self.options.node_plugin + tc.cache_variables["gRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN"] = self.options.objective_c_plugin + tc.cache_variables["gRPC_BUILD_GRPC_PHP_PLUGIN"] = self.options.php_plugin + tc.cache_variables["gRPC_BUILD_GRPC_PYTHON_PLUGIN"] = self.options.python_plugin + tc.cache_variables["gRPC_BUILD_GRPC_RUBY_PLUGIN"] = self.options.ruby_plugin + + # Consumed targets (abseil) via interface target_compiler_feature can propagate newer standards + if not valid_min_cppstd(self, self._cxxstd_required): + tc.cache_variables["CMAKE_CXX_STANDARD"] = self._cxxstd_required + + if is_apple_os(self): + # workaround for: install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable + tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False + + if self._supports_libsystemd: + tc.cache_variables["gRPC_USE_SYSTEMD"] = self.options.with_libsystemd + + tc.generate() + + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # On macOS if all the following are true: + # - protoc from protobuf has shared library dependencies + # - grpc_cpp_plugin has shared library deps (when crossbuilding) + # - using `make` as the cmake generator + # Make will run commands via `/bin/sh` which will strip all env vars that start with `DYLD*` + # This workaround wraps the protoc command to be invoked by CMake with a modified environment + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + settings_build = getattr(self, "settings_build", self.settings) + if settings_build.os == "Macos": + replace_in_file(self, cmakelists, + "COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}", + 'COMMAND ${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}" ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}') + elif not cross_building(self) and settings_build.os == "Linux": + # we are not cross-building, but protobuf or abseil may be shared + # so we need to set LD_LIBRARY_PATH to find them + # Note: if protobuf used RPATH instead of RUNPATH this is not needed + replace_in_file(self, cmakelists, + "COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}", + 'COMMAND ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=$:$ENV{LD_LIBRARY_PATH}" ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}') + if self.settings.os == "Macos" and Version(self.version) >= "1.64": + # See https://github.com/grpc/grpc/issues/36654#issuecomment-2228569158 + replace_in_file(self, cmakelists, "target_compile_features(upb_textformat_lib PUBLIC cxx_std_14)", + """target_compile_features(upb_textformat_lib PUBLIC cxx_std_14) + target_link_options(upb_textformat_lib PRIVATE -Wl,-undefined,dynamic_lookup) + target_link_options(upb_json_lib PRIVATE -Wl,-undefined,dynamic_lookup) + """) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def target_info(self): + if self._target_info: + return self._target_info + target_info_file = os.path.join(self.recipe_folder, "target_info", f"grpc_{self.version}.yml") + with open(target_info_file) as f: + self._target_info = yaml.safe_load(f) + return self._target_info + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # Create one custom module file per executable in order to emulate + # CMake executables imported targets of grpc plugins. + for plugin_info in self.target_info["grpc_plugins"]: + target = plugin_info["target"] + executable = plugin_info["executable"] + option_name = executable.replace("grpc_", "") + if self.options.get_safe(option_name): + self._create_executable_module_file(target, executable) + + def _create_executable_module_file(self, target, executable): + module_abs_path = os.path.join(self.package_folder, self._module_path) + + # Copy our CMake module template file to package folder + copy(self, self._grpc_plugin_template, src=os.path.join(self.source_folder, "cmake"), dst=module_abs_path) + + # Rename it + dst_file = os.path.join(module_abs_path, f"{executable}.cmake") + rename(self, os.path.join(module_abs_path, self._grpc_plugin_template), dst_file) + + # Replace placeholders + replace_in_file(self, dst_file, "@target_name@", target) + replace_in_file(self, dst_file, "@executable_name@", executable) + + find_program_var = "{}_PROGRAM".format(executable.upper()) + replace_in_file(self, dst_file, "@find_program_variable@", find_program_var) + + module_folder_depth = len(os.path.normpath(self._module_path).split(os.path.sep)) + rel_path = "".join(["../"] * module_folder_depth) + replace_in_file(self, dst_file, "@relative_path@", rel_path) + + @property + def _module_path(self): + return os.path.join("lib", "cmake", "conan_trick") + + @property + def _grpc_components(self): + + def libsystemd(): + return ["libsystemd::libsystemd"] if self._supports_libsystemd and self.options.with_libsystemd else [] + + def libm(): + return ["m"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + def pthread(): + return ["pthread"] if self.settings.os in ["Linux", "FreeBSD"] else [] + + def crypt32(): + return ["crypt32"] if self.settings.os == "Windows" else [] + + def ws2_32(): + return ["ws2_32"] if self.settings.os == "Windows" else [] + + def wsock32(): + return ["wsock32"] if self.settings.os == "Windows" else [] + + targets = self.target_info['grpc_targets'] + components = {} + for target in targets: + if self.options.secure and target['name'] in ["grpc_unsecure", "grpc++_unsecure"]: + continue + if not self.options.codegen and target['name'] in ["grpc++_reflection", "grpcpp_channelz"]: + continue + components[target['name']] = { + "lib": target['lib'], + "requires": target.get('requires', []) + libsystemd(), + "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), + "frameworks": target.get('frameworks', []), + } + + return components + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "gRPC") + self.cpp_info.resdirs = ["res"] + ssl_roots_file_path = os.path.join(self.package_folder, "res", "grpc", "roots.pem") + self.runenv_info.define_path("GRPC_DEFAULT_SSL_ROOTS_FILE_PATH", ssl_roots_file_path) + + for component, values in self._grpc_components.items(): + target = values.get("lib") + lib = values.get("lib") + self.cpp_info.components[component].set_property("cmake_target_name", "gRPC::{}".format(target)) + # actually only gpr, grpc, grpc_unsecure, grpc++ and grpc++_unsecure should have a .pc file + self.cpp_info.components[component].set_property("pkg_config_name", target) + self.cpp_info.components[component].libs = [lib] + self.cpp_info.components[component].requires = values.get("requires", []) + self.cpp_info.components[component].system_libs = values.get("system_libs", []) + self.cpp_info.components[component].frameworks = values.get("frameworks", []) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components[component].names["cmake_find_package"] = target + self.cpp_info.components[component].names["cmake_find_package_multi"] = target + + # Executable imported targets are added through custom CMake module files, + # since conan generators don't know how to emulate these kind of targets. + grpc_modules = [] + for plugin_info in self.target_info["grpc_plugins"]: + executable = plugin_info["executable"] + option_name = executable.replace("grpc_", "") + if self.options.get_safe(option_name): + grpc_module_filename = "{}.cmake".format(executable) + grpc_modules.append(os.path.join(self._module_path, grpc_module_filename)) + self.cpp_info.set_property("cmake_build_modules", grpc_modules) + + # TODO: to remove once conan v1 not supported anymore + self.cpp_info.names["cmake_find_package"] = "gRPC" + self.cpp_info.names["cmake_find_package_multi"] = "gRPC" + self.env_info.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH = ssl_roots_file_path + if grpc_modules: + self.cpp_info.components["grpc_execs"].build_modules["cmake_find_package"] = grpc_modules + self.cpp_info.components["grpc_execs"].build_modules["cmake_find_package_multi"] = grpc_modules + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/grpc/all/patches/v1.50.x/001-disable-cppstd-override.patch b/grpc/all/patches/v1.50.x/001-disable-cppstd-override.patch new file mode 100644 index 0000000..fb95233 --- /dev/null +++ b/grpc/all/patches/v1.50.x/001-disable-cppstd-override.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7052846..259fa93 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -227,21 +227,6 @@ if (NOT DEFINED CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 11) + endif() + +-# Add c++14 flags +-if (NOT DEFINED CMAKE_CXX_STANDARD) +- set(CMAKE_CXX_STANDARD 14) +-else() +- if (CMAKE_CXX_STANDARD LESS 14) +- message(FATAL_ERROR "CMAKE_CXX_STANDARD is less than 14, please specify at least SET(CMAKE_CXX_STANDARD 14)") +- endif() +-endif() +-if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) +- set(CMAKE_CXX_STANDARD_REQUIRED ON) +-endif() +-if (NOT DEFINED CMAKE_CXX_EXTENSIONS) +- set(CMAKE_CXX_EXTENSIONS OFF) +-endif() +- + if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + endif() diff --git a/grpc/all/patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch b/grpc/all/patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch new file mode 100644 index 0000000..a0b7846 --- /dev/null +++ b/grpc/all/patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch @@ -0,0 +1,57 @@ +From 64d855b0ddd944369e96b24210a1ce59e704a779 Mon Sep 17 00:00:00 2001 +From: Kirill +Date: Tue, 2 Apr 2024 13:17:47 -0700 +Subject: [PATCH] [CMake] Add gRPC_USE_SYSTEMD option (#34384) + +Issue https://github.com/grpc/grpc/issues/34304 + +Allows to disable systemd support, +as well as linking with libsystemd, +when it is not required. + +The option has three possible values: +AUTO - Default, Will try to find libsystemd. If found, systemd support will be enabled. +ON - Enable systemd support. Build will fail if libsystemd is not found. +OFF - Disable systemd support. + +Closes #34384 + +COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/34384 from kirpichik:cmake-use-systemd-option 96f5f4bd68251ca62ccc45a2d44a68a8203531ac +PiperOrigin-RevId: 621274356 +--- + cmake/systemd.cmake | 21 ++++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake +index a34210177e..559c8d24b6 100644 +--- a/cmake/systemd.cmake ++++ b/cmake/systemd.cmake +@@ -12,9 +12,20 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-find_package(systemd) +-if(TARGET systemd) +- set(_gRPC_SYSTEMD_LIBRARIES systemd ${SYSTEMD_LINK_LIBRARIES}) +- add_definitions(-DHAVE_LIBSYSTEMD) ++set(gRPC_USE_SYSTEMD "AUTO" CACHE STRING "Build with libsystemd support if available. Can be ON, OFF or AUTO") ++ ++if (NOT gRPC_USE_SYSTEMD STREQUAL "OFF") ++ if (gRPC_USE_SYSTEMD STREQUAL "ON") ++ find_package(systemd REQUIRED) ++ elseif (gRPC_USE_SYSTEMD STREQUAL "AUTO") ++ find_package(systemd) ++ else() ++ message(FATAL_ERROR "Unknown value for gRPC_USE_SYSTEMD = ${gRPC_USE_SYSTEMD}") ++ endif() ++ ++ if(TARGET systemd) ++ set(_gRPC_SYSTEMD_LIBRARIES systemd ${SYSTEMD_LINK_LIBRARIES}) ++ add_definitions(-DHAVE_LIBSYSTEMD) ++ endif() ++ set(_gRPC_FIND_SYSTEMD "if(NOT systemd_FOUND)\n find_package(systemd)\nendif()") + endif() +-set(_gRPC_FIND_SYSTEMD "if(NOT systemd_FOUND)\n find_package(systemd)\nendif()") +-- +2.43.0 + diff --git a/grpc/all/target_info/grpc_1.50.0.yml b/grpc/all/target_info/grpc_1.50.0.yml new file mode 100644 index 0000000..693b7c8 --- /dev/null +++ b/grpc/all/target_info/grpc_1.50.0.yml @@ -0,0 +1,120 @@ +grpc_version: 1.50.0 +grpc_targets: + - name: "address_sorting" + lib: "address_sorting" + - name: "gpr" + lib: "gpr" + requires: + - abseil::absl_base + - abseil::absl_core_headers + - abseil::absl_memory + - abseil::absl_random_random + - abseil::absl_status + - abseil::absl_cord + - abseil::absl_str_format + - abseil::absl_strings + - abseil::absl_synchronization + - abseil::absl_time + - abseil::absl_optional + - abseil::absl_variant + - name: "_grpc" + lib: "grpc" + requires: + - zlib::zlib + - c-ares::cares + - address_sorting + - re2::re2 + - upb + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_any_invocable + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - openssl::ssl + - openssl::crypto + - address_sorting + - upb + frameworks: ['CoreFoundation'] + - name: "grpc_unsecure" + lib: "grpc_unsecure" + requires: + - zlib::zlib + - c-ares::cares + - address_sorting + - re2::re2 + - upb + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_any_invocable + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - address_sorting + - upb + frameworks: ['CoreFoundation'] + - name: "grpc++" + lib: "grpc++" + requires: + - protobuf::libprotobuf + - abseil::absl_cleanup + - _grpc + - name: "grpc++_alts" + lib: "grpc++_alts" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "grpc++_error_details" + lib: "grpc++_error_details" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "grpc++_reflection" + lib: "grpc++_reflection" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "grpc++_unsecure" + lib: "grpc++_unsecure" + requires: + - protobuf::libprotobuf + - grpc_unsecure + - name: "grpc_plugin_support" + lib: "grpc_plugin_support" + requires: + - protobuf::libprotoc + - protobuf::libprotobuf + - name: "grpcpp_channelz" + lib: "grpcpp_channelz" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "upb" + lib: "upb" +grpc_plugins: + - target: "gRPC::grpc_cpp_plugin" + executable: "grpc_cpp_plugin" + - target: "gRPC::grpc_csharp_plugin" + executable: "grpc_csharp_plugin" + - target: "gRPC::grpc_node_plugin" + executable: "grpc_node_plugin" + - target: "gRPC::grpc_objective_c_plugin" + executable: "grpc_objective_c_plugin" + - target: "gRPC::grpc_php_plugin" + executable: "grpc_php_plugin" + - target: "gRPC::grpc_python_plugin" + executable: "grpc_python_plugin" + - target: "gRPC::grpc_ruby_plugin" + executable: "grpc_ruby_plugin" diff --git a/grpc/all/target_info/grpc_1.50.1.yml b/grpc/all/target_info/grpc_1.50.1.yml new file mode 100644 index 0000000..3bf0597 --- /dev/null +++ b/grpc/all/target_info/grpc_1.50.1.yml @@ -0,0 +1,120 @@ +grpc_version: 1.50.1 +grpc_targets: + - name: "address_sorting" + lib: "address_sorting" + - name: "gpr" + lib: "gpr" + requires: + - abseil::absl_base + - abseil::absl_core_headers + - abseil::absl_memory + - abseil::absl_random_random + - abseil::absl_status + - abseil::absl_cord + - abseil::absl_str_format + - abseil::absl_strings + - abseil::absl_synchronization + - abseil::absl_time + - abseil::absl_optional + - abseil::absl_variant + - name: "_grpc" + lib: "grpc" + requires: + - zlib::zlib + - c-ares::cares + - address_sorting + - re2::re2 + - upb + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_any_invocable + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - openssl::ssl + - openssl::crypto + - address_sorting + - upb + frameworks: ['CoreFoundation'] + - name: "grpc_unsecure" + lib: "grpc_unsecure" + requires: + - zlib::zlib + - c-ares::cares + - address_sorting + - re2::re2 + - upb + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_any_invocable + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - address_sorting + - upb + frameworks: ['CoreFoundation'] + - name: "grpc++" + lib: "grpc++" + requires: + - protobuf::libprotobuf + - abseil::absl_cleanup + - _grpc + - name: "grpc++_alts" + lib: "grpc++_alts" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "grpc++_error_details" + lib: "grpc++_error_details" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "grpc++_reflection" + lib: "grpc++_reflection" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "grpc++_unsecure" + lib: "grpc++_unsecure" + requires: + - protobuf::libprotobuf + - grpc_unsecure + - name: "grpc_plugin_support" + lib: "grpc_plugin_support" + requires: + - protobuf::libprotoc + - protobuf::libprotobuf + - name: "grpcpp_channelz" + lib: "grpcpp_channelz" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "upb" + lib: "upb" +grpc_plugins: + - target: "gRPC::grpc_cpp_plugin" + executable: "grpc_cpp_plugin" + - target: "gRPC::grpc_csharp_plugin" + executable: "grpc_csharp_plugin" + - target: "gRPC::grpc_node_plugin" + executable: "grpc_node_plugin" + - target: "gRPC::grpc_objective_c_plugin" + executable: "grpc_objective_c_plugin" + - target: "gRPC::grpc_php_plugin" + executable: "grpc_php_plugin" + - target: "gRPC::grpc_python_plugin" + executable: "grpc_python_plugin" + - target: "gRPC::grpc_ruby_plugin" + executable: "grpc_ruby_plugin" diff --git a/grpc/all/target_info/grpc_1.54.3.yml b/grpc/all/target_info/grpc_1.54.3.yml new file mode 100644 index 0000000..a97cd9a --- /dev/null +++ b/grpc/all/target_info/grpc_1.54.3.yml @@ -0,0 +1,152 @@ +grpc_version: 1.54.3 +grpc_targets: + - name: "address_sorting" + lib: "address_sorting" + requires: + - zlib::zlib + - name: "gpr" + lib: "gpr" + requires: + - zlib::zlib + - abseil::absl_base + - abseil::absl_core_headers + - abseil::absl_flags + - abseil::absl_flags_marshalling + - abseil::absl_any_invocable + - abseil::absl_memory + - abseil::absl_random_random + - abseil::absl_status + - abseil::absl_cord + - abseil::absl_str_format + - abseil::absl_strings + - abseil::absl_synchronization + - abseil::absl_time + - abseil::absl_optional + - abseil::absl_variant + - name: "_grpc" + lib: "grpc" + requires: + - zlib::zlib + - c-ares::cares + - address_sorting + - re2::re2 + - upb + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - openssl::ssl + - openssl::crypto + - address_sorting + - upb + frameworks: ['CoreFoundation'] + - name: "grpc_unsecure" + lib: "grpc_unsecure" + requires: + - zlib::zlib + - c-ares::cares + - address_sorting + - re2::re2 + - upb + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - address_sorting + - upb + frameworks: ['CoreFoundation'] + - name: "grpc++" + lib: "grpc++" + requires: + - protobuf::libprotobuf + - zlib::zlib + - _grpc + - name: "grpc++_alts" + lib: "grpc++_alts" + requires: + - protobuf::libprotobuf + - zlib::zlib + - grpc++ + - name: "grpc++_error_details" + lib: "grpc++_error_details" + requires: + - protobuf::libprotobuf + - zlib::zlib + - grpc++ + - name: "grpc++_reflection" + lib: "grpc++_reflection" + requires: + - protobuf::libprotobuf + - zlib::zlib + - grpc++ + - name: "grpc++_unsecure" + lib: "grpc++_unsecure" + requires: + - protobuf::libprotobuf + - zlib::zlib + - grpc_unsecure + - name: "grpc_authorization_provider" + lib: "grpc_authorization_provider" + requires: + - protobuf::libprotobuf + - zlib::zlib + - re2::re2 + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - upb + - name: "grpc_plugin_support" + lib: "grpc_plugin_support" + requires: + - protobuf::libprotoc + - protobuf::libprotobuf + - zlib::zlib + - name: "grpcpp_channelz" + lib: "grpcpp_channelz" + requires: + - protobuf::libprotobuf + - zlib::zlib + - grpc++ + - name: "upb" + lib: "upb" + requires: + - zlib::zlib +grpc_plugins: + - target: "gRPC::grpc_cpp_plugin" + executable: "grpc_cpp_plugin" + - target: "gRPC::grpc_csharp_plugin" + executable: "grpc_csharp_plugin" + - target: "gRPC::grpc_node_plugin" + executable: "grpc_node_plugin" + - target: "gRPC::grpc_objective_c_plugin" + executable: "grpc_objective_c_plugin" + - target: "gRPC::grpc_php_plugin" + executable: "grpc_php_plugin" + - target: "gRPC::grpc_python_plugin" + executable: "grpc_python_plugin" + - target: "gRPC::grpc_ruby_plugin" + executable: "grpc_ruby_plugin" diff --git a/grpc/all/target_info/grpc_1.65.0.yml b/grpc/all/target_info/grpc_1.65.0.yml new file mode 100644 index 0000000..43591e8 --- /dev/null +++ b/grpc/all/target_info/grpc_1.65.0.yml @@ -0,0 +1,174 @@ +grpc_version: 1.65.0 +grpc_targets: + - name: "address_sorting" + lib: "address_sorting" + - name: "gpr" + lib: "gpr" + requires: + - abseil::absl_base + - abseil::absl_core_headers + - abseil::absl_log_severity + - abseil::absl_flags + - abseil::absl_flags_marshalling + - abseil::absl_any_invocable + - abseil::absl_check + - abseil::absl_log_globals + - abseil::absl_log + - abseil::absl_memory + - abseil::absl_random_random + - abseil::absl_status + - abseil::absl_cord + - abseil::absl_str_format + - abseil::absl_strings + - abseil::absl_synchronization + - abseil::absl_time + - abseil::absl_optional + - abseil::absl_variant + - name: "_grpc" + lib: "grpc" + requires: + - upb_json_lib + - upb_textformat_lib + - re2::re2 + - zlib::zlib + - abseil::absl_algorithm_container + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_random_bit_gen_ref + - abseil::absl_random_distributions + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - openssl::ssl + - openssl::crypto + - address_sorting + frameworks: ['CoreFoundation'] + - name: "grpc_unsecure" + lib: "grpc_unsecure" + requires: + - utf8_range_lib + - upb_message_lib + - zlib::zlib + - abseil::absl_algorithm_container + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_random_bit_gen_ref + - abseil::absl_random_distributions + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - address_sorting + frameworks: ['CoreFoundation'] + - name: "upb_base_lib" + lib: "upb_base_lib" + - name: "upb_json_lib" + lib: "upb_json_lib" + requires: + - utf8_range_lib + - upb_message_lib + - name: "upb_mem_lib" + lib: "upb_mem_lib" + - name: "upb_message_lib" + lib: "upb_message_lib" + requires: + - upb_base_lib + - upb_mem_lib + - name: "upb_textformat_lib" + lib: "upb_textformat_lib" + requires: + - utf8_range_lib + - upb_message_lib + - name: "utf8_range_lib" + lib: "utf8_range_lib" + - name: "grpc++" + lib: "grpc++" + requires: + - abseil::absl_absl_check + - abseil::absl_absl_log + - _grpc + - protobuf::libprotobuf + - name: "grpc++_alts" + lib: "grpc++_alts" + requires: + - grpc++ + - name: "grpc++_error_details" + lib: "grpc++_error_details" + requires: + - grpc++ + - name: "grpc++_reflection" + lib: "grpc++_reflection" + requires: + - grpc++ + - name: "grpc++_unsecure" + lib: "grpc++_unsecure" + requires: + - abseil::absl_absl_check + - abseil::absl_absl_log + - grpc_unsecure + - protobuf::libprotobuf + - name: "grpc_authorization_provider" + lib: "grpc_authorization_provider" + requires: + - utf8_range_lib + - upb_message_lib + - re2::re2 + - zlib::zlib + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - address_sorting + - name: "grpc_plugin_support" + lib: "grpc_plugin_support" + requires: + - protobuf::libprotobuf + - protobuf::libprotoc + - name: "grpcpp_channelz" + lib: "grpcpp_channelz" + requires: + - grpc++ +grpc_plugins: + - target: "gRPC::grpc_cpp_plugin" + executable: "grpc_cpp_plugin" + - target: "gRPC::grpc_csharp_plugin" + executable: "grpc_csharp_plugin" + - target: "gRPC::grpc_node_plugin" + executable: "grpc_node_plugin" + - target: "gRPC::grpc_objective_c_plugin" + executable: "grpc_objective_c_plugin" + - target: "gRPC::grpc_php_plugin" + executable: "grpc_php_plugin" + - target: "gRPC::grpc_python_plugin" + executable: "grpc_python_plugin" + - target: "gRPC::grpc_ruby_plugin" + executable: "grpc_ruby_plugin" diff --git a/grpc/all/test_package/CMakeLists.txt b/grpc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..9bdf7d4 --- /dev/null +++ b/grpc/all/test_package/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + + +find_package(gRPC CONFIG REQUIRED) + + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) # grpc 1.47.0 requires c++14 +target_link_libraries(${PROJECT_NAME} + PRIVATE + $,gRPC::grpc++_unsecure,gRPC::grpc++> +) + +if(CHECK_GRPC_CPP_PLUGIN) + if(NOT GRPC_CPP_PLUGIN_PROGRAM) + message(FATAL_ERROR "grpc_cpp_plugin not found") + endif() + + if(NOT TARGET gRPC::grpc_cpp_plugin) + message(FATAL_ERROR "grpc_cpp_plugin target not defined, but expected") + endif() +endif() \ No newline at end of file diff --git a/grpc/all/test_package/conanfile.py b/grpc/all/test_package/conanfile.py new file mode 100644 index 0000000..3e5ae99 --- /dev/null +++ b/grpc/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["CHECK_GRPC_CPP_PLUGIN"] = self.dependencies[self.tested_reference_str].options.cpp_plugin + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/grpc/all/test_package/test_package.cpp b/grpc/all/test_package/test_package.cpp new file mode 100644 index 0000000..53d0200 --- /dev/null +++ b/grpc/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include +#include + + +int main(int argc, char** argv) { + std::cout << "gPRC version: " << grpc::Version() << "\n"; + return 0; +} diff --git a/grpc/config.yml b/grpc/config.yml new file mode 100644 index 0000000..eac63c2 --- /dev/null +++ b/grpc/config.yml @@ -0,0 +1,9 @@ +versions: + "1.65.0": + folder: "all" + "1.54.3": + folder: "all" + "1.50.1": + folder: "all" + "1.50.0": + folder: "all" diff --git a/gtest/all/conandata.yml b/gtest/all/conandata.yml new file mode 100644 index 0000000..7b9115d --- /dev/null +++ b/gtest/all/conandata.yml @@ -0,0 +1,32 @@ +sources: + "1.15.0": + url: "https://github.com/google/googletest/releases/download/v1.15.0/googletest-1.15.0.tar.gz" + sha256: "7315acb6bf10e99f332c8a43f00d5fbb1ee6ca48c52f6b936991b216c586aaad" + "1.14.0": + url: "https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz" + sha256: "8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7" + "1.13.0": + url: "https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz" + sha256: "ad7fdba11ea011c1d925b3289cf4af2c66a352e18d4c7264392fead75e919363" + "1.12.1": + url: "https://github.com/google/googletest/archive/release-1.12.1.tar.gz" + sha256: "81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2" + "1.10.0": + url: "https://github.com/google/googletest/archive/release-1.10.0.tar.gz" + sha256: "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb" + "1.8.1": + url: "https://github.com/google/googletest/archive/release-1.8.1.tar.gz" + sha256: "9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c" +patches: + "1.10.0": + - patch_file: "patches/gtest-1.10.0.patch" + patch_description: "add CUSTOM_DEBUG_POSTFIX option" + patch_type: "conan" + - patch_file: "patches/gtest-1.10.0-override.patch" + patch_description: "prevent compiler from complaining while compiling" + patch_type: "bugfix" + patch_source: "https://github.com/google/googletest/pull/2507" + "1.8.1": + - patch_file: "patches/gtest-1.8.1.patch" + patch_description: "add CUSTOM_DEBUG_POSTFIX option" + patch_type: "conan" diff --git a/gtest/all/conanfile.py b/gtest/all/conanfile.py new file mode 100644 index 0000000..9b88c68 --- /dev/null +++ b/gtest/all/conanfile.py @@ -0,0 +1,198 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc_static_runtime, msvc_runtime_flag +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class GTestConan(ConanFile): + name = "gtest" + description = "Google's C++ test framework" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/googletest" + topics = ("testing", "google-testing", "unit-test") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_gmock": [True, False], + "no_main": [True, False], + "hide_symbols": [True, False], + "debug_postfix": ["ANY"], + "disable_pthreads": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_gmock": True, + "no_main": False, + "hide_symbols": False, + "debug_postfix": "d", + "disable_pthreads": False, + } + # disallow cppstd compatibility, as it affects the ABI in this library + # see https://github.com/conan-io/conan-center-index/issues/23854 + # Requires Conan >=1.53.0 <2 || >=2.1.0 to work + extension_properties = {"compatibility_cppstd": False} + + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "1.13.0" else "14" + + @property + def _minimum_compilers_version(self): + return { + "11": { + "Visual Studio": "14", + "msvc": "190", + "gcc": "4.8.1" if Version(self.version) < "1.11.0" else "5", + "clang": "3.3" if Version(self.version) < "1.11.0" else "5", + "apple-clang": "5.0" if Version(self.version) < "1.11.0" else "9.1", + }, + # Sinse 1.13.0, gtest requires C++14 and Google's Foundational C++ Support Policy + # https://github.com/google/oss-policies-info/blob/603a042ce2ee8f165fac46721a651d796ce59cb6/foundational-cxx-support-matrix.md + "14": { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7.3.1", + "clang": "6", + "apple-clang": "12", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) >= "1.12.0" or self.settings.build_type != "Debug": + del self.options.debug_postfix + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + del self.info.options.no_main # Only used to expose more targets + + def validate(self): + if self.options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("gtest shared is not compatible with static vc runtime") + + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + compiler = self.settings.compiler + min_version = self._minimum_compilers_version.get(str(compiler)) + if min_version and loose_lt_semver(str(compiler.version), min_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_GMOCK"] = bool(self.options.build_gmock) + tc.variables["gtest_hide_internal_symbols"] = bool(self.options.hide_symbols) + + if self.settings.build_type == "Debug" and Version(self.version) < "1.12.0": + tc.cache_variables["CUSTOM_DEBUG_POSTFIX"] = str(self.options.debug_postfix) + + if self.settings.compiler.get_safe("runtime"): + tc.variables["gtest_force_shared_crt"] = "MD" in msvc_runtime_flag(self) + tc.variables["gtest_disable_pthreads"] = self.options.disable_pthreads + if Version(self.version) < "1.12.0": + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # No warnings as errors + internal_utils = os.path.join(self.source_folder, "googletest", "cmake", "internal_utils.cmake") + replace_in_file(self, internal_utils, "-WX", "") + if Version(self.version) < "1.12.0": + replace_in_file(self, internal_utils, "-Werror", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + + @property + def _postfix(self): + return self.options.get_safe("debug_postfix", "") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "GTest") + + # gtest + self.cpp_info.components["libgtest"].set_property("cmake_target_name", "GTest::gtest") + self.cpp_info.components["libgtest"].set_property("cmake_target_aliases", ["GTest::GTest"]) + self.cpp_info.components["libgtest"].set_property("pkg_config_name", "gtest") + self.cpp_info.components["libgtest"].libs = [f"gtest{self._postfix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libgtest"].system_libs.append("m") + if not self.options.disable_pthreads: + self.cpp_info.components["libgtest"].system_libs.append("pthread") + if self.settings.os == "Neutrino" and self.settings.os.version == "7.1": + self.cpp_info.components["libgtest"].system_libs.append("regex") + if self.options.shared: + self.cpp_info.components["libgtest"].defines.append("GTEST_LINKED_AS_SHARED_LIBRARY=1") + + # gtest_main + if not self.options.no_main: + self.cpp_info.components["gtest_main"].set_property("cmake_target_name", "GTest::gtest_main") + self.cpp_info.components["gtest_main"].set_property("cmake_target_aliases", ["GTest::Main"]) + self.cpp_info.components["gtest_main"].set_property("pkg_config_name", "gtest_main") + self.cpp_info.components["gtest_main"].libs = [f"gtest_main{self._postfix}"] + self.cpp_info.components["gtest_main"].requires = ["libgtest"] + + # gmock + if self.options.build_gmock: + self.cpp_info.components["gmock"].set_property("cmake_target_name", "GTest::gmock") + self.cpp_info.components["gmock"].set_property("pkg_config_name", "gmock") + self.cpp_info.components["gmock"].libs = [f"gmock{self._postfix}"] + self.cpp_info.components["gmock"].requires = ["libgtest"] + + # gmock_main + if not self.options.no_main: + self.cpp_info.components["gmock_main"].set_property("cmake_target_name", "GTest::gmock_main") + self.cpp_info.components["gmock_main"].set_property("pkg_config_name", "gmock_main") + self.cpp_info.components["gmock_main"].libs = [f"gmock_main{self._postfix}"] + self.cpp_info.components["gmock_main"].requires = ["gmock"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "GTest" + self.cpp_info.names["cmake_find_package_multi"] = "GTest" + self.cpp_info.components["libgtest"].names["cmake_find_package"] = "gtest" + self.cpp_info.components["libgtest"].names["cmake_find_package_multi"] = "gtest" diff --git a/gtest/all/patches/gtest-1.10.0-override.patch b/gtest/all/patches/gtest-1.10.0-override.patch new file mode 100644 index 0000000..1757bf3 --- /dev/null +++ b/gtest/all/patches/gtest-1.10.0-override.patch @@ -0,0 +1,450 @@ +From 3cddd56e195b516f449bea6dcd3edd4494195631 Mon Sep 17 00:00:00 2001 +From: Robert Luberda +Date: Wed, 9 Oct 2019 21:48:00 +0200 +Subject: [PATCH] Add more override keywords + +Mark more functions with "override" keyword, just like +it was done in commit 2460f97152c. + +This should prevent compiler from complaining while compiling both +user code, and the googletest code itself with the -Wsuggest-override +option turned on; with the exception of: + * calls to new MOCK_METHOD() in test/gmock-function-mocker_test.cc + * calls to old MOCK_METHODx()/MOCK_CONST_METHODx() in other + unit test files. + +Closes #2493 +--- + .../include/gmock/gmock-generated-actions.h | 24 ++--- + .../gmock/gmock-generated-actions.h.pump | 4 +- + .../include/gmock/gmock-generated-matchers.h | 88 +++++++++---------- + .../gmock/gmock-generated-matchers.h.pump | 8 +- + googletest/include/gtest/gtest-typed-test.h | 4 +- + .../include/gtest/internal/gtest-port.h | 4 +- + googletest/test/gtest_unittest.cc | 4 +- + 7 files changed, 68 insertions(+), 68 deletions(-) + +diff --git a/googlemock/include/gmock/gmock-generated-actions.h b/googlemock/include/gmock/gmock-generated-actions.h +index 981af78ff..cee96dae8 100644 +--- a/googlemock/include/gmock/gmock-generated-actions.h ++++ b/googlemock/include/gmock/gmock-generated-actions.h +@@ -663,7 +663,7 @@ class ActionHelper { + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -726,7 +726,7 @@ class ActionHelper { + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + gmock_Impl() {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -776,7 +776,7 @@ class ActionHelper { + args_type;\ + explicit gmock_Impl(p0##_type gmock_p0) : \ + p0(::std::forward(gmock_p0)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -832,7 +832,7 @@ class ActionHelper { + gmock_Impl(p0##_type gmock_p0, \ + p1##_type gmock_p1) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -893,7 +893,7 @@ class ActionHelper { + p2##_type gmock_p2) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -961,7 +961,7 @@ class ActionHelper { + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -1038,7 +1038,7 @@ class ActionHelper { + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -1119,7 +1119,7 @@ class ActionHelper { + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -1206,7 +1206,7 @@ class ActionHelper { + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)), \ + p6(::std::forward(gmock_p6)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -1302,7 +1302,7 @@ class ActionHelper { + p5(::std::forward(gmock_p5)), \ + p6(::std::forward(gmock_p6)), \ + p7(::std::forward(gmock_p7)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -1404,7 +1404,7 @@ class ActionHelper { + p6(::std::forward(gmock_p6)), \ + p7(::std::forward(gmock_p7)), \ + p8(::std::forward(gmock_p8)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -1513,7 +1513,7 @@ class ActionHelper { + p7(::std::forward(gmock_p7)), \ + p8(::std::forward(gmock_p8)), \ + p9(::std::forward(gmock_p9)) {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +diff --git a/googlemock/include/gmock/gmock-generated-actions.h.pump b/googlemock/include/gmock/gmock-generated-actions.h.pump +index 209603c5a..283abcdc2 100644 +--- a/googlemock/include/gmock/gmock-generated-actions.h.pump ++++ b/googlemock/include/gmock/gmock-generated-actions.h.pump +@@ -395,7 +395,7 @@ $range k 0..n-1 + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +@@ -482,7 +482,7 @@ $var macro_name = [[$if i==0 [[ACTION]] $elif i==1 [[ACTION_P]] + typedef typename ::testing::internal::Function::ArgumentTuple\ + args_type;\ + [[$if i==1 [[explicit ]]]]gmock_Impl($ctor_param_list)$inits {}\ +- virtual return_type Perform(const args_type& args) {\ ++ return_type Perform(const args_type& args) override {\ + return ::testing::internal::ActionHelper::\ + Perform(this, args);\ + }\ +diff --git a/googlemock/include/gmock/gmock-generated-matchers.h b/googlemock/include/gmock/gmock-generated-matchers.h +index 690a57f1c..61892380c 100644 +--- a/googlemock/include/gmock/gmock-generated-matchers.h ++++ b/googlemock/include/gmock/gmock-generated-matchers.h +@@ -269,13 +269,13 @@ + public:\ + gmock_Impl()\ + {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + private:\ +@@ -318,13 +318,13 @@ + public:\ + explicit gmock_Impl(p0##_type gmock_p0)\ + : p0(::std::move(gmock_p0)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -371,13 +371,13 @@ + public:\ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -431,13 +431,13 @@ + gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -495,13 +495,13 @@ + p3##_type gmock_p3)\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -568,13 +568,13 @@ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -644,13 +644,13 @@ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -726,13 +726,13 @@ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -814,13 +814,13 @@ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -909,13 +909,13 @@ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \ + p8(::std::move(gmock_p8)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +@@ -1009,13 +1009,13 @@ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \ + p8(::std::move(gmock_p8)), p9(::std::move(gmock_p9)) {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\ + p0##_type const p0;\ +diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump +index ae90917cc..69d2ae418 100644 +--- a/googlemock/include/gmock/gmock-generated-matchers.h.pump ++++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump +@@ -302,13 +302,13 @@ $var param_field_decls2 = [[$for j + public:\ + [[$if i==1 [[explicit ]]]]gmock_Impl($impl_ctor_param_list)\ + $impl_inits {}\ +- virtual bool MatchAndExplain(\ ++ bool MatchAndExplain(\ + GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ +- ::testing::MatchResultListener* result_listener) const;\ +- virtual void DescribeTo(::std::ostream* gmock_os) const {\ ++ ::testing::MatchResultListener* result_listener) const override;\ ++ void DescribeTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(false);\ + }\ +- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ ++ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ + *gmock_os << FormatDescription(true);\ + }\$param_field_decls + private:\ +diff --git a/googletest/include/gtest/gtest-typed-test.h b/googletest/include/gtest/gtest-typed-test.h +index 095ce0580..6b7c9c8a0 100644 +--- a/googletest/include/gtest/gtest-typed-test.h ++++ b/googletest/include/gtest/gtest-typed-test.h +@@ -201,7 +201,7 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); + private: \ + typedef CaseName TestFixture; \ + typedef gtest_TypeParam_ TypeParam; \ +- virtual void TestBody(); \ ++ void TestBody() override; \ + }; \ + static bool gtest_##CaseName##_##TestName##_registered_ \ + GTEST_ATTRIBUTE_UNUSED_ = \ +@@ -276,7 +276,7 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); + private: \ + typedef SuiteName TestFixture; \ + typedef gtest_TypeParam_ TypeParam; \ +- virtual void TestBody(); \ ++ void TestBody() override; \ + }; \ + static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ + GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).AddTestName( \ +diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h +index f6433c58a..2b4770ff5 100644 +--- a/googletest/include/gtest/internal/gtest-port.h ++++ b/googletest/include/gtest/internal/gtest-port.h +@@ -1599,7 +1599,7 @@ class ThreadLocal : public ThreadLocalBase { + class DefaultValueHolderFactory : public ValueHolderFactory { + public: + DefaultValueHolderFactory() {} +- virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); } ++ ValueHolder* MakeNewHolder() const override { return new ValueHolder(); } + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory); +@@ -1608,7 +1608,7 @@ class ThreadLocal : public ThreadLocalBase { + class InstanceValueHolderFactory : public ValueHolderFactory { + public: + explicit InstanceValueHolderFactory(const T& value) : value_(value) {} +- virtual ValueHolder* MakeNewHolder() const { ++ ValueHolder* MakeNewHolder() const override { + return new ValueHolder(value_); + } + +diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc +index 8312bd10e..d17a15540 100644 +--- a/googletest/test/gtest_unittest.cc ++++ b/googletest/test/gtest_unittest.cc +@@ -6170,7 +6170,7 @@ TEST_F(ParseFlagsTest, WideStrings) { + #if GTEST_USE_OWN_FLAGFILE_FLAG_ + class FlagfileTest : public ParseFlagsTest { + public: +- virtual void SetUp() { ++ void SetUp() override { + ParseFlagsTest::SetUp(); + + testdata_path_.Set(internal::FilePath( +@@ -6180,7 +6180,7 @@ class FlagfileTest : public ParseFlagsTest { + EXPECT_TRUE(testdata_path_.CreateFolder()); + } + +- virtual void TearDown() { ++ void TearDown() override { + testing::internal::posix::RmDir(testdata_path_.c_str()); + ParseFlagsTest::TearDown(); + } diff --git a/gtest/all/patches/gtest-1.10.0.patch b/gtest/all/patches/gtest-1.10.0.patch new file mode 100644 index 0000000..92d3799 --- /dev/null +++ b/gtest/all/patches/gtest-1.10.0.patch @@ -0,0 +1,13 @@ +diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake +index 2f70f0b0..8cd03693 100644 +--- a/googletest/cmake/internal_utils.cmake ++++ b/googletest/cmake/internal_utils.cmake +@@ -154,7 +154,7 @@ function(cxx_library_with_type name type cxx_flags) + # Generate debug library name with a postfix. + set_target_properties(${name} + PROPERTIES +- DEBUG_POSTFIX "d") ++ DEBUG_POSTFIX "${CUSTOM_DEBUG_POSTFIX}") + # Set the output directory for build artifacts + set_target_properties(${name} + PROPERTIES diff --git a/gtest/all/patches/gtest-1.8.1.patch b/gtest/all/patches/gtest-1.8.1.patch new file mode 100755 index 0000000..838ab42 --- /dev/null +++ b/gtest/all/patches/gtest-1.8.1.patch @@ -0,0 +1,13 @@ +diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake +index 8c1f9ba..2203d3c 100644 +--- a/googletest/cmake/internal_utils.cmake ++++ b/googletest/cmake/internal_utils.cmake +@@ -166,7 +166,7 @@ function(cxx_library_with_type name type cxx_flags) + # Generate debug library name with a postfix. + set_target_properties(${name} + PROPERTIES +- DEBUG_POSTFIX "d") ++ DEBUG_POSTFIX "${CUSTOM_DEBUG_POSTFIX}") + if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED") + set_target_properties(${name} + PROPERTIES diff --git a/gtest/all/test_package/CMakeLists.txt b/gtest/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..3ca688f --- /dev/null +++ b/gtest/all/test_package/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(GTest REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gtest) +if(GTest_VERSION VERSION_LESS "1.13.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() + +if(WITH_MAIN) + target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gtest_main) + if(WITH_GMOCK) + target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gmock_main) + endif() +else() + target_sources(${PROJECT_NAME} PRIVATE main.cpp) +endif() + +if(WITH_GMOCK) + target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gmock) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_GMOCK) +endif() diff --git a/gtest/all/test_package/conanfile.py b/gtest/all/test_package/conanfile.py new file mode 100644 index 0000000..1bddd2b --- /dev/null +++ b/gtest/all/test_package/conanfile.py @@ -0,0 +1,38 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + + with_gmock = bool(self.dependencies[self.tested_reference_str].options.build_gmock) + tc.cache_variables['WITH_GMOCK'] = with_gmock + if with_gmock: + tc.preprocessor_definitions['WITH_GMOCK'] = 1 + + tc.variables['WITH_MAIN'] = not bool(self.dependencies[self.tested_reference_str].options.no_main) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/gtest/all/test_package/main.cpp b/gtest/all/test_package/main.cpp new file mode 100644 index 0000000..4483c91 --- /dev/null +++ b/gtest/all/test_package/main.cpp @@ -0,0 +1,6 @@ +#include "gtest/gtest.h" + +int main(int argc, char **argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/gtest/all/test_package/test_package.cpp b/gtest/all/test_package/test_package.cpp new file mode 100644 index 0000000..36d68c6 --- /dev/null +++ b/gtest/all/test_package/test_package.cpp @@ -0,0 +1,52 @@ +// Thanks to http://joeyates.info/2010/05/26/googletest-hello-world/ for the example! + +///////////////////////////// +// In the header file + +#include +using namespace std; + +class Salutation +{ +public: + static string greet(const string& name); +}; + +/////////////////////////////////////// +// In the class implementation file + +string Salutation::greet(const string& name) { + ostringstream s; + s << "Hello " << name << "!"; + return s.str(); +} + +/////////////////////////////////////////// +// In the test file +#include + +#ifdef WITH_GMOCK +#include + +class Example +{ +public: + virtual void foo() = 0; +}; + +class MockExample : public Example +{ +public: + MOCK_METHOD0(foo, void()); +}; + +#endif + +TEST(SalutationTest, Static) { + +#ifdef WITH_GMOCK + MockExample m; +#endif + + EXPECT_EQ(string("Hello World!"), Salutation::greet("World")); +} diff --git a/gtest/all/test_v1_package/CMakeLists.txt b/gtest/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/gtest/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/gtest/all/test_v1_package/conanfile.py b/gtest/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..1490f15 --- /dev/null +++ b/gtest/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +import os + +from conan.tools.build import cross_building +from conans import ConanFile, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.definitions['WITH_GMOCK'] = self.options['gtest'].build_gmock + cmake.definitions['WITH_MAIN'] = not self.options['gtest'].no_main + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/gtest/config.yml b/gtest/config.yml new file mode 100644 index 0000000..e0f7e6d --- /dev/null +++ b/gtest/config.yml @@ -0,0 +1,13 @@ +versions: + "1.15.0": + folder: all + "1.14.0": + folder: all + "1.13.0": + folder: all + "1.12.1": + folder: all + "1.10.0": + folder: all + "1.8.1": + folder: all diff --git a/hwloc/all/conandata.yml b/hwloc/all/conandata.yml new file mode 100644 index 0000000..1f50c80 --- /dev/null +++ b/hwloc/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.10.0": + url: "https://download.open-mpi.org/release/hwloc/v2.10/hwloc-2.10.0.tar.bz2" + sha256: "0305dd60c9de2fbe6519fe2a4e8fdc6d3db8de574a0ca7812b92e80c05ae1392" + "2.9.3": + url: "https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.3.tar.bz2" + sha256: "5c4062ce556f6d3451fc177ffb8673a2120f81df6835dea6a21a90fbdfff0dec" diff --git a/hwloc/all/conanfile.py b/hwloc/all/conanfile.py new file mode 100644 index 0000000..ff20e76 --- /dev/null +++ b/hwloc/all/conanfile.py @@ -0,0 +1,102 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + +# INFO: In order to prevent OneTBB missing package error, we build only shared library for hwloc. + +class HwlocConan(ConanFile): + name = "hwloc" + description = "Portable Hardware Locality (hwloc)" + topics = ("hardware", "topology") + license = "BSD-3-Clause" + homepage = "https://www.open-mpi.org/projects/hwloc/" + url = "https://github.com/conan-io/conan-center-index" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_libxml2": [True, False] + } + default_options = { + "with_libxml2": False + } + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def requirements(self): + if self.options.with_libxml2: + self.requires("libxml2/[>=2.12.5 <3]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def generate(self): + if self.settings.os == "Windows": + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.cache_variables["HWLOC_ENABLE_TESTING"] = 'OFF' + tc.cache_variables["HWLOC_SKIP_LSTOPO"] = 'ON' + tc.cache_variables["HWLOC_SKIP_TOOLS"] = 'ON' + tc.cache_variables["HWLOC_SKIP_INCLUDES"] = 'OFF' + tc.cache_variables["HWLOC_WITH_OPENCL"] = 'OFF' + tc.cache_variables["HWLOC_WITH_CUDA"] = 'OFF' + tc.cache_variables["HWLOC_BUILD_SHARED_LIBS"] = True + tc.cache_variables["HWLOC_WITH_LIBXML2"] = self.options.with_libxml2 + tc.generate() + else: + deps = PkgConfigDeps(self) + deps.generate() + tc = AutotoolsToolchain(self) + if not self.options.with_libxml2: + tc.configure_args.extend(["--disable-libxml2"]) + tc.configure_args.extend(["--disable-io", "--disable-cairo"]) + tc.configure_args.extend(["--enable-shared", "--disable-static"]) + tc.generate() + + def build(self): + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join("contrib", "windows-cmake")) + cmake.build() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.install() + # remove PDB files + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + else: + autotools = Autotools(self) + autotools.install() + fix_apple_shared_install_name(self) + # remove tools + rmdir(self, os.path.join(self.package_folder, "bin")) + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "hwloc") + self.cpp_info.libs = ["hwloc"] + if is_apple_os(self): + self.cpp_info.frameworks = ['IOKit', 'Foundation', 'CoreFoundation'] diff --git a/hwloc/all/test_package/CMakeLists.txt b/hwloc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..ea8c4a4 --- /dev/null +++ b/hwloc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(hwloc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE hwloc::hwloc) diff --git a/hwloc/all/test_package/conanfile.py b/hwloc/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/hwloc/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/hwloc/all/test_package/test_package.c b/hwloc/all/test_package/test_package.c new file mode 100644 index 0000000..a8a04af --- /dev/null +++ b/hwloc/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +int main(void) { + hwloc_topology_t topology; + + hwloc_topology_init(&topology); + hwloc_topology_destroy(topology); + + return 0; +} diff --git a/hwloc/config.yml b/hwloc/config.yml new file mode 100644 index 0000000..2da6ef8 --- /dev/null +++ b/hwloc/config.yml @@ -0,0 +1,5 @@ +versions: + "2.10.0": + folder: all + "2.9.3": + folder: all diff --git a/jemalloc/all/conandata.yml b/jemalloc/all/conandata.yml index 01ec764..d4bd61a 100644 --- a/jemalloc/all/conandata.yml +++ b/jemalloc/all/conandata.yml @@ -9,3 +9,14 @@ sources: patches: "5.2.1": - patch_file: "patches/0001-clang12-dont-declare-system-functions-as-nothrow.patch" + patch_description: "Remove nothrow from system function declarations on macOS and FreeBSD." + patch_type: "backport" + "5.3.0": + - patch_file: "patches/0002-add-missing-ac-define-description.patch" + patch_description: "Patch configure.ac to add the missing description in AC_DEFINE." + patch_type: "backport" + patch_source: "https://github.com/jemalloc/jemalloc/pull/2396" + - patch_file: "patches/0003-add-missing-cpp-flags-for-windows.patch" + patch_description: "Add the missing compiler flags for MSVC on Windows." + patch_type: "backport" + patch_source: "https://github.com/jemalloc/jemalloc/issues/2283" diff --git a/jemalloc/all/conanfile.py b/jemalloc/all/conanfile.py index e2ee4ae..7273a9f 100644 --- a/jemalloc/all/conanfile.py +++ b/jemalloc/all/conanfile.py @@ -1,15 +1,15 @@ from conan import ConanFile -from conans import AutoToolsBuildEnvironment, MSBuild from conan.errors import ConanInvalidConfiguration -from conan.tools.scm import Version -from conans import tools as tools_legacy -from conan.tools.files import apply_conandata_patches, get, rename, replace_in_file +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout +from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy, rename, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os import shutil -import string -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.54.0" class JemallocConan(ConanFile): @@ -17,13 +17,13 @@ class JemallocConan(ConanFile): description = "jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support." url = "https://github.com/conan-io/conan-center-index" license = "BSD-2-Clause" - homepage = "http://jemalloc.net/" + homepage = "https://jemalloc.net/" topics = ("conan", "jemalloc", "malloc", "free") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "prefix": "ANY", + "prefix": ["ANY"], "enable_cxx": [True, False], "enable_fill": [True, False], "enable_xmalloc": [True, False], @@ -50,9 +50,36 @@ class JemallocConan(ConanFile): "enable_libdl": True, "enable_prof": False, } - exports_sources = ["patches/**"] - _autotools = None + @property + def _minimum_compilers_version(self): + return { + "clang": "3.9", + "apple-clang": "8", + # The upstream repository provides solution files for Visual Studio 2015, 2017, 2019 and 2022, + # but the 2015 solution does not work properly due to unresolved external symbols: + # `test_hooks_libc_hook` and `test_hooks_arena_new_hook` + "Visual Studio": "15", + "msvc": "191", + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _library_name(self): + libname = "jemalloc" + if self.settings.os == "Windows": + if not self.options.shared: + libname += "_s" + else: + if not self.options.shared and self.options.fPIC: + libname += "_pic" + return libname + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -60,259 +87,109 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self.options.enable_cxx: - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - - def validate(self): - if ( - self.options.enable_cxx - and self.settings.compiler.get_safe("libcxx") == "libc++" - and self.settings.compiler == "clang" - and Version(self.settings.compiler.version) < "10" - ): - raise ConanInvalidConfiguration( - "clang and libc++ version {} (< 10) is missing a mutex implementation".format( - self.settings.compiler.version - ) - ) - if ( - self.settings.compiler == "Visual Studio" - and self.options.shared - and "MT" in self.settings.compiler.runtime - ): - raise ConanInvalidConfiguration( - "Visual Studio build for shared library with MT runtime is not supported" - ) - if ( - self.settings.compiler == "Visual Studio" - and self.settings.compiler.version != "15" - ): - # https://github.com/jemalloc/jemalloc/issues/1703 - raise ConanInvalidConfiguration( - "Only Visual Studio 15 2017 is supported. Please fix this if other versions are supported" - ) - if self.settings.build_type not in ("Release", "Debug", None): - raise ConanInvalidConfiguration( - "Only Release and Debug build_types are supported" - ) - if self.settings.compiler == "Visual Studio" and self.settings.arch not in ( - "x86_64", - "x86", - ): - raise ConanInvalidConfiguration("Unsupported arch") - if ( - self.settings.compiler == "clang" - and Version(self.settings.compiler.version) <= "3.9" - ): - raise ConanInvalidConfiguration("Unsupported compiler version") - # if self.settings.os == "Macos" and self.settings.arch not in ("x86_64", "x86"): - # raise ConanInvalidConfiguration("Unsupported arch") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): basic_layout(self, src_folder="src") - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - def build_requirements(self): - if self._settings_build.os == "Windows" and not self.conf.get( - "tools.microsoft.bash:path", default=False, check_type=bool - ): - self.build_requires("msys2/cci.latest") - - def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True - ) + self.tool_requires("automake/1.16.5") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") - @property - def _autotools_args(self): - conf_args = [ - "--with-jemalloc-prefix={}".format(self.options.prefix), - "--enable-debug" - if self.settings.build_type == "Debug" - else "--disable-debug", - "--enable-cxx" if self.options.enable_cxx else "--disable-cxx", - "--enable-fill" if self.options.enable_fill else "--disable-fill", - "--enable-xmalloc" if self.options.enable_cxx else "--disable-xmalloc", - "--enable-readlinkat" - if self.options.enable_readlinkat - else "--disable-readlinkat", - "--enable-syscall" if self.options.enable_syscall else "--disable-syscall", - "--enable-lazy-lock" - if self.options.enable_lazy_lock - else "--disable-lazy-lock", - "--enable-log" if self.options.enable_debug_logging else "--disable-log", - "--enable-initial-exec-tls" - if self.options.enable_initial_exec_tls - else "--disable-initial-exec-tls", - "--enable-libdl" if self.options.enable_libdl else "--disable-libdl", - ] - if self.options.enable_prof: - conf_args.append("--enable-prof") - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - return conf_args - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment( - self, win_bash=tools_legacy.os_info.is_windows - ) - self._autotools.configure( - args=self._autotools_args, configure_dir=self.source_folder - ) - return self._autotools - - @property - def _msvc_build_type(self): - build_type = str(self.settings.build_type) or "Release" - if not self.options.shared: - build_type += "-static" - return build_type - - def _patch_sources(self): - if self.settings.os == "Windows": - makefile_in = os.path.join(self.source_folder, "Makefile.in") - replace_in_file( - self, - makefile_in, - "DSO_LDFLAGS = @DSO_LDFLAGS@", - "DSO_LDFLAGS = @DSO_LDFLAGS@ -Wl,--out-implib,lib/libjemalloc.a", - strict=False, - ) - replace_in_file( - self, - makefile_in, - "\t$(INSTALL) -d $(LIBDIR)\n" - "\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(LIBDIR)", - "\t$(INSTALL) -d $(BINDIR)\n" - "\t$(INSTALL) -d $(LIBDIR)\n" - "\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(BINDIR)\n" - "\t$(INSTALL) -m 644 $(objroot)lib/libjemalloc.a $(LIBDIR)", - strict=False, - ) + def validate(self): + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires {self.settings.compiler} >= {minimum_version}") + # 1. MSVC specific checks + if is_msvc(self): + # Building the shared library with a static MSVC runtime is not supported + if self.options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Building the shared library with MT runtime is not supported.") + # Only x86-64 and x86 are supported + if self.settings.arch not in ["x86_64", "x86"]: + raise ConanInvalidConfiguration(f"{self.settings.arch} is not supported.") + # 2. Clang specific checks + if self.settings.compiler == "clang": + if self.options.enable_cxx and self.settings.compiler.get_safe("libcxx") == "libc++" and \ + Version(self.settings.compiler.version) < "10": + raise ConanInvalidConfiguration("Clang 9 or earlier with libc++ is not supported due to the missing mutex implementation.") + # 3. Verify the build type + if self.settings.build_type not in ("Release", "Debug", None): + raise ConanInvalidConfiguration("Only Release and Debug builds are supported.") + # 4: Apple Silicon specific checks + if self.settings.os == "Macos" and self.settings.arch == "armv8": + if Version(self.version) < "5.3.0": + raise ConanInvalidConfiguration("Support for Apple Silicon is only available as of 5.3.0.") - apply_conandata_patches(self) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + enable_disable = lambda opt, val: f"--enable-{opt}" if val else f"--disable-{opt}" + tc.configure_args.extend([ + f"--with-jemalloc-prefix={self.options.prefix}", + enable_disable("debug", self.settings.build_type == "Debug"), + enable_disable("cxx", self.options.enable_cxx), + enable_disable("fill", self.options.enable_fill), + enable_disable("xmalloc", self.options.enable_cxx), + enable_disable("readlinkat", self.options.enable_readlinkat), + enable_disable("syscall", self.options.enable_syscall), + enable_disable("lazy-lock", self.options.enable_lazy_lock), + enable_disable("log", self.options.enable_debug_logging), + enable_disable("initial-exec-tls", self.options.enable_initial_exec_tls), + enable_disable("libdl", self.options.enable_libdl), + enable_disable("prof", self.options.enable_prof), + ]) + env = tc.environment() + if is_msvc(self): + # Do not check whether the math library exists when compiled by MSVC + # because MSVC treats the function `char log()` as a intrinsic function + # and therefore complains about insufficient arguments passed to the function + tc.configure_args.append("ac_cv_search_log=none required") + env.define("CC", "cl") + env.define("CXX", "cl") + tc.generate(env) def build(self): - self._patch_sources() - if self.settings.compiler == "Visual Studio": - with tools_legacy.vcvars( - self.settings - ) if self.settings.compiler == "Visual Studio" else tools_legacy.no_op(): - with tools_legacy.environment_append( - {"CC": "cl", "CXX": "cl"} - ) if self.settings.compiler == "Visual Studio" else tools_legacy.no_op(): - with tools_legacy.chdir(self.source_folder): - # Do not use AutoToolsBuildEnvironment because we want to run configure as ./configure - self.run( - "./configure {}".format(" ".join(self._autotools_args)), - win_bash=tools_legacy.os_info.is_windows, - ) - msbuild = MSBuild(self) - # Do not use the 2015 solution: unresolved external symbols: test_hooks_libc_hook and test_hooks_arena_new_hook - sln_file = os.path.join(self.source_folder, "msvc", "jemalloc_vc2017.sln") - msbuild.build( - sln_file, targets=["jemalloc"], build_type=self._msvc_build_type - ) - else: - autotools = self._configure_autotools() - autotools.make() - - @property - def _library_name(self): - libname = "jemalloc" - if self.settings.compiler == "Visual Studio": - if self.options.shared: - if self.settings.build_type == "Debug": - libname += "d" - else: - toolset = tools_legacy.msvs_toolset(self.settings) - toolset_number = "".join(c for c in toolset if c in string.digits) - libname += "-vc{}-{}".format(toolset_number, self._msvc_build_type) - else: - if self.settings.os == "Windows": - if not self.options.shared: - libname += "_s" - else: - if not self.options.shared and self.options.fPIC: - libname += "_pic" - return libname + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy(pattern="COPYING", src=self.source_folder, dst="licenses") - if self.settings.compiler == "Visual Studio": - arch_subdir = { - "x86_64": "x64", - "x86": "x86", - }[str(self.settings.arch)] - self.copy( - "*.lib", - src=os.path.join( - self.source_folder, "msvc", arch_subdir, self._msvc_build_type - ), - dst=os.path.join(self.package_folder, "lib"), - ) - self.copy( - "*.dll", - src=os.path.join( - self.source_folder, "msvc", arch_subdir, self._msvc_build_type - ), - dst=os.path.join(self.package_folder, "bin"), - ) - self.copy( - "jemalloc.h", - src=os.path.join(self.source_folder, "include", "jemalloc"), - dst=os.path.join(self.package_folder, "include", "jemalloc"), - keep_path=True, - ) - shutil.copytree( - os.path.join(self.source_folder, "include", "msvc_compat"), - os.path.join(self.package_folder, "include", "msvc_compat"), - ) - else: - autotools = self._configure_autotools() - # Use install_lib_XXX and install_include to avoid mixing binaries and dll's - autotools.make( - target="install_lib_shared" - if self.options.shared - else "install_lib_static" - ) - autotools.make(target="install_include") - if self.settings.os == "Windows" and self.settings.compiler == "gcc": - rename( - self, - os.path.join( - self.package_folder, "lib", "{}.lib".format(self._library_name) - ), - os.path.join( - self.package_folder, "lib", "lib{}.a".format(self._library_name) - ), - ) - if not self.options.shared: - os.unlink(os.path.join(self.package_folder, "lib", "jemalloc.lib")) + copy(self, pattern="COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install(target="install_lib_shared" if self.options.shared else "install_lib_static") + autotools.install(target="install_include") + if self.settings.os == "Windows" and self.settings.compiler == "gcc": + rename(self, os.path.join(self.package_folder, "lib", f"{self._library_name}.lib"), + os.path.join(self.package_folder, "lib", f"lib{self._library_name}.a")) + if not self.options.shared: + os.unlink(os.path.join(self.package_folder, "lib", "jemalloc.lib")) + if is_msvc(self): + shutil.copytree(os.path.join(self.source_folder, "include", "msvc_compat"), + os.path.join(self.package_folder, "include", "msvc_compat")) + if self.options.shared: + rmdir(self, os.path.join(self.package_folder, "lib")) + copy(self, "*.lib", os.path.join(self.build_folder, "lib"), os.path.join(self.package_folder, "lib")) + copy(self, "*.dll", os.path.join(self.build_folder, "lib"), os.path.join(self.package_folder, "bin")) def package_info(self): - self.cpp_info.names["pkg_config"] = "jemalloc" + self.cpp_info.set_property("pkg_config_name", "jemalloc") self.cpp_info.libs = [self._library_name] - self.cpp_info.includedirs = [ - os.path.join(self.package_folder, "include"), - os.path.join(self.package_folder, "include", "jemalloc"), - ] - if self.settings.compiler == "Visual Studio": - self.cpp_info.includedirs.append( - os.path.join(self.package_folder, "include", "msvc_compat") - ) + self.cpp_info.includedirs = [os.path.join(self.package_folder, "include"), + os.path.join(self.package_folder, "include", "jemalloc")] + if is_msvc(self): + self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include", "msvc_compat")) if not self.options.shared: self.cpp_info.defines = ["JEMALLOC_EXPORT="] if self.settings.os in ["Linux", "FreeBSD"]: diff --git a/jemalloc/all/patches/0002-add-missing-ac-define-description.patch b/jemalloc/all/patches/0002-add-missing-ac-define-description.patch new file mode 100644 index 0000000..7799dfb --- /dev/null +++ b/jemalloc/all/patches/0002-add-missing-ac-define-description.patch @@ -0,0 +1,13 @@ +diff --git a/configure.ac b/configure.ac +index f6d25f334..3115504e2 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1592,7 +1592,7 @@ fi + [enable_uaf_detection="0"] + ) + if test "x$enable_uaf_detection" = "x1" ; then +- AC_DEFINE([JEMALLOC_UAF_DETECTION], [ ]) ++ AC_DEFINE([JEMALLOC_UAF_DETECTION], [ ], ["enable UAF"]) + fi + AC_SUBST([enable_uaf_detection]) + diff --git a/jemalloc/all/patches/0003-add-missing-cpp-flags-for-windows.patch b/jemalloc/all/patches/0003-add-missing-cpp-flags-for-windows.patch new file mode 100644 index 0000000..6e6e2d1 --- /dev/null +++ b/jemalloc/all/patches/0003-add-missing-cpp-flags-for-windows.patch @@ -0,0 +1,12 @@ +diff --git a/configure.ac b/configure.ac +index 3115504e2..ffb504b08 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -749,6 +749,7 @@ case "${host}" in + so="dll" + if test "x$je_cv_msvc" = "xyes" ; then + importlib="lib" ++ JE_APPEND_VS(CPPFLAGS, -DJEMALLOC_NO_PRIVATE_NAMESPACE) + DSO_LDFLAGS="-LD" + EXTRA_LDFLAGS="-link -DEBUG" + CTARGET='-Fo$@' diff --git a/jemalloc/all/test_package/CMakeLists.txt b/jemalloc/all/test_package/CMakeLists.txt index 0cc4864..7188248 100644 --- a/jemalloc/all/test_package/CMakeLists.txt +++ b/jemalloc/all/test_package/CMakeLists.txt @@ -1,9 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(jemalloc REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE jemalloc::jemalloc) diff --git a/jemalloc/all/test_package/conanfile.py b/jemalloc/all/test_package/conanfile.py index d4128b0..d60b533 100644 --- a/jemalloc/all/test_package/conanfile.py +++ b/jemalloc/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/jemalloc/all/test_package/test_package.c b/jemalloc/all/test_package/test_package.c new file mode 100644 index 0000000..cf16dc2 --- /dev/null +++ b/jemalloc/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include + +#include + +void do_something(size_t i) { + // Leak some memory. + malloc(i * 100); +} + +int main() { + for (size_t i = 0; i < 1000; i++) { + do_something(i); + } + + // Dump allocator statistics to stderr. + malloc_stats_print(NULL, NULL, NULL); + + return 0; +} diff --git a/jemalloc/all/test_package/test_package.cpp b/jemalloc/all/test_package/test_package.cpp deleted file mode 100644 index 5d19fec..0000000 --- a/jemalloc/all/test_package/test_package.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include - -#include - -void -do_something(size_t i) { - // Leak some memory. - malloc(i * 100); -} - -int -main(int argc, char **argv) { - for (size_t i = 0; i < 1000; i++) { - do_something(i); - } - - // Dump allocator statistics to stderr. - malloc_stats_print(NULL, NULL, NULL); - - return 0; -} diff --git a/jemalloc/all/test_v1_package/CMakeLists.txt b/jemalloc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..b21cc49 --- /dev/null +++ b/jemalloc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/jemalloc/all/test_v1_package/conanfile.py b/jemalloc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..49a3a66 --- /dev/null +++ b/jemalloc/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/libbacktrace/all/conandata.yml b/libbacktrace/all/conandata.yml new file mode 100644 index 0000000..56d79ce --- /dev/null +++ b/libbacktrace/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "cci.20210118": + url: "https://github.com/ianlancetaylor/libbacktrace/archive/dedbe13fda00253fe5d4f2fb812c909729ed5937.tar.gz" + sha256: "dc8c167f48f3de5ae318c528b26b72f300edb6e33744e55394674fd4b7cdd21d" +patches: + "cci.20210118": + - patch_file: "patches/0001-pointer-arithmetic.patch" + - patch_file: "patches/0002-msvc-unistd-alternative.patch" diff --git a/libbacktrace/all/conanfile.py b/libbacktrace/all/conanfile.py new file mode 100644 index 0000000..2fa71b8 --- /dev/null +++ b/libbacktrace/all/conanfile.py @@ -0,0 +1,108 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.54.0" + + +class LibbacktraceConan(ConanFile): + name = "libbacktrace" + description = "A C library that may be linked into a C/C++ program to produce symbolic backtraces." + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ianlancetaylor/libbacktrace" + license = "BSD-3-Clause" + topics = ("backtrace", "stack-trace") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + check_min_vs(self, "180") + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration("libbacktrace shared is not supported with Visual Studio") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self): + # https://github.com/conan-io/conan/issues/6514 + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self.conf.get("user.automake:compile-wrapper")) + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper")) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + lib_folder = os.path.join(self.package_folder, "lib") + rm(self, "*.la", lib_folder) + fix_apple_shared_install_name(self) + if is_msvc(self): + rename(self, os.path.join(lib_folder, "libbacktrace.lib"), + os.path.join(lib_folder, "backtrace.lib")) + + def package_info(self): + self.cpp_info.libs = ["backtrace"] diff --git a/libbacktrace/all/patches/0001-pointer-arithmetic.patch b/libbacktrace/all/patches/0001-pointer-arithmetic.patch new file mode 100644 index 0000000..062c4cd --- /dev/null +++ b/libbacktrace/all/patches/0001-pointer-arithmetic.patch @@ -0,0 +1,29 @@ +--- a/pecoff.c ++++ b/pecoff.c +@@ -648,7 +648,7 @@ coff_add (struct backtrace_state *state, int descriptor, + magic_ok = memcmp (magic, "PE\0", 4) == 0; + fhdr_off += 4; + +- memcpy (&fhdr, fhdr_view.data + 4, sizeof fhdr); ++ memcpy (&fhdr, (char *)fhdr_view.data + 4, sizeof fhdr); + } + else + { +@@ -682,7 +682,7 @@ coff_add (struct backtrace_state *state, int descriptor, + sects_view_valid = 1; + opt_hdr = (const b_coff_optional_header *) sects_view.data; + sects = (const b_coff_section_header *) +- (sects_view.data + fhdr.size_of_optional_header); ++ ((b_coff_optional_header *)sects_view.data + fhdr.size_of_optional_header); + + is_64 = 0; + if (fhdr.size_of_optional_header > sizeof (*opt_hdr)) +@@ -726,7 +726,7 @@ coff_add (struct backtrace_state *state, int descriptor, + goto fail; + syms_view_valid = 1; + +- str_size = coff_read4 (syms_view.data + syms_size); ++ str_size = coff_read4 ((const unsigned char *)((char *)syms_view.data + syms_size)); + + str_off = syms_off + syms_size; + diff --git a/libbacktrace/all/patches/0002-msvc-unistd-alternative.patch b/libbacktrace/all/patches/0002-msvc-unistd-alternative.patch new file mode 100644 index 0000000..988e538 --- /dev/null +++ b/libbacktrace/all/patches/0002-msvc-unistd-alternative.patch @@ -0,0 +1,54 @@ +--- a/allocfail.c ++++ b/allocfail.c +@@ -33,7 +33,6 @@ POSSIBILITY OF SUCH DAMAGE. */ + #include + #include + #include +-#include + + #include "filenames.h" + +--- a/fileline.c ++++ b/fileline.c +@@ -37,7 +37,11 @@ POSSIBILITY OF SUCH DAMAGE. */ + #include + #include + #include ++#ifdef _MSC_VER ++#include ++#else + #include ++#endif + + #if defined (HAVE_KERN_PROC_ARGS) || defined (HAVE_KERN_PROC) + #include +--- a/posix.c ++++ b/posix.c +@@ -36,7 +36,11 @@ POSSIBILITY OF SUCH DAMAGE. */ + #include + #include + #include ++#ifdef _MSC_VER ++#include ++#else + #include ++#endif + + #include "backtrace.h" + #include "internal.h" +--- a/read.c ++++ b/read.c +@@ -35,7 +35,13 @@ POSSIBILITY OF SUCH DAMAGE. */ + #include + #include + #include ++#ifdef _MSC_VER ++#include ++#include ++typedef SSIZE_T ssize_t; ++#else + #include ++#endif + + #include "backtrace.h" + #include "internal.h" diff --git a/libbacktrace/all/test_package/CMakeLists.txt b/libbacktrace/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..81b50a3 --- /dev/null +++ b/libbacktrace/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libbacktrace REQUIRED CONFIG) + +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE libbacktrace::libbacktrace) diff --git a/libbacktrace/all/test_package/conanfile.py b/libbacktrace/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/libbacktrace/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/libbacktrace/all/test_package/test_package.c b/libbacktrace/all/test_package/test_package.c new file mode 100644 index 0000000..c707f35 --- /dev/null +++ b/libbacktrace/all/test_package/test_package.c @@ -0,0 +1,36 @@ +#include +#include + +#include +#include +#include + +void +error_callback(void* data, const char* msg, int errnum) +{ + fprintf(stderr, "%s", msg); + if (errnum > 0) + fprintf(stderr, ": %s", strerror(errnum)); + fprintf(stderr, "\n"); + exit(0); +} + +int +simple_callback(void* data, uintptr_t pc) +{ + printf(" 0x%016llx\n", pc); + return 1; +} + +int +main(int argc, char** argv) +{ + void* state; + + state = backtrace_create_state(argv[0], BACKTRACE_SUPPORTS_THREADS, error_callback, NULL); + printf("Top stack frame:\n"); + backtrace_simple(state, 0, simple_callback, error_callback, NULL); + printf("Done\n"); + + return 0; +} diff --git a/libbacktrace/all/test_v1_package/CMakeLists.txt b/libbacktrace/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/libbacktrace/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/libbacktrace/all/test_v1_package/conanfile.py b/libbacktrace/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..e0a8588 --- /dev/null +++ b/libbacktrace/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/libbacktrace/config.yml b/libbacktrace/config.yml new file mode 100644 index 0000000..bc0e7dd --- /dev/null +++ b/libbacktrace/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210118": + folder: all diff --git a/libcurl/all/conandata.yml b/libcurl/all/conandata.yml new file mode 100644 index 0000000..612b8f0 --- /dev/null +++ b/libcurl/all/conandata.yml @@ -0,0 +1,41 @@ +sources: + "8.8.0": + url: + - "https://curl.se/download/curl-8.8.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_8_0/curl-8.8.0.tar.xz" + sha256: "0f58bb95fc330c8a46eeb3df5701b0d90c9d9bfcc42bd1cd08791d12551d4400" + "8.6.0": + url: + - "https://curl.se/download/curl-8.6.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_6_0/curl-8.6.0.tar.xz" + sha256: "3ccd55d91af9516539df80625f818c734dc6f2ecf9bada33c76765e99121db15" + "8.5.0": + url: + - "https://curl.se/download/curl-8.5.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_5_0/curl-8.5.0.tar.xz" + sha256: "42ab8db9e20d8290a3b633e7fbb3cec15db34df65fd1015ef8ac1e4723750eeb" + "8.4.0": + url: + - "https://curl.se/download/curl-8.4.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_4_0/curl-8.4.0.tar.xz" + sha256: "16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d" + "8.2.1": + url: + - "https://curl.se/download/curl-8.2.1.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_2_1/curl-8.2.1.tar.xz" + sha256: "dd322f6bd0a20e6cebdfd388f69e98c3d183bed792cf4713c8a7ef498cba4894" + "8.1.2": + url: + - "https://curl.se/download/curl-8.1.2.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_1_2/curl-8.1.2.tar.xz" + sha256: "31b1118eb8bfd43cd95d9a3f146f814ff874f6ed3999b29d94f4d1e7dbac5ef6" + "8.0.1": + url: + - "https://curl.se/download/curl-8.0.1.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_0_1/curl-8.0.1.tar.xz" + sha256: "0a381cd82f4d00a9a334438b8ca239afea5bfefcfa9a1025f2bf118e79e0b5f0" + "7.88.1": + url: + - "https://curl.se/download/curl-7.88.1.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-7_88_1/curl-7.88.1.tar.xz" + sha256: "1dae31b2a7c1fe269de99c0c31bb488346aab3459b5ffca909d6938249ae415f" diff --git a/libcurl/all/conanfile.py b/libcurl/all/conanfile.py new file mode 100644 index 0000000..81baf51 --- /dev/null +++ b/libcurl/all/conanfile.py @@ -0,0 +1,711 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, download, export_conandata_patches, get, load, replace_in_file, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version + +import os +import re + +required_conan_version = ">=1.54.0" + + +class LibcurlConan(ConanFile): + name = "libcurl" + description = "command line tool and library for transferring data with URLs" + license = "curl" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://curl.se" + topics = ("curl", "data-transfer", + "ftp", "gopher", "http", "imap", "ldap", "mqtt", "pop3", "rtmp", "rtsp", + "scp", "sftp", "smb", "smtp", "telnet", "tftp") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": [False, "openssl", "wolfssl", "schannel", "darwinssl", "mbedtls"], + "with_file": [True, False], + "with_ftp": [True, False], + "with_http": [True, False], + "with_ldap": [True, False], + "with_rtsp": [True, False], + "with_dict": [True, False], + "with_telnet": [True, False], + "with_tftp": [True, False], + "with_pop3": [True, False], + "with_imap": [True, False], + "with_smb": [True, False], + "with_smtp": [True, False], + "with_gopher": [True, False], + "with_mqtt": [True, False], + "with_libssh2": [True, False], + "with_libidn": [True, False], + "with_librtmp": [True, False], + "with_libgsasl": [True, False], + "with_libpsl": [True, False], + "with_largemaxwritesize": [True, False], + "with_nghttp2": [True, False], + "with_zlib": [True, False], + "with_brotli": [True, False], + "with_zstd": [True, False], + "with_c_ares": [True, False], + "with_threaded_resolver": [True, False], + "with_proxy": [True, False], + "with_crypto_auth": [True, False], + "with_ntlm": [True, False], + "with_ntlm_wb": [True, False], + "with_cookies": [True, False], + "with_ipv6": [True, False], + "with_docs": [True, False], + "with_misc_docs": [True, False], + "with_verbose_debug": [True, False], + "with_symbol_hiding": [True, False], + "with_unix_sockets": [True, False], + "with_verbose_strings": [True, False], + "with_ca_bundle": [False, "auto", "ANY"], + "with_ca_path": [False, "auto", "ANY"], + "with_ca_fallback": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": "openssl", + "with_dict": True, + "with_file": True, + "with_ftp": True, + "with_gopher": True, + "with_http": True, + "with_imap": True, + "with_ldap": False, + "with_mqtt": True, + "with_pop3": True, + "with_rtsp": True, + "with_smb": True, + "with_smtp": True, + "with_telnet": True, + "with_tftp": True, + "with_libssh2": False, + "with_libidn": False, + "with_librtmp": False, + "with_libgsasl": False, + "with_libpsl": False, + "with_largemaxwritesize": False, + "with_nghttp2": False, + "with_zlib": True, + "with_brotli": False, + "with_zstd": False, + "with_c_ares": False, + "with_threaded_resolver": True, + "with_proxy": True, + "with_crypto_auth": True, + "with_ntlm": True, + "with_ntlm_wb": True, + "with_cookies": True, + "with_ipv6": True, + "with_docs": False, + "with_misc_docs": False, + "with_verbose_debug": True, + "with_symbol_hiding": False, + "with_unix_sockets": True, + "with_verbose_strings": True, + "with_ca_bundle": "auto", + "with_ca_path": "auto", + "with_ca_fallback": False, + } + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _is_win_x_android(self): + return self.settings.os == "Android" and self._settings_build.os == "Windows" + + @property + def _is_using_cmake_build(self): + return is_msvc(self) or self._is_win_x_android + + def export_sources(self): + copy(self, "lib_Makefile_add.am", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self._is_using_cmake_build: + del self.options.with_libgsasl + + if Version(self.version) < "8.7.0": + del self.options.with_misc_docs + + # Default options + self.options.with_ssl = "darwinssl" if is_apple_os(self) else "openssl" + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + if self._is_using_cmake_build: + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_ssl == "openssl": + self.requires("openssl/[>=1.1 <4]") + elif self.options.with_ssl == "wolfssl": + self.requires("wolfssl/5.6.6") + elif self.options.with_ssl == "mbedtls": + self.requires("mbedtls/3.5.0") + if self.options.with_nghttp2: + self.requires("libnghttp2/1.59.0") + if self.options.with_libssh2: + self.requires("libssh2/1.11.0") + if self.options.with_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_brotli: + self.requires("brotli/1.1.0") + if self.options.with_zstd: + self.requires("zstd/1.5.5") + if self.options.with_c_ares: + self.requires("c-ares/[>=1.27 <2]") + if self.options.get_safe("with_libpsl"): + self.requires("libpsl/0.21.1") + + def validate(self): + if self.options.with_ssl == "schannel" and self.settings.os != "Windows": + raise ConanInvalidConfiguration("schannel only suppported on Windows.") + if self.options.with_ssl == "darwinssl" and not is_apple_os(self): + raise ConanInvalidConfiguration("darwinssl only suppported on Apple like OS (Macos, iOS, watchOS or tvOS).") + if self.options.with_ssl == "openssl": + openssl = self.dependencies["openssl"] + if self.options.with_ntlm and openssl.options.no_des: + raise ConanInvalidConfiguration("option with_ntlm=True requires openssl:no_des=False") + if self.options.with_ssl == "wolfssl" and not self.dependencies["wolfssl"].options.with_curl: + raise ConanInvalidConfiguration("option with_ssl=wolfssl requires wolfssl:with_curl=True") + + def build_requirements(self): + if self._is_using_cmake_build: + if self._is_win_x_android: + self.tool_requires("ninja/1.11.1") + else: + self.tool_requires("libtool/2.4.7") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.1.0") + if self.settings.os in [ "tvOS", "watchOS" ]: + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + cert_url = self.conf.get("user.libcurl.cert:url", check_type=str) or "https://curl.se/ca/cacert-2023-08-22.pem" + cert_sha256 = self.conf.get("user.libcurl.cert:sha256", check_type=str) or "23c2469e2a568362a62eecf1b49ed90a15621e6fa30e29947ded3436422de9b9" + download(self, cert_url, "cacert.pem", verify=True, sha256=cert_sha256) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if self._is_using_cmake_build: + self._generate_with_cmake() + else: + self._generate_with_autotools() + + def build(self): + self._patch_sources() + if self._is_using_cmake_build: + cmake = CMake(self) + cmake.configure() + cmake.build() + else: + autotools = Autotools(self) + autotools.autoreconf() + # autoreconf is caalled with "--force" which regenerate all files. + # Because we want to use a patched config.sub for tvOS/watchOS, we + # need to call this patch after autoreconf. + self._patch_autoreconf() + autotools.configure() + autotools.make() + + def _patch_autoreconf(self): + # Fix config.sub for tvOS/watchOS + if self.settings.os in [ "tvOS", "watchOS" ]: + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + + def _patch_sources(self): + apply_conandata_patches(self) + self._patch_misc_files() + self._patch_autotools() + self._patch_cmake() + + def _patch_misc_files(self): + if self.options.with_largemaxwritesize: + replace_in_file(self, os.path.join(self.source_folder, "include", "curl", "curl.h"), + "define CURL_MAX_WRITE_SIZE 16384", + "define CURL_MAX_WRITE_SIZE 10485760") + + # https://github.com/curl/curl/issues/2835 + # for additional info, see this comment https://github.com/conan-io/conan-center-index/pull/1008#discussion_r386122685 + if self.settings.compiler == "apple-clang" and self.settings.compiler.version == "9.1": + if self.options.with_ssl == "darwinssl": + replace_in_file(self, os.path.join(self.source_folder, "lib", "vtls", "sectransp.c"), + "#define CURL_BUILD_MAC_10_13 MAC_OS_X_VERSION_MAX_ALLOWED >= 101300", + "#define CURL_BUILD_MAC_10_13 0") + + def _patch_autotools(self): + if self._is_using_cmake_build: + return + + # Disable curl tool for these reasons: + # - link errors if mingw shared or iOS/tvOS/watchOS + # - it makes recipe consistent with CMake build where we don't build curl tool + top_makefile = os.path.join(self.source_folder, "Makefile.am") + if Version(self.version) < "8.8.0": + replace_in_file(self, top_makefile, "SUBDIRS = lib src", "SUBDIRS = lib") + else: + replace_in_file(self, top_makefile, "SUBDIRS = lib docs src scripts", "SUBDIRS = lib") + replace_in_file(self, top_makefile, "include src/Makefile.inc", "") + + # zlib naming is not always very consistent + if self.options.with_zlib: + configure_ac = os.path.join(self.source_folder, "configure.ac") + zlib_name = self.dependencies["zlib"].cpp_info.aggregated_components().libs[0] + replace_in_file(self, configure_ac, + "AC_CHECK_LIB(z,", + f"AC_CHECK_LIB({zlib_name},") + replace_in_file(self, configure_ac, + "-lz", + f"-l{zlib_name} ") + + if self._is_mingw and self.options.shared: + # patch for shared mingw build + lib_makefile = os.path.join(self.source_folder, "lib", "Makefile.am") + replace_in_file(self, lib_makefile, + "noinst_LTLIBRARIES = libcurlu.la", + "") + replace_in_file(self, lib_makefile, + "noinst_LTLIBRARIES =", + "") + replace_in_file(self, lib_makefile, + "lib_LTLIBRARIES = libcurl.la", + "noinst_LTLIBRARIES = libcurl.la") + # add directives to build dll + # used only for native mingw-make + if not cross_building(self): + # The patch file is located in the base src folder + added_content = load(self, os.path.join(self.folders.base_source, "lib_Makefile_add.am")) + save(self, lib_makefile, added_content, append=True) + + def _patch_cmake(self): + if not self._is_using_cmake_build: + return + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # TODO: check this patch, it's suspicious + if Version(self.version) < "8.4.0": + replace_in_file(self, cmakelists, + "include(CurlSymbolHiding)", "") + + # brotli + if Version(self.version) < "8.2.0": + replace_in_file(self, cmakelists, "find_package(Brotli QUIET)", "find_package(brotli REQUIRED CONFIG)") + else: + replace_in_file(self, cmakelists, "find_package(Brotli REQUIRED)", "find_package(brotli REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "if(BROTLI_FOUND)", "if(brotli_FOUND)") + replace_in_file(self, cmakelists, "${BROTLI_LIBRARIES}", "brotli::brotli") + replace_in_file(self, cmakelists, "${BROTLI_INCLUDE_DIRS}", "${brotli_INCLUDE_DIRS}") + + # zstd + # Use upstream FindZstd.cmake because check_symbol_exists() is called + # afterwards and it would fail with zstd_LIBRARIES generated by CMakeDeps + replace_in_file(self, cmakelists, "find_package(Zstd REQUIRED)", "find_package(Zstd REQUIRED MODULE)") + replace_in_file(self, os.path.join(self.source_folder, "CMake", "FindZstd.cmake"), "if(UNIX)", "if(0)") + + # c-ares + replace_in_file(self, cmakelists, "find_package(CARES REQUIRED)", "find_package(c-ares REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${CARES_LIBRARY}", "c-ares::cares") + + # libpsl + replace_in_file(self, cmakelists, "find_package(LibPSL)", "find_package(libpsl REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "if(LIBPSL_FOUND)", "if(libpsl_FOUND)") + replace_in_file(self, cmakelists, "${LIBPSL_LIBRARY}", "libpsl::libpsl") + replace_in_file(self, cmakelists, "${LIBPSL_INCLUDE_DIR}", "${libpsl_INCLUDE_DIRS}") + + # libssh2 + replace_in_file(self, cmakelists, "find_package(LibSSH2)", "find_package(Libssh2 REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "if(LIBSSH2_FOUND)", "if(Libssh2_FOUND)") + replace_in_file(self, cmakelists, "${LIBSSH2_LIBRARY}", "Libssh2::libssh2") + replace_in_file(self, cmakelists, "${LIBSSH2_INCLUDE_DIR}", "${Libssh2_INCLUDE_DIRS}") + + # libnghttp2 + replace_in_file(self, cmakelists, "find_package(NGHTTP2 REQUIRED)", "find_package(libnghttp2 REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${NGHTTP2_INCLUDE_DIRS}", "${libnghttp2_INCLUDE_DIRS}") + replace_in_file(self, cmakelists, "${NGHTTP2_LIBRARIES}", "libnghttp2::nghttp2") + + # wolfssl + replace_in_file(self, cmakelists, "find_package(WolfSSL REQUIRED)", "find_package(wolfssl REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${WolfSSL_LIBRARIES}", "${wolfssl_LIBRARIES}") + replace_in_file(self, cmakelists, "${WolfSSL_INCLUDE_DIRS}", "${wolfssl_INCLUDE_DIRS}") + + # INTERFACE_LIBRARY (generated by the cmake_find_package generator) targets doesn't have the LOCATION property. + # So skipp the LOCATION check in the CMakeLists.txt + replace_in_file( + self, + cmakelists, + 'get_target_property(_lib "${_libname}" LOCATION)', + """get_target_property(_type "${_libname}" TYPE) + if(${_type} STREQUAL "INTERFACE_LIBRARY") + # Reading the INTERFACE_LIBRARY property on non-imported target will error out. + continue() + endif() + get_target_property(_lib "${_libname}" LOCATION)""", + ) + + def _yes_no(self, value): + return "yes" if value else "no" + + def _generate_with_autotools(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + f"--with-libidn2={self._yes_no(self.options.with_libidn)}", + f"--with-librtmp={self._yes_no(self.options.with_librtmp)}", + f"--with-libpsl={self._yes_no(self.options.with_libpsl)}", + f"--with-libgsasl={self._yes_no(self.options.with_libgsasl)}", + f"--with-schannel={self._yes_no(self.options.with_ssl == 'schannel')}", + f"--with-secure-transport={self._yes_no(self.options.with_ssl == 'darwinssl')}", + f"--with-brotli={self._yes_no(self.options.with_brotli)}", + f"--enable-shared={self._yes_no(self.options.shared)}", + f"--enable-static={self._yes_no(not self.options.shared)}", + f"--enable-dict={self._yes_no(self.options.with_dict)}", + f"--enable-file={self._yes_no(self.options.with_file)}", + f"--enable-ftp={self._yes_no(self.options.with_ftp)}", + f"--enable-gopher={self._yes_no(self.options.with_gopher)}", + f"--enable-http={self._yes_no(self.options.with_http)}", + f"--enable-imap={self._yes_no(self.options.with_imap)}", + f"--enable-ldap={self._yes_no(self.options.with_ldap)}", + f"--enable-mqtt={self._yes_no(self.options.with_mqtt)}", + f"--enable-pop3={self._yes_no(self.options.with_pop3)}", + f"--enable-rtsp={self._yes_no(self.options.with_rtsp)}", + f"--enable-smb={self._yes_no(self.options.with_smb)}", + f"--enable-smtp={self._yes_no(self.options.with_smtp)}", + f"--enable-telnet={self._yes_no(self.options.with_telnet)}", + f"--enable-tftp={self._yes_no(self.options.with_tftp)}", + f"--enable-debug={self._yes_no(self.settings.build_type == 'Debug')}", + f"--enable-ares={self._yes_no(self.options.with_c_ares)}", + f"--enable-threaded-resolver={self._yes_no(self.options.with_threaded_resolver)}", + f"--enable-cookies={self._yes_no(self.options.with_cookies)}", + f"--enable-ipv6={self._yes_no(self.options.with_ipv6)}", + f"--enable-manual={self._yes_no(self.options.with_docs)}", + f"--enable-verbose={self._yes_no(self.options.with_verbose_debug)}", + f"--enable-symbol-hiding={self._yes_no(self.options.with_symbol_hiding)}", + f"--enable-unix-sockets={self._yes_no(self.options.get_safe('with_unix_sockets'))}", + f"--with-zstd={self._yes_no(self.options.with_zstd)}", + ]) + + # Since 7.77.0, disabling TLS must be explicitly requested otherwise it fails + if not self.options.with_ssl: + tc.configure_args.append("--without-ssl") + + if self.options.with_ssl == "openssl": + path = unix_path(self, self.dependencies["openssl"].package_folder) + tc.configure_args.append(f"--with-openssl={path}") + else: + tc.configure_args.append("--without-openssl") + + if self.options.with_ssl == "wolfssl": + path = unix_path(self, self.dependencies["wolfssl"].package_folder) + tc.configure_args.append(f"--with-wolfssl={path}") + else: + tc.configure_args.append("--without-wolfssl") + + if self.options.with_ssl == "mbedtls": + path = unix_path(self, self.dependencies["mbedtls"].package_folder) + tc.configure_args.append(f"--with-mbedtls={path}") + else: + tc.configure_args.append("--without-mbedtls") + + if self.options.with_libssh2: + path = unix_path(self, self.dependencies["libssh2"].package_folder) + tc.configure_args.append(f"--with-libssh2={path}") + else: + tc.configure_args.append("--without-libssh2") + + if self.options.with_nghttp2: + path = unix_path(self, self.dependencies["libnghttp2"].package_folder) + tc.configure_args.append(f"--with-nghttp2={path}") + else: + tc.configure_args.append("--without-nghttp2") + + if self.options.with_zlib: + path = unix_path(self, self.dependencies["zlib"].package_folder) + tc.configure_args.append(f"--with-zlib={path}") + else: + tc.configure_args.append("--without-zlib") + + if not self.options.with_proxy: + tc.configure_args.append("--disable-proxy") + + if not self.options.with_rtsp: + tc.configure_args.append("--disable-rtsp") + + if not self.options.with_crypto_auth: + tc.configure_args.append("--disable-crypto-auth") # also disables NTLM in versions of curl prior to 7.78.0 + + # ntlm will default to enabled if any SSL options are enabled + if not self.options.with_ntlm: + tc.configure_args.append("--disable-ntlm") + + if not self.options.with_ntlm_wb: + tc.configure_args.append("--disable-ntlm-wb") + + if not self.options.with_ca_bundle: + tc.configure_args.append("--without-ca-bundle") + elif self.options.with_ca_bundle != "auto": + tc.configure_args.append(f"--with-ca-bundle={str(self.options.with_ca_bundle)}") + + if not self.options.with_ca_path: + tc.configure_args.append("--without-ca-path") + elif self.options.with_ca_path != "auto": + tc.configure_args.append(f"--with-ca-path={str(self.options.with_ca_path)}") + + tc.configure_args.append(f"--with-ca-fallback={self._yes_no(self.options.with_ca_fallback)}") + + if "with_misc_docs" in self.options: + if self.options.with_misc_docs: + tc.configure_args.append("--enable-docs") + else: + tc.configure_args.append("--disable-docs") + + # Cross building flags + if cross_building(self): + if self.settings.os == "Linux" and "arm" in self.settings.arch: + tc.configure_args.append(f"--host={self._get_linux_arm_host()}") + elif self.settings.os == "iOS": + tc.configure_args.append("--enable-threaded-resolver") + tc.configure_args.append("--disable-verbose") + elif self.settings.os == "Android": + pass # this just works, conan is great! + + env = tc.environment() + + # tweaks for mingw + if self._is_mingw: + rcflags = "-O COFF" + if self.settings.arch == "x86": + rcflags += " --target=pe-i386" + elif self.settings.arch == "x86_64": + rcflags += " --target=pe-x86-64" + tc.extra_defines.append("_AMD64_") + env.define("RCFLAGS", rcflags) + + if self.settings.os != "Windows": + tc.fpic = self.options.get_safe("fPIC", True) + + if cross_building(self) and is_apple_os(self): + tc.extra_defines.extend(['HAVE_SOCKET', 'HAVE_FCNTL_O_NONBLOCK']) + + tc.generate(env) + tc = PkgConfigDeps(self) + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + + def _get_linux_arm_host(self): + arch = None + if self.settings.os == "Linux": + arch = "arm-linux-gnu" + # aarch64 could be added by user + if "aarch64" in self.settings.arch: + arch = "aarch64-linux-gnu" + elif "arm" in self.settings.arch and "hf" in self.settings.arch: + arch = "arm-linux-gnueabihf" + elif "arm" in self.settings.arch and self._arm_version(str(self.settings.arch)) > 4: + arch = "arm-linux-gnueabi" + return arch + + # TODO, this should be a inner fuction of _get_linux_arm_host since it is only used from there + # it should not polute the class namespace, since there are iOS and Android arm aritectures also + def _arm_version(self, arch): + version = None + match = re.match(r"arm\w*(\d)", arch) + if match: + version = int(match.group(1)) + return version + + def _generate_with_cmake(self): + if self._is_win_x_android: + tc = CMakeToolchain(self, generator="Ninja") + else: + tc = CMakeToolchain(self) + tc.variables["ENABLE_UNICODE"] = True + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_CURL_EXE"] = False + tc.variables["CURL_DISABLE_LDAP"] = not self.options.with_ldap + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["CURL_STATICLIB"] = not self.options.shared + tc.variables["CMAKE_DEBUG_POSTFIX"] = "" + tc.variables["CURL_USE_SCHANNEL"] = self.options.with_ssl == "schannel" + tc.variables["CURL_USE_OPENSSL"] = self.options.with_ssl == "openssl" + tc.variables["CURL_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" + tc.variables["CURL_USE_MBEDTLS"] = self.options.with_ssl == "mbedtls" + tc.variables["USE_NGHTTP2"] = self.options.with_nghttp2 + tc.variables["CURL_ZLIB"] = self.options.with_zlib + tc.variables["CURL_BROTLI"] = self.options.with_brotli + tc.variables["CURL_ZSTD"] = self.options.with_zstd + tc.variables["CURL_USE_LIBPSL"] = self.options.with_libpsl + tc.variables["CURL_USE_LIBSSH2"] = self.options.with_libssh2 + tc.variables["ENABLE_ARES"] = self.options.with_c_ares + if not self.options.with_c_ares: + tc.variables["ENABLE_THREADED_RESOLVER"] = self.options.with_threaded_resolver + tc.variables["CURL_DISABLE_PROXY"] = not self.options.with_proxy + tc.variables["USE_LIBRTMP"] = self.options.with_librtmp + tc.variables["USE_LIBIDN2"] = self.options.with_libidn + tc.variables["CURL_DISABLE_RTSP"] = not self.options.with_rtsp + tc.variables["CURL_DISABLE_CRYPTO_AUTH"] = not self.options.with_crypto_auth + tc.variables["CURL_DISABLE_VERBOSE_STRINGS"] = not self.options.with_verbose_strings + + # Also disables NTLM_WB if set to false + if not self.options.with_ntlm: + tc.variables["CURL_DISABLE_NTLM"] = True + tc.variables["NTLM_WB_ENABLED"] = self.options.with_ntlm_wb + + if self.options.with_ca_bundle: + tc.cache_variables["CURL_CA_BUNDLE"] = str(self.options.with_ca_bundle) + else: + tc.cache_variables["CURL_CA_BUNDLE"] = "none" + + if self.options.with_ca_path: + tc.cache_variables["CURL_CA_PATH"] = str(self.options.with_ca_path) + else: + tc.cache_variables["CURL_CA_PATH"] = "none" + + tc.cache_variables["CURL_CA_FALLBACK"] = self.options.with_ca_fallback + + # TODO: remove this when https://github.com/conan-io/conan/issues/12180 will be fixed. + if Version(self.version) >= "8.3.0": + tc.variables["HAVE_SSL_SET0_WBIO"] = False + if Version(self.version) >= "8.4.0": + tc.variables["HAVE_OPENSSL_SRP"] = True + tc.variables["HAVE_SSL_CTX_SET_QUIC_METHOD"] = True + + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "cacert.pem", src=self.source_folder, dst=os.path.join(self.package_folder, "res")) + if self._is_using_cmake_build: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + if self._is_mingw and self.options.shared: + # Handle only mingw libs + copy(self, pattern="*.dll", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, pattern="*.dll.a", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + fix_apple_shared_install_name(self) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CURL") + self.cpp_info.set_property("cmake_target_name", "CURL::libcurl") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("pkg_config_name", "libcurl") + + self.cpp_info.components["curl"].resdirs = ["res"] + if is_msvc(self): + self.cpp_info.components["curl"].libs = ["libcurl_imp"] if self.options.shared else ["libcurl"] + else: + self.cpp_info.components["curl"].libs = ["curl"] + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.with_libidn: + self.cpp_info.components["curl"].libs.append("idn") + if self.options.with_librtmp: + self.cpp_info.components["curl"].libs.append("rtmp") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["curl"].system_libs = ["rt", "pthread"] + elif self.settings.os == "Windows": + # used on Windows for VS build, native and cross mingw build + self.cpp_info.components["curl"].system_libs = ["ws2_32"] + if self.options.with_ldap: + self.cpp_info.components["curl"].system_libs.append("wldap32") + if self.options.with_ssl == "schannel": + self.cpp_info.components["curl"].system_libs.append("crypt32") + elif is_apple_os(self): + self.cpp_info.components["curl"].frameworks.append("CoreFoundation") + self.cpp_info.components["curl"].frameworks.append("CoreServices") + self.cpp_info.components["curl"].frameworks.append("SystemConfiguration") + if self.options.with_ldap: + self.cpp_info.components["curl"].system_libs.append("ldap") + if self.options.with_ssl == "darwinssl": + self.cpp_info.components["curl"].frameworks.append("Security") + + if self._is_mingw: + # provide pthread for dependent packages + self.cpp_info.components["curl"].cflags.append("-pthread") + self.cpp_info.components["curl"].exelinkflags.append("-pthread") + self.cpp_info.components["curl"].sharedlinkflags.append("-pthread") + + if not self.options.shared: + self.cpp_info.components["curl"].defines.append("CURL_STATICLIB=1") + + if self.options.with_ssl == "openssl": + self.cpp_info.components["curl"].requires.append("openssl::openssl") + if self.options.with_ssl == "wolfssl": + self.cpp_info.components["curl"].requires.append("wolfssl::wolfssl") + if self.options.with_ssl == "mbedtls": + self.cpp_info.components["curl"].requires.append("mbedtls::mbedtls") + if self.options.with_nghttp2: + self.cpp_info.components["curl"].requires.append("libnghttp2::libnghttp2") + if self.options.with_libssh2: + self.cpp_info.components["curl"].requires.append("libssh2::libssh2") + if self.options.with_zlib: + self.cpp_info.components["curl"].requires.append("zlib::zlib") + if self.options.with_brotli: + self.cpp_info.components["curl"].requires.append("brotli::brotli") + if self.options.with_zstd: + self.cpp_info.components["curl"].requires.append("zstd::zstd") + if self.options.with_c_ares: + self.cpp_info.components["curl"].requires.append("c-ares::c-ares") + if self.options.get_safe("with_libpsl"): + self.cpp_info.components["curl"].requires.append("libpsl::libpsl") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "CURL" + self.cpp_info.names["cmake_find_package_multi"] = "CURL" + self.cpp_info.components["curl"].names["cmake_find_package"] = "libcurl" + self.cpp_info.components["curl"].names["cmake_find_package_multi"] = "libcurl" + self.cpp_info.components["curl"].set_property("cmake_target_name", "CURL::libcurl") + self.cpp_info.components["curl"].set_property("pkg_config_name", "libcurl") diff --git a/libcurl/all/lib_Makefile_add.am b/libcurl/all/lib_Makefile_add.am new file mode 100644 index 0000000..ab1b697 --- /dev/null +++ b/libcurl/all/lib_Makefile_add.am @@ -0,0 +1,24 @@ + +libcurl_dll_LIBRARY = libcurl.dll +libcurl_dll_a_LIBRARY = libcurl.dll.a + +LIBCURL_OBJECTS := $(patsubst %.c,%.o,$(strip $(CSOURCES))) + +RESOURCE = libcurl.res + +RC = windres + +all-local: $(libcurl_dll_LIBRARY) + + +$(libcurl_dll_LIBRARY): $(LIBCURL_OBJECTS) $(RESOURCE) $(libcurl_dll_DEPENDENCIES) + @$(call DEL, $@) + $(CC) $(LDFLAGS) -shared -o $@ \ + -Wl,--output-def,$(@:.dll=.def),--out-implib,$(libcurl_dll_a_LIBRARY) \ + $(LIBCURL_OBJECTS) $(RESOURCE) $(LIBCURL_LIBS) + +%.o: %.c $(PROOT)/include/curl/curlbuild.h + $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@ + +%.res: %.rc + $(RC) $(RCFLAGS) -i $< -o $@ diff --git a/libcurl/all/test_package/CMakeLists.txt b/libcurl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..cbc4637 --- /dev/null +++ b/libcurl/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(CURL REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE CURL::libcurl) diff --git a/libcurl/all/test_package/conanfile.py b/libcurl/all/test_package/conanfile.py new file mode 100644 index 0000000..b0f5c0a --- /dev/null +++ b/libcurl/all/test_package/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os +import subprocess +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _test_executable(self): + return os.path.join(self.cpp.build.bindirs[0], "test_package") + + def test(self): + if can_run(self): + self.run(self._test_executable, env="conanrun") + else: + # We will dump information for the generated executable + if self.settings.os in ["Android", "iOS"]: + # FIXME: Check output for these hosts + return + + output = subprocess.check_output(["file", self._test_executable]).decode() + + if self.settings.os == "Macos" and self.settings.arch == "armv8": + assert "Mach-O 64-bit executable arm64" in output, f"Not found in output: {output}" + + elif self.settings.os == "Linux": + if self.settings.arch == "armv8_32": + assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" + elif "armv8" in self.settings.arch: + assert re.search(r"Machine:\s+AArch64", output), f"Not found in output: {output}" + elif "arm" in self.settings.arch: + assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" + + elif self.settings.os == "Windows": # FIXME: It satisfies not only MinGW + assert re.search(r"PE32.*executable.*Windows", output), f"Not found in output: {output}" diff --git a/libcurl/all/test_package/test_package.c b/libcurl/all/test_package/test_package.c new file mode 100644 index 0000000..309b36d --- /dev/null +++ b/libcurl/all/test_package/test_package.c @@ -0,0 +1,35 @@ +#include +#include + +int main(void) +{ + CURL *curl; + int retval = 0; + const char *const *proto; + curl_version_info_data* id = curl_version_info(CURLVERSION_NOW); + if (!id) + return 1; + + printf("protocols: "); + for(proto = id->protocols; *proto; proto++) { + printf("%s ", *proto); + } + printf("\nversion: %s\nssl version: %s\nfeatures: %d\n", id->version, id->ssl_version, id->features); + + curl = curl_easy_init(); + if(curl) { + char errbuf[CURL_ERROR_SIZE]; + + /* provide a buffer to store errors in */ + curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf); + + /* always cleanup */ + curl_easy_cleanup(curl); + printf("Succeed\n"); + } else { + printf("Failed to init curl\n"); + retval = 3; + } + + return retval; +} diff --git a/libcurl/all/test_v1_package/CMakeLists.txt b/libcurl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..448a8a5 --- /dev/null +++ b/libcurl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) + diff --git a/libcurl/all/test_v1_package/conanfile.py b/libcurl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..7ebb558 --- /dev/null +++ b/libcurl/all/test_v1_package/conanfile.py @@ -0,0 +1,43 @@ +from conans import ConanFile, CMake, tools +import os +import subprocess +import re + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _test_executable(self): + return os.path.join("bin", "test_package") + + def test(self): + if not tools.cross_building(self): + self.run(self._test_executable, run_environment=True) + else: + # We will dump information for the generated executable + if self.settings.os in ["Android", "iOS"]: + # FIXME: Check output for these hosts + return + + output = subprocess.check_output(["file", self._test_executable]).decode() + + if self.settings.os == "Macos" and self.settings.arch == "armv8": + assert "Mach-O 64-bit executable arm64" in output, f"Not found in output: {output}" + + elif self.settings.os == "Linux": + if self.settings.arch == "armv8_32": + assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" + elif "armv8" in self.settings.arch: + assert re.search(r"Machine:\s+AArch64", output), f"Not found in output: {output}" + elif "arm" in self.settings.arch: + assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" + + elif self.settings.os == "Windows": # FIXME: It satisfies not only MinGW + assert re.search(r"PE32.*executable.*Windows", output), f"Not found in output: {output}" diff --git a/libcurl/config.yml b/libcurl/config.yml new file mode 100644 index 0000000..74fce7b --- /dev/null +++ b/libcurl/config.yml @@ -0,0 +1,17 @@ +versions: + "8.8.0": + folder: all + "8.6.0": + folder: all + "8.5.0": + folder: all + "8.4.0": + folder: all + "8.2.1": + folder: all + "8.1.2": + folder: all + "8.0.1": + folder: all + "7.88.1": + folder: all diff --git a/libdwarf/all/conandata.yml b/libdwarf/all/conandata.yml new file mode 100644 index 0000000..1a5e4c9 --- /dev/null +++ b/libdwarf/all/conandata.yml @@ -0,0 +1,43 @@ +sources: + "0.9.1": + url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.9.1.tar.gz" + sha256: "6da3f46a9f92b4e284c97c733851879d9b91b16642bede90c7614860a946824e" + "0.9.0": + url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.9.0.tar.gz" + sha256: "6d4c0ee8a869e68dfeb15c99b869cafca7a5f715ecfc699cbf4fd30729b33226" + "0.8.0": + url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.8.0.tar.gz" + sha256: "8ef0dbfb0816b02aac97b87426689ebaa4efb8ec2ca2c759ea34c5e4678dff3f" + "0.7.0": + url: "https://www.prevanders.net/libdwarf-0.7.0.tar.xz" + sha256: "23b71829de875fa5842e49f232c8ee1a5043805749738bc61424d9abc1189f38" + "0.5.0": + url: "https://www.prevanders.net/libdwarf-0.5.0.tar.xz" + sha256: "11fa822c60317fa00e1a01a2ac9e8388f6693e8662ab72d352c5f50c7e0112a9" +patches: + "0.9.1": + - patch_file: "patches/0.9.1-0001-fixes.patch" + patch_description: "fix DW_API definition and cmake" + patch_type: "portability" + "0.9.0": + - patch_file: "patches/0.9.0-0001-fixes.patch" + patch_description: "fix DW_API definition and cmake" + patch_type: "portability" + "0.8.0": + - patch_file: "patches/0.8.0-0001-fixes.patch" + patch_description: "fix DW_API definition and cmake" + patch_type: "portability" + "0.7.0": + - patch_file: "patches/0.7.0-0001-fix-cmake.patch" + patch_description: "use cci package, remove lib64/bin64 install folders" + patch_type: "conan" + - patch_file: "patches/0.5.0-0001-fix-DW_API.patch" + patch_description: "fix DW_API definition" + patch_type: "portability" + "0.5.0": + - patch_file: "patches/0.5.0-0001-fix-cmake.patch" + patch_description: "use cci package, remove lib64/bin64 install folders" + patch_type: "conan" + - patch_file: "patches/0.5.0-0001-fix-DW_API.patch" + patch_description: "fix DW_API definition" + patch_type: "portability" diff --git a/libdwarf/all/conanfile.py b/libdwarf/all/conanfile.py new file mode 100644 index 0000000..8eab28c --- /dev/null +++ b/libdwarf/all/conanfile.py @@ -0,0 +1,109 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, rename +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class LibdwarfConan(ConanFile): + name = "libdwarf" + description = "A library and a set of command-line tools for reading and writing DWARF2" + license = ("LGPL-2.1-only", "BSD-2-Clause-Views", "GPL-2.0-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.prevanders.net/dwarf.html" + topics = ("debug", "dwarf", "dwarf2", "elf") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_dwarfgen": [True, False], + "with_dwarfdump": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_dwarfgen": False, + "with_dwarfdump": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + if not self.options.with_dwarfgen: + self.license = (l for l in self.license if l != "BSD-2-Clause-Views") + if not self.options.with_dwarfdump: + self.license = (l for l in self.license if l != "GPL-2.0-only") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_dwarfgen: + self.requires("libelf/0.8.13") + self.requires("zlib/[>=1.2.11 <2]") + if Version(self.version) >= Version("0.9.0"): + self.requires("zstd/1.5.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["BUILD_NON_SHARED"] = not self.options.shared + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_DWARFGEN"] = self.options.with_dwarfgen + tc.variables["BUILD_DWARFDUMP"] = self.options.with_dwarfdump + tc.variables["BUILD_DWARFEXAMPLE"] = False + if cross_building(self): + tc.variables["HAVE_UNUSED_ATTRIBUTE_EXITCODE"] = "0" + tc.variables["HAVE_UNUSED_ATTRIBUTE_EXITCODE__TRYRUN_OUTPUT"] = "" + tc.generate() + + dpes = CMakeDeps(self) + dpes.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "src", "lib", "libdwarf")) + rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING-libdwarf")) + if self.options.with_dwarfgen: + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "src", "bin", "dwarfgen")) + rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING-dwarfgen")) + if self.options.with_dwarfdump: + copy(self, pattern="GPL.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "src", "bin", "dwarfdump")) + rename(self, os.path.join(self.package_folder, "licenses", "GPL.txt"), os.path.join(self.package_folder, "licenses", "COPYING-dwarfdump")) + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["dwarf"] + + if self.options.with_dwarfgen: + bindir = os.path.join(self.package_folder, "bin") + self.output.info(f'Appending PATH environment variable: {bindir}') + self.env_info.PATH.append(bindir) + self.cpp_info.libs.append("dwarfp") diff --git a/libdwarf/all/patches/0.5.0-0001-fix-DW_API.patch b/libdwarf/all/patches/0.5.0-0001-fix-DW_API.patch new file mode 100644 index 0000000..09c3ab0 --- /dev/null +++ b/libdwarf/all/patches/0.5.0-0001-fix-DW_API.patch @@ -0,0 +1,13 @@ +diff --git a/src/lib/libdwarf/libdwarf.h b/src/lib/libdwarf/libdwarf.h +index 9a59eb1..fa5e68e 100644 +--- a/src/lib/libdwarf/libdwarf.h ++++ b/src/lib/libdwarf/libdwarf.h +@@ -50,7 +50,7 @@ + #undef DW_API + #endif /* DW_API */ + +-#if defined(_WIN32) || defined(__CYGWIN__) ++#if defined(LIBDWARF_SHARED) && (defined(_WIN32) || defined(__CYGWIN__)) + # ifdef LIBDWARF_BUILD + # define DW_API __declspec(dllexport) + # else /* !LIBDWARF_BUILD */ diff --git a/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch b/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch new file mode 100644 index 0000000..cd8664d --- /dev/null +++ b/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch @@ -0,0 +1,115 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4f58f43..69e0238 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -129,6 +129,7 @@ check_include_file( "libelf/libelf.h" HAVE_LIBELF_LIBELF_H) + + ### cmake provides no way to guarantee uint32_t present. + ### configure does guarantee that. ++find_package(libelf) + if(HAVE_STDINT_H) + check_c_source_compiles(" + #include +@@ -192,7 +193,8 @@ elseif(HAVE_LIBELF_LIBELF_H) + endif() + + if (HAVE_LIBELF_H OR HAVE_LIBELF_LIBELF_H) +- set (CMAKE_REQUIRED_LIBRARIES elf) ++ set (CMAKE_REQUIRED_LIBRARIES libelf::libelf) ++ set (CMAKE_REQUIRED_DEFINITIONS -D__LIBELF64=1) + message(STATUS "libelf header ${PLAIN_JUST_LIBELF} checking for elf64_getehdr") + check_symbol_exists( elf64_getehdr ${PLAIN_JUST_LIBELF} HAVE_ELF64_GETEHDR) + message(STATUS "libelf header ${PLAIN_JUST_LIBELF} checking for elf64_getshdr") +@@ -216,6 +218,9 @@ if (DWARF_WITH_LIBELF) + message(STATUS "checking using elf header ... ${HAVE_LOCATION_OF_LIBELFHEADER}") + message(STATUS "checking using libelf header ... ${JUST_LIBELF}") + ++set (CMAKE_REQUIRED_LIBRARIES libelf::libelf) ++set (CMAKE_REQUIRED_DEFINITIONS -D__LIBELF64=1) ++ + check_c_source_compiles(" + #include ${HAVE_LOCATION_OF_LIBELFHEADER} + int main() +@@ -361,7 +366,6 @@ message(STATUS "Building api tests ... ${DOTESTS}") + ### end what was configure.cmake + + # This references cmake/FindLibElf.cmake. See cmake documentation. +-find_package(LibElf REQUIRED) + list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBELF_INCLUDE_DIRS}) + + configure_file(cmake/config.h.cmake config.h) +@@ -384,7 +388,6 @@ if(BUILD_SHARED) + endif() + + add_subdirectory(src/lib/libdwarf) +-add_subdirectory(src/bin/dwarfdump) + + if ( BUILD_DWARFEXAMPLE ) + add_subdirectory(src/bin/dwarfexample) +diff --git a/src/bin/dwarfdump/CMakeLists.txt b/src/bin/dwarfdump/CMakeLists.txt +index f6f5376..22c5977 100644 +--- a/src/bin/dwarfdump/CMakeLists.txt ++++ b/src/bin/dwarfdump/CMakeLists.txt +@@ -65,7 +65,7 @@ target_compile_options(dwarfdump PRIVATE ${DW_FWALL}) + + target_link_libraries(dwarfdump PRIVATE ${dwarf-target} ${DW_FZLIB} ${DW_FZSTD} ) + +-if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) ++if(0) + set(SUFFIX 64) + endif() + set(LIBDIR lib${SUFFIX}) +diff --git a/src/bin/dwarfgen/CMakeLists.txt b/src/bin/dwarfgen/CMakeLists.txt +index 5c2c192..fc3428e 100644 +--- a/src/bin/dwarfgen/CMakeLists.txt ++++ b/src/bin/dwarfgen/CMakeLists.txt +@@ -28,7 +28,7 @@ target_include_directories(dwarfgen PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/../../lib/libdwarfp) + + target_link_libraries(dwarfgen PRIVATE ${dwarfp-target} +- ${dwarf-target} ${DW_FZLIB}) ++ ${dwarf-target} ${DW_FZLIB} libelf::libelf) + + set(SUFFIX $<$:64>) + set(LIBDIR lib${SUFFIX}) +diff --git a/src/lib/libdwarf/CMakeLists.txt b/src/lib/libdwarf/CMakeLists.txt +index 0b7d578..62b67da 100644 +--- a/src/lib/libdwarf/CMakeLists.txt ++++ b/src/lib/libdwarf/CMakeLists.txt +@@ -67,7 +67,7 @@ set_source_group(CONFIGURATION_FILES "Configuration Files" + + list(LENGTH DWARF_TARGETS targetCount) + math(EXPR targetCount "${targetCount} - 1") +-list(APPEND DWARF_LIBS ${LIBELF_LIBRARIES}) ++list(APPEND DWARF_LIBS ${libelf_LIBRARIES}) + if (DW_FZLIB) + list(APPEND DWARF_LIBS z) + endif() +@@ -85,13 +85,15 @@ foreach(i RANGE ${targetCount}) + ${LIBELF_INCLUDE_DIRS}) + target_compile_options(${target} PRIVATE -DLIBDWARF_BUILD + ${DW_FWALL}) +- msvc_posix(${target}) ++ if(BUILD_SHARED) ++ target_compile_definitions(${target} PRIVATE LIBDWARF_SHARED) ++ endif() ++ msvc_posix(${target}) + + target_link_libraries(${target} PUBLIC ${LIBELF_LIBRARIES} ${DW_FZLIB} ${DW_FZSTD} ) + + set_target_properties(${target} PROPERTIES OUTPUT_NAME dwarf) + +- set(SUFFIX $<$:64>) + set(LIBDIR lib${SUFFIX}) + set(BINDIR bin${SUFFIX}) + +@@ -119,6 +121,9 @@ install( + ) + install(DIRECTORY libdwarf DESTINATION include/ + FILES_MATCHING PATTERN "*.h") ++install( ++ FILES ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.h ++ DESTINATION include/libdwarf) + install( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/libdwarf.h + DESTINATION include/libdwarf) diff --git a/libdwarf/all/patches/0.7.0-0001-fix-cmake.patch b/libdwarf/all/patches/0.7.0-0001-fix-cmake.patch new file mode 100644 index 0000000..bb0a859 --- /dev/null +++ b/libdwarf/all/patches/0.7.0-0001-fix-cmake.patch @@ -0,0 +1,128 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dd09dde8..8162a985 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -129,6 +129,9 @@ check_include_file( "libelf/libelf.h" HAVE_LIBELF_LIBELF_H) + + ### cmake provides no way to guarantee uint32_t present. + ### configure does guarantee that. ++if (BUILD_DWARFGEN) ++ find_package(libelf REQUIRED) ++endif() + if(HAVE_STDINT_H) + check_c_source_compiles(" + #include +@@ -192,7 +195,8 @@ elseif(HAVE_LIBELF_LIBELF_H) + endif() + + if (HAVE_LIBELF_H OR HAVE_LIBELF_LIBELF_H) +- set (CMAKE_REQUIRED_LIBRARIES elf) ++ set (CMAKE_REQUIRED_LIBRARIES libelf::libelf) ++ set (CMAKE_REQUIRED_DEFINITIONS -D__LIBELF64=1) + message(STATUS "libelf header ${PLAIN_JUST_LIBELF} checking for elf64_getehdr") + check_symbol_exists( elf64_getehdr ${PLAIN_JUST_LIBELF} HAVE_ELF64_GETEHDR) + message(STATUS "libelf header ${PLAIN_JUST_LIBELF} checking for elf64_getshdr") +@@ -216,6 +220,9 @@ if (DWARF_WITH_LIBELF) + message(STATUS "checking using elf header ... ${HAVE_LOCATION_OF_LIBELFHEADER}") + message(STATUS "checking using libelf header ... ${JUST_LIBELF}") + ++set (CMAKE_REQUIRED_LIBRARIES libelf::libelf) ++set (CMAKE_REQUIRED_DEFINITIONS -D__LIBELF64=1) ++ + check_c_source_compiles(" + #include ${HAVE_LOCATION_OF_LIBELFHEADER} + int main() +@@ -361,7 +368,6 @@ message(STATUS "Building api tests ... ${DOTESTS}") + ### end what was configure.cmake + + # This references cmake/FindLibElf.cmake. See cmake documentation. +-find_package(LibElf REQUIRED) + list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBELF_INCLUDE_DIRS}) + + configure_file(cmake/config.h.cmake config.h) +@@ -384,7 +390,6 @@ if(BUILD_SHARED) + endif() + + add_subdirectory(src/lib/libdwarf) +-add_subdirectory(src/bin/dwarfdump) + + if ( BUILD_DWARFEXAMPLE ) + add_subdirectory(src/bin/dwarfexample) +diff --git a/src/bin/dwarfdump/CMakeLists.txt b/src/bin/dwarfdump/CMakeLists.txt +index 507f761d..8ddb0d90 100644 +--- a/src/bin/dwarfdump/CMakeLists.txt ++++ b/src/bin/dwarfdump/CMakeLists.txt +@@ -64,7 +64,7 @@ target_compile_options(dwarfdump PRIVATE ${DW_FWALL}) + + target_link_libraries(dwarfdump PRIVATE ${dwarf-target} ${DW_FZLIB} ${DW_FZSTD} ) + +-if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) ++if(0) + set(SUFFIX 64) + endif() + set(LIBDIR lib${SUFFIX}) +diff --git a/src/bin/dwarfgen/CMakeLists.txt b/src/bin/dwarfgen/CMakeLists.txt +index a7f5d78e..60293f6b 100644 +--- a/src/bin/dwarfgen/CMakeLists.txt ++++ b/src/bin/dwarfgen/CMakeLists.txt +@@ -28,7 +28,7 @@ target_include_directories(dwarfgen PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/../../lib/libdwarfp) + + target_link_libraries(dwarfgen PRIVATE ${dwarfp-target} +- ${dwarf-target} ${DW_FZLIB}) ++ ${dwarf-target} ${DW_FZLIB} libelf::libelf) + + set(SUFFIX $<$:64>) + set(LIBDIR lib${SUFFIX}) +diff --git a/src/lib/libdwarf/CMakeLists.txt b/src/lib/libdwarf/CMakeLists.txt +index 913274b8..8515e2b0 100644 +--- a/src/lib/libdwarf/CMakeLists.txt ++++ b/src/lib/libdwarf/CMakeLists.txt +@@ -70,7 +70,7 @@ set_source_group(CONFIGURATION_FILES "Configuration Files" + + list(LENGTH DWARF_TARGETS targetCount) + math(EXPR targetCount "${targetCount} - 1") +-list(APPEND DWARF_LIBS ${LIBELF_LIBRARIES}) ++list(APPEND DWARF_LIBS ${libelf_LIBRARIES}) + if (DW_FZLIB) + list(APPEND DWARF_LIBS z) + endif() +@@ -88,13 +88,15 @@ foreach(i RANGE ${targetCount}) + ${LIBELF_INCLUDE_DIRS}) + target_compile_options(${target} PRIVATE -DLIBDWARF_BUILD + ${DW_FWALL}) +- msvc_posix(${target}) ++ if(BUILD_SHARED) ++ target_compile_definitions(${target} PRIVATE LIBDWARF_SHARED) ++ endif() ++ msvc_posix(${target}) + + target_link_libraries(${target} PUBLIC ${LIBELF_LIBRARIES} ${DW_FZLIB} ${DW_FZSTD} ) + + set_target_properties(${target} PROPERTIES OUTPUT_NAME dwarf) + +- set(SUFFIX $<$:64>) + set(LIBDIR lib${SUFFIX}) + set(BINDIR bin${SUFFIX}) + +@@ -105,7 +107,6 @@ foreach(i RANGE ${targetCount}) + endforeach() + + # add_library(libdwarf) +-configure_file(libdwarf.pc.cmake libdwarf.pc @ONLY ) + + # The install has to be here, not in + # another CMakeLists.txt to make install work properly +@@ -126,9 +127,9 @@ install( + ) + install(DIRECTORY libdwarf DESTINATION include/ + FILES_MATCHING PATTERN "*.h") ++install( ++ FILES ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.h ++ DESTINATION include/libdwarf) + install( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/libdwarf.h + DESTINATION include/libdwarf) +-install( FILES ${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc +- DESTINATION lib/pkgconfig +-) diff --git a/libdwarf/all/patches/0.8.0-0001-fixes.patch b/libdwarf/all/patches/0.8.0-0001-fixes.patch new file mode 100644 index 0000000..0393ff6 --- /dev/null +++ b/libdwarf/all/patches/0.8.0-0001-fixes.patch @@ -0,0 +1,57 @@ +diff --git src/bin/dwarfdump/CMakeLists.txt src/bin/dwarfdump/CMakeLists.txt +index 1b8aa3ae..72819160 100644 +--- src/bin/dwarfdump/CMakeLists.txt ++++ src/bin/dwarfdump/CMakeLists.txt +@@ -65,7 +65,7 @@ target_compile_options(dwarfdump PRIVATE ${DW_FWALL}) + + target_link_libraries(dwarfdump PRIVATE ${dwarf-target} ${DW_FZLIB} ${DW_FZSTD} ) + +-if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) ++if(0) + set(SUFFIX 64) + endif() + set(LIBDIR lib${SUFFIX}) +diff --git src/lib/libdwarf/CMakeLists.txt src/lib/libdwarf/CMakeLists.txt +index 09908bba..a33f92c8 100644 +--- src/lib/libdwarf/CMakeLists.txt ++++ src/lib/libdwarf/CMakeLists.txt +@@ -109,7 +109,6 @@ foreach(i RANGE ${targetCount}) + + set_target_properties(${target} PROPERTIES OUTPUT_NAME dwarf) + +- set(SUFFIX $<$:64>) + set(LIBDIR lib${SUFFIX}) + set(BINDIR bin${SUFFIX}) + +@@ -119,7 +118,7 @@ foreach(i RANGE ${targetCount}) + ARCHIVE DESTINATION ${LIBDIR}) + endforeach() + +-configure_file(libdwarf.pc.cmake libdwarf.pc @ONLY ) ++#configure_file(libdwarf.pc.cmake libdwarf.pc @ONLY ) + + # The install has to be here, not in + # another CMakeLists.txt to make install work properly +@@ -144,6 +143,6 @@ install( + install( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.h + DESTINATION include/libdwarf) +-install( FILES ${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc +- DESTINATION lib/pkgconfig +-) ++#install( FILES ${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc ++# DESTINATION lib/pkgconfig ++#) +diff --git src/lib/libdwarf/libdwarf.h src/lib/libdwarf/libdwarf.h +index 9a0783e3..0bce4d09 100644 +--- src/lib/libdwarf/libdwarf.h ++++ src/lib/libdwarf/libdwarf.h +@@ -51,7 +51,7 @@ + #endif /* DW_API */ + + #ifndef LIBDWARF_STATIC +-# if defined(_WIN32) || defined(__CYGWIN__) ++# if defined(LIBDWARF_SHARED) && (defined(_WIN32) || defined(__CYGWIN__)) + # ifdef LIBDWARF_BUILD + # define DW_API __declspec(dllexport) + # else /* !LIBDWARF_BUILD */ diff --git a/libdwarf/all/patches/0.9.0-0001-fixes.patch b/libdwarf/all/patches/0.9.0-0001-fixes.patch new file mode 100644 index 0000000..5c91298 --- /dev/null +++ b/libdwarf/all/patches/0.9.0-0001-fixes.patch @@ -0,0 +1,105 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f444af27..5c9390d1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -181,14 +181,20 @@ endif() + + # Zlib and ZSTD need to be found otherwise disable it + find_package(ZLIB) +-find_package(ZSTD) +-if (ZLIB_FOUND AND ZSTD_FOUND ) ++find_package(zstd) ++if (ZLIB_FOUND AND zstd_FOUND ) + set(HAVE_ZLIB TRUE) + set(HAVE_ZLIB_H TRUE) + set(HAVE_ZSTD TRUE) + set(HAVE_ZSTD_H TRUE) + endif() + ++if(TARGET zstd::libzstd_shared) ++ set(ZSTD_LIB zstd::libzstd_shared) ++else() ++ set(ZSTD_LIB zstd::libzstd_static) ++endif() ++ + message(STATUS "CMAKE_SIZEOF_VOID_P ... " ${CMAKE_SIZEOF_VOID_P} ) + + # DW_FWALLXX are gnu C++ options. +diff --git a/src/bin/dwarfdump/CMakeLists.txt b/src/bin/dwarfdump/CMakeLists.txt +index 6d2c328b..bc105813 100644 +--- a/src/bin/dwarfdump/CMakeLists.txt ++++ b/src/bin/dwarfdump/CMakeLists.txt +@@ -68,7 +68,7 @@ target_compile_options(dwarfdump PRIVATE ${DW_FWALL}) + + target_link_libraries(dwarfdump PRIVATE dwarf) + +-if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) ++if(0) + set(SUFFIX 64) + endif() + set(LIBDIR lib${SUFFIX}) +diff --git a/src/lib/libdwarf/CMakeLists.txt b/src/lib/libdwarf/CMakeLists.txt +index 4ad5c4fb..052208a1 100644 +--- a/src/lib/libdwarf/CMakeLists.txt ++++ b/src/lib/libdwarf/CMakeLists.txt +@@ -107,11 +107,10 @@ target_include_directories(dwarf PUBLIC + $ + $ + ) +-if(ZLIB_FOUND AND ZSTD_FOUND) +- target_link_libraries(dwarf PRIVATE ZLIB::ZLIB ZSTD::ZSTD ) ++if(ZLIB_FOUND AND zstd_FOUND) ++ target_link_libraries(dwarf PRIVATE ZLIB::ZLIB ${ZSTD_LIB} ) + endif() + +-set(SUFFIX $<$:64>) + set(LIBDIR lib${SUFFIX}) + set(BINDIR bin${SUFFIX}) + +@@ -120,7 +119,7 @@ install(TARGETS dwarf + LIBRARY DESTINATION ${LIBDIR} + ARCHIVE DESTINATION ${LIBDIR}) + +-configure_file(libdwarf.pc.cmake libdwarf.pc @ONLY ) ++# configure_file(libdwarf.pc.cmake libdwarf.pc @ONLY ) + + # The install has to be here, not in + # another CMakeLists.txt to make install work properly +@@ -145,6 +144,8 @@ install( + install( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.h + DESTINATION include/libdwarf) ++if(0) + install( FILES ${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc + DESTINATION lib/pkgconfig + ) ++endif() +diff --git a/src/lib/libdwarf/libdwarf.h b/src/lib/libdwarf/libdwarf.h +index ed3d1d0b..91f2fd8b 100644 +--- a/src/lib/libdwarf/libdwarf.h ++++ b/src/lib/libdwarf/libdwarf.h +@@ -51,7 +51,7 @@ + #endif /* DW_API */ + + #ifndef LIBDWARF_STATIC +-# if defined(_WIN32) || defined(__CYGWIN__) ++# if defined(LIBDWARF_SHARED) && (defined(_WIN32) || defined(__CYGWIN__)) + # ifdef LIBDWARF_BUILD + # define DW_API __declspec(dllexport) + # else /* !LIBDWARF_BUILD */ +diff --git a/src/lib/libdwarf/libdwarf_private.h b/src/lib/libdwarf/libdwarf_private.h +index b37ae994..7fa89256 100644 +--- a/src/lib/libdwarf/libdwarf_private.h ++++ b/src/lib/libdwarf/libdwarf_private.h +@@ -26,11 +26,7 @@ + #ifdef _MSC_VER /* Macro to select VS compiler */ + #include + typedef SSIZE_T ssize_t; +-#ifdef _WIN64 +-typedef long long off_t; +-#else + typedef long off_t; +-#endif + #endif /* _MSC_VER */ + + #ifndef TRUE diff --git a/libdwarf/all/patches/0.9.1-0001-fixes.patch b/libdwarf/all/patches/0.9.1-0001-fixes.patch new file mode 100644 index 0000000..c7952f7 --- /dev/null +++ b/libdwarf/all/patches/0.9.1-0001-fixes.patch @@ -0,0 +1,86 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 70839abd..972a2b9e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -188,14 +188,20 @@ if (ENABLE_DECOMPRESSION) + find_package(ZLIB) + endif() + if(NOT TARGET ZSTD::ZSTD) +- find_package(ZSTD) ++ find_package(zstd) + endif() +- if (ZLIB_FOUND AND ZSTD_FOUND ) ++ if (ZLIB_FOUND AND zstd_FOUND ) + set(HAVE_ZLIB TRUE) + set(HAVE_ZLIB_H TRUE) + set(HAVE_ZSTD TRUE) + set(HAVE_ZSTD_H TRUE) + endif() ++ find_package(zstd CONFIG REQUIRED) ++ if(TARGET zstd::libzstd_shared) ++ set(ZSTD_LIB zstd::libzstd_shared) ++ else() ++ set(ZSTD_LIB zstd::libzstd_static) ++ endif() + endif () + + message(STATUS "CMAKE_SIZEOF_VOID_P ... " ${CMAKE_SIZEOF_VOID_P} ) +diff --git a/src/lib/libdwarf/CMakeLists.txt b/src/lib/libdwarf/CMakeLists.txt +index 7500c9f4..ce1461fb 100644 +--- a/src/lib/libdwarf/CMakeLists.txt ++++ b/src/lib/libdwarf/CMakeLists.txt +@@ -104,8 +104,8 @@ target_include_directories(dwarf PUBLIC + $ + $ + ) +-if(ZLIB_FOUND AND ZSTD_FOUND) +- target_link_libraries(dwarf PRIVATE ZLIB::ZLIB ZSTD::ZSTD ) ++if(ZLIB_FOUND AND zstd_FOUND) ++ target_link_libraries(dwarf PRIVATE ZLIB::ZLIB ${ZSTD_LIB} ) + endif() + set_target_properties(dwarf PROPERTIES PUBLIC_HEADER "libdwarf.h;dwarf.h") + +@@ -116,7 +116,7 @@ install(TARGETS dwarf + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) + +-configure_file(libdwarf.pc.cmake libdwarf.pc @ONLY) ++# configure_file(libdwarf.pc.cmake libdwarf.pc @ONLY) + + # The install has to be here, not in + # another CMakeLists.txt to make install work properly +@@ -131,4 +131,4 @@ install(EXPORT libdwarfTargets + NAMESPACE libdwarf:: + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libdwarf") + install(FILES cmake/libdwarf-config.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libdwarf") +-install(FILES "${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") ++# install(FILES "${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +diff --git a/src/lib/libdwarf/libdwarf.h b/src/lib/libdwarf/libdwarf.h +index 380d2ef7..8c62ee7e 100644 +--- a/src/lib/libdwarf/libdwarf.h ++++ b/src/lib/libdwarf/libdwarf.h +@@ -51,7 +51,7 @@ + #endif /* DW_API */ + + #ifndef LIBDWARF_STATIC +-# if defined(_WIN32) || defined(__CYGWIN__) ++# if defined(LIBDWARF_SHARED) && (defined(_WIN32) || defined(__CYGWIN__)) + # ifdef LIBDWARF_BUILD + # define DW_API __declspec(dllexport) + # else /* !LIBDWARF_BUILD */ +diff --git a/src/lib/libdwarf/libdwarf_private.h b/src/lib/libdwarf/libdwarf_private.h +index b37ae994..7fa89256 100644 +--- a/src/lib/libdwarf/libdwarf_private.h ++++ b/src/lib/libdwarf/libdwarf_private.h +@@ -26,11 +26,7 @@ + #ifdef _MSC_VER /* Macro to select VS compiler */ + #include + typedef SSIZE_T ssize_t; +-#ifdef _WIN64 +-typedef long long off_t; +-#else + typedef long off_t; +-#endif + #endif /* _MSC_VER */ + + #ifndef TRUE diff --git a/libdwarf/all/test_package/CMakeLists.txt b/libdwarf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..8abbd68 --- /dev/null +++ b/libdwarf/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libdwarf REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libdwarf::libdwarf) + +if(${libdwarf_VERSION} VERSION_LESS "0.9.1") + target_compile_definitions(${PROJECT_NAME} PRIVATE "LIBDWARF_NESTED_INCLUDE") +endif() diff --git a/libdwarf/all/test_package/conanfile.py b/libdwarf/all/test_package/conanfile.py new file mode 100644 index 0000000..a9fbb7f --- /dev/null +++ b/libdwarf/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/libdwarf/all/test_package/test_package.c b/libdwarf/all/test_package/test_package.c new file mode 100644 index 0000000..2878281 --- /dev/null +++ b/libdwarf/all/test_package/test_package.c @@ -0,0 +1,39 @@ +#include +#include +#include +#include + +#ifdef LIBDWARF_NESTED_INCLUDE + #include "libdwarf/dwarf.h" + #include "libdwarf/libdwarf.h" +#else + #include "dwarf.h" + #include "libdwarf.h" +#endif + +void example1(Dwarf_Die somedie) { + Dwarf_Debug dbg = 0; + Dwarf_Signed atcount; + Dwarf_Attribute *atlist; + Dwarf_Error error = 0; + Dwarf_Signed i = 0; + int errv; + errv = dwarf_attrlist(somedie, &atlist, &atcount, &error); + if (errv == DW_DLV_OK) { + for (i = 0; i < atcount; ++i) { + Dwarf_Bool is_string; + dwarf_hasform(atlist[i], DW_FORM_string, &is_string, &error); + dwarf_dealloc(dbg, atlist[i], DW_DLA_ATTR); + } + dwarf_dealloc(dbg, atlist, DW_DLA_LIST); + } + else if(errv == DW_DLV_ERROR){ + dwarf_dealloc(dbg, error, DW_DLA_ERROR); + } +} +int main(void){ + Dwarf_Die somedie; + memset(&somedie, 0, sizeof(somedie)); + example1(somedie); + return EXIT_SUCCESS; +} diff --git a/libdwarf/all/test_v1_package/CMakeLists.txt b/libdwarf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..be00a8c --- /dev/null +++ b/libdwarf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/libdwarf/all/test_v1_package/conanfile.py b/libdwarf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..5a05af3 --- /dev/null +++ b/libdwarf/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/libdwarf/config.yml b/libdwarf/config.yml new file mode 100644 index 0000000..b5a49fc --- /dev/null +++ b/libdwarf/config.yml @@ -0,0 +1,11 @@ +versions: + "0.9.1": + folder: all + "0.9.0": + folder: all + "0.8.0": + folder: all + "0.7.0": + folder: all + "0.5.0": + folder: all diff --git a/libelf/all/CMakeLists.txt b/libelf/all/CMakeLists.txt new file mode 100644 index 0000000..272a6d5 --- /dev/null +++ b/libelf/all/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.4) +project(elf LANGUAGES C) + +if(EXISTS "${LIBELF_SRC_DIR}/lib/sys_elf.h.w32") + file(RENAME "${LIBELF_SRC_DIR}/lib/sys_elf.h.w32" "${LIBELF_SRC_DIR}/lib/sys_elf.h") + file(RENAME "${LIBELF_SRC_DIR}/lib/config.h.w32" "${LIBELF_SRC_DIR}/config.h") +endif() + +file(GLOB_RECURSE SOURCES "${LIBELF_SRC_DIR}/lib/*.c") +file(GLOB_RECURSE HEADERS "${LIBELF_SRC_DIR}/lib/*.h") + +add_library(${PROJECT_NAME} ${SOURCES}) +set_target_properties(${PROJECT_NAME} PROPERTIES + PUBLIC_HEADER "${HEADERS}" + WINDOWS_EXPORT_ALL_SYMBOLS TRUE +) +target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${LIBELF_SRC_DIR}/lib") +target_compile_definitions(${PROJECT_NAME} PUBLIC HAVE_MEMCMP=1 HAVE_MEMCPY=1 HAVE_MEMMOVE=1) + +include(GNUInstallDirs) + +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libelf +) + +install(FILES "${LIBELF_SRC_DIR}/lib/libelf.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(FILES "${LIBELF_SRC_DIR}/lib/gelf.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(FILES "${LIBELF_SRC_DIR}/lib/nlist.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/libelf/all/conandata.yml b/libelf/all/conandata.yml new file mode 100644 index 0000000..68a80e3 --- /dev/null +++ b/libelf/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.8.13": + url: [ + "http://repository.timesys.com/buildsources/l/libelf/libelf-0.8.13/libelf-0.8.13.tar.gz", + "https://fossies.org/linux/misc/old/libelf-0.8.13.tar.gz", + ] + sha256: "591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d" diff --git a/libelf/all/conanfile.py b/libelf/all/conanfile.py new file mode 100644 index 0000000..c93a47a --- /dev/null +++ b/libelf/all/conanfile.py @@ -0,0 +1,123 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path +import os + +required_conan_version = ">=1.54.0" + + +class LibelfConan(ConanFile): + name = "libelf" + description = "ELF object file access library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://directory.fsf.org/wiki/Libelf" + license = "LGPL-2.0" + topics = ("elf", "fsf", "libelf", "object-file") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + exports_sources = "CMakeLists.txt" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.settings.os not in ["Linux", "FreeBSD", "Windows"]: + self.options.rm_safe("shared") + self.package_type = "static-library" + if self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self.settings.os != "Windows": + self.tool_requires("autoconf/2.71") + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if self.settings.os == "Windows": + tc = CMakeToolchain(self) + tc.variables["LIBELF_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + # it's required, libelf doesnt seem to understand DESTDIR + f"--prefix={unix_path(self, self.package_folder)}", + ]) + tc.generate() + + def build(self): + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + else: + replace_in_file(self, os.path.join(self.source_folder, "lib", "Makefile.in"), + "$(LINK_SHLIB)", + "$(LINK_SHLIB) $(LDFLAGS)") + # libelf sources contains really outdated 'config.sub' and + # 'config.guess' files. It not allows to build libelf for armv8 arch. + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING.LIB", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Windows": + cmake = CMake(self) + cmake.install() + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "locale")) + if self.options.get_safe("shared"): + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libelf") + self.cpp_info.libs = ["elf"] + self.cpp_info.includedirs.append(os.path.join("include", "libelf")) diff --git a/libelf/all/test_package/CMakeLists.txt b/libelf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..715677f --- /dev/null +++ b/libelf/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libelf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libelf::libelf) diff --git a/libelf/all/test_package/conanfile.py b/libelf/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/libelf/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/libelf/all/test_package/test_package.c b/libelf/all/test_package/test_package.c new file mode 100644 index 0000000..2cf36fd --- /dev/null +++ b/libelf/all/test_package/test_package.c @@ -0,0 +1,114 @@ +#include +#include + +#include +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include "libelf.h" + +int main(int argc , char **argv) { + int fd; + Elf *e; + const char *k; + Elf_Kind ek; + + if (elf_version(EV_CURRENT) == EV_NONE) { + printf("ELF library initialization failed: %s\n", elf_errmsg ( -1)); + return EXIT_FAILURE; + } + +#ifdef _WIN32 + return EXIT_SUCCESS; +#endif + +#ifdef _MSVC_VER + if ((fd = _open(argv[0], _O_RDONLY , 0)) < 0) { +#else + if ((fd = open(argv[0], O_RDONLY , 0)) < 0) { +#endif + printf("open %s failed\n", argv [0]); + return EXIT_FAILURE; + } + + if(ELF_C_NULL != 0) + { + printf("ELF_C_NULL has wrong value: %d\n", ELF_C_NULL); + return EXIT_FAILURE; + } + if(ELF_C_READ != 1) + { + printf("ELF_C_READ has wrong value: %d\n", ELF_C_READ); + return EXIT_FAILURE; + } + if(ELF_C_WRITE != 2) + { + printf("ELF_C_WRITE has wrong value: %d\n", ELF_C_WRITE); + return EXIT_FAILURE; + } + if(ELF_C_CLR != 3) + { + printf("ELF_C_CLR has wrong value: %d\n", ELF_C_CLR); + return EXIT_FAILURE; + } + if(ELF_C_SET != 4) + { + printf("ELF_C_SET has wrong value: %d\n", ELF_C_SET); + return EXIT_FAILURE; + } + if(ELF_C_FDDONE != 5) + { + printf("ELF_C_FDDONE has wrong value: %d\n", ELF_C_FDDONE); + return EXIT_FAILURE; + } + if(ELF_C_FDREAD != 6) + { + printf("ELF_C_FDREAD has wrong value: %d\n", ELF_C_FDREAD); + return EXIT_FAILURE; + } + if(ELF_C_RDWR != 7) + { + printf("ELF_C_RDWR has wrong value: %d\n", ELF_C_RDWR); + return EXIT_FAILURE; + } + if(ELF_C_NUM != 8) + { + printf("ELF_C_NUM has wrong value: %d\n", ELF_C_NUM); + return EXIT_FAILURE; + } + + if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { + printf("elf_begin () failed: %s.\n", elf_errmsg ( -1)); + return EXIT_FAILURE; + } + + ek = elf_kind(e); + + switch (ek) { + case ELF_K_AR: + k = "ar(1) archive"; + break; + case ELF_K_ELF: + k = "elf object"; + break; + case ELF_K_NONE: + k = "data"; + break; + default: + k = "unrecognized"; + } + + printf("%s: %s\n", argv[0], k); + elf_end(e); + +#ifdef _MSVC_VER + _close(fd); +#else + close(fd); +#endif + + return EXIT_SUCCESS; +} diff --git a/libelf/all/test_v1_package/CMakeLists.txt b/libelf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/libelf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/libelf/all/test_v1_package/conanfile.py b/libelf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/libelf/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/libelf/config.yml b/libelf/config.yml new file mode 100644 index 0000000..f55c7c3 --- /dev/null +++ b/libelf/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8.13": + folder: all diff --git a/libevent/all/conandata.yml b/libevent/all/conandata.yml new file mode 100644 index 0000000..f2a195c --- /dev/null +++ b/libevent/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "2.1.12": + url: "https://github.com/libevent/libevent/archive/release-2.1.12-stable.tar.gz" + sha256: "7180a979aaa7000e1264da484f712d403fcf7679b1e9212c4e3d09f5c93efc24" + "2.1.11": + url: "https://github.com/libevent/libevent/archive/release-2.1.11-stable.tar.gz" + sha256: "229393ab2bf0dc94694f21836846b424f3532585bac3468738b7bf752c03901e" +patches: + "2.1.12": + - patch_file: patches/fix-cmake-2.1.12.patch + "2.1.11": + - patch_file: patches/fix-cmake-2.1.11.patch diff --git a/libevent/all/conanfile.py b/libevent/all/conanfile.py new file mode 100644 index 0000000..2d107e4 --- /dev/null +++ b/libevent/all/conanfile.py @@ -0,0 +1,132 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class LibeventConan(ConanFile): + name = "libevent" + description = "libevent - an event notification library" + topics = ("event", "notification", "networking", "async") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libevent/libevent" + license = "BSD-3-Clause" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openssl": [True, False], + "disable_threads": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openssl": True, + "disable_threads": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if self.options.with_openssl: + tc.variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + tc.cache_variables["EVENT__LIBRARY_TYPE"] = "SHARED" if self.options.shared else "STATIC" + tc.variables["EVENT__DISABLE_DEBUG_MODE"] = self.settings.build_type == "Release" + tc.variables["EVENT__DISABLE_OPENSSL"] = not self.options.with_openssl + tc.variables["EVENT__DISABLE_THREAD_SUPPORT"] = self.options.disable_threads + tc.variables["EVENT__DISABLE_BENCHMARK"] = True + tc.variables["EVENT__DISABLE_TESTS"] = True + tc.variables["EVENT__DISABLE_REGRESS"] = True + tc.variables["EVENT__DISABLE_SAMPLES"] = True + # libevent uses static runtime (MT) for static builds by default + if is_msvc(self): + tc.variables["EVENT__MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # relocatable shared libs on macOS + replace_in_file(self, os.path.join(self.source_folder, "cmake", "AddEventLibrary.cmake"), + "INSTALL_NAME_DIR \"${CMAKE_INSTALL_PREFIX}/lib\"", + "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Libevent") + self.cpp_info.set_property("pkg_config_name", "libevent") # exist in libevent for historical reason + + # core + self.cpp_info.components["core"].set_property("cmake_target_name", "libevent::core") + self.cpp_info.components["core"].set_property("pkg_config_name", "libevent_core") + self.cpp_info.components["core"].libs = ["event_core"] + if self.settings.os in ["Linux", "FreeBSD"] and not self.options.disable_threads: + self.cpp_info.components["core"].system_libs = ["pthread"] + if self.settings.os == "Windows": + self.cpp_info.components["core"].system_libs = ["ws2_32", "advapi32", "iphlpapi"] + + # extra + self.cpp_info.components["extra"].set_property("cmake_target_name", "libevent::extra") + self.cpp_info.components["extra"].set_property("pkg_config_name", "libevent_extra") + self.cpp_info.components["extra"].libs = ["event_extra"] + if self.settings.os == "Windows": + self.cpp_info.components["extra"].system_libs = ["shell32"] + self.cpp_info.components["extra"].requires = ["core"] + + # openssl + if self.options.with_openssl: + self.cpp_info.components["openssl"].set_property("cmake_target_name", "libevent::openssl") + self.cpp_info.components["openssl"].set_property("pkg_config_name", "libevent_openssl") + self.cpp_info.components["openssl"].libs = ["event_openssl"] + self.cpp_info.components["openssl"].requires = ["core", "openssl::openssl"] + + # pthreads + if self.settings.os != "Windows" and not self.options.disable_threads: + self.cpp_info.components["pthreads"].set_property("cmake_target_name", "libevent::pthreads") + self.cpp_info.components["pthreads"].set_property("pkg_config_name", "libevent_pthreads") + self.cpp_info.components["pthreads"].libs = ["event_pthreads"] + self.cpp_info.components["pthreads"].requires = ["core"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "Libevent" + self.cpp_info.filenames["cmake_find_package_multi"] = "Libevent" diff --git a/libevent/all/patches/fix-cmake-2.1.11.patch b/libevent/all/patches/fix-cmake-2.1.11.patch new file mode 100644 index 0000000..e006cba --- /dev/null +++ b/libevent/all/patches/fix-cmake-2.1.11.patch @@ -0,0 +1,39 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,7 +46,7 @@ set(EVENT__LIBRARY_TYPE DEFAULT CACHE STRING + + project(libevent C) + +-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/") ++list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/") + string(REGEX MATCH "SunOS" SOLARIS "${CMAKE_SYSTEM_NAME}") + + +@@ -946,7 +946,6 @@ endif() + # library exists for historical reasons; it contains the contents of + # both libevent_core and libevent_extra. You shouldn’t use it; it may + # go away in a future version of Libevent. +-add_event_library(event SOURCES ${SRC_CORE} ${SRC_EXTRA}) + + set(WIN32_GETOPT) + if (WIN32) +--- a/cmake/AddEventLibrary.cmake ++++ b/cmake/AddEventLibrary.cmake +@@ -127,7 +127,7 @@ macro(add_event_library LIB_NAME) + COMMAND ${CMAKE_COMMAND} -E create_symlink + "$" + "${LIB_LINK_NAME}" +- WORKING_DIRECTORY "lib") ++ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/lib") + endif() + + list(APPEND LIBEVENT_SHARED_LIBRARIES "${LIB_NAME}_shared") +@@ -145,7 +145,7 @@ macro(add_event_library LIB_NAME) + EXPORT LibeventTargets + LIBRARY DESTINATION "lib" COMPONENT lib + ARCHIVE DESTINATION "lib" COMPONENT lib +- RUNTIME DESTINATION "lib" COMPONENT lib ++ RUNTIME DESTINATION "bin" COMPONENT lib + PUBLIC_HEADER DESTINATION "include/event2" + COMPONENT dev + ) diff --git a/libevent/all/patches/fix-cmake-2.1.12.patch b/libevent/all/patches/fix-cmake-2.1.12.patch new file mode 100644 index 0000000..e6fa0d8 --- /dev/null +++ b/libevent/all/patches/fix-cmake-2.1.12.patch @@ -0,0 +1,41 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -970,16 +970,15 @@ endif() + # library exists for historical reasons; it contains the contents of + # both libevent_core and libevent_extra. You shouldn’t use it; it may + # go away in a future version of Libevent. +-add_event_library(event SOURCES ${SRC_CORE} ${SRC_EXTRA}) + + set(WIN32_GETOPT) + if (WIN32) + set(_TMPLIBS) + if (${EVENT_LIBRARY_STATIC}) +- list(APPEND _TMPLIBS event_core_static event_static) ++ list(APPEND _TMPLIBS event_core_static) + endif() + if (${EVENT_LIBRARY_SHARED}) +- list(APPEND _TMPLIBS event_core_shared event_shared) ++ list(APPEND _TMPLIBS event_core_shared) + endif() + foreach(lib ${_TMPLIBS}) + target_link_libraries(${lib} iphlpapi) +--- a/cmake/AddEventLibrary.cmake ++++ b/cmake/AddEventLibrary.cmake +@@ -42,7 +42,7 @@ macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES) + install(TARGETS "${LIB_NAME}_${TYPE}" + LIBRARY DESTINATION "lib" COMPONENT lib + ARCHIVE DESTINATION "lib" COMPONENT lib +- RUNTIME DESTINATION "lib" COMPONENT lib ++ RUNTIME DESTINATION "bin" COMPONENT lib + COMPONENT dev + ) + else() +@@ -69,7 +69,7 @@ macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES) + EXPORT LibeventTargets-${TYPE} + LIBRARY DESTINATION "lib" COMPONENT lib + ARCHIVE DESTINATION "lib" COMPONENT lib +- RUNTIME DESTINATION "lib" COMPONENT lib ++ RUNTIME DESTINATION "bin" COMPONENT lib + COMPONENT dev + ) + endif() diff --git a/libevent/all/test_package/CMakeLists.txt b/libevent/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..dc7570c --- /dev/null +++ b/libevent/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Libevent REQUIRED core CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libevent::core) diff --git a/libevent/all/test_package/conanfile.py b/libevent/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/libevent/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/libevent/all/test_package/test_package.c b/libevent/all/test_package/test_package.c new file mode 100644 index 0000000..e564e1b --- /dev/null +++ b/libevent/all/test_package/test_package.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#ifndef _WIN32 +#include +# ifdef _XOPEN_SOURCE_EXTENDED +# include +# endif +#include +#endif + +#include +#include +#include +#include +#include + +int +main(int argc, char **argv) +{ + struct event_base *base; + const char* version = event_get_version(); + + base = event_base_new(); + if (!base) { + fprintf(stderr, "Could not initialize libevent!\n"); + return 1; + } + + event_base_free(base); + + printf("Version %s\n", version); + printf("done\n"); + return 0; +} diff --git a/libevent/all/test_v1_package/CMakeLists.txt b/libevent/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/libevent/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/libevent/all/test_v1_package/conanfile.py b/libevent/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/libevent/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/libevent/config.yml b/libevent/config.yml new file mode 100644 index 0000000..479e85b --- /dev/null +++ b/libevent/config.yml @@ -0,0 +1,5 @@ +versions: + "2.1.12": + folder: all + "2.1.11": + folder: all diff --git a/libiberty/all/conandata.yml b/libiberty/all/conandata.yml new file mode 100644 index 0000000..b3c320f --- /dev/null +++ b/libiberty/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "9.1.0": + url: "https://ftp.gnu.org/pub/gnu/gcc/gcc-9.1.0/gcc-9.1.0.tar.gz" + sha256: "be303f7a8292982a35381489f5a9178603cbe9a4715ee4fa4a815d6bcd2b658d" diff --git a/libiberty/all/conanfile.py b/libiberty/all/conanfile.py new file mode 100644 index 0000000..34588a0 --- /dev/null +++ b/libiberty/all/conanfile.py @@ -0,0 +1,88 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rename, rmdir +from conan.tools.layout import basic_layout +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.microsoft import is_msvc, unix_path +import os + +required_conan_version = ">=1.53.0" + + +class LibibertyConan(ConanFile): + name = "libiberty" + description = "A collection of subroutines used by various GNU programs" + topics = ("gnu", "gnu-collection") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gcc.gnu.org/onlinedocs/libiberty" + license = "LGPL-2.1" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _libiberty_folder(self): + return os.path.join(self.source_folder, "libiberty") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("libiberty can not be built by Visual Studio.") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + rmdir(self, os.path.join(self.source_folder, "gcc")) + rmdir(self, os.path.join(self.source_folder, "libstdc++-v3")) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.append("--enable-install-libiberty") + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure(build_script_folder=self._libiberty_folder) + autotools.make() + + def package(self): + copy(self, "COPYING.LIB", src=self._libiberty_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + self._package_xx(32) + self._package_xx(64) + + def _package_xx(self, arch): + lib_arch_dir = os.path.join(self.package_folder, f"lib{arch}") + if os.path.exists(lib_arch_dir): + libdir = os.path.join(self.package_folder, "lib") + rmdir(self, libdir) + rename(self, lib_arch_dir, libdir) + + def package_info(self): + self.cpp_info.libs = ["iberty"] diff --git a/libiberty/all/test_package/CMakeLists.txt b/libiberty/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..c618a0e --- /dev/null +++ b/libiberty/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libiberty REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libiberty::libiberty) diff --git a/libiberty/all/test_package/conanfile.py b/libiberty/all/test_package/conanfile.py new file mode 100644 index 0000000..98ab558 --- /dev/null +++ b/libiberty/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/libiberty/all/test_package/test_package.c b/libiberty/all/test_package/test_package.c new file mode 100644 index 0000000..0d3850d --- /dev/null +++ b/libiberty/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include +#include +#include "libiberty/libiberty.h" + +int main(void) { + printf("GETPWD: %s\n", getpwd()); + printf("CONCAT (FOO + BAR): %s\n", concat("FOO", "BAR", NULL)); + return EXIT_SUCCESS; +} diff --git a/libiberty/all/test_v1_package/CMakeLists.txt b/libiberty/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/libiberty/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/libiberty/all/test_v1_package/conanfile.py b/libiberty/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/libiberty/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/libiberty/config.yml b/libiberty/config.yml new file mode 100644 index 0000000..64c2252 --- /dev/null +++ b/libiberty/config.yml @@ -0,0 +1,3 @@ +versions: + "9.1.0": + folder: all diff --git a/libiconv/all/conandata.yml b/libiconv/all/conandata.yml new file mode 100644 index 0000000..445cf39 --- /dev/null +++ b/libiconv/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.17": + url: "https://ftp.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz" + sha256: "8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313" + "1.16": + url: "https://ftp.gnu.org/gnu/libiconv/libiconv-1.16.tar.gz" + sha256: "e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04" + "1.15": + url: "https://ftp.gnu.org/gnu/libiconv/libiconv-1.15.tar.gz" + sha256: "ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178" +patches: + "1.16": + - patch_file: "patches/0001-libcharset-fix-linkage.patch" diff --git a/libiconv/all/conanfile.py b/libiconv/all/conanfile.py new file mode 100644 index 0000000..1c44ed6 --- /dev/null +++ b/libiconv/all/conanfile.py @@ -0,0 +1,170 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import ( + apply_conandata_patches, + copy, + export_conandata_patches, + get, + rename, + rm, + rmdir, + replace_in_file +) +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class LibiconvConan(ConanFile): + name = "libiconv" + description = "Convert text to and from Unicode" + license = ("LGPL-2.0-or-later", "LGPL-2.1-or-later") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/libiconv/" + topics = ("iconv", "text", "encoding", "locale", "unicode", "conversion") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _is_clang_cl(self): + return self.settings.compiler == "clang" and self.settings.os == "Windows" and \ + self.settings.compiler.get_safe("runtime") + + @property + def _msvc_tools(self): + return ("clang-cl", "llvm-lib", "lld-link") if self._is_clang_cl else ("cl", "lib", "link") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if Version(self.version) >= "1.17": + self.license = "LGPL-2.1-or-later" + else: + self.license = "LGPL-2.0-or-later" + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows": + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + self.win_bash = True + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if self.settings.os == "Windows" and self.settings.compiler == "gcc": + if self.settings.arch == "x86": + tc.update_configure_args({ + "--host": "i686-w64-mingw32", + "RC": "windres --target=pe-i386", + "WINDRES": "windres --target=pe-i386", + }) + elif self.settings.arch == "x86_64": + tc.update_configure_args({ + "--host": "x86_64-w64-mingw32", + "RC": "windres --target=pe-x86-64", + "WINDRES": "windres --target=pe-x86-64", + }) + msvc_version = {"Visual Studio": "12", "msvc": "180"} + if is_msvc(self) and Version(self.settings.compiler.version) >= msvc_version[str(self.settings.compiler)]: + # https://github.com/conan-io/conan/issues/6514 + tc.extra_cflags.append("-FS") + if cross_building(self) and is_msvc(self): + triplet_arch_windows = {"x86_64": "x86_64", "x86": "i686", "armv8": "aarch64"} + # ICU doesn't like GNU triplet of conan for msvc (see https://github.com/conan-io/conan/issues/12546) + host_arch = triplet_arch_windows.get(str(self.settings.arch)) + build_arch = triplet_arch_windows.get(str(self._settings_build.arch)) + + if host_arch and build_arch: + host = f"{host_arch}-w64-mingw32" + build = f"{build_arch}-w64-mingw32" + tc.configure_args.extend([ + f"--host={host}", + f"--build={build}", + ]) + env = tc.environment() + if is_msvc(self) or self._is_clang_cl: + cc, lib, link = self._msvc_tools + build_aux_path = os.path.join(self.source_folder, "build-aux") + lt_compile = unix_path(self, os.path.join(build_aux_path, "compile")) + lt_ar = unix_path(self, os.path.join(build_aux_path, "ar-lib")) + env.define("CC", f"{lt_compile} {cc} -nologo") + env.define("CXX", f"{lt_compile} {cc} -nologo") + env.define("LD", link) + env.define("STRIP", ":") + env.define("AR", f"{lt_ar} {lib}") + env.define("RANLIB", ":") + env.define("NM", "dumpbin -symbols") + env.define("win32_target", "_WIN32_WINNT_VISTA") + tc.generate(env) + + def _apply_resource_patch(self): + if self.settings.arch == "x86": + windres_options_path = os.path.join(self.source_folder, "windows", "windres-options") + self.output.info("Applying {} resource patch: {}".format(self.settings.arch, windres_options_path)) + replace_in_file(self, windres_options_path, '# PACKAGE_VERSION_SUBMINOR', '# PACKAGE_VERSION_SUBMINOR\necho "--target=pe-i386"', strict=True) + + def build(self): + apply_conandata_patches(self) + self._apply_resource_patch() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING.LIB", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) + if (is_msvc(self) or self._is_clang_cl) and self.options.shared: + for import_lib in ["iconv", "charset"]: + rename(self, os.path.join(self.package_folder, "lib", f"{import_lib}.dll.lib"), + os.path.join(self.package_folder, "lib", f"{import_lib}.lib")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "Iconv") + self.cpp_info.set_property("cmake_target_name", "Iconv::Iconv") + self.cpp_info.libs = ["iconv", "charset"] + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "Iconv" + self.cpp_info.names["cmake_find_package_multi"] = "Iconv" + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/libiconv/all/patches/0001-libcharset-fix-linkage.patch b/libiconv/all/patches/0001-libcharset-fix-linkage.patch new file mode 100644 index 0000000..f39e0b7 --- /dev/null +++ b/libiconv/all/patches/0001-libcharset-fix-linkage.patch @@ -0,0 +1,155 @@ +diff --git a/libcharset/Makefile.in b/libcharset/Makefile.in +index 5f599fe..e6ba91a 100644 +--- a/libcharset/Makefile.in ++++ b/libcharset/Makefile.in +@@ -30,25 +30,22 @@ mkinstalldirs = $(SHELL) @top_srcdir@/build-aux/mkinstalldirs + + SHELL = @SHELL@ + +-all : include/libcharset.h force ++all : force + cd lib && $(MAKE) all + +-include/libcharset.h : +- if [ ! -d include ] ; then mkdir include ; fi +- $(CP) $(srcdir)/include/libcharset.h.in include/libcharset.h +- + # Installs the library and include files only. Typically called with only + # $(libdir) and $(includedir) - don't use $(prefix) and $(exec_prefix) here. + install-lib : all force + cd lib && $(MAKE) install-lib libdir='$(libdir)' includedir='$(includedir)' + $(mkinstalldirs) $(includedir) +- $(INSTALL_DATA) include/libcharset.h $(includedir)/libcharset.h +- $(INSTALL_DATA) include/localcharset.h.inst $(includedir)/localcharset.h ++ $(INSTALL_DATA) include/libcharset.h.inst $(includedir)/libcharset.h ++# Here, use the include file that contains LIBCHARSET_DLL_EXPORTED annotations. ++ $(INSTALL_DATA) include/localcharset.h $(includedir)/localcharset.h + +-install : include/libcharset.h include/localcharset.h force ++install : all force + cd lib && $(MAKE) install prefix='$(prefix)' exec_prefix='$(exec_prefix)' libdir='$(libdir)' + $(mkinstalldirs) $(DESTDIR)$(includedir) +- $(INSTALL_DATA) include/libcharset.h $(DESTDIR)$(includedir)/libcharset.h ++ $(INSTALL_DATA) include/libcharset.h.inst $(DESTDIR)$(includedir)/libcharset.h + $(INSTALL_DATA) include/localcharset.h.inst $(DESTDIR)$(includedir)/localcharset.h + + install-strip : install +@@ -73,12 +70,12 @@ clean : force + + distclean : force + cd lib && if test -f Makefile; then $(MAKE) distclean; fi +- $(RM) include/libcharset.h include/localcharset.h include/localcharset.h.inst ++ $(RM) include/libcharset.h include/libcharset.h.inst include/localcharset.h include/localcharset.h.inst + $(RM) config.status config.log config.cache Makefile config.h libtool + + maintainer-clean : force + cd lib && if test -f Makefile; then $(MAKE) maintainer-clean; fi +- $(RM) include/libcharset.h include/localcharset.h include/localcharset.h.inst ++ $(RM) include/libcharset.h include/libcharset.h.inst include/localcharset.h include/localcharset.h.inst + $(RM) config.status config.log config.cache Makefile config.h libtool + + # List of source files. +@@ -133,6 +130,7 @@ IMPORTED_FILES = \ + # List of distributed files generated by autotools or Makefile.devel. + GENERATED_FILES = \ + autoconf/aclocal.m4 configure config.h.in \ ++ include/libcharset.h.build.in \ + include/localcharset.h.build.in + # List of distributed files generated by "make". + DISTRIBUTED_BUILT_FILES = +diff --git a/libcharset/configure b/libcharset/configure +index cf4f9d2..8844aca 100755 +--- a/libcharset/configure ++++ b/libcharset/configure +@@ -12346,6 +12346,10 @@ ac_config_files="$ac_config_files Makefile" + + ac_config_files="$ac_config_files lib/Makefile" + ++ac_config_files="$ac_config_files include/libcharset.h:include/libcharset.h.build.in" ++ ++ac_config_files="$ac_config_files include/libcharset.h.inst:include/libcharset.h.in" ++ + ac_config_files="$ac_config_files include/localcharset.h:include/localcharset.h.build.in" + + ac_config_files="$ac_config_files include/localcharset.h.inst:include/localcharset.h.in" +@@ -13346,6 +13350,8 @@ do + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; ++ "include/libcharset.h") CONFIG_FILES="$CONFIG_FILES include/libcharset.h:include/libcharset.h.build.in" ;; ++ "include/libcharset.h.inst") CONFIG_FILES="$CONFIG_FILES include/libcharset.h.inst:include/libcharset.h.in" ;; + "include/localcharset.h") CONFIG_FILES="$CONFIG_FILES include/localcharset.h:include/localcharset.h.build.in" ;; + "include/localcharset.h.inst") CONFIG_FILES="$CONFIG_FILES include/localcharset.h.inst:include/localcharset.h.in" ;; + +diff --git a/libcharset/configure.ac b/libcharset/configure.ac +index 362bde3..a071d25 100644 +--- a/libcharset/configure.ac ++++ b/libcharset/configure.ac +@@ -60,6 +60,8 @@ AC_CHECK_FUNCS([setlocale]) + + AC_CONFIG_FILES([Makefile]) + AC_CONFIG_FILES([lib/Makefile]) ++AC_CONFIG_FILES([include/libcharset.h:include/libcharset.h.build.in]) ++AC_CONFIG_FILES([include/libcharset.h.inst:include/libcharset.h.in]) + AC_CONFIG_FILES([include/localcharset.h:include/localcharset.h.build.in]) + AC_CONFIG_FILES([include/localcharset.h.inst:include/localcharset.h.in]) + AC_OUTPUT +diff --git a/libcharset/include/libcharset.h.build.in b/libcharset/include/libcharset.h.build.in +new file mode 100644 +index 0000000..46e911a +--- /dev/null ++++ b/libcharset/include/libcharset.h.build.in +@@ -0,0 +1,53 @@ ++/* Copyright (C) 2003 Free Software Foundation, Inc. ++ This file is part of the GNU CHARSET Library. ++ ++ The GNU CHARSET Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2 of the ++ License, or (at your option) any later version. ++ ++ The GNU CHARSET Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with the GNU CHARSET Library; see the file COPYING.LIB. If not, ++ see . */ ++ ++#ifndef _LIBCHARSET_H ++#define _LIBCHARSET_H ++ ++#if @HAVE_VISIBILITY@ && BUILDING_LIBCHARSET ++#define LIBCHARSET_DLL_EXPORTED __attribute__((__visibility__("default"))) ++#elif defined _MSC_VER && BUILDING_LIBCHARSET ++#define LIBCHARSET_DLL_EXPORTED __declspec(dllexport) ++#else ++#define LIBCHARSET_DLL_EXPORTED ++#endif ++ ++#include ++ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ ++/* Support for relocatable packages. */ ++ ++/* Sets the original and the current installation prefix of the package. ++ Relocation simply replaces a pathname starting with the original prefix ++ by the corresponding pathname with the current prefix instead. Both ++ prefixes should be directory names without trailing slash (i.e. use "" ++ instead of "/"). */ ++extern LIBCHARSET_DLL_EXPORTED void libcharset_set_relocation_prefix (const char *orig_prefix, ++ const char *curr_prefix); ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++ ++#endif /* _LIBCHARSET_H */ diff --git a/libiconv/all/test_package/CMakeLists.txt b/libiconv/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..64fa90d --- /dev/null +++ b/libiconv/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(Iconv REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Iconv::Iconv) diff --git a/libiconv/all/test_package/conanfile.py b/libiconv/all/test_package/conanfile.py new file mode 100644 index 0000000..12a4269 --- /dev/null +++ b/libiconv/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/libiconv/all/test_package/test_package.c b/libiconv/all/test_package/test_package.c new file mode 100644 index 0000000..2b5cf12 --- /dev/null +++ b/libiconv/all/test_package/test_package.c @@ -0,0 +1,50 @@ +#include +#include +#include //for EXIT_FAILURE +#include + +#if _MSC_VER && _MSC_VER < 1600 +typedef unsigned __int32 uint32_t; +#else +#include +#endif + +#include "iconv.h" +#include "libcharset.h" + +int main() +{ + // Test libiconv + char in_bytes[4] = {'c', 'i', 'a', 'o'}; + char *in_buffer = (char *)&in_bytes; + size_t in_bytes_left = sizeof(char) * 4; + uint32_t ou_bytes[4] = {(uint32_t)-1, (uint32_t)-1, (uint32_t)-1, (uint32_t)-1}; + size_t ou_bytes_left = sizeof(uint32_t) * 4; + char *ou_buffer = (char *)&ou_bytes; + iconv_t context; + size_t rv; + + context = iconv_open("UCS-4-INTERNAL", "US-ASCII"); + if ((iconv_t)(-1) == context) + { + fprintf(stderr, "iconv_open failed\n"); + return EXIT_FAILURE; + } + + rv = iconv(context, &in_buffer, &in_bytes_left, &ou_buffer, &ou_bytes_left); + if ((size_t)(-1) == rv) + { + fprintf(stderr, "icon failed\n"); + return EXIT_FAILURE; + } + + printf("retval libiconv: %lu %u %u %u %u\n", rv, ou_bytes[0], ou_bytes[1], ou_bytes[2], ou_bytes[3]); + + iconv_close(context); + + // Test libcharset + setlocale(LC_ALL, ""); + printf("retval libcharset: %s\n", locale_charset()); + + return EXIT_SUCCESS; +} diff --git a/libiconv/all/test_v1_package/CMakeLists.txt b/libiconv/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/libiconv/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/libiconv/all/test_v1_package/conanfile.py b/libiconv/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..a831367 --- /dev/null +++ b/libiconv/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/libiconv/config.yml b/libiconv/config.yml new file mode 100644 index 0000000..107f427 --- /dev/null +++ b/libiconv/config.yml @@ -0,0 +1,7 @@ +versions: + "1.17": + folder: all + "1.16": + folder: all + "1.15": + folder: all diff --git a/librdkafka/all/conandata.yml b/librdkafka/all/conandata.yml new file mode 100644 index 0000000..5b70b2f --- /dev/null +++ b/librdkafka/all/conandata.yml @@ -0,0 +1,52 @@ +sources: + "2.4.0": + url: "https://github.com/edenhill/librdkafka/archive/v2.4.0.tar.gz" + sha256: "d645e47d961db47f1ead29652606a502bdd2a880c85c1e060e94eea040f1a19a" + "2.3.0": + url: "https://github.com/edenhill/librdkafka/archive/v2.3.0.tar.gz" + sha256: "2d49c35c77eeb3d42fa61c43757fcbb6a206daa560247154e60642bcdcc14d12" + "2.2.0": + url: "https://github.com/edenhill/librdkafka/archive/v2.2.0.tar.gz" + sha256: "af9a820cbecbc64115629471df7c7cecd40403b6c34bfdbb9223152677a47226" + "2.0.2": + url: "https://github.com/edenhill/librdkafka/archive/v2.0.2.tar.gz" + sha256: "f321bcb1e015a34114c83cf1aa7b99ee260236aab096b85c003170c90a47ca9d" + "1.9.2": + url: "https://github.com/edenhill/librdkafka/archive/v1.9.2.tar.gz" + sha256: "3fba157a9f80a0889c982acdd44608be8a46142270a389008b22d921be1198ad" +patches: + "2.4.0": + - patch_file: patches/0001-Change-library-names-1-9-1.patch + patch_description: "find_package conan packages" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-2-3-0.patch + patch_description: "refer conan package names" + patch_type: "conan" + "2.3.0": + - patch_file: patches/0001-Change-library-names-1-9-1.patch + patch_description: "find_package conan packages" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-2-3-0.patch + patch_description: "refer conan package names" + patch_type: "conan" + "2.2.0": + - patch_file: patches/0001-Change-library-names-1-9-1.patch + patch_description: "find_package conan packages" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-2-0-2.patch + patch_description: "refer conan package names" + patch_type: "conan" + "2.0.2": + - patch_file: patches/0001-Change-library-names-1-9-1.patch + patch_description: "find_package conan packages" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-2-0-2.patch + patch_description: "refer conan package names" + patch_type: "conan" + "1.9.2": + - patch_file: patches/0001-Change-library-names-1-9-1.patch + patch_description: "find_package conan packages" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-1-9-1.patch + patch_description: "refer conan package names" + patch_type: "conan" diff --git a/librdkafka/all/conanfile.py b/librdkafka/all/conanfile.py new file mode 100644 index 0000000..90bfc65 --- /dev/null +++ b/librdkafka/all/conanfile.py @@ -0,0 +1,163 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import PkgConfigDeps +import os + +required_conan_version = ">=1.55.0" + + +class LibrdkafkaConan(ConanFile): + name = "librdkafka" + description = ( + "Librdkafka is an Apache Kafka C/C++ library designed with message " + "delivery reliability and high performance in mind." + ) + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/edenhill/librdkafka" + topics = ("kafka", "consumer", "producer") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "zlib": [True, False], + "zstd": [True, False], + "plugins": [True, False], + "ssl": [True, False], + "sasl": [True, False], + "curl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "zlib": False, + "zstd": False, + "plugins": False, + "ssl": False, + "sasl": False, + "curl": False, + } + + @property + def _depends_on_cyrus_sasl(self): + return self.options.sasl and self.settings.os != "Windows" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("lz4/1.9.4") + if self.options.zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.zstd: + self.requires("zstd/1.5.5") + if self.options.ssl: + self.requires("openssl/[>=1.1 <4]") + if self._depends_on_cyrus_sasl: + self.requires("cyrus-sasl/2.1.28") + if self.options.curl: + self.requires("libcurl/[>=7.78.0 <9]") + + def build_requirements(self): + if self._depends_on_cyrus_sasl: + self.tool_requires("pkgconf/2.1.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + tc.variables["WITHOUT_OPTIMIZATION"] = self.settings.build_type == "Debug" + tc.variables["ENABLE_DEVEL"] = self.settings.build_type == "Debug" + tc.variables["RDKAFKA_BUILD_STATIC"] = not self.options.shared + tc.variables["RDKAFKA_BUILD_EXAMPLES"] = False + tc.variables["RDKAFKA_BUILD_TESTS"] = False + tc.variables["WITHOUT_WIN32_CONFIG"] = True + tc.variables["WITH_BUNDLED_SSL"] = False + tc.variables["WITH_ZLIB"] = self.options.zlib + tc.variables["WITH_ZSTD"] = self.options.zstd + tc.variables["WITH_PLUGINS"] = self.options.plugins + tc.variables["WITH_SSL"] = self.options.ssl + tc.variables["WITH_SASL"] = self.options.sasl + tc.variables["ENABLE_LZ4_EXT"] = True + tc.variables["WITH_CURL"] = self.options.curl + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + if self._depends_on_cyrus_sasl: + pc = PkgConfigDeps(self) + pc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSES.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "RdKafka") + # Avoid to create undesirables librdkafka::librdkafka target and librdkafka.pc + # it's fine since rdkafka++ component depends on all components + self.cpp_info.set_property("cmake_target_name", "RdKafka::rdkafka++") + self.cpp_info.set_property("pkg_config_name", "rdkafka++") + + # rdkafka + self.cpp_info.components["rdkafka"].set_property("cmake_target_name", "RdKafka::rdkafka") + self.cpp_info.components["rdkafka"].set_property("pkg_config_name", "rdkafka") + self.cpp_info.components["rdkafka"].libs = ["rdkafka"] + self.cpp_info.components["rdkafka"].requires = ["lz4::lz4"] + if self.options.zlib: + self.cpp_info.components["rdkafka"].requires.append("zlib::zlib") + if self.options.zstd: + self.cpp_info.components["rdkafka"].requires.append("zstd::zstd") + if self.options.ssl: + self.cpp_info.components["rdkafka"].requires.append("openssl::openssl") + if self._depends_on_cyrus_sasl: + self.cpp_info.components["rdkafka"].requires.append("cyrus-sasl::cyrus-sasl") + if self.options.get_safe("curl", False): + self.cpp_info.components["rdkafka"].requires.append("libcurl::libcurl") + if self.settings.os == "Windows": + self.cpp_info.components["rdkafka"].system_libs = ["ws2_32", "secur32"] + if self.options.ssl: + self.cpp_info.components["rdkafka"].system_libs.append("crypt32") + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["rdkafka"].system_libs.extend(["pthread", "rt", "dl", "m"]) + if not self.options.shared: + self.cpp_info.components["rdkafka"].defines.append("LIBRDKAFKA_STATICLIB") + + # rdkafka++ + self.cpp_info.components["rdkafka++"].set_property("cmake_target_name", "RdKafka::rdkafka++") + self.cpp_info.components["rdkafka++"].set_property("pkg_config_name", "rdkafka++") + self.cpp_info.components["rdkafka++"].libs = ["rdkafka++"] + self.cpp_info.components["rdkafka++"].requires = ["rdkafka"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "RdKafka" + self.cpp_info.names["cmake_find_package_multi"] = "RdKafka" diff --git a/librdkafka/all/patches/0001-Change-library-names-1-9-1.patch b/librdkafka/all/patches/0001-Change-library-names-1-9-1.patch new file mode 100644 index 0000000..93de57a --- /dev/null +++ b/librdkafka/all/patches/0001-Change-library-names-1-9-1.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7f3dd0f..89a21e7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -67,7 +67,7 @@ endif() + # } + + # ZSTD { +-find_package(ZSTD QUIET) ++find_package(zstd QUIET CONFIG) + if(ZSTD_FOUND) + set(with_zstd_default ON) + else() +@@ -169,7 +169,8 @@ endif() + option(ENABLE_LZ4_EXT "Enable external LZ4 library support" ON) + set(WITH_LZ4_EXT OFF) + if(ENABLE_LZ4_EXT) +- find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) ++ set(LZ4_FOUND ON) + if(LZ4_FOUND) + set(WITH_LZ4_EXT ON) + list(APPEND BUILT_WITH "LZ4_EXT") diff --git a/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-9-1.patch b/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-9-1.patch new file mode 100644 index 0000000..c334727 --- /dev/null +++ b/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-1-9-1.patch @@ -0,0 +1,25 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 33b3ced..93f49b1 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -207,9 +207,7 @@ if(WITH_ZLIB) + endif() + + if(WITH_ZSTD) +- target_link_libraries(rdkafka PRIVATE ${ZSTD_LIBRARY}) +- target_include_directories(rdkafka PRIVATE ${ZSTD_INCLUDE_DIR}) +- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") ++ target_link_libraries(rdkafka PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + if(WITH_SSL) +@@ -248,8 +246,7 @@ if(WITH_LIBDL) + endif() + + if(WITH_LZ4_EXT) +- target_include_directories(rdkafka PRIVATE ${LZ4_INCLUDE_DIRS}) +- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) ++ target_link_libraries(rdkafka PUBLIC lz4::lz4) + endif() + + if(WIN32) diff --git a/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-0-2.patch b/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-0-2.patch new file mode 100644 index 0000000..740fe7f --- /dev/null +++ b/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-0-2.patch @@ -0,0 +1,24 @@ +diff --git a/a/src/CMakeLists.txt b/b/src/CMakeLists.txt +index 37b43c4..78745a7 100644 +--- a/a/src/CMakeLists.txt ++++ b/b/src/CMakeLists.txt +@@ -214,9 +214,7 @@ if(WITH_ZLIB) + endif() + + if(WITH_ZSTD) +- target_link_libraries(rdkafka PRIVATE ${ZSTD_LIBRARY}) +- target_include_directories(rdkafka PRIVATE ${ZSTD_INCLUDE_DIR}) +- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") ++ target_link_libraries(rdkafka PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + if(WITH_SSL) +@@ -256,7 +254,7 @@ endif() + + if(WITH_LZ4_EXT) + target_include_directories(rdkafka PRIVATE ${LZ4_INCLUDE_DIRS}) +- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) ++ target_link_libraries(rdkafka PUBLIC lz4::lz4) + endif() + + if(WIN32) diff --git a/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-3-0.patch b/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-3-0.patch new file mode 100644 index 0000000..169e5bb --- /dev/null +++ b/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-3-0.patch @@ -0,0 +1,24 @@ +iff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index cbcff50..38ad38e 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -215,9 +215,7 @@ if(WITH_ZLIB) + endif() + + if(WITH_ZSTD) +- target_link_libraries(rdkafka PRIVATE ${ZSTD_LIBRARY}) +- target_include_directories(rdkafka PRIVATE ${ZSTD_INCLUDE_DIR}) +- message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") ++ target_link_libraries(rdkafka PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + if(WITH_SSL) +@@ -257,7 +255,7 @@ endif() + + if(WITH_LZ4_EXT) + target_include_directories(rdkafka PRIVATE ${LZ4_INCLUDE_DIRS}) +- target_link_libraries(rdkafka PUBLIC LZ4::LZ4) ++ target_link_libraries(rdkafka PUBLIC lz4::lz4) + endif() + + if(WIN32) diff --git a/librdkafka/all/test_package/CMakeLists.txt b/librdkafka/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..636b897 --- /dev/null +++ b/librdkafka/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C CXX) + +find_package(RdKafka REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE RdKafka::rdkafka) + +add_executable(${PROJECT_NAME}_cpp test_package.cpp) +target_link_libraries(${PROJECT_NAME}_cpp PRIVATE RdKafka::rdkafka++) diff --git a/librdkafka/all/test_package/conanfile.py b/librdkafka/all/test_package/conanfile.py new file mode 100644 index 0000000..6b68cbd --- /dev/null +++ b/librdkafka/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + self.run(bin_path, env="conanrun") diff --git a/librdkafka/all/test_package/test_package.c b/librdkafka/all/test_package/test_package.c new file mode 100644 index 0000000..9670aa9 --- /dev/null +++ b/librdkafka/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char const *argv[]) { + rd_kafka_conf_t *conf = rd_kafka_conf_new(); + + printf("\n"); + printf("----------------->Tests are done.<---------------------\n"); + printf("Using version (from C lib) %s\n", rd_kafka_version_str()); + printf("///////////////////////////////////////////////////////\n"); + return 0; +} diff --git a/librdkafka/all/test_package/test_package.cpp b/librdkafka/all/test_package/test_package.cpp new file mode 100644 index 0000000..d1ea076 --- /dev/null +++ b/librdkafka/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char const *argv[]) { + RdKafka::Conf* confpp = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL); + + std::cout << std::endl + << "----------------->Tests are done.<---------------------" << std::endl + << "Using version (from C++ lib) " << RdKafka::version() << std::endl + << "///////////////////////////////////////////////////////" << std::endl; + return 0; +} diff --git a/librdkafka/all/test_v1_package/CMakeLists.txt b/librdkafka/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/librdkafka/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/librdkafka/all/test_v1_package/conanfile.py b/librdkafka/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..2be697c --- /dev/null +++ b/librdkafka/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + bin_path = os.path.join("bin", "test_package_cpp") + self.run(bin_path, run_environment=True) diff --git a/librdkafka/config.yml b/librdkafka/config.yml new file mode 100644 index 0000000..d9d5e85 --- /dev/null +++ b/librdkafka/config.yml @@ -0,0 +1,11 @@ +versions: + "2.4.0": + folder: all + "2.3.0": + folder: all + "2.2.0": + folder: all + "2.0.2": + folder: all + "1.9.2": + folder: all diff --git a/libsodium/all/conandata.yml b/libsodium/all/conandata.yml new file mode 100644 index 0000000..c399471 --- /dev/null +++ b/libsodium/all/conandata.yml @@ -0,0 +1,21 @@ +# To update the version on CCI, add a new cci.date entry from the stable branch: +# https://github.com/jedisct1/libsodium/commits/stable +sources: + "1.0.19": + url: "https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19.tar.gz" + sha256: "018d79fe0a045cca07331d37bd0cb57b2e838c51bc48fd837a1472e50068bbea" + "1.0.18": + url: "https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18.tar.gz" + sha256: "6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1" + "cci.20220430": + url: "https://github.com/jedisct1/libsodium/archive/78b6f57493a02a70fca44e5ef3f9d7d1cae9029f.tar.gz" + sha256: "5274b09894c0a7d6676325277cb2e278f45e1e5e077bae4bd8778aba4d6d40da" +patches: + "1.0.18": + - patch_file: "patches/0001-1.0.18-msvc_props.patch" + patch_type: "portability" + patch_description: "Switch MSVC to use PDB" + "cci.20220430": + - patch_file: "patches/0001-1.0.18-msvc_props.patch" + patch_type: "portability" + patch_description: "Switch MSVC to use PDB" diff --git a/libsodium/all/conanfile.py b/libsodium/all/conanfile.py new file mode 100644 index 0000000..f895ac1 --- /dev/null +++ b/libsodium/all/conanfile.py @@ -0,0 +1,189 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, MSBuild, MSBuildToolchain +import os + +required_conan_version = ">=1.54.0" + + +class LibsodiumConan(ConanFile): + name = "libsodium" + description = "A modern and easy-to-use crypto library." + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://doc.libsodium.org/" + topics = "encryption", "signature", "hashing" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_soname": [True, False], + "PIE": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_soname": True, + "PIE": False, + } + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Cannot build shared libsodium libraries with static runtime") + + def build_requirements(self): + if not is_msvc(self): + if self._is_mingw: + self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = "{}{}".format( + "Debug" if self.settings.build_type == "Debug" else "Release", + "DLL" if self.options.shared else "LIB", + ) + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.append("--enable-soname-versions={}".format(yes_no(self.options.use_soname))) + tc.configure_args.append("--enable-pie={}".format(yes_no(self.options.PIE))) + if self._is_mingw: + tc.extra_ldflags.append("-lssp") + if self.settings.os == "Emscripten": + # FIXME: this is an old comment/test, has not been re-tested with conan2 upgrade + self.output.warn("os=Emscripten is not tested/supported by this recipe") + # FIXME: ./dist-build/emscripten.sh does not respect options of this recipe + tc.generate() + + @property + def _msvc_sln_folder(self): + sln_folders = { + "Visual Studio": { + "10": "vs2010", + "11": "vs2012", + "12": "vs2013", + "14": "vs2015", + "15": "vs2017", + "16": "vs2019", + }, + "msvc": { + "170": "vs2012", + "180": "vs2013", + "190": "vs2015", + "191": "vs2017", + "192": "vs2019", + }, + } + default_folder = "vs2019" + if self.version != "1.0.18": + sln_folders["Visual Studio"]["17"] = "vs2022" + sln_folders["msvc"]["193"] = "vs2022" + default_folder = "vs2022" + + return sln_folders.get(str(self.settings.compiler), {}).get(str(self.settings.compiler.version), default_folder) + + def _build_msvc(self): + msvc_sln_folder = os.path.join(self.source_folder, "builds", "msvc", self._msvc_sln_folder) + + #============================== + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + if self.version == "1.0.18" and self._msvc_sln_folder == "vs2019": + toolset = MSBuildToolchain(self).toolset + replace_in_file( + self, os.path.join(msvc_sln_folder, "libsodium", "libsodium.vcxproj"), + "v142", + f"{toolset}", + ) + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + replace_in_file( + self, os.path.join(msvc_sln_folder, "libsodium", "libsodium.vcxproj"), + "", + f"", + ) + #============================== + + msbuild = MSBuild(self) + msbuild.build_type = "{}{}".format( + "Dyn" if self.options.shared else "Static", + "Debug" if self.settings.build_type == "Debug" else "Release", + ) + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(os.path.join(msvc_sln_folder, "libsodium.sln")) + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + self._build_msvc() + else: + autotools = Autotools(self) + if self._is_mingw: + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "*LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + output_dir = os.path.join(self.source_folder, "bin") + copy(self, "*.lib", src=output_dir, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=output_dir, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + inc_src = os.path.join(self.source_folder, "src", "libsodium", "include") + copy(self, "*.h", src=inc_src, dst=os.path.join(self.package_folder, "include"), excludes=("*/private/*")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libsodium") + self.cpp_info.libs = ["{}sodium".format("lib" if is_msvc(self) else "")] + if not self.options.shared: + self.cpp_info.defines = ["SODIUM_STATIC"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs.append("pthread") + if self._is_mingw: + self.cpp_info.system_libs.append("ssp") diff --git a/libsodium/all/patches/0001-1.0.18-msvc_props.patch b/libsodium/all/patches/0001-1.0.18-msvc_props.patch new file mode 100644 index 0000000..9475c86 --- /dev/null +++ b/libsodium/all/patches/0001-1.0.18-msvc_props.patch @@ -0,0 +1,38 @@ +diff --git a/builds/msvc/properties/DebugLIB.props b/builds/msvc/properties/DebugLIB.props +index c5f10128..86eb0449 100644 +--- a/builds/msvc/properties/DebugLIB.props ++++ b/builds/msvc/properties/DebugLIB.props +@@ -12,10 +12,10 @@ + + + +- OldStyle ++ ProgramDatabase + MultiThreadedDebug + true + + + +- +\ No newline at end of file ++ +diff --git a/builds/msvc/properties/Release.props b/builds/msvc/properties/Release.props +index 1c5415bc..1f754ca5 100644 +--- a/builds/msvc/properties/Release.props ++++ b/builds/msvc/properties/Release.props +@@ -14,7 +14,7 @@ + + + /Oy- %(AdditionalOptions) +- ++ ProgramDatabase + true + true + OnlyExplicitInline +@@ -38,4 +38,4 @@ + + + +- +\ No newline at end of file ++ diff --git a/libsodium/all/test_package/CMakeLists.txt b/libsodium/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..ffb72d7 --- /dev/null +++ b/libsodium/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libsodium REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libsodium::libsodium) diff --git a/libsodium/all/test_package/conanfile.py b/libsodium/all/test_package/conanfile.py new file mode 100644 index 0000000..e845ae7 --- /dev/null +++ b/libsodium/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/libsodium/all/test_package/test_package.c b/libsodium/all/test_package/test_package.c new file mode 100644 index 0000000..3db01e0 --- /dev/null +++ b/libsodium/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include +#include + +int main() { + printf("************* Testing libsodium ***************\n"); + if (sodium_init() == -1) { + printf("\tFAIL\n"); + return 1; + } + printf("\tOK\n"); + printf("***********************************************\n"); + return 0; +} diff --git a/libsodium/all/test_v1_package/CMakeLists.txt b/libsodium/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/libsodium/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/libsodium/all/test_v1_package/conanfile.py b/libsodium/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/libsodium/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/libsodium/config.yml b/libsodium/config.yml new file mode 100644 index 0000000..4dfbbb5 --- /dev/null +++ b/libsodium/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.19": + folder: all + "1.0.18": + folder: all + "cci.20220430": + folder: all diff --git a/libtool/all/conandata.yml b/libtool/all/conandata.yml new file mode 100644 index 0000000..fb9d7ca --- /dev/null +++ b/libtool/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2.4.7": + url: "https://ftp.gnu.org/gnu/libtool/libtool-2.4.7.tar.gz" + sha256: "04e96c2404ea70c590c546eba4202a4e12722c640016c12b9b2f1ce3d481e9a8" + "2.4.6": + url: "https://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz" + sha256: "e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3" +patches: + "2.4.7": + - patch_file: "patches/2.4.7-0001-libtool-relocatable.patch" + patch_description: "Make libtool relocatable" + patch_type: "portability" + "2.4.6": + - patch_file: "patches/2.4.6-0001-libtool-relocatable.patch" + patch_description: "Make libtool relocatable" + patch_type: "portability" + - patch_file: "patches/2.4.6-0002-libtool-fix-type-libtool.patch" + patch_description: "Fix type libtool" + patch_type: "portability" diff --git a/libtool/all/conanfile.py b/libtool/all/conanfile.py new file mode 100644 index 0000000..ff73256 --- /dev/null +++ b/libtool/all/conanfile.py @@ -0,0 +1,245 @@ +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rename, replace_in_file, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path_package_info_legacy + +import os +import re +import shutil + +required_conan_version = ">=1.60.0 <2 || >=2.0.5" + + +class LibtoolConan(ConanFile): + name = "libtool" + # most common use is as "application", but library traits + # are a superset of application so this should cover all cases + package_type = "library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/libtool/" + description = "GNU libtool is a generic library support script. " + topics = ("configure", "library", "shared", "static") + license = ("GPL-2.0-or-later", "GPL-3.0-or-later") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _has_dual_profiles(self): + return hasattr(self, "settings_build") + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("automake/1.16.5") + + #TODO: consider adding m4 as direct dependency, perhaps when we start using version ranges. + # https://github.com/conan-io/conan-center-index/pull/16248#discussion_r1116332095 + #self.requires("m4/1.4.19") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._has_dual_profiles: + self.tool_requires("automake/") + self.tool_requires("m4/1.4.19") # Needed by configure + + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _datarootdir(self): + return os.path.join(self.package_folder, "res") + + def generate(self): + VirtualBuildEnv(self).generate() + if not self._has_dual_profiles: + VirtualRunEnv(self).generate(scope="build") + + if is_msvc(self): + # __VSCMD_ARG_NO_LOGO: this test_package has too many invocations, + # this avoids printing the logo everywhere + # VSCMD_SKIP_SENDTELEMETRY: avoid the telemetry process holding onto the directory + # unnecessarily + env = Environment() + env.define("__VSCMD_ARG_NO_LOGO", "1") + env.define("VSCMD_SKIP_SENDTELEMETRY", "1") + env.vars(self, scope="build").save_script("conanbuild_vcvars_options.bat") + + tc = AutotoolsToolchain(self) + + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + + tc.configure_args.extend([ + "--datarootdir=${prefix}/res", + "--enable-shared", + "--enable-static", + "--enable-ltdl-install", + ]) + + env = tc.environment() + if is_msvc(self): + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + + # Disable Fortran detection to handle issue with VS 2022 + # See: https://savannah.gnu.org/patch/?9313#comment1 + # In the future this could be removed if a new version fixes this + # upstream + env.define("F77", "no") + env.define("FC", "no") + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + config_guess = self.dependencies.build["gnu-config"].conf_info.get("user.gnu-config:config_guess") + config_sub = self.dependencies.build["gnu-config"].conf_info.get("user.gnu-config:config_sub") + shutil.copy(config_sub, os.path.join(self.source_folder, "build-aux", "config.sub")) + shutil.copy(config_guess, os.path.join(self.source_folder, "build-aux", "config.guess")) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + @property + def _shared_ext(self): + if self.settings.os == "Windows": + return "dll" + elif is_apple_os(self): + return "dylib" + else: + return "so" + + @property + def _static_ext(self): + if is_msvc(self): + return "lib" + else: + return "a" + + def _rm_binlib_files_containing(self, ext_inclusive, ext_exclusive=None): + regex_in = re.compile(r".*\.({})($|\..*)".format(ext_inclusive)) + if ext_exclusive: + regex_out = re.compile(r".*\.({})($|\..*)".format(ext_exclusive)) + else: + regex_out = re.compile("^$") + for directory in ( + os.path.join(self.package_folder, "bin"), + os.path.join(self.package_folder, "lib"), + ): + for file in os.listdir(directory): + if regex_in.match(file) and not regex_out.match(file): + os.unlink(os.path.join(directory, file)) + + def package(self): + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + fix_apple_shared_install_name(self) + + rmdir(self, os.path.join(self._datarootdir, "info")) + rmdir(self, os.path.join(self._datarootdir, "man")) + + os.unlink(os.path.join(self.package_folder, "lib", "libltdl.la")) + if self.options.shared: + self._rm_binlib_files_containing(self._static_ext, self._shared_ext) + else: + self._rm_binlib_files_containing(self._shared_ext) + + files = ( + os.path.join(self.package_folder, "bin", "libtool"), + os.path.join(self.package_folder, "bin", "libtoolize"), + ) + replaces = { + "GREP": "/usr/bin/env grep", + "EGREP": "/usr/bin/env grep -E", + "FGREP": "/usr/bin/env grep -F", + "SED": "/usr/bin/env sed", + } + for file in files: + contents = open(file).read() + for key, repl in replaces.items(): + contents, nb1 = re.subn("^{}=\"[^\"]*\"".format(key), "{}=\"{}\"".format(key, repl), contents, flags=re.MULTILINE) + contents, nb2 = re.subn("^: \\$\\{{{}=\"[^$\"]*\"\\}}".format(key), ": ${{{}=\"{}\"}}".format(key, repl), contents, flags=re.MULTILINE) + if nb1 + nb2 == 0: + raise ConanException("Failed to find {} in {}".format(key, repl)) + open(file, "w").write(contents) + + binpath = os.path.join(self.package_folder, "bin") + if self.settings.os == "Windows": + rename(self, os.path.join(binpath, "libtoolize"), + os.path.join(binpath, "libtoolize.exe")) + rename(self, os.path.join(binpath, "libtool"), + os.path.join(binpath, "libtool.exe")) + + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "ltdl.dll.lib"), + os.path.join(self.package_folder, "lib", "ltdl.lib")) + + # allow libtool to link static libs into shared for more platforms + libtool_m4 = os.path.join(self._datarootdir, "aclocal", "libtool.m4") + method_pass_all = "lt_cv_deplibs_check_method=pass_all" + replace_in_file(self, libtool_m4, + "lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'", + method_pass_all) + replace_in_file(self, libtool_m4, + "lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'", + method_pass_all) + + def package_info(self): + self.cpp_info.libs = ["ltdl"] + + if self.options.shared: + if self.settings.os == "Windows": + self.cpp_info.defines = ["LIBLTDL_DLL_IMPORT"] + else: + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["dl"] + + # Define environment variables such that libtool m4 files are seen by Automake + libtool_aclocal_dir = os.path.join(self._datarootdir, "aclocal") + + self.buildenv_info.append_path("ACLOCAL_PATH", libtool_aclocal_dir) + self.buildenv_info.append_path("AUTOMAKE_CONAN_INCLUDES", libtool_aclocal_dir) + self.runenv_info.append_path("ACLOCAL_PATH", libtool_aclocal_dir) + self.runenv_info.append_path("AUTOMAKE_CONAN_INCLUDES", libtool_aclocal_dir) + + # For Conan 1.x downstream consumers, can be removed once recipe is Conan 1.x only: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.ACLOCAL_PATH.append(unix_path_package_info_legacy(self, libtool_aclocal_dir)) + self.env_info.AUTOMAKE_CONAN_INCLUDES.append(unix_path_package_info_legacy(self, libtool_aclocal_dir)) diff --git a/libtool/all/patches/2.4.6-0001-libtool-relocatable.patch b/libtool/all/patches/2.4.6-0001-libtool-relocatable.patch new file mode 100644 index 0000000..de3326e --- /dev/null +++ b/libtool/all/patches/2.4.6-0001-libtool-relocatable.patch @@ -0,0 +1,41 @@ +diff --git a/Makefile.in b/Makefile.in +index 178bdec..6f1062c 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -2324,10 +2324,10 @@ $(notes_txt): $(notes_texi) + # files created in the build tree, so instead we regenerate the + # manual pages if the sources for the build-tree files we want to + # run have changed. +-$(libtool_1): $(ltmain_sh) +- $(AM_V_GEN)$(update_mans) --help-option=--help-all libtool +-$(libtoolize_1): $(libtoolize_in) +- $(AM_V_GEN)$(update_mans) libtoolize ++#$(libtool_1): $(ltmain_sh) ++# $(AM_V_GEN)$(update_mans) --help-option=--help-all libtool ++#$(libtoolize_1): $(libtoolize_in) ++# $(AM_V_GEN)$(update_mans) libtoolize + + install-data-local: $(lt_Makefile_in) install-scripts-local + @$(NORMAL_INSTALL) +diff --git a/libtoolize.in b/libtoolize.in +index 798bd0a..bdd3d88 100644 +--- a/libtoolize.in ++++ b/libtoolize.in +@@ -1901,11 +1901,12 @@ func_require_seen_libtool () + pkgmacro_files="@pkgmacro_files@" + + # Locations for important files: +- prefix="@prefix@" +- datadir="@datadir@" +- pkgauxdir="@pkgauxdir@" +- pkgltdldir="@pkgdatadir@" +- aclocaldir="@aclocaldir@" ++ scriptdir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) ++ prefix="$scriptdir/.." ++ datadir="$scriptdir/../res" ++ pkgauxdir="$scriptdir/../res/libtool/build-aux" ++ pkgltdldir="$scriptdir/../res/libtool" ++ aclocaldir="$scriptdir/../res/aclocal" + + # Allow the user to override the master libtoolize repository: + if test -n "$_lt_pkgdatadir"; then diff --git a/libtool/all/patches/2.4.6-0002-libtool-fix-type-libtool.patch b/libtool/all/patches/2.4.6-0002-libtool-fix-type-libtool.patch new file mode 100644 index 0000000..992c311 --- /dev/null +++ b/libtool/all/patches/2.4.6-0002-libtool-fix-type-libtool.patch @@ -0,0 +1,22 @@ +--- build-aux/ltmain.in ++++ build-aux/ltmain.in +@@ -212,7 +212,7 @@ + # a configuration failure hint, and exit. + func_fatal_configuration () + { +- func__fatal_error ${1+"$@"} \ ++ func_fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." + } +--- build-aux/ltmain.sh ++++ build-aux/ltmain.sh +@@ -2124,7 +2124,7 @@ + # a configuration failure hint, and exit. + func_fatal_configuration () + { +- func__fatal_error ${1+"$@"} \ ++ func_fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." + } diff --git a/libtool/all/patches/2.4.7-0001-libtool-relocatable.patch b/libtool/all/patches/2.4.7-0001-libtool-relocatable.patch new file mode 100644 index 0000000..0d9cf85 --- /dev/null +++ b/libtool/all/patches/2.4.7-0001-libtool-relocatable.patch @@ -0,0 +1,41 @@ +diff --git a/Makefile.in b/Makefile.in +index 29db7be..3046cdf 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -2423,10 +2423,10 @@ $(notes_txt): $(notes_texi) + # files created in the build tree, so instead we regenerate the + # manual pages if the sources for the build-tree files we want to + # run have changed. +-$(libtool_1): $(ltmain_sh) +- $(AM_V_GEN)$(update_mans) --help-option=--help-all libtool +-$(libtoolize_1): $(libtoolize_in) +- $(AM_V_GEN)$(update_mans) libtoolize ++#$(libtool_1): $(ltmain_sh) ++# $(AM_V_GEN)$(update_mans) --help-option=--help-all libtool ++#$(libtoolize_1): $(libtoolize_in) ++# $(AM_V_GEN)$(update_mans) libtoolize + + install-data-local: $(lt_Makefile_in) install-scripts-local + @$(NORMAL_INSTALL) +diff --git a/libtoolize.in b/libtoolize.in +index 0c40fed..e82e467 100644 +--- a/libtoolize.in ++++ b/libtoolize.in +@@ -1903,11 +1903,12 @@ func_require_seen_libtool () + pkgmacro_files="@pkgmacro_files@" + + # Locations for important files: +- prefix="@prefix@" +- datadir="@datadir@" +- pkgauxdir="@pkgauxdir@" +- pkgltdldir="@pkgdatadir@" +- aclocaldir="@aclocaldir@" ++ scriptdir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) ++ prefix="$scriptdir/.." ++ datadir="$scriptdir/../res" ++ pkgauxdir="$scriptdir/../res/libtool/build-aux" ++ pkgltdldir="$scriptdir/../res/libtool" ++ aclocaldir="$scriptdir/../res/aclocal" + + # Allow the user to override the master libtoolize repository: + if test -n "$_lt_pkgdatadir"; then diff --git a/libtool/all/test_package/autotools/Makefile.am b/libtool/all/test_package/autotools/Makefile.am new file mode 100644 index 0000000..aae3d30 --- /dev/null +++ b/libtool/all/test_package/autotools/Makefile.am @@ -0,0 +1,13 @@ +# @configure_input@ + +bin_PROGRAMS = test_package +lib_LTLIBRARIES = libtestlib.la + +test_package_SOURCES = test_package.c +test_package_LDADD = libtestlib.la + +libtestlib_la_SOURCES = lib.c +libtestlib_la_LDFLAGS = -no-undefined -export-symbols "$(srcdir)/libtestlib.sym" +include_HEADERS = lib.h + +# ACLOCAL_AMFLAGS = -I m4 diff --git a/libtool/all/test_package/autotools/configure.ac b/libtool/all/test_package/autotools/configure.ac new file mode 100644 index 0000000..e56278b --- /dev/null +++ b/libtool/all/test_package/autotools/configure.ac @@ -0,0 +1,41 @@ +AC_PREREQ(2.69) +# Must init the autoconf setup +# The first parameter is project name +# second is version number +# third is bug report address +AC_INIT([test_package], [1.0]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package.c]) + +# Store the auxiliary build tools (e.g., install-sh, config.sub, config.guess) +# in this dir (build-aux) +AC_CONFIG_AUX_DIR([build-aux]) +# AC_CONFIG_MACRO_DIRS([m4]) + +# Init automake, and specify this program use relaxed structures. +# i.e. this program doesn't follow the gnu coding standards, and doesn't have +# ChangeLog, COPYING, AUTHORS, INSTALL, README etc. files. +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Check for CC and CXX compiler +AC_PROG_CC +AC_PROG_CXX + +# Check for archiver +AM_PROG_AR + +LT_PREREQ([2.4.6]) +LT_INIT([win32-dll]) + +AC_SEARCH_LIBS([sqrt], [m]) + +## We can add more checks in this section +# +## Tells automake to create a Makefile +## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html +AC_CONFIG_FILES([Makefile]) + +## Generate the output +AC_CONFIG_HEADERS([config.h]) +AC_OUTPUT diff --git a/libtool/all/test_package/autotools/lib.c b/libtool/all/test_package/autotools/lib.c new file mode 100644 index 0000000..a633fac --- /dev/null +++ b/libtool/all/test_package/autotools/lib.c @@ -0,0 +1,11 @@ +#include "testlib_private.h" + +#include +#include + +double my_function(double val) { + fprintf(stderr, "inside my_function(%e)\n", val); + return sqrt(val); +} + +TESTLIB_API const int libtestlib_value = 42; diff --git a/libtool/all/test_package/autotools/lib.h b/libtool/all/test_package/autotools/lib.h new file mode 100644 index 0000000..170f967 --- /dev/null +++ b/libtool/all/test_package/autotools/lib.h @@ -0,0 +1,34 @@ +#ifndef TESTLIB_LIB_H +#define TESTLIB_LIB_H + +#if defined(_WIN32) +# define TESTLIB_IMPORT_SHARED __declspec(dllimport) +# define TESTLIB_EXPORT_SHARED __declspec(dllexport) +# define TESTLIB_IMPORT_STATIC +# define TESTLIB_EXPORT_STATIC +#else +# define TESTLIB_IMPORT_SHARED +# define TESTLIB_EXPORT_SHARED +# define TESTLIB_IMPORT_STATIC +# define TESTLIB_EXPORT_STATIC +#endif + +#if defined(LIBTEST_BUILDING) +# define TESTLIB_SHARED TESTLIB_EXPORT_SHARED +# define TESTLIB_STATIC TESTLIB_EXPORT_STATIC +#else +# define TESTLIB_SHARED TESTLIB_IMPORT_SHARED +# define TESTLIB_STATIC TESTLIB_IMPORT_STATIC +#endif + +#if defined(LIBHELLO_STATIC) +# define TESTLIB_API TESTLIB_STATIC +#else +# define TESTLIB_API TESTLIB_SHARED +#endif + +double my_function(double); + +extern TESTLIB_API const int libtestlib_value; + +#endif // TESTLIB_LIB_H diff --git a/libtool/all/test_package/autotools/libtestlib.sym b/libtool/all/test_package/autotools/libtestlib.sym new file mode 100644 index 0000000..8464fb1 --- /dev/null +++ b/libtool/all/test_package/autotools/libtestlib.sym @@ -0,0 +1,2 @@ +my_function +libtestlib_value diff --git a/libtool/all/test_package/autotools/test_package.c b/libtool/all/test_package/autotools/test_package.c new file mode 100644 index 0000000..4fd8442 --- /dev/null +++ b/libtool/all/test_package/autotools/test_package.c @@ -0,0 +1,11 @@ +#include "lib.h" + +#include + +int main(int argc, char * argv[]) +{ + double res = my_function(1.44); + printf("Result is %e\n", res); + printf("The secret value is %d\n", libtestlib_value); + return 0; +} diff --git a/libtool/all/test_package/autotools/testlib_private.h b/libtool/all/test_package/autotools/testlib_private.h new file mode 100644 index 0000000..81831ae --- /dev/null +++ b/libtool/all/test_package/autotools/testlib_private.h @@ -0,0 +1,8 @@ +#ifndef TESTLIB_PRIVATE_H +#define TESTLIB_PRIVATE_H + +#define LIBTEST_BUILDING + +#include "lib.h" + +#endif // TESTLIB_PRIVATE_H diff --git a/libtool/all/test_package/conanfile.py b/libtool/all/test_package/conanfile.py new file mode 100644 index 0000000..fa6b79d --- /dev/null +++ b/libtool/all/test_package/conanfile.py @@ -0,0 +1,199 @@ +from conan import ConanFile +from conan.tools.build import cross_building, can_run +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import chdir, mkdir, rmdir +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake +from conan.tools.layout import basic_layout +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.apple import is_apple_os + +import glob +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + short_paths = True + win_bash = True # This assignment must be *here* to avoid "Cannot wrap command with different envs." in Conan 1.x + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) # Since we are testing libltdl as well + + def build_requirements(self): + if hasattr(self, "settings_build") and not cross_building(self): + self.tool_requires(self.tested_reference_str) # We are testing libtool/libtoolize + + self.tool_requires("autoconf/2.71") + self.tool_requires("automake/1.16.5") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + @property + def autotools_package_folder(self): + return os.path.join(self.build_folder, "pkg_autotools") + + @property + def sis_package_folder(self): + return os.path.join(self.build_folder, "pkg_sis") + + def generate(self): + if is_msvc(self): + # __VSCMD_ARG_NO_LOGO: this test_package has too many invocations, + # this avoids printing the logo everywhere + # VSCMD_SKIP_SENDTELEMETRY: avoid the telemetry process holding onto the directory + # unnecessarily + env = Environment() + env.define("__VSCMD_ARG_NO_LOGO", "1") + env.define("VSCMD_SKIP_SENDTELEMETRY", "1") + env.vars(self, scope="build").save_script("conanbuild_vcvars_options.bat") + + # Use two instances of AutotoolsToolchain with namespaceas, + # as we have two different projects with different settings. + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper", check_type=str)) + msvc_vars = { + "CC": "cl -nologo", + "CXX": "cl -nologo", + "AR": f"{ar_wrapper} lib", + "LD": "link" + } + + # "Autotools" subfolder: project to test integration of Autotools with libtool + # at build time + tc = AutotoolsToolchain(self, namespace="autotools") + env = tc.environment() + if is_msvc(self): + for key, value in msvc_vars.items(): + env.append(key, value) + tc.generate(env) + + # "sis" subfder: project to test building shared library using libtool + # while linking to a static library + tc = AutotoolsToolchain(self, namespace="sis") + tc.configure_args.extend(["--enable-shared", "--disable-static"]) + lib_folder = unix_path(self, os.path.join(self.sis_package_folder, "lib")) + tc.extra_ldflags.append(f"-L{lib_folder}") + env = tc.environment() + if is_msvc(self): + for key, value in msvc_vars.items(): + env.append(key, value) + tc.generate(env) + + # Note: Using AutotoolsDeps causes errors on Windows when configure tries to determine compiler + # because injected values for environment variables CPPFLAGS and LDFLAGS that are not + # interpreted correctly + if is_msvc(self): + # Use NMake to workaround bug in MSBuild versions prior to 2022 that shows up as: + # error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item + # has already been added. Key in dictionary: 'tmp' Key being added: 'TMP' + self.conf.define("tools.cmake.cmaketoolchain:generator", "NMake Makefiles") + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + buildenv = VirtualBuildEnv(self) + buildenv.generate() + + env = Environment() + for var in ["DYLD_LIBRARY_PATH", "LD_LIBRARY_PATH"]: + env.append_path(var, os.path.join(self.autotools_package_folder, "lib")) + env.vars(self, scope="run").save_script("conanrun_libtool_testpackage") + + runenv = VirtualRunEnv(self) + runenv.generate() + + + def _build_autotools(self): + """ Test autotools integration """ + # Copy autotools directory to build folder + autotools_build_folder = os.path.join(self.build_folder, "autotools") + rmdir(self, autotools_build_folder) + shutil.copytree(os.path.join(self.source_folder, "autotools"), autotools_build_folder) + with chdir(self, "autotools"): + self.run("autoreconf --install --verbose --force -Wall") + + mkdir(self, self.autotools_package_folder) + with chdir(self, autotools_build_folder): + autotools = Autotools(self, namespace="autotools") + autotools.configure(build_script_folder=autotools_build_folder) + autotools.make(args=["V=1"]) + autotools.install(args=[f'DESTDIR={unix_path(self, self.autotools_package_folder)}']) + + def _test_autotools(self): + assert os.path.isdir(os.path.join(self.autotools_package_folder, "bin")) + assert os.path.isfile(os.path.join(self.autotools_package_folder, "include", "lib.h")) + assert os.path.isdir(os.path.join(self.autotools_package_folder, "lib")) + + if can_run(self): + self.run(f'{unix_path(self, os.path.join(self.autotools_package_folder, "bin", "test_package"))}', env="conanrun") + + def _build_ltdl(self): + """ Build library using ltdl library """ + cmake = CMake(self) + cmake.configure(build_script_folder="ltdl") + cmake.build() + + def _test_ltdl(self): + """ Test library using ltdl library""" + lib_prefix = "lib" if self.settings.os != "Windows" else "" + lib_extension = "dll" if self.settings.os == "Windows" else "so" + + if can_run(self): + bin_executable = unix_path(self, os.path.join(self.cpp.build.bindirs[0], "test_package")) + lib_path = unix_path(self, os.path.join(self.cpp.build.libdirs[0], f'{lib_prefix}liba.{lib_extension}')) + self.run(f'{bin_executable} {lib_path}', env="conanrun") + + def _build_static_lib_in_shared(self): + """ Build shared library using libtool (while linking to a static library) """ + + # Copy static-in-shared directory to build folder + autotools_sis_folder = os.path.join(self.build_folder, "sis") + rmdir(self, autotools_sis_folder) + shutil.copytree(os.path.join(self.source_folder, "sis"), autotools_sis_folder) + + # Build static library using CMake and install into a folder inside the build folder + cmake = CMake(self) + cmake.configure(build_script_folder="ltdl") + cmake.build(target="static_lib") + install_prefix = unix_path(self, self.sis_package_folder) + self.run(f"cmake --install . --config {self.settings.build_type} --prefix {install_prefix} --component static_lib") + + with chdir(self, autotools_sis_folder): + self.run("autoreconf --install --verbose --force -Wall") + autotools = Autotools(self, namespace="sis") + autotools.configure(build_script_folder=autotools_sis_folder) + autotools.install(args=[f"DESTDIR={unix_path(self, self.sis_package_folder)}"]) + + def _test_static_lib_in_shared(self): + """ Test existence of shared library """ + with chdir(self, self.sis_package_folder): + if self.settings.os == "Windows": + assert len(list(glob.glob(os.path.join("bin", "*.dll")))) > 0 + elif is_apple_os(self): + assert len(list(glob.glob(os.path.join("lib", "*.dylib")))) > 0 + else: + assert len(list(glob.glob(os.path.join("lib", "*.so")))) > 0 + + def build(self): + self._build_ltdl() + if not cross_building(self): + self._build_autotools() + self._build_static_lib_in_shared() + + def test(self): + if can_run(self): + self._test_ltdl() + self._test_autotools() + self._test_static_lib_in_shared() diff --git a/libtool/all/test_package/ltdl/CMakeLists.txt b/libtool/all/test_package/ltdl/CMakeLists.txt new file mode 100644 index 0000000..e15a97d --- /dev/null +++ b/libtool/all/test_package/ltdl/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 2.8.12) +project(test_package) + +find_package(libtool REQUIRED CONFIG) + +include(GenerateExportHeader) + +add_library(liba MODULE liba.c) +generate_export_header(liba) +target_include_directories(liba + PUBLIC $ +) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libtool::libtool) + +add_library(static_lib STATIC + static_lib.c +) + +install(TARGETS static_lib + LIBRARY + DESTINATION lib + COMPONENT static_lib + ARCHIVE + DESTINATION lib + COMPONENT static_lib) diff --git a/libtool/all/test_package/ltdl/liba.c b/libtool/all/test_package/ltdl/liba.c new file mode 100644 index 0000000..7909038 --- /dev/null +++ b/libtool/all/test_package/ltdl/liba.c @@ -0,0 +1,6 @@ +#include "liba_export.h" + +LIBA_EXPORT +int liba_function(int arg) { + return 2 * arg; +} diff --git a/libtool/all/test_package/ltdl/static_lib.c b/libtool/all/test_package/ltdl/static_lib.c new file mode 100644 index 0000000..2ebed9d --- /dev/null +++ b/libtool/all/test_package/ltdl/static_lib.c @@ -0,0 +1,4 @@ +int +static_function(int arg) { + return arg + 42; +} diff --git a/libtool/all/test_package/ltdl/test_package.c b/libtool/all/test_package/ltdl/test_package.c new file mode 100644 index 0000000..51329f4 --- /dev/null +++ b/libtool/all/test_package/ltdl/test_package.c @@ -0,0 +1,36 @@ +#include "ltdl.h" + +#include +#include + +typedef int (*liba_func_t)(int); + +int main(int argc, char **argv) +{ + if (argc < 2) { + fprintf(stderr, "Need an argument\n"); + return EXIT_FAILURE; + } + const char* libname = argv[1]; + lt_dlinit(); + + fprintf(stderr, "lt_dlopenext(\"%s\")\n", libname); + lt_dlhandle ltdl_liba = lt_dlopenext(libname); + if (!ltdl_liba) { + fprintf(stderr, "lt_dlopenext failed.\n"); + return EXIT_FAILURE; + } + + liba_func_t liba_func = (liba_func_t) lt_dlsym(ltdl_liba, "liba_function"); + int res = liba_func(21); + printf("Result is %d\n", res); + if (res != 42) { + fprintf(stderr, "Result is incorrect\n"); + return EXIT_FAILURE; + } + + lt_dlclose(ltdl_liba); + + lt_dlexit(); + return EXIT_SUCCESS; +} diff --git a/libtool/all/test_package/sis/Makefile.am b/libtool/all/test_package/sis/Makefile.am new file mode 100644 index 0000000..824106c --- /dev/null +++ b/libtool/all/test_package/sis/Makefile.am @@ -0,0 +1,8 @@ +# @configure_input@ + +lib_LTLIBRARIES = libshared.la + +libshared_la_SOURCES = shared_lib.c +libshared_la_LDFLAGS = -no-undefined -lstatic_lib + +# ACLOCAL_AMFLAGS = -I m4 diff --git a/libtool/all/test_package/sis/configure.ac b/libtool/all/test_package/sis/configure.ac new file mode 100644 index 0000000..0272fc8 --- /dev/null +++ b/libtool/all/test_package/sis/configure.ac @@ -0,0 +1,13 @@ +AC_PREREQ(2.69) +AC_INIT([test_package], [1.0]) +AC_CONFIG_SRCDIR([shared_lib.c]) +AC_CONFIG_AUX_DIR([build-aux]) +# AC_CONFIG_MACRO_DIRS([m4]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AC_PROG_CC +AM_PROG_AR +LT_PREREQ([2.4]) +LT_INIT([win32-dll]) +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_HEADERS([config.h]) +AC_OUTPUT diff --git a/libtool/all/test_package/sis/shared.sym b/libtool/all/test_package/sis/shared.sym new file mode 100644 index 0000000..e05e2d3 --- /dev/null +++ b/libtool/all/test_package/sis/shared.sym @@ -0,0 +1 @@ +shared_function diff --git a/libtool/all/test_package/sis/shared_lib.c b/libtool/all/test_package/sis/shared_lib.c new file mode 100644 index 0000000..b92cbe2 --- /dev/null +++ b/libtool/all/test_package/sis/shared_lib.c @@ -0,0 +1,7 @@ +int +static_function(int); + +int +shared_function(int arg) { + return static_function(arg) + 1337; +} diff --git a/libtool/all/test_v1_package/autotools/Makefile.am b/libtool/all/test_v1_package/autotools/Makefile.am new file mode 100644 index 0000000..aae3d30 --- /dev/null +++ b/libtool/all/test_v1_package/autotools/Makefile.am @@ -0,0 +1,13 @@ +# @configure_input@ + +bin_PROGRAMS = test_package +lib_LTLIBRARIES = libtestlib.la + +test_package_SOURCES = test_package.c +test_package_LDADD = libtestlib.la + +libtestlib_la_SOURCES = lib.c +libtestlib_la_LDFLAGS = -no-undefined -export-symbols "$(srcdir)/libtestlib.sym" +include_HEADERS = lib.h + +# ACLOCAL_AMFLAGS = -I m4 diff --git a/libtool/all/test_v1_package/autotools/configure.ac b/libtool/all/test_v1_package/autotools/configure.ac new file mode 100644 index 0000000..e56278b --- /dev/null +++ b/libtool/all/test_v1_package/autotools/configure.ac @@ -0,0 +1,41 @@ +AC_PREREQ(2.69) +# Must init the autoconf setup +# The first parameter is project name +# second is version number +# third is bug report address +AC_INIT([test_package], [1.0]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package.c]) + +# Store the auxiliary build tools (e.g., install-sh, config.sub, config.guess) +# in this dir (build-aux) +AC_CONFIG_AUX_DIR([build-aux]) +# AC_CONFIG_MACRO_DIRS([m4]) + +# Init automake, and specify this program use relaxed structures. +# i.e. this program doesn't follow the gnu coding standards, and doesn't have +# ChangeLog, COPYING, AUTHORS, INSTALL, README etc. files. +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Check for CC and CXX compiler +AC_PROG_CC +AC_PROG_CXX + +# Check for archiver +AM_PROG_AR + +LT_PREREQ([2.4.6]) +LT_INIT([win32-dll]) + +AC_SEARCH_LIBS([sqrt], [m]) + +## We can add more checks in this section +# +## Tells automake to create a Makefile +## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html +AC_CONFIG_FILES([Makefile]) + +## Generate the output +AC_CONFIG_HEADERS([config.h]) +AC_OUTPUT diff --git a/libtool/all/test_v1_package/autotools/lib.c b/libtool/all/test_v1_package/autotools/lib.c new file mode 100644 index 0000000..a633fac --- /dev/null +++ b/libtool/all/test_v1_package/autotools/lib.c @@ -0,0 +1,11 @@ +#include "testlib_private.h" + +#include +#include + +double my_function(double val) { + fprintf(stderr, "inside my_function(%e)\n", val); + return sqrt(val); +} + +TESTLIB_API const int libtestlib_value = 42; diff --git a/libtool/all/test_v1_package/autotools/lib.h b/libtool/all/test_v1_package/autotools/lib.h new file mode 100644 index 0000000..170f967 --- /dev/null +++ b/libtool/all/test_v1_package/autotools/lib.h @@ -0,0 +1,34 @@ +#ifndef TESTLIB_LIB_H +#define TESTLIB_LIB_H + +#if defined(_WIN32) +# define TESTLIB_IMPORT_SHARED __declspec(dllimport) +# define TESTLIB_EXPORT_SHARED __declspec(dllexport) +# define TESTLIB_IMPORT_STATIC +# define TESTLIB_EXPORT_STATIC +#else +# define TESTLIB_IMPORT_SHARED +# define TESTLIB_EXPORT_SHARED +# define TESTLIB_IMPORT_STATIC +# define TESTLIB_EXPORT_STATIC +#endif + +#if defined(LIBTEST_BUILDING) +# define TESTLIB_SHARED TESTLIB_EXPORT_SHARED +# define TESTLIB_STATIC TESTLIB_EXPORT_STATIC +#else +# define TESTLIB_SHARED TESTLIB_IMPORT_SHARED +# define TESTLIB_STATIC TESTLIB_IMPORT_STATIC +#endif + +#if defined(LIBHELLO_STATIC) +# define TESTLIB_API TESTLIB_STATIC +#else +# define TESTLIB_API TESTLIB_SHARED +#endif + +double my_function(double); + +extern TESTLIB_API const int libtestlib_value; + +#endif // TESTLIB_LIB_H diff --git a/libtool/all/test_v1_package/autotools/libtestlib.sym b/libtool/all/test_v1_package/autotools/libtestlib.sym new file mode 100644 index 0000000..8464fb1 --- /dev/null +++ b/libtool/all/test_v1_package/autotools/libtestlib.sym @@ -0,0 +1,2 @@ +my_function +libtestlib_value diff --git a/libtool/all/test_v1_package/autotools/test_package.c b/libtool/all/test_v1_package/autotools/test_package.c new file mode 100644 index 0000000..4fd8442 --- /dev/null +++ b/libtool/all/test_v1_package/autotools/test_package.c @@ -0,0 +1,11 @@ +#include "lib.h" + +#include + +int main(int argc, char * argv[]) +{ + double res = my_function(1.44); + printf("Result is %e\n", res); + printf("The secret value is %d\n", libtestlib_value); + return 0; +} diff --git a/libtool/all/test_v1_package/autotools/testlib_private.h b/libtool/all/test_v1_package/autotools/testlib_private.h new file mode 100644 index 0000000..81831ae --- /dev/null +++ b/libtool/all/test_v1_package/autotools/testlib_private.h @@ -0,0 +1,8 @@ +#ifndef TESTLIB_PRIVATE_H +#define TESTLIB_PRIVATE_H + +#define LIBTEST_BUILDING + +#include "lib.h" + +#endif // TESTLIB_PRIVATE_H diff --git a/libtool/all/test_v1_package/conanfile.py b/libtool/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..4b29d6a --- /dev/null +++ b/libtool/all/test_v1_package/conanfile.py @@ -0,0 +1,159 @@ +from conans import AutoToolsBuildEnvironment, CMake, ConanFile, tools +from contextlib import contextmanager +import glob +import os +import shutil + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + test_type = "explicit" + short_paths = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def requirements(self): + self.requires(self.tested_reference_str) # Needed as a requirement for CMake to see libraries + + def build_requirements(self): + if hasattr(self, "settings_build") and not tools.cross_building(self): + self.build_requires(self.tested_reference_str) + self.build_requires("automake/1.16.5") # Needed for aclocal called by autoreconf + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + @contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self.settings): + with tools.environment_append({ + "CC": "cl -nologo", + "CXX": "cl -nologo", + }): + yield + else: + yield + + @property + def _package_folder(self): + return os.path.join(self.build_folder, "package") + + def _build_autotools(self): + """ Test autotools integration """ + # Copy autotools directory to build folder + shutil.copytree(os.path.join(self.source_folder, "autotools"), os.path.join(self.build_folder, "autotools")) + with tools.chdir("autotools"): + self.run("autoreconf --install --verbose -Wall", win_bash=tools.os_info.is_windows) + + tools.mkdir(self._package_folder) + conf_args = [ + "--prefix={}".format(tools.unix_path(self._package_folder)), + "--enable-shared", "--enable-static", + ] + + os.mkdir("bin_autotools") + with tools.chdir("bin_autotools"): + with self._build_context(): + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + autotools.libs = [] + autotools.configure(args=conf_args, configure_dir=os.path.join(self.build_folder, "autotools")) + autotools.make(args=["V=1"]) + autotools.install() + + def _test_autotools(self): + assert os.path.isdir(os.path.join(self._package_folder, "bin")) + assert os.path.isfile(os.path.join(self._package_folder, "include", "lib.h")) + assert os.path.isdir(os.path.join(self._package_folder, "lib")) + + if not tools.cross_building(self): + self.run(os.path.join(self._package_folder, "bin", "test_package"), run_environment=True) + + def _build_ltdl(self): + """ Build library using ltdl library """ + with self._build_context(): + if self.settings.compiler == "Visual Studio": + cmake = CMake(self, generator="NMake Makefiles") + else: + cmake = CMake(self) + cmake.configure(source_folder="ltdl") + cmake.build() + + def _test_ltdl(self): + """ Test library using ltdl library""" + lib_suffix = { + "Linux": "so", + "FreeBSD": "so", + "Macos": "dylib", + "Windows": "dll", + }[str(self.settings.os)] + + if not tools.cross_building(self): + bin_path = tools.unix_path(os.path.join("bin", "test_package")) + libdir = "bin" if self.settings.os == "Windows" else "lib" + lib_path = tools.unix_path(os.path.join(libdir, "liba.{}".format(lib_suffix))) + self.run("{} {}".format(bin_path, lib_path), run_environment=True, win_bash=tools.os_info.is_windows) + + def _build_static_lib_in_shared(self): + """ Build shared library using libtool (while linking to a static library) """ + + # Copy static-in-shared directory to build folder + autotools_folder = os.path.join(self.build_folder, "sis") + shutil.copytree(os.path.join(self.source_folder, "sis"), autotools_folder) + + install_prefix = os.path.join(autotools_folder, "prefix") + + # Build static library using CMake + with self._build_context(): + if self.settings.compiler == "Visual Studio": + cmake = CMake(self, generator="NMake Makefiles") + else: + cmake = CMake(self) + cmake.definitions["CMAKE_INSTALL_PREFIX"] = install_prefix + cmake.configure(source_folder=autotools_folder, build_folder=os.path.join(autotools_folder, "cmake_build")) + cmake.build() + cmake.install() + + # Copy autotools directory to build folder + with tools.chdir(autotools_folder): + self.run("autoreconf -ifv -Wall", win_bash=tools.os_info.is_windows) + + with tools.chdir(autotools_folder): + conf_args = [ + "--enable-shared", + "--disable-static", + "--prefix={}".format(tools.unix_path(os.path.join(install_prefix))), + ] + with self._build_context(): + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + autotools.libs = [] + autotools.link_flags.append("-L{}".format(tools.unix_path(os.path.join(install_prefix, "lib")))) + autotools.configure(args=conf_args, configure_dir=autotools_folder) + autotools.make(args=["V=1"]) + autotools.install() + + def _test_static_lib_in_shared(self): + """ Test existence of shared library """ + install_prefix = os.path.join(self.build_folder, "sis", "prefix") + + with tools.chdir(install_prefix): + if self.settings.os == "Windows": + assert len(list(glob.glob(os.path.join("bin", "*.dll")))) > 0 + elif tools.is_apple_os(self.settings.os): + assert len(list(glob.glob(os.path.join("lib", "*.dylib")))) > 0 + else: + assert len(list(glob.glob(os.path.join("lib", "*.so")))) > 0 + + def build(self): + self._build_ltdl() + if not tools.cross_building(self): + self._build_autotools() + self._build_static_lib_in_shared() + + def test(self): + self._test_ltdl() + if not tools.cross_building(self): + self._test_autotools() + self._test_static_lib_in_shared() diff --git a/libtool/all/test_v1_package/ltdl/CMakeLists.txt b/libtool/all/test_v1_package/ltdl/CMakeLists.txt new file mode 100644 index 0000000..7fc6140 --- /dev/null +++ b/libtool/all/test_v1_package/ltdl/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 2.8.12) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +include(GenerateExportHeader) + +add_library(liba SHARED liba.c) +generate_export_header(liba) +target_include_directories(liba + PUBLIC $ +) +set_property(TARGET liba PROPERTY PREFIX "") + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_include_directories(test_package + PUBLIC "$" +) diff --git a/libtool/all/test_v1_package/ltdl/liba.c b/libtool/all/test_v1_package/ltdl/liba.c new file mode 100644 index 0000000..7909038 --- /dev/null +++ b/libtool/all/test_v1_package/ltdl/liba.c @@ -0,0 +1,6 @@ +#include "liba_export.h" + +LIBA_EXPORT +int liba_function(int arg) { + return 2 * arg; +} diff --git a/libtool/all/test_v1_package/ltdl/test_package.c b/libtool/all/test_v1_package/ltdl/test_package.c new file mode 100644 index 0000000..51329f4 --- /dev/null +++ b/libtool/all/test_v1_package/ltdl/test_package.c @@ -0,0 +1,36 @@ +#include "ltdl.h" + +#include +#include + +typedef int (*liba_func_t)(int); + +int main(int argc, char **argv) +{ + if (argc < 2) { + fprintf(stderr, "Need an argument\n"); + return EXIT_FAILURE; + } + const char* libname = argv[1]; + lt_dlinit(); + + fprintf(stderr, "lt_dlopenext(\"%s\")\n", libname); + lt_dlhandle ltdl_liba = lt_dlopenext(libname); + if (!ltdl_liba) { + fprintf(stderr, "lt_dlopenext failed.\n"); + return EXIT_FAILURE; + } + + liba_func_t liba_func = (liba_func_t) lt_dlsym(ltdl_liba, "liba_function"); + int res = liba_func(21); + printf("Result is %d\n", res); + if (res != 42) { + fprintf(stderr, "Result is incorrect\n"); + return EXIT_FAILURE; + } + + lt_dlclose(ltdl_liba); + + lt_dlexit(); + return EXIT_SUCCESS; +} diff --git a/libtool/all/test_v1_package/sis/CMakeLists.txt b/libtool/all/test_v1_package/sis/CMakeLists.txt new file mode 100644 index 0000000..dff9ec1 --- /dev/null +++ b/libtool/all/test_v1_package/sis/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(static_dependency C) + +set(CMAKE_POSITION_INDEPENDENT_CODE ON) +add_library(static_lib STATIC + static_lib.c +) +install(TARGETS static_lib + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) diff --git a/libtool/all/test_v1_package/sis/Makefile.am b/libtool/all/test_v1_package/sis/Makefile.am new file mode 100644 index 0000000..824106c --- /dev/null +++ b/libtool/all/test_v1_package/sis/Makefile.am @@ -0,0 +1,8 @@ +# @configure_input@ + +lib_LTLIBRARIES = libshared.la + +libshared_la_SOURCES = shared_lib.c +libshared_la_LDFLAGS = -no-undefined -lstatic_lib + +# ACLOCAL_AMFLAGS = -I m4 diff --git a/libtool/all/test_v1_package/sis/configure.ac b/libtool/all/test_v1_package/sis/configure.ac new file mode 100644 index 0000000..0272fc8 --- /dev/null +++ b/libtool/all/test_v1_package/sis/configure.ac @@ -0,0 +1,13 @@ +AC_PREREQ(2.69) +AC_INIT([test_package], [1.0]) +AC_CONFIG_SRCDIR([shared_lib.c]) +AC_CONFIG_AUX_DIR([build-aux]) +# AC_CONFIG_MACRO_DIRS([m4]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AC_PROG_CC +AM_PROG_AR +LT_PREREQ([2.4]) +LT_INIT([win32-dll]) +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_HEADERS([config.h]) +AC_OUTPUT diff --git a/libtool/all/test_v1_package/sis/shared.sym b/libtool/all/test_v1_package/sis/shared.sym new file mode 100644 index 0000000..e05e2d3 --- /dev/null +++ b/libtool/all/test_v1_package/sis/shared.sym @@ -0,0 +1 @@ +shared_function diff --git a/libtool/all/test_v1_package/sis/shared_lib.c b/libtool/all/test_v1_package/sis/shared_lib.c new file mode 100644 index 0000000..b92cbe2 --- /dev/null +++ b/libtool/all/test_v1_package/sis/shared_lib.c @@ -0,0 +1,7 @@ +int +static_function(int); + +int +shared_function(int arg) { + return static_function(arg) + 1337; +} diff --git a/libtool/all/test_v1_package/sis/static_lib.c b/libtool/all/test_v1_package/sis/static_lib.c new file mode 100644 index 0000000..2ebed9d --- /dev/null +++ b/libtool/all/test_v1_package/sis/static_lib.c @@ -0,0 +1,4 @@ +int +static_function(int arg) { + return arg + 42; +} diff --git a/libtool/config.yml b/libtool/config.yml new file mode 100644 index 0000000..f33083b --- /dev/null +++ b/libtool/config.yml @@ -0,0 +1,5 @@ +versions: + "2.4.7": + folder: all + "2.4.6": + folder: all diff --git a/libunwind/all/conandata.yml b/libunwind/all/conandata.yml new file mode 100644 index 0000000..efd030d --- /dev/null +++ b/libunwind/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "1.8.1": + url: "https://github.com/libunwind/libunwind/releases/download/v1.8.1/libunwind-1.8.1.tar.gz" + sha256: "ddf0e32dd5fafe5283198d37e4bf9decf7ba1770b6e7e006c33e6df79e6a6157" + "1.8.0": + url: "https://github.com/libunwind/libunwind/releases/download/v1.8.0/libunwind-1.8.0.tar.gz" + sha256: "b6b3df40a0970c8f2865fb39aa2af7b5d6f12ad6c5774e266ccca4d6b8b72268" + "1.7.2": + url: "https://github.com/libunwind/libunwind/releases/download/v1.7.2/libunwind-1.7.2.tar.gz" + sha256: "a18a6a24307443a8ace7a8acc2ce79fbbe6826cd0edf98d6326d0225d6a5d6e6" + "1.7.0": + url: "https://github.com/libunwind/libunwind/releases/download/v1.7.0/libunwind-1.70.tar.gz" + sha256: "c24c913d2337d6eff851b6ab32aadfb683a86fee48d28fe1fc9cd56c8e9dfa58" + "1.6.2": + url: "https://github.com/libunwind/libunwind/releases/download/v1.6.2/libunwind-1.6.2.tar.gz" + sha256: "4a6aec666991fb45d0889c44aede8ad6eb108071c3554fcdff671f9c94794976" + "1.5.0": + url: "https://github.com/libunwind/libunwind/releases/download/v1.5/libunwind-1.5.0.tar.gz" + sha256: "90337653d92d4a13de590781371c604f9031cdb50520366aa1e3a91e1efb1017" + "1.3.1": + url: "https://github.com/libunwind/libunwind/releases/download/v1.3.1/libunwind-1.3.1.tar.gz" + sha256: "43997a3939b6ccdf2f669b50fdb8a4d3205374728c2923ddc2354c65260214f8" +patches: + "1.3.1": + - patch_file: "patches/0001-multiple-definition-gcc10.patch" diff --git a/libunwind/all/conanfile.py b/libunwind/all/conanfile.py new file mode 100644 index 0000000..d96b4ce --- /dev/null +++ b/libunwind/all/conanfile.py @@ -0,0 +1,160 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualRunEnv +from conan.tools.files import ( + apply_conandata_patches, + copy, + export_conandata_patches, + get, + rm, + rmdir, +) +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout + +import os +import shutil + +required_conan_version = ">=1.53.0" + + +class LiunwindConan(ConanFile): + name = "libunwind" + description = "Manipulate the preserved state of each call-frame and resume the execution at any point." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libunwind/libunwind" + topics = ("unwind", "debuggers", "exception-handling", "introspection", "setjmp") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "coredump": [True, False], + "ptrace": [True, False], + "setjmp": [True, False], + "minidebuginfo": [True, False], + "zlibdebuginfo": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "coredump": True, + "ptrace": True, + "setjmp": True, + "minidebuginfo": True, + "zlibdebuginfo": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.minidebuginfo: + self.requires("xz_utils/5.4.5") + if self.options.zlibdebuginfo: + self.requires("zlib/[>=1.2.11 <2]") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration( + "libunwind is only supported on Linux and FreeBSD" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend( + [ + f"--enable-coredump={yes_no(self.options.coredump)}", + f"--enable-ptrace={yes_no(self.options.ptrace)}", + f"--enable-setjmp={yes_no(self.options.setjmp)}", + f"--enable-minidebuginfo={yes_no(self.options.minidebuginfo)}", + f"--enable-zlibdebuginfo={yes_no(self.options.zlibdebuginfo)}", + "--disable-tests", + "--disable-documentation", + ] + ) + tc.generate() + + tc = AutotoolsDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy( + self, + pattern="COPYING", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + ) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + # In install-exec-hook in Makefile.am, libunwind_generic is linked to libunwind_${arch}. + # As this seems to be unnecessary for the conan package. + # rename the real file to libunwind_generic, + lib_ext = "so" if self.options.shared else "a" + symlink_path = os.path.join( + self.package_folder, "lib", f"libunwind-generic.{lib_ext}" + ) + source_path = os.path.realpath(symlink_path) + rm(self, os.path.basename(symlink_path), os.path.dirname(symlink_path)) + shutil.copy(source_path, symlink_path) + + def package_info(self): + self.cpp_info.components["unwind"].set_property("pkg_config_name", "libunwind") + self.cpp_info.components["unwind"].libs = ["unwind"] + if self.options.minidebuginfo: + self.cpp_info.components["unwind"].requires.append("xz_utils::xz_utils") + if self.options.zlibdebuginfo: + self.cpp_info.components["unwind"].requires.append("zlib::zlib") + if self.settings.os == "Linux": + self.cpp_info.components["unwind"].system_libs.append("pthread") + self.cpp_info.components["generic"].set_property( + "pkg_config_name", "libunwind-generic" + ) + self.cpp_info.components["generic"].libs = ["unwind-generic"] + self.cpp_info.components["generic"].requires = ["unwind"] + if self.options.ptrace: + self.cpp_info.components["ptrace"].set_property( + "pkg_config_name", "libunwind-ptrace" + ) + self.cpp_info.components["ptrace"].libs = ["unwind-ptrace"] + self.cpp_info.components["ptrace"].requires = ["generic", "unwind"] + if self.options.setjmp: + self.cpp_info.components["setjmp"].set_property( + "pkg_config_name", "libunwind-setjmp" + ) + self.cpp_info.components["setjmp"].libs = ["unwind-setjmp"] + self.cpp_info.components["setjmp"].requires = ["unwind"] + if self.options.coredump: + self.cpp_info.components["coredump"].set_property( + "pkg_config_name", "libunwind-coredump" + ) + self.cpp_info.components["coredump"].libs = ["unwind-coredump"] + self.cpp_info.components["coredump"].requires = ["generic", "unwind"] diff --git a/libunwind/all/patches/0001-multiple-definition-gcc10.patch b/libunwind/all/patches/0001-multiple-definition-gcc10.patch new file mode 100644 index 0000000..93fd952 --- /dev/null +++ b/libunwind/all/patches/0001-multiple-definition-gcc10.patch @@ -0,0 +1,252 @@ +Fix from https://github.com/libunwind/libunwind/pull/166 + +--- a/src/aarch64/Ginit.c ++++ b/src/aarch64/Ginit.c +@@ -61,7 +61,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -78,7 +77,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/arm/Ginit.c ++++ b/src/arm/Ginit.c +@@ -57,7 +57,6 @@ tdep_uc_addr (unw_tdep_context_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -68,7 +67,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/hppa/Ginit.c ++++ b/src/hppa/Ginit.c +@@ -64,7 +64,6 @@ _Uhppa_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -81,7 +80,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/mips/Ginit.c ++++ b/src/mips/Ginit.c +@@ -69,7 +69,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -86,7 +85,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) (intptr_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/ppc32/Ginit.c ++++ b/src/ppc32/Ginit.c +@@ -91,7 +91,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + + static void +@@ -104,7 +103,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/ppc64/Ginit.c ++++ b/src/ppc64/Ginit.c +@@ -95,7 +95,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + + static void +@@ -108,7 +107,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/sh/Ginit.c ++++ b/src/sh/Ginit.c +@@ -58,7 +58,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -75,7 +74,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/tilegx/Ginit.c ++++ b/src/tilegx/Ginit.c +@@ -64,7 +64,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -81,7 +80,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) (intptr_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/x86/Ginit.c ++++ b/src/x86/Ginit.c +@@ -54,7 +54,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -71,7 +70,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +--- a/src/x86_64/Ginit.c ++++ b/src/x86_64/Ginit.c +@@ -49,7 +49,6 @@ static struct unw_addr_space local_addr_space; + + unw_addr_space_t unw_local_addr_space = &local_addr_space; + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + + /* XXX fix me: there is currently no way to locate the dyn-info list + by a remote unwinder. On ia64, this is done via a special +@@ -66,7 +65,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + diff --git a/libunwind/all/test_package/CMakeLists.txt b/libunwind/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..e857c1d --- /dev/null +++ b/libunwind/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libunwind REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libunwind::libunwind) diff --git a/libunwind/all/test_package/conanfile.py b/libunwind/all/test_package/conanfile.py new file mode 100644 index 0000000..e845ae7 --- /dev/null +++ b/libunwind/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/libunwind/all/test_package/test_package.c b/libunwind/all/test_package/test_package.c new file mode 100644 index 0000000..2d41d82 --- /dev/null +++ b/libunwind/all/test_package/test_package.c @@ -0,0 +1,22 @@ +#include +#define UNW_LOCAL_ONLY +#include + + +void show_backtrace (void) { + unw_cursor_t cursor; unw_context_t uc; + unw_word_t ip, sp; + + unw_getcontext(&uc); + unw_init_local(&cursor, &uc); + while (unw_step(&cursor) > 0) { + unw_get_reg(&cursor, UNW_REG_IP, &ip); + unw_get_reg(&cursor, UNW_REG_SP, &sp); + printf ("ip = %lx, sp = %lx\n", (long) ip, (long) sp); + } +} + +int main() { + show_backtrace(); + return 0; +} diff --git a/libunwind/all/test_v1_package/CMakeLists.txt b/libunwind/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..de3b75d --- /dev/null +++ b/libunwind/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/libunwind/all/test_v1_package/conanfile.py b/libunwind/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..49a3a66 --- /dev/null +++ b/libunwind/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/libunwind/config.yml b/libunwind/config.yml new file mode 100644 index 0000000..2132c14 --- /dev/null +++ b/libunwind/config.yml @@ -0,0 +1,15 @@ +versions: + "1.8.1": + folder: all + "1.8.0": + folder: all + "1.7.2": + folder: all + "1.7.0": + folder: all + "1.6.2": + folder: all + "1.5.0": + folder: all + "1.3.1": + folder: all diff --git a/lz4/all/conandata.yml b/lz4/all/conandata.yml new file mode 100644 index 0000000..27dd497 --- /dev/null +++ b/lz4/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "1.10.0": + url: "https://github.com/lz4/lz4/archive/v1.10.0.tar.gz" + sha256: "537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b" + "1.9.4": + url: "https://github.com/lz4/lz4/archive/v1.9.4.tar.gz" + sha256: "0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b" + "1.9.3": + url: "https://github.com/lz4/lz4/archive/v1.9.3.tar.gz" + sha256: "030644df4611007ff7dc962d981f390361e6c97a34e5cbc393ddfbe019ffe2c1" +patches: + "1.9.4": + - patch_file: "patches/0004-Added-namespace-declaration-for-xxhash-in-CMake.patch" + patch_description: "Added namespace/prefix for xxHash functions by altering CMakeLists.txt" + patch_type: official + patch_source: "https://github.com/lz4/lz4/pull/1258" + "1.9.3": + - patch_file: "patches/0003-cmake-minimum-required-first-1.9.3.patch" + patch_description: "Move cmake_minimum_required to the top of CMakeFile.txt" + patch_type: conan diff --git a/lz4/all/conanfile.py b/lz4/all/conanfile.py new file mode 100644 index 0000000..ea0b3ac --- /dev/null +++ b/lz4/all/conanfile.py @@ -0,0 +1,120 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class LZ4Conan(ConanFile): + name = "lz4" + description = "Extremely Fast Compression algorithm" + license = ("BSD-2-Clause", "BSD-3-Clause") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lz4/lz4" + topics = ("compression") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LZ4_BUILD_CLI"] = False + if Version(self.version) < "1.10.0": + tc.variables["LZ4_BUILD_LEGACY_LZ4C"] = False + tc.variables["LZ4_BUNDLED_MODE"] = False + tc.variables["LZ4_POSITION_INDEPENDENT_LIB"] = self.options.get_safe("fPIC", True) + # Generate a relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Honor BUILD_SHARED_LIBS (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + @property + def _cmakelists_folder(self): + subfolder = os.path.join("build", "cmake") + return os.path.join(self.source_folder, subfolder) + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=self._cmakelists_folder) + cmake.build() + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + if Version(self.version) >= "1.9.4": + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {self._lz4_target: "lz4::lz4"}, + ) + + @property + def _lz4_target(self): + return f"LZ4::{'lz4_shared' if self.options.shared else 'lz4_static'}" + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "lz4") + self.cpp_info.set_property("cmake_target_name", self._lz4_target) + self.cpp_info.set_property("cmake_target_aliases", ["lz4::lz4"]) # old unofficial target in CCI for lz4, kept for the moment to not break consumers + self.cpp_info.set_property("pkg_config_name", "liblz4") + self.cpp_info.libs = ["lz4"] + if is_msvc(self) and self.options.shared: + self.cpp_info.defines.append("LZ4_DLL_IMPORT=1") + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "liblz4" diff --git a/lz4/all/patches/0003-cmake-minimum-required-first-1.9.3.patch b/lz4/all/patches/0003-cmake-minimum-required-first-1.9.3.patch new file mode 100644 index 0000000..16c6011 --- /dev/null +++ b/lz4/all/patches/0003-cmake-minimum-required-first-1.9.3.patch @@ -0,0 +1,25 @@ +--- a/build/cmake/CMakeLists.txt ++++ b/build/cmake/CMakeLists.txt +@@ -9,11 +9,10 @@ + # + # LZ4's CMake support is maintained by Evan Nemerson; when filing + # bugs please mention @nemequ to make sure I see it. ++cmake_minimum_required (VERSION 2.8.6) + + set(LZ4_TOP_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") + +-option(LZ4_BUILD_CLI "Build lz4 program" ON) +-option(LZ4_BUILD_LEGACY_LZ4C "Build lz4c progam with legacy argument support" ON) + + # Parse version information + file(STRINGS "${LZ4_TOP_SOURCE_DIR}/lib/lz4.h" LZ4_VERSION_MAJOR REGEX "^#define LZ4_VERSION_MAJOR +([0-9]+) +.*$") +@@ -34,7 +33,8 @@ else() + LANGUAGES C) + endif() + +-cmake_minimum_required (VERSION 2.8.6) ++option(LZ4_BUILD_CLI "Build lz4 program" ON) ++option(LZ4_BUILD_LEGACY_LZ4C "Build lz4c progam with legacy argument support" ON) + + # If LZ4 is being bundled in another project, we don't want to + # install anything. However, we want to let people override this, so diff --git a/lz4/all/patches/0004-Added-namespace-declaration-for-xxhash-in-CMake.patch b/lz4/all/patches/0004-Added-namespace-declaration-for-xxhash-in-CMake.patch new file mode 100644 index 0000000..04a888e --- /dev/null +++ b/lz4/all/patches/0004-Added-namespace-declaration-for-xxhash-in-CMake.patch @@ -0,0 +1,19 @@ +--- a/build/cmake/CMakeLists.txt ++++ b/build/cmake/CMakeLists.txt +@@ -131,6 +131,16 @@ if(BUILD_STATIC_LIBS) + list(APPEND LZ4_LIBRARIES_BUILT lz4_static) + endif() + ++# xxhash namesapce ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(lz4_shared PRIVATE ++ XXH_NAMESPACE=LZ4_) ++endif() ++if(BUILD_STATIC_LIBS) ++ target_compile_definitions(lz4_static PRIVATE ++ XXH_NAMESPACE=LZ4_) ++endif() ++ + if(BUILD_STATIC_LIBS) + set(LZ4_LINK_LIBRARY lz4_static) + else() diff --git a/lz4/all/test_package/CMakeLists.txt b/lz4/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..14b12b7 --- /dev/null +++ b/lz4/all/test_package/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(lz4 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if(TARGET LZ4::lz4_static) + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_shared) +endif() + +option(TEST_SHARED_LIB "Use package in a shared library") +if(TEST_AS_SHARED_LIB) + add_library(${PROJECT_NAME}2 SHARED lib.c) + if(TARGET LZ4::lz4_static) + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_static) + else() + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_shared) + endif() +endif() diff --git a/lz4/all/test_package/conanfile.py b/lz4/all/test_package/conanfile.py new file mode 100644 index 0000000..e1a1aff --- /dev/null +++ b/lz4/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + lz4 = self.dependencies["lz4"] + tc = CMakeToolchain(self) + tc.variables["TEST_SHARED_LIB"] = lz4.options.get_safe("fPIC", True) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/lz4/all/test_package/lib.c b/lz4/all/test_package/lib.c new file mode 100644 index 0000000..bbf6f76 --- /dev/null +++ b/lz4/all/test_package/lib.c @@ -0,0 +1,13 @@ +#include "lz4.h" + +#ifdef _MSC_VER +#define API __declspec(dllexport) +#else +#define API __attribute__ ((visibility("default"))) +#endif + +API +int lz4_version() +{ + return LZ4_versionNumber(); +} diff --git a/lz4/all/test_package/test_package.c b/lz4/all/test_package/test_package.c new file mode 100644 index 0000000..8607139 --- /dev/null +++ b/lz4/all/test_package/test_package.c @@ -0,0 +1,13 @@ +// LZ4 trivial example : print Library version number +// Copyright : Takayuki Matsuoka & Yann Collet + + +#include +#include "lz4.h" + +int main(int argc, char** argv) +{ + (void)argc; (void)argv; + printf("Hello World ! LZ4 Library version = %d\n", LZ4_versionNumber()); + return 0; +} diff --git a/lz4/all/test_v1_package/CMakeLists.txt b/lz4/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..f9324f7 --- /dev/null +++ b/lz4/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(lz4 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +if(TARGET LZ4::lz4_static) + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_shared) +endif() + +option(TEST_SHARED_LIB "Use package in a shared library") +if(TEST_AS_SHARED_LIB) + add_library(${PROJECT_NAME}2 SHARED ../test_package/lib.c) + if(TARGET LZ4::lz4_static) + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_static) + else() + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_shared) + endif() +endif() diff --git a/lz4/all/test_v1_package/conanfile.py b/lz4/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..77061a2 --- /dev/null +++ b/lz4/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["TEST_SHARED_LIB"] = dict(self.options["lz4"].items()).get("fPIC", True) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/lz4/config.yml b/lz4/config.yml new file mode 100644 index 0000000..7af8322 --- /dev/null +++ b/lz4/config.yml @@ -0,0 +1,7 @@ +versions: + "1.10.0": + folder: all + "1.9.4": + folder: all + "1.9.3": + folder: all diff --git a/lzo/all/conandata.yml b/lzo/all/conandata.yml new file mode 100644 index 0000000..9607883 --- /dev/null +++ b/lzo/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.10": + sha256: c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072 + url: http://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz diff --git a/lzo/all/conanfile.py b/lzo/all/conanfile.py new file mode 100644 index 0000000..2daa81c --- /dev/null +++ b/lzo/all/conanfile.py @@ -0,0 +1,66 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class LZOConan(ConanFile): + name = "lzo" + description = "lzo is a portable lossless data compression library written in ANSI C" + license = "GPL-v2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.oberhumer.com/opensource/lzo/" + topics = ("compression") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_STATIC"] = not self.options.shared + tc.variables["ENABLE_SHARED"] = self.options.shared + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "bin", "lzo")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "lzo2") + self.cpp_info.includedirs.append(os.path.join("include", "lzo")) + self.cpp_info.libs = ["lzo2"] diff --git a/lzo/all/test_package/CMakeLists.txt b/lzo/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..aae7090 --- /dev/null +++ b/lzo/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(lzo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE lzo::lzo) diff --git a/lzo/all/test_package/conanfile.py b/lzo/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/lzo/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/lzo/all/test_package/test_package.c b/lzo/all/test_package/test_package.c new file mode 100644 index 0000000..82d98c1 --- /dev/null +++ b/lzo/all/test_package/test_package.c @@ -0,0 +1,47 @@ +#include "lzo1f.h" +#include +#include + +const char *text = "This is a string that lzo should compress to less bytes then before if it is working fine.\n" +"This compression algorithm appears to only compress bigger inputs so put a lot of text here.\n"; + + +int main() +{ + if (lzo_init() != LZO_E_OK) + { + printf("internal error - lzo_init() failed !!!\n"); + printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n"); + return 1; + } + + char compressed[2048]; + size_t compressed_len = sizeof(compressed); + { + char workMemory[LZO1F_MEM_COMPRESS+1]; + int r = lzo1f_1_compress((unsigned char*)text, strlen(text), (unsigned char*)compressed, &compressed_len, workMemory); + if (r != LZO_E_OK) { + printf("internal error - compression failed: %d\n", r); + return 1; + } + } + printf("Size before compression: %zu bytes\n", strlen(text)); + printf("Size after compression: %zu bytes\n", compressed_len); + + + char decompressed[2048]; + size_t decompressed_len = sizeof(decompressed); + { + char workMemory[LZO1F_MEM_DECOMPRESS+1]; + int r = lzo1f_decompress((unsigned char*)compressed, compressed_len, (unsigned char*)decompressed, &decompressed_len, workMemory); + if (r != LZO_E_OK) { + printf("internal error - decompression failed: %d\n", r); + return 1; + } + } + + int ok = (strlen(text) == decompressed_len) && (strncmp(text, decompressed, decompressed_len) == 0); + printf("Decompression: %s\n", ok ? "Success" : "Failure"); + + return ok ? 0 : 1; +} diff --git a/lzo/all/test_v1_package/CMakeLists.txt b/lzo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/lzo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/lzo/all/test_v1_package/conanfile.py b/lzo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..94c6eef --- /dev/null +++ b/lzo/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/lzo/all/test_v1_package/test_package.c b/lzo/all/test_v1_package/test_package.c new file mode 100644 index 0000000..82d98c1 --- /dev/null +++ b/lzo/all/test_v1_package/test_package.c @@ -0,0 +1,47 @@ +#include "lzo1f.h" +#include +#include + +const char *text = "This is a string that lzo should compress to less bytes then before if it is working fine.\n" +"This compression algorithm appears to only compress bigger inputs so put a lot of text here.\n"; + + +int main() +{ + if (lzo_init() != LZO_E_OK) + { + printf("internal error - lzo_init() failed !!!\n"); + printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n"); + return 1; + } + + char compressed[2048]; + size_t compressed_len = sizeof(compressed); + { + char workMemory[LZO1F_MEM_COMPRESS+1]; + int r = lzo1f_1_compress((unsigned char*)text, strlen(text), (unsigned char*)compressed, &compressed_len, workMemory); + if (r != LZO_E_OK) { + printf("internal error - compression failed: %d\n", r); + return 1; + } + } + printf("Size before compression: %zu bytes\n", strlen(text)); + printf("Size after compression: %zu bytes\n", compressed_len); + + + char decompressed[2048]; + size_t decompressed_len = sizeof(decompressed); + { + char workMemory[LZO1F_MEM_DECOMPRESS+1]; + int r = lzo1f_decompress((unsigned char*)compressed, compressed_len, (unsigned char*)decompressed, &decompressed_len, workMemory); + if (r != LZO_E_OK) { + printf("internal error - decompression failed: %d\n", r); + return 1; + } + } + + int ok = (strlen(text) == decompressed_len) && (strncmp(text, decompressed, decompressed_len) == 0); + printf("Decompression: %s\n", ok ? "Success" : "Failure"); + + return ok ? 0 : 1; +} diff --git a/lzo/config.yml b/lzo/config.yml new file mode 100644 index 0000000..6ba5fbf --- /dev/null +++ b/lzo/config.yml @@ -0,0 +1,3 @@ +versions: + "2.10": + folder: all diff --git a/m4/all/conandata.yml b/m4/all/conandata.yml new file mode 100644 index 0000000..6dc3bb1 --- /dev/null +++ b/m4/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + "1.4.19": + url: + - "https://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.xz" + - "https://ftpmirror.gnu.org/gnu/m4/m4-1.4.19.tar.xz" + sha256: "63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96" + "1.4.18": + url: + - "https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.xz" + - "https://ftpmirror.gnu.org/gnu/m4/m4-1.4.18.tar.xz" + sha256: "f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07" +patches: + "1.4.19": + - patch_file: "patches/1.4.19-0001-open-files-in-binary-mode.patch" + - patch_file: "patches/1.4.19-0002-ar-lib.patch" + - patch_file: "patches/1.4.19-0003-msvc-debug-assertion.patch" + - patch_file: "patches/1.4.19-0004-disable-hardening-in-source.patch" + "1.4.18": + - patch_file: "patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch" + - patch_file: "patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch" + - patch_file: "patches/1.4.18-0004-fix-checks.patch" + - patch_file: "patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch" + - patch_file: "patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch" + - patch_file: "patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch" + - patch_file: "patches/1.4.18-0008-open-files-in-binary-mode.patch" + - patch_file: "patches/1.4.18-0009-disable-hardening-in-source.patch" + - patch_file: "patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch" diff --git a/m4/all/conanfile.py b/m4/all/conanfile.py new file mode 100644 index 0000000..dadcf2b --- /dev/null +++ b/m4/all/conanfile.py @@ -0,0 +1,135 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version +import os +import shutil + +required_conan_version = ">=1.55.0" + + +class M4Conan(ConanFile): + name = "m4" + package_type = "application" + description = "GNU M4 is an implementation of the traditional Unix macro processor" + topics = ("macro", "preprocessor") + homepage = "https://www.gnu.org/software/m4/" + url = "https://github.com/conan-io/conan-center-index" + license = "GPL-3.0-only" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self): + tc.extra_cflags.append("-FS") + # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug + # Visual Studio does not support the %n format flag: + # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions + # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string, + # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output. + tc.configure_args.extend([ + "gl_cv_func_printf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + ]) + if self.settings.build_type in ("Debug", "RelWithDebInfo"): + tc.extra_ldflags.append("-PDB") + elif self.settings.compiler == "clang" and Version(self.version) < "1.4.19": + tc.extra_cflags.extend([ + "-rtlib=compiler-rt", + "-Wno-unused-command-line-argument", + ]) + if cross_building(self) and is_msvc(self): + triplet_arch_windows = {"x86_64": "x86_64", "x86": "i686", "armv8": "aarch64"} + + host_arch = triplet_arch_windows.get(str(self.settings.arch)) + build_arch = triplet_arch_windows.get(str(self._settings_build.arch)) + + if host_arch and build_arch: + host = f"{host_arch}-w64-mingw32" + build = f"{build_arch}-w64-mingw32" + tc.configure_args.extend([ + f"--host={host}", + f"--build={build}", + ]) + if self.settings.os == "Windows": + tc.configure_args.append("ac_cv_func__set_invalid_parameter_handler=yes") + env = tc.environment() + # help2man trick + env.prepend_path("PATH", self.source_folder) + # handle msvc + if is_msvc(self): + ar_wrapper = unix_path(self, os.path.join(self.source_folder, "build-aux", "ar-lib")) + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + env.define("AR", f"{ar_wrapper} lib") + env.define("LD", "link") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + if shutil.which("help2man") == None: + # dummy file for configure + help2man = os.path.join(self.source_folder, "help2man") + save(self, help2man, "#!/usr/bin/env bash\n:") + if os.name == "posix": + os.chmod(help2man, os.stat(help2man).st_mode | 0o111) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + # M4 environment variable is used by a lot of scripts as a way to override a hard-coded embedded m4 path + bin_ext = ".exe" if self.settings.os == "Windows" else "" + m4_bin = os.path.join(self.package_folder, "bin", f"m4{bin_ext}").replace("\\", "/") + self.runenv_info.define_path("M4", m4_bin) + self.buildenv_info.define_path("M4", m4_bin) + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.M4 = m4_bin diff --git a/m4/all/patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch b/m4/all/patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch new file mode 100644 index 0000000..18da1f9 --- /dev/null +++ b/m4/all/patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch @@ -0,0 +1,170 @@ +# this patches is from https://git.busybox.net/buildroot/commit/?id=c48f8a64626c60bd1b46804b7cf1a699ff53cdf3 +# to fix compiler error on certain systems: +# freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib." + +From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Mon, 5 Mar 2018 10:56:29 -0800 +Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Problem reported by Daniel P. Berrangé in: +https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html +* lib/fbufmode.c (fbufmode): +* lib/fflush.c (clear_ungetc_buffer_preserving_position) +(disable_seek_optimization, rpl_fflush): +* lib/fpending.c (__fpending): +* lib/fpurge.c (fpurge): +* lib/freadable.c (freadable): +* lib/freadahead.c (freadahead): +* lib/freading.c (freading): +* lib/freadptr.c (freadptr): +* lib/freadseek.c (freadptrinc): +* lib/fseeko.c (fseeko): +* lib/fseterr.c (fseterr): +* lib/fwritable.c (fwritable): +* lib/fwriting.c (fwriting): +Check _IO_EOF_SEEN instead of _IO_ftrylockfile. +* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]: +Define if not already defined. + +[yann.morin.1998@free.fr: partially backport from upstream gnulib] +Signed-off-by: "Yann E. MORIN" + +--- + lib/fflush.c | 6 +++--- + lib/fpending.c | 2 +- + lib/fpurge.c | 2 +- + lib/freadahead.c | 2 +- + lib/freading.c | 2 +- + lib/fseeko.c | 4 ++-- + lib/stdio-impl.h | 6 ++++++ + 7 files changed, 15 insertions(+), 9 deletions(-) + +diff --git a/lib/fflush.c b/lib/fflush.c +index ef2a7f1..787790d 100644 +--- a/lib/fflush.c ++++ b/lib/fflush.c +@@ -33,7 +33,7 @@ + #undef fflush + + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ + static void +@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp) + + #endif + +-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) ++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) + + # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream) + if (stream == NULL || ! freading (stream)) + return fflush (stream); + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + clear_ungetc_buffer_preserving_position (stream); + +diff --git a/lib/fpending.c b/lib/fpending.c +index ce93604..9fe7ffb 100644 +--- a/lib/fpending.c ++++ b/lib/fpending.c +@@ -32,7 +32,7 @@ __fpending (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return fp->_IO_write_ptr - fp->_IO_write_base; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +diff --git a/lib/fpurge.c b/lib/fpurge.c +index 53ee68c..7cba3a3 100644 +--- a/lib/fpurge.c ++++ b/lib/fpurge.c +@@ -62,7 +62,7 @@ fpurge (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_IO_read_end = fp->_IO_read_ptr; + fp->_IO_write_ptr = fp->_IO_write_base; + /* Avoid memory leak when there is an active ungetc buffer. */ +diff --git a/lib/freadahead.c b/lib/freadahead.c +index cfc969b..5e43e13 100644 +--- a/lib/freadahead.c ++++ b/lib/freadahead.c +@@ -25,7 +25,7 @@ + size_t + freadahead (FILE *fp) + { +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_write_ptr > fp->_IO_write_base) + return 0; + return (fp->_IO_read_end - fp->_IO_read_ptr) +diff --git a/lib/freading.c b/lib/freading.c +index 05cb0b8..f1da5b9 100644 +--- a/lib/freading.c ++++ b/lib/freading.c +@@ -31,7 +31,7 @@ freading (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return ((fp->_flags & _IO_NO_WRITES) != 0 + || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 + && fp->_IO_read_base != NULL)); +diff --git a/lib/fseeko.c b/lib/fseeko.c +index 0c01c4f..0601619 100644 +--- a/lib/fseeko.c ++++ b/lib/fseeko.c +@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence) + #endif + + /* These tests are based on fpurge.c. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_read_end == fp->_IO_read_ptr + && fp->_IO_write_ptr == fp->_IO_write_base + && fp->_IO_save_base == NULL) +@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence) + return -1; + } + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; + fp->_offset = pos; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ +diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h +index 766d693..75fe3ad 100644 +--- a/lib/stdio-impl.h ++++ b/lib/stdio-impl.h +@@ -18,6 +18,12 @@ + the same implementation of stdio extension API, except that some fields + have different naming conventions, or their access requires some casts. */ + ++/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this ++ problem by defining it ourselves. FIXME: Do not rely on glibc ++ internals. */ ++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN ++# define _IO_IN_BACKUP 0x100 ++#endif + + /* BSD stdio derived implementations. */ + +-- +2.7.4.windows.1 + diff --git a/m4/all/patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch b/m4/all/patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch new file mode 100644 index 0000000..5fb554c --- /dev/null +++ b/m4/all/patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch @@ -0,0 +1,156 @@ +# this patches is from https://git.busybox.net/buildroot/commit/?id=c48f8a64626c60bd1b46804b7cf1a699ff53cdf3 +# to fix compiler error on certain systems: +# freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib." + + +From 74d9d6a293d7462dea8f83e7fc5ac792e956a0ad Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Thu, 8 Mar 2018 16:42:45 -0800 +Subject: [PATCH 2/2] fflush: be more paranoid about libio.h change + +Suggested by Eli Zaretskii in: +https://lists.gnu.org/r/emacs-devel/2018-03/msg00270.html +* lib/fbufmode.c (fbufmode): +* lib/fflush.c (clear_ungetc_buffer_preserving_position) +(disable_seek_optimization, rpl_fflush): +* lib/fpending.c (__fpending): +* lib/fpurge.c (fpurge): +* lib/freadable.c (freadable): +* lib/freadahead.c (freadahead): +* lib/freading.c (freading): +* lib/freadptr.c (freadptr): +* lib/freadseek.c (freadptrinc): +* lib/fseeko.c (fseeko): +* lib/fseterr.c (fseterr): +* lib/fwritable.c (fwritable): +* lib/fwriting.c (fwriting): +Look at _IO_ftrylockfile as well as at _IO_EOF_SEEN. +--- + lib/fflush.c | 9 ++++++--- + lib/fpending.c | 3 ++- + lib/fpurge.c | 3 ++- + lib/freadahead.c | 3 ++- + lib/freading.c | 3 ++- + lib/fseeko.c | 6 ++++-- + 6 files changed, 18 insertions(+), 9 deletions(-) + +[yann.morin.1998@free.fr: partially backport from upstream gnulib] +Signed-off-by: "Yann E. MORIN" + +diff --git a/lib/fflush.c b/lib/fflush.c +index 787790d..d6951a8 100644 +--- a/lib/fflush.c ++++ b/lib/fflush.c +@@ -33,7 +33,8 @@ + #undef fflush + + +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++/* GNU libc, BeOS, Haiku, Linux libc5 */ + + /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ + static void +@@ -72,7 +73,8 @@ clear_ungetc_buffer (FILE *fp) + + #endif + +-#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) ++#if ! (defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1) ++/* GNU libc, BeOS, Haiku, Linux libc5 */ + + # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +@@ -148,7 +150,8 @@ rpl_fflush (FILE *stream) + if (stream == NULL || ! freading (stream)) + return fflush (stream); + +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + + clear_ungetc_buffer_preserving_position (stream); + +diff --git a/lib/fpending.c b/lib/fpending.c +index 9fe7ffb..9433c1a 100644 +--- a/lib/fpending.c ++++ b/lib/fpending.c +@@ -32,7 +32,8 @@ __fpending (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + return fp->_IO_write_ptr - fp->_IO_write_base; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +diff --git a/lib/fpurge.c b/lib/fpurge.c +index 7cba3a3..55758d7 100644 +--- a/lib/fpurge.c ++++ b/lib/fpurge.c +@@ -62,7 +62,8 @@ fpurge (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_IO_read_end = fp->_IO_read_ptr; + fp->_IO_write_ptr = fp->_IO_write_base; + /* Avoid memory leak when there is an active ungetc buffer. */ +diff --git a/lib/freadahead.c b/lib/freadahead.c +index 5e43e13..4ccaa09 100644 +--- a/lib/freadahead.c ++++ b/lib/freadahead.c +@@ -25,7 +25,8 @@ + size_t + freadahead (FILE *fp) + { +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_write_ptr > fp->_IO_write_base) + return 0; + return (fp->_IO_read_end - fp->_IO_read_ptr) +diff --git a/lib/freading.c b/lib/freading.c +index f1da5b9..7ae5618 100644 +--- a/lib/freading.c ++++ b/lib/freading.c +@@ -31,7 +31,8 @@ freading (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + return ((fp->_flags & _IO_NO_WRITES) != 0 + || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 + && fp->_IO_read_base != NULL)); +diff --git a/lib/fseeko.c b/lib/fseeko.c +index 0601619..2fc1986 100644 +--- a/lib/fseeko.c ++++ b/lib/fseeko.c +@@ -47,7 +47,8 @@ fseeko (FILE *fp, off_t offset, int whence) + #endif + + /* These tests are based on fpurge.c. */ +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_read_end == fp->_IO_read_ptr + && fp->_IO_write_ptr == fp->_IO_write_base + && fp->_IO_save_base == NULL) +@@ -123,7 +124,8 @@ fseeko (FILE *fp, off_t offset, int whence) + return -1; + } + +-#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 ++ /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; + fp->_offset = pos; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ +-- +2.7.4.windows.1 + diff --git a/m4/all/patches/1.4.18-0004-fix-checks.patch b/m4/all/patches/1.4.18-0004-fix-checks.patch new file mode 100644 index 0000000..adbef56 --- /dev/null +++ b/m4/all/patches/1.4.18-0004-fix-checks.patch @@ -0,0 +1,35 @@ +--- checks/check-them ++++ checks/check-them +@@ -58,12 +58,13 @@ + shift; shift + fi + + # Find out how the executable prints argv[0] + m4name=`"$m4" --help | ${SED} -e 's/Usage: \(.*\) \[OPTION.*/\1/' \ + -e 's/\\\\/\\\\\\\\/g' -e 1q` ++m4name=`basename $m4name` + + # Find out if we should strip \r in the output + "$m4" --version | tee $out + "$m4" --version | tr -d '\015' > $xout + if cmp -s $out $xout; then + : + +---checks/Makefile ++++ checks/Makefile.in +@@ -1612,14 +1612,14 @@ + $(srcdir)/stamp-checks: $(srcdir)/get-them $(top_srcdir)/doc/m4.texi + rm -f $(DOC_CHECKS) + cd $(srcdir) && AWK=$(AWK) ./get-them ../doc/m4.texi + echo stamp >$@ + + check-local: $(srcdir)/stamp-checks +- PATH=`pwd`/../src"$(PATH_SEPARATOR)"$$PATH; export PATH; \ +- $(srcdir)/check-them -I $(srcdir)/../examples $(CHECKS) ++ cd $(srcdir)/.. && PATH=src"$(PATH_SEPARATOR)"$$PATH \ ++ $(srcdir)/check-them -I examples $(CHECKS) + + installcheck: $(srcdir)/stamp-checks + PATH='$(bindir)'"$(PATH_SEPARATOR)"$$PATH; export PATH; \ + $(srcdir)/check-them -I $(srcdir)/../examples \ + -m "`echo m4 | sed '$(program_transform_name)'`" $(CHECKS) diff --git a/m4/all/patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch b/m4/all/patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch new file mode 100644 index 0000000..65911ef --- /dev/null +++ b/m4/all/patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch @@ -0,0 +1,124 @@ +From 0d01189c540f63159448ba6bf4740bb20ff1e1ee Mon Sep 17 00:00:00 2001 +From: Bruno Haible +Date: Fri, 21 Apr 2017 17:24:48 +0200 +Subject: vasnprintf: Fix for MSVC 14. + +* lib/vasnprintf.c (USE_MSVC__SNPRINTF): New macro. +Everywhere, use !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF instead +of !HAVE_SNPRINTF_RETVAL_C99. +--- + lib/vasnprintf.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +(limited to 'lib/vasnprintf.c') + +diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c +index 4962e5893..839f79060 100644 +--- a/lib/vasnprintf.c ++++ b/lib/vasnprintf.c +@@ -156,6 +156,7 @@ + # define SNPRINTF snwprintf + # else + # define SNPRINTF _snwprintf ++# define USE_MSVC__SNPRINTF 1 + # endif + # else + /* Unix. */ +@@ -181,7 +182,9 @@ + /* Here we need to call the native snprintf, not rpl_snprintf. */ + # undef snprintf + # else ++ /* MSVC versions < 14 did not have snprintf, only _snprintf. */ + # define SNPRINTF _snprintf ++# define USE_MSVC__SNPRINTF 1 + # endif + # else + /* Unix. */ +@@ -208,7 +211,7 @@ + #undef remainder + #define remainder rem + +-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && !WIDE_CHAR_VERSION ++#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && !WIDE_CHAR_VERSION + # if (HAVE_STRNLEN && !defined _AIX) + # define local_strnlen strnlen + # else +@@ -224,7 +227,7 @@ local_strnlen (const char *string, size_t maxlen) + # endif + #endif + +-#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T ++#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T + # if HAVE_WCSLEN + # define local_wcslen wcslen + # else +@@ -247,7 +250,7 @@ local_wcslen (const wchar_t *s) + # endif + #endif + +-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && HAVE_WCHAR_T && WIDE_CHAR_VERSION ++#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T && WIDE_CHAR_VERSION + # if HAVE_WCSNLEN + # define local_wcsnlen wcsnlen + # else +@@ -1517,7 +1520,7 @@ is_borderline (const char *digits, size_t precision) + + #endif + +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF + + /* Use a different function name, to make it possible that the 'wchar_t' + parametrization and the 'char' parametrization get compiled in the same +@@ -2392,7 +2395,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + } + } + #endif +-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T ++#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T + else if (dp->conversion == 's' + # if WIDE_CHAR_VERSION + && a.arg[dp->arg_index].type != TYPE_WIDE_STRING +@@ -4591,10 +4594,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + int has_width; + #endif +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + size_t width; + #endif +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + int has_precision; + size_t precision; + #endif +@@ -4623,7 +4626,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + has_width = 0; + #endif +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + width = 0; + if (dp->width_start != dp->width_end) + { +@@ -4657,7 +4660,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + } + #endif + +-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION ++#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + has_precision = 0; + precision = 6; + if (dp->precision_start != dp->precision_end) +@@ -5127,7 +5130,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + /* Look at the snprintf() return value. */ + if (retcount < 0) + { +-# if !HAVE_SNPRINTF_RETVAL_C99 ++# if !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF + /* HP-UX 10.20 snprintf() is doubly deficient: + It doesn't understand the '%n' directive, + *and* it returns -1 (rather than the length +-- +cgit v1.2.1 + diff --git a/m4/all/patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch b/m4/all/patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch new file mode 100644 index 0000000..3ef80ae --- /dev/null +++ b/m4/all/patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch @@ -0,0 +1,50 @@ +From 5e22aee79f9d02ac37f40f1d18f5696114c3c3c9 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Tue, 16 May 2017 09:23:52 -0700 +Subject: manywarnings: update for GCC 7 + +* build-aux/gcc-warning.spec: +* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): +Add GCC 7 warnings, notably -Wimplicit-fallthrough=5, which +requires a non-comment fallthrough attribute. This is a bit +cleaner than the comment versions. +* lib/strftime.c, lib/dfa.c, lib/fnmatch.c, lib/mbrtowc.c: +* lib/vasnprintf.c, tests/macros.h (FALLTHROUGH): New macro. +Use it whenever one switch case falls through into the next. +--- + lib/vasnprintf.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +(limited to 'lib/vasnprintf.c') + +diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c +index 839f79060..9c2af0e45 100644 +--- a/lib/vasnprintf.c ++++ b/lib/vasnprintf.c +@@ -118,6 +118,14 @@ + # include "fpucw.h" + #endif + ++#ifndef FALLTHROUGH ++# if __GNUC__ < 7 ++# define FALLTHROUGH ((void) 0) ++# else ++# define FALLTHROUGH __attribute__ ((__fallthrough__)) ++# endif ++#endif ++ + /* Default parameters. */ + #ifndef VASNPRINTF + # if WIDE_CHAR_VERSION +@@ -4837,7 +4845,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + *fbp++ = 'l'; + # endif + #endif +- /*FALLTHROUGH*/ ++ FALLTHROUGH; + case TYPE_LONGINT: + case TYPE_ULONGINT: + #if HAVE_WINT_T +-- +cgit v1.2.1 + diff --git a/m4/all/patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch b/m4/all/patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch new file mode 100644 index 0000000..85a0bdd --- /dev/null +++ b/m4/all/patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch @@ -0,0 +1,47 @@ +From c41f233c4c38e84023a16339782ee306f03e7f59 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Fri, 7 Jul 2017 14:10:20 -0700 +Subject: vasnprintf: port to macOS 10.13 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Problem reported by comex in: +http://lists.gnu.org/archive/html/bug-gnulib/2017-07/msg00056.html +* lib/vasnprintf.c (VASNPRINTF): Don’t use %n on macOS. +--- + lib/vasnprintf.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +(limited to 'lib/vasnprintf.c') + +diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c +index 9c2af0e45..fecaf27a1 100644 +--- a/lib/vasnprintf.c ++++ b/lib/vasnprintf.c +@@ -4869,7 +4869,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + #endif + *fbp = dp->conversion; + #if USE_SNPRINTF +-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) ++# if ! (((__GLIBC__ > 2 \ ++ || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \ ++ && !defined __UCLIBC__) \ ++ || (defined __APPLE__ && defined __MACH__) \ ++ || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) + fbp[1] = '%'; + fbp[2] = 'n'; + fbp[3] = '\0'; +@@ -4883,6 +4887,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + in format strings in writable memory may crash the program + (if compiled with _FORTIFY_SOURCE=2), so we should avoid it + in this situation. */ ++ /* macOS 10.13 High Sierra behaves like glibc with ++ _FORTIFY_SOURCE=2, and older macOS releases ++ presumably do not need %n. */ + /* On native Windows systems (such as mingw), we can avoid using + %n because: + - Although the gl_SNPRINTF_TRUNCATION_C99 test fails, +-- +cgit v1.2.1 + diff --git a/m4/all/patches/1.4.18-0008-open-files-in-binary-mode.patch b/m4/all/patches/1.4.18-0008-open-files-in-binary-mode.patch new file mode 100644 index 0000000..fefd1a8 --- /dev/null +++ b/m4/all/patches/1.4.18-0008-open-files-in-binary-mode.patch @@ -0,0 +1,15 @@ +This will open all files in binary mode. +files may contain binary data. +This fixes e.g. autoconf, of whose frozen file, contains all characters from 0x00 to 0xff. + +--- src/path.c ++++ src/path.c +@@ -110,7 +110,7 @@ + static FILE * + m4_fopen (const char *file) + { +- FILE *fp = fopen (file, "r"); ++ FILE *fp = fopen (file, "rb"); + if (fp) + { + struct stat st; diff --git a/m4/all/patches/1.4.18-0009-disable-hardening-in-source.patch b/m4/all/patches/1.4.18-0009-disable-hardening-in-source.patch new file mode 100644 index 0000000..b72b413 --- /dev/null +++ b/m4/all/patches/1.4.18-0009-disable-hardening-in-source.patch @@ -0,0 +1,16 @@ +This requires linking to ssp on some systems, which might not always present. +If this is really desired: +* add `-lssp` to LDFLAGS, and +* add `-D_FORTIFY_SOURCE=2` to CPPFLAGS/CFLAGS + +--- lib/config.hin ++++ lib/config.hin +@@ -96,7 +96,7 @@ + /* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting newer glibc. */ + #if defined __OPTIMIZE__ && __OPTIMIZE__ +- # define _FORTIFY_SOURCE 2 ++ //# define _FORTIFY_SOURCE 2 + #endif + + diff --git a/m4/all/patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch b/m4/all/patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch new file mode 100644 index 0000000..5d5a404 --- /dev/null +++ b/m4/all/patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch @@ -0,0 +1,106 @@ +c-stack: stop using SIGSTKSZ + +It’s been proposed to stop making SIGSTKSZ an integer constant: +https://sourceware.org/pipermail/libc-alpha/2020-September/118028.html +Also, using SIGSTKSZ in #if did not conform to current POSIX. +Also, avoiding SIGSTKSZ makes the code simpler and easier to grok. +* lib/c-stack.c (SIGSTKSZ): Remove. +(alternate_signal_stack): Now a 64 KiB array, for simplicity. +All uses changed. + +[Retrieved (and backported) from: +https://git.savannah.gnu.org/cgit/gnulib.git/patch/?id=f9e2b20a12a230efa30f1d479563ae07d276a94b] +Signed-off-by: Fabrice Fontaine + +diff -Nura lib/c-stack.c lib/c-stack.c +--- lib/c-stack.c 2021-04-11 19:12:14.086494029 +0200 ++++ lib/c-stack.c 2021-04-11 19:48:46.316862760 +0200 +@@ -50,15 +50,16 @@ + #if ! HAVE_STACK_T && ! defined stack_t + typedef struct sigaltstack stack_t; + #endif +-#ifndef SIGSTKSZ +-# define SIGSTKSZ 16384 +-#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384 +-/* libsigsegv 2.6 through 2.8 have a bug where some architectures use +- more than the Linux default of an 8k alternate stack when deciding +- if a fault was caused by stack overflow. */ +-# undef SIGSTKSZ +-# define SIGSTKSZ 16384 +-#endif ++ ++/* Storage for the alternate signal stack. ++ 64 KiB is not too large for Gnulib-using apps, and is large enough ++ for all known platforms. Smaller sizes may run into trouble. ++ For example, libsigsegv 2.6 through 2.8 have a bug where some ++ architectures use more than the Linux default of an 8 KiB alternate ++ stack when deciding if a fault was caused by stack overflow. */ ++static max_align_t alternate_signal_stack[(64 * 1024 ++ + sizeof (max_align_t) - 1) ++ / sizeof (max_align_t)]; + + #include + #include +@@ -128,19 +129,6 @@ + #if (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK \ + && HAVE_STACK_OVERFLOW_HANDLING) || HAVE_LIBSIGSEGV + +-/* Storage for the alternate signal stack. */ +-static union +-{ +- char buffer[SIGSTKSZ]; +- +- /* These other members are for proper alignment. There's no +- standard way to guarantee stack alignment, but this seems enough +- in practice. */ +- long double ld; +- long l; +- void *p; +-} alternate_signal_stack; +- + static void + null_action (int signo __attribute__ ((unused))) + { +@@ -205,8 +193,8 @@ + + /* Always install the overflow handler. */ + if (stackoverflow_install_handler (overflow_handler, +- alternate_signal_stack.buffer, +- sizeof alternate_signal_stack.buffer)) ++ alternate_signal_stack, ++ sizeof alternate_signal_stack)) + { + errno = ENOTSUP; + return -1; +@@ -279,14 +267,14 @@ + stack_t st; + struct sigaction act; + st.ss_flags = 0; ++ st.ss_sp = alternate_signal_stack; ++ st.ss_size = sizeof alternate_signal_stack; + # if SIGALTSTACK_SS_REVERSED + /* Irix mistakenly treats ss_sp as the upper bound, rather than + lower bound, of the alternate stack. */ +- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ - sizeof (void *); +- st.ss_size = sizeof alternate_signal_stack.buffer - sizeof (void *); +-# else +- st.ss_sp = alternate_signal_stack.buffer; +- st.ss_size = sizeof alternate_signal_stack.buffer; ++ st.ss_size -= sizeof (void *); ++ char *ss_sp = st.ss_sp; ++ st.ss_sp = ss_sp + st.ss_size; + # endif + r = sigaltstack (&st, NULL); + if (r != 0) +diff -Nura lib/c-stack.h lib/c-stack.h +--- lib/c-stack.h 2021-04-11 19:12:14.098494042 +0200 ++++ lib/c-stack.h 2021-04-11 19:17:42.138848378 +0200 +@@ -34,7 +34,7 @@ + A null ACTION acts like an action that does nothing. + + ACTION must be async-signal-safe. ACTION together with its callees +- must not require more than SIGSTKSZ bytes of stack space. Also, ++ must not require more than 64 KiB bytes of stack space. Also, + ACTION should not call longjmp, because this implementation does + not guarantee that it is safe to return to the original stack. + diff --git a/m4/all/patches/1.4.19-0001-open-files-in-binary-mode.patch b/m4/all/patches/1.4.19-0001-open-files-in-binary-mode.patch new file mode 100644 index 0000000..91f68e0 --- /dev/null +++ b/m4/all/patches/1.4.19-0001-open-files-in-binary-mode.patch @@ -0,0 +1,15 @@ +This will open all files in binary mode. +files may contain binary data. +This fixes e.g. autoconf, of whose frozen file, contains all characters from 0x00 to 0xff. + +--- src/path.c ++++ src/path.c +@@ -110,7 +110,7 @@ + static FILE * + m4_fopen (const char *file) + { +- FILE *fp = fopen (file, "re"); ++ FILE *fp = fopen (file, "reb"); + if (fp) + { + struct stat st; diff --git a/m4/all/patches/1.4.19-0002-ar-lib.patch b/m4/all/patches/1.4.19-0002-ar-lib.patch new file mode 100644 index 0000000..22f7abe --- /dev/null +++ b/m4/all/patches/1.4.19-0002-ar-lib.patch @@ -0,0 +1,276 @@ +ar-lib is needed for building m4 with Visual Studio. +Re-use the one from m4/1.4.18. +We can't use automake here to avoid a build cycle (m4 -> automake -> autoconf -> m4) +--- /dev/null ++++ build-aux/ar-lib +@@ -0,0 +1,270 @@ ++#! /bin/sh ++# Wrapper for Microsoft lib.exe ++ ++me=ar-lib ++scriptversion=2012-03-01.08; # UTC ++ ++# Copyright (C) 2010-2014 Free Software Foundation, Inc. ++# Written by Peter Rosin . ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2, or (at your option) ++# any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# As a special exception to the GNU General Public License, if you ++# distribute this file as part of a program that contains a ++# configuration script generated by Autoconf, you may include it under ++# the same distribution terms that you use for the rest of that program. ++ ++# This file is maintained in Automake, please report ++# bugs to or send patches to ++# . ++ ++ ++# func_error message ++func_error () ++{ ++ echo "$me: $1" 1>&2 ++ exit 1 ++} ++ ++file_conv= ++ ++# func_file_conv build_file ++# Convert a $build file to $host form and store it in $file ++# Currently only supports Windows hosts. ++func_file_conv () ++{ ++ file=$1 ++ case $file in ++ / | /[!/]*) # absolute file, and not a UNC file ++ if test -z "$file_conv"; then ++ # lazily determine how to convert abs files ++ case `uname -s` in ++ MINGW*) ++ file_conv=mingw ++ ;; ++ CYGWIN*) ++ file_conv=cygwin ++ ;; ++ *) ++ file_conv=wine ++ ;; ++ esac ++ fi ++ case $file_conv in ++ mingw) ++ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ++ ;; ++ cygwin) ++ file=`cygpath -m "$file" || echo "$file"` ++ ;; ++ wine) ++ file=`winepath -w "$file" || echo "$file"` ++ ;; ++ esac ++ ;; ++ esac ++} ++ ++# func_at_file at_file operation archive ++# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE ++# for each of them. ++# When interpreting the content of the @FILE, do NOT use func_file_conv, ++# since the user would need to supply preconverted file names to ++# binutils ar, at least for MinGW. ++func_at_file () ++{ ++ operation=$2 ++ archive=$3 ++ at_file_contents=`cat "$1"` ++ eval set x "$at_file_contents" ++ shift ++ ++ for member ++ do ++ $AR -NOLOGO $operation:"$member" "$archive" || exit $? ++ done ++} ++ ++case $1 in ++ '') ++ func_error "no command. Try '$0 --help' for more information." ++ ;; ++ -h | --h*) ++ cat < ++#endif ++ + /* TRANSLATORS: This is a non-ASCII name: The first name is (with + Unicode escapes) "Ren\u00e9" or (with HTML entities) "René". */ + #define AUTHORS proper_name_utf8 ("Rene' Seindal", "Ren\xC3\xA9 Seindal") +@@ -423,6 +427,15 @@ main (int argc, char *const *argv) + textdomain (PACKAGE); + atexit (close_stdin); + ++#ifdef _WIN32 ++ _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); ++ _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); ++ _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); ++ _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); ++ _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); ++ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); ++#endif ++ + include_init (); + debug_init (); + diff --git a/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch b/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch new file mode 100644 index 0000000..9386ee5 --- /dev/null +++ b/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch @@ -0,0 +1,16 @@ +This requires linking to ssp on some systems, which might not always present. +If this is really desired: +* add `-lssp` to LDFLAGS, and +* add `-D_FORTIFY_SOURCE=2` to CPPFLAGS/CFLAGS + +--- a/lib/config.hin ++++ b/lib/config.hin +@@ -198,7 +198,7 @@ + /* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting newer glibc. */ + #if defined __OPTIMIZE__ && __OPTIMIZE__ +- # define _FORTIFY_SOURCE 2 ++ //# define _FORTIFY_SOURCE 2 + #endif + + diff --git a/m4/all/test_package/conanfile.py b/m4/all/test_package/conanfile.py new file mode 100644 index 0000000..4a294ed --- /dev/null +++ b/m4/all/test_package/conanfile.py @@ -0,0 +1,37 @@ +from conan import ConanFile +from conan.tools.files import save +from io import StringIO +import os +import textwrap + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + @property + def _m4_input_path(self): + return os.path.join(self.build_folder, "input.m4") + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def build(self): + save(self, self._m4_input_path, textwrap.dedent("""\ + m4_define(NAME1, `Harry, Jr.') + m4_define(NAME2, `Sally') + m4_define(MET, `$1 met $2') + MET(`NAME1', `NAME2') + """)) + + def test(self): + extension = ".exe" if self.settings.os == "Windows" else "" + self.run(f"m4{extension} --version") + self.run(f"m4{extension} -P {self._m4_input_path}") + + self.run(f"m4{extension} -R {self.source_folder}/frozen.m4f {self.source_folder}/test.m4") + + output = StringIO() + self.run(f"m4{extension} -P {self._m4_input_path}", output) + assert "Harry, Jr. met Sally" in output.getvalue() diff --git a/m4/all/test_package/frozen.m4f b/m4/all/test_package/frozen.m4f new file mode 100644 index 0000000..26431a1 --- /dev/null +++ b/m4/all/test_package/frozen.m4f @@ -0,0 +1,11 @@ +# This is a frozen state file generated by GNU M4 1.4.18 +V1 +Q1,1 +[] +T9,27 +say_hello[Hello ]conanize_name([$1]) +T11,203 +all_letters +  !"#*%&'()$+,./0123456789:;<=>?@[\]^_`{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ- +T13,10 +conanize_name[Conan $1] diff --git a/m4/all/test_package/test.m4 b/m4/all/test_package/test.m4 new file mode 100644 index 0000000..a044834 --- /dev/null +++ b/m4/all/test_package/test.m4 @@ -0,0 +1,2 @@ +say_hello([World]) +[All letters: ]all_letters diff --git a/m4/all/test_v1_package/conanfile.py b/m4/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..fdefc97 --- /dev/null +++ b/m4/all/test_v1_package/conanfile.py @@ -0,0 +1,42 @@ +from conans import ConanFile, tools +from conans.errors import ConanException +from io import StringIO +import os +import textwrap + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + @property + def _m4_input_path(self): + return os.path.join(self.build_folder, "input.m4") + + def build(self): + tools.save(self._m4_input_path, textwrap.dedent("""\ + m4_define(NAME1, `Harry, Jr.') + m4_define(NAME2, `Sally') + m4_define(MET, `$1 met $2') + MET(`NAME1', `NAME2') + """)) + + def test(self): + if hasattr(self, "settings_build"): + exe_suffix = ".exe" if self.settings.os == "Windows" else "" + m4_bin = os.path.join(self.deps_cpp_info["m4"].rootpath, "bin", "m4" + exe_suffix) + else: + m4_bin = tools.get_env("M4") + if m4_bin is None or not m4_bin.startswith(self.deps_cpp_info["m4"].rootpath): + raise ConanException("M4 environment variable not set") + + if not tools.cross_building(self, skip_x64_x86=True): + self.run(f"{m4_bin} --version", run_environment=True) + self.run(f"{m4_bin} -P {self._m4_input_path}") + + test_package_dir = os.path.join(self.source_folder, os.pardir, "test_package") + self.run(f"{m4_bin} -R {test_package_dir}/frozen.m4f {test_package_dir}/test.m4", run_environment=True) + + output = StringIO() + self.run(f"{m4_bin} -P {self._m4_input_path}", output=output) + + assert "Harry, Jr. met Sally" in output.getvalue() diff --git a/m4/config.yml b/m4/config.yml new file mode 100644 index 0000000..d9912c9 --- /dev/null +++ b/m4/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.19": + folder: all + "1.4.18": + folder: all diff --git a/marisa/all/conandata.yml b/marisa/all/conandata.yml new file mode 100644 index 0000000..6f5b0ae --- /dev/null +++ b/marisa/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.2.6": + url: "https://github.com/s-yata/marisa-trie/archive/refs/tags/v0.2.6.tar.gz" + sha256: "1063a27c789e75afa2ee6f1716cc6a5486631dcfcb7f4d56d6485d2462e566de" +patches: + "0.2.6": + - patch_file: "patches/0001-add-cmake.patch" diff --git a/marisa/all/conanfile.py b/marisa/all/conanfile.py new file mode 100644 index 0000000..05b8f17 --- /dev/null +++ b/marisa/all/conanfile.py @@ -0,0 +1,78 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir + +required_conan_version = ">=1.53.0" + + +class MarisaConan(ConanFile): + name = "marisa" + description = "Matching Algorithm with Recursively Implemented StorAge " + license = ("BSD-2-Clause", "LGPL-2.1") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/s-yata/marisa-trie" + topics = ("algorithm", "dictionary", "marisa") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "tools": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TOOLS"] = self.options.tools + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="COPYING.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "marisa") + self.cpp_info.libs = ["marisa"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + + # TODO: to remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH env var with : '{bin_path}'") + self.env_info.PATH.append(bin_path) diff --git a/marisa/all/patches/0001-add-cmake.patch b/marisa/all/patches/0001-add-cmake.patch new file mode 100644 index 0000000..4635c52 --- /dev/null +++ b/marisa/all/patches/0001-add-cmake.patch @@ -0,0 +1,120 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..c7e4c0e +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,114 @@ ++cmake_minimum_required(VERSION 3.1) ++project(marisa CXX) ++ ++include(GNUInstallDirs) ++ ++option(BUILD_SHARED_LIBS "Build as shared library" OFF) ++option(BUILD_TOOLS "Build tools" ON) ++option(ENABLE_TESTS "Build and run tests" ON) ++ ++if(BUILD_SHARED_LIBS) ++ set(MARISA_LIBRARY_TYPE SHARED) ++else() ++ set(MARISA_LIBRARY_TYPE STATIC) ++endif(BUILD_SHARED_LIBS) ++ ++set(CMAKE_CXX_STANDARD 11) ++ ++if(NOT CMAKE_BUILD_TYPE) ++ set(CMAKE_BUILD_TYPE Debug) ++endif() ++ ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") ++ ++if(NOT MSVC) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weffc++ -Wextra -Wconversion") ++endif() ++ ++if(BUILD_SHARED_LIBS AND MSVC) ++ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++endif() ++ ++include_directories("${PROJECT_SOURCE_DIR}/include") ++include_directories("${PROJECT_SOURCE_DIR}/lib") ++ ++set(HDR_COMPAT ++ include/marisa.h) ++ ++set(HDR_PUBLIC ++ include/marisa/agent.h ++ include/marisa/base.h ++ include/marisa/exception.h ++ include/marisa/iostream.h ++ include/marisa/key.h ++ include/marisa/keyset.h ++ include/marisa/query.h ++ include/marisa/scoped-array.h ++ include/marisa/scoped-ptr.h ++ include/marisa/stdio.h ++ include/marisa/trie.h) ++add_library(marisa ${MARISA_LIBRARY_TYPE} ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/io/mapper.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/io/reader.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/io/writer.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/trie/tail.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/trie/louds-trie.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/vector/bit-vector.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/keyset.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/trie.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/agent.cc") ++ ++install(TARGETS marisa ++ RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ ++if(BUILD_TOOLS) ++ add_library(cmdopt OBJECT "${PROJECT_SOURCE_DIR}/tools/cmdopt.cc") ++ set(TOOLS ++ marisa-benchmark ++ marisa-build ++ marisa-common-prefix-search ++ marisa-dump ++ marisa-lookup ++ marisa-predictive-search ++ marisa-reverse-lookup ++ ) ++ ++ foreach(TOOL ${TOOLS}) ++ add_executable(${TOOL} "${PROJECT_SOURCE_DIR}/tools/${TOOL}.cc") ++ target_link_libraries(${TOOL} PRIVATE marisa cmdopt) ++ install(TARGETS ${TOOL} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) ++ endforeach(TOOL) ++endif() ++ ++if(ENABLE_TESTS) ++ enable_testing() ++ set(TESTS ++ base-test ++ io-test ++ trie-test ++ vector-test ++ marisa-test ++ ) ++ ++ foreach(TEST ${TESTS}) ++ add_executable(${TEST} "${PROJECT_SOURCE_DIR}/tests/${TEST}.cc") ++ target_link_libraries(${TEST} PRIVATE marisa) ++ add_test(${TEST} ${TEST}) ++ endforeach(TEST) ++endif() ++ ++configure_file( ++ ${PROJECT_SOURCE_DIR}/marisa.pc.in ++ ${PROJECT_BINARY_DIR}/marisa.pc ++ @ONLY) ++install(FILES ${PROJECT_BINARY_DIR}/marisa.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++ ++install(FILES ${HDR_COMPAT} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++ ++install(FILES ${HDR_PUBLIC} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/marisa) diff --git a/marisa/all/test_package/CMakeLists.txt b/marisa/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..8f42c91 --- /dev/null +++ b/marisa/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(marisa REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} marisa::marisa) diff --git a/marisa/all/test_package/conanfile.py b/marisa/all/test_package/conanfile.py new file mode 100644 index 0000000..fae501d --- /dev/null +++ b/marisa/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/marisa/all/test_package/test_package.cpp b/marisa/all/test_package/test_package.cpp new file mode 100644 index 0000000..5180045 --- /dev/null +++ b/marisa/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include "marisa.h" + +#include + +int main() { + int x = 100; + int y = 200; + + marisa::swap(x, y); + + return EXIT_SUCCESS; +} diff --git a/marisa/all/test_v1_package/CMakeLists.txt b/marisa/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..91630d7 --- /dev/null +++ b/marisa/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/marisa/all/test_v1_package/conanfile.py b/marisa/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..251bf8a --- /dev/null +++ b/marisa/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os +from conans import CMake, ConanFile, tools +from conan.tools.build import cross_building + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/marisa/config.yml b/marisa/config.yml new file mode 100644 index 0000000..070a324 --- /dev/null +++ b/marisa/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.6": + folder: all diff --git a/meson/all/conandata.yml b/meson/all/conandata.yml new file mode 100644 index 0000000..ff346a7 --- /dev/null +++ b/meson/all/conandata.yml @@ -0,0 +1,54 @@ +sources: + "1.5.0": + url: "https://github.com/mesonbuild/meson/archive/1.5.0.tar.gz" + sha256: "781913826fb6f478eb7d77e1942ab3df39444e4c90e9a3523737e215171db469" + "1.4.1": + url: "https://github.com/mesonbuild/meson/archive/1.4.1.tar.gz" + sha256: "a7efc72ecb873c5a62031ade1921a7177b67cfdcb2e9410a7ab023f9e8192f4b" + "1.4.0": + url: "https://github.com/mesonbuild/meson/archive/1.4.0.tar.gz" + sha256: "61382f295378bddcd9bebb3a9a9065b1cbc671fa41b80964ab02726f9a5f3a88" + "1.3.2": + url: "https://github.com/mesonbuild/meson/archive/1.3.2.tar.gz" + sha256: "683082fb3c5cddf203b21d29bdf4c227e2f7964da5324a15e1a5f7db94322b4b" + "1.3.1": + url: "https://github.com/mesonbuild/meson/archive/1.3.1.tar.gz" + sha256: "274c121edb859602eb4589d31d8791e980748bb19950fc6f611a21d76dc22cc6" + "1.3.0": + url: "https://github.com/mesonbuild/meson/releases/download/1.3.0/meson-1.3.0.tar.gz" + sha256: "4ba253ef60e454e23234696119cbafa082a0aead0bd3bbf6991295054795f5dc" + "1.2.3": + url: "https://github.com/mesonbuild/meson/releases/download/1.2.3/meson-1.2.3.tar.gz" + sha256: "4533a43c34548edd1f63a276a42690fce15bde9409bcf20c4b8fa3d7e4d7cac1" + "1.2.2": + url: "https://github.com/mesonbuild/meson/releases/download/1.2.2/meson-1.2.2.tar.gz" + sha256: "4a0f04de331fbc7af3b802a844fc8838f4ccd1ded1e792ba4f8f2faf8c5fe4d6" + "1.2.1": + url: "https://github.com/mesonbuild/meson/releases/download/1.2.1/meson-1.2.1.tar.gz" + sha256: "b1db3a153087549497ee52b1c938d2134e0338214fe14f7efd16fecd57b639f5" + "1.2.0": + url: "https://github.com/mesonbuild/meson/archive/1.2.0.tar.gz" + sha256: "603489f0aaa6305f806c6cc4a4455a965f22290fc74f65871f589b002110c790" + "1.1.1": + url: "https://github.com/mesonbuild/meson/releases/download/1.1.1/meson-1.1.1.tar.gz" + sha256: "d04b541f97ca439fb82fab7d0d480988be4bd4e62563a5ca35fadb5400727b1c" + # qt requires 1.1.0 + "1.1.0": + url: "https://github.com/mesonbuild/meson/archive/1.1.0.tar.gz" + sha256: "f29a3e14062043d75e82d16f1e41856e6b1ed7a7c016e10c7b13afa7ee6364cc" + # wayland-protocols requires 1.0.0 + "1.0.0": + url: "https://github.com/mesonbuild/meson/releases/download/1.0.0/meson-1.0.0.tar.gz" + sha256: "aa50a4ba4557c25e7d48446abfde857957dcdf58385fffbe670ba0e8efacce05" + # gtk requires 0.62.2 + "0.62.2": + url: "https://github.com/mesonbuild/meson/archive/0.62.2.tar.gz" + sha256: "97108f4d9bb16bc758c44749bd25ec7d42c6a762961efbed8b7589a2a3551ea6" + # gst-plugins-base requires 0.61.2 + "0.61.2": + url: "https://github.com/mesonbuild/meson/archive/0.61.2.tar.gz" + sha256: "33cd555314a94d52acfbb3f6f44d4e61c4ad0bfec7acf4301be7e40bb969b3a8" + # gobject-introspection requires 0.59.3 + "0.59.3": + url: "https://github.com/mesonbuild/meson/archive/0.59.3.tar.gz" + sha256: "b2c5bfd5032189a66cf6a32d98ba82d94d7d314577d8efe4d9dc159c4073f282" diff --git a/meson/all/conanfile.py b/meson/all/conanfile.py new file mode 100644 index 0000000..f11560d --- /dev/null +++ b/meson/all/conanfile.py @@ -0,0 +1,73 @@ +import os +import textwrap + +from conan import ConanFile, conan_version +from conan.tools.files import copy, get, rmdir, save +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class MesonConan(ConanFile): + name = "meson" + package_type = "application" + description = "Meson is a project to create the best possible next-generation build system" + topics = ("meson", "mesonbuild", "build-system") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mesonbuild/meson" + license = "Apache-2.0" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.conf.get("tools.meson.mesontoolchain:backend", default="ninja", check_type=str) == "ninja": + self.requires("ninja/1.11.1") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=self.source_folder, dst=os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "bin", "test cases")) + + # create wrapper scripts + save(self, os.path.join(self.package_folder, "bin", "meson.cmd"), textwrap.dedent("""\ + @echo off + set PYTHONDONTWRITEBYTECODE=1 + CALL python %~dp0/meson.py %* + """)) + save(self, os.path.join(self.package_folder, "bin", "meson"), textwrap.dedent("""\ + #!/usr/bin/env bash + meson_dir=$(dirname "$0") + export PYTHONDONTWRITEBYTECODE=1 + exec "$meson_dir/meson.py" "$@" + """)) + + @staticmethod + def _chmod_plus_x(filename): + if os.name == "posix": + os.chmod(filename, os.stat(filename).st_mode | 0o111) + + def package_info(self): + meson_root = os.path.join(self.package_folder, "bin") + self._chmod_plus_x(os.path.join(meson_root, "meson")) + self._chmod_plus_x(os.path.join(meson_root, "meson.py")) + + self.cpp_info.builddirs = [os.path.join("bin", "mesonbuild", "cmake", "data")] + + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + if Version(conan_version).major < 2: + self.env_info.PATH.append(meson_root) diff --git a/meson/all/test_package/conanfile.py b/meson/all/test_package/conanfile.py new file mode 100644 index 0000000..19ffe68 --- /dev/null +++ b/meson/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "MesonToolchain", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + basic_layout(self) + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def test(self): + self.run("meson --version") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/meson/all/test_package/meson.build b/meson/all/test_package/meson.build new file mode 100644 index 0000000..fb2ab04 --- /dev/null +++ b/meson/all/test_package/meson.build @@ -0,0 +1,2 @@ +project('test_package', 'cpp') +executable('test_package', 'test_package.cpp') diff --git a/meson/all/test_package/test_package.cpp b/meson/all/test_package/test_package.cpp new file mode 100644 index 0000000..5ddd507 --- /dev/null +++ b/meson/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("Hello from Meson.\n"); + return 0; +} diff --git a/meson/all/test_v1_package/conanfile.py b/meson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..c8624c6 --- /dev/null +++ b/meson/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +from conans import ConanFile, Meson, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + + def build(self): + if not tools.cross_building(self): + meson = Meson(self) + meson.configure(build_folder="build") + meson.build() + + def test(self): + self.run("meson --version") + if not tools.cross_building(self): + bin_path = os.path.join("build", "test_package") + self.run(bin_path, run_environment=True) diff --git a/meson/all/test_v1_package/meson.build b/meson/all/test_v1_package/meson.build new file mode 100644 index 0000000..e67dd97 --- /dev/null +++ b/meson/all/test_v1_package/meson.build @@ -0,0 +1,2 @@ +project('test_package', 'cpp') +executable('test_package', '../test_package/test_package.cpp') diff --git a/meson/config.yml b/meson/config.yml new file mode 100644 index 0000000..ef65493 --- /dev/null +++ b/meson/config.yml @@ -0,0 +1,33 @@ +versions: + "1.5.0": + folder: all + "1.4.1": + folder: all + "1.4.0": + folder: all + "1.3.2": + folder: all + "1.3.1": + folder: all + "1.3.0": + folder: all + "1.2.3": + folder: all + "1.2.2": + folder: all + "1.2.1": + folder: all + "1.2.0": + folder: all + "1.1.1": + folder: all + "1.1.0": + folder: all + "1.0.0": + folder: all + "0.62.2": + folder: all + "0.61.2": + folder: all + "0.59.3": + folder: all diff --git a/ninja/all/conandata.yml b/ninja/all/conandata.yml new file mode 100644 index 0000000..36f42c6 --- /dev/null +++ b/ninja/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.12.1": + url: "https://github.com/ninja-build/ninja/archive/v1.12.1.tar.gz" + sha256: "821bdff48a3f683bc4bb3b6f0b5fe7b2d647cf65d52aeb63328c91a6c6df285a" + "1.12.0": + url: "https://github.com/ninja-build/ninja/archive/v1.12.0.tar.gz" + sha256: "8b2c86cd483dc7fcb7975c5ec7329135d210099a89bc7db0590a07b0bbfe49a5" + "1.11.1": + url: "https://github.com/ninja-build/ninja/archive/v1.11.1.tar.gz" + sha256: "31747ae633213f1eda3842686f83c2aa1412e0f5691d1c14dbbcc67fe7400cea" + "1.11.0": + url: "https://github.com/ninja-build/ninja/archive/v1.11.0.tar.gz" + sha256: "3c6ba2e66400fe3f1ae83deb4b235faf3137ec20bd5b08c29bfc368db143e4c6" + "1.10.2": + url: "https://github.com/ninja-build/ninja/archive/v1.10.2.tar.gz" + sha256: "ce35865411f0490368a8fc383f29071de6690cbadc27704734978221f25e2bed" diff --git a/ninja/all/conanfile.py b/ninja/all/conanfile.py new file mode 100644 index 0000000..6fede8d --- /dev/null +++ b/ninja/all/conanfile.py @@ -0,0 +1,55 @@ +from conan import ConanFile, conan_version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class NinjaConan(ConanFile): + name = "ninja" + package_type = "application" + description = "Ninja is a small build system with a focus on speed" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ninja-build/ninja" + topics = ("ninja", "build") + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + if self.settings.os == "Linux" and "libstdc++" in self.settings.compiler.libcxx: + # Link C++ library statically on Linux so that it can run on systems + # with an older C++ runtime + tc.cache_variables["CMAKE_EXE_LINKER_FLAGS"] = "-static-libstdc++ -static-libgcc" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 + if Version(conan_version).major < 2: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.CONAN_CMAKE_GENERATOR = "Ninja" diff --git a/ninja/all/test_package/conanfile.py b/ninja/all/test_package/conanfile.py new file mode 100644 index 0000000..18b4e00 --- /dev/null +++ b/ninja/all/test_package/conanfile.py @@ -0,0 +1,13 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + self.run("ninja --version") diff --git a/ninja/all/test_v1_package/conanfile.py b/ninja/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..f520548 --- /dev/null +++ b/ninja/all/test_v1_package/conanfile.py @@ -0,0 +1,12 @@ +from conans import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + + def test(self): + self.run("ninja --version", run_environment=True) diff --git a/ninja/config.yml b/ninja/config.yml new file mode 100644 index 0000000..8d14bc8 --- /dev/null +++ b/ninja/config.yml @@ -0,0 +1,11 @@ +versions: + "1.12.1": + folder: all + "1.12.0": + folder: all + "1.11.1": + folder: all + "1.11.0": + folder: all + "1.10.2": + folder: all diff --git a/nlohmann_json/all/conandata.yml b/nlohmann_json/all/conandata.yml new file mode 100644 index 0000000..971d019 --- /dev/null +++ b/nlohmann_json/all/conandata.yml @@ -0,0 +1,55 @@ +sources: + "3.11.3": + url: "https://github.com/nlohmann/json/archive/v3.11.3.tar.gz" + sha256: "0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406" + "3.11.2": + url: "https://github.com/nlohmann/json/archive/v3.11.2.tar.gz" + sha256: "d69f9deb6a75e2580465c6c4c5111b89c4dc2fa94e3a85fcd2ffcd9a143d9273" + "3.11.1": + url: "https://github.com/nlohmann/json/archive/v3.11.1.tar.gz" + sha256: "598becb62ee0e01cf32795073c8ae09b6e95335cd43a4417b785d93ce105b0d0" + "3.11.0": + url: "https://github.com/nlohmann/json/archive/v3.11.0.tar.gz" + sha256: "e0c4fbd03c0bb7e99b40791e0276be61e5f531106e1486e8f0d771a7ed6d754a" + "3.10.5": + url: "https://github.com/nlohmann/json/archive/v3.10.5.tar.gz" + sha256: "5daca6ca216495edf89d167f808d1d03c4a4d929cef7da5e10f135ae1540c7e4" + "3.10.4": + url: "https://github.com/nlohmann/json/archive/v3.10.4.tar.gz" + sha256: "1155fd1a83049767360e9a120c43c578145db3204d2b309eba49fbbedd0f4ed3" + "3.10.3": + url: "https://github.com/nlohmann/json/archive/v3.10.3.tar.gz" + sha256: "e0d7c1b120cac47fa7f14a41d10a5d390f67d423d8e97b9d6834887285d6873c" + "3.10.2": + sha256: 081ed0f9f89805c2d96335c3acfa993b39a0a5b4b4cef7edb68dd2210a13458c + url: https://github.com/nlohmann/json/archive/v3.10.2.tar.gz + "3.10.0": + sha256: eb8b07806efa5f95b349766ccc7a8ec2348f3b2ee9975ad879259a371aea8084 + url: https://github.com/nlohmann/json/archive/v3.10.0.tar.gz + "3.9.1": + sha256: 4cf0df69731494668bdd6460ed8cb269b68de9c19ad8c27abc24cd72605b2d5b + url: https://github.com/nlohmann/json/archive/v3.9.1.tar.gz + "3.9.0": + sha256: 9943db11eeaa5b23e58a88fbc26c453faccef7b546e55063ad00e7caaaf76d0b + url: https://github.com/nlohmann/json/archive/v3.9.0.tar.gz + "3.8.0": + sha256: 7d0edf65f2ac7390af5e5a0b323b31202a6c11d744a74b588dc30f5a8c9865ba + url: https://github.com/nlohmann/json/archive/v3.8.0.tar.gz + "3.7.3": + sha256: 249548F4867417D66AE46B338DFE0A2805F3323E81C9E9B83C89F3ADBFDE6F31 + url: https://github.com/nlohmann/json/archive/v3.7.3.tar.gz + "3.7.0": + sha256: D51A3A8D3EFBB1139D7608E28782EA9EFEA7E7933157E8FF8184901EFD8EE760 + url: https://github.com/nlohmann/json/archive/v3.7.0.tar.gz + "3.5.0": + sha256: E0B1FC6CC6CA05706CCE99118A87ACA5248BD9DB3113E703023D23F044995C1D + url: https://github.com/nlohmann/json/archive/v3.5.0.tar.gz + "3.4.0": + sha256: C377963A95989270C943D522BFEFE7B889EF5ED0E1E15D535FD6F6F16ED70732 + url: https://github.com/nlohmann/json/archive/v3.4.0.tar.gz + "3.2.0": + sha256: 2de558ff3b3b32eebfb51cf2ceb835a0fa5170e6b8712b02be9c2c07fcfe52a1 + url: https://github.com/nlohmann/json/archive/v3.2.0.tar.gz + "3.1.1": + sha256: 9f3549824af3ca7e9707a2503959886362801fb4926b869789d6929098a79e47 + url: https://github.com/nlohmann/json/archive/v3.1.1.tar.gz diff --git a/nlohmann_json/all/conanfile.py b/nlohmann_json/all/conanfile.py new file mode 100644 index 0000000..98eaf15 --- /dev/null +++ b/nlohmann_json/all/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class NlohmannJsonConan(ConanFile): + name = "nlohmann_json" + homepage = "https://github.com/nlohmann/json" + description = "JSON for Modern C++ parser and generator." + topics = "json", "header-only" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + pass + + def build(self): + pass + + def package(self): + copy(self, "LICENSE*", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "nlohmann_json") + self.cpp_info.set_property("cmake_target_name", "nlohmann_json::nlohmann_json") + self.cpp_info.set_property("pkg_config_name", "nlohmann_json") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/nlohmann_json/all/test_package/CMakeLists.txt b/nlohmann_json/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..8976512 --- /dev/null +++ b/nlohmann_json/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(nlohmann_json REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nlohmann_json::nlohmann_json) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/nlohmann_json/all/test_package/conanfile.py b/nlohmann_json/all/test_package/conanfile.py new file mode 100644 index 0000000..cb68885 --- /dev/null +++ b/nlohmann_json/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/nlohmann_json/all/test_package/test_package.cpp b/nlohmann_json/all/test_package/test_package.cpp new file mode 100644 index 0000000..1289a2f --- /dev/null +++ b/nlohmann_json/all/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#include + +#include + +using json = nlohmann::json; + +int main() { + const json data = { + {"pi", 3.141}, + {"happy", true}, + {"name", "Niels"}, + {"nothing", nullptr}, + {"answer", { + {"everything", 42} + }}, + {"list", {1, 0, 2}}, + {"object", { + {"currency", "USD"}, + {"value", 42.99} + }} + }; + +#if JSON_USE_IMPLICIT_CONVERSIONS + float f = data["pi"]; +#else + auto f = data["pi"].get(); +#endif + std::cout << data.dump(4) << "\n"; + return 0; +} diff --git a/nlohmann_json/all/test_v1_package/CMakeLists.txt b/nlohmann_json/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..925ecbe --- /dev/null +++ b/nlohmann_json/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/nlohmann_json/all/test_v1_package/conanfile.py b/nlohmann_json/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..37ada80 --- /dev/null +++ b/nlohmann_json/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os + +from conan.tools.build import cross_building +from conans import ConanFile, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/nlohmann_json/config.yml b/nlohmann_json/config.yml new file mode 100644 index 0000000..ad526c4 --- /dev/null +++ b/nlohmann_json/config.yml @@ -0,0 +1,37 @@ +versions: + "3.11.3": + folder: all + "3.11.2": + folder: all + "3.11.1": + folder: all + "3.11.0": + folder: all + "3.10.5": + folder: all + "3.10.4": + folder: all + "3.10.3": + folder: all + "3.10.2": + folder: all + "3.10.0": + folder: all + "3.9.1": + folder: all + "3.9.0": + folder: all + "3.8.0": + folder: all + "3.7.3": + folder: all + "3.7.0": + folder: all + "3.5.0": + folder: all + "3.4.0": + folder: all + "3.2.0": + folder: all + "3.1.1": + folder: all diff --git a/onetbb/2020.x/conandata.yml b/onetbb/2020.x/conandata.yml new file mode 100644 index 0000000..bca751a --- /dev/null +++ b/onetbb/2020.x/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2020.3.3": + url: "https://github.com/oneapi-src/oneTBB/archive/v2020.3.3.tar.gz" + sha256: "494ac15f60e91d95ed7aec04f4e1d389b8a55bffc581d0fe9116b99336401963" + "2020.3": + url: "https://github.com/oneapi-src/oneTBB/archive/v2020.3.tar.gz" + sha256: "ebc4f6aa47972daed1f7bf71d100ae5bf6931c2e3144cf299c8cc7d041dca2f3" + "2020.2": + url: "https://github.com/oneapi-src/oneTBB/archive/v2020.2.tar.gz" + sha256: "4804320e1e6cbe3a5421997b52199e3c1a3829b2ecb6489641da4b8e32faf500" + "2020.1": + url: "https://github.com/oneapi-src/oneTBB/archive/v2020.1.tar.gz" + sha256: "7c96a150ed22bc3c6628bc3fef9ed475c00887b26d37bca61518d76a56510971" + "2020.0": + url: "https://github.com/oneapi-src/oneTBB/archive/v2020.0.tar.gz" + sha256: "57714f2d2cf33935db33cee93af57eb3ecd5a7bef40c1fb7ca4a41d79684b118" + "2019_u9": + url: "https://github.com/oneapi-src/oneTBB/archive/2019_U9.tar.gz" + sha256: "3f5ea81b9caa195f1967a599036b473b2e7c347117330cda99b79cfcf5b77c84" diff --git a/onetbb/2020.x/conanfile.py b/onetbb/2020.x/conanfile.py new file mode 100644 index 0000000..3975cf2 --- /dev/null +++ b/onetbb/2020.x/conanfile.py @@ -0,0 +1,291 @@ +import os +import re +import textwrap + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd +from conan.tools.files import chdir, copy, get, replace_in_file, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.intel import IntelCC +from conan.tools.layout import basic_layout +from conan.tools.microsoft import VCVars, msvs_toolset, msvc_runtime_flag, is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class OneTBBConan(ConanFile): + name = "onetbb" + description = ( + "oneAPI Threading Building Blocks (oneTBB) lets you easily write parallel " + "C++ programs that take full advantage of multicore performance, that " + "are portable, composable and have future-proof scalability." + ) + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/oneapi-src/oneTBB" + topics = ("tbb", "threading", "parallelism", "tbbmalloc") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tbbmalloc": [True, False], + "tbbproxy": [True, False], + } + default_options = { + "shared": True, + "fPIC": True, + "tbbmalloc": False, + "tbbproxy": False, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _base_compiler(self): + base = self.settings.get_safe("compiler.base") + if base: + return self.settings.compiler.base + return self.settings.compiler + + @property + def _is_msvc(self): + return str(self._base_compiler) in ["Visual Studio", "msvc"] + + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.options.tbbmalloc + del self.info.options.tbbproxy + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if is_apple_os(self): + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "8.0": + raise ConanInvalidConfiguration(f"{self.name} {self.version} couldn't be built by apple-clang < 8.0") + if not self.options.shared: + self.output.warning("oneTBB strongly discourages usage of static linkage") + if self.options.tbbproxy and (not self.options.shared or not self.options.tbbmalloc): + raise ConanInvalidConfiguration("tbbproxy needs tbbmaloc and shared options") + + def build_requirements(self): + if self._settings_build.os == "Windows": + if not self.conf_info.get("tools.gnu:make_program", check_type=str): + self.tool_requires("make/4.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + if self._is_msvc: + link_cmd = "xilib" if self.settings.compiler == "intel-cc" else "lib" + save( + self, + os.path.join(self.source_folder, "build", "big_iron_msvc.inc"), + # copy of big_iron.inc adapted for MSVC + textwrap.dedent(f"""\ + LIB_LINK_CMD = {link_cmd}.exe + LIB_OUTPUT_KEY = /OUT: + LIB_LINK_FLAGS = + LIB_LINK_LIBS = + DYLIB_KEY = + override CXXFLAGS += -D__TBB_DYNAMIC_LOAD_ENABLED=0 -D__TBB_SOURCE_DIRECTLY_INCLUDED=1 + ITT_NOTIFY = + DLL = lib + LIBEXT = lib + LIBPREF = + LIBDL = + TBB.DLL = $(LIBPREF)tbb$(DEBUG_SUFFIX).$(LIBEXT) + LINK_TBB.LIB = $(TBB.DLL) + TBB.DEF = + TBB_NO_VERSION.DLL = + MALLOC.DLL = $(LIBPREF)tbbmalloc$(DEBUG_SUFFIX).$(LIBEXT) + LINK_MALLOC.LIB = $(MALLOC.DLL) + MALLOC.DEF = + MALLOC_NO_VERSION.DLL = + MALLOCPROXY.DLL = + MALLOCPROXY.DEF = + """), + ) + if not self.options.shared: + tc.make_args.append("extra_inc=big_iron_msvc.inc") + else: + if not self.options.shared: + tc.make_args.append("extra_inc=big_iron.inc") + + arch = { + "x86": "ia32", + "x86_64": "intel64", + "armv7": "armv7", + "armv8": "arm64" if is_apple_os(self) else "aarch64", + }[str(self.settings.arch)] + tc.make_args.append(f"arch={arch}") + + if self.settings.os == "iOS": + tc.make_args.append("target=ios") + + if str(self._base_compiler) in ("gcc", "clang", "apple-clang"): + if str(self._base_compiler.libcxx) in ("libstdc++", "libstdc++11"): + tc.make_args.append("stdlib=libstdc++") + elif str(self._base_compiler.libcxx) == "libc++": + tc.make_args.append("stdlib=libc++") + + if str(self.settings.compiler) == "intel-cc": + tc.make_args.append("compiler=icc") + elif str(self.settings.compiler) in ("clang", "apple-clang"): + tc.make_args.append("compiler=clang") + else: + tc.make_args.append("compiler=gcc") + + if self.settings.os in ["Linux", "FreeBSD"]: + # runtime is supposed to track the version of the c++ stdlib, + # the version of glibc, and the version of the linux kernel. + # However, it isn't actually used anywhere other than for + # logging and build directory names. + # TBB computes the value of this variable using gcc, which we + # don't necessarily want to require when building this recipe. + # Setting it to a dummy value prevents TBB from calling gcc. + tc.make_args.append("runtime=gnu") + elif self._is_msvc: + if "MT" in msvc_runtime_flag(self): + runtime = "vc_mt" + else: + # Convert MSVC toolset to TBB runtime id + # v140 -> vc14, v141 -> vc14.1, etc + toolset = msvs_toolset(self) + m = re.fullmatch(r"v(\d+)(\d)", toolset) + if m: + runtime = f"vc{m[1]}" + (f".{m[2]}" if m[2] != "0" else "") + else: + self.output.warning(f"Unknown MSVC toolset: {toolset}") + runtime = "vc14.2" + tc.make_args.append(f"runtime={runtime}") + + if self.settings.compiler == "intel-cc": + tc.make_args.append("compiler=icl") + else: + tc.make_args.append("compiler=cl") + elif self._is_clang_cl: + tc.extra_cflags.append("-mrtm") + tc.extra_cxxflags.append("-mrtm") + + tc.generate() + + if self.settings.compiler == "intel-cc": + intelcc = IntelCC(self) + intelcc.generate() + elif is_msvc(self): + # intentionally not using vcvars for clang-cl yet + vcvars = VCVars(self) + vcvars.generate() + + def _patch_sources(self): + # Fix LDFLAGS getting incorrectly applied to ar command + linux_include = os.path.join(self.source_folder, "build", "common_rules.inc") + replace_in_file(self, linux_include, "LIB_LINK_FLAGS += $(LDFLAGS)", "") + # Get the version of the current compiler instead of gcc + linux_include = os.path.join(self.source_folder, "build", "linux.inc") + replace_in_file(self, linux_include, "shell gcc", "shell $(CC)") + replace_in_file(self, linux_include, "= gcc", "= $(CC)") + if self.version != "2019_u9" and self.settings.build_type == "Debug": + replace_in_file(self, os.path.join(self.source_folder, "Makefile"), "release", "debug") + + def build(self): + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + for target in ["tbb", "tbbmalloc", "tbbproxy"]: + autotools.make(target) + + def package(self): + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, "*", + dst=os.path.join(self.package_folder, "include", "tbb", "compat"), + src=os.path.join(self.source_folder, "include", "tbb", "compat")) + + build_folder = os.path.join(self.source_folder, "build") + build_type = "debug" if self.settings.build_type == "Debug" else "release" + for extension in ["lib", "a", "dylib"]: + copy(self, f"*{build_type}*.{extension}", + dst=os.path.join(self.package_folder, "lib"), + src=build_folder, keep_path=False) + copy(self, f"*{build_type}*.dll", + dst=os.path.join(self.package_folder, "bin"), + src=build_folder, keep_path=False) + + # Copy also .dlls to lib folder so consumers can link against them directly when using MinGW + if self.settings.os == "Windows" and self.settings.compiler == "gcc": + copy(self, f"*{build_type}*.dll", + dst=os.path.join(self.package_folder, "lib"), + src=build_folder, keep_path=False) + + if self.settings.os in ["Linux", "FreeBSD"] and self.options.shared: + extension = "so" + copy(self, f"*{build_type}*.{extension}.*", + dst=os.path.join(self.package_folder, "lib"), + src=build_folder, keep_path=False) + # Create libtbb.so.2 -> libtbb.so, etc symlinks + with chdir(self, os.path.join(self.package_folder, "lib")): + for fname in os.listdir("."): + fname_without_version = fname.split(f".{extension}", 1)[0] + f".{extension}" + self.run(f'ln -s "{fname}" "{fname_without_version}"') + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "TBB") + self.cpp_info.set_property("cmake_target_name", "TBB::TBB") + + suffix = "_debug" if self.settings.build_type == "Debug" else "" + + # tbb + self.cpp_info.components["libtbb"].set_property("cmake_target_name", "TBB::tbb") + self.cpp_info.components["libtbb"].libs = [f"tbb{suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libtbb"].system_libs = ["m", "dl", "rt", "pthread"] + + # tbbmalloc + if self.options.tbbmalloc: + self.cpp_info.components["tbbmalloc"].set_property("cmake_target_name", "TBB::tbbmalloc") + self.cpp_info.components["tbbmalloc"].libs = [f"tbbmalloc{suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["tbbmalloc"].system_libs = ["m", "dl", "pthread"] + + # tbbmalloc_proxy + if self.options.tbbproxy: + self.cpp_info.components["tbbmalloc_proxy"].set_property("cmake_target_name", "TBB::tbbmalloc_proxy") + self.cpp_info.components["tbbmalloc_proxy"].libs = [f"tbbmalloc_proxy{suffix}"] + self.cpp_info.components["tbbmalloc_proxy"].requires = ["tbbmalloc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["tbbmalloc_proxy"].system_libs = ["m"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "TBB" + self.cpp_info.names["cmake_find_package_multi"] = "TBB" + self.cpp_info.components["libtbb"].names["cmake_find_package"] = "tbb" + self.cpp_info.components["libtbb"].names["cmake_find_package_multi"] = "tbb" diff --git a/onetbb/2020.x/test_package/CMakeLists.txt b/onetbb/2020.x/test_package/CMakeLists.txt new file mode 100644 index 0000000..2dd759c --- /dev/null +++ b/onetbb/2020.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(TBB REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} TBB::tbb) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/onetbb/2020.x/test_package/conanfile.py b/onetbb/2020.x/test_package/conanfile.py new file mode 100644 index 0000000..ef5d704 --- /dev/null +++ b/onetbb/2020.x/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/onetbb/2020.x/test_package/test_package.cpp b/onetbb/2020.x/test_package/test_package.cpp new file mode 100644 index 0000000..bdbc6a7 --- /dev/null +++ b/onetbb/2020.x/test_package/test_package.cpp @@ -0,0 +1,40 @@ +#include "tbb/task_group.h" +#include "tbb/flow_graph.h" +#include "tbb/compat/tuple" +#include + +using namespace tbb; +using namespace tbb::flow; + +int Fib(int n) { + if( n<2 ) { + return n; + } else { + int x, y; + task_group g; + g.run([&]{x=Fib(n-1);}); // spawn a task + g.run([&]{y=Fib(n-2);}); // spawn another task + g.wait(); // wait for both tasks to complete + return x+y; + } +} + +int main(){ + std::cout<<"Fib 6="< hello( g, + []( const continue_msg &) { + std::cout << "Hello"; + } + ); + continue_node< continue_msg> world( g, + []( const continue_msg &) { + std::cout << " World\n"; + } + ); + make_edge(hello, world); + hello.try_put(continue_msg()); + g.wait_for_all(); + return 0; +} diff --git a/onetbb/2020.x/test_v1_package/CMakeLists.txt b/onetbb/2020.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..91630d7 --- /dev/null +++ b/onetbb/2020.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/onetbb/2020.x/test_v1_package/conanfile.py b/onetbb/2020.x/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/onetbb/2020.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/onetbb/all/conandata.yml b/onetbb/all/conandata.yml new file mode 100644 index 0000000..d6288f6 --- /dev/null +++ b/onetbb/all/conandata.yml @@ -0,0 +1,49 @@ +sources: + "2021.12.0": + url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.12.0.tar.gz" + sha256: "c7bb7aa69c254d91b8f0041a71c5bcc3936acb64408a1719aec0b2b7639dd84f" + "2021.10.0": + url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.10.0.tar.gz" + sha256: "487023a955e5a3cc6d3a0d5f89179f9b6c0ae7222613a7185b0227ba0c83700b" + "2021.9.0": + url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.9.0.tar.gz" + sha256: "1ce48f34dada7837f510735ff1172f6e2c261b09460e3bf773b49791d247d24e" + "2021.8.0": + url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.8.0.tar.gz" + sha256: "eee380323bb7ce864355ed9431f85c43955faaae9e9bce35c62b372d7ffd9f8b" + "2021.7.0": + url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.7.0.tar.gz" + sha256: "2cae2a80cda7d45dc7c072e4295c675fff5ad8316691f26f40539f7e7e54c0cc" + "2021.6.0": + url: "https://github.com/oneapi-src/oneTBB/archive/v2021.6.0.tar.gz" + sha256: "4897dd106d573e9dacda8509ca5af1a0e008755bf9c383ef6777ac490223031f" + "2021.3.0": + url: "https://github.com/oneapi-src/oneTBB/archive/v2021.3.0.tar.gz" + sha256: "8f616561603695bbb83871875d2c6051ea28f8187dbe59299961369904d1d49e" +patches: + "2021.8.0": + - patch_description: "fix building for android with NDK >= 25" + patch_type: "portability" + patch_source: "https://github.com/oneapi-src/oneTBB/pull/953.patch" + patch_file: "patches/android-ndk25.patch" + "2021.7.0": + - patch_description: "fix building for android with NDK >= 25" + patch_type: "portability" + patch_source: "https://github.com/oneapi-src/oneTBB/pull/953.patch" + patch_file: "patches/android-ndk25.patch" + "2021.6.0": + - patch_description: "cherry-pick upstream patch: avoid android compile errors for current NDKs on releases <= 2021.6.0" + patch_type: "portability" + patch_source: "https://github.com/oneapi-src/oneTBB/pull/716.diff" + patch_file: "patches/fix-overeager-stripping-of-compile-flag.diff" + "2021.3.0": + - patch_description: "cherry-pick upstream patch: avoid android compile errors for current NDKs on releases <= 2021.6.0" + patch_type: "portability" + patch_source: "https://github.com/oneapi-src/oneTBB/pull/716.diff" + patch_file: "patches/fix-overeager-stripping-of-compile-flag.diff" + - patch_description: "Use pkg_search_module with IMPORTED_TARGET" + patch_type: "portability" + patch_source: + - "https://github.com/oneapi-src/oneTBB/pull/448.diff" + - "https://github.com/oneapi-src/oneTBB/commit/df3096075a00942acbdd3ce9347f5298cc153fd6.diff" + patch_file: "patches/pkg-search-module-use-imported-target.diff" diff --git a/onetbb/all/conanfile.py b/onetbb/all/conanfile.py new file mode 100644 index 0000000..7031f90 --- /dev/null +++ b/onetbb/all/conanfile.py @@ -0,0 +1,208 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, load, rmdir, rm +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version +import os +import re + +required_conan_version = ">=1.53.0" + + +class OneTBBConan(ConanFile): + name = "onetbb" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/oneapi-src/oneTBB" + description = ( + "oneAPI Threading Building Blocks (oneTBB) lets you easily write parallel C++" + " programs that take full advantage of multicore performance, that are portable, composable" + " and have future-proof scalability.") + topics = ("tbb", "threading", "parallelism", "tbbmalloc") + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "tbbmalloc": [True, False], + "tbbproxy": [True, False], + "tbbbind": [True, False], + "interprocedural_optimization": [True, False], + } + default_options = { + "tbbmalloc": True, + "tbbproxy": True, + "tbbbind": True, + "interprocedural_optimization": True, + } + + @property + def _has_tbbmalloc(self): + return Version(self.version) < "2021.5.0" or self.options.get_safe("tbbmalloc") + + @property + def _has_tbbproxy(self): + return Version(self.version) < "2021.6.0" or self.options.get_safe("tbbproxy") + + @property + def _tbbbind_hwloc_version(self): + # TBB expects different variables depending on the version + return "2_5" if Version(self.version) >= "2021.4.0" else "2_4" + + @property + def _tbbbind_supported(self): + return self.settings.os != "Macos" or Version(self.version) >= "2021.11.0" + + @property + def _tbbbind_build(self): + return self.options.get_safe("tbbbind", False) and self._tbbbind_supported + + @property + def _tbbbind_explicit_hwloc(self): + # during cross-compilation, oneTBB does not search for HWLOC and we need to specify it explicitly + # but then oneTBB creates an imported SHARED target from provided paths, so we have to set shared=True + return self._tbbbind_build and cross_building(self) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if Version(self.version) < "2021.5.0": + del self.options.tbbmalloc + if Version(self.version) < "2021.6.0": + del self.options.tbbproxy + if not self._tbbbind_supported: + del self.options.tbbbind + if Version(self.version) < "2021.6.0" or self.settings.os == "Android": + del self.options.interprocedural_optimization + + def configure(self): + if Version(self.version) >= "2021.6.0" and not self.options.tbbmalloc: + self.options.rm_safe("tbbproxy") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self._tbbbind_build: + self.requires("hwloc/2.9.3") + + def validate(self): + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "11.0": + raise ConanInvalidConfiguration(f"{self.ref} couldn't be built by apple-clang < 11.0") + + # Old versions used to have shared option before hwloc dependency was moved to shared only + if self._tbbbind_explicit_hwloc and not self.dependencies["hwloc"].options.get_safe("shared", True): + raise ConanInvalidConfiguration(f"{self.ref} requires hwloc:shared=True to be built.") + + def build_requirements(self): + if self._tbbbind_build and not self._tbbbind_explicit_hwloc: + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.1.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + toolchain = CMakeToolchain(self) + toolchain.variables["TBB_TEST"] = False + toolchain.variables["TBB_STRICT"] = False + if Version(self.version) >= "2021.5.0": + toolchain.variables["TBBMALLOC_BUILD"] = self.options.tbbmalloc + if self.options.get_safe("interprocedural_optimization"): + toolchain.variables["TBB_ENABLE_IPO"] = self.options.interprocedural_optimization + if Version(self.version) >= "2021.6.0" and self.options.get_safe("tbbmalloc"): + toolchain.variables["TBBMALLOC_PROXY_BUILD"] = self.options.tbbproxy + toolchain.variables["TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH"] = not self._tbbbind_build + if self._tbbbind_explicit_hwloc: + hwloc_package_folder = self.dependencies["hwloc"].package_folder + hwloc_lib_name = ("hwloc.lib" if self.settings.os == "Windows" else + "libhwloc.dylib" if self.settings.os == "Macos" else + "libhwloc.so") + toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_LIBRARY_PATH"] = \ + os.path.join(hwloc_package_folder, "lib", hwloc_lib_name).replace("\\", "/") + toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_INCLUDE_PATH"] = \ + os.path.join(hwloc_package_folder, "include").replace("\\", "/") + if self.settings.os == "Windows": + toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_DLL_PATH"] = \ + os.path.join(hwloc_package_folder, "bin", "hwloc.dll").replace("\\", "/") + toolchain.generate() + + if self._tbbbind_build and not self._tbbbind_explicit_hwloc: + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "TBB") + self.cpp_info.set_property("pkg_config_name", "tbb") + self.cpp_info.set_property("cmake_config_version_compat", "AnyNewerVersion") + + def lib_name(name): + if self.settings.build_type == "Debug": + return name + "_debug" + return name + + # tbb + tbb = self.cpp_info.components["libtbb"] + + tbb.set_property("cmake_target_name", "TBB::tbb") + tbb.libs = [lib_name("tbb")] + if self.settings.os == "Windows": + version_info = load(self, + os.path.join(self.package_folder, "include", "oneapi", "tbb", + "version.h")) + binary_version = re.sub( + r".*" + re.escape("#define __TBB_BINARY_VERSION ") + + r"(\d+).*", + r"\1", + version_info, + flags=re.MULTILINE | re.DOTALL, + ) + tbb.libs.append(lib_name(f"tbb{binary_version}")) + if self.settings.os in ["Linux", "FreeBSD"]: + tbb.system_libs = ["m", "dl", "rt", "pthread"] + + # tbbmalloc + if self._has_tbbmalloc: + tbbmalloc = self.cpp_info.components["tbbmalloc"] + + tbbmalloc.set_property("cmake_target_name", "TBB::tbbmalloc") + tbbmalloc.libs = [lib_name("tbbmalloc")] + if self.settings.os in ["Linux", "FreeBSD"]: + tbbmalloc.system_libs = ["dl", "pthread"] + + # tbbmalloc_proxy + if self._has_tbbproxy: + tbbproxy = self.cpp_info.components["tbbmalloc_proxy"] + + tbbproxy.set_property("cmake_target_name", "TBB::tbbmalloc_proxy") + tbbproxy.libs = [lib_name("tbbmalloc_proxy")] + tbbproxy.requires = ["tbbmalloc"] + if self.settings.os in ["Linux", "FreeBSD"]: + tbbproxy.system_libs = ["m", "dl", "pthread"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "TBB" + self.cpp_info.names["cmake_find_package_multi"] = "TBB" + self.cpp_info.names["pkg_config"] = "tbb" + tbb.names["cmake_find_package"] = "tbb" + tbb.names["cmake_find_package_multi"] = "tbb" diff --git a/onetbb/all/patches/android-ndk25.patch b/onetbb/all/patches/android-ndk25.patch new file mode 100644 index 0000000..4b3cad0 --- /dev/null +++ b/onetbb/all/patches/android-ndk25.patch @@ -0,0 +1,46 @@ +From 4ce5d767df83ac4396eef4964c6df6c3dcfef234 Mon Sep 17 00:00:00 2001 +From: Dmitry Kurtaev +Date: Fri, 4 Nov 2022 09:33:33 +0300 +Subject: [PATCH] Fixes for Android NDK 25 + +Signed-off-by: Dmitry Kurtaev +--- + CMakeLists.txt | 25 +++++++++++++++++++++---- + 1 file changed, 21 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9b8bb7c8be..6c479fe4dc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -279,10 +279,27 @@ endif() + + if (ANDROID_PLATFORM) + if ("${ANDROID_STL}" STREQUAL "c++_shared") +- configure_file( +- "${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${ANDROID_ABI}/libc++_shared.so" +- "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libc++_shared.so" +- COPYONLY) ++ if (${ANDROID_NDK_MAJOR} GREATER_EQUAL "25") ++ if(ANDROID_ABI STREQUAL "arm64-v8a") ++ set(ANDROID_TOOLCHAIN_NAME "aarch64-linux-android") ++ elseif(ANDROID_ABI STREQUAL "x86_64") ++ set(ANDROID_TOOLCHAIN_NAME "x86_64-linux-android") ++ elseif(ANDROID_ABI STREQUAL "armeabi-v7a") ++ set(ANDROID_TOOLCHAIN_NAME "arm-linux-androideabi") ++ elseif(ANDROID_ABI STREQUAL "x86") ++ set(ANDROID_TOOLCHAIN_NAME "i686-linux-android") ++ endif() ++ ++ configure_file( ++ "${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/lib/${ANDROID_TOOLCHAIN_NAME}/libc++_shared.so" ++ "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libc++_shared.so" ++ COPYONLY) ++ else() ++ configure_file( ++ "${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${ANDROID_ABI}/libc++_shared.so" ++ "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libc++_shared.so" ++ COPYONLY) ++ endif() + endif() + # This custom target may be implemented without separate CMake script, but it requires + # ADB(Android Debug Bridge) executable file availability, so to incapsulate this requirement diff --git a/onetbb/all/patches/fix-overeager-stripping-of-compile-flag.diff b/onetbb/all/patches/fix-overeager-stripping-of-compile-flag.diff new file mode 100644 index 0000000..914764c --- /dev/null +++ b/onetbb/all/patches/fix-overeager-stripping-of-compile-flag.diff @@ -0,0 +1,13 @@ +diff --git a/cmake/utils.cmake b/cmake/utils.cmake +index f74abfcf9..a090bacbb 100644 +--- a/cmake/utils.cmake ++++ b/cmake/utils.cmake +@@ -18,7 +18,7 @@ macro(tbb_remove_compile_flag flag) + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS ${_tbb_compile_options}) + unset(_tbb_compile_options) + if (CMAKE_CXX_FLAGS) +- string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) ++ string(REGEX REPLACE "(^|[ \t\r\n]+)${flag}($|[ \t\r\n]+)" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + endif() + endmacro() + diff --git a/onetbb/all/patches/pkg-search-module-use-imported-target.diff b/onetbb/all/patches/pkg-search-module-use-imported-target.diff new file mode 100644 index 0000000..e1a3505 --- /dev/null +++ b/onetbb/all/patches/pkg-search-module-use-imported-target.diff @@ -0,0 +1,97 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 34a23d40..d569d57e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -100,6 +100,8 @@ option(TBB_NO_APPCONTAINER "Apply /APPCONTAINER:NO (for testing binaries for Win + option(TBB4PY_BUILD "Enable tbb4py build" OFF) + option(TBB_CPF "Enable preview features of the library" OFF) + option(TBB_FIND_PACKAGE "Enable search for external oneTBB using find_package instead of build from sources" OFF) ++option(TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH "Disable HWLOC automatic search by pkg-config tool" OFF) ++ + + if (NOT DEFINED BUILD_SHARED_LIBS) + set(BUILD_SHARED_LIBS ON) +@@ -194,7 +196,7 @@ else() + if (NOT "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips") + add_subdirectory(src/tbbmalloc) + add_subdirectory(src/tbbmalloc_proxy) +- if (APPLE) ++ if (APPLE OR NOT BUILD_SHARED_LIBS) + message(STATUS "TBBBind build target is disabled due to unsupported environment") + else() + add_subdirectory(src/tbbbind) +diff --git a/cmake/hwloc_detection.cmake b/cmake/hwloc_detection.cmake +index f1740662..e1806a0f 100644 +--- a/cmake/hwloc_detection.cmake ++++ b/cmake/hwloc_detection.cmake +@@ -45,11 +45,15 @@ endforeach() + + unset(HWLOC_TARGET_NAME) + +-if (NOT HWLOC_TARGET_EXPLICITLY_DEFINED) ++if (NOT HWLOC_TARGET_EXPLICITLY_DEFINED AND ++ # No hwloc auto detection for cross compilation ++ NOT CMAKE_CROSSCOMPILING AND ++ NOT TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH ++) + find_package(PkgConfig QUIET) +- if (PKG_CONFIG_FOUND) +- pkg_search_module(HWLOC hwloc) +- if (HWLOC_FOUND) ++ if (PKG_CONFIG_FOUND AND NOT CMAKE_VERSION VERSION_LESS 3.6) ++ pkg_search_module(HWLOC hwloc IMPORTED_TARGET) ++ if (TARGET PkgConfig::HWLOC) + if (HWLOC_VERSION VERSION_LESS 2) + set(TBBBIND_LIBRARY_NAME tbbbind) + elseif(HWLOC_VERSION VERSION_LESS 2.4) +@@ -60,4 +64,3 @@ if (NOT HWLOC_TARGET_EXPLICITLY_DEFINED) + endif() + endif() + endif() +- +diff --git a/src/tbbbind/CMakeLists.txt b/src/tbbbind/CMakeLists.txt +index da9dabfe..1a4c6ca0 100644 +--- a/src/tbbbind/CMakeLists.txt ++++ b/src/tbbbind/CMakeLists.txt +@@ -18,12 +18,13 @@ endif() + set(CMAKE_SKIP_BUILD_RPATH TRUE) + + function(tbbbind_build TBBBIND_NAME REQUIRED_HWLOC_TARGET) +- if (NOT TARGET ${REQUIRED_HWLOC_TARGET} AND NOT DEFINED HWLOC_LIBRARIES) ++ if (NOT TARGET ${REQUIRED_HWLOC_TARGET}) + message(STATUS "HWLOC target ${REQUIRED_HWLOC_TARGET} doesn't exist." + " The ${TBBBIND_NAME} target cannot be created") + return() + endif() + add_library(${TBBBIND_NAME} tbb_bind.cpp) ++ + add_library(TBB::${TBBBIND_NAME} ALIAS ${TBBBIND_NAME}) + + target_compile_definitions(${TBBBIND_NAME} +@@ -64,14 +65,12 @@ function(tbbbind_build TBBBIND_NAME REQUIRED_HWLOC_TARGET) + PRIVATE + ${TBB_LIB_LINK_FLAGS} + ${TBB_COMMON_LINK_FLAGS} +- ${HWLOC_LIBRARY_DIRS} # pkg-config defined + ) + else() + target_link_libraries(${TBBBIND_NAME} + PRIVATE + ${TBB_LIB_LINK_FLAGS} + ${TBB_COMMON_LINK_FLAGS} +- ${HWLOC_LIBRARY_DIRS} # pkg-config defined + ) + endif() + +@@ -90,9 +89,9 @@ function(tbbbind_build TBBBIND_NAME REQUIRED_HWLOC_TARGET) + endif() + endfunction() + +-if (NOT DEFINED HWLOC_TARGET_EXPLICITLY_DEFINED AND DEFINED HWLOC_LIBRARIES) ++if (NOT DEFINED HWLOC_TARGET_EXPLICITLY_DEFINED AND TARGET PkgConfig::HWLOC) + message(STATUS "The ${TBBBIND_LIBRARY_NAME} target will be configured using the HWLOC ${HWLOC_VERSION}") +- tbbbind_build(${TBBBIND_LIBRARY_NAME} ${HWLOC_LIBRARIES}) ++ tbbbind_build(${TBBBIND_LIBRARY_NAME} PkgConfig::HWLOC) + else() + tbbbind_build(tbbbind HWLOC::hwloc_1_11) + tbbbind_build(tbbbind_2_0 HWLOC::hwloc_2 ) diff --git a/onetbb/all/test_package/CMakeLists.txt b/onetbb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..fbae625 --- /dev/null +++ b/onetbb/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(TBB REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE TBB::tbb) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/onetbb/all/test_package/conanfile.py b/onetbb/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/onetbb/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/onetbb/all/test_package/test_package.cpp b/onetbb/all/test_package/test_package.cpp new file mode 100644 index 0000000..e507d17 --- /dev/null +++ b/onetbb/all/test_package/test_package.cpp @@ -0,0 +1,39 @@ +#include "tbb/task_group.h" +#include "tbb/flow_graph.h" +#include + +using namespace tbb; +using namespace tbb::flow; + +int Fib(int n) { + if( n<2 ) { + return n; + } else { + int x, y; + task_group g; + g.run([&]{x=Fib(n-1);}); // spawn a task + g.run([&]{y=Fib(n-2);}); // spawn another task + g.wait(); // wait for both tasks to complete + return x+y; + } +} + +int main(){ + std::cout<<"Fib 6="< hello( g, + []( const continue_msg &) { + std::cout << "Hello"; + } + ); + continue_node< continue_msg> world( g, + []( const continue_msg &) { + std::cout << " World\n"; + } + ); + make_edge(hello, world); + hello.try_put(continue_msg()); + g.wait_for_all(); + return 0; +} diff --git a/onetbb/all/test_v1_package/CMakeLists.txt b/onetbb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..b21cc49 --- /dev/null +++ b/onetbb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/onetbb/all/test_v1_package/conanfile.py b/onetbb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/onetbb/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/onetbb/config.yml b/onetbb/config.yml new file mode 100644 index 0000000..4ef9daf --- /dev/null +++ b/onetbb/config.yml @@ -0,0 +1,27 @@ +versions: + "2021.12.0": + folder: all + "2021.10.0": + folder: all + "2021.9.0": + folder: all + "2021.8.0": + folder: all + "2021.7.0": + folder: all + "2021.6.0": + folder: all + "2021.3.0": + folder: all + "2020.3.3": + folder: "2020.x" + "2020.3": + folder: "2020.x" + "2020.2": + folder: "2020.x" + "2020.1": + folder: "2020.x" + "2020.0": + folder: "2020.x" + "2019_u9": + folder: "2020.x" diff --git a/openblas/all/conandata.yml b/openblas/all/conandata.yml index cd6bae3..85e4fee 100644 --- a/openblas/all/conandata.yml +++ b/openblas/all/conandata.yml @@ -1,7 +1,16 @@ sources: - "0.3.23": - url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.23.tar.gz" - sha256: "5d9491d07168a5d00116cdc068a40022c3455bf9293c7cb86a65b1054d7e5114" + "0.3.27": + url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.27.tar.gz" + sha256: "aa2d68b1564fe2b13bc292672608e9cdeeeb6dc34995512e65c3b10f4599e897" + "0.3.26": + url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.26.tar.gz" + sha256: "4e6e4f5cb14c209262e33e6816d70221a2fe49eb69eaf0a06f065598ac602c68" + "0.3.25": + url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.25.tar.gz" + sha256: "4c25cb30c4bb23eddca05d7d0a85997b8db6144f5464ba7f8c09ce91e2f35543" + "0.3.24": + url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.24.tar.gz" + sha256: "ceadc5065da97bd92404cac7254da66cc6eb192679cf1002098688978d4d5132" "0.3.20": url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.20.tar.gz" sha256: "8495c9affc536253648e942908e88e097f2ec7753ede55aca52e5dead3029e3c" @@ -20,60 +29,3 @@ sources: "0.3.10": url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.10.tar.gz" sha256: "0484d275f87e9b8641ff2eecaa9df2830cbe276ac79ad80494822721de6e1693" - -patches: - "0.3.10": - - - patch_file: "patches/0.3.10-0001-Fix-libm-linking-and-fortran-detection.patch" - patch_description: "Fix libm linking, fortran detection and intel fortran" - patch_type: "conan" - - - patch_file: "patches/0.3.10-0002-Macro-collision-winnt-SDK.patch" - patch_description: "Add workaround for another macro name collision with Windows 10 SDK winnt.h" - patch_type: "bugfix" - patch_source: "https://github.com/xianyi/OpenBLAS/pull/3276/files" - "0.3.12": - - - patch_file: "patches/0.3.12-0001-Fix-libm-linking-and-fortran-detection.patch" - patch_description: "Fix libm linking, fortran detection and intel fortran" - patch_type: "conan" - - - patch_file: "patches/0.3.12-0002-Macro-collision-winnt-SDK.patch" - patch_description: "Add workaround for another macro name collision with Windows 10 SDK winnt.h" - patch_type: "bugfix" - patch_source: "https://github.com/xianyi/OpenBLAS/pull/3276/files" - "0.3.13": - - - patch_file: "patches/0.3.13-0001-Fix-libm-linking-and-fortran-detection.patch" - patch_description: "Fix libm linking, fortran detection and intel fortran" - patch_type: "conan" - - - patch_file: "patches/0.3.13-0002-Macro-collision-winnt-SDK.patch" - patch_description: "Add workaround for another macro name collision with Windows 10 SDK winnt.h" - patch_type: "bugfix" - patch_source: "https://github.com/xianyi/OpenBLAS/pull/3276/files" - "0.3.15": - - - patch_file: "patches/0.3.15-0001-Fix-libm-linking-and-fortran-detection.patch" - patch_description: "Fix libm linking, fortran detection and intel fortran" - patch_type: "conan" - - - patch_file: "patches/0.3.15-0002-Macro-collision-winnt-SDK.patch" - patch_description: "Add workaround for another macro name collision with Windows 10 SDK winnt.h" - patch_type: "bugfix" - patch_source: "https://github.com/xianyi/OpenBLAS/pull/3276/files" - "0.3.17": - - - patch_file: "patches/0.3.17-0001-Fix-libm-linking-and-fortran-detection.patch" - patch_description: "Fix libm linking, fortran detection and intel fortran" - patch_type: "conan" - "0.3.20": - - - patch_file: "patches/0.3.20-0001-Fix-libm-linking-and-fortran-detection.patch" - patch_description: "Fix libm linking, fortran detection and intel fortran" - patch_type: "conan" - "0.3.23": - - - patch_file: "patches/0.3.23-0001-Fix-Intel-Fortran-detection-and-flag-change-to-fopen.patch" - patch_description: "Fix intel fortran detection and flag change to -fopenmp" - patch_type: "conan" diff --git a/openblas/all/conanfile.py b/openblas/all/conanfile.py index 863b37c..6fcc5d8 100644 --- a/openblas/all/conanfile.py +++ b/openblas/all/conanfile.py @@ -1,14 +1,62 @@ -from os import path from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import cross_building from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches -from conan.tools.files import copy, get, load, rename, rmdir, collect_libs +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc from conan.tools.scm import Version -from conan.tools.apple import fix_apple_shared_install_name - -required_conan_version = ">=1.55.0" +import os +import textwrap + +required_conan_version = ">=1.53.0" + +# Maps Conan's settings.arch to the corresponding OpenBLAS TARGET: +conan_arch_to_openblas_target = { + "x86": "SANDYBRIDGE", # Sandy bridge was discontinued in September of 2013, + "x86_64": "SANDYBRIDGE", # supporting older CPUs is a performance trade-off + "ppc32be": None, # TODO: OpenBLAS has POWER4, POWER5, POWER6, POWER7, + "ppc32": None, # POWER8, POWER9, POWER10, PPCG4, PPC970, PPC970MP, + "ppc64le": None, # PPC440, PPC440FP2, CELL + "ppc64": None, + "armv4": None, # Not supported by OpenBLAS + "armv4i": None, # Not supported by OpenBLAS + "armv5el": "ARMV5", + "armv5hf": "ARMV5", + "armv6": "ARMV6", + "armv7": "ARMV7", + "armv7hf": "ARMV7", + "armv7s": "ARMV7", + "armv7k": "ARMV7", + "armv8": "ARMV8", + "armv8_32": "ARMV7", # No 32-bit ARMv8 TARGET in OpenBLAS + "armv8.3": "ARMV8", + "arm64ec": "ARMV8", + "sparc": None, # TODO: OpenBLAS has SPARC, SPARCV7 + "sparcv9": None, + "mips": None, # TODO: OpenBLAS has P5600, MIPS1004K and MIPS24K + "mips64": "MIPS64_GENERIC", + "avr": None, # Not supported by OpenBLAS + "s390": None, # Not supported by OpenBLAS + "s390x": None, # Not supported by OpenBLAS + "asm.js": "GENERIC", # TODO: ? + "wasm": "GENERIC", # TODO: ? + "sh4le": None, # Not supported by OpenBLAS + "e2k-v2": "E2K", + "e2k-v3": "E2K", + "e2k-v4": "E2K", + "e2k-v5": "E2K", + "e2k-v6": "E2K", + "e2k-v7": "E2K", + "riscv64": "RISCV64_GENERIC", + "riscv32": None, # Not supported by OpenBLAS + "xtensalx6": None, # Not supported by OpenBLAS + "xtensalx106": None, # Not supported by OpenBLAS + "xtensalx7": None, # Not supported by OpenBLAS +} + +# Taken from OpenBLAS TargetList.txt +available_openblas_targets = ["P2", "KATMAI", "COPPERMINE", "NORTHWOOD", "PRESCOTT", "BANIAS", "YONAH", "CORE2", "PENRYN", "DUNNINGTON", "NEHALEM", "SANDYBRIDGE", "HASWELL", "SKYLAKEX", "ATOM", "COOPERLAKE", "SAPPHIRERAPIDS", "ATHLON", "OPTERON", "OPTERON_SSE3", "BARCELONA", "SHANGHAI", "ISTANBUL", "BOBCAT", "BULLDOZER", "PILEDRIVER", "STEAMROLLER", "EXCAVATOR", "ZEN", "SSE_GENERIC", "VIAC3", "NANO", "POWER4", "POWER5", "POWER6", "POWER7", "POWER8", "POWER9", "POWER10", "PPCG4", "PPC970", "PPC970MP", "PPC440", "PPC440FP2", "CELL", "P5600", "MIPS1004K", "MIPS24K", "MIPS64_GENERIC", "SICORTEX", "LOONGSON3A", "LOONGSON3B", "I6400", "P6600", "I6500", "ITANIUM2", "SPARC", "SPARCV7", "CORTEXA15", "CORTEXA9", "ARMV7", "ARMV6", "ARMV5", "ARMV8", "CORTEXA53", "CORTEXA57", "CORTEXA72", "CORTEXA73", "CORTEXA76", "CORTEXA510", "CORTEXA710", "CORTEXX1", "CORTEXX2", "NEOVERSEN1", "NEOVERSEV1", "NEOVERSEN2", "CORTEXA55", "EMAG8180", "FALKOR", "THUNDERX", "THUNDERX2T99", "TSV110", "THUNDERX3T110", "VORTEX", "A64FX", "ARMV8SVE", "FT2000", "ZARCH_GENERIC", "Z13", "Z14", "RISCV64_GENERIC", "RISCV64_ZVL128B", "C910V", "x280", "RISCV64_ZVL256B", "LOONGSONGENERIC", "LOONGSON3R5", "LOONGSON2K1000", "E2K", "EV4", "EV5", "EV6", "CSKY", "CK860FV"] class OpenblasConan(ConanFile): @@ -18,253 +66,216 @@ class OpenblasConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.openblas.net" topics = ("blas", "lapack") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "build_lapack": [True, False], + "build_relapack": [True, False], "use_thread": [True, False], - "use_openmp": [True, False], + "use_locking": [True, False], "dynamic_arch": [True, False], - "with_avx512": [True, False], + "target": [None] + available_openblas_targets } default_options = { "shared": False, "fPIC": True, - "build_lapack": False, + "build_lapack": True, + "build_relapack": False, "use_thread": True, - "use_openmp": False, + "use_locking": True, "dynamic_arch": False, - "with_avx512": False, + "target": None, + } + options_description = { + "build_lapack": "Build LAPACK and LAPACKE", + "build_relapack": "Build with ReLAPACK (recursive implementation of several LAPACK functions on top of standard LAPACK)", + "use_thread": "Enable threads support", + "use_locking": "Use locks even in single-threaded builds to make them callable from multiple threads", + "dynamic_arch": "Include support for multiple CPU targets, with automatic selection at runtime (x86/x86_64, aarch64 or ppc only)", + "target": "OpenBLAS TARGET variable (see TargetList.txt)", } - package_type = "library" short_paths = True - def _fortran_runtime(self, fortran_id): - if self.settings.os in ["Linux", "FreeBSD"]: - if fortran_id == "GNU": - if self.settings.compiler == "gcc": - # Compiler vs. gfortran runtime ver.: 5,6: 3, 7: 4, >=8: 5 - if Version(self.settings.compiler.version).major >= "5": - return "gfortran" - if self.settings.compiler == "clang": - if Version(self.settings.compiler.version).major > "8": - return "gfortran" # Runtime version gfortran5 - - self.output.warning( - f"Unable to select runtime for Fortran {fortran_id} " - f"and C++ {self.settings.compiler} {self.settings.compiler.version}") - return None - - @property - def _openmp_runtime(self): - if self.settings.os in ["Linux", "FreeBSD"]: - if self.settings.compiler == "gcc": - if Version(self.settings.compiler.version).major > "7": - return "gomp" - if self.settings.compiler == "clang": - if Version(self.settings.compiler.version).major > "8": - return "omp" - return None - @property def _fortran_compiler(self): comp_exe = self.conf.get("tools.build:compiler_executables") - if comp_exe and 'fortran' in comp_exe: + if comp_exe and "fortran" in comp_exe: return comp_exe["fortran"] return None - def export(self): - conan_fortran = path.join(self.export_folder, "conan_fortran") - copy(self, "fortran_helper.cmake", self.recipe_folder, conan_fortran) - rename(self, path.join(conan_fortran, "fortran_helper.cmake"), - path.join(conan_fortran, "CMakeLists.txt")) - - def export_sources(self): - export_conandata_patches(self) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - - # Build LAPACK by default if possible w/o Fortran compiler - if Version(self.version) >= "0.3.21": - self.options.build_lapack = True + # When no Fortran compiler is available, OpenBLAS builds LAPACK from an f2c-converted copy of LAPACK unless the NO_LAPACK option is specified. + # This is not available before v0.3.21. + if Version(self.version) < "0.3.21": + self.options.build_lapack = False + self.options.build_relapack = False def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - def layout(self): - cmake_layout(self, src_folder="src") - - def package_id(self): - if self.info.options.build_lapack: - # Capture Fortran compiler in package id using CMake - # Note: It is incomplete before CMake 3.24 - import tempfile - import io - f_compiler = self._fortran_compiler - - if not f_compiler and Version(self.version) >= "0.3.21": - self.output.info("Building LAPACK without Fortran") - return - - conan_fortran = path.join(self.recipe_folder, 'conan_fortran') - run_cmd = f"cmake {conan_fortran} --log-level=ERROR" - - if f_compiler: - run_cmd += f" -DCMAKE_Fortran_COMPILER={f_compiler}" - - with tempfile.TemporaryDirectory() as tmpdir: - self.run(run_cmd, io.StringIO(), cwd=tmpdir) - fortran_id = load(self, path.join(tmpdir, "FORTRAN_COMPILER")) - if fortran_id == "0": - self.output.warning("No or unknown fortran compiler was used.") - f_compiler = True - else: - self.output.info(f"Fortran compiler: {fortran_id}") - f_compiler = fortran_id - - self.info.options.build_lapack = f_compiler + # When cross-compiling, OpenBLAS requires explicitly setting TARGET + if cross_building(self, skip_x64_x86=True) and not self.options.target: + # Try inferring the target from settings.arch + target = conan_arch_to_openblas_target.get(str(self.settings.arch)) + if target: + self.output.warning(f'Setting OpenBLAS TARGET={target} based on settings.arch. This may result in suboptimal performance. Set the "{self.name}/*:target=XXX" option to silence this warning.') + self.options.target = target def validate(self): - if cross_building(self, skip_x64_x86=True): - raise ConanInvalidConfiguration("Cross-building not implemented") - - if self.options.use_thread and self.options.use_openmp: - raise ConanInvalidConfiguration("Both 'use_thread=True' and 'use_openmp=True' are not allowed") - - if self.settings.os == "Windows" and self.options.build_lapack and self.options.use_openmp: - # In OpenBLAS cmake/system.cmake: Disable -fopenmp for LAPACK Fortran codes on Windows - self.output.warning("OpenMP is disabled on LAPACK targets on Windows") - - def build_requirements(self): - if self.options.build_lapack and self.settings.os == "Windows": - self.tool_requires("ninja/1.11.1") + if Version(self.version) < "0.3.24" and self.settings.arch == "armv8": + # OpenBLAS fails to detect the appropriate target architecture for armv8 for versions < 0.3.24, as it matches the 32 bit variant instead of 64. + # This was fixed in https://github.com/OpenMathLib/OpenBLAS/pull/4142, which was introduced in 0.3.24. + # This would be a reasonably trivial hotfix to backport. + raise ConanInvalidConfiguration("armv8 builds are not currently supported for versions lower than 0.3.24. Contributions to support this are welcome.") + + if self.options.build_relapack: + if not self.options.build_lapack: + raise ConanInvalidConfiguration(f'"{self.name}/*:build_relapack=True" option requires "{self.name}/*:build_lapack=True"') + if self.settings.compiler not in ["gcc", "clang"]: + # ld: unknown option: --allow-multiple-definition on apple-clang + raise ConanInvalidConfiguration(f'"{self.name}/*:build_relapack=True" option is only supported for GCC and Clang') + + def validate_build(self): + if Version(self.version) < "0.3.22" and cross_building(self, skip_x64_x86=True): + # OpenBLAS CMake builds did not support some of the cross-compilation targets in 0.3.20/21 and earlier. + # This was fixed in https://github.com/OpenMathLib/OpenBLAS/pull/3714 and https://github.com/OpenMathLib/OpenBLAS/pull/3958 + raise ConanInvalidConfiguration(f"Cross-building is not supported for {self.name}/0.3.21 and earlier.") + + # If we're cross-compiling, and the user didn't provide the target, and + # we couldn't infer the target from settings.arch, fail + if cross_building(self, skip_x64_x86=True) and not self.options.target: + raise ConanInvalidConfiguration(f'Could not determine OpenBLAS TARGET. Please set the "{self.name}/*:target=XXX" option.') def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def generate(self): + def layout(self): + cmake_layout(self, src_folder="src") - conf_generator = self.conf.get("tools.cmake.cmaketoolchain:generator") - ninja_conditions = \ - self.settings.os == "Windows" and self.options.build_lapack \ - and (not conf_generator or "Visual Studio" in conf_generator) - generator = "Ninja" if ninja_conditions else None - if ninja_conditions: - self.output.warning( - "The Visual Studio generator is not compatible with OpenBLAS " - "when building LAPACK. Overwriting generator to 'Ninja'") - tc = CMakeToolchain(self, generator=generator) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_TESTING"] = False tc.variables["NOFORTRAN"] = not self.options.build_lapack - if self.options.build_lapack: - # This checks explicit user-specified fortran compiler - if not self._fortran_compiler: - if Version(self.version) < "0.3.21": - self.output.warning( - "Building with LAPACK support requires a Fortran compiler.") - else: - tc.variables["C_LAPACK"] = True - tc.variables["NOFORTRAN"] = True - self.output.info( - "Building LAPACK without Fortran compiler") + # This checks explicit user-specified fortran compiler + if self.options.build_lapack and not self._fortran_compiler: + if Version(self.version) < "0.3.21": + self.output.warning("Building with LAPACK support requires a Fortran compiler.") + else: + tc.variables["C_LAPACK"] = True + tc.variables["NOFORTRAN"] = True + self.output.info("Building LAPACK without a Fortran compiler") tc.variables["BUILD_WITHOUT_LAPACK"] = not self.options.build_lapack + tc.variables["BUILD_RELAPACK"] = self.options.build_relapack + tc.variables["DYNAMIC_ARCH"] = self.options.dynamic_arch tc.variables["USE_THREAD"] = self.options.use_thread - tc.variables["USE_OPENMP"] = self.options.use_openmp + tc.variables["USE_LOCKING"] = self.options.use_locking - # Required for safe concurrent calls to OpenBLAS routines - tc.variables["USE_LOCKING"] = not self.options.use_thread + tc.variables["MSVC_STATIC_CRT"] = is_msvc_static_runtime(self) - # don't, may lie to consumer, /MD or /MT is managed by conan - tc.variables["MSVC_STATIC_CRT"] = False + # This is a workaround to add the libm dependency on linux, + # which is required to successfully compile on older gcc versions. + tc.variables["ANDROID"] = self.settings.os in ["Linux", "Android"] - tc.variables["NO_AVX512"] = not self.options.with_avx512 + if self.options.target: + tc.cache_variables["TARGET"] = self.options.target + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() + def _patch_sources(self): + if Version(self.version) <= "0.3.15": + replace_in_file(self, os.path.join(self.source_folder, "cmake", "utils.cmake"), + "set(obj_defines ${defines_in})", textwrap.dedent("""\ + set(obj_defines ${defines_in}) + + list(FIND obj_defines "RC" def_idx) + if (${def_idx} GREATER -1) + list(REMOVE_ITEM obj_defines "RC") + list(APPEND obj_defines "RC=RC") + endif () + list(FIND obj_defines "CR" def_idx) + if (${def_idx} GREATER -1) + list(REMOVE_ITEM obj_defines "CR") + list(APPEND obj_defines "CR=CR") + endif ()""")) + if Version(self.version) < "0.3.21": + f_check_cmake = os.path.join(self.source_folder, "cmake", "f_check.cmake") + if Version(self.version) >= "0.3.12": + replace_in_file(self, f_check_cmake, + 'message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK")', + 'message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.")') + else: + replace_in_file(self, f_check_cmake, + "enable_language(Fortran)", + textwrap.dedent("""\ + include(CheckLanguage) + check_language(Fortran) + if(CMAKE_Fortran_COMPILER) + enable_language(Fortran) + else() + message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.") + set (NOFORTRAN 1) + set (NO_LAPACK 1) + endif()""")) + def build(self): - apply_conandata_patches(self) + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() def package(self): - copy(self, pattern="LICENSE", - dst=path.join(self.package_folder, "licenses"), - src=self.source_folder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() - rmdir(self, path.join(self.package_folder, "lib", "pkgconfig")) - rmdir(self, path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) fix_apple_shared_install_name(self) - if self.options.build_lapack: - copy(self, pattern="FORTRAN_COMPILER", - src=self.build_folder, - dst=path.join(self.package_folder, "res")) + @property + def _lib_name(self): + if self.options.shared and self.settings.build_type == "Debug" and not is_msvc(self): + return "openblas_d" + return "openblas" def package_info(self): # CMake config file: # - OpenBLAS always has one and only one of these components: openmp, pthread or serial. - # - Whether this component is requested or not, official CMake imported target is always OpenBLAS::OpenBLAS + # - Whatever if this component is requested or not, official CMake imported target is always OpenBLAS::OpenBLAS + # - TODO: add openmp component when implemented in this recipe self.cpp_info.set_property("cmake_file_name", "OpenBLAS") self.cpp_info.set_property("cmake_target_name", "OpenBLAS::OpenBLAS") self.cpp_info.set_property("pkg_config_name", "openblas") - - component_name = "serial" - if self.options.use_thread: - component_name = "pthread" - elif self.options.use_openmp: - component_name = "openmp" - - self.cpp_info.components[component_name].set_property( - "pkg_config_name", "openblas") - - # Target cannot be named pthread -> causes failed linking - self.cpp_info.components[component_name].set_property( - "cmake_target_name", "OpenBLAS::" + component_name) - self.cpp_info.components[component_name].includedirs.append( - path.join("include", "openblas") - ) - self.cpp_info.components[component_name].libs = collect_libs(self) + # 'pthread' causes issues without namespace + cmake_component_name = "pthread" if self.options.use_thread else "serial" # TODO: how to model this in CMakeDeps? + self.cpp_info.components["openblas_component"].set_property("cmake_target_name", f"OpenBLAS::{cmake_component_name}") + self.cpp_info.components["openblas_component"].set_property("pkg_config_name", "openblas") + self.cpp_info.components["openblas_component"].includedirs.append(os.path.join("include", "openblas")) + self.cpp_info.components["openblas_component"].libs = [self._lib_name] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components[component_name].system_libs.append("m") + self.cpp_info.components["openblas_component"].system_libs.append("m") if self.options.use_thread: - self.cpp_info.components[component_name].system_libs.append("pthread") - if self.options.use_openmp: - openmp_rt = self._openmp_runtime - if openmp_rt: - self.cpp_info.components[component_name].system_libs.append(openmp_rt) - - if self.options.build_lapack: - fortran_file = path.join(self.package_folder, "res", "FORTRAN_COMPILER") - # >=v0.3.21: compiling w/o fortran is possible - if path.isfile(fortran_file): - fortran_id = load(self, fortran_file) - if fortran_id == "GNU": - fortran_rt = self._fortran_runtime(fortran_id) - if fortran_rt: - self.cpp_info.components[component_name].system_libs.append("dl") - self.cpp_info.components[component_name].system_libs.append(fortran_rt) - elif fortran_id == "0": - pass - else: - self.output.warning(f"Runtime libraries for {fortran_id} are not specified") - - self.cpp_info.requires.append(component_name) + self.cpp_info.components["openblas_component"].system_libs.append("pthread") + if self.options.build_lapack and self._fortran_compiler: + self.cpp_info.components["openblas_component"].system_libs.append("gfortran") - # TODO: Remove env_info in conan v2 - self.output.info(f"Setting OpenBLAS_HOME environment variable: {self.package_folder}") - self.env_info.OpenBLAS_HOME = self.package_folder + self.buildenv_info.define_path("OpenBLAS_HOME", self.package_folder) self.runenv_info.define_path("OpenBLAS_HOME", self.package_folder) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "OpenBLAS" self.cpp_info.names["cmake_find_package_multi"] = "OpenBLAS" - self.cpp_info.components[component_name].names["cmake_find_package"] = component_name - self.cpp_info.components[component_name].names["cmake_find_package_multi"] = component_name + self.cpp_info.components["openblas_component"].names["cmake_find_package"] = cmake_component_name + self.cpp_info.components["openblas_component"].names["cmake_find_package_multi"] = cmake_component_name + self.env_info.OpenBLAS_HOME = self.package_folder diff --git a/openblas/all/fortran_helper.cmake b/openblas/all/fortran_helper.cmake deleted file mode 100644 index 173c47d..0000000 --- a/openblas/all/fortran_helper.cmake +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.15) - -project(fortran_check NONE) - -include(CheckLanguage) -check_language(Fortran) -if(CMAKE_Fortran_COMPILER) - enable_language(Fortran) - string(REPLACE "." ";" _versions ${CMAKE_Fortran_COMPILER_VERSION}) - list (LENGTH _versions _len) - if(_len GREATER 0) - list(GET _versions 0 _version_major) - set(_version_major "-${_version_major}.") - endif() - if(_len GREATER 1) - list(GET _versions 1 _version_minor) - endif() - - set(_compiler_id ${CMAKE_Fortran_COMPILER_ID}${_version_major}${_version_minor}) - message(STATUS ${_compiler_id}) - file(WRITE ${CMAKE_BINARY_DIR}/FORTRAN_COMPILER ${_compiler_id}) - message(STATUS ${CMAKE_BINARY_DIR}) -else() - message(STATUS "Unknown fortran compiler") - file(WRITE ${CMAKE_BINARY_DIR}/FORTRAN_COMPILER 0) -endif() diff --git a/openblas/all/patches/0.3.10-0001-Fix-libm-linking-and-fortran-detection.patch b/openblas/all/patches/0.3.10-0001-Fix-libm-linking-and-fortran-detection.patch deleted file mode 100644 index 5b5af71..0000000 --- a/openblas/all/patches/0.3.10-0001-Fix-libm-linking-and-fortran-detection.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 38ae2f1a742bd82246e1490ec0d3f8c75a9a40a7 Mon Sep 17 00:00:00 2001 -From: Joakim Haugen -Date: Fri, 21 Apr 2023 09:26:55 +0200 -Subject: [PATCH] Fix libm linking and fortran fixes - ---- - CMakeLists.txt | 2 +- - cmake/f_check.cmake | 9 +++++++++ - cmake/fc.cmake | 7 +++++-- - 3 files changed, 15 insertions(+), 3 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 12621d6b..630a9600 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -183,7 +183,7 @@ add_library(${OpenBLAS_LIBNAME} ${LA_SOURCES} ${LAPACKE_SOURCES} ${RELA_SOURCES} - target_include_directories(${OpenBLAS_LIBNAME} INTERFACE $) - - # Android needs to explicitly link against libm --if(ANDROID) -+if (${CMAKE_SYSTEM_NAME} MATCHES "AIX|Android|Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|Darwin") - target_link_libraries(${OpenBLAS_LIBNAME} m) - endif() - -diff --git a/cmake/f_check.cmake b/cmake/f_check.cmake -index f877fc3e..6ae1b38a 100644 ---- a/cmake/f_check.cmake -+++ b/cmake/f_check.cmake -@@ -21,7 +21,16 @@ - # NEED2UNDERSCORES - - if (NOT NO_LAPACK) -+ include(CheckLanguage) -+check_language(Fortran) -+if(CMAKE_Fortran_COMPILER) - enable_language(Fortran) -+ file(WRITE ${CMAKE_BINARY_DIR}/FORTRAN_COMPILER ${CMAKE_Fortran_COMPILER_ID}) -+else() -+ message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.") -+ set (NOFORTRAN 1) -+ set (NO_LAPACK 1) -+endif() - else() - include(CMakeForceCompiler) - CMAKE_FORCE_Fortran_COMPILER(gfortran GNU) -diff --git a/cmake/fc.cmake b/cmake/fc.cmake -index fc1f9bb2..6c8f07d2 100644 ---- a/cmake/fc.cmake -+++ b/cmake/fc.cmake -@@ -77,14 +77,17 @@ if (${F_COMPILER} STREQUAL "GFORTRAN") - endif () - endif () - --if (${F_COMPILER} STREQUAL "INTEL") -+if (${F_COMPILER} STREQUAL "IFORT" OR ${F_COMPILER} STREQUAL "IFX") -+ if (MSVC) -+ set(FCOMMON_OPT "${FCOMMON_OPT} -names:lowercase -assume:underscore") -+ endif () - set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_INTEL") - if (INTERFACE64) - set(FCOMMON_OPT "${FCOMMON_OPT} -i8") - endif () - set(FCOMMON_OPT "${FCOMMON_OPT} -recursive") - if (USE_OPENMP) -- set(FCOMMON_OPT "${FCOMMON_OPT} -openmp") -+ set(FCOMMON_OPT "${FCOMMON_OPT} -fopenmp") - endif () - endif () - --- -2.30.2 - diff --git a/openblas/all/patches/0.3.10-0002-Macro-collision-winnt-SDK.patch b/openblas/all/patches/0.3.10-0002-Macro-collision-winnt-SDK.patch deleted file mode 100644 index e66df37..0000000 --- a/openblas/all/patches/0.3.10-0002-Macro-collision-winnt-SDK.patch +++ /dev/null @@ -1,37 +0,0 @@ -From bece3758af9c4dad39f11a5e76bff1e030557bef Mon Sep 17 00:00:00 2001 -From: Joakim Haugen -Date: Fri, 14 Jul 2023 11:41:09 +0200 -Subject: [PATCH] Add workaround for another macro name collision with Windows - 10 SDK winnt.h - ---- - cmake/utils.cmake | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/cmake/utils.cmake b/cmake/utils.cmake -index 1c21e776e..57c4f81e8 100644 ---- a/cmake/utils.cmake -+++ b/cmake/utils.cmake -@@ -251,6 +251,19 @@ function(GenerateNamedObjects sources_in) - # now add the object and set the defines - set(obj_defines ${defines_in}) - -+ list(FIND obj_defines "RC" def_idx) -+ if (${def_idx} GREATER -1) -+ # list(REMOVE_AT ${obj_defines} ${def_idx}) -+ list (REMOVE_ITEM obj_defines "RC") -+ list(APPEND obj_defines "RC=RC") -+ endif () -+ list(FIND obj_defines "CR" def_idx) -+ if (${def_idx} GREATER -1) -+ # list(REMOVE_AT ${obj_defines} ${def_idx}) -+ list (REMOVE_ITEM obj_defines "CR") -+ list(APPEND obj_defines "CR=CR") -+ endif () -+ - if (use_cblas) - set(obj_name "cblas_${obj_name}") - list(APPEND obj_defines "CBLAS") --- -2.30.2 - diff --git a/openblas/all/patches/0.3.12-0001-Fix-libm-linking-and-fortran-detection.patch b/openblas/all/patches/0.3.12-0001-Fix-libm-linking-and-fortran-detection.patch deleted file mode 100644 index 9aa3e09..0000000 --- a/openblas/all/patches/0.3.12-0001-Fix-libm-linking-and-fortran-detection.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 22318be737a949bd19f203a96eac921e1d73588a Mon Sep 17 00:00:00 2001 -From: Joakim Haugen -Date: Fri, 21 Apr 2023 10:02:33 +0200 -Subject: [PATCH] Fix libm linking and fortran fixes - ---- - CMakeLists.txt | 2 +- - cmake/f_check.cmake | 3 ++- - cmake/fc.cmake | 7 +++++-- - 3 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 53c1709a..be154813 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -184,7 +184,7 @@ add_library(${OpenBLAS_LIBNAME} ${LA_SOURCES} ${LAPACKE_SOURCES} ${RELA_SOURCES} - target_include_directories(${OpenBLAS_LIBNAME} INTERFACE $) - - # Android needs to explicitly link against libm --if(ANDROID) -+if (${CMAKE_SYSTEM_NAME} MATCHES "AIX|Android|Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|Darwin") - target_link_libraries(${OpenBLAS_LIBNAME} m) - endif() - -diff --git a/cmake/f_check.cmake b/cmake/f_check.cmake -index 0f5d0e15..e66e9780 100644 ---- a/cmake/f_check.cmake -+++ b/cmake/f_check.cmake -@@ -25,8 +25,9 @@ if (NOT NO_LAPACK) - check_language(Fortran) - if(CMAKE_Fortran_COMPILER) - enable_language(Fortran) -+ file(WRITE ${CMAKE_BINARY_DIR}/FORTRAN_COMPILER ${CMAKE_Fortran_COMPILER_ID}) - else() -- message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK") -+ message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.") - set (NOFORTRAN 1) - set (NO_LAPACK 1) - endif() -diff --git a/cmake/fc.cmake b/cmake/fc.cmake -index fc1f9bb2..6c8f07d2 100644 ---- a/cmake/fc.cmake -+++ b/cmake/fc.cmake -@@ -77,14 +77,17 @@ if (${F_COMPILER} STREQUAL "GFORTRAN") - endif () - endif () - --if (${F_COMPILER} STREQUAL "INTEL") -+if (${F_COMPILER} STREQUAL "IFORT" OR ${F_COMPILER} STREQUAL "IFX") -+ if (MSVC) -+ set(FCOMMON_OPT "${FCOMMON_OPT} -names:lowercase -assume:underscore") -+ endif () - set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_INTEL") - if (INTERFACE64) - set(FCOMMON_OPT "${FCOMMON_OPT} -i8") - endif () - set(FCOMMON_OPT "${FCOMMON_OPT} -recursive") - if (USE_OPENMP) -- set(FCOMMON_OPT "${FCOMMON_OPT} -openmp") -+ set(FCOMMON_OPT "${FCOMMON_OPT} -fopenmp") - endif () - endif () - --- -2.30.2 - diff --git a/openblas/all/patches/0.3.12-0002-Macro-collision-winnt-SDK.patch b/openblas/all/patches/0.3.12-0002-Macro-collision-winnt-SDK.patch deleted file mode 100644 index e1a0f35..0000000 --- a/openblas/all/patches/0.3.12-0002-Macro-collision-winnt-SDK.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e5d4356ad1eba225ee47b46390da5d5e675e8a69 Mon Sep 17 00:00:00 2001 -From: Joakim Haugen -Date: Fri, 14 Jul 2023 11:48:07 +0200 -Subject: [PATCH] Macro collision with SDK winnt - ---- - cmake/utils.cmake | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/cmake/utils.cmake b/cmake/utils.cmake -index 8f25c1b27..01da7b1f3 100644 ---- a/cmake/utils.cmake -+++ b/cmake/utils.cmake -@@ -251,6 +251,19 @@ function(GenerateNamedObjects sources_in) - # now add the object and set the defines - set(obj_defines ${defines_in}) - -+ list(FIND obj_defines "RC" def_idx) -+ if (${def_idx} GREATER -1) -+ # list(REMOVE_AT ${obj_defines} ${def_idx}) -+ list (REMOVE_ITEM obj_defines "RC") -+ list(APPEND obj_defines "RC=RC") -+ endif () -+ list(FIND obj_defines "CR" def_idx) -+ if (${def_idx} GREATER -1) -+ # list(REMOVE_AT ${obj_defines} ${def_idx}) -+ list (REMOVE_ITEM obj_defines "CR") -+ list(APPEND obj_defines "CR=CR") -+ endif () -+ - if (use_cblas) - set(obj_name "cblas_${obj_name}") - list(APPEND obj_defines "CBLAS") --- -2.30.2 - diff --git a/openblas/all/patches/0.3.13-0001-Fix-libm-linking-and-fortran-detection.patch b/openblas/all/patches/0.3.13-0001-Fix-libm-linking-and-fortran-detection.patch deleted file mode 100644 index 615aa39..0000000 --- a/openblas/all/patches/0.3.13-0001-Fix-libm-linking-and-fortran-detection.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 55ce48e2486fb7653adcc398f9bde7bc99b81f90 Mon Sep 17 00:00:00 2001 -From: Joakim Haugen -Date: Fri, 21 Apr 2023 10:04:12 +0200 -Subject: [PATCH] Fix libm linking and fortran fixes - ---- - CMakeLists.txt | 2 +- - cmake/f_check.cmake | 3 ++- - cmake/fc.cmake | 7 +++++-- - 3 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 12730e0e..471d58c2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -184,7 +184,7 @@ add_library(${OpenBLAS_LIBNAME} ${LA_SOURCES} ${LAPACKE_SOURCES} ${RELA_SOURCES} - target_include_directories(${OpenBLAS_LIBNAME} INTERFACE $) - - # Android needs to explicitly link against libm --if(ANDROID) -+if (${CMAKE_SYSTEM_NAME} MATCHES "AIX|Android|Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|Darwin") - target_link_libraries(${OpenBLAS_LIBNAME} m) - endif() - -diff --git a/cmake/f_check.cmake b/cmake/f_check.cmake -index 0f5d0e15..e66e9780 100644 ---- a/cmake/f_check.cmake -+++ b/cmake/f_check.cmake -@@ -25,8 +25,9 @@ if (NOT NO_LAPACK) - check_language(Fortran) - if(CMAKE_Fortran_COMPILER) - enable_language(Fortran) -+ file(WRITE ${CMAKE_BINARY_DIR}/FORTRAN_COMPILER ${CMAKE_Fortran_COMPILER_ID}) - else() -- message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK") -+ message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.") - set (NOFORTRAN 1) - set (NO_LAPACK 1) - endif() -diff --git a/cmake/fc.cmake b/cmake/fc.cmake -index fc1f9bb2..6c8f07d2 100644 ---- a/cmake/fc.cmake -+++ b/cmake/fc.cmake -@@ -77,14 +77,17 @@ if (${F_COMPILER} STREQUAL "GFORTRAN") - endif () - endif () - --if (${F_COMPILER} STREQUAL "INTEL") -+if (${F_COMPILER} STREQUAL "IFORT" OR ${F_COMPILER} STREQUAL "IFX") -+ if (MSVC) -+ set(FCOMMON_OPT "${FCOMMON_OPT} -names:lowercase -assume:underscore") -+ endif () - set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_INTEL") - if (INTERFACE64) - set(FCOMMON_OPT "${FCOMMON_OPT} -i8") - endif () - set(FCOMMON_OPT "${FCOMMON_OPT} -recursive") - if (USE_OPENMP) -- set(FCOMMON_OPT "${FCOMMON_OPT} -openmp") -+ set(FCOMMON_OPT "${FCOMMON_OPT} -fopenmp") - endif () - endif () - --- -2.30.2 - diff --git a/openblas/all/patches/0.3.13-0002-Macro-collision-winnt-SDK.patch b/openblas/all/patches/0.3.13-0002-Macro-collision-winnt-SDK.patch deleted file mode 100644 index be3aa6e..0000000 --- a/openblas/all/patches/0.3.13-0002-Macro-collision-winnt-SDK.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 3be718a78fca15a541cf82961307a0e6304bd18a Mon Sep 17 00:00:00 2001 -From: Joakim Haugen -Date: Fri, 14 Jul 2023 11:51:40 +0200 -Subject: [PATCH] Macro collision in winnt.h SDK - ---- - cmake/utils.cmake | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/cmake/utils.cmake b/cmake/utils.cmake -index 8f25c1b27..01da7b1f3 100644 ---- a/cmake/utils.cmake -+++ b/cmake/utils.cmake -@@ -251,6 +251,19 @@ function(GenerateNamedObjects sources_in) - # now add the object and set the defines - set(obj_defines ${defines_in}) - -+ list(FIND obj_defines "RC" def_idx) -+ if (${def_idx} GREATER -1) -+ # list(REMOVE_AT ${obj_defines} ${def_idx}) -+ list (REMOVE_ITEM obj_defines "RC") -+ list(APPEND obj_defines "RC=RC") -+ endif () -+ list(FIND obj_defines "CR" def_idx) -+ if (${def_idx} GREATER -1) -+ # list(REMOVE_AT ${obj_defines} ${def_idx}) -+ list (REMOVE_ITEM obj_defines "CR") -+ list(APPEND obj_defines "CR=CR") -+ endif () -+ - if (use_cblas) - set(obj_name "cblas_${obj_name}") - list(APPEND obj_defines "CBLAS") --- -2.30.2 - diff --git a/openblas/all/patches/0.3.15-0001-Fix-libm-linking-and-fortran-detection.patch b/openblas/all/patches/0.3.15-0001-Fix-libm-linking-and-fortran-detection.patch deleted file mode 100644 index ff08e91..0000000 --- a/openblas/all/patches/0.3.15-0001-Fix-libm-linking-and-fortran-detection.patch +++ /dev/null @@ -1,79 +0,0 @@ -From d9d6ffc328f1610687fd58da2a1365bdfac538c8 Mon Sep 17 00:00:00 2001 -From: Joakim Haugen -Date: Fri, 21 Apr 2023 10:06:16 +0200 -Subject: [PATCH] Fix libm linking and fortran fixes - ---- - CMakeLists.txt | 2 +- - cmake/f_check.cmake | 3 ++- - cmake/fc.cmake | 7 +++++-- - test/CMakeLists.txt | 1 + - 4 files changed, 9 insertions(+), 4 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 15f6ba2c..c2978df9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -187,7 +187,7 @@ add_library(${OpenBLAS_LIBNAME} ${LA_SOURCES} ${LAPACKE_SOURCES} ${RELA_SOURCES} - target_include_directories(${OpenBLAS_LIBNAME} INTERFACE $) - - # Android needs to explicitly link against libm --if(ANDROID) -+if (${CMAKE_SYSTEM_NAME} MATCHES "AIX|Android|Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|Darwin") - target_link_libraries(${OpenBLAS_LIBNAME} m) - endif() - -diff --git a/cmake/f_check.cmake b/cmake/f_check.cmake -index 0f5d0e15..e66e9780 100644 ---- a/cmake/f_check.cmake -+++ b/cmake/f_check.cmake -@@ -25,8 +25,9 @@ if (NOT NO_LAPACK) - check_language(Fortran) - if(CMAKE_Fortran_COMPILER) - enable_language(Fortran) -+ file(WRITE ${CMAKE_BINARY_DIR}/FORTRAN_COMPILER ${CMAKE_Fortran_COMPILER_ID}) - else() -- message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK") -+ message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.") - set (NOFORTRAN 1) - set (NO_LAPACK 1) - endif() -diff --git a/cmake/fc.cmake b/cmake/fc.cmake -index fc1f9bb2..6c8f07d2 100644 ---- a/cmake/fc.cmake -+++ b/cmake/fc.cmake -@@ -77,14 +77,17 @@ if (${F_COMPILER} STREQUAL "GFORTRAN") - endif () - endif () - --if (${F_COMPILER} STREQUAL "INTEL") -+if (${F_COMPILER} STREQUAL "IFORT" OR ${F_COMPILER} STREQUAL "IFX") -+ if (MSVC) -+ set(FCOMMON_OPT "${FCOMMON_OPT} -names:lowercase -assume:underscore") -+ endif () - set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_INTEL") - if (INTERFACE64) - set(FCOMMON_OPT "${FCOMMON_OPT} -i8") - endif () - set(FCOMMON_OPT "${FCOMMON_OPT} -recursive") - if (USE_OPENMP) -- set(FCOMMON_OPT "${FCOMMON_OPT} -openmp") -+ set(FCOMMON_OPT "${FCOMMON_OPT} -fopenmp") - endif () - endif () - -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index d338242f..afe8f04b 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -24,6 +24,7 @@ endforeach() - # $1 exec, $2 input, $3 output_result - if(WIN32) - FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_helper.ps1 -+"[Console]::InputEncoding = New-Object Text.UTF8Encoding $false\n" - "if (Test-Path $args[2]) { Remove-Item -Force $args[2] } \n" - "$ErrorActionPreference = \"Stop\"\n" - "Get-Content $args[1] | & $args[0]\n" --- -2.30.2 - diff --git a/openblas/all/patches/0.3.15-0002-Macro-collision-winnt-SDK.patch b/openblas/all/patches/0.3.15-0002-Macro-collision-winnt-SDK.patch deleted file mode 100644 index cc61165..0000000 --- a/openblas/all/patches/0.3.15-0002-Macro-collision-winnt-SDK.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e27c87256428c6b7cb71c75c5f52b7e9a05fbe2a Mon Sep 17 00:00:00 2001 -From: Joakim Haugen -Date: Fri, 14 Jul 2023 11:53:42 +0200 -Subject: [PATCH] Macro collision winnt SDK - ---- - cmake/utils.cmake | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/cmake/utils.cmake b/cmake/utils.cmake -index 29b5a067b..2d781476a 100644 ---- a/cmake/utils.cmake -+++ b/cmake/utils.cmake -@@ -254,6 +254,19 @@ function(GenerateNamedObjects sources_in) - # now add the object and set the defines - set(obj_defines ${defines_in}) - -+ list(FIND obj_defines "RC" def_idx) -+ if (${def_idx} GREATER -1) -+ # list(REMOVE_AT ${obj_defines} ${def_idx}) -+ list (REMOVE_ITEM obj_defines "RC") -+ list(APPEND obj_defines "RC=RC") -+ endif () -+ list(FIND obj_defines "CR" def_idx) -+ if (${def_idx} GREATER -1) -+ # list(REMOVE_AT ${obj_defines} ${def_idx}) -+ list (REMOVE_ITEM obj_defines "CR") -+ list(APPEND obj_defines "CR=CR") -+ endif () -+ - if (use_cblas) - set(obj_name "cblas_${obj_name}") - list(APPEND obj_defines "CBLAS") --- -2.30.2 - diff --git a/openblas/all/patches/0.3.17-0001-Fix-libm-linking-and-fortran-detection.patch b/openblas/all/patches/0.3.17-0001-Fix-libm-linking-and-fortran-detection.patch deleted file mode 100644 index 0c53bd2..0000000 --- a/openblas/all/patches/0.3.17-0001-Fix-libm-linking-and-fortran-detection.patch +++ /dev/null @@ -1,79 +0,0 @@ -From c6da99207a57e037664504e7d27affa983330981 Mon Sep 17 00:00:00 2001 -From: Joakim Haugen -Date: Fri, 21 Apr 2023 10:07:18 +0200 -Subject: [PATCH] Fix libm linking and fortran fixes - ---- - CMakeLists.txt | 2 +- - cmake/f_check.cmake | 3 ++- - cmake/fc.cmake | 7 +++++-- - test/CMakeLists.txt | 1 + - 4 files changed, 9 insertions(+), 4 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 37191a42..fce3d850 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -187,7 +187,7 @@ add_library(${OpenBLAS_LIBNAME} ${LA_SOURCES} ${LAPACKE_SOURCES} ${RELA_SOURCES} - target_include_directories(${OpenBLAS_LIBNAME} INTERFACE $) - - # Android needs to explicitly link against libm --if(ANDROID) -+if (${CMAKE_SYSTEM_NAME} MATCHES "AIX|Android|Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|Darwin") - target_link_libraries(${OpenBLAS_LIBNAME} m) - endif() - -diff --git a/cmake/f_check.cmake b/cmake/f_check.cmake -index 0f5d0e15..e66e9780 100644 ---- a/cmake/f_check.cmake -+++ b/cmake/f_check.cmake -@@ -25,8 +25,9 @@ if (NOT NO_LAPACK) - check_language(Fortran) - if(CMAKE_Fortran_COMPILER) - enable_language(Fortran) -+ file(WRITE ${CMAKE_BINARY_DIR}/FORTRAN_COMPILER ${CMAKE_Fortran_COMPILER_ID}) - else() -- message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK") -+ message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.") - set (NOFORTRAN 1) - set (NO_LAPACK 1) - endif() -diff --git a/cmake/fc.cmake b/cmake/fc.cmake -index fc1f9bb2..6c8f07d2 100644 ---- a/cmake/fc.cmake -+++ b/cmake/fc.cmake -@@ -77,14 +77,17 @@ if (${F_COMPILER} STREQUAL "GFORTRAN") - endif () - endif () - --if (${F_COMPILER} STREQUAL "INTEL") -+if (${F_COMPILER} STREQUAL "IFORT" OR ${F_COMPILER} STREQUAL "IFX") -+ if (MSVC) -+ set(FCOMMON_OPT "${FCOMMON_OPT} -names:lowercase -assume:underscore") -+ endif () - set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_INTEL") - if (INTERFACE64) - set(FCOMMON_OPT "${FCOMMON_OPT} -i8") - endif () - set(FCOMMON_OPT "${FCOMMON_OPT} -recursive") - if (USE_OPENMP) -- set(FCOMMON_OPT "${FCOMMON_OPT} -openmp") -+ set(FCOMMON_OPT "${FCOMMON_OPT} -fopenmp") - endif () - endif () - -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index d338242f..afe8f04b 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -24,6 +24,7 @@ endforeach() - # $1 exec, $2 input, $3 output_result - if(WIN32) - FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_helper.ps1 -+"[Console]::InputEncoding = New-Object Text.UTF8Encoding $false\n" - "if (Test-Path $args[2]) { Remove-Item -Force $args[2] } \n" - "$ErrorActionPreference = \"Stop\"\n" - "Get-Content $args[1] | & $args[0]\n" --- -2.30.2 - diff --git a/openblas/all/patches/0.3.20-0001-Fix-libm-linking-and-fortran-detection.patch b/openblas/all/patches/0.3.20-0001-Fix-libm-linking-and-fortran-detection.patch deleted file mode 100644 index 6da723d..0000000 --- a/openblas/all/patches/0.3.20-0001-Fix-libm-linking-and-fortran-detection.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 0bd25ba0a3a6fdbd88b26ad6fb7b3542d23d3968 Mon Sep 17 00:00:00 2001 -From: Joakim Haugen -Date: Fri, 21 Apr 2023 10:09:21 +0200 -Subject: [PATCH] Fix libm linking and fortran fixes - ---- - CMakeLists.txt | 2 +- - cmake/f_check.cmake | 3 ++- - cmake/fc.cmake | 7 +++++-- - test/CMakeLists.txt | 1 + - 4 files changed, 9 insertions(+), 4 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ab9f3af8..873cd28f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -236,7 +236,7 @@ endif() - set_target_properties(${OpenBLAS_LIBS} PROPERTIES OUTPUT_NAME ${OpenBLAS_LIBNAME}) - - # Android needs to explicitly link against libm --if(ANDROID) -+if (${CMAKE_SYSTEM_NAME} MATCHES "AIX|Android|Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|Darwin") - if(BUILD_STATIC_LIBS) - target_link_libraries(${OpenBLAS_LIBNAME}_static m) - endif() -diff --git a/cmake/f_check.cmake b/cmake/f_check.cmake -index 14683ed2..a98b489d 100644 ---- a/cmake/f_check.cmake -+++ b/cmake/f_check.cmake -@@ -24,9 +24,10 @@ include(CheckLanguage) - check_language(Fortran) - if(CMAKE_Fortran_COMPILER) - enable_language(Fortran) -+ file(WRITE ${CMAKE_BINARY_DIR}/FORTRAN_COMPILER ${CMAKE_Fortran_COMPILER_ID}) - else() - if (NOT NO_LAPACK) -- message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK") -+ message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.") - endif() - set (NOFORTRAN 1) - set (NO_LAPACK 1) -diff --git a/cmake/fc.cmake b/cmake/fc.cmake -index 9feda9be..0cb6308f 100644 ---- a/cmake/fc.cmake -+++ b/cmake/fc.cmake -@@ -79,14 +79,17 @@ if (${F_COMPILER} STREQUAL "GFORTRAN") - endif () - endif () - --if (${F_COMPILER} STREQUAL "INTEL") -+if (${F_COMPILER} STREQUAL "IFORT" OR ${F_COMPILER} STREQUAL "IFX") -+ if (MSVC) -+ set(FCOMMON_OPT "${FCOMMON_OPT} -names:lowercase -assume:underscore") -+ endif () - set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_INTEL") - if (INTERFACE64) - set(FCOMMON_OPT "${FCOMMON_OPT} -i8") - endif () - set(FCOMMON_OPT "${FCOMMON_OPT} -recursive") - if (USE_OPENMP) -- set(FCOMMON_OPT "${FCOMMON_OPT} -openmp") -+ set(FCOMMON_OPT "${FCOMMON_OPT} -fopenmp") - endif () - endif () - -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index e4ee8b28..c94b5a6c 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -28,6 +28,7 @@ endforeach() - # $1 exec, $2 input, $3 output_result - if(WIN32) - FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_helper.ps1 -+"[Console]::InputEncoding = New-Object Text.UTF8Encoding $false\n" - "if (Test-Path $args[2]) { Remove-Item -Force $args[2] } \n" - "$ErrorActionPreference = \"Stop\"\n" - "Get-Content $args[1] | & $args[0]\n" --- -2.30.2 - diff --git a/openblas/all/patches/0.3.23-0001-Fix-Intel-Fortran-detection-and-flag-change-to-fopen.patch b/openblas/all/patches/0.3.23-0001-Fix-Intel-Fortran-detection-and-flag-change-to-fopen.patch deleted file mode 100644 index d877a2d..0000000 --- a/openblas/all/patches/0.3.23-0001-Fix-Intel-Fortran-detection-and-flag-change-to-fopen.patch +++ /dev/null @@ -1,52 +0,0 @@ -From b06e6e0ed959ee423838b8bba37ace5bb441dda1 Mon Sep 17 00:00:00 2001 -From: Joakim Haugen -Date: Fri, 21 Apr 2023 10:41:33 +0200 -Subject: [PATCH] Fix Intel Fortran detection and flag change to -fopenmp - ---- - cmake/f_check.cmake | 2 ++ - cmake/fc.cmake | 7 +++++-- - 2 files changed, 7 insertions(+), 2 deletions(-) - -diff --git a/cmake/f_check.cmake b/cmake/f_check.cmake -index df3a4858..9072c28c 100644 ---- a/cmake/f_check.cmake -+++ b/cmake/f_check.cmake -@@ -24,8 +24,10 @@ include(CheckLanguage) - check_language(Fortran) - if(CMAKE_Fortran_COMPILER) - enable_language(Fortran) -+ file(WRITE ${CMAKE_BINARY_DIR}/FORTRAN_COMPILER ${CMAKE_Fortran_COMPILER_ID}) - else() - set (NOFORTRAN 1) -+ file(WRITE ${CMAKE_BINARY_DIR}/FORTRAN_COMPILER 0) - if (NOT NO_LAPACK) - if (NOT XXXXX) - message(STATUS "No Fortran compiler found, can build only BLAS and f2c-converted LAPACK") -diff --git a/cmake/fc.cmake b/cmake/fc.cmake -index e615e148..5149199d 100644 ---- a/cmake/fc.cmake -+++ b/cmake/fc.cmake -@@ -87,14 +87,17 @@ if (${F_COMPILER} STREQUAL "GFORTRAN") - endif () - endif () - --if (${F_COMPILER} STREQUAL "INTEL") -+if (${F_COMPILER} STREQUAL "IFORT" OR ${F_COMPILER} STREQUAL "IFX") -+ if (MSVC) -+ set(FCOMMON_OPT "${FCOMMON_OPT} -names:lowercase -assume:underscore") -+ endif () - set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_INTEL") - if (INTERFACE64) - set(FCOMMON_OPT "${FCOMMON_OPT} -i8") - endif () - set(FCOMMON_OPT "${FCOMMON_OPT} -recursive") - if (USE_OPENMP) -- set(FCOMMON_OPT "${FCOMMON_OPT} -openmp") -+ set(FCOMMON_OPT "${FCOMMON_OPT} -fopenmp") - endif () - endif () - --- -2.30.2 - diff --git a/openblas/all/test_package/CMakeLists.txt b/openblas/all/test_package/CMakeLists.txt index 4153299..eaf0782 100644 --- a/openblas/all/test_package/CMakeLists.txt +++ b/openblas/all/test_package/CMakeLists.txt @@ -1,9 +1,7 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.1) +project(test_package) -project(test_package CXX) - -find_package(OpenBLAS CONFIG REQUIRED) -#find_package(OpenBLAS CONFIG COMPONENTS OpenBLAS::pthread REQUIRED) +find_package(OpenBLAS REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} OpenBLAS::OpenBLAS) diff --git a/openblas/all/test_package/conanfile.py b/openblas/all/test_package/conanfile.py index d2f60fe..02eb5ce 100644 --- a/openblas/all/test_package/conanfile.py +++ b/openblas/all/test_package/conanfile.py @@ -1,13 +1,13 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake, CMakeDeps +from conan.tools.cmake import cmake_layout, CMake import os # It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeToolchain", "VirtualRunEnv" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" def requirements(self): @@ -16,11 +16,6 @@ def requirements(self): def layout(self): cmake_layout(self) - def generate(self): - deps = CMakeDeps(self) - deps.check_components_exist = True - deps.generate() - def build(self): cmake = CMake(self) cmake.configure() diff --git a/openblas/config.yml b/openblas/config.yml index 5adc7ea..e0f3014 100644 --- a/openblas/config.yml +++ b/openblas/config.yml @@ -1,5 +1,11 @@ versions: - "0.3.23": + "0.3.27": + folder: all + "0.3.26": + folder: all + "0.3.25": + folder: all + "0.3.24": folder: all "0.3.20": folder: all diff --git a/openssl/1.x.x/conandata.yml b/openssl/1.x.x/conandata.yml new file mode 100644 index 0000000..26bc447 --- /dev/null +++ b/openssl/1.x.x/conandata.yml @@ -0,0 +1,9 @@ +sources: + 1.1.1w: + sha256: cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8 + url: "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz" +patches: + 1.1.1w: + - patch_file: patches/1.1.1-tvos-watchos.patch + patch_description: "TVOS and WatchOS don't like fork()" + patch_type: "portability" diff --git a/openssl/1.x.x/conanfile.py b/openssl/1.x.x/conanfile.py new file mode 100644 index 0000000..424f65a --- /dev/null +++ b/openssl/1.x.x/conanfile.py @@ -0,0 +1,648 @@ +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os, XCRun +from conan.tools.build import cross_building +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import ( + apply_conandata_patches, chdir, copy, export_conandata_patches, + get, load, replace_in_file, rm, rmdir, save +) +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path +from conan.tools.scm import Version +from contextlib import contextmanager +import fnmatch +import json +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class OpenSSLConan(ConanFile): + name = "openssl" + package_type = "library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/openssl/openssl" + license = "OpenSSL" + topics = ("openssl", "ssl", "tls", "encryption", "security") + description = "A toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols" + + settings = "os", "arch", "compiler", "build_type" + options = { + "no_threads": [True, False], + "shared": [True, False], + "fPIC": [True, False], + "no_asm": [True, False], + "enable_weak_ssl_ciphers": [True, False], + "386": [True, False], + "no_stdio": [True, False], + "no_tests": [True, False], + "no_sse2": [True, False], + "no_bf": [True, False], + "no_cast": [True, False], + "no_des": [True, False], + "no_dh": [True, False], + "no_dsa": [True, False], + "no_hmac": [True, False], + "no_md5": [True, False], + "no_mdc2": [True, False], + "no_rc2": [True, False], + "no_rsa": [True, False], + "no_sha": [True, False], + "no_async": [True, False], + "no_dso": [True, False], + "no_aria": [True, False], + "no_blake2": [True, False], + "no_camellia": [True, False], + "no_chacha": [True, False], + "no_cms": [True, False], + "no_comp": [True, False], + "no_ct": [True, False], + "no_deprecated": [True, False], + "no_dgram": [True, False], + "no_engine": [True, False], + "no_filenames": [True, False], + "no_gost": [True, False], + "no_idea": [True, False], + "no_md4": [True, False], + "no_ocsp": [True, False], + "no_pinshared": [True, False], + "no_rmd160": [True, False], + "no_sm2": [True, False], + "no_sm3": [True, False], + "no_sm4": [True, False], + "no_srp": [True, False], + "no_srtp": [True, False], + "no_ssl": [True, False], + "no_ts": [True, False], + "no_whirlpool": [True, False], + "no_ec": [True, False], + "no_ecdh": [True, False], + "no_ecdsa": [True, False], + "no_rfc3779": [True, False], + "no_seed": [True, False], + "no_sock": [True, False], + "no_ssl3": [True, False], + "no_tls1": [True, False], + "capieng_dialog": [True, False], + "enable_capieng": [True, False], + "openssldir": [None, "ANY"], + } + default_options = {key: False for key in options.keys()} + default_options["fPIC"] = True + default_options["openssldir"] = None + + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" and \ + self.settings.compiler.get_safe("runtime") + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + @property + def _use_nmake(self): + return self._is_clang_cl or is_msvc(self) + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + else: + del self.options.capieng_dialog + del self.options.enable_capieng + + if self.settings.os == "Emscripten": + self.options.no_asm = True + self.options.no_threads = True + self.options.no_stdio = True + self.options.no_tests = True + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os == "Emscripten": + if not all((self.options.no_asm, self.options.no_threads, self.options.no_stdio, self.options.no_tests)): + raise ConanInvalidConfiguration("os=Emscripten requires openssl:{no_asm,no_threads,no_stdio,no_tests}=True") + + def build_requirements(self): + if self._settings_build.os == "Windows": + if not self.options.no_asm: + self.tool_requires("nasm/2.16.01") + if self._use_nmake: + self.tool_requires("strawberryperl/5.32.1.1") + else: + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + + tc = AutotoolsToolchain(self) + if self.settings.os == "Macos" and not cross_building(self): + tc.extra_cflags = [f"-isysroot {XCRun(self).sdk_path}"] + tc.extra_cxxflags = [f"-isysroot {XCRun(self).sdk_path}"] + tc.extra_ldflags = [f"-isysroot {XCRun(self).sdk_path}"] + env = tc.environment() + env.define("PERL", self._perl) + tc.generate(env) + gen_info = {} + gen_info["CFLAGS"] = tc.cflags + gen_info["CXXFLAGS"] = tc.cxxflags + gen_info["DEFINES"] = tc.defines + gen_info["LDFLAGS"] = tc.ldflags + save(self, "gen_info.conf", json.dumps(gen_info)) + tc = AutotoolsDeps(self) + tc.generate() + + @property + def _target(self): + target = "conan-%s-%s-%s-%s-%s" % (self.settings.build_type, + self.settings.os, + self.settings.arch, + self.settings.compiler, + self.settings.compiler.version) + if self._use_nmake: + target = "VC-" + target # VC- prefix is important as it's checked by Configure + if self._is_mingw: + target = "mingw-" + target + return target + + @property + def _perlasm_scheme(self): + # right now, we need to tweak this for iOS & Android only, as they inherit from generic targets + the_arch = str(self.settings.arch) + the_os = str(self.settings.os) + if the_os in ["iOS", "watchOS", "tvOS"]: + return {"armv7": "ios32", + "armv7s": "ios32", + "armv8": "ios64", + "armv8_32": "ios64", + "armv8.3": "ios64", + "armv7k": "ios32"}.get(the_arch, None) + if the_os == "Android": + return {"armv7": "void", + "armv8": "linux64", + "mips": "o32", + "mips64": "64", + "x86": "android", + "x86_64": "elf"}.get(the_arch, None) + return None + + @property + def _targets(self): + is_cygwin = self.settings.get_safe("os.subsystem") == "cygwin" + return { + "Linux-x86-clang": "linux-x86-clang", + "Linux-x86_64-clang": "linux-x86_64-clang", + "Linux-x86-*": "linux-x86", + "Linux-x86_64-*": "linux-x86_64", + "Linux-armv4-*": "linux-armv4", + "Linux-armv4i-*": "linux-armv4", + "Linux-armv5el-*": "linux-armv4", + "Linux-armv5hf-*": "linux-armv4", + "Linux-armv6-*": "linux-armv4", + "Linux-armv7-*": "linux-armv4", + "Linux-armv7hf-*": "linux-armv4", + "Linux-armv7s-*": "linux-armv4", + "Linux-armv7k-*": "linux-armv4", + "Linux-armv8-*": "linux-aarch64", + "Linux-armv8.3-*": "linux-aarch64", + "Linux-armv8-32-*": "linux-arm64ilp32", + "Linux-mips-*": "linux-mips32", + "Linux-mips64-*": "linux-mips64", + "Linux-ppc32-*": "linux-ppc32", + "Linux-ppc32le-*": "linux-pcc32", + "Linux-ppc32be-*": "linux-ppc32", + "Linux-ppc64-*": "linux-ppc64", + "Linux-ppc64le-*": "linux-ppc64le", + "Linux-pcc64be-*": "linux-pcc64", + "Linux-s390x-*": "linux64-s390x", + "Linux-e2k-*": "linux-generic64", + "Linux-sparc-*": "linux-sparcv8", + "Linux-sparcv9-*": "linux64-sparcv9", + "Linux-*-*": "linux-generic32", + "Macos-x86-*": "darwin-i386-cc", + "Macos-x86_64-*": "darwin64-x86_64-cc", + "Macos-ppc32-*": "darwin-ppc-cc", + "Macos-ppc32be-*": "darwin-ppc-cc", + "Macos-ppc64-*": "darwin64-ppc-cc", + "Macos-ppc64be-*": "darwin64-ppc-cc", + "Macos-armv8-*": "darwin64-arm64-cc", + "Macos-*-*": "darwin-common", + "iOS-x86_64-*": "darwin64-x86_64-cc", + "iOS-*-*": "iphoneos-cross", + "watchOS-*-*": "iphoneos-cross", + "tvOS-*-*": "iphoneos-cross", + # Android targets are very broken, see https://github.com/openssl/openssl/issues/7398 + "Android-armv7-*": "linux-generic32", + "Android-armv7hf-*": "linux-generic32", + "Android-armv8-*": "linux-generic64", + "Android-x86-*": "linux-x86-clang", + "Android-x86_64-*": "linux-x86_64-clang", + "Android-mips-*": "linux-generic32", + "Android-mips64-*": "linux-generic64", + "Android-*-*": "linux-generic32", + "Windows-x86-gcc": "Cygwin-x86" if is_cygwin else "mingw", + "Windows-x86_64-gcc": "Cygwin-x86_64" if is_cygwin else "mingw64", + "Windows-*-gcc": "Cygwin-common" if is_cygwin else "mingw-common", + "Windows-ia64-Visual Studio": "VC-WIN64I", # Itanium + "Windows-x86-Visual Studio": "VC-WIN32", + "Windows-x86_64-Visual Studio": "VC-WIN64A", + "Windows-armv7-Visual Studio": "VC-WIN32-ARM", + "Windows-armv8-Visual Studio": "VC-WIN64-ARM", + "Windows-*-Visual Studio": "VC-noCE-common", + "Windows-ia64-clang": "VC-WIN64I", # Itanium + "Windows-x86-clang": "VC-WIN32", + "Windows-x86_64-clang": "VC-WIN64A", + "Windows-armv7-clang": "VC-WIN32-ARM", + "Windows-armv8-clang": "VC-WIN64-ARM", + "Windows-*-clang": "VC-noCE-common", + "WindowsStore-x86-*": "VC-WIN32-UWP", + "WindowsStore-x86_64-*": "VC-WIN64A-UWP", + "WindowsStore-armv7-*": "VC-WIN32-ARM-UWP", + "WindowsStore-armv8-*": "VC-WIN64-ARM-UWP", + "WindowsStore-*-*": "VC-WIN32-ONECORE", + "WindowsCE-*-*": "VC-CE", + "SunOS-x86-gcc": "solaris-x86-gcc", + "SunOS-x86_64-gcc": "solaris64-x86_64-gcc", + "SunOS-sparc-gcc": "solaris-sparcv8-gcc", + "SunOS-sparcv9-gcc": "solaris64-sparcv9-gcc", + "SunOS-x86-suncc": "solaris-x86-cc", + "SunOS-x86_64-suncc": "solaris64-x86_64-cc", + "SunOS-sparc-suncc": "solaris-sparcv8-cc", + "SunOS-sparcv9-suncc": "solaris64-sparcv9-cc", + "SunOS-*-*": "solaris-common", + "*BSD-x86-*": "BSD-x86", + "*BSD-x86_64-*": "BSD-x86_64", + "*BSD-ia64-*": "BSD-ia64", + "*BSD-sparc-*": "BSD-sparcv8", + "*BSD-sparcv9-*": "BSD-sparcv9", + "*BSD-armv8-*": "BSD-generic64", + "*BSD-mips64-*": "BSD-generic64", + "*BSD-ppc64-*": "BSD-generic64", + "*BSD-ppc64le-*": "BSD-generic64", + "*BSD-ppc64be-*": "BSD-generic64", + "AIX-ppc32-gcc": "aix-gcc", + "AIX-ppc64-gcc": "aix64-gcc", + "AIX-pcc32-*": "aix-cc", + "AIX-ppc64-*": "aix64-cc", + "AIX-*-*": "aix-common", + "*BSD-*-*": "BSD-generic32", + "Emscripten-*-*": "cc", + "Neutrino-*-*": "BASE_unix", + } + + @property + def _ancestor_target(self): + if "CONAN_OPENSSL_CONFIGURATION" in os.environ: + return os.environ["CONAN_OPENSSL_CONFIGURATION"] + compiler = "Visual Studio" if self.settings.compiler == "msvc" else self.settings.compiler + query = f"{self.settings.os}-{self.settings.arch}-{compiler}" + ancestor = next((self._targets[i] for i in self._targets if fnmatch.fnmatch(query, i)), None) + if not ancestor: + raise ConanInvalidConfiguration( + f"Unsupported configuration ({self.settings.os}/{self.settings.arch}/{self.settings.compiler}).\n" + f"Please open an issue at {self.url}.\n" + f"Alternatively, set the CONAN_OPENSSL_CONFIGURATION environment variable into your conan profile." + ) + return ancestor + + def _tool(self, env_name, apple_name): + if env_name in os.environ: + return os.environ[env_name] + if self.settings.compiler == "apple-clang": + return getattr(XCRun(self), apple_name) + return None + + def _get_default_openssl_dir(self): + if self.settings.os == "Linux": + return "/etc/ssl" + return "res" + + @property + def _configure_args(self): + openssldir = self.options.openssldir or self._get_default_openssl_dir() + openssldir = unix_path(self, openssldir) if self.win_bash else openssldir + args = [ + f'"{self._target}"', + "shared" if self.options.shared else "no-shared", + "--prefix=/", + f"--openssldir=\"{openssldir}\"", + "no-unit-test", + "no-threads" if self.options.no_threads else "threads", + f"PERL={self._perl}", + "no-tests", + "--debug" if self.settings.build_type == "Debug" else "--release", + "--libdir=lib", # See https://github.com/openssl/openssl/blob/master/INSTALL.md#libdir + ] + + if self.settings.os in ["tvOS", "watchOS"]: + args.append(" -DNO_FORK") # fork is not available on tvOS and watchOS + if self.settings.os == "Android": + args.append(" -D__ANDROID_API__=%s" % str(self.settings.os.api_level)) # see NOTES.ANDROID + if self.settings.os == "Emscripten": + args.append("-D__STDC_NO_ATOMICS__=1") + if self.settings.os == "Windows": + if self.options.enable_capieng: + args.append("enable-capieng") + if self.options.capieng_dialog: + args.append("-DOPENSSL_CAPIENG_DIALOG=1") + else: + args.append("-fPIC" if self.options.get_safe("fPIC", True) else "no-pic") + + args.append("no-md2") + + if self.settings.os == "Neutrino": + args.append("no-asm -lsocket -latomic") + if self._is_clang_cl: + # #error is not yet supported when compiling as C, but this is planned for a future release. + args.append("-D__STDC_NO_ATOMICS__") + + if Version(conan_version).major < 2: + possible_values = self.options.values.fields + else: + possible_values = self.options.possible_values + for option_name in possible_values: + activated = self.options.get_safe(option_name) + if activated and option_name not in ["fPIC", "openssldir", "capieng_dialog", "enable_capieng"]: + self.output.info("activated option: %s" % option_name) + args.append(option_name.replace("_", "-")) + return args + + def _create_targets(self): + config_template = """{targets} = ( + "{target}" => {{ + inherit_from => {ancestor}, + cflags => add("{cflags}"), + cxxflags => add("{cxxflags}"), + {defines} + includes => add({includes}), + lflags => add("{lflags}"), + {shared_target} + {shared_cflag} + {shared_extension} + {cc} + {cxx} + {ar} + {ranlib} + {perlasm_scheme} + }}, +); +""" + gen_info = json.loads(load(self, os.path.join(self.generators_folder, "gen_info.conf"))) + self.output.info(f"gen_info = {gen_info}") + cflags = [] + cxxflags = [] + cflags.extend(gen_info["CFLAGS"]) + cxxflags.extend(gen_info["CXXFLAGS"]) + + cc = self._tool("CC", "cc") + cxx = self._tool("CXX", "cxx") + ar = self._tool("AR", "ar") + ranlib = self._tool("RANLIB", "ranlib") + + perlasm_scheme = "" + if self._perlasm_scheme: + perlasm_scheme = 'perlasm_scheme => "%s",' % self._perlasm_scheme + + cc = 'cc => "%s",' % cc if cc else "" + cxx = 'cxx => "%s",' % cxx if cxx else "" + ar = 'ar => "%s",' % ar if ar else "" + defines = ", ".join(f'"{d}"' for d in gen_info["DEFINES"]) + defines = 'defines => add([%s]),' % defines if defines else "" + ranlib = 'ranlib => "%s",' % ranlib if ranlib else "" + targets = "my %targets" + includes = "" + + ancestor = f'[ "{self._ancestor_target}" ]' + shared_cflag = '' + shared_extension = '' + shared_target = '' + if self.settings.os == 'Neutrino': + if self.options.shared: + shared_extension = r'shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",' + shared_target = 'shared_target => "gnu-shared",' + if self.options.get_safe("fPIC", True): + shared_cflag='shared_cflag => "-fPIC",' + + if self.settings.os in ["iOS", "tvOS", "watchOS"] and self.conf.get("tools.apple:enable_bitcode", check_type=bool): + cflags.append("-fembed-bitcode") + cxxflags.append("-fembed-bitcode") + + config = config_template.format(targets=targets, + target=self._target, + ancestor=ancestor, + cc=cc, + cxx=cxx, + ar=ar, + ranlib=ranlib, + cflags=" ".join(cflags), + cxxflags=" ".join(cxxflags), + defines=defines, + includes=includes, + perlasm_scheme=perlasm_scheme, + shared_target=shared_target, + shared_extension=shared_extension, + shared_cflag=shared_cflag, + lflags=" ".join(gen_info["LDFLAGS"])) + self.output.info("using target: %s -> %s" % (self._target, self._ancestor_target)) + self.output.info(config) + + save(self, os.path.join(self.source_folder, "Configurations", "20-conan.conf"), config) + + @property + def _perl(self): + if self._use_nmake: + return self.dependencies.build["strawberryperl"].conf_info.get("user.strawberryperl:perl", check_type=str) + return "perl" + + @contextmanager + def _make_context(self): + if self._use_nmake: + # Windows: when cmake generates its cache, it populates some environment variables as well. + # If cmake also initiates openssl build, their values (containing spaces and forward slashes) + # break nmake (don't know about mingw make). So we fix them + def sanitize_env_var(var): + return '"{}"'.format(var).replace('/', '\\') if '"' not in var else var + env = Environment() + for key in ("CC", "RC"): + if os.getenv(key): + env.define(key, sanitize_env_var(os.getenv(key))) + with env.vars(self).apply(): + yield + else: + yield + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + self._create_targets() + with self._make_context(): + with chdir(self, self.source_folder): + # workaround for clang-cl not producing .pdb files + if self._is_clang_cl: + save(self, "ossl_static.pdb", "") + args = " ".join(self._configure_args) + self.output.info(self._configure_args) + + if self._use_nmake: + self._replace_runtime_in_file(os.path.join("Configurations", "10-main.conf")) + + self.run(f'{self._perl} ./Configure {args}') + + self._patch_install_name() + + if self._use_nmake: + self.run("nmake /F Makefile") + else: + autotools.make() + + def _patch_install_name(self): + if is_apple_os(self) and self.options.shared: + old_str = '-install_name $(INSTALLTOP)/$(LIBDIR)/' + new_str = '-install_name @rpath/' + replace_in_file(self, "Makefile", old_str, new_str) + if self._use_nmake: + # NMAKE interprets trailing backslash as line continuation + replace_in_file(self, "Makefile", 'INSTALLTOP_dir=\\', 'INSTALLTOP_dir=/') + + def _replace_runtime_in_file(self, filename): + runtime = msvc_runtime_flag(self) + for e in ["MDd", "MTd", "MD", "MT"]: + replace_in_file(self, filename, "/{} ".format(e), "/{} ".format(runtime), strict=False) + replace_in_file(self, filename, "/{}\"".format(e), "/{}\"".format(runtime), strict=False) + + def package(self): + copy(self, "*LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"), keep_path=False) + if self._use_nmake: + with chdir(self, self.source_folder): + self.run(f"nmake -f Makefile install_sw DESTDIR={self.package_folder}") + rm(self, "*.pdb", self.package_folder, recursive=True) + else: + autotools = Autotools(self) + with chdir(self, self.source_folder): + args = [f"DESTDIR={unix_path(self, self.package_folder)}"] + autotools.make(target="install_sw", args=args) + + if self.options.shared: + libdir = os.path.join(self.package_folder, "lib") + for file in os.listdir(libdir): + if self._is_mingw and file.endswith(".dll.a"): + continue + if file.endswith(".a"): + os.unlink(os.path.join(libdir, file)) + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent("""\ + set(OPENSSL_FOUND TRUE) + if(DEFINED OpenSSL_INCLUDE_DIR) + set(OPENSSL_INCLUDE_DIR ${OpenSSL_INCLUDE_DIR}) + endif() + if(DEFINED OpenSSL_Crypto_LIBS) + set(OPENSSL_CRYPTO_LIBRARY ${OpenSSL_Crypto_LIBS}) + set(OPENSSL_CRYPTO_LIBRARIES ${OpenSSL_Crypto_LIBS} + ${OpenSSL_Crypto_DEPENDENCIES} + ${OpenSSL_Crypto_FRAMEWORKS} + ${OpenSSL_Crypto_SYSTEM_LIBS}) + elseif(DEFINED openssl_OpenSSL_Crypto_LIBS_%(config)s) + set(OPENSSL_CRYPTO_LIBRARY ${openssl_OpenSSL_Crypto_LIBS_%(config)s}) + set(OPENSSL_CRYPTO_LIBRARIES ${openssl_OpenSSL_Crypto_LIBS_%(config)s} + ${openssl_OpenSSL_Crypto_DEPENDENCIES_%(config)s} + ${openssl_OpenSSL_Crypto_FRAMEWORKS_%(config)s} + ${openssl_OpenSSL_Crypto_SYSTEM_LIBS_%(config)s}) + endif() + if(DEFINED OpenSSL_SSL_LIBS) + set(OPENSSL_SSL_LIBRARY ${OpenSSL_SSL_LIBS}) + set(OPENSSL_SSL_LIBRARIES ${OpenSSL_SSL_LIBS} + ${OpenSSL_SSL_DEPENDENCIES} + ${OpenSSL_SSL_FRAMEWORKS} + ${OpenSSL_SSL_SYSTEM_LIBS}) + elseif(DEFINED openssl_OpenSSL_SSL_LIBS_%(config)s) + set(OPENSSL_SSL_LIBRARY ${openssl_OpenSSL_SSL_LIBS_%(config)s}) + set(OPENSSL_SSL_LIBRARIES ${openssl_OpenSSL_SSL_LIBS_%(config)s} + ${openssl_OpenSSL_SSL_DEPENDENCIES_%(config)s} + ${openssl_OpenSSL_SSL_FRAMEWORKS_%(config)s} + ${openssl_OpenSSL_SSL_SYSTEM_LIBS_%(config)s}) + endif() + if(DEFINED OpenSSL_LIBRARIES) + set(OPENSSL_LIBRARIES ${OpenSSL_LIBRARIES}) + endif() + if(DEFINED OpenSSL_VERSION) + set(OPENSSL_VERSION ${OpenSSL_VERSION}) + endif() + """ % {"config":str(self.settings.build_type).upper()}) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "OpenSSL") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.set_property("pkg_config_name", "openssl") + + self.cpp_info.components["crypto"].set_property("cmake_target_name", "OpenSSL::Crypto") + self.cpp_info.components["crypto"].set_property("pkg_config_name", "libcrypto") + self.cpp_info.components["ssl"].set_property("cmake_target_name", "OpenSSL::SSL") + self.cpp_info.components["ssl"].set_property("pkg_config_name", "libssl") + if self._use_nmake: + self.cpp_info.components["ssl"].libs = ["libssl"] + self.cpp_info.components["crypto"].libs = ["libcrypto"] + else: + self.cpp_info.components["ssl"].libs = ["ssl"] + self.cpp_info.components["crypto"].libs = ["crypto"] + + self.cpp_info.components["ssl"].requires = ["crypto"] + + if self.settings.os == "Windows": + self.cpp_info.components["crypto"].system_libs.extend(["crypt32", "ws2_32", "advapi32", "user32", "bcrypt"]) + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["crypto"].system_libs.extend(["dl", "rt"]) + self.cpp_info.components["ssl"].system_libs.append("dl") + if not self.options.no_threads: + self.cpp_info.components["crypto"].system_libs.append("pthread") + self.cpp_info.components["ssl"].system_libs.append("pthread") + elif self.settings.os == "Neutrino": + self.cpp_info.components["crypto"].system_libs.append("atomic") + self.cpp_info.components["ssl"].system_libs.append("atomic") + self.cpp_info.components["crypto"].system_libs.append("socket") + self.cpp_info.components["ssl"].system_libs.append("socket") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "OpenSSL" + self.cpp_info.names["cmake_find_package_multi"] = "OpenSSL" + self.cpp_info.components["ssl"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["crypto"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["crypto"].names["cmake_find_package"] = "Crypto" + self.cpp_info.components["crypto"].names["cmake_find_package_multi"] = "Crypto" + self.cpp_info.components["ssl"].names["cmake_find_package"] = "SSL" + self.cpp_info.components["ssl"].names["cmake_find_package_multi"] = "SSL" diff --git a/openssl/1.x.x/patches/1.1.1-tvos-watchos.patch b/openssl/1.x.x/patches/1.1.1-tvos-watchos.patch new file mode 100644 index 0000000..c9291d4 --- /dev/null +++ b/openssl/1.x.x/patches/1.1.1-tvos-watchos.patch @@ -0,0 +1,32 @@ +--- apps/ocsp.c ++++ apps/ocsp.c +@@ -33,6 +33,13 @@ + #include + #include + ++/* fork() breaks AppleTVOS, WatchOS, AppleTVSimulator and WatchSimulator */ ++/* Users should configure with -DNO_FORK */ ++#if defined(NO_FORK) ++# undef HAVE_FORK ++# define HAVE_FORK 0 ++#endif ++ + #ifndef HAVE_FORK + #if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) + # define HAVE_FORK 0 +--- apps/speed.c ++++ apps/speed.c +@@ -99,6 +99,13 @@ + #endif + #include + ++/* fork() breaks AppleTVOS, WatchOS, AppleTVSimulator and WatchSimulator */ ++/* Users should configure with -DNO_FORK */ ++#if defined(NO_FORK) ++# undef HAVE_FORK ++# define HAVE_FORK 0 ++#endif ++ + #ifndef HAVE_FORK + # if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_VXWORKS) + # define HAVE_FORK 0 diff --git a/openssl/1.x.x/test_package/CMakeLists.txt b/openssl/1.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000..7fb310b --- /dev/null +++ b/openssl/1.x.x/test_package/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package C) + +option(OPENSSL_WITH_ZLIB "OpenSSL with zlib support" ON) + +set(OpenSSL_DEBUG 1) +find_package(OpenSSL REQUIRED) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindOpenSSL.html +# are properly defined in conan generators +set(_custom_vars + OPENSSL_FOUND + OPENSSL_INCLUDE_DIR + OPENSSL_CRYPTO_LIBRARY + OPENSSL_CRYPTO_LIBRARIES + OPENSSL_SSL_LIBRARY + OPENSSL_SSL_LIBRARIES + OPENSSL_LIBRARIES + OPENSSL_VERSION +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() + +add_executable(${PROJECT_NAME} digest.c) +target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::SSL) +target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:WITH_ZLIB>) diff --git a/openssl/1.x.x/test_package/conanfile.py b/openssl/1.x.x/test_package/conanfile.py new file mode 100644 index 0000000..5bbdbb3 --- /dev/null +++ b/openssl/1.x.x/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["OPENSSL_WITH_ZLIB"] = not self.dependencies["openssl"].options.get_safe("no_zlib", True) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/openssl/1.x.x/test_package/digest.c b/openssl/1.x.x/test_package/digest.c new file mode 100644 index 0000000..e93ed8d --- /dev/null +++ b/openssl/1.x.x/test_package/digest.c @@ -0,0 +1,106 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(WITH_ZLIB) +#include +#endif + +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define snprintf _snprintf +#endif + +#if OPENSSL_VERSION_NUMBER > 0x10101000L +#define OPENSSL_1_1_1_OR_LATER +#endif + +void SHA3_hash(const EVP_MD *type, const unsigned char *message, size_t message_len, unsigned char *digest, unsigned int *digest_len) { + EVP_MD_CTX *mdctx; + + if((mdctx = EVP_MD_CTX_create()) == NULL) + printf("EVP_MD_CTX_create error!\n"); + + if(EVP_DigestInit_ex(mdctx, type, NULL) != 1) + printf("EVP_DigestInit_ex error!\n"); + + if(EVP_DigestUpdate(mdctx, message, message_len) != 1) + printf("EVP_DigestUpdate error!\n"); + + if(EVP_DigestFinal_ex(mdctx, digest, digest_len) != 1) + printf("EVP_DigestFinal_ex error!\n"); + + EVP_MD_CTX_destroy(mdctx); +} + +int main() +{ + unsigned int digest_len; + unsigned char md5_digest[MD5_DIGEST_LENGTH], + sha1_digest[SHA_DIGEST_LENGTH], + sha256_digest[SHA256_DIGEST_LENGTH], + sha512_digest[SHA512_DIGEST_LENGTH], + sha3_256_digest[SHA256_DIGEST_LENGTH], + sha3_512_digest[SHA512_DIGEST_LENGTH]; + char md5_string[MD5_DIGEST_LENGTH*2+1] = {0}, + sha1_string[SHA_DIGEST_LENGTH*2+1] = {0}, + sha256_string[SHA256_DIGEST_LENGTH*2+1] = {0}, + sha512_string[SHA512_DIGEST_LENGTH*2+1] = {0}, + sha3_256_string[SHA256_DIGEST_LENGTH*2+1] = {0}, + sha3_512_string[SHA512_DIGEST_LENGTH*2+1] = {0}; + char string[] = "happy"; + +#if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_library_init(); +#else + OPENSSL_init_ssl(0, NULL); +#endif + + MD5((unsigned char*)&string, strlen(string), (unsigned char*)&md5_digest); + SHA1((unsigned char*)&string, strlen(string), (unsigned char*)&sha1_digest); + SHA256((unsigned char*)&string, strlen(string), (unsigned char*)&sha256_digest); + SHA512((unsigned char*)&string, strlen(string), (unsigned char*)&sha512_digest); +#ifdef OPENSSL_1_1_1_OR_LATER + SHA3_hash(EVP_sha3_256(), (unsigned char*)&string, strlen(string), (unsigned char*)&sha3_256_digest, &digest_len); + SHA3_hash(EVP_sha3_512(), (unsigned char*)&string, strlen(string), (unsigned char*)&sha3_512_digest, &digest_len); +#endif + int i; + for(i = 0; i < MD5_DIGEST_LENGTH; i++) + snprintf(&md5_string[i*2], sizeof(md5_string)-i*2, "%02x", (unsigned int)md5_digest[i]); + + for(i = 0; i < SHA_DIGEST_LENGTH; i++) + snprintf(&sha1_string[i*2], sizeof(sha1_string)-i*2, "%02x", (unsigned int)sha1_digest[i]); + + for(i = 0; i < SHA256_DIGEST_LENGTH; i++) { + snprintf(&sha256_string[i*2], sizeof(sha256_string)-i*2, "%02x", (unsigned int)sha256_digest[i]); + snprintf(&sha3_256_string[i*2], sizeof(sha3_256_string)-i*2, "%02x", (unsigned int)sha3_256_digest[i]); + } + + for(i = 0; i < SHA512_DIGEST_LENGTH; i++) { + snprintf(&sha512_string[i*2], sizeof(sha512_string)-i*2, "%02x", (unsigned int)sha512_digest[i]); + snprintf(&sha3_512_string[i*2], sizeof(sha3_512_string)-i*2, "%02x", (unsigned int)sha3_512_digest[i]); + } + + printf("md5 digest: %s\n", md5_string); + printf("sha1 digest: %s\n", sha1_string); + printf("sha256 digest: %s\n", sha256_string); + printf("sha512 digest: %s\n", sha512_string); +#ifdef OPENSSL_1_1_1_OR_LATER + printf("sha3 256 digest: %s\n", sha3_256_string); + printf("sha3 512 digest: %s\n", sha3_512_string); +#endif +#if OPENSSL_VERSION_NUMBER < 0x10100000L + printf("SSL library version: %s\n", SSLeay_version(SSLEAY_VERSION)); +#else + printf("SSL library version: %s\n", OpenSSL_version(OPENSSL_VERSION)); +#endif +#if defined(WITH_ZLIB) + COMP_METHOD *zlib_comp = COMP_zlib(); + printf("ZLIB compression method is named: %s\n", SSL_COMP_get_name(zlib_comp)); +#endif + + return 0; +} diff --git a/openssl/1.x.x/test_v1_package/CMakeLists.txt b/openssl/1.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..2f6b1a2 --- /dev/null +++ b/openssl/1.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/openssl/1.x.x/test_v1_package/conanfile.py b/openssl/1.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000..57b42be --- /dev/null +++ b/openssl/1.x.x/test_v1_package/conanfile.py @@ -0,0 +1,25 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def _openssl_option(self, name, default): + try: + return getattr(self.options["openssl"], name, default) + except (AttributeError, ConanException): + return default + + def build(self): + cmake = CMake(self) + cmake.definitions["OPENSSL_WITH_ZLIB"] = not self._openssl_option("no_zlib", True) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/openssl/3.x.x/conandata.yml b/openssl/3.x.x/conandata.yml new file mode 100644 index 0000000..0e6fcf5 --- /dev/null +++ b/openssl/3.x.x/conandata.yml @@ -0,0 +1,19 @@ +sources: + 3.2.2: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.2.2/openssl-3.2.2.tar.gz" + sha256: 197149c18d9e9f292c43f0400acaba12e5f52cacfe050f3d199277ea738ec2e7 + 3.2.1: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.2.1/openssl-3.2.1.tar.gz" + sha256: 83c7329fe52c850677d75e5d0b0ca245309b97e8ecbcfdc1dfdc4ab9fac35b39 + 3.1.6: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.1.6/openssl-3.1.6.tar.gz" + sha256: 5d2be4036b478ef3cb0a854ca9b353072c3a0e26d8a56f8f0ab9fb6ed32d38d7 + 3.1.5: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.1.5/openssl-3.1.5.tar.gz" + sha256: 6ae015467dabf0469b139ada93319327be24b98251ffaeceda0221848dc09262 + 3.0.14: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.0.14/openssl-3.0.14.tar.gz" + sha256: eeca035d4dd4e84fc25846d952da6297484afa0650a6f84c682e39df3a4123ca + 3.0.13: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.0.13/openssl-3.0.13.tar.gz" + sha256: 88525753f79d3bec27d2fa7c66aa0b92b3aa9498dafd93d7cfa4b3780cdae313 diff --git a/openssl/3.x.x/conanfile.py b/openssl/3.x.x/conanfile.py new file mode 100644 index 0000000..6b88374 --- /dev/null +++ b/openssl/3.x.x/conanfile.py @@ -0,0 +1,674 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os, XCRun +from conan.tools.build import build_jobs +from conan.tools.files import chdir, copy, get, replace_in_file, rm, rmdir, save +from conan.tools.gnu import AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path + +import fnmatch +import os +import textwrap + +required_conan_version = ">=1.57.0" + + +class OpenSSLConan(ConanFile): + name = "openssl" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/openssl/openssl" + license = "Apache-2.0" + topics = ("ssl", "tls", "encryption", "security") + description = "A toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_weak_ssl_ciphers": [True, False], + "386": [True, False], + "capieng_dialog": [True, False], + "enable_capieng": [True, False], + "enable_trace": [True, False], + "no_aria": [True, False], + "no_apps": [True, False], + "no_autoload_config": [True, False], + "no_asm": [True, False], + "no_async": [True, False], + "no_blake2": [True, False], + "no_bf": [True, False], + "no_camellia": [True, False], + "no_chacha": [True, False], + "no_cms": [True, False], + "no_comp": [True, False], + "no_ct": [True, False], + "no_cast": [True, False], + "no_deprecated": [True, False], + "no_des": [True, False], + "no_dgram": [True, False], + "no_dh": [True, False], + "no_dsa": [True, False], + "no_dso": [True, False], + "no_ec": [True, False], + "no_ecdh": [True, False], + "no_ecdsa": [True, False], + "no_engine": [True, False], + "no_filenames": [True, False], + "no_fips": [True, False], + "no_gost": [True, False], + "no_idea": [True, False], + "no_legacy": [True, False], + "no_md2": [True, False], + "no_md4": [True, False], + "no_mdc2": [True, False], + "no_module": [True, False], + "no_ocsp": [True, False], + "no_pinshared": [True, False], + "no_rc2": [True, False], + "no_rc4": [True, False], + "no_rc5": [True, False], + "no_rfc3779": [True, False], + "no_rmd160": [True, False], + "no_sm2": [True, False], + "no_sm3": [True, False], + "no_sm4": [True, False], + "no_srp": [True, False], + "no_srtp": [True, False], + "no_sse2": [True, False], + "no_ssl": [True, False], + "no_stdio": [True, False], + "no_seed": [True, False], + "no_sock": [True, False], + "no_ssl3": [True, False], + "no_threads": [True, False], + "no_tls1": [True, False], + "no_ts": [True, False], + "no_whirlpool": [True, False], + "no_zlib": [True, False], + "openssldir": [None, "ANY"], + "tls_security_level": [None, 0, 1, 2, 3, 4, 5], + } + default_options = {key: False for key in options.keys()} + default_options["fPIC"] = True + default_options["no_md2"] = True + default_options["openssldir"] = None + default_options["tls_security_level"] = None + + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" and \ + self.settings.compiler.get_safe("runtime") + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + @property + def _use_nmake(self): + return self._is_clang_cl or is_msvc(self) + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self.settings.os != "Windows": + self.options.rm_safe("capieng_dialog") + self.options.rm_safe("enable_capieng") + else: + self.options.rm_safe("fPIC") + + if self.settings.os == "Emscripten": + self.options.no_asm = True + self.options.no_threads = True + self.options.no_stdio = True + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if not self.options.no_zlib: + self.requires("zlib/[>=1.2.11 <2]") + + def validate(self): + if self.settings.os == "Emscripten": + if not all((self.options.no_asm, self.options.no_threads, self.options.no_stdio)): + raise ConanInvalidConfiguration("os=Emscripten requires openssl:{no_asm,no_threads,no_stdio}=True") + + if self.settings.os == "iOS" and self.options.shared: + raise ConanInvalidConfiguration("OpenSSL 3 does not support building shared libraries for iOS") + + def build_requirements(self): + if self._settings_build.os == "Windows": + if not self.options.no_asm: + self.tool_requires("nasm/2.16.01") + if self._use_nmake: + self.tool_requires("strawberryperl/5.32.1.1") + else: + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _target(self): + target = f"conan-{self.settings.build_type}-{self.settings.os}-{self.settings.arch}-{self.settings.compiler}-{self.settings.compiler.version}" + if self._use_nmake: + target = f"VC-{target}" # VC- prefix is important as it's checked by Configure + if self._is_mingw: + target = f"mingw-{target}" + return target + + @property + def _perlasm_scheme(self): + # right now, we need to tweak this for iOS & Android only, as they inherit from generic targets + if self.settings.os in ("iOS", "watchOS", "tvOS"): + return { + "armv7": "ios32", + "armv7s": "ios32", + "armv8": "ios64", + "armv8_32": "ios64", + "armv8.3": "ios64", + "armv7k": "ios32", + }.get(str(self.settings.arch), None) + elif self.settings.os == "Android": + return { + "armv7": "void", + "armv8": "linux64", + "mips": "o32", + "mips64": "64", + "x86": "android", + "x86_64": "elf", + }.get(str(self.settings.arch), None) + return None + + @property + def _asm_target(self): + if self.settings.os in ("Android", "iOS", "watchOS", "tvOS"): + return { + "x86": "x86_asm" if self.settings.os == "Android" else None, + "x86_64": "x86_64_asm" if self.settings.os == "Android" else None, + "armv5el": "armv4_asm", + "armv5hf": "armv4_asm", + "armv6": "armv4_asm", + "armv7": "armv4_asm", + "armv7hf": "armv4_asm", + "armv7s": "armv4_asm", + "armv7k": "armv4_asm", + "armv8": "aarch64_asm", + "armv8_32": "aarch64_asm", + "armv8.3": "aarch64_asm", + "mips": "mips32_asm", + "mips64": "mips64_asm", + "sparc": "sparcv8_asm", + "sparcv9": "sparcv9_asm", + "ia64": "ia64_asm", + "ppc32be": "ppc32_asm", + "ppc32": "ppc32_asm", + "ppc64le": "ppc64_asm", + "ppc64": "ppc64_asm", + "s390": "s390x_asm", + "s390x": "s390x_asm" + }.get(str(self.settings.os), None) + + @property + def _targets(self): + is_cygwin = self.settings.get_safe("os.subsystem") == "cygwin" + return { + "Linux-x86-clang": "linux-x86-clang", + "Linux-x86_64-clang": "linux-x86_64-clang", + "Linux-x86-*": "linux-x86", + "Linux-x86_64-*": "linux-x86_64", + "Linux-armv4-*": "linux-armv4", + "Linux-armv4i-*": "linux-armv4", + "Linux-armv5el-*": "linux-armv4", + "Linux-armv5hf-*": "linux-armv4", + "Linux-armv6-*": "linux-armv4", + "Linux-armv7-*": "linux-armv4", + "Linux-armv7hf-*": "linux-armv4", + "Linux-armv7s-*": "linux-armv4", + "Linux-armv7k-*": "linux-armv4", + "Linux-armv8-*": "linux-aarch64", + "Linux-armv8.3-*": "linux-aarch64", + "Linux-armv8-32-*": "linux-arm64ilp32", + "Linux-mips-*": "linux-mips32", + "Linux-mips64-*": "linux-mips64", + "Linux-ppc32-*": "linux-ppc32", + "Linux-ppc32le-*": "linux-pcc32", + "Linux-ppc32be-*": "linux-ppc32", + "Linux-ppc64-*": "linux-ppc64", + "Linux-ppc64le-*": "linux-ppc64le", + "Linux-pcc64be-*": "linux-pcc64", + "Linux-s390x-*": "linux64-s390x", + "Linux-e2k-*": "linux-generic64", + "Linux-sparc-*": "linux-sparcv8", + "Linux-sparcv9-*": "linux64-sparcv9", + "Linux-*-*": "linux-generic32", + "Macos-x86-*": "darwin-i386-cc", + "Macos-x86_64-*": "darwin64-x86_64-cc", + "Macos-ppc32-*": "darwin-ppc-cc", + "Macos-ppc32be-*": "darwin-ppc-cc", + "Macos-ppc64-*": "darwin64-ppc-cc", + "Macos-ppc64be-*": "darwin64-ppc-cc", + "Macos-armv8-*": "darwin64-arm64-cc", + "Macos-*-*": "darwin-common", + "iOS-x86_64-*": "darwin64-x86_64-cc", + "iOS-*-*": "iphoneos-cross", + "watchOS-*-*": "iphoneos-cross", + "tvOS-*-*": "iphoneos-cross", + # Android targets are very broken, see https://github.com/openssl/openssl/issues/7398 + "Android-armv7-*": "linux-generic32", + "Android-armv7hf-*": "linux-generic32", + "Android-armv8-*": "linux-generic64", + "Android-x86-*": "linux-x86-clang", + "Android-x86_64-*": "linux-x86_64-clang", + "Android-mips-*": "linux-generic32", + "Android-mips64-*": "linux-generic64", + "Android-*-*": "linux-generic32", + "Windows-x86-gcc": "Cygwin-x86" if is_cygwin else "mingw", + "Windows-x86_64-gcc": "Cygwin-x86_64" if is_cygwin else "mingw64", + "Windows-*-gcc": "Cygwin-common" if is_cygwin else "mingw-common", + "Windows-ia64-Visual Studio": "VC-WIN64I", # Itanium + "Windows-x86-Visual Studio": "VC-WIN32", + "Windows-x86_64-Visual Studio": "VC-WIN64A", + "Windows-armv7-Visual Studio": "VC-WIN32-ARM", + "Windows-armv8-Visual Studio": "VC-WIN64-ARM", + "Windows-*-Visual Studio": "VC-noCE-common", + "Windows-ia64-clang": "VC-WIN64I", # Itanium + "Windows-x86-clang": "VC-WIN32", + "Windows-x86_64-clang": "VC-WIN64A", + "Windows-armv7-clang": "VC-WIN32-ARM", + "Windows-armv8-clang": "VC-WIN64-ARM", + "Windows-*-clang": "VC-noCE-common", + "WindowsStore-x86-*": "VC-WIN32-UWP", + "WindowsStore-x86_64-*": "VC-WIN64A-UWP", + "WindowsStore-armv7-*": "VC-WIN32-ARM-UWP", + "WindowsStore-armv8-*": "VC-WIN64-ARM-UWP", + "WindowsStore-*-*": "VC-WIN32-ONECORE", + "WindowsCE-*-*": "VC-CE", + "SunOS-x86-gcc": "solaris-x86-gcc", + "SunOS-x86_64-gcc": "solaris64-x86_64-gcc", + "SunOS-sparc-gcc": "solaris-sparcv8-gcc", + "SunOS-sparcv9-gcc": "solaris64-sparcv9-gcc", + "SunOS-x86-suncc": "solaris-x86-cc", + "SunOS-x86_64-suncc": "solaris64-x86_64-cc", + "SunOS-sparc-suncc": "solaris-sparcv8-cc", + "SunOS-sparcv9-suncc": "solaris64-sparcv9-cc", + "SunOS-*-*": "solaris-common", + "*BSD-x86-*": "BSD-x86", + "*BSD-x86_64-*": "BSD-x86_64", + "*BSD-ia64-*": "BSD-ia64", + "*BSD-sparc-*": "BSD-sparcv8", + "*BSD-sparcv9-*": "BSD-sparcv9", + "*BSD-armv8-*": "BSD-generic64", + "*BSD-mips64-*": "BSD-generic64", + "*BSD-ppc64-*": "BSD-generic64", + "*BSD-ppc64le-*": "BSD-generic64", + "*BSD-ppc64be-*": "BSD-generic64", + "AIX-ppc32-gcc": "aix-gcc", + "AIX-ppc64-gcc": "aix64-gcc", + "AIX-pcc32-*": "aix-cc", + "AIX-ppc64-*": "aix64-cc", + "AIX-*-*": "aix-common", + "*BSD-*-*": "BSD-generic32", + "Emscripten-*-*": "cc", + "Neutrino-*-*": "BASE_unix", + } + + @property + def _ancestor_target(self): + if "CONAN_OPENSSL_CONFIGURATION" in os.environ: + return os.environ["CONAN_OPENSSL_CONFIGURATION"] + compiler = "Visual Studio" if self.settings.compiler == "msvc" else self.settings.compiler + query = f"{self.settings.os}-{self.settings.arch}-{compiler}" + ancestor = next((self._targets[i] for i in self._targets if fnmatch.fnmatch(query, i)), None) + if not ancestor: + raise ConanInvalidConfiguration( + f"Unsupported configuration ({self.settings.os}/{self.settings.arch}/{self.settings.compiler}).\n" + f"Please open an issue at {self.url}.\n" + f"Alternatively, set the CONAN_OPENSSL_CONFIGURATION environment variable into your conan profile." + ) + return ancestor + + def _get_default_openssl_dir(self): + if self.settings.os == "Linux": + return "/etc/ssl" + return os.path.join(self.package_folder, "res") + + def _adjust_path(self, path): + if self._use_nmake: + return path.replace("\\", "/") + return unix_path(self, path) + + @property + def _configure_args(self): + openssldir = self.options.openssldir or self._get_default_openssl_dir() + openssldir = unix_path(self, openssldir) if self.win_bash else openssldir + args = [ + f'"{self._target}"', + "shared" if self.options.shared else "no-shared", + "--debug" if self.settings.build_type == "Debug" else "--release", + "--prefix=/", + "--libdir=lib", + f"--openssldir=\"{openssldir}\"", + "no-threads" if self.options.no_threads else "threads", + f"PERL={self._perl}", + "no-unit-test", + "no-tests", + ] + + if self.settings.os == "Android": + args.append(f" -D__ANDROID_API__={str(self.settings.os.api_level)}") # see NOTES.ANDROID + if self.settings.os == "Emscripten": + args.append("-D__STDC_NO_ATOMICS__=1") + if self.settings.os == "Windows": + if self.options.enable_capieng: + args.append("enable-capieng") + if self.options.capieng_dialog: + args.append("-DOPENSSL_CAPIENG_DIALOG=1") + else: + args.append("-fPIC" if self.options.get_safe("fPIC", True) else "no-pic") + + args.append("no-fips" if self.options.get_safe("no_fips", True) else "enable-fips") + args.append("no-md2" if self.options.get_safe("no_md2", True) else "enable-md2") + if str(self.options.tls_security_level) != "None": + args.append(f"-DOPENSSL_TLS_SECURITY_LEVEL={self.options.tls_security_level}") + + if self.options.get_safe("enable_trace"): + args.append("enable-trace") + + if self.settings.os == "Neutrino": + args.append("no-asm -lsocket -latomic") + + if not self.options.no_zlib: + zlib_cpp_info = self.dependencies["zlib"].cpp_info.aggregated_components() + include_path = self._adjust_path(zlib_cpp_info.includedirs[0]) + if self._use_nmake: + lib_path = self._adjust_path(os.path.join(zlib_cpp_info.libdirs[0], f"{zlib_cpp_info.libs[0]}.lib")) + else: + # Just path, GNU like compilers will find the right file + lib_path = self._adjust_path(zlib_cpp_info.libdirs[0]) + + if self.dependencies["zlib"].options.shared: + args.append("zlib-dynamic") + else: + args.append("zlib") + + args.extend([ + f'--with-zlib-include="{include_path}"', + f'--with-zlib-lib="{lib_path}"', + ]) + + for option_name in self.default_options.keys(): + if self.options.get_safe(option_name, False) and option_name not in ("shared", "fPIC", "openssldir", "tls_security_level", "capieng_dialog", "enable_capieng", "zlib", "no_fips", "no_md2"): + self.output.info(f"Activated option: {option_name}") + args.append(option_name.replace("_", "-")) + return args + + def generate(self): + tc = AutotoolsToolchain(self) + env = tc.environment() + env.define_path("PERL", self._perl) + if self.settings.compiler == "apple-clang": + xcrun = XCRun(self) + env.define_path("CROSS_SDK", os.path.basename(xcrun.sdk_path)) + env.define_path("CROSS_TOP", os.path.dirname(os.path.dirname(xcrun.sdk_path))) + + self._create_targets(tc.cflags, tc.cxxflags, tc.defines, tc.ldflags) + tc.generate(env) + + def _create_targets(self, cflags, cxxflags, defines, ldflags): + config_template = textwrap.dedent("""\ + {targets} = ( + "{target}" => {{ + inherit_from => {ancestor}, + cflags => add("{cflags}"), + cxxflags => add("{cxxflags}"), + {defines} + lflags => add("{lflags}"), + {shared_target} + {shared_cflag} + {shared_extension} + {perlasm_scheme} + }}, + ); + """) + + perlasm_scheme = "" + if self._perlasm_scheme: + perlasm_scheme = f'perlasm_scheme => "{self._perlasm_scheme}",' + + defines = '", "'.join(defines) + defines = 'defines => add("%s"),' % defines if defines else "" + targets = "my %targets" + + if self._asm_target: + ancestor = f'[ "{self._ancestor_target}", asm("{self._asm_target}") ]' + else: + ancestor = f'[ "{self._ancestor_target}" ]' + shared_cflag = "" + shared_extension = "" + shared_target = "" + if self.settings.os == "Neutrino": + if self.options.shared: + shared_extension = r'shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",' + shared_target = 'shared_target => "gnu-shared",' + if self.options.get_safe("fPIC", True): + shared_cflag = 'shared_cflag => "-fPIC",' + + if self.settings.os in ["iOS", "tvOS", "watchOS"] and self.conf.get("tools.apple:enable_bitcode", check_type=bool): + cflags.append("-fembed-bitcode") + cxxflags.append("-fembed-bitcode") + + config = config_template.format( + targets=targets, + target=self._target, + ancestor=ancestor, + cflags=" ".join(cflags), + cxxflags=" ".join(cxxflags), + defines=defines, + perlasm_scheme=perlasm_scheme, + shared_target=shared_target, + shared_extension=shared_extension, + shared_cflag=shared_cflag, + lflags=" ".join(ldflags) + ) + self.output.info(f"using target: {self._target} -> {self._ancestor_target}") + self.output.info(config) + + save(self, os.path.join(self.source_folder, "Configurations", "20-conan.conf"), config) + + def _run_make(self, targets=None, parallel=True, install=False): + command = [self._make_program] + if install: + command.append(f"DESTDIR={self._adjust_path(self.package_folder)}") + if targets: + command.extend(targets) + if not self._use_nmake: + command.append(f"-j{build_jobs(self)}" if parallel else "-j1") + self.run(" ".join(command), env="conanbuild") + + @property + def _perl(self): + if self._use_nmake: + return self.dependencies.build["strawberryperl"].conf_info.get("user.strawberryperl:perl", check_type=str) + return "perl" + + def _make(self): + with chdir(self, self.source_folder): + args = " ".join(self._configure_args) + + if self._use_nmake: + self._replace_runtime_in_file(os.path.join("Configurations", "10-main.conf")) + + self.run(f"{self._perl} ./Configure {args}", env="conanbuild") + if self._use_nmake: + # When `--prefix=/`, the scripts derive `\` without escaping, which + # causes issues on Windows + replace_in_file(self, "Makefile", "INSTALLTOP_dir=\\", "INSTALLTOP_dir=\\\\") + self._run_make() + + def _make_install(self): + with chdir(self, self.source_folder): + self._run_make(targets=["install_sw"], parallel=False, install=True) + + def build(self): + self._make() + configdata_pm = self._adjust_path(os.path.join(self.source_folder, "configdata.pm")) + self.run(f"{self._perl} {configdata_pm} --dump") + + @property + def _make_program(self): + return "nmake" if self._use_nmake else "make" + + def _replace_runtime_in_file(self, filename): + runtime = msvc_runtime_flag(self) + for e in ["MDd", "MTd", "MD", "MT"]: + replace_in_file(self, filename, f"/{e} ", f"/{runtime} ", strict=False) + replace_in_file(self, filename, f"/{e}\"", f"/{runtime}\"", strict=False) + + def package(self): + copy(self, "*LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + self._make_install() + if is_apple_os(self): + fix_apple_shared_install_name(self) + + rm(self, "*.pdb", self.package_folder, "lib") + if self.options.shared: + libdir = os.path.join(self.package_folder, "lib") + for file in os.listdir(libdir): + if self._is_mingw and file.endswith(".dll.a"): + continue + if file.endswith(".a"): + os.unlink(os.path.join(libdir, file)) + + if not self.options.no_fips: + provdir = os.path.join(self.source_folder, "providers") + modules_dir = os.path.join(self.package_folder, "lib", "ossl-modules") + if self.settings.os == "Macos": + copy(self, "fips.dylib", src=provdir, dst=modules_dir) + elif self.settings.os == "Windows": + copy(self, "fips.dll", src=provdir, dst=modules_dir) + else: + copy(self, "fips.so", src=provdir, dst=modules_dir) + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent("""\ + set(OPENSSL_FOUND TRUE) + if(DEFINED OpenSSL_INCLUDE_DIR) + set(OPENSSL_INCLUDE_DIR ${OpenSSL_INCLUDE_DIR}) + endif() + if(DEFINED OpenSSL_Crypto_LIBS) + set(OPENSSL_CRYPTO_LIBRARY ${OpenSSL_Crypto_LIBS}) + set(OPENSSL_CRYPTO_LIBRARIES ${OpenSSL_Crypto_LIBS} + ${OpenSSL_Crypto_DEPENDENCIES} + ${OpenSSL_Crypto_FRAMEWORKS} + ${OpenSSL_Crypto_SYSTEM_LIBS}) + elseif(DEFINED openssl_OpenSSL_Crypto_LIBS_%(config)s) + set(OPENSSL_CRYPTO_LIBRARY ${openssl_OpenSSL_Crypto_LIBS_%(config)s}) + set(OPENSSL_CRYPTO_LIBRARIES ${openssl_OpenSSL_Crypto_LIBS_%(config)s} + ${openssl_OpenSSL_Crypto_DEPENDENCIES_%(config)s} + ${openssl_OpenSSL_Crypto_FRAMEWORKS_%(config)s} + ${openssl_OpenSSL_Crypto_SYSTEM_LIBS_%(config)s}) + endif() + if(DEFINED OpenSSL_SSL_LIBS) + set(OPENSSL_SSL_LIBRARY ${OpenSSL_SSL_LIBS}) + set(OPENSSL_SSL_LIBRARIES ${OpenSSL_SSL_LIBS} + ${OpenSSL_SSL_DEPENDENCIES} + ${OpenSSL_SSL_FRAMEWORKS} + ${OpenSSL_SSL_SYSTEM_LIBS}) + elseif(DEFINED openssl_OpenSSL_SSL_LIBS_%(config)s) + set(OPENSSL_SSL_LIBRARY ${openssl_OpenSSL_SSL_LIBS_%(config)s}) + set(OPENSSL_SSL_LIBRARIES ${openssl_OpenSSL_SSL_LIBS_%(config)s} + ${openssl_OpenSSL_SSL_DEPENDENCIES_%(config)s} + ${openssl_OpenSSL_SSL_FRAMEWORKS_%(config)s} + ${openssl_OpenSSL_SSL_SYSTEM_LIBS_%(config)s}) + endif() + if(DEFINED OpenSSL_LIBRARIES) + set(OPENSSL_LIBRARIES ${OpenSSL_LIBRARIES}) + endif() + if(DEFINED OpenSSL_VERSION) + set(OPENSSL_VERSION ${OpenSSL_VERSION}) + endif() + """% {"config":str(self.settings.build_type).upper()}) + save(self, module_file, content) + + @property + def _module_subfolder(self): + return os.path.join("lib", "cmake") + + @property + def _module_file_rel_path(self): + return os.path.join(self._module_subfolder, + f"conan-official-{self.name}-variables.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "OpenSSL") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("pkg_config_name", "openssl") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.names["cmake_find_package"] = "OpenSSL" + self.cpp_info.names["cmake_find_package_multi"] = "OpenSSL" + self.cpp_info.components["ssl"].builddirs.append(self._module_subfolder) + self.cpp_info.components["ssl"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["ssl"].set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.components["crypto"].builddirs.append(self._module_subfolder) + self.cpp_info.components["crypto"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["crypto"].set_property("cmake_build_modules", [self._module_file_rel_path]) + + if self._use_nmake: + self.cpp_info.components["ssl"].libs = ["libssl"] + self.cpp_info.components["crypto"].libs = ["libcrypto"] + else: + self.cpp_info.components["ssl"].libs = ["ssl"] + self.cpp_info.components["crypto"].libs = ["crypto"] + + self.cpp_info.components["ssl"].requires = ["crypto"] + + if not self.options.no_zlib: + self.cpp_info.components["crypto"].requires.append("zlib::zlib") + + if self.settings.os == "Windows": + self.cpp_info.components["crypto"].system_libs.extend(["crypt32", "ws2_32", "advapi32", "user32", "bcrypt"]) + elif self.settings.os == "Linux": + self.cpp_info.components["crypto"].system_libs.extend(["dl", "rt"]) + self.cpp_info.components["ssl"].system_libs.append("dl") + if not self.options.no_threads: + self.cpp_info.components["crypto"].system_libs.append("pthread") + self.cpp_info.components["ssl"].system_libs.append("pthread") + elif self.settings.os == "Neutrino": + self.cpp_info.components["crypto"].system_libs.append("atomic") + self.cpp_info.components["ssl"].system_libs.append("atomic") + self.cpp_info.components["crypto"].system_libs.append("socket") + self.cpp_info.components["ssl"].system_libs.append("socket") + + self.cpp_info.components["crypto"].set_property("cmake_target_name", "OpenSSL::Crypto") + self.cpp_info.components["crypto"].set_property("pkg_config_name", "libcrypto") + self.cpp_info.components["ssl"].set_property("cmake_target_name", "OpenSSL::SSL") + self.cpp_info.components["ssl"].set_property("pkg_config_name", "libssl") + self.cpp_info.components["crypto"].names["cmake_find_package"] = "Crypto" + self.cpp_info.components["crypto"].names["cmake_find_package_multi"] = "Crypto" + self.cpp_info.components["ssl"].names["cmake_find_package"] = "SSL" + self.cpp_info.components["ssl"].names["cmake_find_package_multi"] = "SSL" + + openssl_modules_dir = os.path.join(self.package_folder, "lib", "ossl-modules") + self.runenv_info.define_path("OPENSSL_MODULES", openssl_modules_dir) + + # For legacy 1.x downstream consumers, remove once recipe is 2.0 only: + self.env_info.OPENSSL_MODULES = openssl_modules_dir diff --git a/openssl/3.x.x/test_package/CMakeLists.txt b/openssl/3.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000..f479eb1 --- /dev/null +++ b/openssl/3.x.x/test_package/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +option(OPENSSL_WITH_LEGACY "OpenSSL with support for the legacy provider" ON) +option(OPENSSL_WITH_MD4 "OpenSSL with MD4 support (needs legacy provider)" ON) +option(OPENSSL_WITH_RIPEMD160 "OpenSSL with RIPEMD16 support (needs legacy provider)" ON) + +set(OpenSSL_DEBUG 1) +find_package(OpenSSL REQUIRED) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindOpenSSL.html +# are properly defined in conan generators +set(_custom_vars + OPENSSL_FOUND + OPENSSL_INCLUDE_DIR + OPENSSL_CRYPTO_LIBRARY + OPENSSL_CRYPTO_LIBRARIES + OPENSSL_SSL_LIBRARY + OPENSSL_SSL_LIBRARIES + OPENSSL_LIBRARIES + OPENSSL_VERSION +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() + +add_executable(test_package test_package.c digest.c) +target_link_libraries(test_package PRIVATE OpenSSL::SSL OpenSSL::Crypto) + +if(OPENSSL_WITH_LEGACY) + target_sources(test_package PRIVATE digest_legacy.c) + # do now show deperecation warnings + target_compile_definitions(test_package PRIVATE OPENSSL_SUPPRESS_DEPRECATED TEST_OPENSSL_LEGACY) + if(OPENSSL_WITH_MD4) + target_compile_definitions(test_package PRIVATE OPENSSL_WITH_MD4) + endif() + if(OPENSSL_WITH_RIPEMD160) + target_compile_definitions(test_package PRIVATE OPENSSL_WITH_RIPEMD160) + endif() +endif() diff --git a/openssl/3.x.x/test_package/conanfile.py b/openssl/3.x.x/test_package/conanfile.py new file mode 100644 index 0000000..76d2cc2 --- /dev/null +++ b/openssl/3.x.x/test_package/conanfile.py @@ -0,0 +1,38 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def _with_legacy(self): + return (not self.dependencies["openssl"].options.no_legacy and + ((not self.dependencies["openssl"].options.no_md4) or + (not self.dependencies["openssl"].options.no_rmd160))) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["OPENSSL_WITH_LEGACY"] = self._with_legacy() + tc.cache_variables["OPENSSL_WITH_MD4"] = not self.dependencies["openssl"].options.no_md4 + tc.cache_variables["OPENSSL_WITH_RIPEMD160"] = not self.dependencies["openssl"].options.no_rmd160 + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/openssl/3.x.x/test_package/digest.c b/openssl/3.x.x/test_package/digest.c new file mode 100644 index 0000000..9446463 --- /dev/null +++ b/openssl/3.x.x/test_package/digest.c @@ -0,0 +1,65 @@ +#include +#include +#include +#include + +#include +#include +#include + +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define snprintf _snprintf +#endif + +void SHA3_hash(const EVP_MD *type, const unsigned char *message, size_t message_len, unsigned char *digest, unsigned int *digest_len) { + EVP_MD_CTX *mdctx; + + if((mdctx = EVP_MD_CTX_create()) == NULL) + printf("EVP_MD_CTX_create error!\n"); + + if(EVP_DigestInit_ex(mdctx, type, NULL) != 1) + printf("EVP_DigestInit_ex error!\n"); + + if(EVP_DigestUpdate(mdctx, message, message_len) != 1) + printf("EVP_DigestUpdate error!\n"); + + if(EVP_DigestFinal_ex(mdctx, digest, digest_len) != 1) + printf("EVP_DigestFinal_ex error!\n"); + + EVP_MD_CTX_destroy(mdctx); +} + +void digest() +{ + unsigned int digest_len; + unsigned char sha256_digest[SHA256_DIGEST_LENGTH], + sha512_digest[SHA512_DIGEST_LENGTH], + sha3_256_digest[SHA256_DIGEST_LENGTH], + sha3_512_digest[SHA512_DIGEST_LENGTH]; + char sha256_string[SHA256_DIGEST_LENGTH*2+1] = {0}, + sha512_string[SHA512_DIGEST_LENGTH*2+1] = {0}, + sha3_256_string[SHA256_DIGEST_LENGTH*2+1] = {0}, + sha3_512_string[SHA512_DIGEST_LENGTH*2+1] = {0}; + char string[] = "happy"; + + SHA256((unsigned char*)&string, strlen(string), (unsigned char*)&sha256_digest); + SHA512((unsigned char*)&string, strlen(string), (unsigned char*)&sha512_digest); + SHA3_hash(EVP_sha3_256(), (unsigned char*)&string, strlen(string), (unsigned char*)&sha3_256_digest, &digest_len); + SHA3_hash(EVP_sha3_512(), (unsigned char*)&string, strlen(string), (unsigned char*)&sha3_512_digest, &digest_len); + + for(int i = 0; i < SHA256_DIGEST_LENGTH; i++) { + snprintf(&sha256_string[i*2], sizeof(sha256_string)-i*2, "%02x", (unsigned int)sha256_digest[i]); + snprintf(&sha3_256_string[i*2], sizeof(sha3_256_string)-i*2, "%02x", (unsigned int)sha3_256_digest[i]); + } + + for(int i = 0; i < SHA512_DIGEST_LENGTH; i++) { + snprintf(&sha512_string[i*2], sizeof(sha512_string)-i*2, "%02x", (unsigned int)sha512_digest[i]); + snprintf(&sha3_512_string[i*2], sizeof(sha3_512_string)-i*2, "%02x", (unsigned int)sha3_512_digest[i]); + } + + printf("sha256 digest: %s\n", sha256_string); + printf("sha512 digest: %s\n", sha512_string); + printf("sha3 256 digest: %s\n", sha3_256_string); + printf("sha3 512 digest: %s\n", sha3_512_string); + +} diff --git a/openssl/3.x.x/test_package/digest_legacy.c b/openssl/3.x.x/test_package/digest_legacy.c new file mode 100644 index 0000000..9a23bf2 --- /dev/null +++ b/openssl/3.x.x/test_package/digest_legacy.c @@ -0,0 +1,141 @@ +#include +#if OPENSSL_WITH_MD4 +#include // MD4 needs legacy provider +#endif +#if OPENSSL_WITH_RIPEMD160 +#include // RIPEMD160 needs legacy provider +#endif +#include +#include +#include +#include +#include + +#include +#include +#include + +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define snprintf _snprintf +#endif + +int MDx_hash(const EVP_MD *type, const unsigned char *message, size_t message_len, unsigned char *digest, unsigned int *digest_len) { + EVP_MD_CTX *mdctx; + + if((mdctx = EVP_MD_CTX_create()) == NULL) + { + printf("EVP_MD_CTX_create error!\n"); + return 1; + } + + if(EVP_DigestInit_ex(mdctx, type, NULL) != 1) + { + printf("EVP_DigestInit_ex error!\n"); + return 1; + } + + if(EVP_DigestUpdate(mdctx, message, message_len) != 1) + { + printf("EVP_DigestUpdate error!\n"); + return 1; + } + + if(EVP_DigestFinal_ex(mdctx, digest, digest_len) != 1) + { + printf("EVP_DigestFinal_ex error!\n"); + return 1; + } + + EVP_MD_CTX_destroy(mdctx); + return 0; +} + +int digest_legacy() +{ + unsigned int digest_len; + unsigned char md5_digest[MD5_DIGEST_LENGTH]; + unsigned char md5_digest2[MD5_DIGEST_LENGTH]; + char md5_string[MD5_DIGEST_LENGTH*2+1] = {0}; + char md5_string2[MD5_DIGEST_LENGTH*2+1] = {0}; + char string[] = "happy"; + + MD5((unsigned char*)&string, strlen(string), (unsigned char*)&md5_digest); + if (MDx_hash(EVP_md5(), (unsigned char*)&string, strlen(string), (unsigned char*)&md5_digest2, &digest_len)) + return 1; + + for(int i = 0; i < MD5_DIGEST_LENGTH; i++) { + snprintf(&md5_string[i*2], sizeof(md5_string)-i*2, "%02x", (unsigned int)md5_digest[i]); + snprintf(&md5_string2[i*2], sizeof(md5_string2)-i*2, "%02x", (unsigned int)md5_digest2[i]); + } + + // MD4 needs the legacy provider + OSSL_LIB_CTX* context = OSSL_LIB_CTX_new(); + // From https://wiki.openssl.org/index.php/OpenSSL_3.0 + /* Load Multiple providers into the default (nullptr) library context */ + OSSL_PROVIDER* legacy = OSSL_PROVIDER_load(context, "legacy"); + if (0 == legacy) { + const char* error_string = ERR_error_string(ERR_get_error(), 0); + fprintf(stderr, "Loading legacy provider failed with this error:\n"); + fprintf(stderr, "\t%s\n", error_string); + return 1; + } + OSSL_LIB_CTX* oldcontex = OSSL_LIB_CTX_set0_default(context); + printf("Legacy provider successfully loaded.\n"); + +#if OPENSSL_WITH_MD4 + unsigned char md4_digest[MD4_DIGEST_LENGTH]; + unsigned char md4_digest2[MD4_DIGEST_LENGTH]; + char md4_string[MD4_DIGEST_LENGTH*2+1] = {0}; + char md4_string2[MD4_DIGEST_LENGTH*2+1] = {0}; + + MD4((unsigned char*)&string, strlen(string), (unsigned char*)&md4_digest); + if (MDx_hash(EVP_md4(), (unsigned char*)&string, strlen(string), (unsigned char*)&md4_digest2, &digest_len)) { + const char* error_string = ERR_error_string(ERR_get_error(), 0); + fprintf(stderr, "MD4 calculation failed with this error:\n"); + fprintf(stderr, "\t%s\n", error_string); + return 1; + } + + for(int i = 0; i < MD4_DIGEST_LENGTH; i++) { + snprintf(&md4_string[i*2], sizeof(md4_string)-i*2, "%02x", (unsigned int)md4_digest[i]); + snprintf(&md4_string2[i*2], sizeof(md4_string2)-i*2, "%02x", (unsigned int)md4_digest2[i]); + } +#endif + +#if OPENSSL_WITH_RIPEMD160 + unsigned char ripemd160_digest[RIPEMD160_DIGEST_LENGTH]; + unsigned char ripemd160_digest2[RIPEMD160_DIGEST_LENGTH]; + char ripemd160_string[RIPEMD160_DIGEST_LENGTH*2+1] = {0}; + char ripemd160_string2[RIPEMD160_DIGEST_LENGTH*2+1] = {0}; + + RIPEMD160((unsigned char*)&string, strlen(string), (unsigned char*)&ripemd160_digest); + if (MDx_hash(EVP_ripemd160(), (unsigned char*)&string, strlen(string), (unsigned char*)&ripemd160_digest2, &digest_len)) { + const char* error_string = ERR_error_string(ERR_get_error(), 0); + fprintf(stderr, "RIPEMD160 calculation failed with this error:\n"); + fprintf(stderr, "\t%s\n", error_string); + return 1; + } + + for(int i = 0; i < RIPEMD160_DIGEST_LENGTH; i++) { + snprintf(&ripemd160_string[i*2], sizeof(ripemd160_string)-i*2, "%02x", (unsigned int)ripemd160_digest[i]); + snprintf(&ripemd160_string2[i*2], sizeof(ripemd160_string2)-i*2, "%02x", (unsigned int)ripemd160_digest2[i]); + } +#endif + + OSSL_LIB_CTX_set0_default(oldcontex); + OSSL_PROVIDER_unload(legacy); + OSSL_LIB_CTX_free(context); + + printf("MD5 digest: %s\n", md5_string); + printf("MD5 digest (variant 2): %s\n", md5_string2); +#if OPENSSL_WITH_MD4 + printf("MD4 digest: %s\n", md4_string); + printf("MD4 digest (variant 2): %s\n", md4_string2); +#endif +#if OPENSSL_WITH_RIPEMD160 + printf("RIPEMD160 digest: %s\n", ripemd160_string); + printf("RIPEMD160 digest (variant 2): %s\n", ripemd160_string2); +#endif + + return 0; +} diff --git a/openssl/3.x.x/test_package/test_package.c b/openssl/3.x.x/test_package/test_package.c new file mode 100644 index 0000000..8f4148f --- /dev/null +++ b/openssl/3.x.x/test_package/test_package.c @@ -0,0 +1,24 @@ +#include +#include + +void digest(); +int digest_legacy(); + +int main() +{ + int legacy_result = 0; + OPENSSL_init_ssl(0, NULL); + printf("OpenSSL version: %s\n", OpenSSL_version(OPENSSL_VERSION)); + + digest(); + +#if defined(TEST_OPENSSL_LEGACY) + legacy_result = digest_legacy(); + if (legacy_result != 0) { + printf("Error testing the digest_legacy() function\n"); + return 1; + } +#endif + + return 0; +} diff --git a/openssl/3.x.x/test_v1_package/CMakeLists.txt b/openssl/3.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..d52c980 --- /dev/null +++ b/openssl/3.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +option(OPENSSL_WITH_ZLIB "OpenSSL with zlib support" ON) +option(OPENSSL_WITH_LEGACY "OpenSSL with support for the legacy provider" ON) +option(OPENSSL_WITH_MD4 "OpenSSL with MD4 support (needs legacy provider)" ON) +option(OPENSSL_WITH_RIPEMD160 "OpenSSL with RIPEMD16 support (needs legacy provider)" ON) + +set(OpenSSL_DEBUG 1) +find_package(OpenSSL REQUIRED) + +message("OPENSSL_FOUND: ${OPENSSL_FOUND}") +message("OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}") +message("OPENSSL_CRYPTO_LIBRARY: ${OPENSSL_CRYPTO_LIBRARY}") +message("OPENSSL_CRYPTO_LIBRARIES: ${OPENSSL_CRYPTO_LIBRARIES}") +message("OPENSSL_SSL_LIBRARY: ${OPENSSL_SSL_LIBRARY}") +message("OPENSSL_SSL_LIBRARIES: ${OPENSSL_SSL_LIBRARIES}") +message("OPENSSL_LIBRARIES: ${OPENSSL_LIBRARIES}") +message("OPENSSL_VERSION: ${OPENSSL_VERSION}") + +add_executable(digest digest.c) +if(OPENSSL_WITH_ZLIB) + target_compile_definitions(digest PRIVATE WITH_ZLIB) +endif() +target_link_libraries(digest OpenSSL::Crypto) + +if(OPENSSL_WITH_LEGACY) + add_executable(digest_legacy digest_legacy.c) + # do now show deperecation warnings + target_compile_definitions(digest_legacy PRIVATE OPENSSL_SUPPRESS_DEPRECATED) + if(OPENSSL_WITH_MD4) + target_compile_definitions(digest_legacy PRIVATE OPENSSL_WITH_MD4) + endif() + if(OPENSSL_WITH_RIPEMD160) + target_compile_definitions(digest_legacy PRIVATE OPENSSL_WITH_RIPEMD160) + endif() + if(OPENSSL_WITH_ZLIB) + target_compile_definitions(digest_legacy PRIVATE WITH_ZLIB) + endif() + target_link_libraries(digest_legacy OpenSSL::Crypto) +endif() diff --git a/openssl/3.x.x/test_v1_package/conanfile.py b/openssl/3.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000..ad50993 --- /dev/null +++ b/openssl/3.x.x/test_v1_package/conanfile.py @@ -0,0 +1,40 @@ +from conans import CMake, tools, ConanFile +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + generators = "cmake", "cmake_find_package", "pkg_config" + + def _with_legacy(self): + return (not self.options["openssl"].no_legacy and + ((not self.options["openssl"].no_md4) or + (not self.options["openssl"].no_rmd160))) + + def build(self): + cmake = CMake(self) + cmake.definitions["OPENSSL_WITH_ZLIB"] = not self.options["openssl"].no_zlib + cmake.definitions["OPENSSL_WITH_LEGACY"] = self._with_legacy() + cmake.definitions["OPENSSL_WITH_MD4"] = not self.options["openssl"].no_md4 + cmake.definitions["OPENSSL_WITH_RIPEMD160"] = not self.options["openssl"].no_rmd160 + if self.settings.os == "Android": + cmake.definitions["CONAN_LIBCXX"] = "" + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "digest") + self.run(bin_path, run_environment=True) + + if not self.options["openssl"].no_legacy: + bin_legacy_path = os.path.join("bin", "digest_legacy") + self.run(bin_legacy_path, run_environment=True) + + if not self.options["openssl"].no_stdio: + self.run("openssl version", run_environment=True) + assert os.path.exists(os.path.join(self.deps_cpp_info["openssl"].rootpath, "licenses", "LICENSE.txt")) + + for fn in ("libcrypto.pc", "libssl.pc", "openssl.pc",): + assert os.path.isfile(os.path.join(self.build_folder, fn)) diff --git a/openssl/3.x.x/test_v1_package/digest.c b/openssl/3.x.x/test_v1_package/digest.c new file mode 100644 index 0000000..0693be6 --- /dev/null +++ b/openssl/3.x.x/test_v1_package/digest.c @@ -0,0 +1,73 @@ +#include +#include +#include +#include +#if defined(WITH_ZLIB) +#include +#endif + +#include +#include +#include + +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define snprintf _snprintf +#endif + +void SHA3_hash(const EVP_MD *type, const unsigned char *message, size_t message_len, unsigned char *digest, unsigned int *digest_len) { + EVP_MD_CTX *mdctx; + + if((mdctx = EVP_MD_CTX_create()) == NULL) + printf("EVP_MD_CTX_create error!\n"); + + if(EVP_DigestInit_ex(mdctx, type, NULL) != 1) + printf("EVP_DigestInit_ex error!\n"); + + if(EVP_DigestUpdate(mdctx, message, message_len) != 1) + printf("EVP_DigestUpdate error!\n"); + + if(EVP_DigestFinal_ex(mdctx, digest, digest_len) != 1) + printf("EVP_DigestFinal_ex error!\n"); + + EVP_MD_CTX_destroy(mdctx); +} + +int main() +{ + unsigned int digest_len; + unsigned char sha256_digest[SHA256_DIGEST_LENGTH], + sha512_digest[SHA512_DIGEST_LENGTH], + sha3_256_digest[SHA256_DIGEST_LENGTH], + sha3_512_digest[SHA512_DIGEST_LENGTH]; + char sha256_string[SHA256_DIGEST_LENGTH*2+1] = {0}, + sha512_string[SHA512_DIGEST_LENGTH*2+1] = {0}, + sha3_256_string[SHA256_DIGEST_LENGTH*2+1] = {0}, + sha3_512_string[SHA512_DIGEST_LENGTH*2+1] = {0}; + char string[] = "happy"; + + SHA256((unsigned char*)&string, strlen(string), (unsigned char*)&sha256_digest); + SHA512((unsigned char*)&string, strlen(string), (unsigned char*)&sha512_digest); + SHA3_hash(EVP_sha3_256(), (unsigned char*)&string, strlen(string), (unsigned char*)&sha3_256_digest, &digest_len); + SHA3_hash(EVP_sha3_512(), (unsigned char*)&string, strlen(string), (unsigned char*)&sha3_512_digest, &digest_len); + + for(int i = 0; i < SHA256_DIGEST_LENGTH; i++) { + snprintf(&sha256_string[i*2], sizeof(sha256_string)-i*2, "%02x", (unsigned int)sha256_digest[i]); + snprintf(&sha3_256_string[i*2], sizeof(sha3_256_string)-i*2, "%02x", (unsigned int)sha3_256_digest[i]); + } + + for(int i = 0; i < SHA512_DIGEST_LENGTH; i++) { + snprintf(&sha512_string[i*2], sizeof(sha512_string)-i*2, "%02x", (unsigned int)sha512_digest[i]); + snprintf(&sha3_512_string[i*2], sizeof(sha3_512_string)-i*2, "%02x", (unsigned int)sha3_512_digest[i]); + } + + printf("sha256 digest: %s\n", sha256_string); + printf("sha512 digest: %s\n", sha512_string); + printf("sha3 256 digest: %s\n", sha3_256_string); + printf("sha3 512 digest: %s\n", sha3_512_string); + printf("OpenSSL version: %s\n", OpenSSL_version(OPENSSL_VERSION)); +#if defined(WITH_ZLIB) + printf("ZLIB version: %s\n", ZLIB_VERSION); +#endif + + return 0; +} diff --git a/openssl/3.x.x/test_v1_package/digest_legacy.c b/openssl/3.x.x/test_v1_package/digest_legacy.c new file mode 100644 index 0000000..740f0d2 --- /dev/null +++ b/openssl/3.x.x/test_v1_package/digest_legacy.c @@ -0,0 +1,148 @@ +#include +#if OPENSSL_WITH_MD4 +#include // MD4 needs legacy provider +#endif +#if OPENSSL_WITH_RIPEMD160 +#include // RIPEMD160 needs legacy provider +#endif +#include +#include +#include +#include +#include +#if defined(WITH_ZLIB) +#include +#endif + +#include +#include +#include + +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define snprintf _snprintf +#endif + +int MDx_hash(const EVP_MD *type, const unsigned char *message, size_t message_len, unsigned char *digest, unsigned int *digest_len) { + EVP_MD_CTX *mdctx; + + if((mdctx = EVP_MD_CTX_create()) == NULL) + { + printf("EVP_MD_CTX_create error!\n"); + return 1; + } + + if(EVP_DigestInit_ex(mdctx, type, NULL) != 1) + { + printf("EVP_DigestInit_ex error!\n"); + return 1; + } + + if(EVP_DigestUpdate(mdctx, message, message_len) != 1) + { + printf("EVP_DigestUpdate error!\n"); + return 1; + } + + if(EVP_DigestFinal_ex(mdctx, digest, digest_len) != 1) + { + printf("EVP_DigestFinal_ex error!\n"); + return 1; + } + + EVP_MD_CTX_destroy(mdctx); + return 0; +} + +int main() +{ + unsigned int digest_len; + unsigned char md5_digest[MD5_DIGEST_LENGTH]; + unsigned char md5_digest2[MD5_DIGEST_LENGTH]; + char md5_string[MD5_DIGEST_LENGTH*2+1] = {0}; + char md5_string2[MD5_DIGEST_LENGTH*2+1] = {0}; + char string[] = "happy"; + + MD5((unsigned char*)&string, strlen(string), (unsigned char*)&md5_digest); + if (MDx_hash(EVP_md5(), (unsigned char*)&string, strlen(string), (unsigned char*)&md5_digest2, &digest_len)) + return 1; + + for(int i = 0; i < MD5_DIGEST_LENGTH; i++) { + snprintf(&md5_string[i*2], sizeof(md5_string)-i*2, "%02x", (unsigned int)md5_digest[i]); + snprintf(&md5_string2[i*2], sizeof(md5_string2)-i*2, "%02x", (unsigned int)md5_digest2[i]); + } + + // MD4 needs the legacy provider + OSSL_LIB_CTX* context = OSSL_LIB_CTX_new(); + // From https://wiki.openssl.org/index.php/OpenSSL_3.0 + /* Load Multiple providers into the default (nullptr) library context */ + OSSL_PROVIDER* legacy = OSSL_PROVIDER_load(context, "legacy"); + if (0 == legacy) { + const char* error_string = ERR_error_string(ERR_get_error(), 0); + fprintf(stderr, "Loading legacy provider failed with this error:\n"); + fprintf(stderr, "\t%s\n", error_string); + return 1; + } + OSSL_LIB_CTX* oldcontex = OSSL_LIB_CTX_set0_default(context); + printf("Legacy provider successfully loaded.\n"); + +#if OPENSSL_WITH_MD4 + unsigned char md4_digest[MD4_DIGEST_LENGTH]; + unsigned char md4_digest2[MD4_DIGEST_LENGTH]; + char md4_string[MD4_DIGEST_LENGTH*2+1] = {0}; + char md4_string2[MD4_DIGEST_LENGTH*2+1] = {0}; + + MD4((unsigned char*)&string, strlen(string), (unsigned char*)&md4_digest); + if (MDx_hash(EVP_md4(), (unsigned char*)&string, strlen(string), (unsigned char*)&md4_digest2, &digest_len)) { + const char* error_string = ERR_error_string(ERR_get_error(), 0); + fprintf(stderr, "MD4 calculation failed with this error:\n"); + fprintf(stderr, "\t%s\n", error_string); + return 1; + } + + for(int i = 0; i < MD4_DIGEST_LENGTH; i++) { + snprintf(&md4_string[i*2], sizeof(md4_string)-i*2, "%02x", (unsigned int)md4_digest[i]); + snprintf(&md4_string2[i*2], sizeof(md4_string2)-i*2, "%02x", (unsigned int)md4_digest2[i]); + } +#endif + +#if OPENSSL_WITH_RIPEMD160 + unsigned char ripemd160_digest[RIPEMD160_DIGEST_LENGTH]; + unsigned char ripemd160_digest2[RIPEMD160_DIGEST_LENGTH]; + char ripemd160_string[RIPEMD160_DIGEST_LENGTH*2+1] = {0}; + char ripemd160_string2[RIPEMD160_DIGEST_LENGTH*2+1] = {0}; + + RIPEMD160((unsigned char*)&string, strlen(string), (unsigned char*)&ripemd160_digest); + if (MDx_hash(EVP_ripemd160(), (unsigned char*)&string, strlen(string), (unsigned char*)&ripemd160_digest2, &digest_len)) { + const char* error_string = ERR_error_string(ERR_get_error(), 0); + fprintf(stderr, "RIPEMD160 calculation failed with this error:\n"); + fprintf(stderr, "\t%s\n", error_string); + return 1; + } + + for(int i = 0; i < RIPEMD160_DIGEST_LENGTH; i++) { + snprintf(&ripemd160_string[i*2], sizeof(ripemd160_string)-i*2, "%02x", (unsigned int)ripemd160_digest[i]); + snprintf(&ripemd160_string2[i*2], sizeof(ripemd160_string2)-i*2, "%02x", (unsigned int)ripemd160_digest2[i]); + } +#endif + + OSSL_LIB_CTX_set0_default(oldcontex); + OSSL_PROVIDER_unload(legacy); + OSSL_LIB_CTX_free(context); + + printf("MD5 digest: %s\n", md5_string); + printf("MD5 digest (variant 2): %s\n", md5_string2); +#if OPENSSL_WITH_MD4 + printf("MD4 digest: %s\n", md4_string); + printf("MD4 digest (variant 2): %s\n", md4_string2); +#endif +#if OPENSSL_WITH_RIPEMD160 + printf("RIPEMD160 digest: %s\n", ripemd160_string); + printf("RIPEMD160 digest (variant 2): %s\n", ripemd160_string2); +#endif + printf("OpenSSL version: %s\n", OpenSSL_version(OPENSSL_VERSION)); +#if defined(WITH_ZLIB) + printf("ZLIB version: %s\n", ZLIB_VERSION); +#endif + + return 0; +} diff --git a/openssl/config.yml b/openssl/config.yml new file mode 100644 index 0000000..1ab48b6 --- /dev/null +++ b/openssl/config.yml @@ -0,0 +1,15 @@ +versions: + "3.2.2": + folder: "3.x.x" + "3.2.1": + folder: "3.x.x" + "3.1.6": + folder: "3.x.x" + "3.1.5": + folder: "3.x.x" + "3.0.14": + folder: "3.x.x" + "3.0.13": + folder: "3.x.x" + "1.1.1w": + folder: "1.x.x" diff --git a/opentelemetry-cpp/all/conandata.yml b/opentelemetry-cpp/all/conandata.yml index 5c4a591..ce31f61 100644 --- a/opentelemetry-cpp/all/conandata.yml +++ b/opentelemetry-cpp/all/conandata.yml @@ -1,73 +1,13 @@ sources: - '1.8.3': - url: 'https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.8.3.tar.gz' - sha256: 'b23d3c80d2e0012734ea343d2be69b2a7139ec5545453c503b13e629eb8fbe05' - '1.8.1.1': - url: 'https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.8.1.tar.gz' - sha256: '3d640201594b07f08dade9cd1017bd0b59674daca26223b560b9bb6bf56264c2' - '1.8.1': - url: 'https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.8.1.tar.gz' - sha256: '3d640201594b07f08dade9cd1017bd0b59674daca26223b560b9bb6bf56264c2' - '1.7.0': - url: 'https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.7.0.tar.gz' - sha256: '2ad0911cdc94fe84a93334773bef4789a38bd1f01e39560cabd4a5c267e823c3' - '1.6.1': - url: 'https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.6.1.tar.gz' - sha256: '1fc371be049b3220b8b9571c8b713f03e9a84f3c5684363f64ccc814638391a5' - '1.4.1': - url: 'https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.4.1.tar.gz' - sha256: '301b1ab74a664723560f46c29f228360aff1e2d63e930b963755ea077ae67524' - '1.4.0': - url: 'https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.4.0.tar.gz' - sha256: '110f4fb2e38dcc72a421647631cfbb9429afd3c77c6c98829cc1d11bd0c72563' - '1.3.0': - url: 'https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.3.0.tar.gz' - sha256: '6a4c43b9c9f753841ebc0fe2717325271f02e2a1d5ddd0b52735c35243629ab3' - '1.2.0': - url: 'https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.2.0.tar.gz' - sha256: '7a6420f9e4fa44b81a5b06e30e5e116da71decc9086e5cc4f126e1efc8a397c2' - '1.0.1': - url: 'https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.0.1.tar.gz' - sha256: '32f12ff15ec257e3462883f84bc291c2d5dc30055604c12ec4b46a36dfa3f189' - -patches: - '1.8.3': - - patch_file: 'patches/1.8.3-0001-fix-cmake.patch' - patch_description: 'fix lack of linking libraries due to conan not generating the variables that are expected' - patch_type: 'conan' - '1.8.1.1': - - patch_file: 'patches/1.8.1-0001-fix-cmake.patch' - patch_description: 'fix lack of linking libraries due to conan not generating the variables that are expected' - patch_type: 'conan' - '1.8.1': - - patch_file: 'patches/1.8.1-0001-fix-cmake.patch' - patch_description: 'fix lack of linking libraries due to conan not generating the variables that are expected' - patch_type: 'conan' - '1.7.0': - - patch_file: 'patches/1.7.0-0001-fix-cmake.patch' - patch_description: 'fix lack of linking libraries due to conan not generating the variables that are expected' - patch_type: 'conan' - '1.6.1': - - patch_file: 'patches/1.6.1-0001-fix-cmake.patch' - patch_description: 'fix lack of linking libraries due to conan not generating the variables that are expected' - patch_type: 'conan' - '1.4.1': - - patch_file: 'patches/1.4.0-0001-fix-cmake.patch' - patch_description: 'fix lack of linking libraries due to conan not generating the variables that are expected' - patch_type: 'conan' - '1.4.0': - - patch_file: 'patches/1.4.0-0001-fix-cmake.patch' - patch_description: 'fix lack of linking libraries due to conan not generating the variables that are expected' - patch_type: 'conan' - '1.3.0': - - patch_file: 'patches/1.3.0-0001-fix-cmake.patch' - patch_description: 'fix lack of linking libraries due to conan not generating the variables that are expected' - patch_type: 'conan' - '1.2.0': - - patch_file: 'patches/1.2.0-0001-fix-cmake.patch' - patch_description: 'fix lack of linking libraries due to conan not generating the variables that are expected' - patch_type: 'conan' - '1.0.1': - - patch_file: 'patches/1.0.1-0001-fix-cmake.patch' - patch_description: 'fix lack of linking libraries due to conan not generating the variables that are expected' - patch_type: 'conan' + "1.14.2": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.14.2.tar.gz" + sha256: "c7e7801c9f6228751cdb9dd4724d0f04777ed53f524c8828e73bf4c9f894e0bd" + "1.12.0": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.12.0.tar.gz" + sha256: "09c208a21fb1159d114a3ea15dc1bcc5dee28eb39907ba72a6012d2c7b7564a0" + "1.9.1": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.9.1.tar.gz" + sha256: "668de24f81c8d36d75092ad9dcb02a97cd41473adbe72485ece05e336db48249" + "1.8.3": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.8.3.tar.gz" + sha256: "b23d3c80d2e0012734ea343d2be69b2a7139ec5545453c503b13e629eb8fbe05" diff --git a/opentelemetry-cpp/all/conanfile.py b/opentelemetry-cpp/all/conanfile.py index c4ecd43..60940dc 100644 --- a/opentelemetry-cpp/all/conanfile.py +++ b/opentelemetry-cpp/all/conanfile.py @@ -1,24 +1,15 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration -from conan.tools.files import ( - apply_conandata_patches, - export_conandata_patches, - get, - copy, - rmdir, - replace_in_file, - save, -) +from conan.tools.files import get, copy, rmdir, replace_in_file, save from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.microsoft import check_min_vs +from conan.tools.env import VirtualRunEnv, VirtualBuildEnv import os import textwrap -required_conan_version = ">=1.53.0" - +required_conan_version = ">=1.56.0 <2 || >=2.0.6" class OpenTelemetryCppConan(ConanFile): name = "opentelemetry-cpp" @@ -27,6 +18,7 @@ class OpenTelemetryCppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/open-telemetry/opentelemetry-cpp" topics = ("opentelemetry", "telemetry", "tracing", "metrics", "logs") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -35,7 +27,7 @@ class OpenTelemetryCppConan(ConanFile): "with_stl": [True, False], "with_gsl": [True, False], "with_abseil": [True, False], - "with_otlp": [True, False], + "with_otlp": ["deprecated", True, False], "with_otlp_grpc": [True, False], "with_otlp_http": [True, False], "with_zipkin": [True, False], @@ -52,11 +44,12 @@ class OpenTelemetryCppConan(ConanFile): default_options = { "fPIC": True, "shared": False, + "with_no_deprecated_code": False, - "with_stl": True, + "with_stl": False, "with_gsl": False, "with_abseil": True, - "with_otlp": True, + "with_otlp": "deprecated", "with_otlp_grpc": True, "with_otlp_http": True, "with_zipkin": True, @@ -73,23 +66,41 @@ class OpenTelemetryCppConan(ConanFile): short_paths = True @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): + if self.options.with_abseil and Version(self.dependencies["abseil"].ref.version) >= "20230125": + return 14 return 11 - def export_sources(self): - export_conandata_patches(self) + @property + def _compilers_minimum_version(self): + if self._min_cppstd == 14: + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "16", + "msvc": "192", + } + else: + return { + "Visual Studio": "16", + "msvc": "192", + } def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") + if Version(self.version) >= "1.10": + del self.options.with_jaeger + if Version(self.version) >= "1.11": + del self.options.with_logs_preview def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - - if not self.options.with_otlp: - self.options.rm_safe("with_otlp_grpc") - self.options.rm_safe("with_otlp_http") + if self.options.with_otlp != "deprecated": + self.output.warning(f"{self.ref}:with_otlp option is deprecated, do not use anymore. " + "Please, consider with_otlp_grpc or with_otlp_http instead.") def layout(self): cmake_layout(self, src_folder="src") @@ -99,80 +110,57 @@ def requirements(self): self.requires("ms-gsl/4.0.0") if self.options.with_abseil: - self.requires("abseil/20220623.0") - - if self.options.with_otlp: - self.requires("protobuf/3.21.4") - if Version(self.version) <= "1.4.1": - self.requires("opentelemetry-proto/0.11.0") - else: - self.requires("opentelemetry-proto/0.19.0") - - if self.options.get_safe("with_otlp_grpc"): - self.requires("grpc/1.50.1") - - if ( - self.options.with_zipkin - or self.options.with_elasticsearch - or self.options.get_safe("with_otlp_http") - or self.options.with_etw + self.requires("abseil/20230125.3", transitive_headers=True) + + if self.options.with_otlp_grpc or self.options.with_otlp_http: + self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True) + + if self.options.with_otlp_grpc: + self.requires("grpc/1.54.3", transitive_headers=True, transitive_libs=True) + + if (self.options.with_zipkin or + self.options.with_elasticsearch or + self.options.with_otlp_http or + self.options.with_etw ): - self.requires("nlohmann_json/3.11.2") - self.requires("openssl/1.1.1t") + self.requires("nlohmann_json/3.11.3") + self.requires("openssl/[>=1.1 <4]") - if ( - self.options.with_zipkin - or self.options.with_elasticsearch - or self.options.get_safe("with_otlp_http") + if (self.options.with_zipkin or + self.options.with_elasticsearch or + self.options.with_otlp_http ): - self.requires("libcurl/7.87.0") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.with_prometheus: self.requires("prometheus-cpp/1.1.0") - if self.options.with_jaeger: + if self.options.get_safe("with_jaeger"): self.requires("thrift/0.17.0") - - if Version(self.version) >= "1.3.0": - self.requires("boost/1.81.0") + self.requires("boost/1.84.0") @property def _required_boost_components(self): - return ( - ["locale"] - if self.options.with_jaeger and Version(self.version) >= "1.3.0" - else [] - ) + return ["locale"] if self.options.get_safe("with_jaeger") else [] def validate(self): - if self.settings.get_safe("compiler.cppstd"): - check_min_cppstd(self, self._minimum_cpp_standard) - check_min_vs(self, "192") - - if self.settings.os != "Linux" and self.options.shared: + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( - f"{self.ref} supports building shared libraries only on Linux" + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if self.options.get_safe("with_otlp_grpc") and not self.options.with_otlp: - raise ConanInvalidConfiguration( - "Option 'with_otlp_grpc' requires 'with_otlp'" - ) - - if self.options.get_safe("with_otlp_http") and not self.options.with_otlp: - raise ConanInvalidConfiguration( - "Option 'with_otlp_http' requires 'with_otlp'" - ) + if self.settings.os != "Linux" and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} supports building shared libraries only on Linux") - if not self.dependencies["grpc"].options.cpp_plugin: - raise ConanInvalidConfiguration( - f"{self.ref} requires grpc with cpp_plugin=True" - ) + if self.options.with_otlp_grpc: + if not self.dependencies["grpc"].options.cpp_plugin: + raise ConanInvalidConfiguration(f"{self.ref} requires grpc with cpp_plugin=True") - boost_required_comp = any( - self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) - for boost_comp in self._required_boost_components - ) + boost_required_comp = any(self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) + for boost_comp in self._required_boost_components) if boost_required_comp: raise ConanInvalidConfiguration( @@ -180,101 +168,87 @@ def validate(self): f"{', '.join(self._required_boost_components)}" ) + if conan_version.major == 1 and self.settings.compiler == "apple-clang" and Version(self.version) >= "1.12.0": + # Only fails on apple-clang in this configuration for some reason: + # https://github.com/conan-io/conan-center-index/pull/21332#issuecomment-1830766894 + raise ConanInvalidConfiguration("opentelemetry-cpp >= 1.12.0 does not support Apple Clang on Conan v1") + def build_requirements(self): - self.tool_requires("protobuf/3.21.4") - self.tool_requires("grpc/1.50.1") + if self.options.with_otlp_grpc or self.options.with_otlp_http: + self.tool_requires("opentelemetry-proto/1.2.0") + self.tool_requires("protobuf/") + + if self.options.with_otlp_grpc: + self.tool_requires("grpc/") def _create_cmake_module_variables(self, module_file): - content = textwrap.dedent( - """\ + content = textwrap.dedent("""\ set(OPENTELEMETRY_CPP_INCLUDE_DIRS ${opentelemetry-cpp_INCLUDE_DIRS} ${opentelemetry-cpp_INCLUDE_DIRS_RELEASE} ${opentelemetry-cpp_INCLUDE_DIRS_RELWITHDEBINFO} ${opentelemetry-cpp_INCLUDE_DIRS_MINSIZEREL} ${opentelemetry-cpp_INCLUDE_DIRS_DEBUG}) set(OPENTELEMETRY_CPP_LIBRARIES opentelemetry-cpp::opentelemetry-cpp) - """ - ) + """) save(self, module_file, content) + def package_id(self): + # deprecated + del self.info.options.with_otlp + def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True, - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): - tc = CMakeToolchain(self) - - tc.variables["BUILD_TESTING"] = False - tc.variables["BUILD_BENCHMARK"] = False - tc.variables["WITH_EXAMPLES"] = False - - tc.variables["WITH_NO_DEPRECATED_CODE"] = self.options.with_no_deprecated_code - tc.variables["WITH_STL"] = self.options.with_stl - tc.variables["WITH_GSL"] = self.options.with_gsl - tc.variables["WITH_ABSEIL"] = self.options.with_abseil - tc.variables["WITH_OTLP"] = self.options.with_otlp - tc.variables["WITH_OTLP_GRPC"] = self.options.get_safe("with_otlp_grpc") - tc.variables["WITH_OTLP_HTTP"] = self.options.get_safe("with_otlp_http") - tc.variables["WITH_ZIPKIN"] = self.options.with_zipkin - tc.variables["WITH_PROMETHEUS"] = self.options.with_prometheus - tc.variables["WITH_ELASTICSEARCH"] = self.options.with_elasticsearch - tc.variables["WITH_ZPAGES"] = self.options.with_zpages - tc.variables["WITH_JAEGER"] = self.options.with_jaeger - tc.variables["WITH_NO_GETENV"] = self.options.with_no_getenv - tc.variables["WITH_ETW"] = self.options.with_etw - tc.variables["WITH_LOGS_PREVIEW"] = self.options.with_logs_preview - tc.variables[ - "WITH_ASYNC_EXPORT_PREVIEW" - ] = self.options.with_async_export_preview - tc.variables[ - "WITH_METRICS_EXEMPLAR_PREVIEW" - ] = self.options.with_metrics_exemplar_preview + VirtualBuildEnv(self).generate(scope="build") + VirtualRunEnv(self).generate(scope="build") + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["BUILD_BENCHMARK"] = False + tc.cache_variables["WITH_EXAMPLES"] = False + tc.cache_variables["WITH_NO_DEPRECATED_CODE"] = self.options.with_no_deprecated_code + tc.cache_variables["WITH_STL"] = self.options.with_stl + tc.cache_variables["WITH_GSL"] = self.options.with_gsl + tc.cache_variables["WITH_ABSEIL"] = self.options.with_abseil + if Version(self.version) < "1.10": + tc.cache_variables["WITH_OTLP"] = self.options.with_otlp_grpc or self.options.with_otlp_http + tc.cache_variables["WITH_OTLP_GRPC"] = self.options.with_otlp_grpc + tc.cache_variables["WITH_OTLP_HTTP"] = self.options.with_otlp_http + tc.cache_variables["WITH_ZIPKIN"] = self.options.with_zipkin + tc.cache_variables["WITH_PROMETHEUS"] = self.options.with_prometheus + tc.cache_variables["WITH_ELASTICSEARCH"] = self.options.with_elasticsearch + tc.cache_variables["WITH_ZPAGES"] = self.options.with_zpages + tc.cache_variables["WITH_JAEGER"] = self.options.get_safe("with_jaeger", False) + tc.cache_variables["WITH_NO_GETENV"] = self.options.with_no_getenv + tc.cache_variables["WITH_ETW"] = self.options.with_etw + if Version(self.version) < "1.11": + tc.cache_variables["WITH_LOGS_PREVIEW"] = self.options.with_logs_preview + tc.cache_variables["WITH_ASYNC_EXPORT_PREVIEW"] = self.options.with_async_export_preview + tc.cache_variables["WITH_METRICS_EXEMPLAR_PREVIEW"] = self.options.with_metrics_exemplar_preview + tc.cache_variables["OPENTELEMETRY_INSTALL"] = True + if not self.settings.compiler.cppstd: + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd tc.generate() - tc = CMakeDeps(self) - tc.generate() + deps = CMakeDeps(self) - def _patch_sources(self): - protos_path = self.deps_user_info["opentelemetry-proto"].proto_root.replace( - "\\", "/" - ) - protos_cmake_path = os.path.join( - self.source_folder, "cmake", "opentelemetry-proto.cmake" - ) - if Version(self.version) >= "1.1.0": - replace_in_file( - self, - protos_cmake_path, - "if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto/.git)", - "if(1)", - ) - if Version(self.version) <= "1.8.1": - replace_in_file( - self, - protos_cmake_path, - 'set(PROTO_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto")', - f'set(PROTO_PATH "{protos_path}")', - ) - else: - replace_in_file( - self, - protos_cmake_path, - '"${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto")', - f'"{protos_path}")', - ) - rmdir( - self, - os.path.join( - self.source_folder, "api", "include", "opentelemetry", "nostd", "absl" - ), - ) + deps.generate() - apply_conandata_patches(self) + def _patch_sources(self): + if self.options.with_otlp_http or self.options.with_otlp_grpc: + protos_path = self.dependencies.build["opentelemetry-proto"].conf_info.get("user.opentelemetry-proto:proto_root").replace("\\", "/") + protos_cmake_path = os.path.join(self.source_folder, "cmake", "opentelemetry-proto.cmake") + replace_in_file(self, protos_cmake_path, + "if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto/.git)", + "if(1)") + replace_in_file(self, protos_cmake_path, + '"${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto")', + f'"{protos_path}")') + if self.options.with_otlp_grpc and Version(self.version) < "1.9.1": + save(self, protos_cmake_path, "\ntarget_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++)", append=True) + + rmdir(self, os.path.join(self.source_folder, "api", "include", "opentelemetry", "nostd", "absl")) def build(self): self._patch_sources() @@ -283,15 +257,11 @@ def build(self): cmake.build() def package(self): - copy( - self, - pattern="LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) self._create_cmake_module_variables( os.path.join(self.package_folder, self._otel_cmake_variables_path) ) @@ -302,9 +272,8 @@ def _module_subfolder(self): @property def _otel_cmake_variables_path(self): - return os.path.join( - self._module_subfolder, f"conan-official-{self.name}-variables.cmake" - ) + return os.path.join(self._module_subfolder, + f"conan-official-{self.name}-variables.cmake") @property def _otel_build_modules(self): @@ -312,16 +281,11 @@ def _otel_build_modules(self): @property def _http_client_name(self): - return ( - "http_client_curl" - if Version(self.version) < "1.3.0" - else "opentelemetry_http_client_curl" - ) + return "opentelemetry_http_client_curl" @property def _otel_libraries(self): libraries = [ - self._http_client_name, "opentelemetry_common", "opentelemetry_exporter_in_memory", "opentelemetry_exporter_ostream_span", @@ -330,92 +294,60 @@ def _otel_libraries(self): "opentelemetry_version", ] - if self.options.with_otlp: - libraries.extend( - [ - "opentelemetry_proto", - "opentelemetry_otlp_recordable", - ] - ) - - if self.options.get_safe("with_otlp_grpc"): + if self.options.with_otlp_http or self.options.with_elasticsearch or self.options.get_safe("with_jaeger") or self.options.with_zipkin: + # https://github.com/open-telemetry/opentelemetry-cpp/blob/v1.12.0/CMakeLists.txt#L452-L460 + libraries.append(self._http_client_name) + if self.options.with_otlp_grpc or self.options.with_otlp_http: + libraries.extend([ + "opentelemetry_proto", + "opentelemetry_otlp_recordable", + ]) + if self.options.with_otlp_grpc: libraries.append("opentelemetry_exporter_otlp_grpc") - - if Version(self.version) >= "1.5.0": - libraries.append("opentelemetry_exporter_otlp_grpc_metrics") - - if Version(self.version) >= "1.7.0": - libraries.append("opentelemetry_exporter_otlp_grpc_client") - - if self.options.with_logs_preview: + libraries.append("opentelemetry_exporter_otlp_grpc_metrics") + libraries.append("opentelemetry_exporter_otlp_grpc_client") + if Version(self.version) >= "1.11" or self.options.with_logs_preview: libraries.append("opentelemetry_exporter_otlp_grpc_log") - - if self.options.get_safe("with_otlp_http"): + if self.options.with_otlp_http: libraries.append("opentelemetry_exporter_otlp_http") - - if Version(self.version) >= "1.1.0": - libraries.append("opentelemetry_exporter_otlp_http_client") - - if Version(self.version) >= "1.5.0": - libraries.append("opentelemetry_exporter_otlp_http_metric") - - if self.options.with_logs_preview: + libraries.append("opentelemetry_exporter_otlp_http_client") + libraries.append("opentelemetry_exporter_otlp_http_metric") + if Version(self.version) >= "1.11" or self.options.with_logs_preview: libraries.append("opentelemetry_exporter_otlp_http_log") - if self.options.with_prometheus: libraries.append("opentelemetry_exporter_prometheus") - - if self.options.with_elasticsearch and self.options.with_logs_preview: + if self.options.with_elasticsearch and (Version(self.version) >= "1.11" or self.options.with_logs_preview): libraries.append("opentelemetry_exporter_elasticsearch_logs") - if self.options.with_zipkin: libraries.append("opentelemetry_exporter_zipkin_trace") - - if self.options.with_jaeger: + if self.options.get_safe("with_jaeger"): libraries.append("opentelemetry_exporter_jaeger_trace") - - if Version(self.version) >= "1.2.0": - libraries.append("opentelemetry_metrics") - - if Version(self.version) >= "1.4.0": - libraries.append("opentelemetry_exporter_ostream_metrics") - - if self.options.with_logs_preview: - libraries.extend( - [ - "opentelemetry_logs", - "opentelemetry_exporter_ostream_logs", - ] - ) - + libraries.append("opentelemetry_metrics") + libraries.append("opentelemetry_exporter_ostream_metrics") + if Version(self.version) >= "1.11" or self.options.with_logs_preview: + libraries.extend([ + "opentelemetry_logs", + "opentelemetry_exporter_ostream_logs", + ]) if self.settings.os == "Windows" and self.options.with_etw: libraries.append("opentelemetry_exporter_etw") - return libraries def package_info(self): for lib in self._otel_libraries: self.cpp_info.components[lib].libs = [lib] self.cpp_info.components[lib].builddirs.append(self._module_subfolder) - self.cpp_info.components[lib].build_modules[ - "cmake_find_package" - ] = self._otel_build_modules - self.cpp_info.components[lib].build_modules[ - "cmake_find_package_multi" - ] = self._otel_build_modules - - self.cpp_info.components["opentelemetry_resources"].requires.extend( - [ - "opentelemetry_common", - ] - ) + self.cpp_info.components[lib].build_modules["cmake_find_package"] = self._otel_build_modules + self.cpp_info.components[lib].build_modules["cmake_find_package_multi"] = self._otel_build_modules - self.cpp_info.components["opentelemetry_trace"].requires.extend( - [ - "opentelemetry_common", - "opentelemetry_resources", - ] - ) + self.cpp_info.components["opentelemetry_resources"].requires.extend([ + "opentelemetry_common", + ]) + + self.cpp_info.components["opentelemetry_trace"].requires.extend([ + "opentelemetry_common", + "opentelemetry_resources", + ]) self.cpp_info.components["opentelemetry_exporter_ostream_span"].requires.append( "opentelemetry_trace", @@ -423,198 +355,117 @@ def package_info(self): self.cpp_info.components["opentelemetry_exporter_in_memory"].libs = [] - if self.options.with_logs_preview: - self.cpp_info.components["opentelemetry_logs"].requires.extend( - [ - "opentelemetry_resources", - "opentelemetry_common", - ] - ) + if Version(self.version) >= "1.11" or self.options.with_logs_preview: + self.cpp_info.components["opentelemetry_logs"].requires.extend([ + "opentelemetry_resources", + "opentelemetry_common", + ]) - self.cpp_info.components[ - "opentelemetry_exporter_ostream_logs" - ].requires.append( + self.cpp_info.components["opentelemetry_exporter_ostream_logs"].requires.append( "opentelemetry_logs", ) if self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.components["opentelemetry_common"].system_libs.extend( - ["pthread"] - ) + self.cpp_info.components["opentelemetry_common"].system_libs.extend(["pthread"]) if self.options.with_stl: - self.cpp_info.components["opentelemetry_common"].defines.append( - "HAVE_CPP_STDLIB" - ) + self.cpp_info.components["opentelemetry_common"].defines.append("HAVE_CPP_STDLIB") if self.options.with_gsl: self.cpp_info.components["opentelemetry_common"].defines.append("HAVE_GSL") - self.cpp_info.components["opentelemetry_common"].requires.append( - "ms-gsl::_ms-gsl" - ) + self.cpp_info.components["opentelemetry_common"].requires.append("ms-gsl::_ms-gsl") if self.options.with_abseil: - self.cpp_info.components["opentelemetry_common"].defines.append( - "HAVE_ABSEIL" - ) - self.cpp_info.components["opentelemetry_common"].requires.append( - "abseil::abseil" - ) + self.cpp_info.components["opentelemetry_common"].defines.append("HAVE_ABSEIL") + self.cpp_info.components["opentelemetry_common"].requires.append("abseil::abseil") - if self.options.with_otlp: - self.cpp_info.components["opentelemetry_proto"].requires.extend( - [ - "opentelemetry-proto::opentelemetry-proto", - "protobuf::protobuf", - ] - ) + if self.options.with_otlp_http or self.options.with_otlp_grpc: + self.cpp_info.components["opentelemetry_proto"].requires.append("protobuf::protobuf") + self.cpp_info.components["opentelemetry_otlp_recordable"].requires.extend([ + "opentelemetry_proto", + "opentelemetry_resources", + "opentelemetry_trace", + ]) - self.cpp_info.components["opentelemetry_otlp_recordable"].requires.extend( - [ - "opentelemetry_proto", - "opentelemetry_resources", - "opentelemetry_trace", - ] - ) + if Version(self.version) >= "1.11": + self.cpp_info.components["opentelemetry_otlp_recordable"].requires.extend([ + "opentelemetry_logs", + ]) + + if self.options.with_otlp_grpc: + self.cpp_info.components["opentelemetry_exporter_otlp_grpc_client"].requires.extend([ + "grpc::grpc++", + "opentelemetry_proto", + ]) + + self.cpp_info.components["opentelemetry_exporter_otlp_grpc"].requires.extend([ + "opentelemetry_otlp_recordable", + "opentelemetry_exporter_otlp_grpc_client" + ]) + + self.cpp_info.components["opentelemetry_exporter_otlp_grpc_metrics"].requires.extend([ + "opentelemetry_otlp_recordable", + "opentelemetry_exporter_otlp_grpc_client" + ]) + + if Version(self.version) >= "1.11" or self.options.with_logs_preview: + self.cpp_info.components["opentelemetry_exporter_otlp_grpc_log"].requires.extend([ + "opentelemetry_otlp_recordable", + "opentelemetry_exporter_otlp_grpc_client", + ]) - if self.options.get_safe("with_otlp_grpc"): - if Version(self.version) >= "1.5.0" and Version(self.version) < "1.7.0": - self.cpp_info.components[ - "opentelemetry_exporter_otlp_grpc_metrics" - ].requires.extend( - [ - "grpc::grpc++", - "opentelemetry_otlp_recordable", - ] - ) - - if Version(self.version) <= "1.7.0": - self.cpp_info.components[ - "opentelemetry_exporter_otlp_grpc" - ].requires.extend( - [ - "grpc::grpc++", - "opentelemetry_otlp_recordable", - ] - ) - - if Version(self.version) >= "1.7.0": - self.cpp_info.components[ - "opentelemetry_exporter_otlp_grpc_client" - ].requires.extend( - [ - "grpc::grpc++", - "opentelemetry_proto", - ] - ) - - self.cpp_info.components[ - "opentelemetry_exporter_otlp_grpc" - ].requires.extend( - [ - "opentelemetry_otlp_recordable", - "opentelemetry_exporter_otlp_grpc_client", - ] - ) - - self.cpp_info.components[ - "opentelemetry_exporter_otlp_grpc_metrics" - ].requires.extend( - [ - "opentelemetry_otlp_recordable", - "opentelemetry_exporter_otlp_grpc_client", - ] - ) - - if self.options.with_logs_preview: - self.cpp_info.components[ - "opentelemetry_exporter_otlp_grpc_log" - ].requires.extend( - [ - "opentelemetry_otlp_recordable", - "opentelemetry_exporter_otlp_grpc_client", - ] - ) - - if ( - self.options.get_safe("with_otlp_http") - or self.options.with_zipkin - or self.options.with_elasticsearch + if (self.options.with_otlp_http or + self.options.with_zipkin or + self.options.with_elasticsearch ): - self.cpp_info.components[self._http_client_name].requires.append( - "libcurl::libcurl" - ) + self.cpp_info.components[self._http_client_name].requires.append("libcurl::libcurl") + self.cpp_info.components[self._http_client_name].requires.append("openssl::openssl") - if self.options.get_safe("with_otlp_http"): - self.cpp_info.components[ + if self.options.with_otlp_http: + self.cpp_info.components["opentelemetry_exporter_otlp_http_client"].requires.extend([ + self._http_client_name, + "nlohmann_json::nlohmann_json", + "opentelemetry_proto", + ]) + + self.cpp_info.components["opentelemetry_exporter_otlp_http"].requires.extend([ + "opentelemetry_otlp_recordable", + "opentelemetry_exporter_otlp_http_client", + ]) + + self.cpp_info.components["opentelemetry_exporter_otlp_http_metric"].requires.extend([ + "opentelemetry_otlp_recordable", "opentelemetry_exporter_otlp_http_client" - ].requires.extend( - [ - self._http_client_name, - "nlohmann_json::nlohmann_json", - "opentelemetry_proto", - ] - ) + ]) - self.cpp_info.components[ - "opentelemetry_exporter_otlp_http" - ].requires.extend( - [ + if Version(self.version) >= "1.11" or self.options.with_logs_preview: + self.cpp_info.components["opentelemetry_exporter_otlp_http_log"].requires.extend([ "opentelemetry_otlp_recordable", "opentelemetry_exporter_otlp_http_client", - ] - ) - - if Version(self.version) >= "1.5.0": - self.cpp_info.components[ - "opentelemetry_exporter_otlp_http_metric" - ].requires.extend( - [ - "opentelemetry_otlp_recordable", - "opentelemetry_exporter_otlp_http_client", - ] - ) - - if self.options.with_logs_preview: - self.cpp_info.components[ - "opentelemetry_exporter_otlp_http_log" - ].requires.extend( - [ - "opentelemetry_otlp_recordable", - "opentelemetry_exporter_otlp_http_client", - ] - ) + ]) if self.options.with_zipkin: - self.cpp_info.components[ - "opentelemetry_exporter_zipkin_trace" - ].requires.extend( - [ - self._http_client_name, - "nlohmann_json::nlohmann_json", - "opentelemetry_trace", - ] - ) + self.cpp_info.components["opentelemetry_exporter_zipkin_trace"].requires.extend([ + self._http_client_name, + "nlohmann_json::nlohmann_json", + "opentelemetry_trace", + ]) - if self.options.with_jaeger: - self.cpp_info.components[ - "opentelemetry_exporter_jaeger_trace" - ].requires.extend( - [ - self._http_client_name, - "openssl::openssl", - "opentelemetry_resources", - "thrift::thrift", - ] - ) + if self.options.get_safe("with_jaeger"): + self.cpp_info.components["opentelemetry_exporter_jaeger_trace"].requires.extend([ + self._http_client_name, + "openssl::openssl", + "opentelemetry_resources", + "thrift::thrift", + ]) - if Version(self.version) >= "1.3.0": - self.cpp_info.components[ - "opentelemetry_exporter_jaeger_trace" - ].requires.append("boost::locale") + self.cpp_info.components["opentelemetry_exporter_jaeger_trace"].requires.append( + "boost::locale" + ) if self.settings.os == "Windows" and self.options.with_etw: self.cpp_info.components["opentelemetry_exporter_etw"].libs = [] self.cpp_info.components["opentelemetry_exporter_etw"].requires.append( "nlohmann_json::nlohmann_json", ) + diff --git a/opentelemetry-cpp/all/patches/1.0.1-0001-fix-cmake.patch b/opentelemetry-cpp/all/patches/1.0.1-0001-fix-cmake.patch deleted file mode 100644 index ecdbb0c..0000000 --- a/opentelemetry-cpp/all/patches/1.0.1-0001-fix-cmake.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 9fb6f49..1f1547e 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -162,6 +162,10 @@ else() # cmake 3.8 or lower - target_link_libraries(opentelemetry_proto INTERFACE ${Protobuf_LIBRARIES}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(BUILD_SHARED_LIBS) - set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON) - endif() -diff --git a/exporters/zipkin/CMakeLists.txt b/exporters/zipkin/CMakeLists.txt -index 2316860..8995b31 100644 ---- a/exporters/zipkin/CMakeLists.txt -+++ b/exporters/zipkin/CMakeLists.txt -@@ -21,7 +21,7 @@ add_library(opentelemetry_exporter_zipkin_trace src/zipkin_exporter.cc - src/recordable.cc) - - target_link_libraries(opentelemetry_exporter_zipkin_trace -- PUBLIC opentelemetry_trace http_client_curl) -+ PUBLIC opentelemetry_trace http_client_curl nlohmann_json::nlohmann_json) - - install( - TARGETS opentelemetry_exporter_zipkin_trace diff --git a/opentelemetry-cpp/all/patches/1.2.0-0001-fix-cmake.patch b/opentelemetry-cpp/all/patches/1.2.0-0001-fix-cmake.patch deleted file mode 100644 index 275e2c9..0000000 --- a/opentelemetry-cpp/all/patches/1.2.0-0001-fix-cmake.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 8d8f868..2a78f98 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -214,6 +214,10 @@ else() - ${METRICS_SERVICE_PB_CPP_FILE}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(needs_proto_download) - add_dependencies(opentelemetry_proto opentelemetry-proto) - endif() diff --git a/opentelemetry-cpp/all/patches/1.3.0-0001-fix-cmake.patch b/opentelemetry-cpp/all/patches/1.3.0-0001-fix-cmake.patch deleted file mode 100644 index ce868fb..0000000 --- a/opentelemetry-cpp/all/patches/1.3.0-0001-fix-cmake.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 09c21fd..a8d7d16 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -203,7 +203,6 @@ if(WITH_JAEGER) - find_package(Thrift QUIET) - if(Thrift_FOUND) - find_package(Boost REQUIRED) -- include_directories(${Boost_INCLUDE_DIR}) - else() - # Install Thrift and propagate via vcpkg toolchain file - if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 8d8f868..2a78f98 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -214,6 +214,10 @@ else() - ${METRICS_SERVICE_PB_CPP_FILE}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(needs_proto_download) - add_dependencies(opentelemetry_proto opentelemetry-proto) - endif() diff --git a/opentelemetry-cpp/all/patches/1.4.0-0001-fix-cmake.patch b/opentelemetry-cpp/all/patches/1.4.0-0001-fix-cmake.patch deleted file mode 100644 index 1fcf5a0..0000000 --- a/opentelemetry-cpp/all/patches/1.4.0-0001-fix-cmake.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6d2b274..4611a6b 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -208,7 +208,6 @@ if(WITH_JAEGER) - find_package(Thrift QUIET) - if(Thrift_FOUND) - find_package(Boost REQUIRED) -- include_directories(${Boost_INCLUDE_DIR}) - else() - # Install Thrift and propagate via vcpkg toolchain file - if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 37d45da..89395c0 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -215,6 +215,10 @@ else() - ${METRICS_SERVICE_PB_CPP_FILE}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(needs_proto_download) - add_dependencies(opentelemetry_proto opentelemetry-proto) - endif() diff --git a/opentelemetry-cpp/all/patches/1.6.1-0001-fix-cmake.patch b/opentelemetry-cpp/all/patches/1.6.1-0001-fix-cmake.patch deleted file mode 100644 index b339185..0000000 --- a/opentelemetry-cpp/all/patches/1.6.1-0001-fix-cmake.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a1b6934..d4f5251 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -209,7 +209,6 @@ if(WITH_JAEGER) - find_package(Thrift QUIET) - if(Thrift_FOUND) - find_package(Boost REQUIRED) -- include_directories(${Boost_INCLUDE_DIR}) - else() - # Install Thrift and propagate via vcpkg toolchain file - if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 629ea81..3b09b92 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -242,6 +242,10 @@ else() # cmake 3.8 or lower - target_link_libraries(opentelemetry_proto INTERFACE ${Protobuf_LIBRARIES}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(BUILD_SHARED_LIBS) - set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON) - endif() diff --git a/opentelemetry-cpp/all/patches/1.7.0-0001-fix-cmake.patch b/opentelemetry-cpp/all/patches/1.7.0-0001-fix-cmake.patch deleted file mode 100644 index e5e3898..0000000 --- a/opentelemetry-cpp/all/patches/1.7.0-0001-fix-cmake.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e7597fc8..d880a90d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -217,7 +217,6 @@ if(WITH_JAEGER) - find_package(Thrift QUIET) - if(Thrift_FOUND) - find_package(Boost REQUIRED) -- include_directories(${Boost_INCLUDE_DIR}) - else() - # Install Thrift and propagate via vcpkg toolchain file - if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 629ea815..3b09b92e 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -242,6 +242,10 @@ else() # cmake 3.8 or lower - target_link_libraries(opentelemetry_proto INTERFACE ${Protobuf_LIBRARIES}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(BUILD_SHARED_LIBS) - set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON) - endif() diff --git a/opentelemetry-cpp/all/patches/1.8.1-0001-fix-cmake.patch b/opentelemetry-cpp/all/patches/1.8.1-0001-fix-cmake.patch deleted file mode 100644 index 5c4fcae..0000000 --- a/opentelemetry-cpp/all/patches/1.8.1-0001-fix-cmake.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9b9710d..6eb42bb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -222,7 +222,6 @@ if(WITH_JAEGER) - find_package(Thrift QUIET) - if(Thrift_FOUND) - find_package(Boost REQUIRED) -- include_directories(${Boost_INCLUDE_DIR}) - else() - # Install Thrift and propagate via vcpkg toolchain file - if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 47f57a6..ebf5869 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -280,6 +280,10 @@ else() # cmake 3.8 or lower - target_link_libraries(opentelemetry_proto INTERFACE ${Protobuf_LIBRARIES}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(BUILD_SHARED_LIBS) - set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON) - endif() diff --git a/opentelemetry-cpp/all/patches/1.8.3-0001-fix-cmake.patch b/opentelemetry-cpp/all/patches/1.8.3-0001-fix-cmake.patch deleted file mode 100644 index 35ba7f0..0000000 --- a/opentelemetry-cpp/all/patches/1.8.3-0001-fix-cmake.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f4fa064..1f06058 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -261,7 +261,6 @@ if(WITH_JAEGER) - find_package(Thrift QUIET) - if(Thrift_FOUND) - find_package(Boost REQUIRED) -- include_directories(${Boost_INCLUDE_DIR}) - else() - # Install Thrift and propagate via vcpkg toolchain file - if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 1aa1ba0..10e2f58 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -285,6 +285,10 @@ else() # cmake 3.8 or lower - target_link_libraries(opentelemetry_proto INTERFACE ${Protobuf_LIBRARIES}) - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(BUILD_SHARED_LIBS) - set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON) - endif() diff --git a/opentelemetry-cpp/all/test_package/CMakeLists.txt b/opentelemetry-cpp/all/test_package/CMakeLists.txt index 297eee2..0898e91 100644 --- a/opentelemetry-cpp/all/test_package/CMakeLists.txt +++ b/opentelemetry-cpp/all/test_package/CMakeLists.txt @@ -4,7 +4,6 @@ project(test_package CXX) find_package(opentelemetry-cpp REQUIRED CONFIG) -set(CMAKE_CXX_STANDARD 17) - add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE opentelemetry-cpp::opentelemetry-cpp) +target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/opentelemetry-cpp/all/test_package/test_package.cpp b/opentelemetry-cpp/all/test_package/test_package.cpp index 852e565..9e4a4f4 100644 --- a/opentelemetry-cpp/all/test_package/test_package.cpp +++ b/opentelemetry-cpp/all/test_package/test_package.cpp @@ -3,20 +3,20 @@ #include #include -int main(int argc, char **argv) { +int main(int argc, char** argv) { auto exporter = std::unique_ptr( - new opentelemetry::exporter::trace::OStreamSpanExporter); + new opentelemetry::exporter::trace::OStreamSpanExporter); auto processor = std::unique_ptr( - new opentelemetry::sdk::trace::SimpleSpanProcessor(std::move(exporter))); - auto provider = std::shared_ptr( - new opentelemetry::sdk::trace::TracerProvider(std::move(processor))); + new opentelemetry::sdk::trace::SimpleSpanProcessor(std::move(exporter))); + auto provider = opentelemetry::nostd::shared_ptr( + new opentelemetry::sdk::trace::TracerProvider(std::move(processor))); auto tracer = provider->GetTracer("simple"); - std::shared_ptr span = - tracer->StartSpan("op", { - {"my.attribute", "123"}, - }); + opentelemetry::nostd::shared_ptr span = tracer->StartSpan( + "op", { + {"my.attribute", "123"}, + }); return 0; } diff --git a/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt b/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt index 432e5d7..babe7e0 100644 --- a/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt +++ b/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt @@ -1,12 +1,9 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(opentelemetry-cpp REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE opentelemetry-cpp::opentelemetry-cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/opentelemetry-cpp/config.yml b/opentelemetry-cpp/config.yml index 4dd7c49..2d95945 100644 --- a/opentelemetry-cpp/config.yml +++ b/opentelemetry-cpp/config.yml @@ -1,17 +1,9 @@ versions: - "1.8.1": + "1.14.2": folder: all - "1.7.0": + "1.12.0": folder: all - "1.6.1": + "1.9.1": folder: all - "1.4.1": - folder: all - "1.4.0": - folder: all - "1.3.0": - folder: all - "1.2.0": - folder: all - "1.0.1": + "1.8.3": folder: all diff --git a/opentelemetry-proto/all/conandata.yml b/opentelemetry-proto/all/conandata.yml new file mode 100644 index 0000000..043fc48 --- /dev/null +++ b/opentelemetry-proto/all/conandata.yml @@ -0,0 +1,31 @@ +sources: + "1.3.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.3.0.tar.gz" + sha256: "73a678b0ff7a29b581381566a2230fe2a00b864608786c99c050a4492e2bbafc" + "1.2.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.2.0.tar.gz" + sha256: "516dc94685dbaa14fb792788f31d2ef2b0c3ad08dfa8a9a8164e3cf60c1ab6f7" + "1.1.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.1.0.tar.gz" + sha256: "df491a05f3fcbf86cc5ba5c9de81f6a624d74d4773d7009d573e37d6e2b6af64" + "1.0.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.0.0.tar.gz" + sha256: "a13a1a7b76a1f22a0ca2e6c293e176ffef031413ab8ba653a82a1dbc286a3a33" + "0.20.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v0.20.0.tar.gz" + sha256: "6ab267cf82832ed60ad075d574c78da736193eecb9693e8a8d02f65d6d3f3520" + "0.19.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v0.19.0.tar.gz" + sha256: "464bc2b348e674a1a03142e403cbccb01be8655b6de0f8bfe733ea31fcd421be" + "0.18.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/refs/tags/v0.18.0.tar.gz" + sha256: "134ce87f0a623daac19b9507b92da0d9b82929e3db796bba631e422f6ea8d3b3" + "0.17.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/refs/tags/v0.17.0.tar.gz" + sha256: "f269fbcb30e17b03caa1decd231ce826e59d7651c0f71c3b28eb5140b4bb5412" + "0.16.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/refs/tags/v0.16.0.tar.gz" + sha256: "22763df2020d4e16a411b249f86dda8fa1bea69a9592915bf0b1dab6d7005190" + "0.11.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/refs/tags/v0.11.0.tar.gz" + sha256: "985367f8905e91018e636cbf0d83ab3f834b665c4f5899a27d10cae9657710e2" diff --git a/opentelemetry-proto/all/conanfile.py b/opentelemetry-proto/all/conanfile.py new file mode 100644 index 0000000..b24f1a7 --- /dev/null +++ b/opentelemetry-proto/all/conanfile.py @@ -0,0 +1,45 @@ +import os + +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + + +class OpenTelemetryProtoConan(ConanFile): + name = "opentelemetry-proto" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/open-telemetry/opentelemetry-proto" + description = "Protobuf definitions for the OpenTelemetry protocol (OTLP)" + topics = ("opentelemetry", "telemetry", "otlp", "pre-built") + + package_type = "build-scripts" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def build(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), src=self.build_folder) + copy(self, pattern="*.proto", + dst=os.path.join(self.package_folder, "res"), src=self.build_folder) + + def package_info(self): + self.conf_info.define("user.opentelemetry-proto:proto_root", + os.path.join(self.package_folder, "res")) + self.cpp_info.resdirs = ["res"] + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + # TODO: to remove in conan v2 + self.user_info.proto_root = os.path.join(self.package_folder, "res") diff --git a/opentelemetry-proto/all/test_package/conanfile.py b/opentelemetry-proto/all/test_package/conanfile.py new file mode 100644 index 0000000..43eb202 --- /dev/null +++ b/opentelemetry-proto/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +import os + +from conan import ConanFile +from conan.tools.files import save, load +from conan.tools.layout import basic_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + save(self, os.path.join(self.build_folder, "proto_root"), self.dependencies["opentelemetry-proto"].conf_info.get("user.opentelemetry-proto:proto_root")) + + def test(self): + res_folder = load(self, os.path.join(self.build_folder, "proto_root")) + proto_path = os.path.join(res_folder, "opentelemetry", "proto", "common", "v1", "common.proto") + assert os.path.isfile(proto_path) diff --git a/opentelemetry-proto/all/test_v1_package/conanfile.py b/opentelemetry-proto/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..c5940f5 --- /dev/null +++ b/opentelemetry-proto/all/test_v1_package/conanfile.py @@ -0,0 +1,7 @@ +from conans import ConanFile, CMake +import os + +class TestPackageV1Conan(ConanFile): + def test(self): + res_folder = self.deps_user_info["opentelemetry-proto"].proto_root + assert os.path.isfile(os.path.join(res_folder, "opentelemetry", "proto", "common", "v1", "common.proto")) diff --git a/opentelemetry-proto/config.yml b/opentelemetry-proto/config.yml new file mode 100644 index 0000000..b7acdad --- /dev/null +++ b/opentelemetry-proto/config.yml @@ -0,0 +1,21 @@ +versions: + "1.3.0": + folder: all + "1.2.0": + folder: all + "1.1.0": + folder: all + "1.0.0": + folder: all + "0.20.0": + folder: all + "0.19.0": + folder: all + "0.18.0": + folder: all + "0.17.0": + folder: all + "0.16.0": + folder: all + "0.11.0": + folder: all diff --git a/pkgconf/all/conandata.yml b/pkgconf/all/conandata.yml new file mode 100644 index 0000000..33c2bc4 --- /dev/null +++ b/pkgconf/all/conandata.yml @@ -0,0 +1,47 @@ +sources: + "2.2.0": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-2.2.0.tar.xz" + sha256: "b06ff63a83536aa8c2f6422fa80ad45e4833f590266feb14eaddfe1d4c853c69" + "2.1.0": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-2.1.0.tar.xz" + sha256: "266d5861ee51c52bc710293a1d36622ae16d048d71ec56034a02eb9cf9677761" + "2.0.3": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-2.0.3.tar.xz" + sha256: "cabdf3c474529854f7ccce8573c5ac68ad34a7e621037535cbc3981f6b23836c" + "2.0.2": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-2.0.2.tar.xz" + sha256: "ea5a25ef8f251eb5377ec0e21c75fb61894433cfbdbf0b2559ba33e4c2664401" + "1.9.5": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.9.5.tar.xz" + sha256: "1ac1656debb27497563036f7bffc281490f83f9b8457c0d60bcfb638fb6b6171" + "1.9.3": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.9.3.tar.xz" + sha256: "5fb355b487d54fb6d341e4f18d4e2f7e813a6622cf03a9e87affa6a40565699d" + "1.7.4": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.7.4.tar.xz" + sha256: "d73f32c248a4591139a6b17777c80d4deab6b414ec2b3d21d0a24be348c476ab" + "1.7.3": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.7.3.tar.xz" + sha256: "b846aea51cf696c3392a0ae58bef93e2e72f8e7073ca6ad1ed8b01c85871f9c0" +patches: + "2.2.0": + - patch_file: "patches/2.2.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" + "2.1.0": + - patch_file: "patches/2.1.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" + "2.0.3": + - patch_file: "patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" + "2.0.2": + - patch_file: "patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" + "1.9.5": + - patch_file: "patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" + "1.9.3": + - patch_file: "patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" + "1.7.4": + - patch_file: "patches/1.7.4-0001-clang-12-strndup-not-in-string-h.patch" + - patch_file: "patches/1.7.4-0002-fix-static-link.patch" + - patch_file: "patches/1.7.4-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" + "1.7.3": + - patch_file: "patches/1.7.3-0001-meson-use-declare-dependencies.patch" + - patch_file: "patches/1.7.3-0002-clang-12-strndup-not-in-string-h.patch" + - patch_file: "patches/1.7.3-0003-meson-use-library.patch" + - patch_file: "patches/1.7.3-0004-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" diff --git a/pkgconf/all/conanfile.py b/pkgconf/all/conanfile.py new file mode 100644 index 0000000..673b980 --- /dev/null +++ b/pkgconf/all/conanfile.py @@ -0,0 +1,145 @@ +import os + +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm, rmdir, replace_in_file +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import is_msvc, unix_path_package_info_legacy +from conan.tools.scm import Version + + +required_conan_version = ">=1.57.0" + + +class PkgConfConan(ConanFile): + name = "pkgconf" + url = "https://github.com/conan-io/conan-center-index" + topics = ("build", "configuration") + homepage = "https://git.sr.ht/~kaniini/pkgconf" + license = "ISC" + description = "package compiler and linker metadata toolkit" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_lib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_lib": False, + } + + def layout(self): + basic_layout(self, src_folder="src") + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if not self.options.enable_lib: + self.options.rm_safe("fPIC") + self.options.rm_safe("shared") + elif self.options.shared: + self.options.rm_safe("fPIC") + + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def package_id(self): + if not self.info.options.enable_lib: + del self.info.settings.compiler + + def build_requirements(self): + self.tool_requires("meson/1.2.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _patch_sources(self): + apply_conandata_patches(self) + + if not self.options.get_safe("shared", False): + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "'-DLIBPKGCONF_EXPORT'", + "'-DPKGCONFIG_IS_STATIC'") + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "project('pkgconf', 'c',", + "project('pkgconf', 'c',\ndefault_options : ['c_std=gnu99'],") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = MesonToolchain(self) + if Version(self.version) >= "1.9.4": + tc.project_options["tests"] = "disabled" + else: + tc.project_options["tests"] = False + + if not self.options.enable_lib: + tc.project_options["default_library"] = "static" + tc.generate() + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder,"licenses")) + + meson = Meson(self) + meson.install() + + if is_msvc(self): + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if self.options.enable_lib and not self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libpkgconf.a"), + os.path.join(self.package_folder, "lib", "pkgconf.lib"),) + + if not self.options.enable_lib: + rmdir(self, os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "include")) + + + rmdir(self, os.path.join(self.package_folder, "share", "man")) + rename(self, os.path.join(self.package_folder, "share", "aclocal"), + os.path.join(self.package_folder, "bin", "aclocal")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + if self.options.enable_lib: + self.cpp_info.set_property("pkg_config_name", "libpkgconf") + if Version(self.version) >= "1.7.4": + self.cpp_info.includedirs.append(os.path.join("include", "pkgconf")) + self.cpp_info.libs = ["pkgconf"] + if not self.options.shared: + self.cpp_info.defines = ["PKGCONFIG_IS_STATIC"] + else: + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + bindir = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bindir) + + exesuffix = ".exe" if self.settings.os == "Windows" else "" + pkg_config = os.path.join(bindir, "pkgconf" + exesuffix).replace("\\", "/") + self.buildenv_info.define_path("PKG_CONFIG", pkg_config) + + pkgconf_aclocal = os.path.join(self.package_folder, "bin", "aclocal") + self.buildenv_info.prepend_path("ACLOCAL_PATH", pkgconf_aclocal) + # TODO: evaluate if `ACLOCAL_PATH` is enough and we can stop using `AUTOMAKE_CONAN_INCLUDES` + self.buildenv_info.prepend_path("AUTOMAKE_CONAN_INCLUDES", pkgconf_aclocal) + + # TODO: remove in conanv2 + automake_extra_includes = unix_path_package_info_legacy(self, pkgconf_aclocal.replace("\\", "/")) + self.env_info.PKG_CONFIG = pkg_config + self.env_info.AUTOMAKE_CONAN_INCLUDES.append(automake_extra_includes) diff --git a/pkgconf/all/patches/1.7.3-0001-meson-use-declare-dependencies.patch b/pkgconf/all/patches/1.7.3-0001-meson-use-declare-dependencies.patch new file mode 100644 index 0000000..1e4ed6f --- /dev/null +++ b/pkgconf/all/patches/1.7.3-0001-meson-use-declare-dependencies.patch @@ -0,0 +1,20 @@ +--- meson.build ++++ meson.build +@@ -84,12 +84,16 @@ + soversion : '3', + ) + ++libpkgconf_dep = declare_dependency( ++ link_with: libpkgconf, ++ compile_args: '-DLIBPKGCONF_EXPORT', ++) + + pkgconf_exe = executable('pkgconf', + 'cli/main.c', + 'cli/getopt_long.c', + 'cli/renderer-msvc.c', +- link_with : libpkgconf, ++ dependencies: libpkgconf_dep, + install : true) + + if get_option('tests') diff --git a/pkgconf/all/patches/1.7.3-0002-clang-12-strndup-not-in-string-h.patch b/pkgconf/all/patches/1.7.3-0002-clang-12-strndup-not-in-string-h.patch new file mode 100644 index 0000000..6ac86aa --- /dev/null +++ b/pkgconf/all/patches/1.7.3-0002-clang-12-strndup-not-in-string-h.patch @@ -0,0 +1,19 @@ +--- meson.build ++++ meson.build +@@ -31,11 +31,11 @@ +- ['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path', 'sys/cygwin.h'], +- ['HAVE_STRLCAT', 'strlcat', 'string.h'], +- ['HAVE_STRLCPY', 'strlcpy', 'string.h'], +- ['HAVE_STRNDUP', 'strndup', 'string.h'], ++ ['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path(CCP_POSIX_TO_WIN_A, (void*)0, (void*)0, 0)', 'sys/cygwin.h'], ++ ['HAVE_STRLCAT', 'strlcat((void*)0, (void*)0, 0)', 'string.h'], ++ ['HAVE_STRLCPY', 'strlcpy((void*)0, (void*)0, 0)', 'string.h'], ++ ['HAVE_STRNDUP', 'strndup((void*)0, 0)', 'string.h'], + ] + + foreach f : check_functions +- if cc.has_function(f.get(1), prefix : '#include <' + f.get(2) + '>') and cc.has_header_symbol(f.get(2), f.get(1)) ++ if cc.links('#include <' + f.get(2) + '>\nint main() { ' + f.get(1) + ';}') + cdata.set(f.get(0), 1) + endif + endforeach diff --git a/pkgconf/all/patches/1.7.3-0003-meson-use-library.patch b/pkgconf/all/patches/1.7.3-0003-meson-use-library.patch new file mode 100644 index 0000000..0bc7ebc --- /dev/null +++ b/pkgconf/all/patches/1.7.3-0003-meson-use-library.patch @@ -0,0 +1,11 @@ +--- meson.build ++++ meson.build +@@ -63,7 +63,7 @@ + + subdir('libpkgconf') + +-libpkgconf = shared_library('pkgconf', ++libpkgconf = library('pkgconf', + 'libpkgconf/argvsplit.c', + 'libpkgconf/audit.c', + 'libpkgconf/bsdstubs.c', diff --git a/pkgconf/all/patches/1.7.3-0004-PKG_CONF_PATH-allow-colon+semicolon-separator.patch b/pkgconf/all/patches/1.7.3-0004-PKG_CONF_PATH-allow-colon+semicolon-separator.patch new file mode 100644 index 0000000..c0bee01 --- /dev/null +++ b/pkgconf/all/patches/1.7.3-0004-PKG_CONF_PATH-allow-colon+semicolon-separator.patch @@ -0,0 +1,11 @@ +--- libpkgconf/path.c ++++ libpkgconf/path.c +@@ -146,7 +146,7 @@ + return 0; + + iter = workbuf = strdup(text); +- while ((p = strtok(iter, PKG_CONFIG_PATH_SEP_S)) != NULL) ++ while ((p = strtok(iter, ":;")) != NULL) + { + pkgconf_path_add(p, dirlist, filter); + diff --git a/pkgconf/all/patches/1.7.4-0001-clang-12-strndup-not-in-string-h.patch b/pkgconf/all/patches/1.7.4-0001-clang-12-strndup-not-in-string-h.patch new file mode 100644 index 0000000..68442e9 --- /dev/null +++ b/pkgconf/all/patches/1.7.4-0001-clang-12-strndup-not-in-string-h.patch @@ -0,0 +1,19 @@ +--- meson.build ++++ meson.build +@@ -13,11 +13,11 @@ +- ['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path', 'sys/cygwin.h'], +- ['HAVE_STRLCAT', 'strlcat', 'string.h'], +- ['HAVE_STRLCPY', 'strlcpy', 'string.h'], +- ['HAVE_STRNDUP', 'strndup', 'string.h'], ++ ['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path(CCP_POSIX_TO_WIN_A, (void*)0, (void*)0, 0)', 'sys/cygwin.h'], ++ ['HAVE_STRLCAT', 'strlcat((void*)0, (void*)0, 0)', 'string.h'], ++ ['HAVE_STRLCPY', 'strlcpy((void*)0, (void*)0, 0)', 'string.h'], ++ ['HAVE_STRNDUP', 'strndup((void*)0, 0)', 'string.h'], + ] + + foreach f : check_functions +- if cc.has_function(f.get(1), prefix : '#include <' + f.get(2) + '>') and cc.has_header_symbol(f.get(2), f.get(1)) ++ if cc.links('#include <' + f.get(2) + '>\nint main() { ' + f.get(1) + ';}') + cdata.set(f.get(0), 1) + endif + endforeach diff --git a/pkgconf/all/patches/1.7.4-0002-fix-static-link.patch b/pkgconf/all/patches/1.7.4-0002-fix-static-link.patch new file mode 100644 index 0000000..dd92515 --- /dev/null +++ b/pkgconf/all/patches/1.7.4-0002-fix-static-link.patch @@ -0,0 +1,44 @@ +diff --git a/meson.build b/meson.build +index e7822b8da..8f7aa0075 100644 +--- a/meson.build ++++ b/meson.build +@@ -45,6 +45,13 @@ cdata.set('abs_top_builddir', meson.build_root()) + + subdir('libpkgconf') + ++libtype = get_option('default_library') ++if libtype == 'static' ++ build_static = '-DPKGCONFIG_IS_STATIC' ++else ++ build_static = '-DLIBPKGCONF_EXPORT' ++endif ++ + libpkgconf = library('pkgconf', + 'libpkgconf/argvsplit.c', + 'libpkgconf/audit.c', +@@ -60,7 +67,7 @@ libpkgconf = library('pkgconf', + 'libpkgconf/pkg.c', + 'libpkgconf/queue.c', + 'libpkgconf/tuple.c', +- c_args: '-DLIBPKGCONF_EXPORT', ++ c_args: build_static, + install : true, + version : '3.0.0', + soversion : '3', +@@ -73,13 +80,16 @@ pkg.generate(libpkgconf, + url: 'http://github.com/pkgconf/pkgconf', + filebase : 'libpkgconf', + subdirs: ['pkgconf'], ++ extra_cflags : build_static + ) + ++ + pkgconf_exe = executable('pkgconf', + 'cli/main.c', + 'cli/getopt_long.c', + 'cli/renderer-msvc.c', + link_with : libpkgconf, ++ c_args: build_static, + install : true) + + if get_option('tests') diff --git a/pkgconf/all/patches/1.7.4-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch b/pkgconf/all/patches/1.7.4-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch new file mode 100644 index 0000000..6c8cd85 --- /dev/null +++ b/pkgconf/all/patches/1.7.4-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch @@ -0,0 +1,11 @@ +--- libpkgconf/path.c ++++ libpkgconf/path.c +@@ -142,7 +142,7 @@ + return 0; + + iter = workbuf = strdup(text); +- while ((p = strtok(iter, PKG_CONFIG_PATH_SEP_S)) != NULL) ++ while ((p = strtok(iter, ":;")) != NULL) + { + pkgconf_path_add(p, dirlist, filter); + diff --git a/pkgconf/all/patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch b/pkgconf/all/patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch new file mode 100644 index 0000000..8c6738a --- /dev/null +++ b/pkgconf/all/patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch @@ -0,0 +1,11 @@ +--- libpkgconf/path.c ++++ libpkgconf/path.c +@@ -138,7 +138,7 @@ + return 0; + + iter = workbuf = strdup(text); +- while ((p = strtok(iter, PKG_CONFIG_PATH_SEP_S)) != NULL) ++ while ((p = strtok(iter, ":;")) != NULL) + { + pkgconf_path_add(p, dirlist, filter); + diff --git a/pkgconf/all/patches/2.1.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch b/pkgconf/all/patches/2.1.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch new file mode 100644 index 0000000..ad4d094 --- /dev/null +++ b/pkgconf/all/patches/2.1.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch @@ -0,0 +1,11 @@ +--- libpkgconf/path.c ++++ libpkgconf/path.c +@@ -170,7 +170,7 @@ + return 0; + + iter = workbuf = strdup(text); +- while ((p = strtok(iter, PKG_CONFIG_PATH_SEP_S)) != NULL) ++ while ((p = strtok(iter, ":;")) != NULL) + { + pkgconf_path_add(p, dirlist, filter); + diff --git a/pkgconf/all/patches/2.2.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch b/pkgconf/all/patches/2.2.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch new file mode 100644 index 0000000..344efd9 --- /dev/null +++ b/pkgconf/all/patches/2.2.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch @@ -0,0 +1,11 @@ +--- libpkgconf/path.c ++++ libpkgconf/path.c +@@ -170,7 +170,7 @@ + return 0; + + iter = workbuf = strdup(text); +- while ((p = strtok(iter, PKG_CONFIG_PATH_SEP_S)) != NULL) ++ while ((p = strtok(iter, ";:")) != NULL) + { + pkgconf_path_add(p, dirlist, filter); + diff --git a/pkgconf/all/test_package/conanfile.py b/pkgconf/all/test_package/conanfile.py new file mode 100644 index 0000000..b2de624 --- /dev/null +++ b/pkgconf/all/test_package/conanfile.py @@ -0,0 +1,83 @@ +from io import StringIO +import os +from pathlib import Path +import re + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.microsoft import unix_path + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + + # Expose `PKG_CONFIG_PATH` to be able to find libexample1.pc + env = Environment() + self.output.info(f"Source folder: {self.source_folder}") + env.prepend_path("PKG_CONFIG_PATH", self.source_folder) + env.vars(self, scope="run").save_script("pkgconf-config-path") + + # CMake project to test that we can link against the library, + # when the library is built + if self.dependencies[self.tested_reference_str].options.enable_lib: + ct = CMakeToolchain(self) + ct.generate() + deps = CMakeDeps(self) + deps.generate() + + # Check build environment postconditions + buildenv = VirtualBuildEnv(self) + env = buildenv.vars(scope='build') + assert 'PKG_CONFIG' in env.keys() + assert 'ACLOCAL_PATH' in env.keys() + assert 'AUTOMAKE_CONAN_INCLUDES' in env.keys() + buildenv.generate() + + @property + def _testing_library(self): + # Workaround, in Conan >=2.0 we should be able to remove this in favour of: + # self.dependencies[self.tested_reference_str].options.enable_lib + has_toolchain = sorted(Path(self.build_folder).rglob('conan_toolchain.cmake')) + return has_toolchain + + def build(self): + if self._testing_library: + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + # Check that we can find pkgconf in build environment + # and that it is the expected version + if can_run(self): + output = StringIO() + self.run("pkgconf --about", output, env="conanrun") + # TODO: When recipe is Conan 2+ only, this can be simplified + # to: self.dependencies['pkgconf'].ref.version + tokens = re.split('[@#]', self.tested_reference_str) + pkgconf_expected_version = tokens[0].split("/", 1)[1] + assert f"pkgconf {pkgconf_expected_version}" in output.getvalue() + + self.run("pkgconf libexample1 -cflags", env="conanrun") + + # Test that executable linked against library runs as expected + if can_run(self) and self._testing_library: + test_executable = unix_path(self, os.path.join(self.cpp.build.bindirs[0], "test_package")) + self.run(test_executable, env="conanrun") diff --git a/pkgconf/all/test_package/src/CMakeLists.txt b/pkgconf/all/test_package/src/CMakeLists.txt new file mode 100644 index 0000000..04e3aa2 --- /dev/null +++ b/pkgconf/all/test_package/src/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(pkgconf REQUIRED) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE pkgconf::pkgconf) diff --git a/pkgconf/all/test_package/src/libexample1.pc b/pkgconf/all/test_package/src/libexample1.pc new file mode 100644 index 0000000..5fc1bea --- /dev/null +++ b/pkgconf/all/test_package/src/libexample1.pc @@ -0,0 +1,6 @@ +Name: libexample1 +Description: This is a description of libexample1. +Requires: +Version: 0.42 +Libs: -L/usr/lib -lexample1 +Cflags: -I/usr/include/libexample1 -I/usr/include -DEXAMPLE1_STATIC diff --git a/pkgconf/all/test_package/src/test_package.c b/pkgconf/all/test_package/src/test_package.c new file mode 100644 index 0000000..f8fd8ee --- /dev/null +++ b/pkgconf/all/test_package/src/test_package.c @@ -0,0 +1,24 @@ +#include "libpkgconf/libpkgconf.h" + +#include +#include +#include + +bool error_callback(const char *msg, const pkgconf_client_t *client, const void *data) { + printf("error callback: %s\n", msg); + fflush(stdout); + return 1; // 1/true means message handled +} + +int main() { + pkgconf_client_t client; + memset(&client, 0, sizeof(client)); + + pkgconf_client_init(&client, error_callback, NULL, pkgconf_cross_personality_default()); + + pkgconf_error(&client, "%s:%d %s: %s", __FILE__, __LINE__, __FUNCTION__, "test error"); + + pkgconf_client_deinit(&client); + + return 0; +} diff --git a/pkgconf/config.yml b/pkgconf/config.yml new file mode 100644 index 0000000..369e560 --- /dev/null +++ b/pkgconf/config.yml @@ -0,0 +1,17 @@ +versions: + "2.2.0": + folder: "all" + "2.1.0": + folder: "all" + "2.0.3": + folder: "all" + "2.0.2": + folder: "all" + "1.9.5": + folder: "all" + "1.9.3": + folder: "all" + "1.7.4": + folder: "all" + "1.7.3": + folder: "all" diff --git a/prometheus-cpp/all/conandata.yml b/prometheus-cpp/all/conandata.yml new file mode 100644 index 0000000..a1e0c24 --- /dev/null +++ b/prometheus-cpp/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "1.1.0": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v1.1.0.tar.gz" + sha256: "397544fe91e183029120b4eebcfab24ed9ec833d15850aae78fd5db19062d13a" + "1.0.1": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v1.0.1.tar.gz" + sha256: "593e028d401d3298eada804d252bc38d8cab3ea1c9e88bcd72095281f85e6d16" + "1.0.0": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v1.0.0.tar.gz" + sha256: "07018db604ea3e61f5078583e87c80932ea10c300d979061490ee1b7dc8e3a41" + "0.12.3": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v0.12.3.tar.gz" + sha256: "e021e76e8e933672f1af0d223307282004f585a054354f8d894db39debddff8e" + "0.12.1": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v0.12.1.tar.gz" + sha256: "2102609457f812dbeaaafd55736461fd0538fc7e7568174b1cdec43399dbded4" + "0.11.0": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v0.11.0.tar.gz" + sha256: "aab4ef8342319f631969e01b8c41e355704847cbe76131cb1dd5ea1862000bda" +patches: + "0.11.0": + - patch_file: "patches/0001-include-limits.patch" diff --git a/prometheus-cpp/all/conanfile.py b/prometheus-cpp/all/conanfile.py new file mode 100644 index 0000000..10a8edf --- /dev/null +++ b/prometheus-cpp/all/conanfile.py @@ -0,0 +1,159 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc, check_min_vs + +import os + +required_conan_version = ">=1.53.0" + +class PrometheusCppConan(ConanFile): + name = "prometheus-cpp" + description = "Prometheus Client Library for Modern C++" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jupp0r/prometheus-cpp" + topics = ("metrics", "prometheus", "networking") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_pull": [True, False], + "with_push": [True, False], + "with_compression": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_pull": True, + "with_push": True, + "with_compression": True, + } + + @property + def _min_cppstd(self): + return 11 if Version(self.version) < "1.1.0" else 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.with_pull: + self.options.rm_safe("with_compression") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_pull: + self.requires("civetweb/1.16") + if self.options.with_push: + self.requires("libcurl/[>=7.78.0 <9]") + if self.options.get_safe("with_compression"): + self.requires("zlib/[>=1.2.11 <2]") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + if Version(self.version) < "1.1.0": + return + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_THIRDPARTY_LIBRARIES"] = False + tc.variables["ENABLE_TESTING"] = False + tc.variables["OVERRIDE_CXX_STANDARD_FLAGS"] = not valid_min_cppstd(self, self._min_cppstd) + tc.variables["ENABLE_PULL"] = self.options.with_pull + tc.variables["ENABLE_PUSH"] = self.options.with_push + if self.options.with_pull: + tc.variables["ENABLE_COMPRESSION"] = self.options.with_compression + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "prometheus-cpp") + + self.cpp_info.components["prometheus-cpp-core"].set_property("cmake_target_name", "prometheus-cpp::core") + self.cpp_info.components["prometheus-cpp-core"].set_property("pkg_config_name", "prometheus-cpp-core") + self.cpp_info.components["prometheus-cpp-core"].libs = ["prometheus-cpp-core"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["prometheus-cpp-core"].system_libs = ["pthread", "rt"] + + if self.options.with_push: + self.cpp_info.components["prometheus-cpp-push"].set_property("cmake_target_name", "prometheus-cpp::push") + self.cpp_info.components["prometheus-cpp-push"].set_property("pkg_config_name", "prometheus-cpp-push") + self.cpp_info.components["prometheus-cpp-push"].libs = ["prometheus-cpp-push"] + self.cpp_info.components["prometheus-cpp-push"].requires = [ + "prometheus-cpp-core", + "libcurl::libcurl", + ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["prometheus-cpp-push"].system_libs = ["pthread", "rt"] + + if self.options.with_pull: + self.cpp_info.components["prometheus-cpp-pull"].set_property("cmake_target_name", "prometheus-cpp::pull") + self.cpp_info.components["prometheus-cpp-pull"].set_property("pkg_config_name", "prometheus-cpp-pull") + self.cpp_info.components["prometheus-cpp-pull"].libs = ["prometheus-cpp-pull"] + self.cpp_info.components["prometheus-cpp-pull"].requires = [ + "prometheus-cpp-core", + "civetweb::civetweb-cpp" + ] + if self.options.with_compression: + self.cpp_info.components["prometheus-cpp-pull"].requires.append("zlib::zlib") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["prometheus-cpp-pull"].system_libs = ["pthread", "rt"] + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["prometheus-cpp-core"].names["cmake_find_package"] = "core" + self.cpp_info.components["prometheus-cpp-core"].names["cmake_find_package_multi"] = "core" + if self.options.with_push: + self.cpp_info.components["prometheus-cpp-push"].names["cmake_find_package"] = "push" + self.cpp_info.components["prometheus-cpp-push"].names["cmake_find_package_multi"] = "push" + if self.options.with_pull: + self.cpp_info.components["prometheus-cpp-pull"].names["cmake_find_package"] = "pull" + self.cpp_info.components["prometheus-cpp-pull"].names["cmake_find_package_multi"] = "pull" diff --git a/prometheus-cpp/all/patches/0001-include-limits.patch b/prometheus-cpp/all/patches/0001-include-limits.patch new file mode 100644 index 0000000..d8d94b9 --- /dev/null +++ b/prometheus-cpp/all/patches/0001-include-limits.patch @@ -0,0 +1,10 @@ +--- a/core/src/histogram.cc ++++ b/core/src/histogram.cc +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/prometheus-cpp/all/test_package/CMakeLists.txt b/prometheus-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..0df7da5 --- /dev/null +++ b/prometheus-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(prometheus-cpp CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE prometheus-cpp::push prometheus-cpp::pull) +if(${prometheus-cpp_VERSION} VERSION_LESS "1.1.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/prometheus-cpp/all/test_package/conanfile.py b/prometheus-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000..a9fb966 --- /dev/null +++ b/prometheus-cpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/prometheus-cpp/all/test_package/test_package.cpp b/prometheus-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000..eff7662 --- /dev/null +++ b/prometheus-cpp/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +using namespace prometheus; + +int main(int argc, char** argv) { + auto registry = std::make_shared(); + auto& counter_family = BuildCounter() + .Name("time_running_seconds_total") + .Help("How many seconds is this server running?") + .Labels({{"label", "value"}}) + .Register(*registry); + auto& second_counter = counter_family.Add( + {{"another_label", "value"}, {"yet_another_label", "value"}}); + second_counter.Increment(); + return 0; +} diff --git a/prometheus-cpp/all/test_v1_package/CMakeLists.txt b/prometheus-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..925ecbe --- /dev/null +++ b/prometheus-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/prometheus-cpp/all/test_v1_package/conanfile.py b/prometheus-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..5a05af3 --- /dev/null +++ b/prometheus-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/prometheus-cpp/config.yml b/prometheus-cpp/config.yml new file mode 100644 index 0000000..3bfa390 --- /dev/null +++ b/prometheus-cpp/config.yml @@ -0,0 +1,13 @@ +versions: + "1.1.0": + folder: all + "1.0.1": + folder: all + "1.0.0": + folder: all + "0.12.3": + folder: all + "0.12.1": + folder: all + "0.11.0": + folder: all diff --git a/protobuf/all/conandata.yml b/protobuf/all/conandata.yml new file mode 100644 index 0000000..c03c833 --- /dev/null +++ b/protobuf/all/conandata.yml @@ -0,0 +1,99 @@ +sources: + "5.27.0": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v5.27.0.tar.gz" + sha256: "1611a03e550c27c526bde1da544c94f7aa65c10687bbc8e570537dfa94069e1a" + "4.25.3": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v4.25.3.tar.gz" + sha256: "1d6b8d9114cb5b33ce8711729893097a107d4fefff5423528eb1decb5451856c" + "3.21.12": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.12.tar.gz" + sha256: "930c2c3b5ecc6c9c12615cf5ad93f1cd6e12d0aba862b572e076259970ac3a53" + "3.20.3": + url: "https://github.com/protocolbuffers/protobuf/archive/v3.20.3.tar.gz" + sha256: "9c0fd39c7a08dff543c643f0f4baf081988129a411b977a07c46221793605638" +patches: + "3.21.12": + - patch_file: "patches/protobuf-3.21.12-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" + "3.20.3": + - patch_file: "patches/protobuf-3.20.0-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" +absl_deps: + "5.27.0": + - absl_absl_check + - absl_absl_log + - absl_algorithm + - absl_base + - absl_bind_front + - absl_bits + - absl_btree + - absl_cleanup + - absl_cord + - absl_core_headers + - absl_debugging + - absl_die_if_null + - absl_dynamic_annotations + - absl_flags + - absl_flat_hash_map + - absl_flat_hash_set + - absl_function_ref + - absl_hash + - absl_if_constexpr + - absl_layout + - absl_log_initialize + - absl_log_globals + - absl_log_severity + - absl_memory + - absl_node_hash_map + - absl_node_hash_set + - absl_optional + - absl_random_distributions + - absl_random_random + - absl_span + - absl_status + - absl_statusor + - absl_strings + - absl_synchronization + - absl_time + - absl_type_traits + - absl_utility + - absl_variant + "4.25.3": + - absl_absl_check + - absl_absl_log + - absl_algorithm + - absl_base + - absl_bind_front + - absl_bits + - absl_btree + - absl_cleanup + - absl_cord + - absl_core_headers + - absl_debugging + - absl_die_if_null + - absl_dynamic_annotations + - absl_flags + - absl_flat_hash_map + - absl_flat_hash_set + - absl_function_ref + - absl_hash + - absl_layout + - absl_log_initialize + - absl_log_severity + - absl_memory + - absl_node_hash_map + - absl_node_hash_set + - absl_optional + - absl_span + - absl_status + - absl_statusor + - absl_strings + - absl_synchronization + - absl_time + - absl_type_traits + - absl_utility + - absl_variant diff --git a/protobuf/all/conanfile.py b/protobuf/all/conanfile.py new file mode 100644 index 0000000..d36546a --- /dev/null +++ b/protobuf/all/conanfile.py @@ -0,0 +1,312 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, rename, get, apply_conandata_patches, export_conandata_patches, replace_in_file, rmdir, rm, save +from conan.tools.microsoft import check_min_vs, msvc_runtime_flag, is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.53" + + +class ProtobufConan(ConanFile): + name = "protobuf" + description = "Protocol Buffers - Google's data interchange format" + topics = ("protocol-buffers", "protocol-compiler", "serialization", "rpc", "protocol-compiler") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/protocolbuffers/protobuf" + license = "BSD-3-Clause" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + "with_rtti": [True, False], + "lite": [True, False], + "upb": [True, False], + "debug_suffix": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + "with_rtti": True, + "lite": False, + "upb": False, + "debug_suffix": True, + } + + short_paths = True + + @property + def _is_clang_cl(self): + return self.settings.compiler == "clang" and self.settings.os == "Windows" + + @property + def _is_clang_x86(self): + return self.settings.compiler == "clang" and self.settings.arch == "x86" + + @property + def _protobuf_release(self): + current_ver = Version(self.version) + return Version(f"{current_ver.minor}.{current_ver.patch}") + + def export_sources(self): + export_conandata_patches(self) + copy(self, "protobuf-conan-protoc-target.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + if self._protobuf_release < "27.0": + self.options.rm_safe("upb") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/[>=1.2.11 <2]") + + if self._protobuf_release >= "22.0": + self.requires("abseil/20240116.2", transitive_headers=True) + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + def validate(self): + if self.options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Protobuf can't be built with shared + MT(d) runtimes") + + if is_msvc(self) and self._protobuf_release >= "22" and self.options.shared and \ + not self.dependencies["abseil"].options.shared: + raise ConanInvalidConfiguration("When building protobuf as a shared library on Windows, " + "abseil needs to be a shared library too") + + if self._protobuf_release >= "22.0": + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + else: + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), None) + compiler_version = Version(self.settings.compiler.version) + if minimum_version and compiler_version < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++14, which your compiler does not support.", + ) + + check_min_vs(self, "190") + + if self.settings.compiler == "clang": + if Version(self.settings.compiler.version) < "4": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support clang < 4") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _cmake_install_base_path(self): + return os.path.join("lib", "cmake", "protobuf") + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_INSTALL_CMAKEDIR"] = self._cmake_install_base_path.replace("\\", "/") + tc.cache_variables["protobuf_WITH_ZLIB"] = self.options.with_zlib + tc.cache_variables["protobuf_BUILD_TESTS"] = False + tc.cache_variables["protobuf_BUILD_PROTOC_BINARIES"] = self.settings.os != "tvOS" + if not self.options.debug_suffix: + tc.cache_variables["protobuf_DEBUG_POSTFIX"] = "" + tc.cache_variables["protobuf_BUILD_LIBPROTOC"] = self.settings.os != "tvOS" + tc.cache_variables["protobuf_DISABLE_RTTI"] = not self.options.with_rtti + tc.cache_variables["protobuf_BUILD_LIBUPB"] = self.options.get_safe("upb") + if self._protobuf_release >= "22.0": + tc.cache_variables["protobuf_ABSL_PROVIDER"] = "package" + if not self.settings.compiler.get_safe("cppstd") and self._protobuf_release >= "22.0": + tc.variables["CMAKE_CXX_STANDARD"] = 14 + if is_msvc(self) or self._is_clang_cl: + runtime = msvc_runtime_flag(self) + if not runtime: + runtime = self.settings.get_safe("compiler.runtime") + tc.cache_variables["protobuf_MSVC_STATIC_RUNTIME"] = "MT" in runtime + if is_apple_os(self) and self.options.shared: + # Workaround against SIP on macOS for consumers while invoking protoc when protobuf lib is shared + tc.variables["CMAKE_INSTALL_RPATH"] = "@loader_path/../lib" + + if self.settings.os == "Linux": + # Use RPATH instead of RUNPATH to help with specific case + # in the grpc recipe when grpc_cpp_plugin is run with protoc + # in the same build. RPATH ensures that the rpath in the binary + # is respected for transitive dependencies too + project_include = os.path.join(self.generators_folder, "protobuf_project_include.cmake") + save(self, project_include, "add_link_options(-Wl,--disable-new-dtags)") + tc.variables["CMAKE_PROJECT_INCLUDE"] = project_include + # Note: conan2 only could be: + # tc.extra_exelinkflags.append("-Wl,--disable-new-dtags") + # tc.extra_sharedlinkflags.append("-Wl,--disable-new-dtags") + + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + if self._protobuf_release < "22.0": + # In older versions of protobuf, this file defines the `protobuf_generate` function + protobuf_config_cmake = os.path.join(self.source_folder, "cmake", "protobuf-config.cmake.in") + replace_in_file(self, protobuf_config_cmake, "@_protobuf_FIND_ZLIB@", "") + replace_in_file(self, protobuf_config_cmake, + "include(\"${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake\")", + "" + ) + + # Disable a potential warning in protobuf-module.cmake.in + # TODO: remove this patch? Is it really useful? + protobuf_module_cmake = os.path.join(self.source_folder, "cmake", "protobuf-module.cmake.in") + replace_in_file(self, + protobuf_module_cmake, + "if(DEFINED Protobuf_SRC_ROOT_FOLDER)", + "if(0)\nif(DEFINED Protobuf_SRC_ROOT_FOLDER)", + ) + replace_in_file(self, + protobuf_module_cmake, + "# Define upper case versions of output variables", + "endif()", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake_root = "cmake" if Version(self.version) < "3.21" else None + cmake.configure(build_script_folder=cmake_root) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake", "utf8_range")) + if self._protobuf_release < "22.0": + rename(self, os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-config.cmake"), + os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-generate.cmake")) + + cmake_config_folder = os.path.join(self.package_folder, self._cmake_install_base_path) + rm(self, "protobuf-config*.cmake", folder=cmake_config_folder) + rm(self, "protobuf-targets*.cmake", folder=cmake_config_folder) + copy(self, "protobuf-conan-protoc-target.cmake", src=self.source_folder, dst=cmake_config_folder) + + if not self.options.lite: + rm(self, "libprotobuf-lite*", os.path.join(self.package_folder, "lib")) + rm(self, "libprotobuf-lite*", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "Protobuf") + self.cpp_info.set_property("cmake_file_name", "protobuf") + self.cpp_info.set_property("pkg_config_name", "protobuf_full_package") # unofficial, but required to avoid side effects (libprotobuf component "steals" the default global pkg_config name) + + build_modules = [ + os.path.join(self._cmake_install_base_path, "protobuf-generate.cmake"), + os.path.join(self._cmake_install_base_path, "protobuf-module.cmake"), + os.path.join(self._cmake_install_base_path, "protobuf-options.cmake"), + os.path.join(self._cmake_install_base_path, "protobuf-conan-protoc-target.cmake"), + ] + self.cpp_info.set_property("cmake_build_modules", build_modules) + + lib_prefix = "lib" if (is_msvc(self) or self._is_clang_cl) else "" + lib_suffix = "d" if self.settings.build_type == "Debug" and self.options.debug_suffix else "" + + if self._protobuf_release >= "22.0": + absl_deps = [f"abseil::{c}" for c in self.conan_data["absl_deps"][self.version]] + + if self._protobuf_release >= "22.0" and (not self.options.shared or self.options.get_safe("upb")): + # utf8 libraries + # it's a private dependency and unconditionally built as a static library, should only + # be exposed when protobuf itself is static (or if upb is being built) + self.cpp_info.components["utf8_range"].set_property("cmake_target_name", "utf8_range::utf8_range") + self.cpp_info.components["utf8_range"].libs = ["utf8_range"] + self.cpp_info.components["utf8_validity"].set_property("cmake_target_name", "utf8_range::utf8_validity") + self.cpp_info.components["utf8_validity"].libs = ["utf8_validity"] + self.cpp_info.components["utf8_validity"].requires = ["abseil::absl_strings"] + + if self.options.get_safe("upb"): + # upb libraries: note that these are unconditionally static + self.cpp_info.components["upb"].set_property("cmake_target_name", "protobuf::libupb") + self.cpp_info.components["upb"].libs = [lib_prefix + "upb" + lib_suffix] + self.cpp_info.components["upb"].requires = ["utf8_range"] + + # libprotobuf + self.cpp_info.components["libprotobuf"].set_property("cmake_target_name", "protobuf::libprotobuf") + self.cpp_info.components["libprotobuf"].set_property("pkg_config_name", "protobuf") + self.cpp_info.components["libprotobuf"].builddirs.append(self._cmake_install_base_path) + self.cpp_info.components["libprotobuf"].libs = [lib_prefix + "protobuf" + lib_suffix] + if self.options.with_zlib: + self.cpp_info.components["libprotobuf"].requires = ["zlib::zlib"] + if self._protobuf_release >= "22.0": + self.cpp_info.components["libprotobuf"].requires.extend(absl_deps) + if not self.options.shared: + self.cpp_info.components["libprotobuf"].requires.extend(["utf8_validity"]) + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libprotobuf"].system_libs.extend(["m", "pthread"]) + if self._is_clang_x86 or "arm" in str(self.settings.arch): + self.cpp_info.components["libprotobuf"].system_libs.append("atomic") + if self.settings.os == "Android": + self.cpp_info.components["libprotobuf"].system_libs.append("log") + if self.settings.os == "Windows": + if self.options.shared: + self.cpp_info.components["libprotobuf"].defines = ["PROTOBUF_USE_DLLS"] + + # libprotoc + if self.settings.os != "tvOS": + self.cpp_info.components["libprotoc"].set_property("cmake_target_name", "protobuf::libprotoc") + self.cpp_info.components["libprotoc"].libs = [lib_prefix + "protoc" + lib_suffix] + self.cpp_info.components["libprotoc"].requires = ["libprotobuf"] + if self._protobuf_release >= "22.0": + self.cpp_info.components["libprotoc"].requires.extend(absl_deps) + + # libprotobuf-lite + if self.options.lite: + self.cpp_info.components["libprotobuf-lite"].set_property("cmake_target_name", "protobuf::libprotobuf-lite") + self.cpp_info.components["libprotobuf-lite"].set_property("pkg_config_name", "protobuf-lite") + self.cpp_info.components["libprotobuf-lite"].builddirs.append(self._cmake_install_base_path) + self.cpp_info.components["libprotobuf-lite"].libs = [lib_prefix + "protobuf-lite" + lib_suffix] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libprotobuf-lite"].system_libs.extend(["m", "pthread"]) + if self._is_clang_x86 or "arm" in str(self.settings.arch): + self.cpp_info.components["libprotobuf-lite"].system_libs.append("atomic") + if self.settings.os == "Windows": + if self.options.shared: + self.cpp_info.components["libprotobuf-lite"].defines = ["PROTOBUF_USE_DLLS"] + if self.settings.os == "Android": + self.cpp_info.components["libprotobuf-lite"].system_libs.append("log") + if self._protobuf_release >= "22.0": + self.cpp_info.components["libprotobuf-lite"].requires.extend(absl_deps) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.filenames["cmake_find_package"] = "Protobuf" + self.cpp_info.filenames["cmake_find_package_multi"] = "protobuf" + self.cpp_info.names["pkg_config"] ="protobuf_full_package" + for generator in ["cmake_find_package", "cmake_find_package_multi"]: + self.cpp_info.components["libprotobuf"].build_modules[generator] = build_modules + if self.options.lite: + for generator in ["cmake_find_package", "cmake_find_package_multi"]: + self.cpp_info.components["libprotobuf-lite"].build_modules[generator] = build_modules + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/protobuf/all/patches/protobuf-3.20.0-upstream-macos-macros.patch b/protobuf/all/patches/protobuf-3.20.0-upstream-macos-macros.patch new file mode 100644 index 0000000..df772b5 --- /dev/null +++ b/protobuf/all/patches/protobuf-3.20.0-upstream-macos-macros.patch @@ -0,0 +1,29 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index bdb2eec..e8d7dbc 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -816,6 +816,11 @@ + #undef TRUE + #pragma push_macro("FALSE") + #undef FALSE ++// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. ++#pragma push_macro("UID_MAX") ++#undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX + #endif // __APPLE__ + + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index 58136a4..eb0fdc8 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -134,6 +134,8 @@ + #pragma pop_macro("DOMAIN") + #pragma pop_macro("TRUE") + #pragma pop_macro("FALSE") ++#pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") + #endif // __APPLE__ + + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/protobuf/all/patches/protobuf-3.21.12-upstream-macos-macros.patch b/protobuf/all/patches/protobuf-3.21.12-upstream-macos-macros.patch new file mode 100644 index 0000000..3a152f6 --- /dev/null +++ b/protobuf/all/patches/protobuf-3.21.12-upstream-macos-macros.patch @@ -0,0 +1,25 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index f00daf7..d956db2 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -870,6 +870,8 @@ + // Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. + #pragma push_macro("UID_MAX") + #undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX + #endif // __APPLE__ + + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index e880fa5..f8968d9 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -144,6 +144,7 @@ + #pragma pop_macro("TRUE") + #pragma pop_macro("FALSE") + #pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") + #endif // __APPLE__ + + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/protobuf/all/protobuf-conan-protoc-target.cmake b/protobuf/all/protobuf-conan-protoc-target.cmake new file mode 100644 index 0000000..6165d8f --- /dev/null +++ b/protobuf/all/protobuf-conan-protoc-target.cmake @@ -0,0 +1,25 @@ +if(NOT TARGET protobuf::protoc) + # Locate protoc executable + ## Workaround for legacy "cmake" generator in case of cross-build + if(CMAKE_CROSSCOMPILING) + find_program(PROTOC_PROGRAM NAMES protoc PATHS ENV PATH NO_DEFAULT_PATH) + endif() + ## And here this will work fine with "CMakeToolchain" (for native & cross-build) + ## and legacy "cmake" generator in case of native build + if(NOT PROTOC_PROGRAM) + find_program(PROTOC_PROGRAM NAMES protoc) + endif() + ## Last resort: we search in package folder directly + if(NOT PROTOC_PROGRAM) + set(PROTOC_PROGRAM "${CMAKE_CURRENT_LIST_DIR}/../../../bin/protoc${CMAKE_EXECUTABLE_SUFFIX}") + endif() + get_filename_component(PROTOC_PROGRAM "${PROTOC_PROGRAM}" ABSOLUTE) + + # Give opportunity to users to provide an external protoc executable + # (this is a feature of official FindProtobuf.cmake) + set(Protobuf_PROTOC_EXECUTABLE ${PROTOC_PROGRAM} CACHE FILEPATH "The protoc compiler") + + # Create executable imported target protobuf::protoc + add_executable(protobuf::protoc IMPORTED) + set_property(TARGET protobuf::protoc PROPERTY IMPORTED_LOCATION ${Protobuf_PROTOC_EXECUTABLE}) +endif() diff --git a/protobuf/all/test_package/CMakeLists.txt b/protobuf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..b192771 --- /dev/null +++ b/protobuf/all/test_package/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(protobuf CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +if(CONAN_TEST_USE_CXXSTD_14) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() +target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") +if (protobuf_LITE) + target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf-lite) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf) +endif() + +if(TARGET protobuf::libprotoc) + target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotoc) +endif() + +if(NOT TARGET protobuf::protoc) + message(FATAL_ERROR "protoc executable should have been defined as part of find_package(protobuf)") +endif() + +if(NOT COMMAND protobuf_generate) + message(FATAL_ERROR "protobuf_generate should have been defined as part of find_package(protobuf)") +endif() diff --git a/protobuf/all/test_package/addressbook.proto b/protobuf/all/test_package/addressbook.proto new file mode 100644 index 0000000..be5732b --- /dev/null +++ b/protobuf/all/test_package/addressbook.proto @@ -0,0 +1,64 @@ +// See README.txt for information and build instructions. +// +// Note: START and END tags are used in comments to define sections used in +// tutorials. They are not part of the syntax for Protocol Buffers. +// +// To get an in-depth walkthrough of this file and the related examples, see: +// https://developers.google.com/protocol-buffers/docs/tutorials + +// [START declaration] +syntax = "proto3"; +package tutorial; + +import "google/protobuf/timestamp.proto"; +// [END declaration] + +// [START java_declaration] +option java_package = "com.example.tutorial"; +option java_outer_classname = "AddressBookProtos"; +// [END java_declaration] + +// [START csharp_declaration] +option csharp_namespace = "Google.Protobuf.Examples.AddressBook"; +// [END csharp_declaration] + +// [START messages] +message Person { + string name = 1; + int32 id = 2; // Unique ID number for this person. + string email = 3; + + enum PhoneType { + MOBILE = 0; + HOME = 1; + WORK = 2; + } + + message PhoneNumber { + string number = 1; + PhoneType type = 2; + } + + repeated PhoneNumber phones = 4; + + google.protobuf.Timestamp last_updated = 5; +} + +// Our address book file is just one of these. +message AddressBook { + repeated Person people = 1; +} +// [END messages] + +// Artibrary message with a GID type, to cause +// the .pb.h file to define `GID_MAX`, which +// may conflict with a macro defined by system +// headers on macOS. +message FooBar { + enum GID { + FOO = 0; + } + enum UID { + BAR = 0; + } +} diff --git a/protobuf/all/test_package/conanfile.py b/protobuf/all/test_package/conanfile.py new file mode 100644 index 0000000..880d1f9 --- /dev/null +++ b/protobuf/all/test_package/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +from conan.tools.scm import Version +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + # note `run=True` so that the runenv can find protoc + self.requires(self.tested_reference_str, run=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["protobuf_LITE"] = self.dependencies[self.tested_reference_str].options.lite + protobuf_version = Version(self.dependencies[self.tested_reference_str].ref.version) + tc.cache_variables["CONAN_TEST_USE_CXXSTD_14"] = protobuf_version >= "3.22" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + + # Invoke protoc in the same way CMake would + self.run(f"protoc --proto_path={self.source_folder} --cpp_out={self.build_folder} {self.source_folder}/addressbook.proto", env="conanrun") + assert os.path.exists(os.path.join(self.build_folder,"addressbook.pb.cc")) + assert os.path.exists(os.path.join(self.build_folder,"addressbook.pb.h")) diff --git a/protobuf/all/test_package/test_package.cpp b/protobuf/all/test_package/test_package.cpp new file mode 100644 index 0000000..61cb2bc --- /dev/null +++ b/protobuf/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include + +#include +#include + +int main() +{ + google::protobuf::Timestamp ts; + google::protobuf::util::TimeUtil::FromString("1972-01-01T10:00:20.021Z", &ts); + const auto nanoseconds = ts.nanos(); + + std::cout << "1972-01-01T10:00:20.021Z in nanoseconds: " << nanoseconds << "\n"; + return EXIT_SUCCESS; +} diff --git a/protobuf/config.yml b/protobuf/config.yml new file mode 100644 index 0000000..cb56719 --- /dev/null +++ b/protobuf/config.yml @@ -0,0 +1,9 @@ +versions: + "5.27.0": + folder: all + "4.25.3": + folder: all + "3.21.12": + folder: all + "3.20.3": + folder: all diff --git a/rapidxml/all/conandata.yml b/rapidxml/all/conandata.yml new file mode 100644 index 0000000..76068c7 --- /dev/null +++ b/rapidxml/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.13": + url: "https://sourceforge.net/projects/rapidxml/files/rapidxml/rapidxml%201.13/rapidxml-1.13.zip/download" + sha256: "c3f0b886374981bb20fabcf323d755db4be6dba42064599481da64a85f5b3571" +patches: + "1.13": + - patch_file: "patches/1.13-fix-template-compile-issue.patch" + patch_description: "Fix compilation issue: call to function 'print_declaration_node' that is neither visible in the template definition nor found by argument-dependent lookup" + patch_type: "portability" + patch_source: "https://sourceforge.net/p/rapidxml/bugs/16/" diff --git a/rapidxml/all/conanfile.py b/rapidxml/all/conanfile.py new file mode 100644 index 0000000..5a9da57 --- /dev/null +++ b/rapidxml/all/conanfile.py @@ -0,0 +1,44 @@ +from conan import ConanFile +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + + +class RapiXMLConan(ConanFile): + name = "rapidxml" + description = "RapidXml is an attempt to create the fastest XML parser possible." + license = ["BSL-1.0", "MIT"] + topics = ("rapidxml", "xml", "parser") + homepage = "http://rapidxml.sourceforge.net" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def layout(self): + basic_layout(self, src_folder="src") + + def export_sources(self): + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "license.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "rapidxml")) + + def package_info(self): + self.cpp_info.includedirs.append(os.path.join("include", "rapidxml")) + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/rapidxml/all/patches/1.13-fix-template-compile-issue.patch b/rapidxml/all/patches/1.13-fix-template-compile-issue.patch new file mode 100644 index 0000000..a9cede8 --- /dev/null +++ b/rapidxml/all/patches/1.13-fix-template-compile-issue.patch @@ -0,0 +1,36 @@ +--- rapidxml_print.hpp ++++ rapidxml_print.hpp +@@ -102,6 +102,33 @@ namespace rapidxml + /////////////////////////////////////////////////////////////////////////// + // Internal printing operations + ++ template ++ inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_attributes(OutIt out, const xml_node *node, int flags); ++ ++ template ++ inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent); ++ ++ template ++ inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent); ++ + // Print node + template + inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent) diff --git a/rapidxml/all/test_package/CMakeLists.txt b/rapidxml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..c90ae86 --- /dev/null +++ b/rapidxml/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(rapidxml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rapidxml::rapidxml) diff --git a/rapidxml/all/test_package/beer_journal.xml b/rapidxml/all/test_package/beer_journal.xml new file mode 100644 index 0000000..381ed0b --- /dev/null +++ b/rapidxml/all/test_package/beer_journal.xml @@ -0,0 +1,18 @@ + + + + + "What an excellent IPA. This is the most delicious beer I have ever tasted!" + + + + + This beer is not so good... but I am not that big of a fan of english style ales. + + + + + Another execllent brew. Two Hearted gives Founders Centennial a run for it's money. + + + diff --git a/rapidxml/all/test_package/conanfile.py b/rapidxml/all/test_package/conanfile.py new file mode 100644 index 0000000..bef433c --- /dev/null +++ b/rapidxml/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + xml_name = os.path.join(self.source_folder, "beer_journal.xml") + self.run(f"{bin_path} {xml_name}", env="conanrun") diff --git a/rapidxml/all/test_package/test_package.cpp b/rapidxml/all/test_package/test_package.cpp new file mode 100644 index 0000000..efdb15b --- /dev/null +++ b/rapidxml/all/test_package/test_package.cpp @@ -0,0 +1,49 @@ +#include +#include + +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + if (argc < 2) { + std::cerr << "Need at least one argument\n"; + return 1; + } + + std::cout << "Parsing my beer journal..." << std::endl; + rapidxml::xml_document<> doc; + rapidxml::xml_node<> * root_node; + // Read the xml file into a vector + std::ifstream theFile(argv[1]); + std::vector buffer((std::istreambuf_iterator(theFile)), std::istreambuf_iterator()); + buffer.push_back('\0'); + // Parse the buffer using the xml file parsing library into doc + doc.parse<0>(&buffer[0]); + // Find our root node + root_node = doc.first_node("MyBeerJournal"); + // Iterate over the brewerys + for (rapidxml::xml_node<> * brewery_node = root_node->first_node("Brewery"); brewery_node; brewery_node = brewery_node->next_sibling()) + { + printf("I have visited %s in %s. ", + brewery_node->first_attribute("name")->value(), + brewery_node->first_attribute("location")->value()); + // Interate over the beers + for(rapidxml::xml_node<> * beer_node = brewery_node->first_node("Beer"); beer_node; beer_node = beer_node->next_sibling()) + { + printf("On %s, I tried their %s which is a %s. ", + beer_node->first_attribute("dateSampled")->value(), + beer_node->first_attribute("name")->value(), + beer_node->first_attribute("description")->value()); + printf("I gave it the following review: %s", beer_node->value()); + } + std::cout << std::endl; + } + + std::cout << "Original xml document:" << std::endl; + std::cout << doc; + + return 0; +} diff --git a/rapidxml/all/test_v1_package/CMakeLists.txt b/rapidxml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..3eff1dc --- /dev/null +++ b/rapidxml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(rapidxml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rapidxml::rapidxml) diff --git a/rapidxml/all/test_v1_package/conanfile.py b/rapidxml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..af16690 --- /dev/null +++ b/rapidxml/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + xml_name = os.path.join(self.source_folder, os.pardir, "test_package", "beer_journal.xml") + self.run(f"{bin_path} {xml_name}", run_environment=True) diff --git a/rapidxml/config.yml b/rapidxml/config.yml new file mode 100644 index 0000000..48dc233 --- /dev/null +++ b/rapidxml/config.yml @@ -0,0 +1,3 @@ +versions: + "1.13": + folder: all diff --git a/re2/all/conandata.yml b/re2/all/conandata.yml new file mode 100644 index 0000000..718ca94 --- /dev/null +++ b/re2/all/conandata.yml @@ -0,0 +1,43 @@ +sources: + "20240702": + url: "https://github.com/google/re2/releases/download/2024-07-02/re2-2024-07-02.tar.gz" + sha256: "eb2df807c781601c14a260a507a5bb4509be1ee626024cb45acbd57cb9d4032b" + "20240301": + url: "https://github.com/google/re2/releases/download/2024-03-01/re2-2024-03-01.tar.gz" + sha256: "7b2b3aa8241eac25f674e5b5b2e23d4ac4f0a8891418a2661869f736f03f57f4" + "20231101": + url: "https://github.com/google/re2/releases/download/2023-11-01/re2-2023-11-01.tar.gz" + sha256: "4e6593ac3c71de1c0f322735bc8b0492a72f66ffccfad76e259fa21c41d27d8a" + "20230901": + url: "https://github.com/google/re2/releases/download/2023-09-01/re2-2023-09-01.tar.gz" + sha256: "5bb6875ae1cd1e9fedde98018c346db7260655f86fdb8837e3075103acd3649b" + "20230801": + url: "https://github.com/google/re2/releases/download/2023-08-01/re2-2023-08-01.tar.gz" + sha256: "d82d0efe2389949244445e7a6ac9a10fccc3d6a3d267ec4652991a51291647b0" + "20230701": + url: "https://github.com/google/re2/releases/download/2023-07-01/re2-2023-07-01.tar.gz" + sha256: "18cf85922e27fad3ed9c96a27733037da445f35eb1a2744c306a37c6d11e95c4" + "20230602": + url: "https://github.com/google/re2/releases/download/2023-06-02/re2-2023-06-02.tar.gz" + sha256: "4ccdd5aafaa1bcc24181e6dd3581c3eee0354734bb9f3cb4306273ffa434b94f" + "20230301": + url: "https://github.com/google/re2/archive/refs/tags/2023-03-01.tar.gz" + sha256: "7a9a4824958586980926a300b4717202485c4b4115ac031822e29aa4ef207e48" + "20230201": + url: "https://github.com/google/re2/archive/refs/tags/2023-02-01.tar.gz" + sha256: "cbce8b7803e856827201a132862e41af386e7afd9cc6d9a9bc7a4fa4d8ddbdde" + "20221201": + url: "https://github.com/google/re2/archive/refs/tags/2022-12-01.tar.gz" + sha256: "665b65b6668156db2b46dddd33405cd422bd611352c5052ab3dae6a5fbac5506" + "20220601": + url: "https://github.com/google/re2/archive/refs/tags/2022-06-01.tar.gz" + sha256: "f89c61410a072e5cbcf8c27e3a778da7d6fd2f2b5b1445cd4f4508bee946ab0f" + "20220201": + url: "https://github.com/google/re2/archive/refs/tags/2022-02-01.tar.gz" + sha256: "9c1e6acfd0fed71f40b025a7a1dabaf3ee2ebb74d64ced1f9ee1b0b01d22fd27" + "20211101": + url: "https://github.com/google/re2/archive/refs/tags/2021-11-01.tar.gz" + sha256: "8c45f7fba029ab41f2a7e6545058d9eec94eef97ce70df58e92d85cfc08b4669" + "20210901": + url: "https://github.com/google/re2/archive/refs/tags/2021-09-01.tar.gz" + sha256: "42a2e1d56b5de252f5d418dc1cc0848e9e52ca22b056453988b18c6195ec7f8d" diff --git a/re2/all/conanfile.py b/re2/all/conanfile.py new file mode 100644 index 0000000..caa9278 --- /dev/null +++ b/re2/all/conanfile.py @@ -0,0 +1,106 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + +class Re2Conan(ConanFile): + name = "re2" + description = "Fast, safe, thread-friendly regular expression library" + topics = ("regex",) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/re2" + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_icu": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_icu": False, + } + + @property + def _min_cppstd(self): + return 14 if Version(self.version) >= "20230601" else 11 + + @property + def _compilers_minimum_version(self): + return { + "14": { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "20230201": + del self.options.with_icu + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("with_icu"): + self.requires("icu/73.2") + if Version(self.version) >= "20230601": + self.requires("abseil/20240116.1", transitive_headers=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["RE2_BUILD_TESTING"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "re2") + self.cpp_info.set_property("cmake_target_name", "re2::re2") + self.cpp_info.set_property("pkg_config_name", "re2") + self.cpp_info.libs = ["re2"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] diff --git a/re2/all/test_package/CMakeLists.txt b/re2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..f2cb637 --- /dev/null +++ b/re2/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(re2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE re2::re2) +if (re2_VERSION VERSION_GREATER_EQUAL "20230602") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/re2/all/test_package/conanfile.py b/re2/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/re2/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/re2/all/test_package/test_package.cpp b/re2/all/test_package/test_package.cpp new file mode 100644 index 0000000..199c668 --- /dev/null +++ b/re2/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include +#include + +int main() { + assert(RE2::FullMatch("hello", "h.*o")); + assert(!RE2::FullMatch("hello", "e")); + return 0; +} diff --git a/re2/all/test_v1_package/CMakeLists.txt b/re2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/re2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/re2/all/test_v1_package/conanfile.py b/re2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/re2/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/re2/config.yml b/re2/config.yml new file mode 100644 index 0000000..bfce54f --- /dev/null +++ b/re2/config.yml @@ -0,0 +1,29 @@ +versions: + "20240702": + folder: all + "20240301": + folder: all + "20231101": + folder: all + "20230901": + folder: all + "20230801": + folder: all + "20230701": + folder: all + "20230602": + folder: all + "20230301": + folder: all + "20230201": + folder: all + "20221201": + folder: all + "20220601": + folder: all + "20220201": + folder: all + "20211101": + folder: all + "20210901": + folder: all diff --git a/roaring/all/conandata.yml b/roaring/all/conandata.yml new file mode 100644 index 0000000..610e256 --- /dev/null +++ b/roaring/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "4.1.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.1.0.tar.gz" + sha256: "0596c6e22bcccb56f38260142b435f1f72aef7721fa370fd9f2b88380245fc1d" + "4.0.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.0.0.tar.gz" + sha256: "a8b98db3800cd10979561a1388e4e970886a24015bd6cfabb08ba7917f541b0d" + "3.0.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v3.0.0.tar.gz" + sha256: "25183bc54ab650d964256d547869a34573a13d06f7e6a369b79e77f5c1feb8ba" + "2.1.2": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v2.1.2.tar.gz" + sha256: "a53d2f540f78ddae31e30c573b1b7fd41d7257d6a090507ba35d9c398712e5ad" + "2.0.4": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v2.0.4.tar.gz" + sha256: "3c962c196ba28abf2639067f2e2fd25879744ba98152a4e0e74556ca515eda33" + "1.3.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.3.0.tar.gz" + sha256: "c4fccf6a8cfa6f15f47d0e6f6b202940c2305e3078eb745d25fe9e2739ae5278" + "1.1.5": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.1.5.tar.gz" + sha256: "5210a277ce83c3099dfee41d494c28aec61bdbc9160b3b124cb5afeab49cd123" + "1.0.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.0.0.tar.gz" + sha256: "08f884cd2790fcfba69b63443442034702f5d4865514fb09ac6ff05e048bf230" diff --git a/roaring/all/conanfile.py b/roaring/all/conanfile.py new file mode 100644 index 0000000..f0d5174 --- /dev/null +++ b/roaring/all/conanfile.py @@ -0,0 +1,102 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class RoaringConan(ConanFile): + name = "roaring" + description = "Portable Roaring bitmaps in C and C++" + license = ("Apache-2.0", "MIT") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/RoaringBitmap/CRoaring" + topics = ("bitset", "compression", "index", "format") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_avx": [True, False], + "with_avx512": [True, False], + "with_neon": [True, False], + "native_optimization": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_avx": True, + "with_avx512": True, + "with_neon": True, + "native_optimization": False, + } + + @property + def _min_cppstd(self): + return 11 + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.arch not in ("x86", "x86_64"): + del self.options.with_avx + del self.options.with_avx512 + elif Version(self.version) < "1.1.0": + del self.options.with_avx512 + if not str(self.settings.arch).startswith("arm"): + del self.options.with_neon + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "11": + raise ConanInvalidConfiguration( + f"{self.ref} requires at least apple-clang 11 to support runtime dispatching.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ROARING_DISABLE_AVX"] = not self.options.get_safe("with_avx", False) + if "with_avx512" in self.options: + tc.variables["ROARING_DISABLE_AVX512"] = not self.options.with_avx512 + tc.variables["ROARING_DISABLE_NEON"] = not self.options.get_safe("with_neon", False) + tc.variables["ROARING_DISABLE_NATIVE"] = not self.options.native_optimization + tc.variables["ROARING_BUILD_STATIC"] = not self.options.shared + tc.variables["ENABLE_ROARING_TESTS"] = False + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + def build(self): + if Version(self.version) < "2.0.0": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set(CMAKE_MACOSX_RPATH OFF)", "") + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "roaring") + self.cpp_info.set_property("cmake_target_name", "roaring::roaring") + self.cpp_info.set_property("pkg_config_name", "roaring") + self.cpp_info.libs = ["roaring"] diff --git a/roaring/all/test_package/CMakeLists.txt b/roaring/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..6e9e7fa --- /dev/null +++ b/roaring/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(roaring REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE roaring::roaring) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/roaring/all/test_package/conanfile.py b/roaring/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/roaring/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/roaring/all/test_package/test_package.cpp b/roaring/all/test_package/test_package.cpp new file mode 100644 index 0000000..1816972 --- /dev/null +++ b/roaring/all/test_package/test_package.cpp @@ -0,0 +1,196 @@ +#include +#include +#include + +#include "roaring/roaring.hh" +#include "roaring/roaring.h" + +using namespace roaring; + +void test_example_cpp(bool copy_on_write) { + // create a new empty bitmap + Roaring r1; + r1.setCopyOnWrite(copy_on_write); + // then we can add values + for (uint32_t i = 100; i < 1000; i++) { + r1.add(i); + } + + // check whether a value is contained + assert(r1.contains(500)); + + // compute how many bits there are: + uint64_t cardinality = r1.cardinality(); + std::cout << "Cardinality = " << cardinality << std::endl; + + // if your bitmaps have long runs, you can compress them by calling + // run_optimize + size_t size = r1.getSizeInBytes(); + r1.runOptimize(); + size_t compact_size = r1.getSizeInBytes(); + + std::cout << "size before run optimize " << size << " bytes, and after " + << compact_size << " bytes." << std::endl; + + // create a new bitmap with varargs + Roaring r2 = Roaring::bitmapOf(5, 1, 2, 3, 5, 6); + + r2.printf(); + printf("\n"); + + // test select + uint32_t element; + r2.select(3, &element); + assert(element == 5); + + assert(r2.minimum() == 1); + + assert(r2.maximum() == 6); + + assert(r2.rank(4) == 3); + + // we can also create a bitmap from a pointer to 32-bit integers + const uint32_t values[] = {2, 3, 4}; + Roaring r3(3, values); + r3.setCopyOnWrite(copy_on_write); + + // we can also go in reverse and go from arrays to bitmaps + uint64_t card1 = r1.cardinality(); + uint32_t *arr1 = new uint32_t[card1]; + assert(arr1 != NULL); + r1.toUint32Array(arr1); + Roaring r1f(card1, arr1); + delete[] arr1; + + // bitmaps shall be equal + assert(r1 == r1f); + + // we can copy and compare bitmaps + Roaring z(r3); + z.setCopyOnWrite(copy_on_write); + assert(r3 == z); + + // we can compute union two-by-two + Roaring r1_2_3 = r1 | r2; + r1_2_3.setCopyOnWrite(copy_on_write); + r1_2_3 |= r3; + + // we can compute a big union + const Roaring *allmybitmaps[] = {&r1, &r2, &r3}; + Roaring bigunion = Roaring::fastunion(3, allmybitmaps); + assert(r1_2_3 == bigunion); + + // we can compute intersection two-by-two + Roaring i1_2 = r1 & r2; + + // we can write a bitmap to a pointer and recover it later + size_t expectedsize = r1.getSizeInBytes(); + char *serializedbytes = new char[expectedsize]; + r1.write(serializedbytes); + Roaring t = Roaring::read(serializedbytes); + assert(expectedsize == t.getSizeInBytes()); + assert(r1 == t); + + Roaring t2 = Roaring::readSafe(serializedbytes, expectedsize); + assert(expectedsize == t2.getSizeInBytes()); + assert(r1 == t2); + + delete[] serializedbytes; + + size_t counter = 0; + for (Roaring::const_iterator i = t.begin(); i != t.end(); i++) { + ++counter; + } + assert(counter == t.cardinality()); + + // we can move iterators + const uint32_t manyvalues[] = {2, 3, 4, 7, 8}; + Roaring rogue(5, manyvalues); + Roaring::const_iterator j = rogue.begin(); + j.equalorlarger(4); + assert(*j == 4); + + // test move constructor + { + Roaring b; + b.add(10); + b.add(20); + + Roaring a(std::move(b)); + assert(a.cardinality() == 2); + assert(a.contains(10)); + assert(a.contains(20)); + + // b should be destroyed without any errors + assert(b.cardinality() == 0); + } + + // test move operator + { + Roaring b; + b.add(10); + b.add(20); + + Roaring a; + + a = std::move(b); + assert(2 == a.cardinality()); + assert(a.contains(10)); + assert(a.contains(20)); + + // b should be destroyed without any errors + assert(0 == b.cardinality()); + } + + // test toString + { + Roaring a; + a.add(1); + a.add(2); + a.add(3); + a.add(4); + + } +} + +int main() { + Roaring r1; + // then we can add values + for (uint32_t i = 100; i < 1000; i++) { + r1.add(i); + } + + // check whether a value is contained + assert(r1.contains(500)); + + // compute how many bits there are: + uint64_t cardinality = r1.cardinality(); + std::cout << "Cardinality = " << cardinality << std::endl; + + // if your bitmaps have long runs, you can compress them by calling + // run_optimize + size_t size = r1.getSizeInBytes(); + r1.runOptimize(); + size_t compact_size = r1.getSizeInBytes(); + + std::cout << "size before run optimize " << size << " bytes, and after " + << compact_size << " bytes." << std::endl; + + // create a new bitmap with varargs + Roaring r2 = Roaring::bitmapOf(5, 1, 2, 3, 5, 6); + + r2.printf(); + printf("\n"); + + // test select + uint32_t element; + r2.select(3, &element); + assert(element == 5); + + assert(r2.minimum() == 1); + + assert(r2.maximum() == 6); + + assert(r2.rank(4) == 3); + return EXIT_SUCCESS; +} diff --git a/roaring/all/test_v1_package/CMakeLists.txt b/roaring/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/roaring/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/roaring/all/test_v1_package/conanfile.py b/roaring/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..1d4478b --- /dev/null +++ b/roaring/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type", + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/roaring/config.yml b/roaring/config.yml new file mode 100644 index 0000000..4c7b26e --- /dev/null +++ b/roaring/config.yml @@ -0,0 +1,17 @@ +versions: + "4.1.0": + folder: all + "4.0.0": + folder: all + "3.0.0": + folder: all + "2.1.2": + folder: all + "2.0.4": + folder: all + "1.3.0": + folder: all + "1.1.5": + folder: all + "1.0.0": + folder: all diff --git a/rocksdb/all/CMakeLists.txt b/rocksdb/all/CMakeLists.txt deleted file mode 100644 index f287ed2..0000000 --- a/rocksdb/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/rocksdb/all/conandata.yml b/rocksdb/all/conandata.yml index 2e0d65d..ed28eb0 100644 --- a/rocksdb/all/conandata.yml +++ b/rocksdb/all/conandata.yml @@ -1,38 +1,36 @@ sources: + "9.4.0": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v9.4.0.tar.gz" + sha256: "1f829976aa24b8ba432e156f52c9e0f0bd89c46dc0cc5a9a628ea70571c1551c" + "9.2.1": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v9.2.1.tar.gz" + sha256: "bb20fd9a07624e0dc1849a8e65833e5421960184f9c469d508b58ed8f40a780f" + "9.1.0": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v9.1.0.tar.gz" + sha256: "3c225e45bf6f6367cf5a4413f71abc4a3427627790e6d58c57adc2daa4b6309d" + "9.0.0": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v9.0.0.tar.gz" + sha256: "013aac178aa12837cbfa3b1e20e9e91ff87962ab7fdd044fd820e859f8964f9b" + "8.8.1": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v8.8.1.tar.gz" + sha256: "056c7e21ad8ae36b026ac3b94b9d6e0fcc60e1d937fc80330921e4181be5c36e" "6.29.5": - url: "https://github.com/facebook/rocksdb/archive/v6.29.5.tar.gz" + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v6.29.5.tar.gz" sha256: "ddbf84791f0980c0bbce3902feb93a2c7006f6f53bfd798926143e31d4d756f0" "6.27.3": - url: "https://github.com/facebook/rocksdb/archive/v6.27.3.tar.gz" + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v6.27.3.tar.gz" sha256: "ee29901749b9132692b26f0a6c1d693f47d1a9ed8e3771e60556afe80282bf58" "6.20.3": - url: "https://github.com/facebook/rocksdb/archive/v6.20.3.tar.gz" + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v6.20.3.tar.gz" sha256: "c6502c7aae641b7e20fafa6c2b92273d935d2b7b2707135ebd9a67b092169dca" - "6.10.2": - url: "https://github.com/facebook/rocksdb/archive/v6.10.2.tar.gz" - sha256: "514b315c64159dd767bbbf6430d33313903c0c9240d4249bddead5c4297d128f" - "6.8.1": - url: "https://github.com/facebook/rocksdb/archive/v6.8.1.tar.gz" - sha256: "ca192a06ed3bcb9f09060add7e9d0daee1ae7a8705a3d5ecbe41867c5e2796a2" - "6.0.2": - url: "https://github.com/facebook/rocksdb/archive/v6.0.2.tar.gz" - sha256: "89e0832f1fb00ac240a9438d4bbdae37dd3e52f7c15c3f646dc26887da16f342" patches: "6.29.5": - - patch_file: "patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch" - base_path: "source_subfolder" + - patch_file: "patches/6.29.5-0001-add-include-cstdint-for-gcc-13.patch" + patch_description: "Fix build with gcc 13 by including cstdint" + patch_type: "portability" + patch_source: "https://github.com/facebook/rocksdb/pull/11118" "6.27.3": - - patch_file: "patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch" - base_path: "source_subfolder" - "6.20.3": - - patch_file: "patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch" - base_path: "source_subfolder" - "6.10.2": - - patch_file: "patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch" - base_path: "source_subfolder" - "6.8.1": - - patch_file: "patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch" - base_path: "source_subfolder" - "6.0.2": - - patch_file: "patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch" - base_path: "source_subfolder" + - patch_file: "patches/6.27.3-0001-add-include-cstdint-for-gcc-13.patch" + patch_description: "Fix build with gcc 13 by including cstdint" + patch_type: "portability" + patch_source: "https://github.com/facebook/rocksdb/pull/11118" diff --git a/rocksdb/all/conanfile.py b/rocksdb/all/conanfile.py index b10e35f..605a6ad 100644 --- a/rocksdb/all/conanfile.py +++ b/rocksdb/all/conanfile.py @@ -1,22 +1,27 @@ -from conan.tools.microsoft import msvc_runtime_flag -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os import glob import shutil -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +required_conan_version = ">=1.53.0" -class RocksDB(ConanFile): + +class RocksDBConan(ConanFile): name = "rocksdb" - homepage = "https://github.com/facebook/rocksdb" + description = "A library that provides an embeddable, persistent key-value store for fast storage" license = ("GPL-2.0-only", "Apache-2.0") url = "https://github.com/conan-io/conan-center-index" - description = "A library that provides an embeddable, persistent key-value store for fast storage" - topics = ("rocksdb", "database", "leveldb", "facebook", "key-value") - - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/facebook/rocksdb" + topics = ("database", "leveldb", "facebook", "key-value") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -46,25 +51,22 @@ class RocksDB(ConanFile): "use_rtti": False, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return "11" if Version(self.version) < "8.8.1" else "17" @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] + def _compilers_minimum_version(self): + return {} if self._min_cppstd == "11" else { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -76,115 +78,106 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_gflags: self.requires("gflags/2.2.2") if self.options.with_snappy: - self.requires("snappy/1.1.9") + self.requires("snappy/1.1.10") if self.options.with_lz4: - self.requires("lz4/1.9.3") + self.requires("lz4/1.9.4") if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: - self.requires("zstd/1.5.2") + self.requires("zstd/1.5.5") if self.options.get_safe("with_tbb"): - self.requires("onetbb/2020.3") + self.requires("onetbb/2021.10.0") if self.options.with_jemalloc: - self.requires("jemalloc/5.2.1") + self.requires("jemalloc/5.3.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) - if self.settings.arch not in ["x86_64", "ppc64le", "ppc64", "mips64", "armv8"]: - raise ConanInvalidConfiguration("Rocksdb requires 64 bits") + check_min_cppstd(self, self._min_cppstd) - if self.settings.os == "Windows" and \ - self.settings.compiler == "Visual Studio" and \ - tools.Version(self.settings.compiler.version) < "15": - raise ConanInvalidConfiguration("Rocksdb requires Visual Studio 15 or later.") + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) - if self.version == "6.0.2" and \ - self.settings.os == "Windows" and \ - self.settings.compiler == "Visual Studio" and \ - tools.Version(self.settings.compiler.version) > "15": - raise ConanInvalidConfiguration("Rocksdb 6.0.2 is not compilable with Visual Studio >15.") # See https://github.com/facebook/rocksdb/issues/6048 + if self.settings.arch not in ["x86_64", "ppc64le", "ppc64", "mips64", "armv8"]: + raise ConanInvalidConfiguration("Rocksdb requires 64 bits") - if self.version == "6.0.2" and \ - self.settings.os == "Linux" and \ - self.settings.compiler == "clang" and \ - tools.Version(self.settings.compiler.version) > "9": - raise ConanInvalidConfiguration("Rocksdb 6.0.2 is not compilable with clang >9.") # See https://github.com/facebook/rocksdb/pull/7265 + check_min_vs(self, "191") if self.version == "6.20.3" and \ self.settings.os == "Linux" and \ self.settings.compiler == "gcc" and \ - tools.Version(self.settings.compiler.version) < "5": + Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration("Rocksdb 6.20.3 is not compilable with gcc <5.") # See https://github.com/facebook/rocksdb/issues/3522 def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - - self._cmake.definitions["FAIL_ON_WARNINGS"] = False - self._cmake.definitions["WITH_TESTS"] = False - self._cmake.definitions["WITH_TOOLS"] = False - self._cmake.definitions["WITH_CORE_TOOLS"] = False - self._cmake.definitions["WITH_BENCHMARK_TOOLS"] = False - self._cmake.definitions["WITH_FOLLY_DISTRIBUTED_MUTEX"] = False - if self._is_msvc: - self._cmake.definitions["WITH_MD_LIBRARY"] = "MD" in msvc_runtime_flag(self) - self._cmake.definitions["ROCKSDB_INSTALL_ON_WINDOWS"] = self.settings.os == "Windows" - self._cmake.definitions["ROCKSDB_LITE"] = self.options.lite - self._cmake.definitions["WITH_GFLAGS"] = self.options.with_gflags - self._cmake.definitions["WITH_SNAPPY"] = self.options.with_snappy - self._cmake.definitions["WITH_LZ4"] = self.options.with_lz4 - self._cmake.definitions["WITH_ZLIB"] = self.options.with_zlib - self._cmake.definitions["WITH_ZSTD"] = self.options.with_zstd - self._cmake.definitions["WITH_TBB"] = self.options.get_safe("with_tbb", False) - self._cmake.definitions["WITH_JEMALLOC"] = self.options.with_jemalloc - self._cmake.definitions["ROCKSDB_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["ROCKSDB_LIBRARY_EXPORTS"] = self.settings.os == "Windows" and self.options.shared - self._cmake.definitions["ROCKSDB_DLL" ] = self.settings.os == "Windows" and self.options.shared - - self._cmake.definitions["USE_RTTI"] = self.options.use_rtti - if self.options.enable_sse == "False": - self._cmake.definitions["PORTABLE"] = True - self._cmake.definitions["FORCE_SSE42"] = False + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FAIL_ON_WARNINGS"] = False + tc.variables["WITH_TESTS"] = False + tc.variables["WITH_TOOLS"] = False + tc.variables["WITH_CORE_TOOLS"] = False + tc.variables["WITH_BENCHMARK_TOOLS"] = False + tc.variables["WITH_FOLLY_DISTRIBUTED_MUTEX"] = False + if is_msvc(self): + tc.variables["WITH_MD_LIBRARY"] = not is_msvc_static_runtime(self) + tc.variables["ROCKSDB_INSTALL_ON_WINDOWS"] = self.settings.os == "Windows" + tc.variables["ROCKSDB_LITE"] = self.options.lite + tc.variables["WITH_GFLAGS"] = self.options.with_gflags + tc.variables["WITH_SNAPPY"] = self.options.with_snappy + tc.variables["WITH_LZ4"] = self.options.with_lz4 + tc.variables["WITH_ZLIB"] = self.options.with_zlib + tc.variables["WITH_ZSTD"] = self.options.with_zstd + tc.variables["WITH_TBB"] = self.options.get_safe("with_tbb", False) + tc.variables["WITH_JEMALLOC"] = self.options.with_jemalloc + tc.variables["ROCKSDB_BUILD_SHARED"] = self.options.shared + tc.variables["ROCKSDB_LIBRARY_EXPORTS"] = self.settings.os == "Windows" and self.options.shared + tc.variables["ROCKSDB_DLL" ] = self.settings.os == "Windows" and self.options.shared + tc.variables["USE_RTTI"] = self.options.use_rtti + if not bool(self.options.enable_sse): + tc.variables["PORTABLE"] = True + tc.variables["FORCE_SSE42"] = False elif self.options.enable_sse == "sse42": - self._cmake.definitions["PORTABLE"] = True - self._cmake.definitions["FORCE_SSE42"] = True + tc.variables["PORTABLE"] = True + tc.variables["FORCE_SSE42"] = True elif self.options.enable_sse == "avx2": - self._cmake.definitions["PORTABLE"] = False - self._cmake.definitions["FORCE_SSE42"] = False - + tc.variables["PORTABLE"] = False + tc.variables["FORCE_SSE42"] = False # not available yet in CCI + tc.variables["WITH_NUMA"] = False + tc.generate() - self._cmake.definitions["WITH_NUMA"] = False - - if self.settings.os == "Macos" and self.settings.arch == "armv8": - self._cmake.definitions["CMAKE_CXX_FLAGS"] = "-march=armv8-a" - - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + deps = CMakeDeps(self) + if self.options.with_jemalloc: + deps.set_property("jemalloc", "cmake_file_name", "JeMalloc") + deps.set_property("jemalloc", "cmake_target_name", "JeMalloc::JeMalloc") + if self.options.with_zstd: + deps.set_property("zstd", "cmake_target_name", "zstd::zstd") + deps.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def _remove_static_libraries(self): - for static_lib_name in ["lib*.a", "rocksdb.lib"]: - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), static_lib_name) + rm(self, "rocksdb.lib", os.path.join(self.package_folder, "lib")) + for lib in glob.glob(os.path.join(self.package_folder, "lib", "*.a")): + if not lib.endswith(".dll.a"): + os.remove(lib) def _remove_cpp_headers(self): for path in glob.glob(os.path.join(self.package_folder, "include", "rocksdb", "*")): @@ -195,21 +188,22 @@ def _remove_cpp_headers(self): shutil.rmtree(path) def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() if self.options.shared: self._remove_static_libraries() self._remove_cpp_headers() # Force stable ABI for shared libraries - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): cmake_target = "rocksdb-shared" if self.options.shared else "rocksdb" self.cpp_info.set_property("cmake_file_name", "RocksDB") - self.cpp_info.set_property("cmake_target_name", "RocksDB::{}".format(cmake_target)) + self.cpp_info.set_property("cmake_target_name", f"RocksDB::{cmake_target}") # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["librocksdb"].libs = tools.collect_libs(self) + self.cpp_info.components["librocksdb"].libs = collect_libs(self) if self.settings.os == "Windows": self.cpp_info.components["librocksdb"].system_libs = ["shlwapi", "rpcrt4"] if self.options.shared: @@ -224,7 +218,7 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "RocksDB" self.cpp_info.components["librocksdb"].names["cmake_find_package"] = cmake_target self.cpp_info.components["librocksdb"].names["cmake_find_package_multi"] = cmake_target - self.cpp_info.components["librocksdb"].set_property("cmake_target_name", "RocksDB::{}".format(cmake_target)) + self.cpp_info.components["librocksdb"].set_property("cmake_target_name", f"RocksDB::{cmake_target}") if self.options.with_gflags: self.cpp_info.components["librocksdb"].requires.append("gflags::gflags") if self.options.with_snappy: diff --git a/rocksdb/all/patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch b/rocksdb/all/patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch deleted file mode 100644 index fa3904b..0000000 --- a/rocksdb/all/patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -66,5 +66,5 @@ else() - set(WITH_JEMALLOC ON) - else() - if(WITH_JEMALLOC) -- find_package(JeMalloc REQUIRED) -+ find_package(jemalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) diff --git a/rocksdb/all/patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch b/rocksdb/all/patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch deleted file mode 100644 index 2e8cfd1..0000000 --- a/rocksdb/all/patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -101,9 +101,9 @@ else() - set(WITH_JEMALLOC ON) - else() - if(WITH_JEMALLOC) -- find_package(JeMalloc REQUIRED) -+ find_package(jemalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) -- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) -+ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) - endif() - endif() - diff --git a/rocksdb/all/patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch b/rocksdb/all/patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch deleted file mode 100644 index 9919590..0000000 --- a/rocksdb/all/patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -100,9 +100,9 @@ else() - set(WITH_JEMALLOC ON) - else() - if(WITH_JEMALLOC) -- find_package(JeMalloc REQUIRED) -+ find_package(jemalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) -- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) -+ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) - endif() - endif() - diff --git a/rocksdb/all/patches/6.27.3-0001-add-include-cstdint-for-gcc-13.patch b/rocksdb/all/patches/6.27.3-0001-add-include-cstdint-for-gcc-13.patch new file mode 100644 index 0000000..bd7cc04 --- /dev/null +++ b/rocksdb/all/patches/6.27.3-0001-add-include-cstdint-for-gcc-13.patch @@ -0,0 +1,30 @@ +--- include/rocksdb/utilities/checkpoint.h ++++ include/rocksdb/utilities/checkpoint.h +@@ -8,6 +8,7 @@ + #pragma once + #ifndef ROCKSDB_LITE + ++#include + #include + #include + #include "rocksdb/status.h" +--- table/block_based/data_block_hash_index.h ++++ table/block_based/data_block_hash_index.h +@@ -5,6 +5,7 @@ + + #pragma once + ++#include + #include + #include + +--- util/string_util.h ++++ util/string_util.h +@@ -6,6 +6,7 @@ + + #pragma once + ++#include + #include + #include + #include diff --git a/rocksdb/all/patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch b/rocksdb/all/patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch deleted file mode 100644 index 862805a..0000000 --- a/rocksdb/all/patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -108,9 +108,9 @@ else() - set(WITH_JEMALLOC ON) - else() - if(WITH_JEMALLOC) -- find_package(JeMalloc REQUIRED) -+ find_package(jemalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) -- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) -+ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) - endif() - endif() - diff --git a/rocksdb/all/patches/6.29.5-0001-add-include-cstdint-for-gcc-13.patch b/rocksdb/all/patches/6.29.5-0001-add-include-cstdint-for-gcc-13.patch new file mode 100644 index 0000000..05725bf --- /dev/null +++ b/rocksdb/all/patches/6.29.5-0001-add-include-cstdint-for-gcc-13.patch @@ -0,0 +1,30 @@ +--- a/include/rocksdb/utilities/checkpoint.h ++++ b/include/rocksdb/utilities/checkpoint.h +@@ -8,6 +8,7 @@ + #pragma once + #ifndef ROCKSDB_LITE + ++#include + #include + #include + #include "rocksdb/status.h" +--- a/table/block_based/data_block_hash_index.h ++++ b/table/block_based/data_block_hash_index.h +@@ -5,6 +5,7 @@ + + #pragma once + ++#include + #include + #include + +--- a/util/string_util.h ++++ b/util/string_util.h +@@ -6,6 +6,7 @@ + + #pragma once + ++#include + #include + #include + #include diff --git a/rocksdb/all/patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch b/rocksdb/all/patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch deleted file mode 100644 index 862805a..0000000 --- a/rocksdb/all/patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -108,9 +108,9 @@ else() - set(WITH_JEMALLOC ON) - else() - if(WITH_JEMALLOC) -- find_package(JeMalloc REQUIRED) -+ find_package(jemalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) -- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) -+ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) - endif() - endif() - diff --git a/rocksdb/all/patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch b/rocksdb/all/patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch deleted file mode 100644 index acaacf5..0000000 --- a/rocksdb/all/patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -97,9 +97,9 @@ else() - set(WITH_JEMALLOC ON) - else() - if(WITH_JEMALLOC) -- find_package(JeMalloc REQUIRED) -+ find_package(jemalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) -- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) -+ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) - endif() - endif() - diff --git a/rocksdb/all/test_package/CMakeLists.txt b/rocksdb/all/test_package/CMakeLists.txt index cab2ad0..b23ea40 100644 --- a/rocksdb/all/test_package/CMakeLists.txt +++ b/rocksdb/all/test_package/CMakeLists.txt @@ -1,18 +1,23 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +enable_testing() find_package(RocksDB REQUIRED CONFIG) add_executable(${PROJECT_NAME}_stable_abi test_package_stable_abi.cpp) +add_test(NAME ${PROJECT_NAME}_stable_abi COMMAND ${PROJECT_NAME}_stable_abi) if(ROCKSDB_SHARED) - target_link_libraries(${PROJECT_NAME}_stable_abi RocksDB::rocksdb-shared) + target_link_libraries(${PROJECT_NAME}_stable_abi PRIVATE RocksDB::rocksdb-shared) else() - target_link_libraries(${PROJECT_NAME}_stable_abi RocksDB::rocksdb) + target_link_libraries(${PROJECT_NAME}_stable_abi PRIVATE RocksDB::rocksdb) - add_executable(${PROJECT_NAME}_cpp test_package.cpp) - target_link_libraries(${PROJECT_NAME}_cpp RocksDB::rocksdb) - set_property(TARGET ${PROJECT_NAME}_cpp PROPERTY CXX_STANDARD 11) + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE RocksDB::rocksdb) + if(RocksDB_VERSION VERSION_LESS "8.8.1") + target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_11) + else() + target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_17) + endif() + add_test(NAME ${PROJECT_NAME}_cpp COMMAND ${PROJECT_NAME}_cpp) endif() diff --git a/rocksdb/all/test_package/conanfile.py b/rocksdb/all/test_package/conanfile.py index 326ef69..06b097c 100644 --- a/rocksdb/all/test_package/conanfile.py +++ b/rocksdb/all/test_package/conanfile.py @@ -1,22 +1,29 @@ -from conans import ConanFile, CMake, tools -import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ROCKSDB_SHARED"] = self.dependencies["rocksdb"].options.shared + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["ROCKSDB_SHARED"] = self.options["rocksdb"].shared cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self): - if not self.options["rocksdb"].shared: - bin_path = os.path.join("bin", "test_package_cpp") - self.run(bin_path, run_environment=True) - - bin_path = os.path.join("bin", "test_package_stable_abi") - self.run(bin_path, run_environment=True) + if can_run(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", env="conanrun") diff --git a/rocksdb/all/test_v1_package/CMakeLists.txt b/rocksdb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..c23ed5c --- /dev/null +++ b/rocksdb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_v1_package) + +enable_testing() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/rocksdb/all/test_v1_package/conanfile.py b/rocksdb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..5fc2cee --- /dev/null +++ b/rocksdb/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["ROCKSDB_SHARED"] = self.options["rocksdb"].shared + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", run_environment=True) diff --git a/rocksdb/config.yml b/rocksdb/config.yml index 51a8046..a2441c8 100644 --- a/rocksdb/config.yml +++ b/rocksdb/config.yml @@ -1,13 +1,17 @@ versions: - "6.29.5": + "9.4.0": folder: all - "6.27.3": + "9.2.1": folder: all - "6.20.3": + "9.1.0": + folder: all + "9.0.0": folder: all - "6.10.2": + "8.8.1": folder: all - "6.8.1": + "6.29.5": + folder: all + "6.27.3": folder: all - "6.0.2": + "6.20.3": folder: all diff --git a/s2n/all/CMakeLists.txt b/s2n/all/CMakeLists.txt index 881539f..c7d1ca7 100644 --- a/s2n/all/CMakeLists.txt +++ b/s2n/all/CMakeLists.txt @@ -1,13 +1,11 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper LANGUAGES C) -include(conanbuildinfo.cmake) -conan_basic_setup() - -find_package(OpenSSL REQUIRED COMPONENTS Crypto) +# We want to discover OpenSSL through CMakeDeps and use OpenSSL::Crypto target for linking +# https://github.com/aws/s2n-tls/blob/v1.3.31/CMakeLists.txt#L27-L28 +# https://github.com/aws/s2n-tls/blob/v1.3.31/CMakeLists.txt#L379-L381 +find_package(OpenSSL REQUIRED) add_library(crypto INTERFACE IMPORTED) set_target_properties(crypto PROPERTIES INTERFACE_LINK_LIBRARIES "OpenSSL::Crypto") -set(SEARCH_LIBCRYPTO OFF) - -add_subdirectory(source_subfolder) +add_subdirectory(src) diff --git a/s2n/all/conandata.yml b/s2n/all/conandata.yml index 119cdd4..5b8f0f1 100644 --- a/s2n/all/conandata.yml +++ b/s2n/all/conandata.yml @@ -1,4 +1,31 @@ sources: + "1.4.16": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.4.1.tar.gz" + sha256: "d8c1d8e1142441412434feacb4947ce6430a244dcd8f58921af79b29bd901731" + "1.4.13": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.4.13.tar.gz" + sha256: "8b0b36697963d6752e5a1b49e28e393605990d348edf1aef6f39c33164d45edb" + "1.4.1": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.4.1.tar.gz" + sha256: "d8c1d8e1142441412434feacb4947ce6430a244dcd8f58921af79b29bd901731" + "1.4.0": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.4.0.tar.gz" + sha256: "3f786cb2f35e0551e120e1747e7b510a8228cd852073afa241313939672046cb" + "1.3.56": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.3.56.tar.gz" + sha256: "5d7bab81357a564453bc453469b4ae02936f1f35225ad297b8d846d2ecdda521" + "1.3.55": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.3.55.tar.gz" + sha256: "3b4d51d08326757440a7a134dd4d73c904b700d64837aa7fec0aca908b70fd9b" + "1.3.52": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.3.52.tar.gz" + sha256: "c8ae02ae427763dcffe10d211ed7a2433803affd9aa5836951ef972c53db0120" + "1.3.50": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.3.50.tar.gz" + sha256: "19c9a7e9e0ce14aae3fc0c55995759f4eadd5b55f5353de69f82c62ccb3693f8" + "1.3.49": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.3.49.tar.gz" + sha256: "2bc7b170a750a435ad02ab8e696c3ad6e9bb7a585c02899472793f87670184dd" "1.3.31": url: "https://github.com/aws/s2n-tls/archive/v1.3.31.tar.gz" sha256: "23cfb42f82cbe1ce94b59f3b1c1c8eb9d24af2a1ae4c8f854209ff88fddd3900" @@ -23,7 +50,5 @@ sources: patches: "1.1.0": - patch_file: "patches/1.1.0/001-try-compile.patch" - base_path: "source_subfolder" "1.0.11": - patch_file: "patches/1.0.11/001-try-compile.patch" - base_path: "source_subfolder" diff --git a/s2n/all/conanfile.py b/s2n/all/conanfile.py index ab4c244..34d4cbc 100644 --- a/s2n/all/conanfile.py +++ b/s2n/all/conanfile.py @@ -1,19 +1,21 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import apply_conandata_patches, get, rmdir -from conans import CMake +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save import os +import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" -class S2n(ConanFile): +class S2nConan(ConanFile): name = "s2n" description = "An implementation of the TLS/SSL protocols" topics = ("aws", "amazon", "cloud", ) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/aws/s2n-tls" - license = "Apache-2.0", + license = "Apache-2.0" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,68 +26,79 @@ class S2n(ConanFile): "fPIC": True, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.settings.os == "Windows": raise ConanInvalidConfiguration("Not supported (yet)") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["UNSAFE_TREAT_WARNINGS_AS_ERRORS"] = False - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["UNSAFE_TREAT_WARNINGS_AS_ERRORS"] = False + tc.variables["SEARCH_LIBCRYPTO"] = False # see CMakeLists wrapper + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): apply_conandata_patches(self) - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "s2n")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::s2n": "s2n::s2n"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "s2n") self.cpp_info.set_property("cmake_target_name", "AWS::s2n") - # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["s2n-lib"].libs = ["s2n"] - self.cpp_info.components["s2n-lib"].requires = ["openssl::crypto"] + self.cpp_info.libs = ["s2n"] + self.cpp_info.requires = ["openssl::crypto"] if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.components["s2n-lib"].system_libs = ["m", "pthread"] + self.cpp_info.system_libs = ["m", "pthread"] # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.filenames["cmake_find_package"] = "s2n" - self.cpp_info.filenames["cmake_find_package_multi"] = "s2n" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["s2n-lib"].names["cmake_find_package"] = "s2n" - self.cpp_info.components["s2n-lib"].names["cmake_find_package_multi"] = "s2n" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/s2n/all/test_package/CMakeLists.txt b/s2n/all/test_package/CMakeLists.txt index 9863ead..2f57c92 100644 --- a/s2n/all/test_package/CMakeLists.txt +++ b/s2n/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(s2n REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} AWS::s2n) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::s2n) diff --git a/s2n/all/test_package/conanfile.py b/s2n/all/test_package/conanfile.py index 49a3a66..0a6bc68 100644 --- a/s2n/all/test_package/conanfile.py +++ b/s2n/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/s2n/all/test_v1_package/CMakeLists.txt b/s2n/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/s2n/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/s2n/all/test_v1_package/conanfile.py b/s2n/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/s2n/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/s2n/config.yml b/s2n/config.yml index 611e0f7..c02d8ff 100644 --- a/s2n/config.yml +++ b/s2n/config.yml @@ -1,4 +1,22 @@ versions: + "1.4.16": + folder: all + "1.4.13": + folder: all + "1.4.1": + folder: all + "1.4.0": + folder: all + "1.3.56": + folder: all + "1.3.55": + folder: all + "1.3.52": + folder: all + "1.3.50": + folder: all + "1.3.49": + folder: all "1.3.31": folder: all "1.3.15": diff --git a/snappy/all/conandata.yml b/snappy/all/conandata.yml new file mode 100644 index 0000000..501018a --- /dev/null +++ b/snappy/all/conandata.yml @@ -0,0 +1,72 @@ +sources: + "1.2.1": + url: "https://github.com/google/snappy/archive/1.2.1.tar.gz" + sha256: "736aeb64d86566d2236ddffa2865ee5d7a82d26c9016b36218fcc27ea4f09f86" + "1.2.0": + url: "https://github.com/google/snappy/archive/1.2.0.tar.gz" + sha256: "9b8f10fbb5e3bc112f2e5e64f813cb73faea42ec9c533a5023b5ae08aedef42e" + "1.1.10": + url: "https://github.com/google/snappy/archive/1.1.10.tar.gz" + sha256: "49d831bffcc5f3d01482340fe5af59852ca2fe76c3e05df0e67203ebbe0f1d90" + "1.1.9": + url: "https://github.com/google/snappy/archive/1.1.9.tar.gz" + sha256: "75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7" + "1.1.8": + url: "https://github.com/google/snappy/archive/1.1.8.tar.gz" + sha256: "16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f" + "1.1.7": + url: "https://github.com/google/snappy/archive/1.1.7.tar.gz" + sha256: "3dfa02e873ff51a11ee02b9ca391807f0c8ea0529a4924afa645fbf97163f9d4" +patches: + "1.2.1": + - patch_file: "patches/1.1.10-0001-fix-inlining-failure.patch" + patch_description: "disable inlining for compilation error" + patch_type: "portability" + - patch_file: "patches/1.1.9-0002-no-Werror.patch" + patch_description: "disable 'warning as error' options" + patch_type: "portability" + - patch_file: "patches/1.2.0-0003-fix-clobber-list-older-llvm.patch" + patch_description: "disable inline asm on apple-clang" + patch_type: "portability" + - patch_file: "patches/1.2.0-0004-rtti-by-default.patch" + patch_description: "remove 'disable rtti'" + patch_type: "conan" + "1.2.0": + - patch_file: "patches/1.1.10-0001-fix-inlining-failure.patch" + patch_description: "disable inlining for compilation error" + patch_type: "portability" + - patch_file: "patches/1.1.9-0002-no-Werror.patch" + patch_description: "disable 'warning as error' options" + patch_type: "portability" + - patch_file: "patches/1.2.0-0003-fix-clobber-list-older-llvm.patch" + patch_description: "disable inline asm on apple-clang" + patch_type: "portability" + - patch_file: "patches/1.2.0-0004-rtti-by-default.patch" + patch_description: "remove 'disable rtti'" + patch_type: "conan" + "1.1.10": + - patch_file: "patches/1.1.10-0001-fix-inlining-failure.patch" + patch_description: "disable inlining for compilation error" + patch_type: "portability" + - patch_file: "patches/1.1.9-0002-no-Werror.patch" + patch_description: "disable 'warning as error' options" + patch_type: "portability" + - patch_file: "patches/1.1.10-0003-fix-clobber-list-older-llvm.patch" + patch_description: "disable inline asm on apple-clang" + patch_type: "portability" + - patch_file: "patches/1.1.9-0004-rtti-by-default.patch" + patch_description: "remove 'disable rtti'" + patch_type: "conan" + "1.1.9": + - patch_file: "patches/1.1.9-0001-fix-inlining-failure.patch" + patch_description: "disable inlining for compilation error" + patch_type: "portability" + - patch_file: "patches/1.1.9-0002-no-Werror.patch" + patch_description: "disable 'warning as error' options" + patch_type: "portability" + - patch_file: "patches/1.1.9-0003-fix-clobber-list-older-llvm.patch" + patch_description: "disable inline asm on apple-clang" + patch_type: "portability" + - patch_file: "patches/1.1.9-0004-rtti-by-default.patch" + patch_description: "remove 'disable rtti'" + patch_type: "conan" diff --git a/snappy/all/conanfile.py b/snappy/all/conanfile.py new file mode 100644 index 0000000..d60c824 --- /dev/null +++ b/snappy/all/conanfile.py @@ -0,0 +1,106 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class SnappyConan(ConanFile): + name = "snappy" + description = "A fast compressor/decompressor" + topics = ("google", "compressor", "decompressor") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/snappy" + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_bmi2": [True, False, "auto"], + "with_ssse3": [True, False, "auto"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_bmi2": "auto", + "with_ssse3": "auto", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + if self.settings.arch not in ["x86", "x86_64"]: + del self.options.with_bmi2 + del self.options.with_ssse3 + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SNAPPY_BUILD_TESTS"] = False + if Version(self.version) >= "1.1.8": + tc.variables["SNAPPY_FUZZING_BUILD"] = False + # Don't use these avx options. These are useless. + # https://github.com/conan-io/conan-center-index/pull/16495 + tc.variables["SNAPPY_REQUIRE_AVX"] = False + tc.variables["SNAPPY_REQUIRE_AVX2"] = False + tc.variables["SNAPPY_INSTALL"] = True + if Version(self.version) >= "1.1.9": + tc.variables["SNAPPY_BUILD_BENCHMARKS"] = False + if self.settings.arch in ["x86", "x86_64"]: + if self.options.with_bmi2 != "auto": + tc.variables["SNAPPY_HAVE_BMI2"] = self.options.with_bmi2 + if self.options.with_ssse3 != "auto": + tc.variables["SNAPPY_HAVE_SSSE3"] = self.options.with_ssse3 + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Snappy") + self.cpp_info.set_property("cmake_target_name", "Snappy::snappy") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed + self.cpp_info.components["snappylib"].libs = ["snappy"] + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["snappylib"].system_libs.append("m") + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["snappylib"].system_libs.append(libcxx) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "Snappy" + self.cpp_info.names["cmake_find_package_multi"] = "Snappy" + self.cpp_info.components["snappylib"].names["cmake_find_package"] = "snappy" + self.cpp_info.components["snappylib"].names["cmake_find_package_multi"] = "snappy" + self.cpp_info.components["snappylib"].set_property("cmake_target_name", "Snappy::snappy") diff --git a/snappy/all/patches/1.1.10-0001-fix-inlining-failure.patch b/snappy/all/patches/1.1.10-0001-fix-inlining-failure.patch new file mode 100644 index 0000000..66b0f05 --- /dev/null +++ b/snappy/all/patches/1.1.10-0001-fix-inlining-failure.patch @@ -0,0 +1,13 @@ +diff --git a/snappy-stubs-internal.h b/snappy-stubs-internal.h +index 1548ed7..3b4a9f3 100644 +--- a/snappy-stubs-internal.h ++++ b/snappy-stubs-internal.h +@@ -100,7 +100,7 @@ + + // Inlining hints. + #if HAVE_ATTRIBUTE_ALWAYS_INLINE +-#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) ++#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE + #else + #define SNAPPY_ATTRIBUTE_ALWAYS_INLINE + #endif // HAVE_ATTRIBUTE_ALWAYS_INLINE diff --git a/snappy/all/patches/1.1.10-0003-fix-clobber-list-older-llvm.patch b/snappy/all/patches/1.1.10-0003-fix-clobber-list-older-llvm.patch new file mode 100644 index 0000000..969ce38 --- /dev/null +++ b/snappy/all/patches/1.1.10-0003-fix-clobber-list-older-llvm.patch @@ -0,0 +1,13 @@ +diff --git a/snappy.cc b/snappy.cc +index d414718..e4efb59 100644 +--- a/snappy.cc ++++ b/snappy.cc +@@ -1132,7 +1132,7 @@ inline size_t AdvanceToNextTagX86Optimized(const uint8_t** ip_p, size_t* tag) { + size_t literal_len = *tag >> 2; + size_t tag_type = *tag; + bool is_literal; +-#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) ++#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) && ( (!defined(__clang__) && !defined(__APPLE__)) || (!defined(__APPLE__) && defined(__clang__) && (__clang_major__ >= 9)) || (defined(__APPLE__) && defined(__clang__) && (__clang_major__ > 11)) ) + // TODO clang misses the fact that the (c & 3) already correctly + // sets the zero flag. + asm("and $3, %k[tag_type]\n\t" diff --git a/snappy/all/patches/1.1.9-0001-fix-inlining-failure.patch b/snappy/all/patches/1.1.9-0001-fix-inlining-failure.patch new file mode 100644 index 0000000..cdc119c --- /dev/null +++ b/snappy/all/patches/1.1.9-0001-fix-inlining-failure.patch @@ -0,0 +1,14 @@ +Fixes the following error: +error: inlining failed in call to ‘always_inline’ ‘size_t snappy::AdvanceToNextTag(const uint8_t**, size_t*)’: function body can be overwritten at link time + +--- snappy-stubs-internal.h ++++ snappy-stubs-internal.h +@@ -100,7 +100,7 @@ + + // Inlining hints. + #ifdef HAVE_ATTRIBUTE_ALWAYS_INLINE +-#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) ++#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE + #else + #define SNAPPY_ATTRIBUTE_ALWAYS_INLINE + #endif diff --git a/snappy/all/patches/1.1.9-0002-no-Werror.patch b/snappy/all/patches/1.1.9-0002-no-Werror.patch new file mode 100644 index 0000000..d86e4e0 --- /dev/null +++ b/snappy/all/patches/1.1.9-0002-no-Werror.patch @@ -0,0 +1,12 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -69,7 +69,7 @@ +- # Use -Werror for clang only. ++if(0) + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror") + endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- ++endif() diff --git a/snappy/all/patches/1.1.9-0003-fix-clobber-list-older-llvm.patch b/snappy/all/patches/1.1.9-0003-fix-clobber-list-older-llvm.patch new file mode 100644 index 0000000..84bc674 --- /dev/null +++ b/snappy/all/patches/1.1.9-0003-fix-clobber-list-older-llvm.patch @@ -0,0 +1,12 @@ +asm clobbers do not work for clang < 9 and apple-clang < 11 (found by SpaceIm) +--- snappy.cc ++++ snappy.cc +@@ -1026,7 +1026,7 @@ + size_t literal_len = *tag >> 2; + size_t tag_type = *tag; + bool is_literal; +-#if defined(__GNUC__) && defined(__x86_64__) ++#if defined(__GNUC__) && defined(__x86_64__) && ( (!defined(__clang__) && !defined(__APPLE__)) || (!defined(__APPLE__) && defined(__clang__) && (__clang_major__ >= 9)) || (defined(__APPLE__) && defined(__clang__) && (__clang_major__ > 11)) ) + // TODO clang misses the fact that the (c & 3) already correctly + // sets the zero flag. + asm("and $3, %k[tag_type]\n\t" diff --git a/snappy/all/patches/1.1.9-0004-rtti-by-default.patch b/snappy/all/patches/1.1.9-0004-rtti-by-default.patch new file mode 100644 index 0000000..c353a48 --- /dev/null +++ b/snappy/all/patches/1.1.9-0004-rtti-by-default.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,8 +53,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_definitions(-D_HAS_EXCEPTIONS=0) + + # Disable RTTI. +- string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") + else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Use -Wall for clang and gcc. + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") +@@ -78,8 +76,6 @@ endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") + + # Disable RTTI. +- string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") + endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + + # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make diff --git a/snappy/all/patches/1.2.0-0003-fix-clobber-list-older-llvm.patch b/snappy/all/patches/1.2.0-0003-fix-clobber-list-older-llvm.patch new file mode 100644 index 0000000..05accb6 --- /dev/null +++ b/snappy/all/patches/1.2.0-0003-fix-clobber-list-older-llvm.patch @@ -0,0 +1,13 @@ +diff --git a/snappy.cc b/snappy.cc +index 08c2a98..151de55 100644 +--- a/snappy.cc ++++ b/snappy.cc +@@ -1311,7 +1311,7 @@ inline size_t AdvanceToNextTagX86Optimized(const uint8_t** ip_p, size_t* tag) { + size_t literal_len = *tag >> 2; + size_t tag_type = *tag; + bool is_literal; +-#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) ++#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) && ( (!defined(__clang__) && !defined(__APPLE__)) || (!defined(__APPLE__) && defined(__clang__) && (__clang_major__ >= 9)) || (defined(__APPLE__) && defined(__clang__) && (__clang_major__ > 11)) ) + // TODO clang misses the fact that the (c & 3) already correctly + // sets the zero flag. + asm("and $3, %k[tag_type]\n\t" diff --git a/snappy/all/patches/1.2.0-0004-rtti-by-default.patch b/snappy/all/patches/1.2.0-0004-rtti-by-default.patch new file mode 100644 index 0000000..7ca0e72 --- /dev/null +++ b/snappy/all/patches/1.2.0-0004-rtti-by-default.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 01eb2d7..fb4e6bf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,8 +53,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_definitions(-D_HAS_EXCEPTIONS=0) + + # Disable RTTI. +- string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") ++# string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") ++# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") + else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Use -Wall for clang and gcc. + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") +@@ -83,8 +83,8 @@ endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") + + # Disable RTTI. +- string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") ++# string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") ++# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") + endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + + # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make diff --git a/snappy/all/test_package/CMakeLists.txt b/snappy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..a0fd3f8 --- /dev/null +++ b/snappy/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(Snappy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Snappy::snappy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c PRIVATE Snappy::snappy) diff --git a/snappy/all/test_package/conanfile.py b/snappy/all/test_package/conanfile.py new file mode 100644 index 0000000..543039a --- /dev/null +++ b/snappy/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + bin_path_c = os.path.join(self.cpp.build.bindirs[0], "test_package_c") + self.run(bin_path_c, env="conanrun") diff --git a/snappy/all/test_package/test_package.c b/snappy/all/test_package/test_package.c new file mode 100644 index 0000000..79754cd --- /dev/null +++ b/snappy/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include + +#include +#include +#include +#include + +int main() { + const char *input = "conan-center-index"; + size_t input_length = strlen(input); + size_t output_length = snappy_max_compressed_length(input_length); + char *output = (char*)malloc(output_length); + if (output == NULL) return 0; + if (snappy_compress(input, input_length, output, &output_length) == SNAPPY_OK) { + printf("%s compressed: %s\n", input, output); + } + free(output); + return 0; +} diff --git a/snappy/all/test_package/test_package.cpp b/snappy/all/test_package/test_package.cpp new file mode 100644 index 0000000..4aa37e8 --- /dev/null +++ b/snappy/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#include +#include +#include + +int main() { + std::string input("conan-enter-index"); + std::string output; + + const size_t result = snappy::Compress(input.c_str(), input.size(), &output); + + std::cout << input << " compressed (" << result << "): " << output << std::endl; + + return EXIT_SUCCESS; +} diff --git a/snappy/all/test_v1_package/CMakeLists.txt b/snappy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/snappy/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/snappy/all/test_v1_package/conanfile.py b/snappy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..00d8ab9 --- /dev/null +++ b/snappy/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + bin_path_c = os.path.join("bin", "test_package_c") + self.run(bin_path_c, run_environment=True) diff --git a/snappy/config.yml b/snappy/config.yml new file mode 100644 index 0000000..4059143 --- /dev/null +++ b/snappy/config.yml @@ -0,0 +1,13 @@ +versions: + "1.2.1": + folder: all + "1.2.0": + folder: all + "1.1.10": + folder: all + "1.1.9": + folder: all + "1.1.8": + folder: all + "1.1.7": + folder: all diff --git a/thrift/all/conandata.yml b/thrift/all/conandata.yml new file mode 100644 index 0000000..6ddf0c5 --- /dev/null +++ b/thrift/all/conandata.yml @@ -0,0 +1,54 @@ +sources: + "0.20.0": + url: "http://archive.apache.org/dist/thrift/0.20.0/thrift-0.20.0.tar.gz" + sha256: "b5d8311a779470e1502c027f428a1db542f5c051c8e1280ccd2163fa935ff2d6" + "0.18.1": + url: "http://archive.apache.org/dist/thrift/0.18.1/thrift-0.18.1.tar.gz" + sha256: "04c6f10e5d788ca78e13ee2ef0d2152c7b070c0af55483d6b942e29cff296726" + "0.17.0": + url: "http://archive.apache.org/dist/thrift/0.17.0/thrift-0.17.0.tar.gz" + sha256: "b272c1788bb165d99521a2599b31b97fa69e5931d099015d91ae107a0b0cc58f" + "0.16.0": + url: "http://archive.apache.org/dist/thrift/0.16.0/thrift-0.16.0.tar.gz" + sha256: "f460b5c1ca30d8918ff95ea3eb6291b3951cf518553566088f3f2be8981f6209" + "0.15.0": + url: "http://archive.apache.org/dist/thrift/0.15.0/thrift-0.15.0.tar.gz" + sha256: "d5883566d161f8f6ddd4e21f3a9e3e6b8272799d054820f1c25b11e86718f86b" + "0.14.2": + url: "http://archive.apache.org/dist/thrift/0.14.2/thrift-0.14.2.tar.gz" + sha256: "4191bfc0b7490e20cc69f9f4dc6e991fbb612d4551aa9eef1dbf7f4c47ce554d" + "0.14.1": + url: "http://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz" + sha256: "13da5e1cd9c8a3bb89778c0337cc57eb0c29b08f3090b41cf6ab78594b410ca5" +patches: + "0.20.0": + - patch_file: "patches/cmake-0.16.0.patch" + patch_description: "use cci packages" + patch_type: "conan" + "0.18.1": + - patch_file: "patches/cmake-0.16.0.patch" + patch_description: "use cci packages" + patch_type: "conan" + - patch_file: "patches/0.18.1-0002-include-stddef.patch" + patch_description: "include cstddef" + patch_type: "portability" + "0.17.0": + - patch_file: "patches/cmake-0.16.0.patch" + patch_description: "use cci packages" + patch_type: "conan" + "0.16.0": + - patch_file: "patches/cmake-0.16.0.patch" + patch_description: "use cci packages" + patch_type: "conan" + "0.15.0": + - patch_file: "patches/cmake-0.15.0.patch" + patch_description: "use cci packages" + patch_type: "conan" + "0.14.2": + - patch_file: "patches/cmake-0.14.1.patch" + patch_description: "use cci packages" + patch_type: "conan" + "0.14.1": + - patch_file: "patches/cmake-0.14.1.patch" + patch_description: "use cci packages" + patch_type: "conan" diff --git a/thrift/all/conanfile.py b/thrift/all/conanfile.py new file mode 100644 index 0000000..4239d05 --- /dev/null +++ b/thrift/all/conanfile.py @@ -0,0 +1,232 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class ThriftConan(ConanFile): + name = "thrift" + description = "Thrift is an associated code generation mechanism for RPC" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/apache/thrift" + topics = ("thrift", "serialization", "rpc") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + "with_libevent": [True, False], + "with_openssl": [True, False], + "with_c_glib": [True, False], + "with_cpp": [True, False], + "with_java": [True, False], + "with_python": [True, False], + "with_qt5": [True, False], + "with_haskell": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + "with_libevent": True, + "with_openssl": True, + "with_c_glib": False, + "with_cpp": True, + "with_java": False, + "with_python": False, + "with_qt5": False, + "with_haskell": False, + } + + short_paths = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.85.0", transitive_headers=True) + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.with_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_libevent: + self.requires("libevent/2.1.12") + if self.options.with_qt5: + self.requires("qt/5.15.13") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.25") + else: + self.tool_requires("flex/2.6.4") + self.tool_requires("bison/3.8.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + for option, value in self.options.items(): + if option.startswith("with_"): + tc.variables[option.upper()] = value + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_COMPILER"] = True + tc.variables["BUILD_LIBRARIES"] = True + tc.variables["BUILD_TUTORIALS"] = False + if is_msvc(self): + tc.variables["WITH_MT"] = is_msvc_static_runtime(self) + # This policy doesn't matter for us, but avoids a warning + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0074"] = "NEW" + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + env = VirtualBuildEnv(self) + env.generate(scope="build") + + def _patch_sources(self): + apply_conandata_patches(self) + # No static code analysis (seems to trigger CMake warnings due to weird custom Find module file) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "include(StaticCodeAnalysis)", "") + # TODO: To remove in conan v2, but it's still needed if building with 1 profile. + # May also be removed if flex & bison recipes define cmake_find_mode property to "none" in their package_info() + for f in ["Findflex.cmake", "flex-config.cmake", "Findbison.cmake", "bison-config.cmake"]: + rm(self, f, self.generators_folder) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + # Copy generated headers from build tree + copy(self, "*.h", src=self.build_folder, dst=os.path.join(self.package_folder, "include"), keep_path=True) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + targets = {} + if self.options.with_zlib: + targets.update({"thriftz::thriftz": "thrift::thriftz"}) + if self.options.with_libevent: + targets.update({"thriftnb::thriftnb": "thrift::thriftnb"}) + if self.options.with_qt5: + targets.update({"thriftqt5::thriftqt5": "thrift::thriftqt5"}) + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + targets + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Thrift") + # unofficial, for conan internal purpose, it avoids conflict with libthrift component + self.cpp_info.set_property("cmake_target_name", "thrift::thrift-conan-do-not-use") + self.cpp_info.set_property("pkg_config_name", "thrift_conan_do_not_use") + + libsuffix = "{}{}".format( + ("mt" if is_msvc_static_runtime(self) else "md") if is_msvc(self) else "", + "d" if self.settings.build_type == "Debug" else "", + ) + + self.cpp_info.components["libthrift"].set_property("cmake_target_name", "thrift::thrift") + self.cpp_info.components["libthrift"].set_property("pkg_config_name", "thrift") + self.cpp_info.components["libthrift"].libs = [f"thrift{libsuffix}"] + if self.settings.os == "Windows": + self.cpp_info.components["libthrift"].defines.append("NOMINMAX") + if Version(self.version) >= "0.15.0": + self.cpp_info.components["libthrift"].system_libs.append("shlwapi") + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libthrift"].system_libs.extend(["m", "pthread"]) + self.cpp_info.components["libthrift"].requires.append("boost::headers") + if self.options.with_openssl: + self.cpp_info.components["libthrift"].requires.append("openssl::openssl") + + if self.options.with_zlib: + self.cpp_info.components["libthrift_z"].set_property("cmake_target_name", "thriftz::thriftz") + self.cpp_info.components["libthrift_z"].set_property("pkg_config_name", "thrift-z") + self.cpp_info.components["libthrift_z"].libs = [f"thriftz{libsuffix}"] + self.cpp_info.components["libthrift_z"].requires = ["libthrift", "zlib::zlib"] + + + if self.options.with_libevent: + self.cpp_info.components["libthrift_nb"].set_property("cmake_target_name", "thriftnb::thriftnb") + self.cpp_info.components["libthrift_nb"].set_property("pkg_config_name", "thrift-nb") + self.cpp_info.components["libthrift_nb"].libs = [f"thriftnb{libsuffix}"] + self.cpp_info.components["libthrift_nb"].requires = ["libthrift", "libevent::libevent"] + + if self.options.with_qt5: + self.cpp_info.components["libthrift_qt5"].set_property("cmake_target_name", "thriftqt5::thriftqt5") + self.cpp_info.components["libthrift_qt5"].set_property("pkg_config_name", "thrift-qt5") + self.cpp_info.components["libthrift_qt5"].libs = [f"thriftqt5{libsuffix}"] + self.cpp_info.components["libthrift_qt5"].requires = ["libthrift", "qt::qtCore"] + + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH env var with : {bin_path}") + self.env_info.PATH.append(bin_path) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.filenames["cmake_find_package"] = "Thrift" + self.cpp_info.filenames["cmake_find_package_multi"] = "Thrift" + self.cpp_info.names["cmake_find_package"] = "thrift" + self.cpp_info.names["cmake_find_package_multi"] = "thrift" + self.cpp_info.names["pkg_config"] = "thrift_conan_do_not_use" + self.cpp_info.components["libthrift"].names["cmake_find_package"] = "thrift" + self.cpp_info.components["libthrift"].names["cmake_find_package_multi"] = "thrift" + if self.options.with_zlib: + self.cpp_info.components["libthrift_z"].names["cmake_find_package"] = "thriftz" + self.cpp_info.components["libthrift_z"].names["cmake_find_package_multi"] = "thriftz" + self.cpp_info.components["libthrift_z"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libthrift_z"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.with_libevent: + self.cpp_info.components["libthrift_nb"].names["cmake_find_package"] = "thriftnb" + self.cpp_info.components["libthrift_nb"].names["cmake_find_package_multi"] = "thriftnb" + self.cpp_info.components["libthrift_nb"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libthrift_nb"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + if self.options.with_qt5: + self.cpp_info.components["libthrift_qt5"].names["cmake_find_package"] = "thriftqt5" + self.cpp_info.components["libthrift_qt5"].names["cmake_find_package_multi"] = "thriftqt5" + self.cpp_info.components["libthrift_qt5"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libthrift_qt5"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/thrift/all/patches/0.18.1-0002-include-stddef.patch b/thrift/all/patches/0.18.1-0002-include-stddef.patch new file mode 100644 index 0000000..f8195ce --- /dev/null +++ b/thrift/all/patches/0.18.1-0002-include-stddef.patch @@ -0,0 +1,24 @@ +diff --git a/lib/cpp/src/thrift/numeric_cast.h b/lib/cpp/src/thrift/numeric_cast.h +index d7063db..8775121 100644 +--- a/lib/cpp/src/thrift/numeric_cast.h ++++ b/lib/cpp/src/thrift/numeric_cast.h +@@ -22,6 +22,7 @@ + + #include + #include ++#include + + #if defined(_MSC_VER) + // avoid compiler warnings and errors in MSVC if max is defined as a macro +diff --git a/lib/cpp/src/thrift/transport/TBufferTransports.h b/lib/cpp/src/thrift/transport/TBufferTransports.h +index f72d8f6..f745b8c 100644 +--- a/lib/cpp/src/thrift/transport/TBufferTransports.h ++++ b/lib/cpp/src/thrift/transport/TBufferTransports.h +@@ -22,6 +22,7 @@ + + #include + #include ++#include + #include + + #include diff --git a/thrift/all/patches/cmake-0.14.1.patch b/thrift/all/patches/cmake-0.14.1.patch new file mode 100644 index 0000000..56966ba --- /dev/null +++ b/thrift/all/patches/cmake-0.14.1.patch @@ -0,0 +1,108 @@ +--- a/build/cmake/DefineInstallationPaths.cmake ++++ b/build/cmake/DefineInstallationPaths.cmake +@@ -20,11 +20,7 @@ + + # Define the default install paths + set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)") +-if(MSVC) +- set(LIB_INSTALL_DIR "bin${LIB_SUFFIX}" CACHE PATH "The library install dir (default: bin${LIB_SUFFIX})") +-else() + set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})") +-endif() + set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)") + set(CMAKE_INSTALL_DIR "lib/cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)") + set(PKGCONFIG_INSTALL_DIR "lib/pkgconfig" CACHE PATH "The subdirectory to install pkgconfig config files (default: lib/pkgconfig)") +--- a/build/cmake/DefineOptions.cmake ++++ b/build/cmake/DefineOptions.cmake +@@ -39,11 +39,6 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON) + # and enables the library if all are found. This means the default is to build as + # much as possible but leaving out libraries if their dependencies are not met. + +-if (NOT Boost_USE_STATIC_LIBS) +- add_definitions(-DBOOST_ALL_DYN_LINK) +- add_definitions(-DBOOST_TEST_DYN_LINK) +-endif() +- + # as3 + option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON) + if (WITH_AS3) +@@ -87,9 +82,7 @@ CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON + + # OpenSSL + if(WITH_CPP OR WITH_C_GLIB) +- find_package(OpenSSL QUIET) +- CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON +- "OPENSSL_FOUND" OFF) ++ OPTION(WITH_OPENSSL "Build with OpenSSL support" ON) + endif() + + # Java +@@ -106,14 +99,11 @@ else() + endif() + + # Javascript +-option(WITH_JAVASCRIPT "Build Javascript Thrift library" ON) +-CMAKE_DEPENDENT_OPTION(BUILD_JAVASCRIPT "Build Javascript library" ON +- "BUILD_LIBRARIES;WITH_JAVASCRIPT;NOT WIN32; NOT CYGWIN" OFF) ++option(WITH_JAVASCRIPT "Build Javascript Thrift library" OFF) + + # NodeJS +-option(WITH_NODEJS "Build NodeJS Thrift library" ON) +-CMAKE_DEPENDENT_OPTION(BUILD_NODEJS "Build NodeJS library" ON +- "BUILD_LIBRARIES;WITH_NODEJS" OFF) ++option(WITH_NODEJS "Build NodeJS Thrift library" OFF) ++ + + # Python + option(WITH_PYTHON "Build Python Thrift library" ON) +--- a/lib/c_glib/CMakeLists.txt ++++ b/lib/c_glib/CMakeLists.txt +@@ -61,11 +61,12 @@ set(thrift_c_glib_SOURCES + + # If OpenSSL is not found just ignore the OpenSSL stuff + if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list(APPEND thrift_c_glib_SOURCES + src/thrift/c_glib/transport/thrift_ssl_socket.c + ) +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ #include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + + +--- a/lib/cpp/CMakeLists.txt ++++ b/lib/cpp/CMakeLists.txt +@@ -101,13 +101,14 @@ else() + endif() + + # If OpenSSL is not found or disabled just ignore the OpenSSL stuff +-if(OPENSSL_FOUND AND WITH_OPENSSL) ++if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list( APPEND thriftcpp_SOURCES + src/thrift/transport/TSSLSocket.cpp + src/thrift/transport/TSSLServerSocket.cpp + ) +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ #include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + + if(UNIX) +@@ -161,11 +162,11 @@ ADD_PKGCONFIG_THRIFT(thrift) + + if(WITH_LIBEVENT) + find_package(Libevent REQUIRED) # Libevent comes with CMake support from upstream +- include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) ++ #include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) + + ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES}) + LINK_AGAINST_THRIFT_LIBRARY(thriftnb thrift) +- TARGET_LINK_LIBRARIES_THRIFT(thriftnb ${SYSLIBS} ${LIBEVENT_LIBRARIES}) ++ TARGET_LINK_LIBRARIES_THRIFT(thriftnb ${SYSLIBS} libevent::core libevent::extra) + ADD_PKGCONFIG_THRIFT(thrift-nb) + endif() + diff --git a/thrift/all/patches/cmake-0.15.0.patch b/thrift/all/patches/cmake-0.15.0.patch new file mode 100644 index 0000000..06e4185 --- /dev/null +++ b/thrift/all/patches/cmake-0.15.0.patch @@ -0,0 +1,116 @@ +--- a/build/cmake/DefineInstallationPaths.cmake ++++ b/build/cmake/DefineInstallationPaths.cmake +@@ -20,11 +20,7 @@ + + # Define the default install paths + set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)") +-if(MSVC) +- set(LIB_INSTALL_DIR "bin${LIB_SUFFIX}" CACHE PATH "The library install dir (default: bin${LIB_SUFFIX})") +-else() + set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})") +-endif() + set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)") + set(CMAKE_INSTALL_DIR "lib/cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)") + set(PKGCONFIG_INSTALL_DIR "lib/pkgconfig" CACHE PATH "The subdirectory to install pkgconfig config files (default: lib/pkgconfig)") +--- a/build/cmake/DefineOptions.cmake ++++ b/build/cmake/DefineOptions.cmake +@@ -39,11 +39,6 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON) + # and enables the library if all are found. This means the default is to build as + # much as possible but leaving out libraries if their dependencies are not met. + +-if (NOT Boost_USE_STATIC_LIBS) +- add_definitions(-DBOOST_ALL_DYN_LINK) +- add_definitions(-DBOOST_TEST_DYN_LINK) +-endif() +- + # as3 + option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON) + if (WITH_AS3) +@@ -87,9 +82,7 @@ CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON + + # OpenSSL + if(WITH_CPP OR WITH_C_GLIB) +- find_package(OpenSSL QUIET) +- CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON +- "OPENSSL_FOUND" OFF) ++ OPTION(WITH_OPENSSL "Build with OpenSSL support" ON) + endif() + + # Java +@@ -106,14 +99,11 @@ else() + endif() + + # Javascript +-option(WITH_JAVASCRIPT "Build Javascript Thrift library" ON) +-CMAKE_DEPENDENT_OPTION(BUILD_JAVASCRIPT "Build Javascript library" ON +- "BUILD_LIBRARIES;WITH_JAVASCRIPT;NOT WIN32; NOT CYGWIN" OFF) ++option(WITH_JAVASCRIPT "Build Javascript Thrift library" OFF) + + # NodeJS +-option(WITH_NODEJS "Build NodeJS Thrift library" ON) +-CMAKE_DEPENDENT_OPTION(BUILD_NODEJS "Build NodeJS library" ON +- "BUILD_LIBRARIES;WITH_NODEJS" OFF) ++option(WITH_NODEJS "Build NodeJS Thrift library" OFF) ++ + + # Python + option(WITH_PYTHON "Build Python Thrift library" ON) +--- a/lib/c_glib/CMakeLists.txt ++++ b/lib/c_glib/CMakeLists.txt +@@ -72,11 +72,12 @@ set(thrift_c_glib_zlib_SOURCES + + # If OpenSSL is not found just ignore the OpenSSL stuff + if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list(APPEND thrift_c_glib_SOURCES + src/thrift/c_glib/transport/thrift_ssl_socket.c + ) +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ #include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + + +--- a/lib/cpp/CMakeLists.txt ++++ b/lib/cpp/CMakeLists.txt +@@ -101,13 +101,14 @@ else() + endif() + + # If OpenSSL is not found or disabled just ignore the OpenSSL stuff +-if(OPENSSL_FOUND AND WITH_OPENSSL) ++if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list( APPEND thriftcpp_SOURCES + src/thrift/transport/TSSLSocket.cpp + src/thrift/transport/TSSLServerSocket.cpp + ) +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ #include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + + if(UNIX) +@@ -161,16 +162,16 @@ ADD_PKGCONFIG_THRIFT(thrift) + + if(WITH_LIBEVENT) + find_package(Libevent REQUIRED) # Libevent comes with CMake support from upstream +- include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) ++ #include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) + + ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES}) + LINK_AGAINST_THRIFT_LIBRARY(thriftnb PUBLIC thrift) +- if(TARGET libevent::core AND TARGET libevent::extra) ++ #if(TARGET libevent::core AND TARGET libevent::extra) + # libevent was found via its cmake config, use modern style targets + TARGET_LINK_LIBRARIES_THRIFT(thriftnb PUBLIC libevent::core libevent::extra) +- else() +- TARGET_LINK_LIBRARIES_THRIFT(thriftnb PUBLIC ${LIBEVENT_LIBRARIES}) +- endif() ++ #else() ++ #TARGET_LINK_LIBRARIES_THRIFT(thriftnb PUBLIC ${LIBEVENT_LIBRARIES}) ++ #endif() + ADD_PKGCONFIG_THRIFT(thrift-nb) + endif() + diff --git a/thrift/all/patches/cmake-0.16.0.patch b/thrift/all/patches/cmake-0.16.0.patch new file mode 100644 index 0000000..1998215 --- /dev/null +++ b/thrift/all/patches/cmake-0.16.0.patch @@ -0,0 +1,125 @@ +diff --git a/build/cmake/DefineInstallationPaths.cmake b/build/cmake/DefineInstallationPaths.cmake +index 23962b4..0c824cc 100644 +--- a/build/cmake/DefineInstallationPaths.cmake ++++ b/build/cmake/DefineInstallationPaths.cmake +@@ -20,11 +20,7 @@ + + # Define the default install paths + set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)") +-if(MSVC) +- set(LIB_INSTALL_DIR "bin${LIB_SUFFIX}" CACHE PATH "The library install dir (default: bin${LIB_SUFFIX})") +-else() +- set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})") +-endif() ++set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})") + set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)") + set(CMAKE_INSTALL_DIR "lib/cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)") + set(PKGCONFIG_INSTALL_DIR "lib/pkgconfig" CACHE PATH "The subdirectory to install pkgconfig config files (default: lib/pkgconfig)") +diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake +index 3cca31e..ffc2811 100644 +--- a/build/cmake/DefineOptions.cmake ++++ b/build/cmake/DefineOptions.cmake +@@ -39,11 +39,6 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON) + # and enables the library if all are found. This means the default is to build as + # much as possible but leaving out libraries if their dependencies are not met. + +-if (NOT Boost_USE_STATIC_LIBS) +- add_definitions(-DBOOST_ALL_DYN_LINK) +- add_definitions(-DBOOST_TEST_DYN_LINK) +-endif() +- + # as3 + option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON) + if (WITH_AS3) +@@ -90,6 +85,7 @@ if(WITH_CPP OR WITH_C_GLIB) + find_package(OpenSSL QUIET) + CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON + "OPENSSL_FOUND" OFF) ++ OPTION(WITH_OPENSSL "Build with OpenSSL support" ON) + endif() + + # Java +@@ -106,14 +102,10 @@ else() + endif() + + # Javascript +-option(WITH_JAVASCRIPT "Build Javascript Thrift library" ON) +-CMAKE_DEPENDENT_OPTION(BUILD_JAVASCRIPT "Build Javascript library" ON +- "BUILD_LIBRARIES;WITH_JAVASCRIPT;NOT WIN32; NOT CYGWIN" OFF) ++option(WITH_JAVASCRIPT "Build Javascript Thrift library" OFF) + + # NodeJS +-option(WITH_NODEJS "Build NodeJS Thrift library" ON) +-CMAKE_DEPENDENT_OPTION(BUILD_NODEJS "Build NodeJS library" ON +- "BUILD_LIBRARIES;WITH_NODEJS" OFF) ++option(WITH_NODEJS "Build NodeJS Thrift library" OFF) + + # Python + option(WITH_PYTHON "Build Python Thrift library" ON) +diff --git a/lib/c_glib/CMakeLists.txt b/lib/c_glib/CMakeLists.txt +index 218f7dd..b879830 100644 +--- a/lib/c_glib/CMakeLists.txt ++++ b/lib/c_glib/CMakeLists.txt +@@ -71,7 +71,8 @@ set(thrift_c_glib_zlib_SOURCES + ) + + # If OpenSSL is not found just ignore the OpenSSL stuff +-if(OPENSSL_FOUND AND WITH_OPENSSL) ++if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list(APPEND thrift_c_glib_SOURCES + src/thrift/c_glib/transport/thrift_ssl_socket.c + ) +@@ -83,8 +84,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL) + list(APPEND SYSLIBS OpenSSL::Crypto) + endif() + else() +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + endif() + +diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt +index 13b41c5..4b2b116 100755 +--- a/lib/cpp/CMakeLists.txt ++++ b/lib/cpp/CMakeLists.txt +@@ -96,7 +96,8 @@ else() + endif() + + # If OpenSSL is not found or disabled just ignore the OpenSSL stuff +-if(OPENSSL_FOUND AND WITH_OPENSSL) ++if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list(APPEND thriftcpp_SOURCES + src/thrift/transport/TSSLSocket.cpp + src/thrift/transport/TSSLServerSocket.cpp +@@ -111,8 +112,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL) + list(APPEND SYSLIBS OpenSSL::Crypto) + endif() + else() +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + endif() + +@@ -167,16 +167,11 @@ ADD_PKGCONFIG_THRIFT(thrift) + + if(WITH_LIBEVENT) + find_package(Libevent REQUIRED) # Libevent comes with CMake support from upstream +- include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) + + ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES}) + target_link_libraries(thriftnb PUBLIC thrift) +- if(TARGET libevent::core AND TARGET libevent::extra) +- # libevent was found via its cmake config, use modern style targets +- target_link_libraries(thriftnb PUBLIC libevent::core libevent::extra) +- else() +- target_link_libraries(thriftnb PUBLIC ${LIBEVENT_LIBRARIES}) +- endif() ++ # libevent was found via its cmake config, use modern style targets ++ target_link_libraries(thriftnb PUBLIC libevent::core libevent::extra) + ADD_PKGCONFIG_THRIFT(thrift-nb) + endif() + diff --git a/thrift/all/test_package/CMakeLists.txt b/thrift/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..d5da5a4 --- /dev/null +++ b/thrift/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Thrift CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} + calculator_constants.cpp + calculator_types.cpp + Calculator.cpp + test_package.cpp +) +target_link_libraries(${PROJECT_NAME} PRIVATE thrift::thrift) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/thrift/all/test_package/Calculator.cpp b/thrift/all/test_package/Calculator.cpp new file mode 100644 index 0000000..8d287de --- /dev/null +++ b/thrift/all/test_package/Calculator.cpp @@ -0,0 +1,436 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "Calculator.h" + + + + +Calculator_add_args::~Calculator_add_args() throw() { +} + + +uint32_t Calculator_add_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->num1); + this->__isset.num1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->num2); + this->__isset.num2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Calculator_add_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Calculator_add_args"); + + xfer += oprot->writeFieldBegin("num1", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->num1); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("num2", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->num2); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +Calculator_add_pargs::~Calculator_add_pargs() throw() { +} + + +uint32_t Calculator_add_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Calculator_add_pargs"); + + xfer += oprot->writeFieldBegin("num1", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((*(this->num1))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("num2", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((*(this->num2))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +Calculator_add_result::~Calculator_add_result() throw() { +} + + +uint32_t Calculator_add_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Calculator_add_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Calculator_add_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I64, 0); + xfer += oprot->writeI64(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +Calculator_add_presult::~Calculator_add_presult() throw() { +} + + +uint32_t Calculator_add_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +int64_t CalculatorClient::add(const int32_t num1, const int32_t num2) +{ + send_add(num1, num2); + return recv_add(); +} + +void CalculatorClient::send_add(const int32_t num1, const int32_t num2) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add", ::apache::thrift::protocol::T_CALL, cseqid); + + Calculator_add_pargs args; + args.num1 = &num1; + args.num2 = &num2; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +int64_t CalculatorClient::recv_add() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + int64_t _return; + Calculator_add_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add failed: unknown result"); +} + +bool CalculatorProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) { + ProcessMap::iterator pfn; + pfn = processMap_.find(fname); + if (pfn == processMap_.end()) { + iprot->skip(::apache::thrift::protocol::T_STRUCT); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'"); + oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return true; + } + (this->*(pfn->second))(seqid, iprot, oprot, callContext); + return true; +} + +void CalculatorProcessor::process_add(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Calculator.add", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Calculator.add"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Calculator.add"); + } + + Calculator_add_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Calculator.add", bytes); + } + + Calculator_add_result result; + try { + result.success = iface_->add(args.num1, args.num2); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Calculator.add"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Calculator.add"); + } + + oprot->writeMessageBegin("add", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Calculator.add", bytes); + } +} + +::std::shared_ptr< ::apache::thrift::TProcessor > CalculatorProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) { + ::apache::thrift::ReleaseHandler< CalculatorIfFactory > cleanup(handlerFactory_); + ::std::shared_ptr handler(handlerFactory_->getHandler(connInfo), cleanup); + ::std::shared_ptr<::apache::thrift::TProcessor> processor(new CalculatorProcessor(handler)); + return processor; +} + +int64_t CalculatorConcurrentClient::add(const int32_t num1, const int32_t num2) +{ + int32_t seqid = send_add(num1, num2); + return recv_add(seqid); +} + +int32_t CalculatorConcurrentClient::send_add(const int32_t num1, const int32_t num2) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("add", ::apache::thrift::protocol::T_CALL, cseqid); + + Calculator_add_pargs args; + args.num1 = &num1; + args.num2 = &num2; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +int64_t CalculatorConcurrentClient::recv_add(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + int64_t _return; + Calculator_add_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} diff --git a/thrift/all/test_package/Calculator.h b/thrift/all/test_package/Calculator.h new file mode 100644 index 0000000..7aca53a --- /dev/null +++ b/thrift/all/test_package/Calculator.h @@ -0,0 +1,303 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef Calculator_H +#define Calculator_H + +#include +#include +#include "calculator_types.h" + + + +#ifdef _MSC_VER + #pragma warning( push ) + #pragma warning (disable : 4250 ) //inheriting methods via dominance +#endif + +class CalculatorIf { + public: + virtual ~CalculatorIf() {} + virtual int64_t add(const int32_t num1, const int32_t num2) = 0; +}; + +class CalculatorIfFactory { + public: + typedef CalculatorIf Handler; + + virtual ~CalculatorIfFactory() {} + + virtual CalculatorIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0; + virtual void releaseHandler(CalculatorIf* /* handler */) = 0; +}; + +class CalculatorIfSingletonFactory : virtual public CalculatorIfFactory { + public: + CalculatorIfSingletonFactory(const std::shared_ptr& iface) : iface_(iface) {} + virtual ~CalculatorIfSingletonFactory() {} + + virtual CalculatorIf* getHandler(const ::apache::thrift::TConnectionInfo&) { + return iface_.get(); + } + virtual void releaseHandler(CalculatorIf* /* handler */) {} + + protected: + ::std::shared_ptr iface_; +}; + +class CalculatorNull : virtual public CalculatorIf { + public: + virtual ~CalculatorNull() {} + int64_t add(const int32_t /* num1 */, const int32_t /* num2 */) { + int64_t _return = 0; + return _return; + } +}; + +typedef struct _Calculator_add_args__isset { + _Calculator_add_args__isset() : num1(false), num2(false) {} + bool num1 :1; + bool num2 :1; +} _Calculator_add_args__isset; + +class Calculator_add_args { + public: + + Calculator_add_args(const Calculator_add_args&); + Calculator_add_args& operator=(const Calculator_add_args&); + Calculator_add_args() : num1(0), num2(0) { + } + + virtual ~Calculator_add_args() throw(); + int32_t num1; + int32_t num2; + + _Calculator_add_args__isset __isset; + + void __set_num1(const int32_t val); + + void __set_num2(const int32_t val); + + bool operator == (const Calculator_add_args & rhs) const + { + if (!(num1 == rhs.num1)) + return false; + if (!(num2 == rhs.num2)) + return false; + return true; + } + bool operator != (const Calculator_add_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Calculator_add_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Calculator_add_pargs { + public: + + + virtual ~Calculator_add_pargs() throw(); + const int32_t* num1; + const int32_t* num2; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Calculator_add_result__isset { + _Calculator_add_result__isset() : success(false) {} + bool success :1; +} _Calculator_add_result__isset; + +class Calculator_add_result { + public: + + Calculator_add_result(const Calculator_add_result&); + Calculator_add_result& operator=(const Calculator_add_result&); + Calculator_add_result() : success(0) { + } + + virtual ~Calculator_add_result() throw(); + int64_t success; + + _Calculator_add_result__isset __isset; + + void __set_success(const int64_t val); + + bool operator == (const Calculator_add_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const Calculator_add_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Calculator_add_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Calculator_add_presult__isset { + _Calculator_add_presult__isset() : success(false) {} + bool success :1; +} _Calculator_add_presult__isset; + +class Calculator_add_presult { + public: + + + virtual ~Calculator_add_presult() throw(); + int64_t* success; + + _Calculator_add_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +class CalculatorClient : virtual public CalculatorIf { + public: + CalculatorClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot); + } + CalculatorClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + setProtocol(iprot,oprot); + } + private: + void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot,prot); + } + void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + piprot_=iprot; + poprot_=oprot; + iprot_ = iprot.get(); + oprot_ = oprot.get(); + } + public: + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + int64_t add(const int32_t num1, const int32_t num2); + void send_add(const int32_t num1, const int32_t num2); + int64_t recv_add(); + protected: + std::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; + std::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; + ::apache::thrift::protocol::TProtocol* iprot_; + ::apache::thrift::protocol::TProtocol* oprot_; +}; + +class CalculatorProcessor : public ::apache::thrift::TDispatchProcessor { + protected: + ::std::shared_ptr iface_; + virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext); + private: + typedef void (CalculatorProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*); + typedef std::map ProcessMap; + ProcessMap processMap_; + void process_add(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + public: + CalculatorProcessor(::std::shared_ptr iface) : + iface_(iface) { + processMap_["add"] = &CalculatorProcessor::process_add; + } + + virtual ~CalculatorProcessor() {} +}; + +class CalculatorProcessorFactory : public ::apache::thrift::TProcessorFactory { + public: + CalculatorProcessorFactory(const ::std::shared_ptr< CalculatorIfFactory >& handlerFactory) : + handlerFactory_(handlerFactory) {} + + ::std::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo); + + protected: + ::std::shared_ptr< CalculatorIfFactory > handlerFactory_; +}; + +class CalculatorMultiface : virtual public CalculatorIf { + public: + CalculatorMultiface(std::vector >& ifaces) : ifaces_(ifaces) { + } + virtual ~CalculatorMultiface() {} + protected: + std::vector > ifaces_; + CalculatorMultiface() {} + void add(::std::shared_ptr iface) { + ifaces_.push_back(iface); + } + public: + int64_t add(const int32_t num1, const int32_t num2) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add(num1, num2); + } + return ifaces_[i]->add(num1, num2); + } + +}; + +// The 'concurrent' client is a thread safe client that correctly handles +// out of order responses. It is slower than the regular client, so should +// only be used when you need to share a connection among multiple threads +class CalculatorConcurrentClient : virtual public CalculatorIf { + public: + CalculatorConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot); + } + CalculatorConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + setProtocol(iprot,oprot); + } + private: + void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot,prot); + } + void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + piprot_=iprot; + poprot_=oprot; + iprot_ = iprot.get(); + oprot_ = oprot.get(); + } + public: + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + int64_t add(const int32_t num1, const int32_t num2); + int32_t send_add(const int32_t num1, const int32_t num2); + int64_t recv_add(const int32_t seqid); + protected: + std::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; + std::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; + ::apache::thrift::protocol::TProtocol* iprot_; + ::apache::thrift::protocol::TProtocol* oprot_; + ::apache::thrift::async::TConcurrentClientSyncInfo sync_; +}; + +#ifdef _MSC_VER + #pragma warning( pop ) +#endif + + + +#endif diff --git a/thrift/all/test_package/calc.thrift b/thrift/all/test_package/calc.thrift new file mode 100644 index 0000000..8fb142d --- /dev/null +++ b/thrift/all/test_package/calc.thrift @@ -0,0 +1,77 @@ +include "shared.thrift" + +namespace cpp tutorial +namespace d tutorial +namespace java tutorial +namespace php tutorial +namespace perl tutorial + +/** + * Thrift also lets you define constants for use across languages. Complex + * types and structs are specified using JSON notation. + */ +const i32 INT32CONSTANT = 9853 +const map MAPCONSTANT = {'hello':'world', 'goodnight':'moon'} + +/** + * You can define enums, which are just 32 bit integers. Values are optional + * and start at 1 if not supplied, C style again. + */ +enum Operation { + ADD = 1, + SUBTRACT = 2, + MULTIPLY = 3, + DIVIDE = 4 +} + +/** + * Structs are the basic complex data structures. They are comprised of fields + * which each have an integer identifier, a type, a symbolic name, and an + * optional default value. + * + * Fields can be declared "optional", which ensures they will not be included + * in the serialized output if they aren't set. Note that this requires some + * manual management in some languages. + */ +struct Work { + 1: i32 num1 = 0, + 2: i32 num2, + 3: Operation op, + 4: optional string comment, +} + +/** + * Structs can also be exceptions, if they are nasty. + */ +exception InvalidOperation { + 1: i32 what, + 2: string why +} + +/** + * Ahh, now onto the cool part, defining a service. Services just need a name + * and can optionally inherit from another service using the extends keyword. + */ +service Calculator extends shared.SharedService { + + /** + * A method definition looks like C code. It has a return type, arguments, + * and optionally a list of exceptions that it may throw. Note that argument + * lists and exception lists are specified using the exact same syntax as + * field lists in struct or exception definitions. + */ + + void ping(), + + i32 add(1:i32 num1, 2:i32 num2), + + i32 calculate(1:i32 logid, 2:Work w) throws (1:InvalidOperation ouch), + + /** + * This method has a oneway modifier. That means the client only makes + * a request and does not listen for any response at all. Oneway methods + * must be void. + */ + oneway void zip() + +} diff --git a/thrift/all/test_package/calculator_constants.cpp b/thrift/all/test_package/calculator_constants.cpp new file mode 100644 index 0000000..e6df4d9 --- /dev/null +++ b/thrift/all/test_package/calculator_constants.cpp @@ -0,0 +1,17 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "calculator_constants.h" + + + +const calculatorConstants g_calculator_constants; + +calculatorConstants::calculatorConstants() { +} + + + diff --git a/thrift/all/test_package/calculator_constants.h b/thrift/all/test_package/calculator_constants.h new file mode 100644 index 0000000..3bdeb7a --- /dev/null +++ b/thrift/all/test_package/calculator_constants.h @@ -0,0 +1,24 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef calculator_CONSTANTS_H +#define calculator_CONSTANTS_H + +#include "calculator_types.h" + + + +class calculatorConstants { + public: + calculatorConstants(); + +}; + +extern const calculatorConstants g_calculator_constants; + + + +#endif diff --git a/thrift/all/test_package/calculator_types.cpp b/thrift/all/test_package/calculator_types.cpp new file mode 100644 index 0000000..2924978 --- /dev/null +++ b/thrift/all/test_package/calculator_types.cpp @@ -0,0 +1,16 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "calculator_types.h" + +#include +#include + +#include + + + + diff --git a/thrift/all/test_package/calculator_types.h b/thrift/all/test_package/calculator_types.h new file mode 100644 index 0000000..bcdb62c --- /dev/null +++ b/thrift/all/test_package/calculator_types.h @@ -0,0 +1,23 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef calculator_TYPES_H +#define calculator_TYPES_H + +#include + +#include +#include +#include +#include +#include + + + + + + +#endif diff --git a/thrift/all/test_package/conanfile.py b/thrift/all/test_package/conanfile.py new file mode 100644 index 0000000..bf9e658 --- /dev/null +++ b/thrift/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=can_run(self)) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + self.run("thrift --version", env="conanrun") diff --git a/thrift/all/test_package/test_package.cpp b/thrift/all/test_package/test_package.cpp new file mode 100644 index 0000000..a6274b9 --- /dev/null +++ b/thrift/all/test_package/test_package.cpp @@ -0,0 +1,60 @@ +// This autogenerated skeleton file illustrates how to build a server. +// You should copy it to another filename to avoid overwriting it. + +#include "Calculator.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace apache::thrift; +using namespace apache::thrift::concurrency; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; +using namespace apache::thrift::server; + +class CalculatorHandler : virtual public CalculatorIf { + public: + CalculatorHandler() + { + } + + int64_t add(const int32_t num1, const int32_t num2) + { + return 0; + } + +}; + +int main(int argc, char **argv) { + int port = 9090; + std::shared_ptr handler(new CalculatorHandler()); + std::shared_ptr processor(new CalculatorProcessor(handler)); + std::shared_ptr serverTransport(new TServerSocket(port)); + std::shared_ptr transportFactory(new TBufferedTransportFactory()); + std::shared_ptr protocolFactory(new TBinaryProtocolFactory()); + + + TSimpleServer server1(processor, serverTransport, transportFactory, protocolFactory); + TThreadedServer server2(processor, serverTransport, transportFactory, protocolFactory); + TThreadPoolServer server3(processor, serverTransport, transportFactory, protocolFactory); + + const int workerCount = 4; + std::shared_ptr threadManager = ThreadManager::newSimpleThreadManager(workerCount); + threadManager->threadFactory(std::make_shared()); + + std::cout << "Thrift " << PACKAGE_VERSION << '\n'; + return EXIT_SUCCESS; +} diff --git a/thrift/all/test_v1_package/CMakeLists.txt b/thrift/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..be00a8c --- /dev/null +++ b/thrift/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/thrift/all/test_v1_package/conanfile.py b/thrift/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..26e744d --- /dev/null +++ b/thrift/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + self.run("thrift --version", run_environment=True) diff --git a/thrift/config.yml b/thrift/config.yml new file mode 100644 index 0000000..f54d461 --- /dev/null +++ b/thrift/config.yml @@ -0,0 +1,15 @@ +versions: + "0.20.0": + folder: all + "0.18.1": + folder: all + "0.17.0": + folder: all + "0.16.0": + folder: all + "0.15.0": + folder: all + "0.14.2": + folder: all + "0.14.1": + folder: all diff --git a/xsimd/all/conandata.yml b/xsimd/all/conandata.yml new file mode 100644 index 0000000..04062fa --- /dev/null +++ b/xsimd/all/conandata.yml @@ -0,0 +1,43 @@ +sources: + "13.0.0": + url: "https://github.com/xtensor-stack/xsimd/archive/13.0.0.tar.gz" + sha256: "8bdbbad0c3e7afa38d88d0d484d70a1671a1d8aefff03f4223ab2eb6a41110a3" + "12.1.1": + url: "https://github.com/xtensor-stack/xsimd/archive/12.1.1.tar.gz" + sha256: "73f94a051278ef3da4533b691d31244d12074d5d71107473a9fd8d7be15f0110" + "12.1.0": + url: "https://github.com/xtensor-stack/xsimd/archive/12.1.0.tar.gz" + sha256: "86b86e0aeba7a85575f6e079728f0c2b65307dddb7210487f2b7cb261ac8a4a2" + "12.0.0": + url: "https://github.com/xtensor-stack/xsimd/archive/12.0.0.tar.gz" + sha256: "6f156ec9bcc602d2581ef023ef0e927e3759c30cf1405028210e8c103a4f846d" + "11.2.0": + url: "https://github.com/xtensor-stack/xsimd/archive/11.2.0.tar.gz" + sha256: "509bbfe12e78ee1a0e81711019e7c7a372dabcff566dbf15b95cc94339443242" + "11.1.0": + url: "https://github.com/xtensor-stack/xsimd/archive/11.1.0.tar.gz" + sha256: "aa54dba8daade472656eba0d27154f072fec06ee3831aefcac69a5f6c7dbbae7" + "11.0.0": + url: "https://github.com/xtensor-stack/xsimd/archive/11.0.0.tar.gz" + sha256: "50c31c319c8b36c8946eb954c7cca2e2ece86bf8a66a7ebf321b24cd273e7c47" + "10.0.0": + url: "https://github.com/xtensor-stack/xsimd/archive/10.0.0.tar.gz" + sha256: "73f818368b3a4dad92fab1b2933d93694241bd2365a6181747b2df1768f6afdd" + "9.0.1": + url: "https://github.com/xtensor-stack/xsimd/archive/9.0.1.tar.gz" + sha256: "b1bb5f92167fd3a4f25749db0be7e61ed37e0a5d943490f3accdcd2cd2918cc0" + "8.1.0": + url: "https://github.com/xtensor-stack/xsimd/archive/8.1.0.tar.gz" + sha256: "d52551360d37709675237d2a0418e28f70995b5b7cdad7c674626bcfbbf48328" + "8.0.5": + url: "https://github.com/xtensor-stack/xsimd/archive/8.0.5.tar.gz" + sha256: "0e1b5d973b63009f06a3885931a37452580dbc8d7ca8ad40d4b8c80d2a0f84d7" + "8.0.3": + url: "https://github.com/xtensor-stack/xsimd/archive/refs/tags/8.0.3.tar.gz" + sha256: "d1d41253c4f82eaf2f369d7fcb4142e35076cf8675b9d94caa06ecf883024344" + "7.5.0": + url: "https://github.com/xtensor-stack/xsimd/archive/refs/tags/7.5.0.tar.gz" + sha256: "45337317c7f238fe0d64bb5d5418d264a427efc53400ddf8e6a964b6bcb31ce9" + "7.4.10": + url: "https://github.com/xtensor-stack/xsimd/archive/7.4.10.tar.gz" + sha256: "df00f476dea0c52ffebad60924e3f0db2a016b80d508f8d5a2399a74c0d134cd" diff --git a/xsimd/all/conanfile.py b/xsimd/all/conanfile.py new file mode 100644 index 0000000..b22729f --- /dev/null +++ b/xsimd/all/conanfile.py @@ -0,0 +1,115 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd +import os +import textwrap + +required_conan_version = ">=1.50.0" + + +class XsimdConan(ConanFile): + name = "xsimd" + description = "C++ wrappers for SIMD intrinsics and parallelized, optimized mathematical functions (SSE, AVX, NEON, AVX512)" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xtensor-stack/xsimd" + topics = ("simd-intrinsics", "vectorization", "simd", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "xtl_complex": [True, False], + } + default_options = { + "xtl_complex": False, + } + no_copy_source = True + + @property + def _min_cppstd(self): + return 14 if self.options.xtl_complex else 11 + + @property + def _compilers_minimum_version(self): + return { + "14": { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) + + def requirements(self): + if self.options.xtl_complex: + self.requires("xtl/0.7.5") + + def package_id(self): + self.info.clear() + + def validate(self): + # TODO: check supported version (probably >= 8.0.0) + if Version(self.version) < "8.0.0" and is_apple_os(self) and self.settings.arch in ["armv8", "armv8_32", "armv8.3"]: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support macOS M1") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + includedir = os.path.join(self.source_folder, "include") + copy(self, "*.hpp", src=includedir, dst=os.path.join(self.package_folder, "include")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"xsimd": "xsimd::xsimd"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "xsimd") + self.cpp_info.set_property("cmake_target_name", "xsimd") + self.cpp_info.set_property("pkg_config_name", "xsimd") + if self.options.xtl_complex: + self.cpp_info.defines = ["XSIMD_ENABLE_XTL_COMPLEX=1"] + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + ## TODO: workaround for arm compilation issue : https://github.com/xtensor-stack/xsimd/issues/735 + if Version(self.version) >= "9.0.0" and \ + is_apple_os(self) and self.settings.arch in ["armv8", "armv8_32", "armv8.3"]: + self.cpp_info.cxxflags.extend(["-flax-vector-conversions", "-fsigned-char",]) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/xsimd/all/test_package/CMakeLists.txt b/xsimd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..0624e26 --- /dev/null +++ b/xsimd/all/test_package/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(CheckCXXCompilerFlag) + +find_package(xsimd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE xsimd) + +if (XSIMD_WITH_XTL) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() + +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + foreach(flag "/arch:AVX") + CHECK_CXX_COMPILER_FLAG(${flag} COMPILER_SUPPORTS_MARCH_NATIVE) + if(COMPILER_SUPPORTS_MARCH_NATIVE) + target_compile_options(${PROJECT_NAME} PRIVATE ${flag}) + endif() + endforeach() +elseif ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) + foreach(flag "-march=native" "-mtune=native") + CHECK_CXX_COMPILER_FLAG(${flag} COMPILER_SUPPORTS_MARCH_NATIVE) + if(COMPILER_SUPPORTS_MARCH_NATIVE) + target_compile_options(${PROJECT_NAME} PRIVATE ${flag}) + endif() + endforeach() +endif() diff --git a/xsimd/all/test_package/conanfile.py b/xsimd/all/test_package/conanfile.py new file mode 100644 index 0000000..21848ef --- /dev/null +++ b/xsimd/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.cmake import CMakeDeps, CMakeToolchain +from conan.tools.env import VirtualBuildEnv +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["XSIMD_WITH_XTL"] = self.dependencies["xsimd"].options.xtl_complex + tc.generate() + tc = CMakeDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate(scope="build") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/xsimd/all/test_package/test_package.cpp b/xsimd/all/test_package/test_package.cpp new file mode 100644 index 0000000..ed1e514 --- /dev/null +++ b/xsimd/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include "xsimd/xsimd.hpp" +#include + +int main(int argc, char *argv[]) { + namespace xs = xsimd; +#if XSIMD_VERSION_MAJOR < 8 + xs::batch a(1., 1.); + xs::batch b(2., 2.); +#else + auto a = xs::broadcast(1.); + auto b = xs::broadcast(2.); +#endif + + auto mean = (a + b) / 2.; + std::cout << "Mean: " << mean << std::endl; + return 0; +} diff --git a/xsimd/all/test_v1_package/CMakeLists.txt b/xsimd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..9d54a09 --- /dev/null +++ b/xsimd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/xsimd/all/test_v1_package/conanfile.py b/xsimd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..71bd246 --- /dev/null +++ b/xsimd/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["XSIMD_WITH_XTL"] = self.options["xsimd"].xtl_complex + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/xsimd/config.yml b/xsimd/config.yml new file mode 100644 index 0000000..1f8cc88 --- /dev/null +++ b/xsimd/config.yml @@ -0,0 +1,29 @@ +versions: + "13.0.0": + folder: all + "12.1.1": + folder: all + "12.1.0": + folder: all + "12.0.0": + folder: all + "11.2.0": + folder: all + "11.1.0": + folder: all + "11.0.0": + folder: all + "10.0.0": + folder: all + "9.0.1": + folder: all + "8.1.0": + folder: all + "8.0.5": + folder: all + "8.0.3": + folder: all + "7.5.0": + folder: all + "7.4.10": + folder: all diff --git a/xz_utils/all/conandata.yml b/xz_utils/all/conandata.yml new file mode 100644 index 0000000..3274a9b --- /dev/null +++ b/xz_utils/all/conandata.yml @@ -0,0 +1,41 @@ +sources: + "5.4.5": + url: + - "https://tukaani.org/xz/xz-5.4.5.tar.xz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/da9dec6c12cf2ecf269c31ab65b5de18e8e52b96f35d5bcd08c12b43e6878803" + sha256: "da9dec6c12cf2ecf269c31ab65b5de18e8e52b96f35d5bcd08c12b43e6878803" + "5.4.4": + url: + - "https://tukaani.org/xz/xz-5.4.4.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/aae39544e254cfd27e942d35a048d592959bd7a79f9a624afb0498bb5613bdf8" + sha256: "aae39544e254cfd27e942d35a048d592959bd7a79f9a624afb0498bb5613bdf8" + "5.4.2": + url: + - "https://tukaani.org/xz/xz-5.4.2.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/87947679abcf77cc509d8d1b474218fd16b72281e2797360e909deaee1ac9d05" + sha256: "87947679abcf77cc509d8d1b474218fd16b72281e2797360e909deaee1ac9d05" + "5.4.0": + url: + - "https://tukaani.org/xz/xz-5.4.0.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/7471ef5991f690268a8f2be019acec2e0564b7b233ca40035f339fe9a07f830b" + sha256: "7471ef5991f690268a8f2be019acec2e0564b7b233ca40035f339fe9a07f830b" + "5.2.10": + url: + - "https://tukaani.org/xz/xz-5.2.10.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/eb7a3b2623c9d0135da70ca12808a214be9c019132baaa61c9e1d198d1d9ded3" + sha256: "eb7a3b2623c9d0135da70ca12808a214be9c019132baaa61c9e1d198d1d9ded3" + "5.2.5": + url: + - "https://tukaani.org/xz/xz-5.2.5.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10" + sha256: "f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10" + "5.2.4": + url: + - "https://tukaani.org/xz/xz-5.2.4.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145" + sha256: "b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145" +patches: + "5.2.4": + - patch_file: "patches/0001-relax_windows-sdk-restriction.patch" + patch_description: "Relax Windows SDK restriction" + patch_type: "conan" diff --git a/xz_utils/all/conanfile.py b/xz_utils/all/conanfile.py new file mode 100644 index 0000000..388fe0c --- /dev/null +++ b/xz_utils/all/conanfile.py @@ -0,0 +1,201 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, MSBuild, MSBuildToolchain +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class XZUtilsConan(ConanFile): + name = "xz_utils" + description = ( + "XZ Utils is free general-purpose data compression software with a high " + "compression ratio. XZ Utils were written for POSIX-like systems, but also " + "work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils." + ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://tukaani.org/xz" + topics = ("lzma", "xz", "compression") + license = "Unlicense", "LGPL-2.1-or-later", "GPL-2.0-or-later", "GPL-3.0-or-later" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _effective_msbuild_type(self): + # treat "RelWithDebInfo" and "MinSizeRel" as "Release" + # there is no DebugMT configuration in upstream vcxproj, we patch Debug configuration afterwards + return "{}{}".format( + "Debug" if self.settings.build_type == "Debug" else "Release", + "MT" if is_msvc_static_runtime(self) and self.settings.build_type != "Debug" else "", + ) + + @property + def _msbuild_target(self): + return "liblzma_dll" if self.options.shared else "liblzma" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._effective_msbuild_type + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-doc") + if self.settings.build_type == "Debug": + tc.configure_args.append("--enable-debug") + tc.generate() + + @property + def _msvc_sln_folder(self): + if (str(self.settings.compiler) == "Visual Studio" and Version(self.settings.compiler) >= "15") or \ + (str(self.settings.compiler) == "msvc" and Version(self.settings.compiler) >= "191"): + return "vs2017" + return "vs2013" + + def _build_msvc(self): + build_script_folder = os.path.join(self.source_folder, "windows", self._msvc_sln_folder) + + #============================== + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client. + vcxproj_files = [ + os.path.join(build_script_folder, "liblzma.vcxproj"), + os.path.join(build_script_folder, "liblzma_dll.vcxproj"), + ] + if (str(self.settings.compiler) == "Visual Studio" and Version(self.settings.compiler) >= "15") or \ + (str(self.settings.compiler) == "msvc" and Version(self.settings.compiler) >= "191"): + old_toolset = "v141" + else: + old_toolset = "v120" + new_toolset = MSBuildToolchain(self).toolset + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + for vcxproj_file in vcxproj_files: + replace_in_file( + self, vcxproj_file, + f"{old_toolset}", + f"{new_toolset}", + ) + replace_in_file( + self, vcxproj_file, + "", + f"", + ) + #============================== + + msbuild = MSBuild(self) + msbuild.build_type = self._effective_msbuild_type + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(os.path.join(build_script_folder, "xz_win.sln"), targets=[self._msbuild_target]) + + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + self._build_msvc() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + inc_dir = os.path.join(self.source_folder, "src", "liblzma", "api") + copy(self, "*.h", src=inc_dir, dst=os.path.join(self.package_folder, "include")) + output_dir = os.path.join(self.source_folder, "windows") + copy(self, "*.lib", src=output_dir, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=output_dir, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + rename(self, os.path.join(self.package_folder, "lib", "liblzma.lib"), + os.path.join(self.package_folder, "lib", "lzma.lib")) + else: + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path), + ) + + def _create_cmake_module_variables(self, module_file): + # TODO: also add LIBLZMA_HAS_AUTO_DECODER, LIBLZMA_HAS_EASY_ENCODER & LIBLZMA_HAS_LZMA_PRESET + content = textwrap.dedent(f"""\ + set(LIBLZMA_FOUND TRUE) + if(DEFINED LibLZMA_INCLUDE_DIRS) + set(LIBLZMA_INCLUDE_DIRS ${{LibLZMA_INCLUDE_DIRS}}) + endif() + if(DEFINED LibLZMA_LIBRARIES) + set(LIBLZMA_LIBRARIES ${{LibLZMA_LIBRARIES}}) + endif() + set(LIBLZMA_VERSION_MAJOR {Version(self.version).major}) + set(LIBLZMA_VERSION_MINOR {Version(self.version).minor}) + set(LIBLZMA_VERSION_PATCH {Version(self.version).patch}) + set(LIBLZMA_VERSION_STRING "{self.version}") + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "LibLZMA") + self.cpp_info.set_property("cmake_target_name", "LibLZMA::LibLZMA") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.set_property("pkg_config_name", "liblzma") + self.cpp_info.libs = ["lzma"] + if not self.options.shared: + self.cpp_info.defines.append("LZMA_API_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "LibLZMA" + self.cpp_info.names["cmake_find_package_multi"] = "LibLZMA" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] diff --git a/xz_utils/all/patches/0001-relax_windows-sdk-restriction.patch b/xz_utils/all/patches/0001-relax_windows-sdk-restriction.patch new file mode 100644 index 0000000..d968098 --- /dev/null +++ b/xz_utils/all/patches/0001-relax_windows-sdk-restriction.patch @@ -0,0 +1,20 @@ +--- a/windows/vs2017/liblzma.vcxproj ++++ b/windows/vs2017/liblzma.vcxproj +@@ -29,7 +29,6 @@ + + {12728250-16EC-4DC6-94D7-E21DD88947F8} + Win32Proj +- 10.0.15063.0 + + + +--- a/windows/vs2017/liblzma_dll.vcxproj ++++ b/windows/vs2017/liblzma_dll.vcxproj +@@ -29,7 +29,6 @@ + + {E0F247DB-EF12-4755-8DF9-F74BCD1348F7} + Win32Proj +- 10.0.15063.0 + + + diff --git a/xz_utils/all/test_package/CMakeLists.txt b/xz_utils/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..cd4e960 --- /dev/null +++ b/xz_utils/all/test_package/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(LibLZMA REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE LibLZMA::LibLZMA) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindLibLZMA.html +# are properly defined in conan generators +set(_custom_vars + LIBLZMA_FOUND + LIBLZMA_INCLUDE_DIRS + LIBLZMA_LIBRARIES + LIBLZMA_VERSION_MAJOR + LIBLZMA_VERSION_MINOR + LIBLZMA_VERSION_PATCH + LIBLZMA_VERSION_STRING +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/xz_utils/all/test_package/conanfile.py b/xz_utils/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/xz_utils/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/xz_utils/all/test_package/test_package.c b/xz_utils/all/test_package/test_package.c new file mode 100644 index 0000000..a1f55ac --- /dev/null +++ b/xz_utils/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include +#include + +int main() { + printf("LZMA version %s\n", lzma_version_string()); + return EXIT_SUCCESS; +} diff --git a/xz_utils/all/test_v1_package/CMakeLists.txt b/xz_utils/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/xz_utils/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/xz_utils/all/test_v1_package/conanfile.py b/xz_utils/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..19e6a0c --- /dev/null +++ b/xz_utils/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/xz_utils/config.yml b/xz_utils/config.yml new file mode 100644 index 0000000..d950dab --- /dev/null +++ b/xz_utils/config.yml @@ -0,0 +1,15 @@ +versions: + "5.4.5": + folder: all + "5.4.4": + folder: all + "5.4.2": + folder: all + "5.4.0": + folder: all + "5.2.10": + folder: all + "5.2.5": + folder: all + "5.2.4": + folder: all diff --git a/yaml-cpp/all/conandata.yml b/yaml-cpp/all/conandata.yml new file mode 100644 index 0000000..542de36 --- /dev/null +++ b/yaml-cpp/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "0.8.0": + url: "https://github.com/jbeder/yaml-cpp/archive/refs/tags/0.8.0.tar.gz" + sha256: "fbe74bbdcee21d656715688706da3c8becfd946d92cd44705cc6098bb23b3a16" + "0.7.0": + url: "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.7.0.tar.gz" + sha256: "43e6a9fcb146ad871515f0d0873947e5d497a1c9c60c58cb102a97b47208b7c3" + "0.6.3": + url: "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.6.3.tar.gz" + sha256: "77ea1b90b3718aa0c324207cb29418f5bced2354c2e483a9523d98c3460af1ed" +patches: + "0.7.0": + - patch_file: "patches/0001-install-0.7.0.patch" + patch_description: "trigger installation through add_subdirectory from another CMakeLists.txt" + patch_type: "conan" + patch_source: "https://github.com/jbeder/yaml-cpp/pull/847" + - patch_file: "patches/0002-libcxx-and-gcc.patch" + patch_description: "Adds assert to enable compilation with libcxx + gcc" + patch_type: "portability" + patch_source: "https://github.com/jbeder/yaml-cpp/pull/947" diff --git a/yaml-cpp/all/conanfile.py b/yaml-cpp/all/conanfile.py new file mode 100644 index 0000000..29c95c5 --- /dev/null +++ b/yaml-cpp/all/conanfile.py @@ -0,0 +1,124 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.53.0" + + +class YamlCppConan(ConanFile): + name = "yaml-cpp" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jbeder/yaml-cpp" + topics = ("yaml", "yaml-parser", "serialization", "data-serialization") + description = "A YAML parser and emitter in C++" + license = "MIT" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + f"Visual Studio build for {self.name} shared library with MT runtime is not supported" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["YAML_CPP_BUILD_TESTS"] = False + tc.variables["YAML_CPP_BUILD_CONTRIB"] = True + tc.variables["YAML_CPP_BUILD_TOOLS"] = False + tc.variables["YAML_CPP_INSTALL"] = True + tc.variables["YAML_BUILD_SHARED_LIBS"] = self.options.shared + if is_msvc(self): + tc.variables["YAML_MSVC_SHARED_RT"] = not is_msvc_static_runtime(self) + tc.preprocessor_definitions["_NOEXCEPT"] = "noexcept" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "CMake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"yaml-cpp": "yaml-cpp::yaml-cpp"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "yaml-cpp") + self.cpp_info.set_property("cmake_target_name", "yaml-cpp::yaml-cpp") + self.cpp_info.set_property("cmake_target_aliases", ["yaml-cpp"]) # CMake imported target before 0.8.0 + self.cpp_info.set_property("pkg_config_name", "yaml-cpp") + self.cpp_info.libs = collect_libs(self) + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs.append("m") + if is_msvc(self): + self.cpp_info.defines.append("_NOEXCEPT=noexcept") + if Version(self.version) < "0.8.0": + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("YAML_CPP_DLL") + else: + if not self.options.shared: + self.cpp_info.defines.append("YAML_CPP_STATIC_DEFINE") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/yaml-cpp/all/patches/0001-install-0.7.0.patch b/yaml-cpp/all/patches/0001-install-0.7.0.patch new file mode 100644 index 0000000..d826281 --- /dev/null +++ b/yaml-cpp/all/patches/0001-install-0.7.0.patch @@ -0,0 +1,17 @@ +# see issue https://github.com/jbeder/yaml-cpp/pull/847 +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b230b9e..35dfdca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,9 +24,8 @@ option(YAML_BUILD_SHARED_LIBS "Build yaml-cpp shared library" ${BUILD_SHARED_LIB + cmake_dependent_option(YAML_CPP_BUILD_TESTS + "Enable yaml-cpp tests" ON + "BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF) +-cmake_dependent_option(YAML_CPP_INSTALL +- "Enable generation of yaml-cpp install targets" ON +- "CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF) ++option(YAML_CPP_INSTALL ++ "Enable generation of yaml-cpp install targets" ON) + cmake_dependent_option(YAML_MSVC_SHARED_RT + "MSVC: Build yaml-cpp with shared runtime libs (/MD)" ON + "MSVC" OFF) diff --git a/yaml-cpp/all/patches/0002-libcxx-and-gcc.patch b/yaml-cpp/all/patches/0002-libcxx-and-gcc.patch new file mode 100644 index 0000000..2602a4a --- /dev/null +++ b/yaml-cpp/all/patches/0002-libcxx-and-gcc.patch @@ -0,0 +1,23 @@ +From 79aa6d53e5718ca44bc01ef05fdda7a849d353e0 Mon Sep 17 00:00:00 2001 +From: mjvankampen +Date: Thu, 15 Jul 2021 22:09:05 +0100 +Subject: [PATCH] Add assert to enable compilation with libcxx + gcc (#947) + +--- + include/yaml-cpp/node/iterator.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/include/yaml-cpp/node/iterator.h b/include/yaml-cpp/node/iterator.h +index b44723817..1fcf6e400 100644 +--- a/include/yaml-cpp/node/iterator.h ++++ b/include/yaml-cpp/node/iterator.h +@@ -15,6 +15,9 @@ + #include + #include + ++// Assert in place so gcc + libc++ combination properly builds ++static_assert(std::is_constructible::value, "Node must be copy constructable"); ++ + namespace YAML { + namespace detail { + struct iterator_value : public Node, std::pair { diff --git a/yaml-cpp/all/test_package/CMakeLists.txt b/yaml-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..293d6d7 --- /dev/null +++ b/yaml-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(yaml-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE yaml-cpp::yaml-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/yaml-cpp/all/test_package/conanfile.py b/yaml-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/yaml-cpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/yaml-cpp/all/test_package/test_package.cpp b/yaml-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000..5d97f12 --- /dev/null +++ b/yaml-cpp/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include "yaml-cpp/yaml.h" + +void parsing_nodes() { + YAML::Node primes = YAML::Load("[2, 3, 5, 7, 11]"); + std::cout << "Size: " << primes.size() << '\n'; +} + +void building_nodes() { + YAML::Emitter emitter; + emitter << YAML::BeginMap; + emitter << YAML::Key << "name"; + emitter << YAML::Value << "Ryan Braun"; + emitter << YAML::Key << "position"; + emitter << YAML::Value << "LF"; + emitter << YAML::EndMap; + std::cout << emitter.c_str() << '\n'; +} + +int main() { + parsing_nodes(); + building_nodes(); + return 0; +} diff --git a/yaml-cpp/all/test_v1_package/CMakeLists.txt b/yaml-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..925ecbe --- /dev/null +++ b/yaml-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/yaml-cpp/all/test_v1_package/conanfile.py b/yaml-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/yaml-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/yaml-cpp/config.yml b/yaml-cpp/config.yml new file mode 100644 index 0000000..3ad5266 --- /dev/null +++ b/yaml-cpp/config.yml @@ -0,0 +1,7 @@ +versions: + "0.8.0": + folder: all + "0.7.0": + folder: all + "0.6.3": + folder: all diff --git a/zlib/all/conandata.yml b/zlib/all/conandata.yml new file mode 100644 index 0000000..e069fd4 --- /dev/null +++ b/zlib/all/conandata.yml @@ -0,0 +1,57 @@ +sources: + "1.3.1": + url: + - "https://zlib.net/fossils/zlib-1.3.1.tar.gz" + - "https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz" + sha256: "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23" + "1.3": + url: + - "https://zlib.net/fossils/zlib-1.3.tar.gz" + - "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz" + sha256: "ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e" + "1.2.13": + url: + - "https://zlib.net/fossils/zlib-1.2.13.tar.gz" + - "https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz" + sha256: "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30" + "1.2.12": + url: "https://zlib.net/fossils/zlib-1.2.12.tar.gz" + sha256: "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9" + "1.2.11": + url: "https://zlib.net/fossils/zlib-1.2.11.tar.gz" + sha256: "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1" +patches: + "1.3.1": + - patch_file: "patches/1.3.1/0001-fix-cmake.patch" + patch_description: "separate static/shared builds, disable debug suffix" + patch_type: "conan" + "1.3": + - patch_file: "patches/1.3/0001-fix-cmake.patch" + patch_description: "separate static/shared builds, disable debug suffix, disable building examples" + patch_type: "conan" + "1.2.13": + - patch_file: "patches/1.2.13/0001-Fix-cmake.patch" + patch_description: "separate static/shared builds, disable debug suffix, disable building examples" + patch_type: "conan" + "1.2.12": + - patch_file: "patches/1.2.x/0001-fix-cmake.patch" + patch_description: "separate static/shared builds, disable debug suffix, disable building examples" + patch_type: "conan" + - patch_file: "patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch" + patch_description: "CVE-2022-37434: Fix a bug when getting a gzip header extra field with inflate()" + patch_type: "vulnerability" + patch_source: "https://github.com/madler/zlib/commit/eff308af425b67093bab25f80f1ae950166bece1" + sha256: "15e3c177dc2a034a22e02490a97ba5b1719aae3f8129a06c16d727b661d1650f" + - patch_file: "patches/1.2.x/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch" + patch_description: "CVE-2022-37434: Fix extra field processing bug that dereferences NULL state->head" + patch_type: "vulnerability" + patch_source: "https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d" + sha256: "cdd69eb3251728b1875c8ecae6427b50aa750b4045ef984ab79b6c07b7e6dd3a" + "1.2.11": + - patch_file: "patches/1.2.x/0001-fix-cmake.patch" + patch_description: "separate static/shared builds, disable debug suffix, disable building examples" + patch_type: "conan" + - patch_file: "patches/1.2.x/0003-gzguts-fix-widechar-condition.patch" + patch_description: "fix condition for WIDECHAR usage" + patch_type: "portability" + patch_source: "https://github.com/madler/zlib/issues/268" diff --git a/zlib/all/conanfile.py b/zlib/all/conanfile.py new file mode 100644 index 0000000..834fcf9 --- /dev/null +++ b/zlib/all/conanfile.py @@ -0,0 +1,110 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, load, replace_in_file, save +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class ZlibConan(ConanFile): + name = "zlib" + package_type = "library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://zlib.net" + license = "Zlib" + description = ("A Massively Spiffy Yet Delicately Unobtrusive Compression Library " + "(Also Free, Not to Mention Unencumbered by Patents)") + topics = ("zlib", "compression") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SKIP_INSTALL_ALL"] = False + tc.variables["SKIP_INSTALL_LIBRARIES"] = False + tc.variables["SKIP_INSTALL_HEADERS"] = False + tc.variables["SKIP_INSTALL_FILES"] = True + # Correct for misuse of "${CMAKE_INSTALL_PREFIX}/" in CMakeLists.txt + tc.variables["INSTALL_LIB_DIR"] = "lib" + tc.variables["INSTALL_INC_DIR"] = "include" + tc.variables["ZLIB_BUILD_EXAMPLES"] = False + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + is_apple_clang12 = self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) >= "12.0" + if not is_apple_clang12: + for filename in ['zconf.h', 'zconf.h.cmakein', 'zconf.h.in']: + filepath = os.path.join(self.source_folder, filename) + replace_in_file(self, filepath, + '#ifdef HAVE_UNISTD_H ' + '/* may be set to #if 1 by ./configure */', + '#if defined(HAVE_UNISTD_H) && (1-HAVE_UNISTD_H-1 != 0)') + replace_in_file(self, filepath, + '#ifdef HAVE_STDARG_H ' + '/* may be set to #if 1 by ./configure */', + '#if defined(HAVE_STDARG_H) && (1-HAVE_STDARG_H-1 != 0)') + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def _extract_license(self): + tmp = load(self, os.path.join(self.source_folder, "zlib.h")) + license_contents = tmp[2:tmp.find("*/", 1)] + return license_contents + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "ZLIB") + self.cpp_info.set_property("cmake_target_name", "ZLIB::ZLIB") + self.cpp_info.set_property("pkg_config_name", "zlib") + if self.settings.os == "Windows" and not self._is_mingw: + libname = "zdll" if self.options.shared else "zlib" + else: + libname = "z" + self.cpp_info.libs = [libname] + + self.cpp_info.names["cmake_find_package"] = "ZLIB" + self.cpp_info.names["cmake_find_package_multi"] = "ZLIB" diff --git a/zlib/all/patches/1.2.13/0001-Fix-cmake.patch b/zlib/all/patches/1.2.13/0001-Fix-cmake.patch new file mode 100644 index 0000000..a0748ec --- /dev/null +++ b/zlib/all/patches/1.2.13/0001-Fix-cmake.patch @@ -0,0 +1,118 @@ +From 9a709a43549fbe23ca41eeb450d4c71e3b78c8c4 Mon Sep 17 00:00:00 2001 +From: Mikhail Lappo +Date: Fri, 14 Oct 2022 13:29:56 +0200 +Subject: [PATCH] Fix cmake + +--- + CMakeLists.txt | 33 +++++++++++++++++++++------------ + 1 file changed, 21 insertions(+), 12 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b412dc7..a5284ed 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 2.4.4) ++cmake_minimum_required(VERSION 3.0) # it's important to have https://cmake.org/cmake/help/latest/policy/CMP0042.html#policy:CMP0042 + set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) + + project(zlib C) +@@ -57,7 +57,6 @@ endif() + check_include_file(unistd.h Z_HAVE_UNISTD_H) + + if(MSVC) +- set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +@@ -80,7 +79,7 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein + ${ZLIB_PC} @ONLY) + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein + ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY) +-include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) ++include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + + + #============================================================================ +@@ -120,7 +119,7 @@ set(ZLIB_SRCS + zutil.c + ) + +-if(NOT MINGW) ++if(MSVC) + set(ZLIB_DLL_SRCS + win32/zlib1.rc # If present will override custom build rule below. + ) +@@ -131,7 +130,7 @@ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) + string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" + "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) + +-if(MINGW) ++if(WIN32 AND NOT MSVC) + # This gets us DLL resource information when compiling on MinGW. + if(NOT CMAKE_RC_COMPILER) + set(CMAKE_RC_COMPILER windres.exe) +@@ -145,12 +144,15 @@ if(MINGW) + -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj + -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) +-endif(MINGW) ++endif() + ++if(BUILD_SHARED_LIBS) + add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) ++else() ++add_library(zlib STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++endif() + + if(NOT CYGWIN) + # This property causes shared libraries on Linux to have the full version +@@ -163,19 +165,24 @@ if(NOT CYGWIN) + set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION}) + endif() + +-if(UNIX) ++if(WIN32 AND NOT MINGW) ++ if(BUILD_SHARED_LIBS) ++ set_target_properties(zlib PROPERTIES ARCHIVE_OUTPUT_NAME zdll) ++ endif() ++else() + # On unix-like platforms the library is almost always called libz +- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) ++ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) + if(NOT APPLE) + set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") + endif() +-elseif(BUILD_SHARED_LIBS AND WIN32) ++endif() ++if(BUILD_SHARED_LIBS AND WIN32) + # Creates zlib1.dll when building shared library version +- set_target_properties(zlib PROPERTIES SUFFIX "1.dll") ++ set_target_properties(zlib PROPERTIES PREFIX "" RUNTIME_OUTPUT_NAME "zlib1") + endif() + + if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) +- install(TARGETS zlib zlibstatic ++ install(TARGETS zlib + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) +@@ -194,6 +201,7 @@ endif() + # Example binaries + #============================================================================ + ++if(0) + add_executable(example test/example.c) + target_link_libraries(example zlib) + add_test(example example) +@@ -211,3 +219,4 @@ if(HAVE_OFF64_T) + target_link_libraries(minigzip64 zlib) + set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") + endif() ++endif() +-- +2.24.3 (Apple Git-128) + diff --git a/zlib/all/patches/1.2.x/0001-fix-cmake.patch b/zlib/all/patches/1.2.x/0001-fix-cmake.patch new file mode 100644 index 0000000..f99f0b5 --- /dev/null +++ b/zlib/all/patches/1.2.x/0001-fix-cmake.patch @@ -0,0 +1,104 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 2.4.4) ++cmake_minimum_required(VERSION 3.0) # it's important to have https://cmake.org/cmake/help/latest/policy/CMP0042.html#policy:CMP0042 + set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) + + project(zlib C) +@@ -60,7 +60,6 @@ endif() + check_include_file(unistd.h Z_HAVE_UNISTD_H) + + if(MSVC) +- set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +@@ -83,7 +82,7 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein + ${ZLIB_PC} @ONLY) + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein + ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY) +-include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) ++include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + + + #============================================================================ +@@ -123,7 +122,7 @@ set(ZLIB_SRCS + zutil.c + ) + +-if(NOT MINGW) ++if(MSVC) + set(ZLIB_DLL_SRCS + win32/zlib1.rc # If present will override custom build rule below. + ) +@@ -167,7 +166,7 @@ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) + string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" + "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) + +-if(MINGW) ++if(WIN32 AND NOT MSVC) + # This gets us DLL resource information when compiling on MinGW. + if(NOT CMAKE_RC_COMPILER) + set(CMAKE_RC_COMPILER windres.exe) +@@ -181,12 +180,15 @@ if(MINGW) + -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj + -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) +-endif(MINGW) ++endif() + ++if(BUILD_SHARED_LIBS) + add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) ++else() ++add_library(zlib STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++endif() + + if(NOT CYGWIN) + # This property causes shared libraries on Linux to have the full version +@@ -199,19 +201,24 @@ if(NOT CYGWIN) + set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION}) + endif() + +-if(UNIX) ++if(WIN32 AND NOT MINGW) ++ if(BUILD_SHARED_LIBS) ++ set_target_properties(zlib PROPERTIES ARCHIVE_OUTPUT_NAME zdll) ++ endif() ++else() + # On unix-like platforms the library is almost always called libz +- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) ++ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) + if(NOT APPLE) + set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") + endif() +-elseif(BUILD_SHARED_LIBS AND WIN32) ++endif() ++if(BUILD_SHARED_LIBS AND WIN32) + # Creates zlib1.dll when building shared library version +- set_target_properties(zlib PROPERTIES SUFFIX "1.dll") ++ set_target_properties(zlib PROPERTIES PREFIX "" RUNTIME_OUTPUT_NAME "zlib1") + endif() + + if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) +- install(TARGETS zlib zlibstatic ++ install(TARGETS zlib + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) +@@ -230,6 +237,7 @@ endif() + # Example binaries + #============================================================================ + ++if(0) + add_executable(example test/example.c) + target_link_libraries(example zlib) + add_test(example example) +@@ -247,3 +255,4 @@ if(HAVE_OFF64_T) + target_link_libraries(minigzip64 zlib) + set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") + endif() ++endif() diff --git a/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch b/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch new file mode 100644 index 0000000..3de4978 --- /dev/null +++ b/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch @@ -0,0 +1,13 @@ +diff --git a/gzguts.h b/gzguts.h +index 990a4d2..6378d46 100644 +--- a/gzguts.h ++++ b/gzguts.h +@@ -39,7 +39,7 @@ + # include + #endif + +-#if defined(_WIN32) || defined(__CYGWIN__) ++#if defined(_WIN32) + # define WIDECHAR + #endif + diff --git a/zlib/all/patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch b/zlib/all/patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch new file mode 100644 index 0000000..80eed3e --- /dev/null +++ b/zlib/all/patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch @@ -0,0 +1,35 @@ +From eff308af425b67093bab25f80f1ae950166bece1 Mon Sep 17 00:00:00 2001 +From: Mark Adler +Date: Sat, 30 Jul 2022 15:51:11 -0700 +Subject: [PATCH] Fix a bug when getting a gzip header extra field with + inflate(). + +If the extra field was larger than the space the user provided with +inflateGetHeader(), and if multiple calls of inflate() delivered +the extra header data, then there could be a buffer overflow of the +provided space. This commit assures that provided space is not +exceeded. +--- + inflate.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/inflate.c b/inflate.c +index 7be8c63..7a72897 100644 +--- a/inflate.c ++++ b/inflate.c +@@ -763,9 +763,10 @@ int flush; + copy = state->length; + if (copy > have) copy = have; + if (copy) { ++ len = state->head->extra_len - state->length; + if (state->head != Z_NULL && +- state->head->extra != Z_NULL) { +- len = state->head->extra_len - state->length; ++ state->head->extra != Z_NULL && ++ len < state->head->extra_max) { + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); +-- +2.25.1 + diff --git a/zlib/all/patches/1.2.x/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch b/zlib/all/patches/1.2.x/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch new file mode 100644 index 0000000..f34c401 --- /dev/null +++ b/zlib/all/patches/1.2.x/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch @@ -0,0 +1,32 @@ +From 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d Mon Sep 17 00:00:00 2001 +From: Mark Adler +Date: Mon, 8 Aug 2022 10:50:09 -0700 +Subject: [PATCH] Fix extra field processing bug that dereferences NULL + state->head. + +The recent commit to fix a gzip header extra field processing bug +introduced the new bug fixed here. +--- + inflate.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/inflate.c b/inflate.c +index 7a72897..2a3c4fe 100644 +--- a/inflate.c ++++ b/inflate.c +@@ -763,10 +763,10 @@ int flush; + copy = state->length; + if (copy > have) copy = have; + if (copy) { +- len = state->head->extra_len - state->length; + if (state->head != Z_NULL && + state->head->extra != Z_NULL && +- len < state->head->extra_max) { ++ (len = state->head->extra_len - state->length) < ++ state->head->extra_max) { + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); +-- +2.25.1 + diff --git a/zlib/all/patches/1.3.1/0001-fix-cmake.patch b/zlib/all/patches/1.3.1/0001-fix-cmake.patch new file mode 100644 index 0000000..036af67 --- /dev/null +++ b/zlib/all/patches/1.3.1/0001-fix-cmake.patch @@ -0,0 +1,81 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 15ceebe..2f08574 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,7 +59,6 @@ endif() + check_include_file(unistd.h Z_HAVE_UNISTD_H) + + if(MSVC) +- set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +@@ -122,7 +121,7 @@ set(ZLIB_SRCS + zutil.c + ) + +-if(NOT MINGW) ++if(MSVC) + set(ZLIB_DLL_SRCS + win32/zlib1.rc # If present will override custom build rule below. + ) +@@ -133,7 +132,7 @@ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) + string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" + "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) + +-if(MINGW) ++if(WIN32 AND NOT MSVC) + # This gets us DLL resource information when compiling on MinGW. + if(NOT CMAKE_RC_COMPILER) + set(CMAKE_RC_COMPILER windres.exe) +@@ -147,14 +146,16 @@ if(MINGW) + -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj + -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) +-endif(MINGW) ++endif() + ++if(BUILD_SHARED_LIBS) + add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) +-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +-target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) ++else() ++add_library(zlib STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++endif() + + if(NOT CYGWIN) + # This property causes shared libraries on Linux to have the full version +@@ -167,19 +168,25 @@ if(NOT CYGWIN) + set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION}) + endif() + +-if(UNIX) ++if(WIN32 AND NOT MINGW) ++ if(BUILD_SHARED_LIBS) ++ set_target_properties(zlib PROPERTIES ARCHIVE_OUTPUT_NAME zdll) ++ endif() ++else() + # On unix-like platforms the library is almost always called libz +- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) ++ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) + if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX)) + set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") + endif() +-elseif(BUILD_SHARED_LIBS AND WIN32) ++endif() ++if(BUILD_SHARED_LIBS AND WIN32) + # Creates zlib1.dll when building shared library version +- set_target_properties(zlib PROPERTIES SUFFIX "1.dll") ++ set_target_properties(zlib PROPERTIES PREFIX "" RUNTIME_OUTPUT_NAME "zlib1") + endif() + ++ + if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) +- install(TARGETS zlib zlibstatic ++ install(TARGETS zlib + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) diff --git a/zlib/all/patches/1.3/0001-fix-cmake.patch b/zlib/all/patches/1.3/0001-fix-cmake.patch new file mode 100644 index 0000000..b2aa69d --- /dev/null +++ b/zlib/all/patches/1.3/0001-fix-cmake.patch @@ -0,0 +1,92 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7f1b69f..618ea02 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -57,7 +57,6 @@ endif() + check_include_file(unistd.h Z_HAVE_UNISTD_H) + + if(MSVC) +- set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +@@ -120,7 +119,7 @@ set(ZLIB_SRCS + zutil.c + ) + +-if(NOT MINGW) ++if(MSVC) + set(ZLIB_DLL_SRCS + win32/zlib1.rc # If present will override custom build rule below. + ) +@@ -131,7 +130,7 @@ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) + string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" + "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) + +-if(MINGW) ++if(WIN32 AND NOT MSVC) + # This gets us DLL resource information when compiling on MinGW. + if(NOT CMAKE_RC_COMPILER) + set(CMAKE_RC_COMPILER windres.exe) +@@ -145,12 +144,16 @@ if(MINGW) + -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj + -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) +-endif(MINGW) ++endif() + ++if(BUILD_SHARED_LIBS) + add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) ++else() ++add_library(zlib STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++endif() + + if(NOT CYGWIN) + # This property causes shared libraries on Linux to have the full version +@@ -163,19 +166,24 @@ if(NOT CYGWIN) + set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION}) + endif() + +-if(UNIX) ++if(WIN32 AND NOT MINGW) ++ if(BUILD_SHARED_LIBS) ++ set_target_properties(zlib PROPERTIES ARCHIVE_OUTPUT_NAME zdll) ++ endif() ++else() + # On unix-like platforms the library is almost always called libz +- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) ++ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) + if(NOT APPLE) + set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") + endif() +-elseif(BUILD_SHARED_LIBS AND WIN32) ++endif() ++if(BUILD_SHARED_LIBS AND WIN32) + # Creates zlib1.dll when building shared library version +- set_target_properties(zlib PROPERTIES SUFFIX "1.dll") ++ set_target_properties(zlib PROPERTIES PREFIX "" RUNTIME_OUTPUT_NAME "zlib1") + endif() + + if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) +- install(TARGETS zlib zlibstatic ++ install(TARGETS zlib + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) +@@ -193,7 +201,7 @@ endif() + #============================================================================ + # Example binaries + #============================================================================ +- ++if(0) + add_executable(example test/example.c) + target_link_libraries(example zlib) + add_test(example example) +@@ -211,3 +219,4 @@ if(HAVE_OFF64_T) + target_link_libraries(minigzip64 zlib) + set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") + endif() ++endif() diff --git a/zlib/all/test_package/CMakeLists.txt b/zlib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..6369d1f --- /dev/null +++ b/zlib/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(ZLIB REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB) diff --git a/zlib/all/test_package/conanfile.py b/zlib/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/zlib/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/zlib/all/test_package/test_package.c b/zlib/all/test_package/test_package.c new file mode 100644 index 0000000..4c3da30 --- /dev/null +++ b/zlib/all/test_package/test_package.c @@ -0,0 +1,32 @@ +#include +#include +#include + +#include + +int main(void) { + char buffer_in [32] = {"Conan Package Manager"}; + char buffer_out [32] = {0}; + + z_stream defstream; + defstream.zalloc = Z_NULL; + defstream.zfree = Z_NULL; + defstream.opaque = Z_NULL; + defstream.avail_in = (uInt) strlen(buffer_in); + defstream.next_in = (Bytef *) buffer_in; + defstream.avail_out = (uInt) sizeof(buffer_out); + defstream.next_out = (Bytef *) buffer_out; + + deflateInit(&defstream, Z_BEST_COMPRESSION); + deflate(&defstream, Z_FINISH); + deflateEnd(&defstream); + + printf("Compressed size is: %lu\n", strlen(buffer_in)); + printf("Compressed string is: %s\n", buffer_in); + printf("Compressed size is: %lu\n", strlen(buffer_out)); + printf("Compressed string is: %s\n", buffer_out); + + printf("ZLIB VERSION: %s\n", zlibVersion()); + + return EXIT_SUCCESS; +} diff --git a/zlib/all/test_v1_package/CMakeLists.txt b/zlib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..eecfa28 --- /dev/null +++ b/zlib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ZLIB REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB) diff --git a/zlib/all/test_v1_package/conanfile.py b/zlib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..0245c9a --- /dev/null +++ b/zlib/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/zlib/config.yml b/zlib/config.yml new file mode 100644 index 0000000..79c9c7d --- /dev/null +++ b/zlib/config.yml @@ -0,0 +1,11 @@ +versions: + "1.3.1": + folder: all + "1.3": + folder: all + "1.2.13": + folder: all + "1.2.12": + folder: all + "1.2.11": + folder: all diff --git a/zstd/all/conandata.yml b/zstd/all/conandata.yml new file mode 100644 index 0000000..03a332c --- /dev/null +++ b/zstd/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "1.5.6": + url: "https://github.com/facebook/zstd/releases/download/v1.5.6/zstd-1.5.6.tar.gz" + sha256: "8c29e06cf42aacc1eafc4077ae2ec6c6fcb96a626157e0593d5e82a34fd403c1" + "1.5.5": + url: "https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz" + sha256: "9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4" + "1.5.2": + url: "https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz" + sha256: "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0" + "1.5.0": + url: "https://github.com/facebook/zstd/releases/download/v1.5.0/zstd-1.5.0.tar.gz" + sha256: "5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94" +patches: + "1.5.6": + - patch_file: "patches/1.5.6-public-scope-windows-shared.patch" + patch_description: "Include zstd.h folder when building shared library on Windows" + patch_type: "bugfix" + patch_source: "https://github.com/facebook/zstd/pull/4009" + "1.5.5": + - patch_file: "patches/1.5.2-cmake-remove-asm-except-x86_64.patch" + patch_description: "use assembler codes only on x86_64" + patch_type: "portability" + - patch_file: "patches/1.5.5-qnx_support.patch" + patch_description: "Add qnx to platform" + patch_type: "portability" + patch_source: "https://github.com/facebook/zstd/pull/3745" + "1.5.2": + - patch_file: "patches/1.5.2-cmake-remove-asm-except-x86_64.patch" + patch_description: "use assembler codes only on x86_64" + patch_type: "portability" + - patch_file: "patches/1.5.0-remove-explicit-standard-setting.patch" + patch_description: "fix strange performance and scalability issues" + patch_type: "bugfix" + patch_source: "https://github.com/facebook/zstd/pull/3167" + "1.5.0": + - patch_file: "patches/1.5.0-remove-explicit-standard-setting.patch" + patch_description: "fix strange performance and scalability issues" + patch_type: "bugfix" + patch_source: "https://github.com/facebook/zstd/pull/3167" diff --git a/zstd/all/conanfile.py b/zstd/all/conanfile.py new file mode 100644 index 0000000..397fedf --- /dev/null +++ b/zstd/all/conanfile.py @@ -0,0 +1,103 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir, rm +import glob +import os + +required_conan_version = ">=1.53.0" + +class ZstdConan(ConanFile): + name = "zstd" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/facebook/zstd" + description = "Zstandard - Fast real-time compression algorithm" + topics = ("zstandard", "compression", "algorithm", "decoder") + license = "BSD-3-Clause" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "threading": [True, False], + "build_programs": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "threading": True, + "build_programs": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ZSTD_BUILD_PROGRAMS"] = self.options.build_programs + tc.variables["ZSTD_BUILD_STATIC"] = not self.options.shared or self.options.build_programs + tc.variables["ZSTD_BUILD_SHARED"] = self.options.shared + tc.variables["ZSTD_MULTITHREAD_SUPPORT"] = self.options.threading + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Don't force PIC + replace_in_file(self, os.path.join(self.source_folder, "build", "cmake", "lib", "CMakeLists.txt"), + "POSITION_INDEPENDENT_CODE On", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "build", "cmake")) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + if self.options.shared and self.options.build_programs: + # If we build programs we have to build static libs (see logic in generate()), + # but if shared is True, we only want shared lib in package folder. + rm(self, "*_static.*", os.path.join(self.package_folder, "lib")) + for lib in glob.glob(os.path.join(self.package_folder, "lib", "*.a")): + if not lib.endswith(".dll.a"): + os.remove(lib) + + def package_info(self): + zstd_cmake = "libzstd_shared" if self.options.shared else "libzstd_static" + self.cpp_info.set_property("cmake_file_name", "zstd") + self.cpp_info.set_property("cmake_target_name", f"zstd::{zstd_cmake}") + self.cpp_info.set_property("pkg_config_name", "libzstd") + self.cpp_info.components["zstdlib"].libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["zstdlib"].system_libs.append("pthread") + + # TODO: Remove after dropping Conan 1.x from ConanCenterIndex + self.cpp_info.components["zstdlib"].names["cmake_find_package"] = zstd_cmake + self.cpp_info.components["zstdlib"].names["cmake_find_package_multi"] = zstd_cmake + self.cpp_info.components["zstdlib"].set_property("cmake_target_name", f"zstd::{zstd_cmake}") + self.cpp_info.components["zstdlib"].set_property("pkg_config_name", "libzstd") + if self.options.build_programs: + bindir = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bindir) diff --git a/zstd/all/patches/1.5.0-remove-explicit-standard-setting.patch b/zstd/all/patches/1.5.0-remove-explicit-standard-setting.patch new file mode 100644 index 0000000..cb025cd --- /dev/null +++ b/zstd/all/patches/1.5.0-remove-explicit-standard-setting.patch @@ -0,0 +1,21 @@ +diff --git a/a/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake b/b/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake +index e23b9d6..8d04458 100644 +--- a/a/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake ++++ b/b/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake +@@ -22,10 +22,12 @@ endfunction() + + macro(ADD_ZSTD_COMPILATION_FLAGS) + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" OR MINGW) #Not only UNIX but also WIN32 for MinGW +- #Set c++11 by default +- EnableCompilerFlag("-std=c++11" false true) +- #Set c99 by default +- EnableCompilerFlag("-std=c99" true false) ++ # It's possible to select the exact standard used for compilation. ++ # It's not necessary, but can be employed for specific purposes. ++ # Note that zstd source code is compatible with both C++98 and above ++ # and C-gnu90 (c90 + long long + variadic macros ) and above ++ # EnableCompilerFlag("-std=c++11" false true) # Set C++ compilation to c++11 standard ++ # EnableCompilerFlag("-std=c99" true false) # Set C compiation to c99 standard + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND MSVC) + # clang-cl normally maps -Wall to -Weverything. + EnableCompilerFlag("/clang:-Wall" true true) diff --git a/zstd/all/patches/1.5.2-cmake-remove-asm-except-x86_64.patch b/zstd/all/patches/1.5.2-cmake-remove-asm-except-x86_64.patch new file mode 100644 index 0000000..ed1ab3f --- /dev/null +++ b/zstd/all/patches/1.5.2-cmake-remove-asm-except-x86_64.patch @@ -0,0 +1,17 @@ +diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt +index 4905bd9..5974725 100644 +--- a/build/cmake/lib/CMakeLists.txt ++++ b/build/cmake/lib/CMakeLists.txt +@@ -26,7 +26,11 @@ if (MSVC) + file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c) + add_compile_options(-DZSTD_DISABLE_ASM) + else () +- file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c ${LIBRARY_DIR}/decompress/*.S) ++ if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") ++ file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c ${LIBRARY_DIR}/decompress/*.S) ++ else() ++ file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c) ++ endif() + endif () + file(GLOB DictBuilderSources ${LIBRARY_DIR}/dictBuilder/*.c) + diff --git a/zstd/all/patches/1.5.5-qnx_support.patch b/zstd/all/patches/1.5.5-qnx_support.patch new file mode 100644 index 0000000..ba58a24 --- /dev/null +++ b/zstd/all/patches/1.5.5-qnx_support.patch @@ -0,0 +1,11 @@ +--- programs/platform.h 2023-04-04 22:13:52.000000000 +0200 ++++ programs/platform.h 2023-09-03 10:01:58.930595800 +0200 +@@ -89,7 +89,7 @@ + */ + # elif !defined(_WIN32) \ + && ( defined(__unix__) || defined(__unix) \ +- || defined(__midipix__) || defined(__VMS) || defined(__HAIKU__) ) ++ || defined(_QNX_SOURCE) || defined(__midipix__) || defined(__VMS) || defined(__HAIKU__) ) + + # if defined(__linux__) || defined(__linux) || defined(__CYGWIN__) + # ifndef _POSIX_C_SOURCE diff --git a/zstd/all/patches/1.5.6-public-scope-windows-shared.patch b/zstd/all/patches/1.5.6-public-scope-windows-shared.patch new file mode 100644 index 0000000..9862de8 --- /dev/null +++ b/zstd/all/patches/1.5.6-public-scope-windows-shared.patch @@ -0,0 +1,13 @@ +diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt +index 5d514cc..1791897 100644 +--- a/build/cmake/lib/CMakeLists.txt ++++ b/build/cmake/lib/CMakeLists.txt +@@ -123,7 +123,7 @@ set(PUBLIC_INCLUDE_DIRS ${LIBRARY_DIR}) + set(library_targets) + if (ZSTD_BUILD_SHARED) + add_library(libzstd_shared SHARED ${Sources} ${Headers} ${PlatformDependResources}) +- target_include_directories(libzstd_shared INTERFACE $) ++ target_include_directories(libzstd_shared PUBLIC $) + list(APPEND library_targets libzstd_shared) + if (ZSTD_MULTITHREAD_SUPPORT) + set_property(TARGET libzstd_shared APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD") diff --git a/zstd/all/test_package/CMakeLists.txt b/zstd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..57a72ca --- /dev/null +++ b/zstd/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(zstd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +if (TARGET zstd::libzstd_shared) + target_link_libraries(${PROJECT_NAME} PRIVATE zstd::libzstd_shared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE zstd::libzstd_static) +endif() diff --git a/zstd/all/test_package/conanfile.py b/zstd/all/test_package/conanfile.py new file mode 100644 index 0000000..541303d --- /dev/null +++ b/zstd/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not can_run(self): + return + + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/zstd/all/test_package/test_package.c b/zstd/all/test_package/test_package.c new file mode 100644 index 0000000..29bca24 --- /dev/null +++ b/zstd/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include +#include +#include + +int main() { + const char* originalData = "Sample text"; + size_t compressedSize = ZSTD_compressBound(strlen(originalData) + 1); + printf("%zu\n", compressedSize); + + return 0; +} diff --git a/zstd/all/test_v1_package/CMakeLists.txt b/zstd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/zstd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/zstd/all/test_v1_package/conanfile.py b/zstd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/zstd/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/zstd/config.yml b/zstd/config.yml new file mode 100644 index 0000000..3b1802f --- /dev/null +++ b/zstd/config.yml @@ -0,0 +1,9 @@ +versions: + "1.5.6": + folder: all + "1.5.5": + folder: all + "1.5.2": + folder: all + "1.5.0": + folder: all