diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 86ea5a6a6dbcab..3782948d20054b 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -1313,3 +1313,26 @@ authorized_users: - Ruwei-Liu - msparapa - pzheltov +- igadmg +- eljonny +- VladimirShaleev +- phwissmann +- ybogo +- ujos +- nclindroos +- es20490446e +- victimsnino +- dmpriso +- darakelian +- sivachandran +- oteffahi +- Ruwei +- TibiIius +- MattBelanger321 +- X1aomu +- datalogics-rgailiunas +- yhsng +- omdxp +- pierricgimmig +- laci-aura +- BenBudr diff --git a/.c3i/conan_v2_ready_references.yml b/.c3i/conan_v2_ready_references.yml index aced003f387803..6994382f1a936b 100644 --- a/.c3i/conan_v2_ready_references.yml +++ b/.c3i/conan_v2_ready_references.yml @@ -90,6 +90,7 @@ required_for_references: - bdwgc - bear - beauty +- behaviortree.cpp - benchmark - bertrand - bezier @@ -208,6 +209,7 @@ required_for_references: - cose-c - cotila - coz +- cpp-channel - cpp-httplib - cpp-ipc - cpp-jwt @@ -236,6 +238,7 @@ required_for_references: - cprocessing - cpu_features - cpuinfo +- cpython - cqrlib - crc32c - crc_cpp @@ -533,6 +536,7 @@ required_for_references: - id3v2lib - idna - ignition-cmake +- iguana - iir1 - im95able-rea - imagl @@ -629,6 +633,7 @@ required_for_references: - libbacktrace - libbasisu - libbigwig +- libboxes - libbpf - libbsd - libcap @@ -644,6 +649,7 @@ required_for_references: - libcpuid - libcuckoo - libcurl +- libcvd - libdaemon - libdb - libdc1394 @@ -670,9 +676,11 @@ required_for_references: - libexif - libfdk_aac - libffi +- libfork - libfreenect - libfreenect2 - libftdi +- libftp - libfuse - libgcrypt - libgd @@ -690,6 +698,7 @@ required_for_references: - libiberty - libiconv - libid3tag +- libinput - libinterpolate - libipt - libjpeg @@ -767,6 +776,7 @@ required_for_references: - libspng - libsquish - libsrtp +- libssh - libssh2 - libsvm - libsvtav1 @@ -847,6 +857,7 @@ required_for_references: - lzma_sdk - lzo - m4 +- macdylibbundler - maddy - magic_enum - mailio @@ -893,6 +904,7 @@ required_for_references: - mingw-builds - mingw-w64 - miniaudio +- minicoro - minimp3 - minisat - miniscript @@ -903,6 +915,7 @@ required_for_references: - minizip-ng - mio - mm_file +- mocknetworkaccessmanager - modern-cpp-kafka - mold - moltenvk @@ -970,6 +983,7 @@ required_for_references: - numcpp - nuraft - nv-codec-headers +- nvcloth - nvtx - oatpp - oatpp-libressl @@ -1026,12 +1040,14 @@ required_for_references: - openmesh - openmvg - openpam +- openssh - openssl - opensubdiv - opentdf-client - opentelemetry-cpp - opentelemetry-proto - opentracing-cpp +- openvdb - openvino - openvr - openxlsx @@ -1042,6 +1058,7 @@ required_for_references: - orcania - osmanip - osqp +- ouster_sdk - out_ptr - outcome - ozz-animation @@ -1123,6 +1140,7 @@ required_for_references: - protobuf-c - protopuf - protozero +- proxy - psimd - psyinf-gmtl - ptex @@ -1146,6 +1164,7 @@ required_for_references: - quantlib - quaternions - quazip +- quickcpplib - quickfix - quickjs - quill @@ -1274,6 +1293,7 @@ required_for_references: - span-lite - spdlog - spectra +- speedb - spirv-cross - spirv-headers - spirv-tools @@ -1281,6 +1301,7 @@ required_for_references: - spy - sqlcipher - sqlite3 +- sqlite3mc - sqlite_orm - sqlitecpp - sqlpp11 @@ -1380,6 +1401,7 @@ required_for_references: - tng - toml11 - tomlplusplus +- toon - tqdm-cpp - tracy - transwarp @@ -1474,6 +1496,7 @@ required_for_references: - whisper-cpp - wide-integer - wil +- wildcards - wildmidi - winflexbison - winmd diff --git a/.c3i/config_v1.yml b/.c3i/config_v1.yml index a7779831e1660a..68c6f4fbb39ea8 100644 --- a/.c3i/config_v1.yml +++ b/.c3i/config_v1.yml @@ -3,7 +3,7 @@ id: 'conan-io/conan-center-index' conan: - version: 1.62.0 + version: 1.64.0 artifactory: url: "https://c3i.jfrog.io/c3i" diff --git a/.c3i/config_v2.yml b/.c3i/config_v2.yml index ce873ee6cf6736..c4ac212386ed74 100644 --- a/.c3i/config_v2.yml +++ b/.c3i/config_v2.yml @@ -3,7 +3,7 @@ id: 'conan-io/conan-center-index' conan: - version: 2.0.16 + version: 2.2.2 backup_sources: upload_url: "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/" download_url: "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/" diff --git a/.github/workflows/alert-community.yml b/.github/workflows/alert-community.yml index a12c503bcd8f0d..76a1a4165dd49b 100644 --- a/.github/workflows/alert-community.yml +++ b/.github/workflows/alert-community.yml @@ -316,6 +316,11 @@ jobs: files: "recipes/lz4/*/*" reviewers: "@Hopobcn" + - uses: ./.github/actions/alert-community + with: + files: "recipes/mocknetworkaccessmanager/*/*" + reviewers: "@MartinDelille" + - uses: ./.github/actions/alert-community with: files: "recipes/ms-gsl/*/*" @@ -376,6 +381,11 @@ jobs: files: "recipes/psimd/*/*" reviewers: "@Hopobcn" + - uses: ./.github/actions/alert-community + with: + files: "recipes/qtawesome/*/*" + reviewers: "@MartinDelille" + - uses: ./.github/actions/alert-community with: files: "recipes/qt/*/*" diff --git a/docs/changelog.md b/docs/changelog.md index 8179d56b57c909..3d6b985571d207 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,9 +1,19 @@ # Changelog -### 13-Mar-2024 - 11:08 CET +### 03-April-2024 - 13:53 CEST -- [feature]: Build with both */*:shared=True/False option when package type is declared as ``shared-library``. -- [fix]: Fix ValidateInfra python version check to be aligned with the latest Jenkins version. +- [feature] Add support for Conan 2.2.2 in the CI +- [feature] Add support for Conan 1.63.0 in the CI + +### 20-March-2024 - 11:13 CET + +- [fix] Changing Version Ranges in dependencies is now bump dependencies +- [fix] Static library package type should be built with both all static and all shared dependencies + +### 13-March-2024 - 11:08 CET + +- [feature] Build with both */*:shared=True/False option when package type is declared as ``shared-library``. +- [fix] Fix ValidateInfra python version check to be aligned with the latest Jenkins version. ### 07-February-2024 - 15:43 CET diff --git a/docs/faqs.md b/docs/faqs.md index b463fc96e8c9bb..a1714a7a2b37b6 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -453,6 +453,8 @@ and does not install libraries with the boost prefix. Yes, but make sure it does not have Boost in the name. Use the [`author-name` convention](https://github.com/conan-io/conan-center-index/blob/master/docs/faqs.md#what-is-the-policy-on-recipe-name-collisions) so there are no conflicts. In addition to follow the rules outlined above. +**NOTE**: In case you have no intention to submit to Boost, then you can use the project name as is (e.g `boost-foobar`). + ## Can I add options that do not affect `package_id` or the package contents Generally no, these sorts of options can most likely be set from a profile or downstream recipes. However if the project supports this option from its build script diff --git a/docs/package_templates/autotools_package/all/conanfile.py b/docs/package_templates/autotools_package/all/conanfile.py index 0d8464ec8e6f0e..2bd1c8b1bd5e92 100644 --- a/docs/package_templates/autotools_package/all/conanfile.py +++ b/docs/package_templates/autotools_package/all/conanfile.py @@ -132,7 +132,7 @@ def generate(self): # --enable/disable-shared is automatically managed when 'shared' option is declared tc = AutotoolsToolchain(self) # autotools usually uses 'yes' and 'no' to enable/disable options - yes_no = lambda v: "yes" if v else "no" + def yes_no(v): return "yes" if v else "no" tc.configure_args.extend([ f"--with-foobar={yes_no(self.options.with_foobar)}", "--enable-tools=no", diff --git a/docs/supported_platforms_and_configurations.md b/docs/supported_platforms_and_configurations.md index 156a1c5f868d73..6b1a32e9557cc2 100644 --- a/docs/supported_platforms_and_configurations.md +++ b/docs/supported_platforms_and_configurations.md @@ -58,8 +58,8 @@ For more information see [conan-io/conan-docker-tools](https://github.com/conan- ## Linux -- Python: 3.7.13 -- CMake: 3.15.7, 3.18.2 (same version expected after all use [new docker images](https://github.com/conan-io/conan-docker-tools/tree/master/modern)) +- Python: 3.7.17 +- CMake: 3.15.7, 3.18.6 (same version expected after all use [new docker images](https://github.com/conan-io/conan-docker-tools/tree/master/modern)) - Compilers: - GCC versions: 5, 7, 9, 11 - Clang versions: 13 diff --git a/recipes/7bitdi/all/conandata.yml b/recipes/7bitdi/all/conandata.yml index 22d7e84c10e0a1..a38a06daf64fb0 100644 --- a/recipes/7bitdi/all/conandata.yml +++ b/recipes/7bitdi/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.1.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.1.0.tar.gz" + sha256: "345bf91e2a33cfe98628cac98c75488ddd55232b8c4bcfeba9b5001fec8d4f7c" + "3.0.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.0.0.tar.gz" + sha256: "aabb8e907c0cafb8e4b7c8367ed5dbb3cba2d83af090bdef9a7f855c0778c8f3" "2.1.0": url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v2.1.0.tar.gz" sha256: "54edceb4f90bf652126310ca0b78150d05a02d7081cef3c9ccaba5f4dd112935" diff --git a/recipes/7bitdi/config.yml b/recipes/7bitdi/config.yml index 4a1d176d1dc7ea..9a995179e264f6 100644 --- a/recipes/7bitdi/config.yml +++ b/recipes/7bitdi/config.yml @@ -1,4 +1,8 @@ versions: + "3.1.0": + folder: all + "3.0.0": + folder: all "2.1.0": folder: all "2.0.0": diff --git a/recipes/7zip/19.00/conandata.yml b/recipes/7zip/all/conandata.yml similarity index 100% rename from recipes/7zip/19.00/conandata.yml rename to recipes/7zip/all/conandata.yml diff --git a/recipes/7zip/19.00/conanfile.py b/recipes/7zip/all/conanfile.py similarity index 97% rename from recipes/7zip/19.00/conanfile.py rename to recipes/7zip/all/conanfile.py index b1fa099b52650c..91093cc791c526 100644 --- a/recipes/7zip/19.00/conanfile.py +++ b/recipes/7zip/all/conanfile.py @@ -62,9 +62,11 @@ def generate(self): tc.generate() else: tc = AutotoolsToolchain(self) + env = None if self.settings.os == "Windows" and self.settings.compiler == "gcc": - tc.environment().define("IS_MINGW", "1") - tc.generate() + env = tc.environment() + env.define("IS_MINGW", "1") + tc.generate(env=env) deps = AutotoolsDeps(self) deps.generate() diff --git a/recipes/7zip/19.00/test_package/conanfile.py b/recipes/7zip/all/test_package/conanfile.py similarity index 100% rename from recipes/7zip/19.00/test_package/conanfile.py rename to recipes/7zip/all/test_package/conanfile.py diff --git a/recipes/7zip/19.00/test_v1_package/conanfile.py b/recipes/7zip/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/7zip/19.00/test_v1_package/conanfile.py rename to recipes/7zip/all/test_v1_package/conanfile.py diff --git a/recipes/7zip/config.yml b/recipes/7zip/config.yml index 5f2a8f313a5d8a..9e03b0cc48e127 100644 --- a/recipes/7zip/config.yml +++ b/recipes/7zip/config.yml @@ -1,7 +1,7 @@ versions: "23.01": - folder: "19.00" + folder: "all" "22.01": - folder: "19.00" + folder: "all" "19.00": - folder: "19.00" + folder: "all" diff --git a/recipes/aaf/all/conanfile.py b/recipes/aaf/all/conanfile.py index ee7906ff059366..471ea8132e2ce4 100644 --- a/recipes/aaf/all/conanfile.py +++ b/recipes/aaf/all/conanfile.py @@ -35,7 +35,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("libjpeg/9e") if self.settings.os in ("FreeBSD", "Linux"): self.requires("util-linux-libuuid/2.39") diff --git a/recipes/abseil/all/conandata.yml b/recipes/abseil/all/conandata.yml index c6bc5198c7de01..7958f236ae2525 100644 --- a/recipes/abseil/all/conandata.yml +++ b/recipes/abseil/all/conandata.yml @@ -1,4 +1,7 @@ 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" @@ -15,6 +18,15 @@ sources: 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" "20240116.1": - patch_file: "patches/0003-absl-string-libm-20240116.patch" patch_description: "link libm to absl string" diff --git a/recipes/abseil/config.yml b/recipes/abseil/config.yml index 4db2fe8f16b71e..0af2b7beb4451b 100644 --- a/recipes/abseil/config.yml +++ b/recipes/abseil/config.yml @@ -1,4 +1,6 @@ versions: + "20240116.2": + folder: all "20240116.1": folder: all "20230802.1": diff --git a/recipes/ada/all/conandata.yml b/recipes/ada/all/conandata.yml index 8588363204f2a5..235136d4b7acf4 100644 --- a/recipes/ada/all/conandata.yml +++ b/recipes/ada/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.7.8": + url: "https://github.com/ada-url/ada/archive/v2.7.8.tar.gz" + sha256: "8de067b7cb3da1808bf5439279aee6048d761ba246bf8a854c2af73b16b41c75" "2.7.7": url: "https://github.com/ada-url/ada/archive/v2.7.7.tar.gz" sha256: "7116d86a80b79886efbc9d946d3919801815060ae62daf78de68c508552af554" diff --git a/recipes/ada/config.yml b/recipes/ada/config.yml index 2c783447077658..50d72ec6cb8b64 100644 --- a/recipes/ada/config.yml +++ b/recipes/ada/config.yml @@ -1,4 +1,6 @@ versions: + "2.7.8": + folder: all "2.7.7": folder: all "2.7.5": diff --git a/recipes/alembic/all/conanfile.py b/recipes/alembic/all/conanfile.py index 81ce4ae17f4f7e..b0e76d94370d07 100644 --- a/recipes/alembic/all/conanfile.py +++ b/recipes/alembic/all/conanfile.py @@ -46,7 +46,7 @@ def layout(self): def requirements(self): self.requires("imath/3.1.9", transitive_headers=True) if self.options.with_hdf5: - self.requires("hdf5/1.14.2") + self.requires("hdf5/1.14.3") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/android-ndk/all/conandata.yml b/recipes/android-ndk/all/conandata.yml index 788c3990884da0..0a73cd9fc973bd 100644 --- a/recipes/android-ndk/all/conandata.yml +++ b/recipes/android-ndk/all/conandata.yml @@ -1,4 +1,17 @@ sources: + "r26c": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26c-windows.zip" + sha256: "67d0c7e4ba853e9168584e8640a562af431dcf086c08efef3ec23ee827139303" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26c-linux.zip" + sha256: "6d6e659834d28bb24ba7ae66148ad05115ebbad7dabed1af9b3265674774fcf6" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26c-darwin.zip" + sha256: "312756dfcbdbf389d35d651e17ca98683bd36cb83cc7bf7ad51cac5c06bd064b" "r26b": "Windows": "x86_64": diff --git a/recipes/android-ndk/config.yml b/recipes/android-ndk/config.yml index a7fa8c97dd42c7..2f8b2364c9c1c3 100644 --- a/recipes/android-ndk/config.yml +++ b/recipes/android-ndk/config.yml @@ -1,4 +1,6 @@ versions: + "r26c": + folder: all "r26b": folder: all "r26": diff --git a/recipes/annoy/all/conandata.yml b/recipes/annoy/all/conandata.yml new file mode 100644 index 00000000000000..540727dc55607c --- /dev/null +++ b/recipes/annoy/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.17.3": + url: "https://github.com/spotify/annoy/archive/refs/tags/v1.17.3.tar.gz" + sha256: "c121d38cacd98f5103b24ca4e94ca097f18179eed3037e9eb93ad70ec1e6356e" diff --git a/recipes/annoy/all/conanfile.py b/recipes/annoy/all/conanfile.py new file mode 100644 index 00000000000000..a583978167f269 --- /dev/null +++ b/recipes/annoy/all/conanfile.py @@ -0,0 +1,44 @@ +import os + +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" + +class AnnoyConan(ConanFile): + name = "annoy" + description = "Approximate Nearest Neighbors optimized for memory usage and loading/saving to disk" + license = "Apache-2.0" + homepage = "https://github.com/spotify/annoy" + url = "https://github.com/conan-io/conan-center-index" + topics = ("approximate-nearest-neighbors", "machine-learning", "nearest-neighbors", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + 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 package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + for header in ["annoylib.h", "kissrandom.h", "mman.h"]: + copy(self, header, os.path.join(self.source_folder, "src"), os.path.join(self.package_folder, "include", "annoy")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Annoy") + self.cpp_info.set_property("cmake_target_name", "Annoy::Annoy") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "Annoy" + self.cpp_info.names["cmake_find_package_multi"] = "Annoy" diff --git a/recipes/annoy/all/test_package/CMakeLists.txt b/recipes/annoy/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..33d34348b2425d --- /dev/null +++ b/recipes/annoy/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Annoy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Annoy::Annoy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libassert/all/test_package/conanfile.py b/recipes/annoy/all/test_package/conanfile.py similarity index 99% rename from recipes/libassert/all/test_package/conanfile.py rename to recipes/annoy/all/test_package/conanfile.py index f5cf204295e195..3a91c9439218e3 100644 --- a/recipes/libassert/all/test_package/conanfile.py +++ b/recipes/annoy/all/test_package/conanfile.py @@ -3,17 +3,18 @@ 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 requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/annoy/all/test_package/test_package.cpp b/recipes/annoy/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..ee5f4538042eae --- /dev/null +++ b/recipes/annoy/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include + +#include +#include + +int main() { + const int n = 3; + Annoy::AnnoyIndex index(n); + + double x[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; + double needle[3] = {0.1, 0.1, 0.8}; + + for (int i = 0; i < n; i++) { + index.add_item(i, x[i]); + } + index.build(-1); + + std::vector result; + index.get_nns_by_vector(needle, 1, -1, &result, nullptr); + std::cout << "Nearest neighbor to vector [1.0, 0.5, 0.5]: "; + for (int i : result) { + std::cout << i << " "; + } + std::cout << std::endl; + return 0; +} diff --git a/recipes/annoy/config.yml b/recipes/annoy/config.yml new file mode 100644 index 00000000000000..a138b582eaf2e1 --- /dev/null +++ b/recipes/annoy/config.yml @@ -0,0 +1,3 @@ +versions: + "1.17.3": + folder: all diff --git a/recipes/apr-util/all/conanfile.py b/recipes/apr-util/all/conanfile.py index ed635923b1c3a4..92e0be4b1f040f 100644 --- a/recipes/apr-util/all/conanfile.py +++ b/recipes/apr-util/all/conanfile.py @@ -90,7 +90,7 @@ def requirements(self): if self.options.with_sqlite3: self.requires("sqlite3/3.45.0") if self.options.with_expat: - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_postgresql: self.requires("libpq/15.4") diff --git a/recipes/arrow/all/conandata.yml b/recipes/arrow/all/conandata.yml index 5521daf96b996d..7579743855f0f6 100644 --- a/recipes/arrow/all/conandata.yml +++ b/recipes/arrow/all/conandata.yml @@ -38,51 +38,25 @@ sources: "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" patches: "8.0.1": - patch_file: "patches/8.0.0-0005-install-utils.patch" - patch_description: "enable utilis installation" + 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 utilis installation" + 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 utilis installation" + 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" - "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" diff --git a/recipes/arrow/all/conanfile.py b/recipes/arrow/all/conanfile.py index dcd80308b7b011..a94962ec1298d6 100644 --- a/recipes/arrow/all/conanfile.py +++ b/recipes/arrow/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException from conan.tools.build import check_min_cppstd, cross_building from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir @@ -71,13 +71,13 @@ class ArrowConan(ConanFile): "shared": False, "fPIC": True, "gandiva": False, - "parquet": "auto", + "parquet": False, "skyhook": False, "substrait": False, "acero": False, "cli": False, - "compute": "auto", - "dataset_modules": "auto", + "compute": False, + "dataset_modules": False, "deprecated": True, "encryption": False, "filesystem_layer": False, @@ -86,29 +86,29 @@ class ArrowConan(ConanFile): "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_thrift": "auto", - "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, @@ -144,35 +144,10 @@ def export_sources(self): 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 - - self.options.parquet = self._parquet() - self.options.compute = self._compute() - self.options.dataset_modules = self._dataset_modules() - self.options.with_boost = self._with_boost() - self.options.with_flight_rpc = self._with_flight_rpc() - self.options.with_gflags = self._with_gflags() - self.options.with_glog = self._with_glog() - self.options.with_grpc = self._with_grpc() - self.options.with_jemalloc = self._with_jemalloc() - self.options.with_thrift = self._with_thrift() - self.options.with_llvm = self._with_llvm() - self.options.with_openssl = self._with_openssl() - self.options.with_protobuf = self._with_protobuf() - self.options.with_re2 = self._with_re2() - self.options.with_utf8proc = self._with_utf8proc() + if is_msvc(self): + self.options.with_boost = True def configure(self): if self.options.shared: @@ -181,127 +156,20 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") - def _compute(self): - if 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): - if self.options.parquet == "auto": - return bool(self.options.get_safe("substrait", False)) - else: - return bool(self.options.parquet) - - def _dataset_modules(self): - if self.options.dataset_modules == "auto": - return bool(self.options.get_safe("substrait", False)) - else: - return bool(self.options.dataset_modules) - - def _with_jemalloc(self): - if self.options.with_jemalloc == "auto": - return bool("BSD" in str(self.settings.os)) - else: - return bool(self.options.with_jemalloc) - - def _with_re2(self): - if 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): - if 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): - if 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): - if self.options.with_gflags == "auto": - return bool(self._with_glog() or self._with_grpc()) - else: - return bool(self.options.with_gflags) - - def _with_glog(self): - if self.options.with_glog == "auto": - return False - else: - return bool(self.options.with_glog) - - def _with_grpc(self): - if self.options.with_grpc == "auto": - return self._with_flight_rpc() - else: - return bool(self.options.with_grpc) - - def _with_boost(self): - if 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): - if self.options.with_thrift == "auto": - return bool(self._parquet()) - else: - return bool(self.options.with_thrift) - - def _with_utf8proc(self): - if self.options.with_utf8proc == "auto": - return bool(self._compute() or self.options.gandiva) - else: - return bool(self.options.with_utf8proc) - - def _with_llvm(self): - if self.options.with_llvm == "auto": - return bool(self.options.gandiva) - else: - return bool(self.options.with_llvm) - - def _with_openssl(self): - if 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 _requires_rapidjson(self): - if self.options.with_json: - return True - if Version(self.version) >= "7.0.0" and self.options.encryption: - return True - return False + return self.options.with_json or self.options.encryption def requirements(self): if self.options.with_thrift: self.requires("thrift/0.17.0") if self.options.with_protobuf: - self.requires("protobuf/3.21.9") + 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.options.with_boost: - self.requires("boost/1.83.0") + self.requires("boost/1.84.0") if self.options.with_gflags: self.requires("gflags/2.2.2") if self.options.with_glog: @@ -332,8 +200,7 @@ def requirements(self): 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 \ + 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: @@ -346,13 +213,32 @@ def requirements(self): 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): - # validate options with 'auto' as default value - auto_options = ["parquet", "compute", "dataset_modules", "with_boost", "with_flight_rpc", "with_gflags", "with_glog", - "with_grpc", "with_jemalloc", "with_thrift", "with_llvm", "with_openssl", "with_protobuf", "with_re2", "with_utf8proc"] - for option in auto_options: - assert "auto" not in str(self.options.get_safe(option)), f"Option '{option}' contains 'auto' value, wich is not allowed. Generally the final value should be True/False" + # 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) @@ -367,8 +253,6 @@ def validate(self): 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_orc: - raise ConanInvalidConfiguration("CCI has no orc 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.") @@ -376,8 +260,6 @@ def validate(self): if self.dependencies["jemalloc"].options.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 build_requirements(self): if Version(self.version) >= "13.0.0": @@ -414,7 +296,7 @@ def generate(self): tc.variables["ARROW_NO_DEPRECATED_API"] = not bool(self.options.deprecated) 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"] = self.options.compute + 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.options.with_jemalloc @@ -459,12 +341,9 @@ def generate(self): 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.dependencies["zstd"].options.shared) tc.variables["ORC_SOURCE"] = "SYSTEM" @@ -509,7 +388,7 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - if "7.0.0" <= Version(self.version) < "10.0.0": + 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", @@ -613,9 +492,8 @@ def package_info(self): self.cpp_info.components["libgandiva"].requires.append("boost::boost") 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") + # 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.options.with_gflags: diff --git a/recipes/arrow/all/patches/1.0.0-0003-fix-shared-msvc.patch b/recipes/arrow/all/patches/1.0.0-0003-fix-shared-msvc.patch deleted file mode 100644 index 3c7e86d5ff279b..00000000000000 --- a/recipes/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/recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch b/recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch deleted file mode 100644 index 5f0f6f4c52d5c6..00000000000000 --- a/recipes/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/recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch b/recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch deleted file mode 100644 index eb6816262214bf..00000000000000 --- a/recipes/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/recipes/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch b/recipes/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch deleted file mode 100644 index f3268abf74e2c4..00000000000000 --- a/recipes/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/recipes/arrow/all/patches/2.0.0-0005-gandiva-engine.patch b/recipes/arrow/all/patches/2.0.0-0005-gandiva-engine.patch deleted file mode 100644 index 9fcc4b1a36a8a5..00000000000000 --- a/recipes/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/recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch b/recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch deleted file mode 100644 index 7153d641e0c618..00000000000000 --- a/recipes/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/recipes/arrow/config.yml b/recipes/arrow/config.yml index fdbc85ca265411..316731612eda23 100644 --- a/recipes/arrow/config.yml +++ b/recipes/arrow/config.yml @@ -25,7 +25,3 @@ versions: folder: all "7.0.0": folder: all - "2.0.0": - folder: all - "1.0.0": - folder: all diff --git a/recipes/asio/all/conandata.yml b/recipes/asio/all/conandata.yml index 5d0a18b1c54ced..2701f5013ce40b 100644 --- a/recipes/asio/all/conandata.yml +++ b/recipes/asio/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.30.2": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-30-2.tar.gz" + sha256: "755bd7f85a4b269c67ae0ea254907c078d408cce8e1a352ad2ed664d233780e8" + "1.30.1": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-30-1.tar.gz" + sha256: "94b121cc2016680f2314ef58eadf169c2d34fff97fba01df325a192d502d3a58" "1.29.0": url: "https://github.com/chriskohlhoff/asio/archive/asio-1-29-0.tar.gz" sha256: "44305859b4e6664dbbf853c1ef8ca0259d694f033753ae309fcb2534ca20f721" diff --git a/recipes/asio/config.yml b/recipes/asio/config.yml index 5385ba92196448..1655f339efad7c 100644 --- a/recipes/asio/config.yml +++ b/recipes/asio/config.yml @@ -1,4 +1,8 @@ versions: + "1.30.2": + folder: all + "1.30.1": + folder: all "1.29.0": folder: all "1.28.2": diff --git a/recipes/astro-informatics-so3/all/conandata.yml b/recipes/astro-informatics-so3/all/conandata.yml index 044d46996e9bec..7fd6407fb8411f 100644 --- a/recipes/astro-informatics-so3/all/conandata.yml +++ b/recipes/astro-informatics-so3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.6": + url: "https://github.com/astro-informatics/so3/archive/v1.3.6.tar.gz" + sha256: "9a8536b9998d54e7b61313548df01e989f07e15116ad49b471d7e321999f5f35" "1.3.4": url: "https://github.com/astro-informatics/so3/archive/refs/tags/v1.3.4.zip" sha256: "383431c3078faa073c3017ceb3e0108885ab7628e81af13488f9aa021b95bbc7" diff --git a/recipes/astro-informatics-so3/all/conanfile.py b/recipes/astro-informatics-so3/all/conanfile.py index e7486ed5b8c5a4..a00f6ada8c83c1 100644 --- a/recipes/astro-informatics-so3/all/conanfile.py +++ b/recipes/astro-informatics-so3/all/conanfile.py @@ -17,14 +17,12 @@ class AstroInformaticsSO3(ConanFile): homepage = "https://github.com/astro-informatics/so3" topics = ("physics", "astrophysics", "radio interferometry") - package_type = "library" + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { - "shared": [True, False], "fPIC": [True, False], } default_options = { - "shared": False, "fPIC": True, } @@ -40,8 +38,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("ssht/1.4.0", transitive_headers=True) - self.requires("fftw/3.3.9") + self.requires("ssht/1.5.2", transitive_headers=True, transitive_libs=True) + self.requires("fftw/3.3.10") def validate(self): if is_msvc(self): @@ -68,9 +66,7 @@ def build(self): cmake.build() def package(self): - copy(self, "LICENSE", - dst=os.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() diff --git a/recipes/astro-informatics-so3/config.yml b/recipes/astro-informatics-so3/config.yml index a81e52666d0757..f8568797580a52 100644 --- a/recipes/astro-informatics-so3/config.yml +++ b/recipes/astro-informatics-so3/config.yml @@ -1,3 +1,5 @@ versions: + "1.3.6": + folder: all "1.3.4": folder: all diff --git a/recipes/async_simple/all/conandata.yml b/recipes/async_simple/all/conandata.yml index b0f536ac754733..884ed02955ab22 100644 --- a/recipes/async_simple/all/conandata.yml +++ b/recipes/async_simple/all/conandata.yml @@ -1,5 +1,7 @@ sources: + "1.2": + url: "https://github.com/alibaba/async_simple/archive/refs/tags/1.2.tar.gz" + sha256: "a59a2674ac2b0a3997b90873b2bf0fbe4d96fdedbe6a2628c16c92a65a3fa39a" "1.0.0": - url: - - "https://github.com/alibaba/async_simple/archive/refs/tags/1.0.tar.gz" + url: "https://github.com/alibaba/async_simple/archive/refs/tags/1.0.tar.gz" sha256: "b243fb7af5d61b534fe18b662d16498392bbce1deffdc68e58829aa31db7badf" diff --git a/recipes/async_simple/config.yml b/recipes/async_simple/config.yml index 5d96905a31039c..0b3d8acdb470b5 100644 --- a/recipes/async_simple/config.yml +++ b/recipes/async_simple/config.yml @@ -1,4 +1,5 @@ versions: - # Newer versions at the top + "1.2": + folder: all "1.0.0": folder: all diff --git a/recipes/autoconf/all/conandata.yml b/recipes/autoconf/all/conandata.yml index 48a99f0a3f9087..9d182df49e442f 100644 --- a/recipes/autoconf/all/conandata.yml +++ b/recipes/autoconf/all/conandata.yml @@ -1,9 +1,13 @@ sources: "2.72": - url: "https://ftpmirror.gnu.org/autoconf/autoconf-2.72.tar.xz" + 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" + 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": diff --git a/recipes/avahi/all/conanfile.py b/recipes/avahi/all/conanfile.py index 6dfd0f410cd70e..2920eabb9e4486 100644 --- a/recipes/avahi/all/conanfile.py +++ b/recipes/avahi/all/conanfile.py @@ -45,8 +45,8 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.78.1") - self.requires("expat/2.5.0") + self.requires("glib/2.78.3") + self.requires("expat/[>=2.6.2 <3]") self.requires("libdaemon/0.14") self.requires("dbus/1.15.8") self.requires("gdbm/1.23") diff --git a/recipes/aws-kvs-pic/all/conandata.yml b/recipes/aws-kvs-pic/all/conandata.yml index 4be3843841ab1c..5e5052a1a9680a 100644 --- a/recipes/aws-kvs-pic/all/conandata.yml +++ b/recipes/aws-kvs-pic/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/awslabs/amazon-kinesis-video-streams-pic/archive/refs/tags/v1.1.0.tar.gz" + sha256: "ef45723cd439f855bae2304d9488b68cd6d1e0dc3203c97ebd1cbb26197edb55" "1.0.1": url: "https://github.com/awslabs/amazon-kinesis-video-streams-pic/archive/refs/tags/v1.0.1.tar.gz" sha256: "d04732217c74687c5498665b353cb089d725ca7f5b5da61a3f984f7fbefb2ac9" diff --git a/recipes/aws-kvs-pic/all/conanfile.py b/recipes/aws-kvs-pic/all/conanfile.py index a0653e082edea0..e8a10732328070 100644 --- a/recipes/aws-kvs-pic/all/conanfile.py +++ b/recipes/aws-kvs-pic/all/conanfile.py @@ -4,6 +4,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir, replace_in_file +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -72,6 +73,10 @@ def package_info(self): self.cpp_info.components["kvspic"].set_property("pkg_config_name", "libkvspic") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["kvspic"].system_libs = ["dl", "rt", "pthread"] + + if Version(self.version) >= "1.1.0": + if self.settings.build_type == "Debug": + self.cpp_info.components["kvspic"].defines = ["DEBUG_BUILD"] self.cpp_info.components["kvspicClient"].libs = ["kvspicClient"] self.cpp_info.components["kvspicClient"].set_property("pkg_config_name", "libkvspicClient") diff --git a/recipes/aws-kvs-pic/config.yml b/recipes/aws-kvs-pic/config.yml index 42adf0e62a4df0..f7630e1054b00f 100644 --- a/recipes/aws-kvs-pic/config.yml +++ b/recipes/aws-kvs-pic/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.0": + folder: all "1.0.1": folder: all "cci.20210812": diff --git a/recipes/basu/all/conandata.yml b/recipes/basu/all/conandata.yml new file mode 100644 index 00000000000000..3da511b3e486bb --- /dev/null +++ b/recipes/basu/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "0.2.1": + url: "https://git.sr.ht/~emersion/basu/refs/download/v0.2.1/basu-0.2.1.tar.gz" + sha256: "d9b373a9fcb5d5eb5f6c1c56355f76edb7f2f52bc744570e80604e83455a19bd" + +patches: + "0.2.1": + - patch_file: "patches/0001-memfd-util.c-Use-F_ADD_SEALS-definition-from-missing.patch" + patch_description: "add missing header to support old glibc" + patch_type: "portability" + patch_source: "https://lists.sr.ht/~emersion/public-inbox/patches/49899" diff --git a/recipes/basu/all/conanfile.py b/recipes/basu/all/conanfile.py new file mode 100644 index 00000000000000..5fbf09d93352b3 --- /dev/null +++ b/recipes/basu/all/conanfile.py @@ -0,0 +1,97 @@ +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, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +import os + + +required_conan_version = ">=1.53.0" + + +class BasuConan(ConanFile): + name = "basu" + description = "The sd-bus library, extracted from systemd" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://git.sr.ht/~emersion/basu" + topics = ("dbus", "sd-bus", "systemd") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libcap": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libcap": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os != "Linux": + del self.options.with_libcap + + 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 self.options.get_safe("with_libcap"): + self.requires("libcap/2.69") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration( + f"{self.ref} does not support {self.settings.os}") + + def build_requirements(self): + self.tool_requires("meson/1.3.2") + self.tool_requires("gperf/3.1") + if not self.conf.get("tools.gnu:pkg_config", default=False, 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): + feature = lambda option: "enabled" if option else "disabled" + + tc = MesonToolchain(self) + tc.project_options["auto_features"] = "disabled" + tc.project_options["libcap"] = feature(self.options.get_safe("with_libcap")) + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "LICENSE.LGPL2.1", self.source_folder, + os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["basu"] + self.cpp_info.set_property("pkg_config_name", "basu") + self.cpp_info.system_libs.extend(["m", "pthread", "rt"]) diff --git a/recipes/basu/all/patches/0001-memfd-util.c-Use-F_ADD_SEALS-definition-from-missing.patch b/recipes/basu/all/patches/0001-memfd-util.c-Use-F_ADD_SEALS-definition-from-missing.patch new file mode 100644 index 00000000000000..69e899279f1aef --- /dev/null +++ b/recipes/basu/all/patches/0001-memfd-util.c-Use-F_ADD_SEALS-definition-from-missing.patch @@ -0,0 +1,34 @@ +From 8e4960e8b9d11d9be96e83b02bd3b08178ddce1b Mon Sep 17 00:00:00 2001 +From: Sergey Bobrenok +Date: Wed, 28 Feb 2024 20:42:19 +0300 +Subject: [PATCH basu] memfd-util.c: Use F_ADD_SEALS definition from missing.h + +uClibc and glibc (until version 2.27, 2018) implementations don't +support F_ADD_SEALS and other F_SEAL_xxx flags. +'missing.h' was removed from 'memfd-util.c' in 37dbb2fcb ("Remove +useless includes"). + +Upstream: https://lists.sr.ht/~emersion/public-inbox/patches/49899 + +Signed-off-by: Sergey Bobrenok +--- + src/basic/memfd-util.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/basic/memfd-util.c b/src/basic/memfd-util.c +index 89893ba..7e535c6 100644 +--- a/src/basic/memfd-util.c ++++ b/src/basic/memfd-util.c +@@ -7,6 +7,7 @@ + + #include "alloc-util.h" + #include "memfd-util.h" ++#include "missing.h" + + int memfd_set_sealed(int fd) { + #if defined(__FreeBSD__) && __FreeBSD__ < 13 + +base-commit: 684a41d68cfbb05e38aacb60a8548e21ddfbecdb +-- +2.44.0 + diff --git a/recipes/basu/all/test_package/conanfile.py b/recipes/basu/all/test_package/conanfile.py new file mode 100644 index 00000000000000..cdcf9b281723d9 --- /dev/null +++ b/recipes/basu/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "PkgConfigDeps", "MesonToolchain", "VirtualRunEnv", "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires("meson/1.3.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + def build(self): + meson = Meson(self) + meson.configure() + meson.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/recipes/basu/all/test_package/meson.build b/recipes/basu/all/test_package/meson.build new file mode 100644 index 00000000000000..adf0ed21b4bcd1 --- /dev/null +++ b/recipes/basu/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('basu') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/basu/all/test_package/test_package.c b/recipes/basu/all/test_package/test_package.c new file mode 100644 index 00000000000000..9fe70e4d4a1cea --- /dev/null +++ b/recipes/basu/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include +#include + +#include + +int main(void) { + char *id = NULL; + int ret = 0; + + puts("decode object path"); + ret = sd_bus_path_decode("/foo/bar", "/foo", &id); + free(id); + if (ret > 0) { + puts("ok"); + return EXIT_SUCCESS; + } + puts("failed"); + return EXIT_FAILURE; +} diff --git a/recipes/basu/config.yml b/recipes/basu/config.yml new file mode 100644 index 00000000000000..f975c1e3261f72 --- /dev/null +++ b/recipes/basu/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.1": + folder: all diff --git a/recipes/behaviortree.cpp/all/conan_deps.cmake b/recipes/behaviortree.cpp/all/conan_deps.cmake new file mode 100644 index 00000000000000..1bfd028b220030 --- /dev/null +++ b/recipes/behaviortree.cpp/all/conan_deps.cmake @@ -0,0 +1,16 @@ +# Inject unvendored dependencies provided by Conan + +if(WITH_LEXY) + find_package(lexy REQUIRED CONFIG) + link_libraries(foonathan::lexy) +endif() + +if(WITH_MINITRACE) + find_package(minitrace REQUIRED CONFIG) + link_libraries(minitrace::minitrace) +endif() + +if(WITH_TINYXML2) + find_package(tinyxml2 REQUIRED CONFIG) + link_libraries(tinyxml2::tinyxml2) +endif() diff --git a/recipes/behaviortree.cpp/all/conandata.yml b/recipes/behaviortree.cpp/all/conandata.yml index 8e188b3097d435..e0d26c089d74f7 100644 --- a/recipes/behaviortree.cpp/all/conandata.yml +++ b/recipes/behaviortree.cpp/all/conandata.yml @@ -1,28 +1,13 @@ sources: + "4.5.2": + url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.5.2.tar.gz" + sha256: "1aaac034fc6a2f03d9347934e3baf3cabd5edc8bb416b9d7f5d944598019aeb9" "4.0.1": url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.0.1.tar.gz" sha256: "71544f72abea8e8c246b016b7e8d87d96f731c8aa96698058d8e69d40e56f9b9" + "3.8.6": + url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/3.8.6.tar.gz" + sha256: "df01713e61aa3b6f4a637dcff31dfd3c96c3c05fac226da8566a873a24ccde27" "3.7.0": url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/3.7.0.tar.gz" sha256: "ab0d8ac1a0df4dd43cf45da8a784bab7fdedf711bd0e227f7ed071f79b0c7b5c" - "3.5.6": - url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/3.5.6.tar.gz" - sha256: "543c428602b5acb7c5666aee34feb532e18ce7200870a79b23ff9aed17ee84c4" -patches: - "4.0.1": - - patch_file: "patches/4.0.1-0001-remove-fpic.patch" - - patch_file: "patches/4.0.1-0002-find-zmq.patch" - - patch_file: "patches/4.0.1-0003-no-werror.patch" - - patch_file: "patches/3.5.6-0005-stdc-format.patch" - - patch_file: "patches/3.5.6-0005-stdc-format.patch" - "3.7.0": - - patch_file: "patches/3.7.0-0001-remove-fpic.patch" - - patch_file: "patches/3.7.0-0002-find-zmq.patch" - - patch_file: "patches/3.7.0-0003-no-werror.patch" - - patch_file: "patches/3.5.6-0005-stdc-format.patch" - "3.5.6": - - patch_file: "patches/3.5.6-0001-remove-fpic.patch" - - patch_file: "patches/3.5.6-0002-find-zmq.patch" - - patch_file: "patches/3.5.6-0003-no-werror.patch" - - patch_file: "patches/3.5.6-0004-win-sigaction.patch" - - patch_file: "patches/3.5.6-0005-stdc-format.patch" diff --git a/recipes/behaviortree.cpp/all/conanfile.py b/recipes/behaviortree.cpp/all/conanfile.py index 54f5ae5ad83225..abd62b04171b48 100644 --- a/recipes/behaviortree.cpp/all/conanfile.py +++ b/recipes/behaviortree.cpp/all/conanfile.py @@ -1,8 +1,8 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import check_min_vs, is_msvc -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir -from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm +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 @@ -23,39 +23,70 @@ class BehaviorTreeCPPConan(ConanFile): "fPIC": [True, False], "with_tools": [True, False], "with_coroutines": [True, False], + "enable_groot_interface": [True, False], + "enable_sqlite_logging": [True, False], + "enable_manual_selector": [True, False], + "use_v3_compatible_names": [True, False], } default_options = { "shared": False, "fPIC": True, "with_tools": False, "with_coroutines": False, + "enable_groot_interface": True, + "enable_sqlite_logging": True, + "enable_manual_selector": False, + "use_v3_compatible_names": False, + } + options_description = { + "with_tools": "Build commandline tools", + "with_coroutines": "Enable Boost coroutines", + "enable_groot_interface": "Add Groot2 connection (requires ZeroMQ)", + "enable_sqlite_logging": "Add SQLite logging", + "enable_manual_selector": "Build manual selector node", + "use_v3_compatible_names": "Use v3 compatible names", } @property def _minimum_cppstd_required(self): - return 14 if Version(self.version) < "4.0" else 17 + if Version(self.version) >= "4.0": + return 17 + return 14 @property def _minimum_compilers_version(self): - if Version(self.version) < "4.0": + if Version(self.version) >= "4.0": return { - "gcc": "5", - "clang": "5", + "gcc": "8", + "clang": "7", "apple-clang": "12", + "msvc": "192", + "Visual Studio": "16", } else: return { - "gcc": "8", - "clang": "7", + "gcc": "5", + "clang": "5", "apple-clang": "12", + "msvc": "191", + "Visual Studio": "15", } def export_sources(self): - export_conandata_patches(self) + copy(self, "conan_deps.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) < "4.0": + del self.options.use_v3_compatible_names + if Version(self.version) >= "4.1.0": + del self.options.with_coroutines + if Version(self.version) >= "4.1.1": + del self.options.enable_manual_selector + else: + del self.options.enable_groot_interface + del self.options.enable_sqlite_logging def configure(self): if self.options.shared: @@ -64,54 +95,150 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + @property + def _with_boost(self): + return self.options.get_safe("with_coroutines", False) + + @property + def _with_lexy(self): + # FIXME: using vendored version temporarily due to a missing CCI binary + # return Version(self.version) >= "4.0.0" + return False + + @property + def _with_minitrace(self): + return Version(self.version) >= "4.3.4" + + @property + def _with_ncurses(self): + return self.options.get_safe("enable_manual_selector", False) + + @property + def _with_sqlite3(self): + return self.options.get_safe("enable_sqlite_logging", False) + + @property + def _with_tinyxml2(self): + return Version(self.version) >= "4.0.0" + + @property + def _with_zeromq(self): + if Version(self.version) >= "4.1.1": + return self.options.enable_groot_interface + return Version(self.version) >= "4.0.0" + def requirements(self): - if self.options.with_coroutines: - self.requires("boost/1.80.0") - self.requires("ncurses/6.3") - self.requires("zeromq/4.3.4") - self.requires("cppzmq/4.9.0") + if self._with_boost: + self.requires("boost/1.83.0") + if self._with_ncurses: + self.requires("ncurses/6.4") + if self._with_lexy: + self.requires("foonathan-lexy/2022.12.1") + if self._with_minitrace: + self.requires("minitrace/cci.20230905") + if self._with_sqlite3: + self.requires("sqlite3/3.44.2") + if self._with_tinyxml2: + self.requires("tinyxml2/10.0.0") + if self._with_zeromq: + self.requires("zeromq/4.3.5") + + # TODO: other vendored dependencies + # - cppzmq is customized and not compatible with Conan version + # - cpp-sqlite + # - minicoro + # - wildcards def validate(self): if self.info.settings.os == "Windows" and self.info.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Windows.") if self.info.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._minimum_cppstd_required) - check_min_vs(self, 191 if Version(self.version) < "4.0" else 192) - if not is_msvc(self): - minimum_version = self._minimum_compilers_version.get(str(self.info.settings.compiler), False) - if not minimum_version: - self.output.warn(f"{self.ref} requires C++{self._minimum_cppstd_required}. Your compiler is unknown. Assuming it supports C++{self._minimum_cppstd_required}.") - elif Version(self.info.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("BehaviorTree.CPP requires C++{}, which your compiler does not support." - .format(self._minimum_cppstd_required)) + minimum_version = self._minimum_compilers_version.get(str(self.info.settings.compiler), False) + if not minimum_version: + self.output.warn(f"{self.ref} requires C++{self._minimum_cppstd_required}. " + f"Your compiler is unknown. Assuming it supports C++{self._minimum_cppstd_required}.") + elif Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"BehaviorTree.CPP requires C++{self._minimum_cppstd_required}, which your compiler does not support." + ) if self.settings.compiler == "clang" and str(self.settings .compiler.libcxx) == "libstdc++": raise ConanInvalidConfiguration(f"{self.ref} needs recent libstdc++ with charconv. please switch to gcc, or to libc++") + if self.settings.compiler == "apple-clang" and cross_building(self) and self.settings.arch in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"Cross-compiling for {self.settings.arch} is not yet supported. Contributions are welcome!") + + def build_requirements(self): + if Version(self.version) >= "4.1.0": + self.tool_requires("cmake/[>=3.16.3 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + tc = CMakeToolchain(self) + tc.variables["CMAKE_PROJECT_behaviortree_cpp_INCLUDE"] = "conan_deps.cmake" + tc.variables["WITH_LEXY"] = self._with_lexy + tc.variables["WITH_MINITRACE"] = self._with_minitrace + tc.variables["WITH_TINYXML2"] = self._with_tinyxml2 + if not self.options.get_safe("enable_manual_selector"): + # Avoid accidental use of system ncurses + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Curses"] = True if Version(self.version) < "4.0": tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_UNIT_TESTS"] = False tc.variables["BUILD_TOOLS"] = self.options.with_tools tc.variables["ENABLE_COROUTINES"] = self.options.with_coroutines + tc.variables["BUILD_MANUAL_SELECTOR"] = self.options.get_safe("enable_manual_selector", False) else: tc.variables["BTCPP_SHARED_LIBS"] = self.options.shared tc.variables["BTCPP_EXAMPLES"] = False tc.variables["BTCPP_UNIT_TESTS"] = False tc.variables["BTCPP_BUILD_TOOLS"] = self.options.with_tools - tc.variables["BTCPP_ENABLE_COROUTINES"] = self.options.with_coroutines + tc.variables["BTCPP_ENABLE_COROUTINES"] = self.options.get_safe("with_coroutines", False) + tc.variables["BTCPP_MANUAL_SELECTOR"] = self.options.get_safe("enable_manual_selector", False) + tc.variables["BTCPP_GROOT_INTERFACE"] = self.options.get_safe("enable_groot_interface", False) + tc.variables["BTCPP_SQLITE_LOGGING"] = self.options.get_safe("enable_sqlite_logging", False) + tc.variables["USE_V3_COMPATIBLE_NAMES"] = self.options.use_v3_compatible_names tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) + if Version(self.version) >= "4.1.0": + deps.set_property("zeromq", "cmake_file_name", "ZeroMQ") + else: + deps.set_property("zeromq", "cmake_file_name", "ZMQ") deps.generate() + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # Let Conan handle -fPIC + replace_in_file(self, cmakelists, "set(CMAKE_POSITION_INDEPENDENT_CODE ON)\n", "") + # Unvendor lexy + if self._with_lexy: + rmdir(self, os.path.join(self.source_folder, "3rdparty", "lexy")) + save(self, os.path.join(self.source_folder, "3rdparty", "lexy", "CMakeLists.txt"), "") + # Unvendor minitrace + if self._with_minitrace: + rmdir(self, os.path.join(self.source_folder, "3rdparty", "minitrace")) + replace_in_file(self, cmakelists, "3rdparty/minitrace/minitrace.cpp", "") + replace_in_file(self, os.path.join(self.source_folder, "src", "loggers", "bt_minitrace_logger.cpp"), + "minitrace/minitrace.h", "minitrace.h") + # Unvendor tinyxml2 + if self._with_tinyxml2: + rmdir(self, os.path.join(self.source_folder, "3rdparty", "tinyxml2")) + replace_in_file(self, cmakelists, "3rdparty/tinyxml2/tinyxml2.cpp", "") + replace_in_file(self, os.path.join(self.source_folder, "src", "xml_parsing.cpp"), + "tinyxml2/tinyxml2.h", "tinyxml2.h") + # Ensure ZeroMQ and other packages are provided by Conan + rm(self, "Find*.cmake", os.path.join(self.source_folder, "cmake")) + def build(self): - apply_conandata_patches(self) + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -125,39 +252,48 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - if Version(self.version) < "4.0": - self.cpp_info.set_property("cmake_file_name", "BehaviorTreeV3") + if Version(self.version) >= "4.0": + cmake_file_name = "BehaviorTree" + libname = "behaviortree_cpp" else: - self.cpp_info.set_property("cmake_file_name", "BehaviorTree") - - libname = "behaviortree_cpp_v3" if Version(self.version) < "4.0" else "behaviortree_cpp" + cmake_file_name = "BehaviorTreeV3" + libname = "behaviortree_cpp_v3" + self.cpp_info.set_property("cmake_file_name", cmake_file_name) self.cpp_info.set_property("cmake_target_name", f"BT::{libname}") + requires = [] + if self._with_boost: + requires.append("boost::coroutine") + if self._with_lexy: + requires.append("foonathan-lexy::foonathan-lexy") + if self._with_minitrace: + requires.append("minitrace::minitrace") + if self._with_ncurses: + requires.append("ncurses::ncurses") + if self._with_sqlite3: + requires.append("sqlite3::sqlite3") + if self._with_tinyxml2: + requires.append("tinyxml2::tinyxml2") + if self._with_zeromq: + requires.append("zeromq::zeromq") + postfix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" # TODO: back to global scope in conan v2 once cmake_find_package* generators removed self.cpp_info.components[libname].libs = [f"{libname}{postfix}"] - self.cpp_info.components[libname].requires = ["zeromq::zeromq", "cppzmq::cppzmq", "ncurses::ncurses"] - if self.options.with_coroutines: - self.cpp_info.components[libname].requires.append("boost::coroutine") + self.cpp_info.components[libname].requires = requires if self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.components[libname].system_libs.append("pthread") + self.cpp_info.components[libname].system_libs.extend(["pthread", "dl"]) if Version(self.version) >= "4.0" and \ self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": self.cpp_info.components[libname].system_libs.append("stdc++fs") if self.options.with_tools: bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env var with : {}".format(bin_path)) self.env_info.PATH.append(bin_path) # TODO: to remove in conan v2 once cmake_find_package* generators removed - if Version(self.version) < "4.0": - self.cpp_info.filenames["cmake_find_package"] = "BehaviorTreeV3" - self.cpp_info.filenames["cmake_find_package_multi"] = "BehaviorTreeV3" - else: - self.cpp_info.filenames["cmake_find_package"] = "BehaviorTree" - self.cpp_info.filenames["cmake_find_package_multi"] = "BehaviorTree" - + self.cpp_info.filenames["cmake_find_package"] = cmake_file_name + self.cpp_info.filenames["cmake_find_package_multi"] = cmake_file_name self.cpp_info.names["cmake_find_package"] = "BT" self.cpp_info.names["cmake_find_package_multi"] = "BT" self.cpp_info.components[libname].names["cmake_find_package"] = libname diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0001-remove-fpic.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0001-remove-fpic.patch deleted file mode 100644 index 7cb2daad955aa1..00000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0001-remove-fpic.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a390aed..aff91ec 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -36,7 +36,6 @@ if(NOT DEFINED BT_COROUTINES) - add_definitions(-DBT_NO_COROUTINES) - endif() - --set(CMAKE_POSITION_INDEPENDENT_CODE ON) - - #---- project configuration ---- - option(BUILD_EXAMPLES "Build tutorials and examples" ON) diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0002-find-zmq.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0002-find-zmq.patch deleted file mode 100644 index c717020c8e00ad..00000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0002-find-zmq.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index aff91ec..242c214 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -45,14 +45,14 @@ option(BUILD_SHARED_LIBS "Build shared libraries" ON) - - #---- Find other packages ---- - find_package(Threads) --find_package(ZMQ) -+find_package(ZeroMQ) - - list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS} - ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - message(STATUS "ZeroMQ found.") - add_definitions( -DZMQ_FOUND ) - list(APPEND BT_SOURCE src/loggers/bt_zmq_publisher.cpp) -@@ -202,8 +202,8 @@ if (WIN32) - add_library(${BEHAVIOR_TREE_LIBRARY} STATIC ${BT_SOURCE} ) - endif() - --if( ZMQ_FOUND ) -- list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZMQ_INCLUDE_DIRS}) -+if( ZeroMQ_FOUND ) -+ list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIRS}) - endif() - - target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC -@@ -211,7 +211,7 @@ target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC - - target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PRIVATE - ${Boost_LIBRARIES} -- ${ZMQ_LIBRARIES}) -+ ${ZeroMQ_LIBRARIES}) - - #get_target_property(my_libs ${BEHAVIOR_TREE_LIBRARY} INTERFACE_LINK_LIBRARIES) - #list(REMOVE_ITEM _libs X) -@@ -227,8 +227,8 @@ target_include_directories(${BEHAVIOR_TREE_LIBRARY} PUBLIC - $ - ${BUILD_TOOL_INCLUDE_DIRS}) - --if( ZMQ_FOUND ) -- target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZMQ_FOUND) -+if( ZeroMQ_FOUND ) -+ target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZeroMQ_FOUND) - endif() - - if(MSVC) -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 0801850..153b447 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -6,9 +6,9 @@ target_link_libraries(bt3_log_cat ${BEHAVIOR_TREE_LIBRARY} ) - install(TARGETS bt3_log_cat - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - add_executable(bt3_recorder bt_recorder.cpp ) -- target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZMQ_LIBRARIES}) -+ target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZeroMQ_LIBRARIES}) - install(TARGETS bt3_recorder - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - endif() diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0003-no-werror.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0003-no-werror.patch deleted file mode 100644 index 4996714060f932..00000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0003-no-werror.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 242c214..cb8d77a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -232,10 +232,10 @@ if( ZeroMQ_FOUND ) - endif() - - if(MSVC) -- target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE /W3 /WX) -+ target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE /W3) - else() - target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE -- -Wall -Wextra -Werror=return-type) -+ -Wall -Wextra) - endif() - - ###################################################### diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0004-win-sigaction.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0004-win-sigaction.patch deleted file mode 100644 index 75f9c74e55e107..00000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0004-win-sigaction.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/tools/bt_recorder.cpp b/tools/bt_recorder.cpp -index 3aa6740..4b36414 100644 ---- a/tools/bt_recorder.cpp -+++ b/tools/bt_recorder.cpp -@@ -16,12 +16,17 @@ static void s_signal_handler(int) - - static void CatchSignals(void) - { -+#ifdef _WIN32 -+ signal(SIGINT, s_signal_handler); -+ signal(SIGTERM, s_signal_handler); -+#else - struct sigaction action; - action.sa_handler = s_signal_handler; - action.sa_flags = 0; - sigemptyset(&action.sa_mask); - sigaction(SIGINT, &action, NULL); - sigaction(SIGTERM, &action, NULL); -+#endif - } - - int main(int argc, char* argv[]) diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0005-stdc-format.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0005-stdc-format.patch deleted file mode 100644 index d1b1b47051f320..00000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0005-stdc-format.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/3rdparty/minitrace/minitrace.h b/3rdparty/minitrace/minitrace.h -index c7d5b31..d68dc52 100644 ---- a/3rdparty/minitrace/minitrace.h -+++ b/3rdparty/minitrace/minitrace.h -@@ -21,6 +21,7 @@ - // More: - // http://www.altdevblogaday.com/2012/08/21/using-chrometracing-to-view-your-inline-profiling-data/ - -+#define __STDC_FORMAT_MACROS - #include - - #define MTR_ENABLED diff --git a/recipes/behaviortree.cpp/all/patches/3.7.0-0001-remove-fpic.patch b/recipes/behaviortree.cpp/all/patches/3.7.0-0001-remove-fpic.patch deleted file mode 100644 index b1bd9fd89538c0..00000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.7.0-0001-remove-fpic.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cd490a5..843045e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -15,8 +15,6 @@ else() - add_definitions(-Wpedantic) - endif() - --set(CMAKE_POSITION_INDEPENDENT_CODE ON) -- - #---- project configuration ---- - option(BUILD_EXAMPLES "Build tutorials and examples" ON) - option(BUILD_SAMPLES "Build sample nodes" ON) diff --git a/recipes/behaviortree.cpp/all/patches/3.7.0-0002-find-zmq.patch b/recipes/behaviortree.cpp/all/patches/3.7.0-0002-find-zmq.patch deleted file mode 100644 index 7290476cc87263..00000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.7.0-0002-find-zmq.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 843045e..471c00e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -54,14 +54,14 @@ endif() - - #---- Find other packages ---- - find_package(Threads) --find_package(ZMQ) -+find_package(ZeroMQ) - - list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS} - ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - message(STATUS "ZeroMQ found.") - add_definitions( -DZMQ_FOUND ) - list(APPEND BT_SOURCE src/loggers/bt_zmq_publisher.cpp) -@@ -193,8 +193,8 @@ else() - add_library(${BEHAVIOR_TREE_LIBRARY} STATIC ${BT_SOURCE}) - endif() - --if( ZMQ_FOUND ) -- list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZMQ_INCLUDE_DIRS}) -+if( ZeroMQ_FOUND ) -+ list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIRS}) - endif() - - target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC -@@ -202,7 +202,7 @@ target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC - - target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PRIVATE - ${Boost_LIBRARIES} -- ${ZMQ_LIBRARIES}) -+ ${ZeroMQ_LIBRARIES}) - - #get_target_property(my_libs ${BEHAVIOR_TREE_LIBRARY} INTERFACE_LINK_LIBRARIES) - #list(REMOVE_ITEM _libs X) -@@ -218,8 +218,8 @@ target_include_directories(${BEHAVIOR_TREE_LIBRARY} PUBLIC - $ - ${BUILD_TOOL_INCLUDE_DIRS}) - --if( ZMQ_FOUND ) -- target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZMQ_FOUND) -+if( ZeroMQ_FOUND ) -+ target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZeroMQ_FOUND) - endif() - - if(MSVC) -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 2ad33b3..2dc969d 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -6,9 +6,9 @@ target_link_libraries(bt3_log_cat ${BEHAVIOR_TREE_LIBRARY} ) - install(TARGETS bt3_log_cat - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - add_executable(bt3_recorder bt_recorder.cpp ) -- target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZMQ_LIBRARIES}) -+ target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZeroMQ_LIBRARIES}) - install(TARGETS bt3_recorder - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - endif() diff --git a/recipes/behaviortree.cpp/all/patches/3.7.0-0003-no-werror.patch b/recipes/behaviortree.cpp/all/patches/3.7.0-0003-no-werror.patch deleted file mode 100644 index 5bf8893db1770a..00000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.7.0-0003-no-werror.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 471c00e..7245461 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -225,7 +225,7 @@ endif() - if(MSVC) - else() - target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE -- -Wall -Wextra -Werror=return-type) -+ -Wall -Wextra) - endif() - - ############################################################# diff --git a/recipes/behaviortree.cpp/all/patches/4.0.1-0001-remove-fpic.patch b/recipes/behaviortree.cpp/all/patches/4.0.1-0001-remove-fpic.patch deleted file mode 100644 index 23931bd446392c..00000000000000 --- a/recipes/behaviortree.cpp/all/patches/4.0.1-0001-remove-fpic.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d03b8a7..a2f23cf 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -15,8 +15,6 @@ else() - add_definitions(-Wpedantic) - endif() - --set(CMAKE_POSITION_INDEPENDENT_CODE ON) -- - #---- project configuration ---- - option(BTCPP_SHARED_LIBS "Build shared libraries" ON) - option(BTCPP_ENABLE_COROUTINES "Enable boost coroutines" ON) diff --git a/recipes/behaviortree.cpp/all/patches/4.0.1-0002-find-zmq.patch b/recipes/behaviortree.cpp/all/patches/4.0.1-0002-find-zmq.patch deleted file mode 100644 index 6753b06f564d08..00000000000000 --- a/recipes/behaviortree.cpp/all/patches/4.0.1-0002-find-zmq.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a2f23cf..d427d37 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -67,14 +67,14 @@ endif() - - #---- Find other packages ---- - find_package(Threads) --find_package(ZMQ) -+find_package(ZeroMQ) - - list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS} - ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - message(STATUS "ZeroMQ found.") - add_definitions( -DZMQ_FOUND ) - list(APPEND BT_SOURCE src/loggers/bt_zmq_publisher.cpp) -@@ -221,7 +221,7 @@ target_link_libraries(${BEHAVIOR_TREE_LIBRARY} - ${BEHAVIOR_TREE_PUBLIC_LIBRARIES} - PRIVATE - ${Boost_LIBRARIES} -- ${ZMQ_LIBRARIES} -+ ${ZeroMQ_LIBRARIES} - $ - ) - -@@ -243,8 +243,8 @@ target_include_directories(${BEHAVIOR_TREE_LIBRARY} PRIVATE - $ - ) - --if( ZMQ_FOUND ) -- target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZMQ_FOUND) -+if( ZeroMQ_FOUND ) -+ target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZeroMQ_FOUND) - endif() - - if(MSVC) -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 163e703..b98f525 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -7,9 +7,9 @@ target_link_libraries(bt3_log_cat ${BEHAVIOR_TREE_LIBRARY} ) - install(TARGETS bt3_log_cat - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - add_executable(bt3_recorder bt_recorder.cpp ) -- target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZMQ_LIBRARIES}) -+ target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZeroMQ_LIBRARIES}) - install(TARGETS bt3_recorder - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - endif() diff --git a/recipes/behaviortree.cpp/all/patches/4.0.1-0003-no-werror.patch b/recipes/behaviortree.cpp/all/patches/4.0.1-0003-no-werror.patch deleted file mode 100644 index b69541449eb87f..00000000000000 --- a/recipes/behaviortree.cpp/all/patches/4.0.1-0003-no-werror.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d427d37..0c10f52 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -250,7 +250,7 @@ endif() - if(MSVC) - else() - target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE -- -Wall -Wextra -Werror=return-type) -+ -Wall -Wextra) - endif() - - ############################################################# diff --git a/recipes/behaviortree.cpp/config.yml b/recipes/behaviortree.cpp/config.yml index e1234d5535a8c3..f6b53df246238d 100644 --- a/recipes/behaviortree.cpp/config.yml +++ b/recipes/behaviortree.cpp/config.yml @@ -1,7 +1,9 @@ versions: + "4.5.2": + folder: all "4.0.1": folder: all - "3.7.0": + "3.8.6": folder: all - "3.5.6": + "3.7.0": folder: all diff --git a/recipes/binutils/all/conandata.yml b/recipes/binutils/all/conandata.yml index 92a40425b25909..f0dd0d5db997f0 100644 --- a/recipes/binutils/all/conandata.yml +++ b/recipes/binutils/all/conandata.yml @@ -1,26 +1,16 @@ sources: + "2.42": + url: "https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz" + sha256: "f6e4d41fd5fc778b06b7891457b3620da5ecea1006c6a4a41ae998109f85a800" "2.41": - url: "https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.gz" - sha256: "48d00a8dc73aa7d2394a7dc069b96191d95e8de8f0da6dc91da5cce655c20e45" - "2.40": - url: "https://ftp.gnu.org/gnu/binutils/binutils-2.40.tar.gz" - sha256: "d7f82c4047decf43a6f769ac32456a92ddb6932409a585c633cdd4e9df23d956" - "2.38": # 2022-02-09 - url: "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" - sha256: "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" - "2.37": - url: "https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.gz" - sha256: "c44968b97cd86499efbc4b4ab7d98471f673e5414c554ef54afa930062dbbfcb" + url: "https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.xz" + sha256: "ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450" patches: + "2.42": + - patch_file: "patches/2.42-0001-no-texinfo.patch" + patch_type: "conan" + patch_description: "disable texinfo" "2.41": - patch_file: "patches/2.41-0001-no-texinfo.patch" - patch_type: conan - patch_description: "disable texinfo" - "2.40": - - patch_file: "patches/2.40-0001-no-texinfo.patch" - patch_type: conan - patch_description: "disable texinfo" - "2.38": - - patch_file: "patches/2.38-0001-no-texinfo.patch" - patch_type: conan + patch_type: "conan" patch_description: "disable texinfo" diff --git a/recipes/binutils/all/conanfile.py b/recipes/binutils/all/conanfile.py index 1e04fbc03a87b2..09d66fc511d1fe 100644 --- a/recipes/binutils/all/conanfile.py +++ b/recipes/binutils/all/conanfile.py @@ -132,10 +132,8 @@ def build_requirements(self): self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type="str"): self.tool_requires("msys2/cci.latest") - - if self.version >= "2.39": - self.tool_requires("bison/3.8.2") - self.tool_requires("flex/2.6.4") + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") def requirements(self): self.requires("zlib/[>=1.2.11 <2]") @@ -199,8 +197,6 @@ def package_info(self): # v2 exports self.buildenv_info.append_path("PATH", bindir) self.buildenv_info.append_path("PATH", absolute_target_bindir) - self.conf_info.define("user.binutils:gnu_triplet", self.options.target_triplet) - self.conf_info.define("user.binutils:prefix", self.options.prefix) # Add recipe path to enable running the self test in the test package. # Don't use this property in production code. It's unsupported. diff --git a/recipes/binutils/all/patches/2.38-0001-no-texinfo.patch b/recipes/binutils/all/patches/2.38-0001-no-texinfo.patch deleted file mode 100644 index 1e0698965c0de5..00000000000000 --- a/recipes/binutils/all/patches/2.38-0001-no-texinfo.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- gas/Makefile.in -+++ gas/Makefile.in -@@ -1778,7 +1778,7 @@ - check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU - check: check-recursive --all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h -+all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) config.h - installdirs: installdirs-recursive - installdirs-am: - for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \ -@@ -1854,7 +1854,7 @@ info: info-recursive - - info-am: $(INFO_DEPS) info-local - --install-data-am: install-data-local install-info-am install-man -+install-data-am: install-man - - install-dvi: install-dvi-recursive - diff --git a/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch b/recipes/binutils/all/patches/2.42-0001-no-texinfo.patch similarity index 77% rename from recipes/binutils/all/patches/2.40-0001-no-texinfo.patch rename to recipes/binutils/all/patches/2.42-0001-no-texinfo.patch index fbd00f17e49e49..231668a13cce45 100644 --- a/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch +++ b/recipes/binutils/all/patches/2.42-0001-no-texinfo.patch @@ -1,26 +1,6 @@ ---- gas/Makefile.in -+++ gas/Makefile.in -@@ -1794,7 +1794,7 @@ - check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU - check: check-recursive --all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h -+all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) config.h - installdirs: installdirs-recursive - installdirs-am: - for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \ -@@ -1870,7 +1870,7 @@ - - info-am: $(INFO_DEPS) info-local - --install-data-am: install-info-am install-man -+install-data-am: install-man - - install-dvi: install-dvi-recursive - --- bfd/Makefile.in +++ bfd/Makefile.in -@@ -266,7 +266,7 @@ +@@ -259,7 +259,7 @@ am__v_texidevnull_0 = > /dev/null am__v_texidevnull_1 = am__dirstamp = $(am__leading_dot)dirstamp @@ -29,16 +9,16 @@ am__TEXINFO_TEX_DIR = $(srcdir) DVIS = doc/bfd.dvi PDFS = doc/bfd.pdf -@@ -2053,7 +2053,7 @@ +@@ -2050,7 +2050,7 @@ check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive --all-am: Makefile $(INFO_DEPS) $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) \ -+all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) \ - config.h +-all-am: Makefile $(INFO_DEPS) $(LTLIBRARIES) $(HEADERS) config.h ++all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h installdirs: installdirs-recursive installdirs-am: -@@ -2122,8 +2122,7 @@ + for dir in "$(DESTDIR)$(bfdlibdir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(bfdincludedir)"; do \ +@@ -2117,8 +2117,7 @@ info-am: $(INFO_DEPS) @@ -48,3 +28,24 @@ install-dvi: install-dvi-recursive + +--- gas/Makefile.in ++++ gas/Makefile.in +@@ -1825,7 +1825,7 @@ + check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU + check: check-recursive +-all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h ++all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) config.h + installdirs: installdirs-recursive + installdirs-am: + for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \ +@@ -1901,7 +1901,7 @@ + + info-am: $(INFO_DEPS) info-local + +-install-data-am: install-info-am install-man ++install-data-am: install-man + + install-dvi: install-dvi-recursive + diff --git a/recipes/binutils/config.yml b/recipes/binutils/config.yml index 97d0d2ecab157c..58766488a25845 100644 --- a/recipes/binutils/config.yml +++ b/recipes/binutils/config.yml @@ -1,9 +1,5 @@ versions: - "2.41": - folder: all - "2.40": + "2.42": folder: all - "2.38": - folder: all - "2.37": + "2.41": folder: all diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index f2f1c3f6feecdb..25b060af95c59a 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -1749,6 +1749,8 @@ def filter_transform_module_libraries(names): 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",) and self.settings.os == "Windows": continue if name == "boost_stacktrace_addr2line" and not self._stacktrace_addr2line_available: diff --git a/recipes/botan/all/conandata.yml b/recipes/botan/all/conandata.yml index 67a7d6257434cb..3472b4e6e22008 100644 --- a/recipes/botan/all/conandata.yml +++ b/recipes/botan/all/conandata.yml @@ -32,6 +32,9 @@ sources: "3.3.0": url: "https://github.com/randombit/botan/archive/3.3.0.tar.gz" sha256: "57fefda7b9ab6f8409329620cdaf26d2d7e962b6a10eb321d331e9ecb796f804" + "3.4.0": + url: "https://github.com/randombit/botan/archive/3.4.0.tar.gz" + sha256: "6ef2a16a0527b1cfc9648a644877f7b95c4d07e8ef237273b030c623418c5e5b" patches: "2.18.2": - patch_file: "patches/fix-amalgamation-build.patch" diff --git a/recipes/botan/config.yml b/recipes/botan/config.yml index 9230bceaba6c62..97827ec9a391e4 100644 --- a/recipes/botan/config.yml +++ b/recipes/botan/config.yml @@ -21,3 +21,5 @@ versions: folder: all "3.3.0": folder: all + "3.4.0": + folder: all diff --git a/recipes/bshoshany-thread-pool/all/conandata.yml b/recipes/bshoshany-thread-pool/all/conandata.yml index 3f31e9885d1c35..679f32bc317692 100644 --- a/recipes/bshoshany-thread-pool/all/conandata.yml +++ b/recipes/bshoshany-thread-pool/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.1.0": + sha256: "be7abecbc420bb87919eeef729b13ff7c29d5ce547bdae284923296c695415bd" + url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v4.1.0.tar.gz" "4.0.1": sha256: "34d25503e17e58198613d9306313f8358cfaaa9320f2b7694dc599b90a1858a7" url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v4.0.1.tar.gz" diff --git a/recipes/bshoshany-thread-pool/config.yml b/recipes/bshoshany-thread-pool/config.yml index 31ec3f0d004299..56c2c868cfbdfe 100644 --- a/recipes/bshoshany-thread-pool/config.yml +++ b/recipes/bshoshany-thread-pool/config.yml @@ -1,4 +1,6 @@ versions: + "4.1.0": + folder: all "4.0.1": folder: all "3.5.0": diff --git a/recipes/c-ares/all/conandata.yml b/recipes/c-ares/all/conandata.yml index 3833dbb894ff02..3a07eb4a811b85 100644 --- a/recipes/c-ares/all/conandata.yml +++ b/recipes/c-ares/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "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" diff --git a/recipes/c-ares/config.yml b/recipes/c-ares/config.yml index 75dbe67cad1ac8..78e892e1326a40 100644 --- a/recipes/c-ares/config.yml +++ b/recipes/c-ares/config.yml @@ -1,4 +1,6 @@ versions: + "1.28.1": + folder: all "1.27.0": folder: all "1.26.0": diff --git a/recipes/cairo/all/conandata.yml b/recipes/cairo/all/conandata.yml deleted file mode 100644 index a2d821e85845fd..00000000000000 --- a/recipes/cairo/all/conandata.yml +++ /dev/null @@ -1,26 +0,0 @@ -sources: - "1.17.2": - sha256: "6b70d4655e2a47a22b101c666f4b29ba746eda4aa8a0f7255b32b2e9408801df" - url: - - "https://www.cairographics.org/snapshots/cairo-1.17.2.tar.xz" - - "https://www.mirrorservice.org/sites/tinycorelinux.net/11.x/x86_64/tcz/src/cairo/cairo-1.17.2.tar.xz" - "1.16.0": - sha256: "5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331" - url: - - "https://www.cairographics.org/releases/cairo-1.16.0.tar.xz" - - "https://mirror.koddos.net/blfs/conglomeration/cairo/cairo-1.16.0.tar.xz" -patches: - "1.17.2": - - patch_file: "patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch" - - patch_file: "patches/binutils-2.34-libbfd-fix.patch" - patch_description: "fix build with newer versions of bfd" - patch_type: backport - patch_source: https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/128 - base_path: "util/cairo-trace" - "1.16.0": - - patch_file: "patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch" - - patch_file: "patches/binutils-2.34-libbfd-fix.patch" - patch_description: "fix build with newer versions of bfd" - patch_type: backport - patch_source: https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/128 - base_path: "util/cairo-trace" diff --git a/recipes/cairo/all/conanfile.py b/recipes/cairo/all/conanfile.py deleted file mode 100644 index 1e8675e64a203b..00000000000000 --- a/recipes/cairo/all/conanfile.py +++ /dev/null @@ -1,341 +0,0 @@ -import os - -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import fix_apple_shared_install_name, is_apple_os -from conan.tools.build import cross_building -from conan.tools.env import VirtualBuildEnv, VirtualRunEnv -from conan.tools.files import ( - apply_conandata_patches, - copy, - export_conandata_patches, - get, - replace_in_file, - rename, - rm, - rmdir -) -from conan.tools.gnu import PkgConfigDeps, Autotools, AutotoolsDeps, AutotoolsToolchain -from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc, unix_path -from conan.tools.scm import Version - -required_conan_version = ">=1.54.0" - - -class CairoConan(ConanFile): - name = "cairo" - description = "Cairo is a 2D graphics library with support for multiple output devices" - topics = ("graphics") - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://cairographics.org/" - license = ("LGPL-2.1-only", "MPL-1.1") - package_type = "library" - settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - "with_freetype": [True, False], - "with_fontconfig": [True, False], - "with_xlib": [True, False], - "with_xlib_xrender": [True, False], - "with_xcb": [True, False], - "with_glib": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - "with_freetype": True, - "with_fontconfig": True, - "with_xlib": True, - "with_xlib_xrender": False, - "with_xcb": True, - "with_glib": True, - } - 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 - del self.options.with_fontconfig - if is_msvc(self): - del self.options.with_freetype - del self.options.with_glib - if self.settings.os != "Linux": - del self.options.with_xlib - del self.options.with_xlib_xrender - del self.options.with_xcb - - 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 self.options.get_safe("with_freetype", True): - self.requires("freetype/2.13.0") - if self.options.get_safe("with_fontconfig", False): - self.requires("fontconfig/2.14.2") - if self.settings.os == "Linux": - if self.options.with_xlib or self.options.with_xlib_xrender or self.options.with_xcb: - self.requires("xorg/system") - if self.options.get_safe("with_glib", True): - self.requires("glib/2.76.3") - self.requires("zlib/1.2.13") - self.requires("pixman/0.40.0") - self.requires("libpng/1.6.40") - - def package_id(self): - if self.options.get_safe("with_glib") and not self.dependencies["glib"].options.shared: - self.info.requires["glib"].full_package_mode() - - def validate(self): - if is_msvc(self): - # TODO autotools build results in LNK1127 error from a library in the WindowsSDK on CCI - # should be retested in case this is just a CCI environment issue - raise ConanInvalidConfiguration("MSVC autotools build is not supported. Use the Meson build instead.") - - def build_requirements(self): - self.tool_requires("libtool/2.4.7") - if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/1.9.3") - if self._settings_build.os == "Windows": - self.win_bash = True - if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=str): - self.tool_requires("msys2/cci.latest") - if is_msvc(self): - self.tool_requires("automake/1.16.5") - else: - self.tool_requires("gtk-doc-stub/cci.20181216") - - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) - - def _create_toolchain(self, namespace, directory): - def is_enabled(value): - return "yes" if value else "no" - - def dep_path(dependency): - return unix_path(self, self.deps_cpp_info[dependency].rootpath) - - tc = AutotoolsToolchain(self, namespace=namespace) - tc.configure_args += [ - f"--datarootdir={unix_path(self, os.path.join(self.package_folder, 'res'))}", - f"--enable-ft={is_enabled(self.options.get_safe('with_freetype', True))}", - f"--enable-gobject={is_enabled(self.options.get_safe('with_glib', True))}", - f"--enable-fc={is_enabled(self.options.get_safe('with_fontconfig'))}", - f"--enable-xlib={is_enabled(self.options.get_safe('with_xlib'))}", - f"--enable-xlib_xrender={is_enabled(self.options.get_safe('with_xlib_xrender'))}", - f"--enable-xcb={is_enabled(self.options.get_safe('xcb'))}", - "--disable-gtk-doc" - ] - if is_msvc(self): - tc.make_args += [ - "--directory", directory, - "-f", "Makefile.win32", - f"CFG={str(self.settings.build_type).lower()}", - "CAIRO_HAS_FC_FONT=0", - f"ZLIB_PATH={dep_path('zlib')}", - f"LIBPNG_PATH={dep_path('libpng')}", - f"PIXMAN_PATH={dep_path('pixman')}", - f"FREETYPE_PATH={dep_path('freetype')}", - f"GOBJECT_PATH={dep_path('glib')}" - ] - tc.extra_cflags += ["-FS"] - - if self.settings.compiler in ["gcc", "clang", "apple-clang"]: - tc.extra_cflags.append("-Wno-enum-conversion") - - return tc - - def generate(self): - VirtualBuildEnv(self).generate() - - if not cross_building(self): - VirtualRunEnv(self).generate(scope="build") - - tc_main = self._create_toolchain("main", unix_path(self, self.source_folder)) - tc_main.generate() - - if is_msvc(self): - tc_gobject = self._create_toolchain("gobject", unix_path(self, os.path.join(self.source_folder, "util", "cairo-gobject"))) - tc_gobject.generate() - - PkgConfigDeps(self).generate() - deps = AutotoolsDeps(self) - if is_msvc(self): - cppflags = deps.vars().get("CPPFLAGS") - deps.environment.append('CFLAGS', cppflags.replace("/I", "-I")) - ldflags = deps.vars().get("LDFLAGS") - deps.environment.define('LDFLAGS', ldflags.replace("/LIBPATH:", "-LIBPATH:")) - deps.environment.append('LDFLAGS', deps.vars().get("LIBS")) - - deps.generate() - - def _patch_sources(self): - apply_conandata_patches(self) - - def fix_freetype_version(): - replace_in_file( - self, - os.path.join(self.source_folder, "configure.ac"), - "FREETYPE_MIN_VERSION=9.7.3", - f"FREETYPE_MIN_VERSION={Version(self.dependencies['freetype'].ref.version)}" - ) - - def exclude_tests_and_docs_from_build(): - makefile_am = os.path.join(self.source_folder, "Makefile.am") - replace_in_file(self, makefile_am, "SUBDIRS += boilerplate test perf", "") - replace_in_file(self, makefile_am, "SUBDIRS = src doc util", "SUBDIRS = src util") - - fix_freetype_version() - exclude_tests_and_docs_from_build() - - if self.options.get_safe("with_freetype"): - replace_in_file(self, os.path.join(self.source_folder, "src", "cairo-ft-font.c"), - "#if HAVE_UNISTD_H", "#ifdef HAVE_UNISTD_H") - - if is_msvc(self): - # https://cairographics.org/end_to_end_build_for_win32/ - win32_common = os.path.join(self.source_folder, "build", "Makefile.win32.common") - replace_in_file(self, win32_common, "-MD ", f"-{self.settings.compiler.runtime} ") - replace_in_file(self, win32_common, "-MDd ", f"-{self.settings.compiler.runtime} ") - replace_in_file(self, win32_common, "$(PIXMAN_PATH)/lib/pixman-1.lib", - self.deps_cpp_info["pixman"].libs[0] + ".lib") - replace_in_file(self, win32_common, "$(FREETYPE_PATH)/lib/freetype.lib", - self.deps_cpp_info["freetype"].libs[0] + ".lib") - replace_in_file(self, win32_common, "$(ZLIB_PATH)/lib/zlib1.lib", - self.deps_cpp_info["zlib"].libs[0] + ".lib") - replace_in_file(self, win32_common, "$(LIBPNG_PATH)/lib/libpng16.lib", - self.deps_cpp_info["libpng"].libs[0] + ".lib") - - def build(self): - self._patch_sources() - autotools = Autotools(self, namespace="main") - if is_msvc(self): - autotools.make() - autotools_gobject = Autotools(self, namespace="gobject") - autotools_gobject.make() - else: - autotools.autoreconf() - autotools.configure() - autotools.make() - - def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - if is_msvc(self): - src = os.path.join(self.source_folder, "src") - inc = os.path.join(self.package_folder, "include", "cairo") - copy(self, "cairo-version.h", (src if Version(self.version) >= "1.17.4" else self.source_folder), inc) - copy(self, "cairo-features.h", src, inc) - copy(self, "cairo.h", src, inc) - copy(self, "cairo-deprecated.h", src, inc) - copy(self, "cairo-win32.h", src, inc) - copy(self, "cairo-script.h", src, inc) - copy(self, "cairo-ft.h", src, inc) - copy(self, "cairo-ps.h", src, inc) - copy(self, "cairo-pdf.h", src, inc) - copy(self, "cairo-svg.h", src, inc) - copy(self, "cairo-gobject.h", inc, os.path.join(self.source_folder, "util", "cairo-gobject")) - - config = str(self.settings.build_type).lower() - lib_src_path = os.path.join(self.source_folder, "src", config) - cairo_gobject_src_path = os.path.join(self.source_folder, "util", "cairo-gobject", config) - lib_dest_path = os.path.join(self.package_folder, "lib") - runtime_dest_path = os.path.join(self.package_folder, "bin") - - if self.options.shared: - copy(self, "*cairo.lib", lib_src_path, lib_dest_path) - copy(self, "*cairo.dll", lib_src_path, runtime_dest_path) - copy(self, "*cairo-gobject.lib", cairo_gobject_src_path, lib_dest_path) - copy(self, "*cairo-gobject.dll", cairo_gobject_src_path, runtime_dest_path) - else: - copy(self, "cairo-static.lib", lib_src_path, lib_dest_path) - copy(self, "cairo-gobject.lib", cairo_gobject_src_path, lib_dest_path) - rename(self, os.path.join(lib_dest_path, "cairo-static.lib"), os.path.join(lib_dest_path, "cairo.lib")) - else: - autotools = Autotools(self, namespace="main") - autotools.install() - - copy(self, "COPYING*", self.source_folder, os.path.join(self.package_folder, "licenses")) - rm(self, "*.la", self.package_folder, recursive=True) - rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - fix_apple_shared_install_name(self) - - def package_info(self): - self.cpp_info.set_property("pkg_config_name", "cairo-all-do-no-use") - - self.cpp_info.components["cairo_"].set_property("pkg_config_name", "cairo") - self.cpp_info.components["cairo_"].libs = ["cairo"] - self.cpp_info.components["cairo_"].includedirs.insert(0, os.path.join("include", "cairo")) - self.cpp_info.components["cairo_"].requires = ["pixman::pixman", "libpng::libpng", "zlib::zlib"] - - if self.options.get_safe("with_freetype", True): - self.cpp_info.components["cairo_"].requires.append("freetype::freetype") - - if self.settings.os == "Windows": - self.cpp_info.components["cairo_"].system_libs.extend(["gdi32", "msimg32", "user32"]) - if not self.options.shared: - self.cpp_info.components["cairo_"].defines.append("CAIRO_WIN32_STATIC_BUILD=1") - else: - if self.options.with_glib: - self.cpp_info.components["cairo_"].requires.extend(["glib::gobject-2.0", "glib::glib-2.0"]) - if self.options.with_fontconfig: - self.cpp_info.components["cairo_"].requires.append("fontconfig::fontconfig") - - if self.settings.os == "Linux": - self.cpp_info.components["cairo_"].system_libs = ["pthread", "rt"] - self.cpp_info.components["cairo_"].cflags = ["-pthread"] - self.cpp_info.components["cairo_"].cxxflags = ["-pthread"] - if self.options.with_xcb: - self.cpp_info.components["cairo_"].requires.extend(["xorg::xcb-shm", "xorg::xcb"]) - if self.options.with_xlib_xrender: - self.cpp_info.components["cairo_"].requires.extend(["xorg::xcb-render"]) - if self.options.with_xlib: - self.cpp_info.components["cairo_"].requires.extend(["xorg::x11", "xorg::xext"]) - - if is_apple_os(self): - self.cpp_info.components["cairo_"].frameworks.append("CoreGraphics") - - if self.settings.os == "Windows": - self.cpp_info.components["cairo-win32"].set_property("pkg_config_name", "cairo-win32") - self.cpp_info.components["cairo-win32"].requires = ["cairo_", "pixman::pixman", "libpng::libpng"] - - if self.options.get_safe("with_glib", True): - self.cpp_info.components["cairo-gobject"].set_property("pkg_config_name", "cairo-gobject") - self.cpp_info.components["cairo-gobject"].libs = ["cairo-gobject"] - self.cpp_info.components["cairo-gobject"].requires = ["cairo_", "glib::gobject-2.0", "glib::glib-2.0"] - if self.settings.os != "Windows": - if self.options.with_fontconfig: - self.cpp_info.components["cairo-fc"].set_property("pkg_config_name", "cairo-fc") - self.cpp_info.components["cairo-fc"].requires = ["cairo_", "fontconfig::fontconfig"] - if self.options.get_safe("with_freetype", True): - self.cpp_info.components["cairo-ft"].set_property("pkg_config_name", "cairo-ft") - self.cpp_info.components["cairo-ft"].requires = ["cairo_", "freetype::freetype"] - - self.cpp_info.components["cairo-pdf"].set_property("pkg_config_name", "cairo-pdf") - self.cpp_info.components["cairo-pdf"].requires = ["cairo_", "zlib::zlib"] - - if self.settings.os == "Linux": - if self.options.with_xlib: - self.cpp_info.components["cairo-xlib"].set_property("pkg_config_name", "cairo-xlib") - self.cpp_info.components["cairo-xlib"].requires = ["cairo_", "xorg::x11", "xorg::xext"] - - if is_apple_os(self): - self.cpp_info.components["cairo-quartz"].set_property("pkg_config_name", "cairo-quartz") - self.cpp_info.components["cairo-quartz"].requires = ["cairo_"] - self.cpp_info.components["cairo-quartz"].frameworks.extend(["CoreFoundation", "CoreGraphics", "ApplicationServices"]) - - self.cpp_info.components["cairo-quartz-font"].set_property("pkg_config_name", "cairo-quartz-font") - self.cpp_info.components["cairo-quartz-font"].requires = ["cairo_"] diff --git a/recipes/cairo/all/patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch b/recipes/cairo/all/patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch deleted file mode 100644 index 1554d7bb38ba6e..00000000000000 --- a/recipes/cairo/all/patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 2801a57b7dae8060f4b4c2dede65cf4ce79da62b Mon Sep 17 00:00:00 2001 -From: Ignacio Casal Quinteiro -Date: Tue, 28 Feb 2017 11:10:37 +0100 -Subject: [PATCH] msvc: update build scripts to compile with more features - -This also adds support to build cairo-gobject ---- - build/Makefile.win32.common | 52 +++++++++++++++++++++++++++++++-------- - build/Makefile.win32.features | 13 +++++----- - util/cairo-gobject/Makefile.win32 | 24 ++++++++++++++++++ - 3 files changed, 73 insertions(+), 16 deletions(-) - create mode 100644 util/cairo-gobject/Makefile.win32 - -diff --git a/build/Makefile.win32.common b/build/Makefile.win32.common -index 7d7e973..38063a7 100644 ---- a/build/Makefile.win32.common -+++ b/build/Makefile.win32.common -@@ -23,34 +23,66 @@ CFG_CFLAGS := -MD -O2 - CFG_LDFLAGS := - endif - -+ifeq ($(ARCH),) -+ARCH=Win32 -+endif -+ -+ifeq ($(INSTALL_DIR),) -+INSTALL_DIR=$(top_srcdir)/../../../../gtk/$(ARCH)/$(CFG) -+endif -+ - ifeq ($(PIXMAN_PATH),) --PIXMAN_PATH := $(top_builddir)/../pixman -+PIXMAN_PATH := $(INSTALL_DIR) - endif --PIXMAN_CFLAGS := -I$(PIXMAN_PATH)/pixman/ --PIXMAN_LIBS := $(PIXMAN_PATH)/pixman/$(CFG)/pixman-1.lib -+PIXMAN_CFLAGS := -I$(PIXMAN_PATH)/include/pixman-1 -+PIXMAN_LIBS := $(PIXMAN_PATH)/lib/pixman-1.lib - - CAIRO_LIBS = gdi32.lib msimg32.lib user32.lib - - ifeq ($(CAIRO_HAS_PNG_FUNCTIONS),1) - ifeq ($(LIBPNG_PATH),) --LIBPNG_PATH := $(top_builddir)/../libpng -+LIBPNG_PATH := $(INSTALL_DIR) - endif --LIBPNG_CFLAGS += -I$(LIBPNG_PATH)/ --CAIRO_LIBS += $(LIBPNG_PATH)/libpng.lib -+LIBPNG_CFLAGS += -I$(LIBPNG_PATH)/include -+CAIRO_LIBS += $(LIBPNG_PATH)/lib/libpng16.lib - endif - - ifeq ($(CAIRO_HAS_PS_SURFACE)$(CAIRO_HAS_PDF_SURFACE),00) - else - ifeq ($(ZLIB_PATH),) --ZLIB_PATH := $(top_builddir)/../zlib -+ZLIB_PATH := $(INSTALL_DIR) -+endif -+ZLIB_CFLAGS += -I$(ZLIB_PATH)/include -+CAIRO_LIBS += $(ZLIB_PATH)/lib/zlib1.lib -+endif -+ -+ifeq ($(CAIRO_HAS_FT_FONT),1) -+ifeq ($(FREETYPE_PATH),) -+FREETYPE_PATH := $(INSTALL_DIR) -+endif -+FREETYPE_CFLAGS += -I$(FREETYPE_PATH)/include -+CAIRO_LIBS += $(FREETYPE_PATH)/lib/freetype.lib -+endif -+ -+ifeq ($(CAIRO_HAS_FC_FONT),1) -+ifeq ($(FONTCONFIG_PATH),) -+FONTCONFIG_PATH := $(INSTALL_DIR) -+endif -+FONTCONFIG_CFLAGS += -I$(FONTCONFIG_PATH)/include -+CAIRO_LIBS += $(FONTCONFIG_PATH)/lib/fontconfig.lib -+endif -+ -+ifeq ($(CAIRO_HAS_GOBJECT_FUNCTIONS),1) -+ifeq ($(GOBJECT_PATH),) -+GOBJECT_PATH := $(INSTALL_DIR) - endif --ZLIB_CFLAGS += -I$(ZLIB_PATH)/ --CAIRO_LIBS += $(ZLIB_PATH)/zdll.lib -+GOBJECT_CFLAGS := -I$(GOBJECT_PATH)/include/glib-2.0 -I$(GOBJECT_PATH)/lib/glib-2.0/include -+GOBJECT_LIBS := $(GOBJECT_PATH)/lib/glib-2.0.lib $(GOBJECT_PATH)/lib/gobject-2.0.lib - endif - - DEFAULT_CFLAGS = -nologo $(CFG_CFLAGS) - DEFAULT_CFLAGS += -I. -I$(top_srcdir) -I$(top_srcdir)/src --DEFAULT_CFLAGS += $(PIXMAN_CFLAGS) $(LIBPNG_CFLAGS) $(ZLIB_CFLAGS) -+DEFAULT_CFLAGS += $(PIXMAN_CFLAGS) $(LIBPNG_CFLAGS) $(ZLIB_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) - - CAIRO_CFLAGS = $(DEFAULT_CFLAGS) $(CFLAGS) - -diff --git a/build/Makefile.win32.features b/build/Makefile.win32.features -index 8cb155d..db3f0ac 100644 ---- a/build/Makefile.win32.features -+++ b/build/Makefile.win32.features -@@ -26,16 +26,17 @@ CAIRO_HAS_EGL_FUNCTIONS=0 - CAIRO_HAS_GLX_FUNCTIONS=0 - CAIRO_HAS_WGL_FUNCTIONS=0 - CAIRO_HAS_SCRIPT_SURFACE=1 --CAIRO_HAS_FT_FONT=0 --CAIRO_HAS_FC_FONT=0 -+CAIRO_HAS_FT_FONT=1 -+CAIRO_HAS_FC_FONT=1 - CAIRO_HAS_PS_SURFACE=1 - CAIRO_HAS_PDF_SURFACE=1 - CAIRO_HAS_SVG_SURFACE=1 - CAIRO_HAS_TEST_SURFACES=0 --CAIRO_HAS_TEE_SURFACE=0 --CAIRO_HAS_XML_SURFACE=0 -+CAIRO_HAS_TEE_SURFACE=1 -+CAIRO_HAS_XML_SURFACE=1 - CAIRO_HAS_PTHREAD=0 --CAIRO_HAS_GOBJECT_FUNCTIONS=0 --CAIRO_HAS_TRACE=0 -+CAIRO_HAS_GOBJECT_FUNCTIONS=1 -+CAIRO_HAS_TRACE=1 - CAIRO_HAS_INTERPRETER=1 - CAIRO_HAS_SYMBOL_LOOKUP=0 -+CAIRO_HAS_IMAGE_SURFACE=1 -diff --git a/util/cairo-gobject/Makefile.win32 b/util/cairo-gobject/Makefile.win32 -new file mode 100644 -index 0000000..1f63511 ---- /dev/null -+++ b/util/cairo-gobject/Makefile.win32 -@@ -0,0 +1,24 @@ -+top_srcdir = ../.. -+include $(top_srcdir)/build/Makefile.win32.common -+ -+CAIRO_LIB = $(top_srcdir)/src/$(CFG)/cairo.lib -+SOURCES = \ -+ cairo-gobject-enums.c \ -+ cairo-gobject-structs.c -+ -+OBJECTS = $(patsubst %.c, $(CFG)/%.obj, $(SOURCES)) -+ -+dynamic: inform $(CFG)/cairo-gobject.dll -+ -+$(CFG)/%.obj: %.c $(top_srcdir)/src/cairo-features.h -+ @mkdir -p $(CFG)/`dirname $<` -+ @$(CC) $(CAIRO_CFLAGS) $(GOBJECT_CFLAGS) -c -Fo"$@" $< -+ -+$(CFG)/cairo-gobject.dll: $(OBJECTS) -+ @$(LD) $(CAIRO_LDFLAGS) $(GOBJECT_LDFLAGS) -DLL -OUT:$@ $(CAIRO_LIB) $(GOBJECT_LIBS) $(OBJECTS) -+ -+all: inform $(CFG)/cairo-gobject.dll -+ @echo "Built successfully!" -+ @echo "You should copy the following files to a proper place now:" -+ @echo "" -+ @echo " util/cairo-gobject/$(CFG)/cairo-gobject.dll" --- -2.9.3 - diff --git a/recipes/cairo/all/patches/binutils-2.34-libbfd-fix.patch b/recipes/cairo/all/patches/binutils-2.34-libbfd-fix.patch deleted file mode 100644 index 197f3fbc3cad00..00000000000000 --- a/recipes/cairo/all/patches/binutils-2.34-libbfd-fix.patch +++ /dev/null @@ -1,43 +0,0 @@ -The libbfd issues were fixed in upstream with following commit: - - From e30259f6237571c61992433c110bc6e1ef900244 Mon Sep 17 00:00:00 2001 - From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= - Date: Tue, 23 Feb 2021 11:36:24 +0000 - Subject: cairo-trace: fix build with newer versions of bfd - - https://cgit.freedesktop.org/cairo/commit/?id=e30259f6237571c61992433c110bc6e1ef900244 - -Note that the upstream commit was more comprehensive, but cannot be directly -applied to 1.17.4 version. Any new cairo version beyond 1.17.4 will likely -not need this fix. - ---- lookup-symbol.c.original 2021-08-05 22:21:15.819998378 +0300 -+++ lookup-symbol.c 2021-08-05 22:26:05.212448342 +0300 -@@ -145,14 +145,26 @@ - if (symbol->found) - return; - -+#ifdef bfd_get_section_flags - if ((bfd_get_section_flags (symtab->bfd, section) & SEC_ALLOC) == 0) -+#else -+ if ((bfd_section_flags (section) & SEC_ALLOC) == 0) -+#endif - return; - -+#ifdef bfd_get_section_vma - vma = bfd_get_section_vma (symtab->bfd, section); -+#else -+ vma = bfd_section_vma (section); -+#endif - if (symbol->pc < vma) - return; - -- size = bfd_section_size (symtab->bfd, section); -+#ifdef bfd_get_section_size -+ size = bfd_get_section_size (section); -+#else -+ size = bfd_section_size (section); -+#endif - if (symbol->pc >= vma + size) - return; - diff --git a/recipes/cairo/all/test_package/CMakeLists.txt b/recipes/cairo/all/test_package/CMakeLists.txt deleted file mode 100644 index 4f33d55898eb29..00000000000000 --- a/recipes/cairo/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(test_package C) - -find_package(cairo CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE cairo::cairo) diff --git a/recipes/cairo/all/test_package/test_package.c b/recipes/cairo/all/test_package/test_package.c deleted file mode 100644 index 5854291cea1778..00000000000000 --- a/recipes/cairo/all/test_package/test_package.c +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include - -#if defined(WIN32) && CAIRO_HAS_WIN32_SURFACE && CAIRO_HAS_WIN32_FONT - -#include -#include - -#endif - -int main() -{ -#if defined(WIN32) && CAIRO_HAS_WIN32_SURFACE && CAIRO_HAS_WIN32_FONT - - HDC hDC = GetDC(0); - if (hDC) - { - cairo_surface_t * surface = cairo_win32_surface_create(hDC); - if (surface) - { - HFONT hFont = (HFONT)GetStockObject(SYSTEM_FONT); - cairo_font_face_t* font = cairo_win32_font_face_create_for_hfont(hFont); - if (font) - cairo_font_face_destroy(font); - - cairo_surface_destroy(surface); - } - ReleaseDC(0, hDC); - } -#endif - - printf("cairo version is %s\n", cairo_version_string()); - - return 0; -} diff --git a/recipes/cairo/config.yml b/recipes/cairo/config.yml index 8e74221deaa9fb..63606cbea47b1c 100644 --- a/recipes/cairo/config.yml +++ b/recipes/cairo/config.yml @@ -7,7 +7,3 @@ versions: folder: meson "1.17.4": folder: meson - "1.17.2": - folder: all - "1.16.0": - folder: all diff --git a/recipes/cairo/meson/conanfile.py b/recipes/cairo/meson/conanfile.py index 9cddead167dbc2..9b42f6bc4a8e0f 100644 --- a/recipes/cairo/meson/conanfile.py +++ b/recipes/cairo/meson/conanfile.py @@ -86,9 +86,9 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("pixman/0.42.2") + self.requires("pixman/0.43.4") if self.options.with_zlib and self.options.with_png: - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_lzo: self.requires("lzo/2.10") if self.options.with_zlib: @@ -96,11 +96,11 @@ def requirements(self): if self.options.with_freetype: self.requires("freetype/2.13.2", transitive_headers=True, transitive_libs=True) if self.options.with_fontconfig: - self.requires("fontconfig/2.14.2", transitive_headers=True, transitive_libs=True) + self.requires("fontconfig/2.15.0", transitive_headers=True, transitive_libs=True) if self.options.with_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_glib: - self.requires("glib/2.78.1") + self.requires("glib/2.78.3") if self.settings.os in ["Linux", "FreeBSD"]: if self.options.with_xlib or self.options.with_xlib_xrender or self.options.with_xcb: self.requires("xorg/system", transitive_headers=True, transitive_libs=True) @@ -128,9 +128,9 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.3.0") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/capnproto/all/test_package/CMakeLists.txt b/recipes/capnproto/all/test_package/CMakeLists.txt index 8ffc65e9ffa4be..5e0d93f57dde5b 100644 --- a/recipes/capnproto/all/test_package/CMakeLists.txt +++ b/recipes/capnproto/all/test_package/CMakeLists.txt @@ -3,19 +3,9 @@ project(test_package LANGUAGES CXX) find_package(CapnProto REQUIRED capnp capnp-rpc CONFIG) -capnp_generate_cpp(addressbookSources addressbookHeaders addressbook.capnp) -add_executable(addressbook addressbook.c++ ${addressbookSources}) + +add_executable(addressbook test_package.c++ ${addressbookSources}) target_include_directories(addressbook PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(addressbook PRIVATE CapnProto::capnp) target_compile_features(addressbook PRIVATE cxx_std_14) -capnp_generate_cpp(calculatorSources calculatorHeaders calculator.capnp) -add_library(calculator_protocol STATIC ${calculatorSources}) -target_include_directories(calculator_protocol PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(calculator_protocol PUBLIC CapnProto::capnp-rpc) -target_compile_features(calculator_protocol PUBLIC cxx_std_14) - -add_executable(calculator-client calculator-client.c++) -target_link_libraries(calculator-client PRIVATE calculator_protocol) -add_executable(calculator-server calculator-server.c++) -target_link_libraries(calculator-server PRIVATE calculator_protocol) diff --git a/recipes/capnproto/all/test_package/addressbook.c++ b/recipes/capnproto/all/test_package/addressbook.c++ deleted file mode 100644 index b2bece9472b88f..00000000000000 --- a/recipes/capnproto/all/test_package/addressbook.c++ +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -// Licensed under the MIT License: -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// This sample code appears in the documentation for the C++ implementation. -// -// If Cap'n Proto is installed, build the sample like: -// capnp compile -oc++ addressbook.capnp -// c++ -std=c++14 -Wall addressbook.c++ addressbook.capnp.c++ `pkg-config --cflags --libs capnp` -o addressbook -// -// If Cap'n Proto is not installed, but the source is located at $SRC and has been -// compiled in $BUILD (often both are simply ".." from here), you can do: -// $BUILD/capnp compile -I$SRC/src -o$BUILD/capnpc-c++ addressbook.capnp -// c++ -std=c++14 -Wall addressbook.c++ addressbook.capnp.c++ -I$SRC/src -L$BUILD/.libs -lcapnp -lkj -o addressbook -// -// Run like: -// ./addressbook write | ./addressbook read -// Use "dwrite" and "dread" to use dynamic code instead. - -// TODO(test): Needs cleanup. - -#include "addressbook.capnp.h" -#include -#include -#include - -using addressbook::Person; -using addressbook::AddressBook; - -void writeAddressBook(int fd) { - ::capnp::MallocMessageBuilder message; - - AddressBook::Builder addressBook = message.initRoot(); - ::capnp::List::Builder people = addressBook.initPeople(2); - - Person::Builder alice = people[0]; - alice.setId(123); - alice.setName("Alice"); - alice.setEmail("alice@example.com"); - // Type shown for explanation purposes; normally you'd use auto. - ::capnp::List::Builder alicePhones = - alice.initPhones(1); - alicePhones[0].setNumber("555-1212"); - alicePhones[0].setType(Person::PhoneNumber::Type::MOBILE); - alice.getEmployment().setSchool("MIT"); - - Person::Builder bob = people[1]; - bob.setId(456); - bob.setName("Bob"); - bob.setEmail("bob@example.com"); - auto bobPhones = bob.initPhones(2); - bobPhones[0].setNumber("555-4567"); - bobPhones[0].setType(Person::PhoneNumber::Type::HOME); - bobPhones[1].setNumber("555-7654"); - bobPhones[1].setType(Person::PhoneNumber::Type::WORK); - bob.getEmployment().setUnemployed(); - - writePackedMessageToFd(fd, message); -} - -void printAddressBook(int fd) { - ::capnp::PackedFdMessageReader message(fd); - - AddressBook::Reader addressBook = message.getRoot(); - - for (Person::Reader person : addressBook.getPeople()) { - std::cout << person.getName().cStr() << ": " - << person.getEmail().cStr() << std::endl; - for (Person::PhoneNumber::Reader phone: person.getPhones()) { - const char* typeName = "UNKNOWN"; - switch (phone.getType()) { - case Person::PhoneNumber::Type::MOBILE: typeName = "mobile"; break; - case Person::PhoneNumber::Type::HOME: typeName = "home"; break; - case Person::PhoneNumber::Type::WORK: typeName = "work"; break; - } - std::cout << " " << typeName << " phone: " - << phone.getNumber().cStr() << std::endl; - } - Person::Employment::Reader employment = person.getEmployment(); - switch (employment.which()) { - case Person::Employment::UNEMPLOYED: - std::cout << " unemployed" << std::endl; - break; - case Person::Employment::EMPLOYER: - std::cout << " employer: " - << employment.getEmployer().cStr() << std::endl; - break; - case Person::Employment::SCHOOL: - std::cout << " student at: " - << employment.getSchool().cStr() << std::endl; - break; - case Person::Employment::SELF_EMPLOYED: - std::cout << " self-employed" << std::endl; - break; - } - } -} - -#if !CAPNP_LITE - -#include "addressbook.capnp.h" -#include -#include -#include -#include -#include - -using ::capnp::DynamicValue; -using ::capnp::DynamicStruct; -using ::capnp::DynamicEnum; -using ::capnp::DynamicList; -using ::capnp::List; -using ::capnp::Schema; -using ::capnp::StructSchema; -using ::capnp::EnumSchema; - -using ::capnp::Void; -using ::capnp::Text; -using ::capnp::MallocMessageBuilder; -using ::capnp::PackedFdMessageReader; - -void dynamicWriteAddressBook(int fd, StructSchema schema) { - // Write a message using the dynamic API to set each - // field by text name. This isn't something you'd - // normally want to do; it's just for illustration. - - MallocMessageBuilder message; - - // Types shown for explanation purposes; normally you'd - // use auto. - DynamicStruct::Builder addressBook = - message.initRoot(schema); - - DynamicList::Builder people = - addressBook.init("people", 2).as(); - - DynamicStruct::Builder alice = - people[0].as(); - alice.set("id", 123); - alice.set("name", "Alice"); - alice.set("email", "alice@example.com"); - auto alicePhones = alice.init("phones", 1).as(); - auto phone0 = alicePhones[0].as(); - phone0.set("number", "555-1212"); - phone0.set("type", "mobile"); - alice.get("employment").as() - .set("school", "MIT"); - - auto bob = people[1].as(); - bob.set("id", 456); - bob.set("name", "Bob"); - bob.set("email", "bob@example.com"); - - // Some magic: We can convert a dynamic sub-value back to - // the native type with as()! - List::Builder bobPhones = - bob.init("phones", 2).as>(); - bobPhones[0].setNumber("555-4567"); - bobPhones[0].setType(Person::PhoneNumber::Type::HOME); - bobPhones[1].setNumber("555-7654"); - bobPhones[1].setType(Person::PhoneNumber::Type::WORK); - bob.get("employment").as() - .set("unemployed", ::capnp::VOID); - - writePackedMessageToFd(fd, message); -} - -void dynamicPrintValue(DynamicValue::Reader value) { - // Print an arbitrary message via the dynamic API by - // iterating over the schema. Look at the handling - // of STRUCT in particular. - - switch (value.getType()) { - case DynamicValue::VOID: - std::cout << ""; - break; - case DynamicValue::BOOL: - std::cout << (value.as() ? "true" : "false"); - break; - case DynamicValue::INT: - std::cout << value.as(); - break; - case DynamicValue::UINT: - std::cout << value.as(); - break; - case DynamicValue::FLOAT: - std::cout << value.as(); - break; - case DynamicValue::TEXT: - std::cout << '\"' << value.as().cStr() << '\"'; - break; - case DynamicValue::LIST: { - std::cout << "["; - bool first = true; - for (auto element: value.as()) { - if (first) { - first = false; - } else { - std::cout << ", "; - } - dynamicPrintValue(element); - } - std::cout << "]"; - break; - } - case DynamicValue::ENUM: { - auto enumValue = value.as(); - KJ_IF_MAYBE(enumerant, enumValue.getEnumerant()) { - std::cout << - enumerant->getProto().getName().cStr(); - } else { - // Unknown enum value; output raw number. - std::cout << enumValue.getRaw(); - } - break; - } - case DynamicValue::STRUCT: { - std::cout << "("; - auto structValue = value.as(); - bool first = true; - for (auto field: structValue.getSchema().getFields()) { - if (!structValue.has(field)) continue; - if (first) { - first = false; - } else { - std::cout << ", "; - } - std::cout << field.getProto().getName().cStr() - << " = "; - dynamicPrintValue(structValue.get(field)); - } - std::cout << ")"; - break; - } - default: - // There are other types, we aren't handling them. - std::cout << "?"; - break; - } -} - -void dynamicPrintMessage(int fd, StructSchema schema) { - PackedFdMessageReader message(fd); - dynamicPrintValue(message.getRoot(schema)); - std::cout << std::endl; -} - -#endif // !CAPNP_LITE - -int main(int argc, char* argv[]) { - if (argc != 2) { - std::cerr << "Missing arg." << std::endl; - return 1; - } else if (strcmp(argv[1], "write") == 0) { - writeAddressBook(1); - } else if (strcmp(argv[1], "read") == 0) { - printAddressBook(0); -#if !CAPNP_LITE - } else if (strcmp(argv[1], "dwrite") == 0) { - StructSchema schema = Schema::from(); - dynamicWriteAddressBook(1, schema); - } else if (strcmp(argv[1], "dread") == 0) { - StructSchema schema = Schema::from(); - dynamicPrintMessage(0, schema); -#endif - } else { - std::cerr << "Invalid arg: " << argv[1] << std::endl; - return 1; - } - return 0; -} diff --git a/recipes/capnproto/all/test_package/addressbook.capnp b/recipes/capnproto/all/test_package/addressbook.capnp deleted file mode 100644 index 1a6c60937e8af3..00000000000000 --- a/recipes/capnproto/all/test_package/addressbook.capnp +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -# Licensed under the MIT License: -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -@0x9eb32e19f86ee174; - -using Cxx = import "/capnp/c++.capnp"; -$Cxx.namespace("addressbook"); - -struct Person { - id @0 :UInt32; - name @1 :Text; - email @2 :Text; - phones @3 :List(PhoneNumber); - - struct PhoneNumber { - number @0 :Text; - type @1 :Type; - - enum Type { - mobile @0; - home @1; - work @2; - } - } - - employment :union { - unemployed @4 :Void; - employer @5 :Text; - school @6 :Text; - selfEmployed @7 :Void; - # We assume that a person is only one of these. - } -} - -struct AddressBook { - people @0 :List(Person); -} diff --git a/recipes/capnproto/all/test_package/calculator-client.c++ b/recipes/capnproto/all/test_package/calculator-client.c++ deleted file mode 100644 index 5d8452921cde97..00000000000000 --- a/recipes/capnproto/all/test_package/calculator-client.c++ +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -// Licensed under the MIT License: -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#include "calculator.capnp.h" -#include -#include -#include -#include - -class PowerFunction final: public Calculator::Function::Server { - // An implementation of the Function interface wrapping pow(). Note that - // we're implementing this on the client side and will pass a reference to - // the server. The server will then be able to make calls back to the client. - -public: - kj::Promise call(CallContext context) { - auto params = context.getParams().getParams(); - KJ_REQUIRE(params.size() == 2, "Wrong number of parameters."); - context.getResults().setValue(pow(params[0], params[1])); - return kj::READY_NOW; - } -}; - -int main(int argc, const char* argv[]) { - if (argc != 2) { - std::cerr << "usage: " << argv[0] << " HOST:PORT\n" - "Connects to the Calculator server at the given address and " - "does some RPCs." << std::endl; - return 1; - } - - capnp::EzRpcClient client(argv[1]); - Calculator::Client calculator = client.getMain(); - - // Keep an eye on `waitScope`. Whenever you see it used is a place where we - // stop and wait for the server to respond. If a line of code does not use - // `waitScope`, then it does not block! - auto& waitScope = client.getWaitScope(); - - { - // Make a request that just evaluates the literal value 123. - // - // What's interesting here is that evaluate() returns a "Value", which is - // another interface and therefore points back to an object living on the - // server. We then have to call read() on that object to read it. - // However, even though we are making two RPC's, this block executes in - // *one* network round trip because of promise pipelining: we do not wait - // for the first call to complete before we send the second call to the - // server. - - std::cout << "Evaluating a literal... "; - std::cout.flush(); - - // Set up the request. - auto request = calculator.evaluateRequest(); - request.getExpression().setLiteral(123); - - // Send it, which returns a promise for the result (without blocking). - auto evalPromise = request.send(); - - // Using the promise, create a pipelined request to call read() on the - // returned object, and then send that. - auto readPromise = evalPromise.getValue().readRequest().send(); - - // Now that we've sent all the requests, wait for the response. Until this - // point, we haven't waited at all! - auto response = readPromise.wait(waitScope); - KJ_ASSERT(response.getValue() == 123); - - std::cout << "PASS" << std::endl; - } - - { - // Make a request to evaluate 123 + 45 - 67. - // - // The Calculator interface requires that we first call getOperator() to - // get the addition and subtraction functions, then call evaluate() to use - // them. But, once again, we can get both functions, call evaluate(), and - // then read() the result -- four RPCs -- in the time of *one* network - // round trip, because of promise pipelining. - - std::cout << "Using add and subtract... "; - std::cout.flush(); - - Calculator::Function::Client add = nullptr; - Calculator::Function::Client subtract = nullptr; - - { - // Get the "add" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::ADD); - add = request.send().getFunc(); - } - - { - // Get the "subtract" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::SUBTRACT); - subtract = request.send().getFunc(); - } - - // Build the request to evaluate 123 + 45 - 67. - auto request = calculator.evaluateRequest(); - - auto subtractCall = request.getExpression().initCall(); - subtractCall.setFunction(subtract); - auto subtractParams = subtractCall.initParams(2); - subtractParams[1].setLiteral(67); - - auto addCall = subtractParams[0].initCall(); - addCall.setFunction(add); - auto addParams = addCall.initParams(2); - addParams[0].setLiteral(123); - addParams[1].setLiteral(45); - - // Send the evaluate() request, read() the result, and wait for read() to - // finish. - auto evalPromise = request.send(); - auto readPromise = evalPromise.getValue().readRequest().send(); - - auto response = readPromise.wait(waitScope); - KJ_ASSERT(response.getValue() == 101); - - std::cout << "PASS" << std::endl; - } - - { - // Make a request to evaluate 4 * 6, then use the result in two more - // requests that add 3 and 5. - // - // Since evaluate() returns its result wrapped in a `Value`, we can pass - // that `Value` back to the server in subsequent requests before the first - // `evaluate()` has actually returned. Thus, this example again does only - // one network round trip. - - std::cout << "Pipelining eval() calls... "; - std::cout.flush(); - - Calculator::Function::Client add = nullptr; - Calculator::Function::Client multiply = nullptr; - - { - // Get the "add" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::ADD); - add = request.send().getFunc(); - } - - { - // Get the "multiply" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::MULTIPLY); - multiply = request.send().getFunc(); - } - - // Build the request to evaluate 4 * 6 - auto request = calculator.evaluateRequest(); - - auto multiplyCall = request.getExpression().initCall(); - multiplyCall.setFunction(multiply); - auto multiplyParams = multiplyCall.initParams(2); - multiplyParams[0].setLiteral(4); - multiplyParams[1].setLiteral(6); - - auto multiplyResult = request.send().getValue(); - - // Use the result in two calls that add 3 and add 5. - - auto add3Request = calculator.evaluateRequest(); - auto add3Call = add3Request.getExpression().initCall(); - add3Call.setFunction(add); - auto add3Params = add3Call.initParams(2); - add3Params[0].setPreviousResult(multiplyResult); - add3Params[1].setLiteral(3); - auto add3Promise = add3Request.send().getValue().readRequest().send(); - - auto add5Request = calculator.evaluateRequest(); - auto add5Call = add5Request.getExpression().initCall(); - add5Call.setFunction(add); - auto add5Params = add5Call.initParams(2); - add5Params[0].setPreviousResult(multiplyResult); - add5Params[1].setLiteral(5); - auto add5Promise = add5Request.send().getValue().readRequest().send(); - - // Now wait for the results. - KJ_ASSERT(add3Promise.wait(waitScope).getValue() == 27); - KJ_ASSERT(add5Promise.wait(waitScope).getValue() == 29); - - std::cout << "PASS" << std::endl; - } - - { - // Our calculator interface supports defining functions. Here we use it - // to define two functions and then make calls to them as follows: - // - // f(x, y) = x * 100 + y - // g(x) = f(x, x + 1) * 2; - // f(12, 34) - // g(21) - // - // Once again, the whole thing takes only one network round trip. - - std::cout << "Defining functions... "; - std::cout.flush(); - - Calculator::Function::Client add = nullptr; - Calculator::Function::Client multiply = nullptr; - Calculator::Function::Client f = nullptr; - Calculator::Function::Client g = nullptr; - - { - // Get the "add" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::ADD); - add = request.send().getFunc(); - } - - { - // Get the "multiply" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::MULTIPLY); - multiply = request.send().getFunc(); - } - - { - // Define f. - auto request = calculator.defFunctionRequest(); - request.setParamCount(2); - - { - // Build the function body. - auto addCall = request.getBody().initCall(); - addCall.setFunction(add); - auto addParams = addCall.initParams(2); - addParams[1].setParameter(1); // y - - auto multiplyCall = addParams[0].initCall(); - multiplyCall.setFunction(multiply); - auto multiplyParams = multiplyCall.initParams(2); - multiplyParams[0].setParameter(0); // x - multiplyParams[1].setLiteral(100); - } - - f = request.send().getFunc(); - } - - { - // Define g. - auto request = calculator.defFunctionRequest(); - request.setParamCount(1); - - { - // Build the function body. - auto multiplyCall = request.getBody().initCall(); - multiplyCall.setFunction(multiply); - auto multiplyParams = multiplyCall.initParams(2); - multiplyParams[1].setLiteral(2); - - auto fCall = multiplyParams[0].initCall(); - fCall.setFunction(f); - auto fParams = fCall.initParams(2); - fParams[0].setParameter(0); - - auto addCall = fParams[1].initCall(); - addCall.setFunction(add); - auto addParams = addCall.initParams(2); - addParams[0].setParameter(0); - addParams[1].setLiteral(1); - } - - g = request.send().getFunc(); - } - - // OK, we've defined all our functions. Now create our eval requests. - - // f(12, 34) - auto fEvalRequest = calculator.evaluateRequest(); - auto fCall = fEvalRequest.initExpression().initCall(); - fCall.setFunction(f); - auto fParams = fCall.initParams(2); - fParams[0].setLiteral(12); - fParams[1].setLiteral(34); - auto fEvalPromise = fEvalRequest.send().getValue().readRequest().send(); - - // g(21) - auto gEvalRequest = calculator.evaluateRequest(); - auto gCall = gEvalRequest.initExpression().initCall(); - gCall.setFunction(g); - gCall.initParams(1)[0].setLiteral(21); - auto gEvalPromise = gEvalRequest.send().getValue().readRequest().send(); - - // Wait for the results. - KJ_ASSERT(fEvalPromise.wait(waitScope).getValue() == 1234); - KJ_ASSERT(gEvalPromise.wait(waitScope).getValue() == 4244); - - std::cout << "PASS" << std::endl; - } - - { - // Make a request that will call back to a function defined locally. - // - // Specifically, we will compute 2^(4 + 5). However, exponent is not - // defined by the Calculator server. So, we'll implement the Function - // interface locally and pass it to the server for it to use when - // evaluating the expression. - // - // This example requires two network round trips to complete, because the - // server calls back to the client once before finishing. In this - // particular case, this could potentially be optimized by using a tail - // call on the server side -- see CallContext::tailCall(). However, to - // keep the example simpler, we haven't implemented this optimization in - // the sample server. - - std::cout << "Using a callback... "; - std::cout.flush(); - - Calculator::Function::Client add = nullptr; - - { - // Get the "add" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::ADD); - add = request.send().getFunc(); - } - - // Build the eval request for 2^(4+5). - auto request = calculator.evaluateRequest(); - - auto powCall = request.getExpression().initCall(); - powCall.setFunction(kj::heap()); - auto powParams = powCall.initParams(2); - powParams[0].setLiteral(2); - - auto addCall = powParams[1].initCall(); - addCall.setFunction(add); - auto addParams = addCall.initParams(2); - addParams[0].setLiteral(4); - addParams[1].setLiteral(5); - - // Send the request and wait. - auto response = request.send().getValue().readRequest() - .send().wait(waitScope); - KJ_ASSERT(response.getValue() == 512); - - std::cout << "PASS" << std::endl; - } - - return 0; -} diff --git a/recipes/capnproto/all/test_package/calculator-server.c++ b/recipes/capnproto/all/test_package/calculator-server.c++ deleted file mode 100644 index c2593be3a9064b..00000000000000 --- a/recipes/capnproto/all/test_package/calculator-server.c++ +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -// Licensed under the MIT License: -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#include "calculator.capnp.h" -#include -#include -#include -#include - -typedef unsigned int uint; - -kj::Promise readValue(Calculator::Value::Client value) { - // Helper function to asynchronously call read() on a Calculator::Value and - // return a promise for the result. (In the future, the generated code might - // include something like this automatically.) - - return value.readRequest().send() - .then([](capnp::Response result) { - return result.getValue(); - }); -} - -kj::Promise evaluateImpl( - Calculator::Expression::Reader expression, - capnp::List::Reader params = capnp::List::Reader()) { - // Implementation of CalculatorImpl::evaluate(), also shared by - // FunctionImpl::call(). In the latter case, `params` are the parameter - // values passed to the function; in the former case, `params` is just an - // empty list. - - switch (expression.which()) { - case Calculator::Expression::LITERAL: - return expression.getLiteral(); - - case Calculator::Expression::PREVIOUS_RESULT: - return readValue(expression.getPreviousResult()); - - case Calculator::Expression::PARAMETER: { - KJ_REQUIRE(expression.getParameter() < params.size(), - "Parameter index out-of-range."); - return params[expression.getParameter()]; - } - - case Calculator::Expression::CALL: { - auto call = expression.getCall(); - auto func = call.getFunction(); - - // Evaluate each parameter. - kj::Array> paramPromises = - KJ_MAP(param, call.getParams()) { - return evaluateImpl(param, params); - }; - - // Join the array of promises into a promise for an array. - kj::Promise> joinedParams = - kj::joinPromises(kj::mv(paramPromises)); - - // When the parameters are complete, call the function. - return joinedParams.then([KJ_CPCAP(func)](kj::Array&& paramValues) mutable { - auto request = func.callRequest(); - request.setParams(paramValues); - return request.send().then( - [](capnp::Response&& result) { - return result.getValue(); - }); - }); - } - - default: - // Throw an exception. - KJ_FAIL_REQUIRE("Unknown expression type."); - } -} - -class ValueImpl final: public Calculator::Value::Server { - // Simple implementation of the Calculator.Value Cap'n Proto interface. - -public: - ValueImpl(double value): value(value) {} - - kj::Promise read(ReadContext context) { - context.getResults().setValue(value); - return kj::READY_NOW; - } - -private: - double value; -}; - -class FunctionImpl final: public Calculator::Function::Server { - // Implementation of the Calculator.Function Cap'n Proto interface, where the - // function is defined by a Calculator.Expression. - -public: - FunctionImpl(uint paramCount, Calculator::Expression::Reader body) - : paramCount(paramCount) { - this->body.setRoot(body); - } - - kj::Promise call(CallContext context) { - auto params = context.getParams().getParams(); - KJ_REQUIRE(params.size() == paramCount, "Wrong number of parameters."); - - return evaluateImpl(body.getRoot(), params) - .then([KJ_CPCAP(context)](double value) mutable { - context.getResults().setValue(value); - }); - } - -private: - uint paramCount; - // The function's arity. - - capnp::MallocMessageBuilder body; - // Stores a permanent copy of the function body. -}; - -class OperatorImpl final: public Calculator::Function::Server { - // Implementation of the Calculator.Function Cap'n Proto interface, wrapping - // basic binary arithmetic operators. - -public: - OperatorImpl(Calculator::Operator op): op(op) {} - - kj::Promise call(CallContext context) { - auto params = context.getParams().getParams(); - KJ_REQUIRE(params.size() == 2, "Wrong number of parameters."); - - double result; - switch (op) { - case Calculator::Operator::ADD: result = params[0] + params[1]; break; - case Calculator::Operator::SUBTRACT:result = params[0] - params[1]; break; - case Calculator::Operator::MULTIPLY:result = params[0] * params[1]; break; - case Calculator::Operator::DIVIDE: result = params[0] / params[1]; break; - default: - KJ_FAIL_REQUIRE("Unknown operator."); - } - - context.getResults().setValue(result); - return kj::READY_NOW; - } - -private: - Calculator::Operator op; -}; - -class CalculatorImpl final: public Calculator::Server { - // Implementation of the Calculator Cap'n Proto interface. - -public: - kj::Promise evaluate(EvaluateContext context) override { - return evaluateImpl(context.getParams().getExpression()) - .then([KJ_CPCAP(context)](double value) mutable { - context.getResults().setValue(kj::heap(value)); - }); - } - - kj::Promise defFunction(DefFunctionContext context) override { - auto params = context.getParams(); - context.getResults().setFunc(kj::heap( - params.getParamCount(), params.getBody())); - return kj::READY_NOW; - } - - kj::Promise getOperator(GetOperatorContext context) override { - context.getResults().setFunc(kj::heap( - context.getParams().getOp())); - return kj::READY_NOW; - } -}; - -int main(int argc, const char* argv[]) { - if (argc != 2) { - std::cerr << "usage: " << argv[0] << " ADDRESS[:PORT]\n" - "Runs the server bound to the given address/port.\n" - "ADDRESS may be '*' to bind to all local addresses.\n" - ":PORT may be omitted to choose a port automatically." << std::endl; - return 1; - } - - // Set up a server. - capnp::EzRpcServer server(kj::heap(), argv[1]); - - // Write the port number to stdout, in case it was chosen automatically. - auto& waitScope = server.getWaitScope(); - uint port = server.getPort().wait(waitScope); - if (port == 0) { - // The address format "unix:/path/to/socket" opens a unix domain socket, - // in which case the port will be zero. - std::cout << "Listening on Unix socket..." << std::endl; - } else { - std::cout << "Listening on port " << port << "..." << std::endl; - } - - // Run forever, accepting connections and handling requests. - kj::NEVER_DONE.wait(waitScope); -} diff --git a/recipes/capnproto/all/test_package/calculator.capnp b/recipes/capnproto/all/test_package/calculator.capnp deleted file mode 100644 index adc8294e57578e..00000000000000 --- a/recipes/capnproto/all/test_package/calculator.capnp +++ /dev/null @@ -1,118 +0,0 @@ -# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -# Licensed under the MIT License: -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -@0x85150b117366d14b; - -interface Calculator { - # A "simple" mathematical calculator, callable via RPC. - # - # But, to show off Cap'n Proto, we add some twists: - # - # - You can use the result from one call as the input to the next - # without a network round trip. To accomplish this, evaluate() - # returns a `Value` object wrapping the actual numeric value. - # This object may be used in a subsequent expression. With - # promise pipelining, the Value can actually be used before - # the evaluate() call that creates it returns! - # - # - You can define new functions, and then call them. This again - # shows off pipelining, but it also gives the client the - # opportunity to define a function on the client side and have - # the server call back to it. - # - # - The basic arithmetic operators are exposed as Functions, and - # you have to call getOperator() to obtain them from the server. - # This again demonstrates pipelining -- using getOperator() to - # get each operator and then using them in evaluate() still - # only takes one network round trip. - - evaluate @0 (expression :Expression) -> (value :Value); - # Evaluate the given expression and return the result. The - # result is returned wrapped in a Value interface so that you - # may pass it back to the server in a pipelined request. To - # actually get the numeric value, you must call read() on the - # Value -- but again, this can be pipelined so that it incurs - # no additional latency. - - struct Expression { - # A numeric expression. - - union { - literal @0 :Float64; - # A literal numeric value. - - previousResult @1 :Value; - # A value that was (or, will be) returned by a previous - # evaluate(). - - parameter @2 :UInt32; - # A parameter to the function (only valid in function bodies; - # see defFunction). - - call :group { - # Call a function on a list of parameters. - function @3 :Function; - params @4 :List(Expression); - } - } - } - - interface Value { - # Wraps a numeric value in an RPC object. This allows the value - # to be used in subsequent evaluate() requests without the client - # waiting for the evaluate() that returns the Value to finish. - - read @0 () -> (value :Float64); - # Read back the raw numeric value. - } - - defFunction @1 (paramCount :Int32, body :Expression) - -> (func :Function); - # Define a function that takes `paramCount` parameters and returns the - # evaluation of `body` after substituting these parameters. - - interface Function { - # An algebraic function. Can be called directly, or can be used inside - # an Expression. - # - # A client can create a Function that runs on the server side using - # `defFunction()` or `getOperator()`. Alternatively, a client can - # implement a Function on the client side and the server will call back - # to it. However, a function defined on the client side will require a - # network round trip whenever the server needs to call it, whereas - # functions defined on the server and then passed back to it are called - # locally. - - call @0 (params :List(Float64)) -> (value :Float64); - # Call the function on the given parameters. - } - - getOperator @2 (op :Operator) -> (func :Function); - # Get a Function representing an arithmetic operator, which can then be - # used in Expressions. - - enum Operator { - add @0; - subtract @1; - multiply @2; - divide @3; - } -} diff --git a/recipes/capnproto/all/test_package/conanfile.py b/recipes/capnproto/all/test_package/conanfile.py index d4d32590a51cc5..85b7dcba030f51 100644 --- a/recipes/capnproto/all/test_package/conanfile.py +++ b/recipes/capnproto/all/test_package/conanfile.py @@ -14,11 +14,7 @@ def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - if hasattr(self, "settings_build") and cross_building(self): - self.tool_requires(self.tested_reference_str) + self.requires(self.tested_reference_str, run=True) def generate(self): VirtualRunEnv(self).generate() @@ -34,5 +30,7 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "addressbook") - self.run(f"{bin_path} write", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "addressbook") + self.run(bin_path, env="conanrun") + + self.run("capnp id") diff --git a/recipes/capnproto/all/test_package/test_package.c++ b/recipes/capnproto/all/test_package/test_package.c++ new file mode 100644 index 00000000000000..8ed58079da0b02 --- /dev/null +++ b/recipes/capnproto/all/test_package/test_package.c++ @@ -0,0 +1,9 @@ +#include +#include + + +int main() { + capnp::MallocMessageBuilder message; + std::cout << sizeof(message) << std::endl; + return 0; +} diff --git a/recipes/capnproto/all/test_v1_package/CMakeLists.txt b/recipes/capnproto/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68b..00000000000000 --- a/recipes/capnproto/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/recipes/capnproto/all/test_v1_package/conanfile.py b/recipes/capnproto/all/test_v1_package/conanfile.py deleted file mode 100644 index 9c7aa58ab88686..00000000000000 --- a/recipes/capnproto/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,26 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(self.tested_reference_str) - - def build(self): - with tools.no_op() if hasattr(self, "settings_build") else tools.run_environment(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "addressbook") - self.run(f"{bin_path} write", run_environment=True) diff --git a/recipes/catch2/3.x.x/conandata.yml b/recipes/catch2/3.x.x/conandata.yml index cf3bf5f0495f51..1b3f439405dee1 100644 --- a/recipes/catch2/3.x.x/conandata.yml +++ b/recipes/catch2/3.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.5.4": + url: "https://github.com/catchorg/Catch2/archive/v3.5.4.tar.gz" + sha256: "b7754b711242c167d8f60b890695347f90a1ebc95949a045385114165d606dbb" "3.5.3": url: "https://github.com/catchorg/Catch2/archive/v3.5.3.tar.gz" sha256: "8d723b0535c94860ef8cf6231580fa47d67a3416757ecb10639e40d748ab6c71" diff --git a/recipes/catch2/config.yml b/recipes/catch2/config.yml index b24c301a17e499..d67eb0bdcc6a4d 100644 --- a/recipes/catch2/config.yml +++ b/recipes/catch2/config.yml @@ -1,4 +1,6 @@ versions: + "3.5.4": + folder: 3.x.x "3.5.3": folder: 3.x.x "3.5.2": diff --git a/recipes/cctag/all/conandata.yml b/recipes/cctag/all/conandata.yml index 13ba480ba9f39c..1f24a6339e1f2f 100644 --- a/recipes/cctag/all/conandata.yml +++ b/recipes/cctag/all/conandata.yml @@ -1,9 +1,26 @@ sources: + "1.0.3": + url: "https://github.com/alicevision/CCTag/archive/refs/tags/v1.0.3.tar.gz" + sha256: "25396b03c4aa3c1be241a2a8518a29511cb4fff695caa5126203fbba8e8e444d" "1.0.1": url: "https://github.com/alicevision/CCTag/archive/refs/tags/v1.0.1.tar.gz" sha256: "ae8a819bc978eb13bb1061a204c214da835e56c9b7dc775237ed6b2191011dec" patches: + "1.0.3": + - patch_file: "patches/1.0.3-0001-honor-vc-runtime.patch" + patch_description: "Honor vc runtime" + patch_type: "conan" + - patch_file: "patches/1.0.3-0002-fix-boost-deprecated-includes.patch" + patch_description: "Fix deprecated Boost includes" + patch_type: "portability" "1.0.1": - - patch_file: "patches/0001-honor-vc-runtime.patch" + - patch_file: "patches/1.0.1-0001-honor-vc-runtime.patch" patch_description: "Honor vc runtime" patch_type: "conan" + - patch_file: "patches/1.0.3-0002-fix-boost-deprecated-includes.patch" + patch_description: "Fix deprecated Boost includes" + patch_type: "portability" + - patch_file: "patches/1.0.1-0002-fix-missing-define.patch" + patch_description: "Add missing _GNU_SOURCE define" + patch_type: "bugfix" + patch_source: "https://github.com/alicevision/CCTag/commit/b49d710ab6870a865c20c943a65bd6dca906a184" diff --git a/recipes/cctag/all/conanfile.py b/recipes/cctag/all/conanfile.py index 773c86527b19a9..8d249cbcf72c9a 100644 --- a/recipes/cctag/all/conanfile.py +++ b/recipes/cctag/all/conanfile.py @@ -4,6 +4,7 @@ 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_static_runtime +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -18,6 +19,7 @@ class CCTagConan(ConanFile): homepage = "https://github.com/alicevision/CCTag" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,6 +28,7 @@ class CCTagConan(ConanFile): "visual_debug": [True, False], "no_cout": [True, False], "with_cuda": [True, False], + "cuda_cc_list": [None, "ANY"], } default_options = { "shared": False, @@ -34,6 +37,7 @@ class CCTagConan(ConanFile): "visual_debug": False, "no_cout": True, "with_cuda": False, + "cuda_cc_list": None, # e.g. "5.2;7.5;8.2", builds all up to 7.5 by default } def export_sources(self): @@ -47,14 +51,21 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def package_id(self): + if not self.info.options.with_cuda: + del self.info.options.cuda_cc_list + def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.80.0") - self.requires("eigen/3.4.0") - self.requires("onetbb/2020.3") - self.requires("opencv/4.5.5") + self.requires("boost/1.84.0", transitive_headers=True, transitive_libs=True) + self.requires("eigen/3.4.0", transitive_headers=True) + if Version(self.version) >= "1.0.3": + self.requires("onetbb/2021.10.0") + else: + self.requires("onetbb/2020.3.3") + self.requires("opencv/4.9.0", transitive_headers=True, transitive_libs=True) @property def _required_boost_components(self): @@ -64,27 +75,22 @@ def _required_boost_components(self): ] def validate(self): - miss_boost_required_comp = \ - any(getattr(self.dependencies["boost"].options, - f"without_{boost_comp}", - True) for boost_comp in self._required_boost_components) + miss_boost_required_comp = any( + self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) + for boost_comp in self._required_boost_components + ) if self.dependencies["boost"].options.header_only or miss_boost_required_comp: raise ConanInvalidConfiguration( f"{self.ref} requires non header-only boost with these components: " f"{', '.join(self._required_boost_components)}", ) - if self.settings.compiler == "Visual Studio" and not self.options.shared and \ - is_msvc_static_runtime(self) and self.dependencies["onetbb"].options.shared: + if is_msvc_static_runtime(self) and not self.options.shared and self.dependencies["onetbb"].options.shared: raise ConanInvalidConfiguration("this specific configuration is prevented due to internal c3i limitations") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 14) - # FIXME: add cuda support - if self.options.with_cuda: - raise ConanInvalidConfiguration("CUDA not supported yet") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -93,16 +99,18 @@ def generate(self): tc.variables["CCTAG_SERIALIZE"] = self.options.serialize tc.variables["CCTAG_VISUAL_DEBUG"] = self.options.visual_debug tc.variables["CCTAG_NO_COUT"] = self.options.no_cout - tc.variables["CCTAG_WITH_CUDA"] = self.options.with_cuda tc.variables["CCTAG_BUILD_APPS"] = False - tc.variables["CCTAG_CUDA_CC_CURRENT_ONLY"] = False - tc.variables["CCTAG_NVCC_WARNINGS"] = False tc.variables["CCTAG_EIGEN_NO_ALIGN"] = True tc.variables["CCTAG_USE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) tc.variables["CCTAG_ENABLE_SIMD_AVX2"] = False tc.variables["CCTAG_BUILD_TESTS"] = False tc.variables["CCTAG_BUILD_DOC"] = False - tc.variables["CCTAG_NO_THRUST_COPY_IF"] = False + + tc.variables["CCTAG_WITH_CUDA"] = self.options.with_cuda + tc.variables["CCTAG_CUDA_CC_CURRENT_ONLY"] = False + tc.variables["CCTAG_NVCC_WARNINGS"] = False + if self.options.cuda_cc_list: + tc.variables["CCTAG_CUDA_CC_LIST_INIT"] = self.options.cuda_cc_list tc.generate() deps = CMakeDeps(self) @@ -118,6 +126,10 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "${OpenCV_LIBS}", "opencv_core opencv_videoio opencv_imgproc opencv_imgcodecs") + # Remove very old CUDA compute capabilities + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CCTAG_CUDA_CC_LIST_INIT0 3.5 3.7 5.0 5.2)", + "set(CCTAG_CUDA_CC_LIST_INIT0 5.0 5.2)") def build(self): self._patch_sources() @@ -139,17 +151,31 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["dl", "pthread"]) self.cpp_info.requires = [ - "boost::atomic", "boost::chrono", "boost::date_time", "boost::exception", - "boost::filesystem", "boost::serialization", "boost::system", - "boost::thread", "boost::timer", "boost::math_c99", "eigen::eigen", - "onetbb::onetbb", "opencv::opencv_core", "opencv::opencv_videoio", - "opencv::opencv_imgproc", "opencv::opencv_imgcodecs", + "boost::atomic", + "boost::chrono", + "boost::date_time", + "boost::exception", + "boost::filesystem", + "boost::math_c99", + "boost::serialization", + "boost::system", + "boost::thread", + "boost::timer", + "eigen::eigen", + "onetbb::onetbb", + "opencv::opencv_core", + "opencv::opencv_imgcodecs", + "opencv::opencv_imgproc", + "opencv::opencv_videoio", ] if self.settings.os == "Windows": self.cpp_info.requires.append("boost::stacktrace_windbg") else: self.cpp_info.requires.append("boost::stacktrace_basic") + # CCTag links against shared CUDA runtime by default and does not use it in headers, + # so we don't need to explicitly link against it. + # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "CCTag" self.cpp_info.names["cmake_find_package_multi"] = "CCTag" diff --git a/recipes/cctag/all/patches/0001-honor-vc-runtime.patch b/recipes/cctag/all/patches/1.0.1-0001-honor-vc-runtime.patch similarity index 100% rename from recipes/cctag/all/patches/0001-honor-vc-runtime.patch rename to recipes/cctag/all/patches/1.0.1-0001-honor-vc-runtime.patch diff --git a/recipes/cctag/all/patches/1.0.1-0002-fix-missing-define.patch b/recipes/cctag/all/patches/1.0.1-0002-fix-missing-define.patch new file mode 100644 index 00000000000000..26658b4f5bbf26 --- /dev/null +++ b/recipes/cctag/all/patches/1.0.1-0002-fix-missing-define.patch @@ -0,0 +1,29 @@ +From b49d710ab6870a865c20c943a65bd6dca906a184 Mon Sep 17 00:00:00 2001 +From: Simone Gasparini +Date: Fri, 7 Oct 2022 23:37:33 +0200 +Subject: [PATCH] [cctag] add osx fix _GNU_SOURCE + +as per +https://github.com/boostorg/stacktrace/issues/88 +--- + src/cctag/utils/Exceptions.hpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/cctag/utils/Exceptions.hpp b/src/cctag/utils/Exceptions.hpp +index 1e16b9b5..46067cff 100644 +--- a/src/cctag/utils/Exceptions.hpp ++++ b/src/cctag/utils/Exceptions.hpp +@@ -7,6 +7,13 @@ + */ + #ifndef _CCTAG_EXCEPTIONS_HPP_ + #define _CCTAG_EXCEPTIONS_HPP_ ++ ++// This fix is necessary on Apple and on Windows using cygwin to avoid the compilation error ++// #error "Boost.Stacktrace requires `_Unwind_Backtrace` function. ++// see https://github.com/boostorg/stacktrace/issues/88 ++#ifndef _GNU_SOURCE ++#define _GNU_SOURCE ++#endif + + #include + #include diff --git a/recipes/cctag/all/patches/1.0.3-0001-honor-vc-runtime.patch b/recipes/cctag/all/patches/1.0.3-0001-honor-vc-runtime.patch new file mode 100644 index 00000000000000..25d94454a5b937 --- /dev/null +++ b/recipes/cctag/all/patches/1.0.3-0001-honor-vc-runtime.patch @@ -0,0 +1,20 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -41,7 +41,7 @@ + else() + message(STATUS "Building in ${CMAKE_BUILD_TYPE} configuration") + endif() +- ++if(0) + # ensure the proper linker flags when building the static version on MSVC + if(MSVC AND NOT BUILD_SHARED_LIBS) + foreach(config "DEBUG" "RELEASE" "MINSIZEREL" "RELWITHDEBINFO") +@@ -65,7 +65,7 @@ + endif() + list(APPEND CUDA_NVCC_FLAGS -Xcompiler ${CCTAG_MVSC_LINKER}) + endif() +- ++endif() + set(CCTAG_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD ${CCTAG_CXX_STANDARD}) + set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/recipes/cctag/all/patches/1.0.3-0002-fix-boost-deprecated-includes.patch b/recipes/cctag/all/patches/1.0.3-0002-fix-boost-deprecated-includes.patch new file mode 100644 index 00000000000000..503defa4a3e7eb --- /dev/null +++ b/recipes/cctag/all/patches/1.0.3-0002-fix-boost-deprecated-includes.patch @@ -0,0 +1,16 @@ +Fixes "This header is deprecated. Use instead.", etc. deprecation warnings. +--- src/cctag/CCTagMarkersBank.hpp ++++ src/cctag/CCTagMarkersBank.hpp +@@ -9,9 +9,9 @@ + #define VISION_MARKER_CCTAG_MARKERS_BANK_HPP + + #include +-#include +-#include +-#include ++#include ++#include ++#include + #include + + #include diff --git a/recipes/cctag/config.yml b/recipes/cctag/config.yml index 715e55357a17be..2350f098ddd201 100644 --- a/recipes/cctag/config.yml +++ b/recipes/cctag/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.3": + folder: all "1.0.1": folder: all diff --git a/recipes/chunkio/all/conandata.yml b/recipes/chunkio/all/conandata.yml index 0ec309fb48a891..0996c6fec0b7ee 100644 --- a/recipes/chunkio/all/conandata.yml +++ b/recipes/chunkio/all/conandata.yml @@ -1,8 +1,18 @@ sources: + "1.5.2": + url: "https://github.com/fluent/chunkio/archive/refs/tags/v1.5.2.tar.gz" + sha256: "c73e809215454c34a79ed2a7d38abc6058da99dad8564de85e2919100fb987a5" "1.1.6": - url: "https://github.com/edsiper/chunkio/archive/refs/tags/v1.1.6.tar.gz" + url: "https://github.com/fluent/chunkio/archive/refs/tags/v1.1.6.tar.gz" sha256: "755dda0b8ccf6f5ff804b2c1a3caa938bae7b0f37d73afa12c1bf1fab4fd4c86" patches: + "1.5.2": + - patch_file: "patches/1.5.2-0001-add-installer.patch" + patch_description: "add installer" + patch_type: "conan" + - patch_file: "patches/1.1.6-0003-disable-pic.patch" + patch_description: "disable pic on static build" + patch_type: "portability" "1.1.6": - patch_file: "patches/1.1.6-0001-add-installer.patch" patch_description: "add installer" diff --git a/recipes/chunkio/all/conanfile.py b/recipes/chunkio/all/conanfile.py index a32c30c04b01b5..730b6cde7d240b 100644 --- a/recipes/chunkio/all/conanfile.py +++ b/recipes/chunkio/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -10,7 +11,7 @@ class ChunkIOConan(ConanFile): description = "Simple library to manage chunks of data in memory and file system" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/edsiper/chunkio" + homepage = "https://github.com/fluent/chunkio" topics = ("chunk", "io", "memory", "file") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -70,3 +71,5 @@ def package_info(self): self.cpp_info.libs = ["chunkio-shared"] if self.options.shared else ["chunkio-static", "cio-crc32"] if self.settings.os == "Windows": self.cpp_info.system_libs.append("shlwapi") + if Version(self.version) >= "1.5.0": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/chunkio/all/patches/1.5.2-0001-add-installer.patch b/recipes/chunkio/all/patches/1.5.2-0001-add-installer.patch new file mode 100644 index 00000000000000..6e02f8052fa980 --- /dev/null +++ b/recipes/chunkio/all/patches/1.5.2-0001-add-installer.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dbc7d48..a3810a5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -118,10 +118,15 @@ include_directories( + + add_subdirectory(deps/crc32) + add_subdirectory(src) +-add_subdirectory(tools) ++# add_subdirectory(tools) + + # Tests + if(CIO_TESTS) + enable_testing() + add_subdirectory(tests) + endif() ++ ++include(GNUInstallDirs) ++install(FILES ${PROJECT_BINARY_DIR}/include/chunkio/cio_info.h ${PROJECT_BINARY_DIR}/include/chunkio/cio_version.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/chunkio) ++install(DIRECTORY include/chunkio DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PATTERN "*.in" EXCLUDE) ++install(DIRECTORY deps/monkey/include/monkey DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +diff --git a/deps/crc32/CMakeLists.txt b/deps/crc32/CMakeLists.txt +index 8ae1823..0b7dba0 100644 +--- a/deps/crc32/CMakeLists.txt ++++ b/deps/crc32/CMakeLists.txt +@@ -3,3 +3,12 @@ set(src + ) + + add_library(cio-crc32 STATIC ${src}) ++ ++if(CIO_LIB_STATIC) ++ include(GNUInstallDirs) ++ install( ++ TARGETS cio-crc32 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index bb52273..b6e37b1 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -51,3 +51,22 @@ endif() + if (NOT CIO_LIB_STATIC AND NOT CIO_LIB_SHARED) + message(FATAL_ERROR "What are you doing?, you should build something") + endif() ++ ++include(GNUInstallDirs) ++ ++if(CIO_LIB_STATIC) ++ install( ++ TARGETS chunkio-static ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() ++ ++if(CIO_LIB_SHARED) ++ install( ++ TARGETS chunkio-shared ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() diff --git a/recipes/chunkio/all/test_package/CMakeLists.txt b/recipes/chunkio/all/test_package/CMakeLists.txt index 145508da160d29..b429e0efccdb77 100644 --- a/recipes/chunkio/all/test_package/CMakeLists.txt +++ b/recipes/chunkio/all/test_package/CMakeLists.txt @@ -3,5 +3,9 @@ project(test_package LANGUAGES C) find_package(chunkio REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.c) +if(chunkio_VERSION VERSION_LESS "1.5.0") + add_executable(${PROJECT_NAME} test_package.c) +else() + add_executable(${PROJECT_NAME} test_package_1_5_0.c) +endif() target_link_libraries(${PROJECT_NAME} PRIVATE chunkio::chunkio) diff --git a/recipes/chunkio/all/test_package/test_package_1_5_0.c b/recipes/chunkio/all/test_package/test_package_1_5_0.c new file mode 100644 index 00000000000000..ebbc2de6796ecf --- /dev/null +++ b/recipes/chunkio/all/test_package/test_package_1_5_0.c @@ -0,0 +1,23 @@ +#include "chunkio/chunkio.h" +#include + +static int log_cb(struct cio_ctx *ctx, int level, const char *file, int line, + char *str) +{ + (void) ctx; + + printf("[cio-test-fs] %-60s => %s:%i\n", str, file, line); + return 0; +} + +int main() { + struct cio_options options; + cio_options_init(&options); + options.flags = CIO_CHECKSUM; + options.log_level = CIO_LOG_INFO; + struct cio_ctx *ctx = cio_create(&options); + + cio_destroy(ctx); + + return 0; +} diff --git a/recipes/chunkio/config.yml b/recipes/chunkio/config.yml index 98af2724bf2b9b..2ac27382830861 100644 --- a/recipes/chunkio/config.yml +++ b/recipes/chunkio/config.yml @@ -1,3 +1,5 @@ versions: + "1.5.2": + folder: "all" "1.1.6": folder: "all" diff --git a/recipes/cista/all/conandata.yml b/recipes/cista/all/conandata.yml index dddca09a6246dd..02747f36f74acc 100644 --- a/recipes/cista/all/conandata.yml +++ b/recipes/cista/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "0.15": + - url: "https://github.com/felixguendling/cista/releases/download/v0.15/cista.h" + sha256: "45685fde5c5ef576ad821c4db7f01e375eb2668aa6dafd6b9627fe58ce0641eb" + - url: "https://raw.githubusercontent.com/felixguendling/cista/v0.15/LICENSE" + sha256: "fcd47e35fd6dc22feec454c5c1e572ccb7587dedd91d824528ebbb00a7f37c56" "0.14": - url: "https://github.com/felixguendling/cista/releases/download/v0.14/cista.h" sha256: "078933804966439ae105a6a748aa027a2f197351d735712b1efca0453340562d" diff --git a/recipes/cista/config.yml b/recipes/cista/config.yml index 4390251f719531..205c7eaece71d6 100644 --- a/recipes/cista/config.yml +++ b/recipes/cista/config.yml @@ -1,4 +1,6 @@ versions: + "0.15": + folder: all "0.14": folder: all "0.11": diff --git a/recipes/cmake/binary/conandata.yml b/recipes/cmake/binary/conandata.yml index 312a7c7d57530b..71b9095645b4b6 100644 --- a/recipes/cmake/binary/conandata.yml +++ b/recipes/cmake/binary/conandata.yml @@ -1,4 +1,42 @@ sources: + "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.1": Linux: armv8: diff --git a/recipes/cmake/config.yml b/recipes/cmake/config.yml index 7ce9e3ce4a58b7..839417c0a8da66 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -1,4 +1,8 @@ versions: + "3.29.2": + folder: "binary" + "3.29.0": + folder: "binary" "3.28.1": folder: "binary" "3.27.9": diff --git a/recipes/commata/all/conandata.yml b/recipes/commata/all/conandata.yml index 2f4d1cb571d151..f27e5a5899c63e 100644 --- a/recipes/commata/all/conandata.yml +++ b/recipes/commata/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.9": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.9.tar.gz" + sha256: "24c404e90e2f01a2f9e46e55c2f8121a3f146d1f2dfb819b8d7ab5cf13bd6a9f" "0.2.8": url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.8.tar.gz" sha256: "a762ec3ef1549aa5aebef78a160a40ee16d396fd976154f1f5c160837d145c8a" @@ -15,6 +18,15 @@ sources: url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.5.tar.gz" sha256: "d1be1f366267af6c466c29f846f5968f57626a8a6635a2ea9a3de3f6fb88e53b" patches: + "0.2.9": + - patch_file: "patches/0.2.9-0001-include-set.patch" + patch_description: "include header" + patch_type: "portability" + patch_source: "https://github.com/furfurylic/commata/pull/3" + - patch_file: "patches/0.2.9-0002-additional-missing-includes.patch" + patch_description: "add more missing headers" + patch_type: "portability" + patch_source: "https://github.com/furfurylic/commata/commit/07c6f43f0fae0237569d12420aded35f8ccf792f" "0.2.7": - patch_file: "patches/0.2.7-0001-include-optional.patch" patch_description: "include header" diff --git a/recipes/commata/all/patches/0.2.9-0001-include-set.patch b/recipes/commata/all/patches/0.2.9-0001-include-set.patch new file mode 100644 index 00000000000000..1519e2f79a965b --- /dev/null +++ b/recipes/commata/all/patches/0.2.9-0001-include-set.patch @@ -0,0 +1,12 @@ +diff --git a/include/commata/field_scanners.hpp b/include/commata/field_scanners.hpp +index 9b19b8c..9606732 100644 +--- a/include/commata/field_scanners.hpp ++++ b/include/commata/field_scanners.hpp +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + #include "text_error.hpp" + #include "text_value_translation.hpp" diff --git a/recipes/commata/all/patches/0.2.9-0002-additional-missing-includes.patch b/recipes/commata/all/patches/0.2.9-0002-additional-missing-includes.patch new file mode 100644 index 00000000000000..87671798cc1bdf --- /dev/null +++ b/recipes/commata/all/patches/0.2.9-0002-additional-missing-includes.patch @@ -0,0 +1,14 @@ +diff --git a/include/commata/field_handling.hpp b/include/commata/field_handling.hpp +index 04ab67e..8b438b6 100644 +--- a/include/commata/field_handling.hpp ++++ b/include/commata/field_handling.hpp +@@ -6,7 +6,9 @@ + #ifndef COMMATA_GUARD_CD40E918_ACCD_4879_BB48_7D9B8B823369 + #define COMMATA_GUARD_CD40E918_ACCD_4879_BB48_7D9B8B823369 + ++#include + #include ++#include + + namespace commata { + diff --git a/recipes/commata/config.yml b/recipes/commata/config.yml index 613aa17053d3e0..142c2b3beaf0a4 100644 --- a/recipes/commata/config.yml +++ b/recipes/commata/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.9": + folder: all "0.2.8": folder: all "0.2.7": diff --git a/recipes/cpp-channel/all/conandata.yml b/recipes/cpp-channel/all/conandata.yml new file mode 100644 index 00000000000000..8e45b895787016 --- /dev/null +++ b/recipes/cpp-channel/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.8.2": + url: "https://github.com/andreiavrammsd/cpp-channel/archive/refs/tags/v0.8.2.tar.gz" + sha256: "7666ec6ef275029593dc97bf35057761bc049298d71597a640da1e659c39a667" diff --git a/recipes/cpp-channel/all/conanfile.py b/recipes/cpp-channel/all/conanfile.py new file mode 100644 index 00000000000000..2dfc0cff05ee7b --- /dev/null +++ b/recipes/cpp-channel/all/conanfile.py @@ -0,0 +1,59 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.52.0" + +class CppCHannelConan(ConanFile): + name = "cpp-channel" + description = "Thread-safe container for sharing data between threads" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/andreiavrammsd/cpp-channel" + topics = ("channel", "golang", "container", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(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 == "gcc" and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < 7") + + 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 package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + copy( + self, + pattern="*.inl", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cpp-channel/all/test_package/CMakeLists.txt b/recipes/cpp-channel/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..6e53e2494f3890 --- /dev/null +++ b/recipes/cpp-channel/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cpp-channel REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp-channel::cpp-channel) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cairo/all/test_package/conanfile.py b/recipes/cpp-channel/all/test_package/conanfile.py similarity index 65% rename from recipes/cairo/all/test_package/conanfile.py rename to recipes/cpp-channel/all/test_package/conanfile.py index e904c93b97465a..3a91c9439218e3 100644 --- a/recipes/cairo/all/test_package/conanfile.py +++ b/recipes/cpp-channel/all/test_package/conanfile.py @@ -1,20 +1,20 @@ from conan import ConanFile -from conan.tools.cmake import CMake, cmake_layout from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + 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 requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() @@ -22,5 +22,5 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/cpp-channel/all/test_package/test_package.cpp b/recipes/cpp-channel/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..f0fa8b9f9e5930 --- /dev/null +++ b/recipes/cpp-channel/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include "msd/channel.hpp" + +int main() +{ + msd::channel ch{10}; + + int in{}; + + in = 1; + ch << in; + + in = 2; + ch << in; + + in = 3; + ch << in; + + for (auto out : ch) { + std::cout << out << '\n'; + + if (ch.empty()) { + break; + } + } +} diff --git a/recipes/cpp-channel/config.yml b/recipes/cpp-channel/config.yml new file mode 100644 index 00000000000000..bed1cdd9bb5b16 --- /dev/null +++ b/recipes/cpp-channel/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8.2": + folder: all diff --git a/recipes/cpp-dump/all/conandata.yml b/recipes/cpp-dump/all/conandata.yml new file mode 100644 index 00000000000000..5f382aa287ad37 --- /dev/null +++ b/recipes/cpp-dump/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.5.0": + url: "https://github.com/philip82148/cpp-dump/archive/refs/tags/v0.5.0.tar.gz" + sha256: "31fa8b03c9ee820525137be28f37b36e2abe7fd91df7d67681cb894db2230fe6" diff --git a/recipes/cpp-dump/all/conanfile.py b/recipes/cpp-dump/all/conanfile.py new file mode 100644 index 00000000000000..b9f479f3b52af7 --- /dev/null +++ b/recipes/cpp-dump/all/conanfile.py @@ -0,0 +1,73 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.52.0" + + +class CppDumpConan(ConanFile): + name = "cpp-dump" + description = "An all-round dump function library for C++ that can print any type, even user-defined types." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/philip82148/cpp-dump" + topics = ("debug", "dump", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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 package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="dump.hpp", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include", "hpp"), + src=os.path.join(self.source_folder, "hpp"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cpp-dump/all/test_package/CMakeLists.txt b/recipes/cpp-dump/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..79f40a47d7e0c7 --- /dev/null +++ b/recipes/cpp-dump/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cpp-dump REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp-dump::cpp-dump) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cpp-dump/all/test_package/conanfile.py b/recipes/cpp-dump/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/cpp-dump/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cpp-dump/all/test_package/test_package.cpp b/recipes/cpp-dump/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..187dc7393224b4 --- /dev/null +++ b/recipes/cpp-dump/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include +#include +#include + +int main() { + std::clog << std::endl; + + std::vector> my_vector{{3, 5, 8, 9, 7}, {9, 3, 2, 3, 8}}; + CPP_DUMP(my_vector); + + std::clog << std::endl; +} diff --git a/recipes/cpp-dump/config.yml b/recipes/cpp-dump/config.yml new file mode 100644 index 00000000000000..ca7b2c3985d5ed --- /dev/null +++ b/recipes/cpp-dump/config.yml @@ -0,0 +1,3 @@ +versions: + "0.5.0": + folder: all diff --git a/recipes/cpp-peglib/1.x.x/conandata.yml b/recipes/cpp-peglib/1.x.x/conandata.yml index dc41e18c30f7b9..7aa81fd5b52ff2 100644 --- a/recipes/cpp-peglib/1.x.x/conandata.yml +++ b/recipes/cpp-peglib/1.x.x/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.8.8": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.8.tar.gz" + sha256: "3019d8084a146562fe2fd4c71e3226ac6e3994e8cee21cab27b3cd5a86bcef34" + "1.8.7": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.7.tar.gz" + sha256: "400696cc7e721b23aeac28a1ae12ceec235e2671888993da2ce012f6acdf83d4" "1.8.6": url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.6.tar.gz" sha256: "b2ebdc135a66074a386d377b761b38e050088fba6482575ca3028d0e184ecd91" diff --git a/recipes/cpp-peglib/config.yml b/recipes/cpp-peglib/config.yml index 67a22c2c821e54..81349971ce40f2 100644 --- a/recipes/cpp-peglib/config.yml +++ b/recipes/cpp-peglib/config.yml @@ -1,4 +1,8 @@ versions: + "1.8.8": + folder: "1.x.x" + "1.8.7": + folder: "1.x.x" "1.8.6": folder: "1.x.x" "1.8.5": diff --git a/recipes/cpptrace/all/conandata.yml b/recipes/cpptrace/all/conandata.yml index 3c8c1e7ad89018..82140c1347a010 100644 --- a/recipes/cpptrace/all/conandata.yml +++ b/recipes/cpptrace/all/conandata.yml @@ -1,5 +1,13 @@ sources: # Newer versions at the top + "0.5.2": + url: + - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.5.2.tar.gz" + sha256: "d148998e175b9c69ffb4383ab321a0d27487392e4eee3f39441d35b6856c8f78" + "0.5.1": + url: + - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.5.1.tar.gz" + sha256: "27b9f862ec6185f570ee59c07fdd12bebb55a986191518e896621317d2654f26" "0.5.0": url: - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.5.0.tar.gz" @@ -25,6 +33,11 @@ sources: - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.2.1.tar.gz" sha256: "3184f404c61b6b8ba6fe7c64fc40d1c3d6d87df59bcacf1845d846101bc22f9a" patches: + "0.5.2": + - patch_file: "patches/0.5.2/0001-msvc-bug.patch" + patch_type: "official" + patch_source: "https://github.com/jeremy-rifkin/cpptrace/commit/599d6abd6cc74e80e8429fc309247be5f7edd5d7" + patch_description: "Workaround bug for old msvc" "0.4.0": - patch_file: "patches/0.4.0/0001-libdwarf_path.patch" patch_type: "conan" diff --git a/recipes/cpptrace/all/patches/0.5.2/0001-msvc-bug.patch b/recipes/cpptrace/all/patches/0.5.2/0001-msvc-bug.patch new file mode 100644 index 00000000000000..b9a184ee0d627b --- /dev/null +++ b/recipes/cpptrace/all/patches/0.5.2/0001-msvc-bug.patch @@ -0,0 +1,36 @@ +diff --git a/src/utils/microfmt.hpp b/src/utils/microfmt.hpp +index ba47db7..0f750c3 100644 +--- a/src/utils/microfmt.hpp ++++ b/src/utils/microfmt.hpp +@@ -302,20 +302,27 @@ namespace microfmt { + } + } + +- template + #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ template + std::string format(std::string_view fmt, Args&&... args) { +- #else +- std::string format(const std::string& fmt, Args&&... args) { +- #endif + return detail::format(fmt.begin(), fmt.end(), {detail::format_value(args)...}); + } + ++ inline std::string format(std::string_view fmt) { ++ return std::string(fmt); ++ } ++ #endif ++ + template + std::string format(const char* fmt, Args&&... args) { + return detail::format(fmt, fmt + std::strlen(fmt), {detail::format_value(args)...}); + } + ++ // working around an old msvc bug https://godbolt.org/z/88T8hrzzq mre: https://godbolt.org/z/drd8echbP ++ inline std::string format(const char* fmt) { ++ return std::string(fmt); ++ } ++ + template + void print(const S& fmt, Args&&... args) { + std::cout<=7.78.0 <9]", transitive_headers=True, transitive_libs=True) - # FIXME: This is a very dirty hack. - # with_ssl == _AUTO_SSL, cpr needs the openssl header to compile. But Conan recipe does not know which SSL library to use. - # because cpr's CMakeLists.txt automatically detects SSL libraries with CPR_ENABLE_SSL == ON. - if self.settings.os in ["Linux", "FreeBSD"] and self.options.with_ssl in ["openssl", CprConan._AUTO_SSL]: + if self.options.with_ssl == "openssl": self.requires("openssl/[>=1.1 <4]") def validate(self): @@ -101,24 +99,15 @@ def validate(self): if not self._uses_valid_abi_and_compiler: raise ConanInvalidConfiguration(f"Cannot compile {self.ref} with libstdc++ on clang < 9") - ssl_library = str(self.options.with_ssl) - - if ssl_library == "openssl" and is_apple_os(self): - raise ConanInvalidConfiguration("OpenSSL is not supported on macOS") - if ssl_library == "darwinssl" and not is_apple_os(self): - raise ConanInvalidConfiguration("DarwinSSL is only supported on macOS") - if ssl_library == "winssl" and self.settings.os != "Windows": - raise ConanInvalidConfiguration("WinSSL is only on Windows") + if self.options.with_ssl: + ssl_library = str(self.options.with_ssl) - if ssl_library not in (CprConan._AUTO_SSL, CprConan._NO_SSL, "winssl") and ssl_library != self.dependencies["libcurl"].options.with_ssl: - raise ConanInvalidConfiguration( - f"{self.ref}:with_ssl={self.options.with_ssl} requires libcurl:with_ssl={self.options.with_ssl}" - ) - - if ssl_library == "winssl" and self.dependencies["libcurl"].options.with_ssl != "schannel": - raise ConanInvalidConfiguration( - f"{self.ref}:with_ssl=winssl requires libcurl:with_ssl=schannel" - ) + if ssl_library == "openssl" and is_apple_os(self): + raise ConanInvalidConfiguration("OpenSSL is not supported on macOS. Use DarwinSSL instead.") + if ssl_library == "darwinssl" and not is_apple_os(self): + raise ConanInvalidConfiguration("DarwinSSL is only supported on macOS") + if ssl_library == "winssl" and self.settings.os != "Windows": + raise ConanInvalidConfiguration("WinSSL is only on Windows") if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") @@ -143,9 +132,7 @@ def generate(self): tc.variables["CPR_FORCE_OPENSSL_BACKEND"] = (self.options.with_ssl == "openssl") tc.variables["CPR_FORCE_WINSSL_BACKEND"] = (self.options.with_ssl == "winssl") tc.variables["CMAKE_USE_OPENSSL"] = (self.options.with_ssl == "openssl") - # If we are on a version where disabling SSL requires a cmake option, disable it - if self.options.with_ssl == CprConan._NO_SSL: - tc.variables["CPR_ENABLE_SSL"] = False + tc.variables["CPR_ENABLE_SSL"] = bool(self.options.with_ssl) if self.options.get_safe("verbose_logging", False): tc.variables["CURL_VERBOSE_LOGGING"] = True diff --git a/recipes/cpython/all/conandata.yml b/recipes/cpython/all/conandata.yml index f9fd51067c8b3b..d49b9005763391 100644 --- a/recipes/cpython/all/conandata.yml +++ b/recipes/cpython/all/conandata.yml @@ -1,72 +1,79 @@ sources: - "3.10.0": - url: "https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz" - sha256: "c4e0cbad57c90690cb813fb4663ef670b4d0f587d8171e2c42bd4c9245bd2758" - "3.9.7": - url: "https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tgz" - sha256: "a838d3f9360d157040142b715db34f0218e535333696a5569dc6f854604eb9d1" - "3.8.12": - url: "https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz" - sha256: "316aa33f3b7707d041e73f246efedb297a70898c4b91f127f66dc8d80c596f1a" - "3.7.12": - url: "https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz" - sha256: "33b4daaf831be19219659466d12645f87ecec6eb21d4d9f9711018a7b66cce46" - "2.7.18": - url: "https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz" - sha256: "da3080e3b488f648a3d7a4560ddee895284c3380b11d6de75edb986526b9a814" + "3.12.2": + url: "https://www.python.org/ftp/python/3.12.2/Python-3.12.2.tgz" + sha256: "a7c4f6a9dc423d8c328003254ab0c9338b83037bd787d680826a5bf84308116e" + "3.11.9": + url: "https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz" + sha256: "e7de3240a8bc2b1e1ba5c81bf943f06861ff494b69fda990ce2722a504c6153d" + "3.10.14": + url: "https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tgz" + sha256: "cefea32d3be89c02436711c95a45c7f8e880105514b78680c14fe76f5709a0f6" + "3.9.19": + url: "https://www.python.org/ftp/python/3.9.19/Python-3.9.19.tgz" + sha256: "f5f9ec8088abca9e399c3b62fd8ef31dbd2e1472c0ccb35070d4d136821aaf71" + "3.8.19": + url: "https://www.python.org/ftp/python/3.8.19/Python-3.8.19.tgz" + sha256: "c7fa55a36e5c7a19ec37d8f90f60a2197548908c9ac8b31e7c0dbffdd470eeac" patches: - "3.10.0": - - patch_file: "patches/3.10.0-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0002-_msi-vcxproj.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.10.0-0003-_ctypes-ffi.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.10.0-0005-disable-macos-tcltk.patch" - base_path: "source_subfolder" + "3.12.2": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.12/3.12.1-0001-_ctypes-ffi.patch" + patch_description: "Support shared libffi" + patch_type: "portability" - patch_file: "patches/3.x-0001-relocatable-python-config.patch" - base_path: "source_subfolder" - "3.9.7": - - patch_file: "patches/3.9.7-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0002-_msi-vcxproj.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0003-_ctypes-ffi.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0005-disable-macos-tcltk.patch" - base_path: "source_subfolder" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.12/3.12.1-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.11.9": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.11/3.11.7-0001-_ctypes-ffi.patch" + patch_description: "Support shared libffi" + patch_type: "portability" - patch_file: "patches/3.x-0001-relocatable-python-config.patch" - base_path: "source_subfolder" - "3.8.12": - - patch_file: "patches/3.8.12-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.8.12-0002-_ctypes-ffi.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.8.12-0004-disable-macos-tcltk.patch" - base_path: "source_subfolder" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.x-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.10.14": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.10/3.10.0-0003-_ctypes-ffi.patch" + patch_description: "Remove duplicate libffi symbols and support shared libffi" + patch_type: "portability" - patch_file: "patches/3.x-0001-relocatable-python-config.patch" - base_path: "source_subfolder" - "3.7.12": - - patch_file: "patches/3.7.9-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.7.9-0003-disable-macos-tcltk.patch" - base_path: "source_subfolder" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.x-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.9.19": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.9/3.9.7-0003-_ctypes-ffi.patch" + patch_description: "Remove duplicate libffi symbols and support shared libffi" + patch_type: "portability" - patch_file: "patches/3.x-0001-relocatable-python-config.patch" - base_path: "source_subfolder" - "2.7.18": - - patch_file: "patches/2.7.18-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/2.7.18-0002-add-support-msvc-14.patch" - base_path: "source_subfolder" - - patch_file: "patches/2.7.18-0003-msvc-fix-static.patch" - base_path: "source_subfolder" - - patch_file: "patches/2.7.18-0004-disable-macos-tcltk.patch" - base_path: "source_subfolder" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.x-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.8.19": + - patch_file: "patches/3.8/3.8.12-0002-_ctypes-ffi.patch" + patch_description: "Remove duplicate libffi symbols and support shared libffi" + patch_type: "portability" + - patch_file: "patches/3.x-0001-relocatable-python-config.patch" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.x-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" diff --git a/recipes/cpython/all/conanfile.py b/recipes/cpython/all/conanfile.py index 4fa1d1da6334ef..0a6a08312b3d5c 100644 --- a/recipes/cpython/all/conanfile.py +++ b/recipes/cpython/all/conanfile.py @@ -1,21 +1,29 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, MSBuild, tools -from conans.errors import ConanInvalidConfiguration -from io import StringIO import os import re import textwrap -required_conan_version = ">=1.33.0" +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.env import VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, mkdir, replace_in_file, rm, rmdir, save, unzip +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import MSBuildDeps, MSBuildToolchain, MSBuild, is_msvc, is_msvc_static_runtime, msvc_runtime_flag, msvs_toolset +from conan.tools.scm import Version + +required_conan_version = ">=1.58.0" class CPythonConan(ConanFile): name = "cpython" + description = "Python is a programming language that lets you work quickly and integrate systems more effectively." + license = "Python-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.python.org" - description = "Python is a programming language that lets you work quickly and integrate systems more effectively." topics = ("python", "cpython", "language", "script") - license = ("Python-2.0",) - exports_sources = "patches/**" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,11 +38,6 @@ class CPythonConan(ConanFile): "with_sqlite3": [True, False], "with_tkinter": [True, False], "with_curses": [True, False], - - # Python 2 options - "unicode": ["ucs2", "ucs4"], - "with_bsddb": [True, False], - # Python 3 options "with_lzma": [True, False], # options that don't change package id @@ -53,286 +56,426 @@ class CPythonConan(ConanFile): "with_sqlite3": True, "with_tkinter": True, "with_curses": True, - - # Python 2 options - "unicode": "ucs2", - "with_bsddb": False, # True, # FIXME: libdb package missing (#5309/#5392) - # Python 3 options "with_lzma": True, # options that don't change package id "env_vars": True, } - - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _version_number_only(self): - return re.match(r"^([0-9.]+)", self.version).group(1) - - @property - def _version_tuple(self): - return tuple(self._version_number_only.split(".")) + short_paths = True @property def _supports_modules(self): - return self.settings.compiler != "Visual Studio" or self.options.shared + return not is_msvc(self) or self.options.shared @property def _version_suffix(self): - if self.settings.compiler == "Visual Studio": - joiner = "" - else: - joiner = "." - return joiner.join(self._version_tuple[:2]) + v = Version(self.version) + joiner = "" if is_msvc(self) else "." + return f"{v.major}{joiner}{v.minor}" - @property - def _is_py3(self): - return tools.Version(self._version_number_only).major == "3" - - @property - def _is_py2(self): - return tools.Version(self._version_number_only).major == "2" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if self.settings.compiler == "Visual Studio": + if is_msvc(self): del self.options.lto del self.options.docstrings del self.options.pymalloc del self.options.with_curses del self.options.with_gdbm del self.options.with_nis - if self._is_py2: - # Python 2.xx does not support following options - del self.options.with_lzma - elif self._is_py3: - # Python 3.xx does not support following options - del self.options.with_bsddb - del self.options.unicode - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.compiler.rm_safe("libcxx") + self.settings.compiler.rm_safe("cppstd") def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self._supports_modules: - del self.options.with_bz2 - del self.options.with_sqlite3 - del self.options.with_tkinter + self.options.rm_safe("with_bz2") + self.options.rm_safe("with_sqlite3") + self.options.rm_safe("with_tkinter") + self.options.rm_safe("with_lzma") - del self.options.with_bsddb - del self.options.with_lzma - if self.settings.compiler == "Visual Studio": - # The msbuild generator only works with Visual Studio - self.generators.append("MSBuildDeps") + def layout(self): + basic_layout(self, src_folder="src") - def validate(self): - if self.options.shared: - if self.settings.compiler == "Visual Studio" and "MT" in self.settings.compiler.runtime: - raise ConanInvalidConfiguration("cpython does not support MT(d) runtime when building a shared cpython library") - if self.settings.compiler == "Visual Studio": - if self.options.optimizations: - raise ConanInvalidConfiguration("This recipe does not support optimized MSVC cpython builds (yet)") - # FIXME: should probably throw when cross building - # FIXME: optimizations for Visual Studio, before building the final `build_type`: - # 1. build the MSVC PGInstrument build_type, - # 2. run the instrumented binaries, (PGInstrument should have created a `python.bat` file in the PCbuild folder) - # 3. build the MSVC PGUpdate build_type - if self.settings.build_type == "Debug" and "d" not in self.settings.compiler.runtime: - raise ConanInvalidConfiguration("Building debug cpython requires a debug runtime (Debug cpython requires _CrtReportMode symbol, which only debug runtimes define)") - if self._is_py2: - if self.settings.compiler.version >= tools.Version("14"): - self.output.warn("Visual Studio versions 14 and higher were never officially supported by the CPython developers") - if str(self.settings.arch) not in self._msvc_archs: - raise ConanInvalidConfiguration("Visual Studio does not support this architecture") - - if not self.options.shared and tools.Version(self._version_number_only) >= "3.10": - raise ConanInvalidConfiguration("Static msvc build disabled (>=3.10) due to \"AttributeError: module 'sys' has no attribute 'winver'\"") - - if self.options.get_safe("with_curses", False) and not self.options["ncurses"].with_widec: - raise ConanInvalidConfiguration("cpython requires ncurses with wide character support") - - def package_id(self): - del self.info.options.env_vars - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @property - def _with_libffi(self): - # cpython 3.7.x on MSVC uses an ancient libffi 2.00-beta (which is not available at cci, and is API/ABI incompatible with current 3.2+) - return self._supports_modules \ - and (self.settings.compiler != "Visual Studio" or tools.Version(self._version_number_only) >= "3.8") + def build_requirements(self): + if Version(self.version) >= "3.11" and not is_msvc(self) and not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.1.0") def requirements(self): - self.requires("zlib/1.2.11") + self.requires("zlib/[>=1.2.11 <2]") if self._supports_modules: - self.requires("openssl/1.1.1l") - self.requires("expat/2.4.1") - if self._with_libffi: - self.requires("libffi/3.2.1") - if tools.Version(self._version_number_only) < "3.8": - self.requires("mpdecimal/2.4.2") - elif tools.Version(self._version_number_only) < "3.10": + self.requires("openssl/[>=1.1 <4]") + self.requires("expat/[>=2.6.2 <3]") + self.requires("libffi/3.4.4") + if Version(self.version) < "3.10" or is_apple_os(self): + # FIXME: mpdecimal > 2.5.0 on MacOS causes the _decimal module to not be importable self.requires("mpdecimal/2.5.0") else: - self.requires("mpdecimal/2.5.0") # FIXME: no 2.5.1 to troubleshoot apple + self.requires("mpdecimal/2.5.1") if self.settings.os != "Windows": - if not tools.is_apple_os(self.settings.os): - self.requires("libuuid/1.0.3") - self.requires("libxcrypt/4.4.25") + if not is_apple_os(self): + self.requires("util-linux-libuuid/2.39.2") + # In <3.9 and lower patch versions of 3.9/10/11, crypt.h was exposed in Python.h + # This was removed in 3.11 and backported: https://github.com/python/cpython/issues/88914 + # For the sake of this recipe, we only have later patch versions, so this version check + # may be slightly inaccurate if a lower patch version is desired. + transitive_crypt = Version(self.version) < "3.9" + self.requires("libxcrypt/4.4.36", transitive_headers=transitive_crypt, transitive_libs=transitive_crypt) if self.options.get_safe("with_bz2"): self.requires("bzip2/1.0.8") if self.options.get_safe("with_gdbm", False): - self.requires("gdbm/1.19") + self.requires("gdbm/1.23") if self.options.get_safe("with_nis", False): # TODO: Add nis when available. raise ConanInvalidConfiguration("nis is not available on CCI (yet)") if self.options.get_safe("with_sqlite3"): - self.requires("sqlite3/3.36.0") + self.requires("sqlite3/3.45.2") if self.options.get_safe("with_tkinter"): self.requires("tk/8.6.10") if self.options.get_safe("with_curses", False): - self.requires("ncurses/6.2") - if self.options.get_safe("with_bsddb", False): - self.requires("libdb/5.3.28") + # Used in a public header + # https://github.com/python/cpython/blob/v3.10.13/Include/py_curses.h#L34 + self.requires("ncurses/6.4", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_lzma", False): - self.requires("xz_utils/5.2.5") + self.requires("xz_utils/5.4.5") + + def package_id(self): + del self.info.options.env_vars + + def validate(self): + if self.options.shared: + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "cpython does not support MT(d) runtime when building a shared cpython library" + ) + if is_msvc(self): + if self.options.optimizations: + raise ConanInvalidConfiguration( + "This recipe does not support optimized MSVC cpython builds (yet)" + ) + # FIXME: should probably throw when cross building + # FIXME: optimizations for Visual Studio, before building the final `build_type`: + # 1. build the MSVC PGInstrument build_type, + # 2. run the instrumented binaries, (PGInstrument should have created a `python.bat` file in the PCbuild folder) + # 3. build the MSVC PGUpdate build_type + if self.settings.build_type == "Debug" and "d" not in msvc_runtime_flag(self): + raise ConanInvalidConfiguration( + "Building debug cpython requires a debug runtime (Debug cpython requires _CrtReportMode" + " symbol, which only debug runtimes define)" + ) + if str(self.settings.arch) not in self._msvc_archs: + raise ConanInvalidConfiguration("Visual Studio does not support this architecture") + if not self.options.shared and Version(self.version) >= "3.10": + # Static CPython on Windows is only loosely supported, see https://github.com/python/cpython/issues/110234 + # 3.10 fails during the test, 3.11 fails during the build (missing symbol that seems to be DLL specific: PyWin_DLLhModule) + raise ConanInvalidConfiguration("Static msvc build disabled (>=3.10) due to \"AttributeError: module 'sys' has no attribute 'winver'\"") + + if self.options.get_safe("with_curses", False) and not self.dependencies["ncurses"].options.with_widec: + raise ConanInvalidConfiguration("cpython requires ncurses with wide character support") + + if self._supports_modules: + if Version(self.version) >= "3.9.0": + if self.dependencies["mpdecimal"].ref.version < Version("2.5.0"): + raise ConanInvalidConfiguration("cpython 3.9.0 (and newer) requires (at least) mpdecimal 2.5.0") - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.libs = [] + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == 9 and Version(self.version) >= "3.12": + raise ConanInvalidConfiguration("FIXME: GCC 9 produces an internal compiler error locally, and a link error in CCI") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _generate_autotools(self): + tc = AutotoolsToolchain(self, prefix=self.package_folder) + # Not necessary, just cleans up the output + tc.update_configure_args({"--enable-static": None, "--disable-static": None}) yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), + tc.configure_args += [ "--with-doc-strings={}".format(yes_no(self.options.docstrings)), "--with-pymalloc={}".format(yes_no(self.options.pymalloc)), "--with-system-expat", - "--with-system-ffi", "--enable-optimizations={}".format(yes_no(self.options.optimizations)), "--with-lto={}".format(yes_no(self.options.lto)), "--with-pydebug={}".format(yes_no(self.settings.build_type == "Debug")), + "--with-system-libmpdec", + "--with-openssl={}".format(self.dependencies["openssl"].package_folder), ] - if self._is_py2: - conf_args.extend([ - "--enable-unicode={}".format(yes_no(self.options.unicode)), - ]) - if self._is_py3: - conf_args.extend([ - "--with-system-libmpdec", - "--with-openssl={}".format(self.deps_cpp_info["openssl"].rootpath), - "--enable-loadable-sqlite-extensions={}".format(yes_no(not self.options["sqlite3"].omit_load_extension)), - ]) - if self.settings.compiler == "intel": - conf_args.extend(["--with-icc"]) - if tools.get_env("CC") or self.settings.compiler != "gcc": - conf_args.append("--without-gcc") - if self.options.with_tkinter: + if Version(self.version) < "3.12": + tc.configure_args.append("--with-system-ffi") + if Version(self.version) >= "3.10": + tc.configure_args.append("--disable-test-modules") + if self.options.get_safe("with_sqlite3"): + tc.configure_args.append("--enable-loadable-sqlite-extensions={}".format( + yes_no(not self.dependencies["sqlite3"].options.omit_load_extension) + )) + if self.options.with_tkinter and Version(self.version) < "3.11": tcltk_includes = [] tcltk_libs = [] # FIXME: collect using some conan util (https://github.com/conan-io/conan/issues/7656) for dep in ("tcl", "tk", "zlib"): - tcltk_includes += ["-I{}".format(d) for d in self.deps_cpp_info[dep].include_paths] - tcltk_libs += ["-l{}".format(lib) for lib in self.deps_cpp_info[dep].libs] - if self.settings.os == "Linux" and not self.options["tk"].shared: + cpp_info = self.dependencies[dep].cpp_info.aggregated_components() + tcltk_includes += [f"-I{d}" for d in cpp_info.includedirs] + tcltk_libs += [f"-L{lib}" for lib in cpp_info.libdirs] + tcltk_libs += [f"-l{lib}" for lib in cpp_info.libs] + if self.settings.os in ["Linux", "FreeBSD"] and not self.dependencies["tk"].options.shared: # FIXME: use info from xorg.components (x11, xscrnsaver) - tcltk_libs.extend(["-l{}".format(lib) for lib in ("X11", "Xss")]) - conf_args.extend([ + tcltk_libs.extend([f"-l{lib}" for lib in ("X11", "Xss")]) + tc.configure_args += [ "--with-tcltk-includes={}".format(" ".join(tcltk_includes)), "--with-tcltk-libs={}".format(" ".join(tcltk_libs)), - ]) - if self.settings.os in ("Linux", "FreeBSD"): - # Building _testembed fails due to missing pthread/rt symbols - self._autotools.link_flags.append("-lpthread") - - build = None - if tools.cross_building(self) and not tools.cross_building(self, skip_x64_x86=True): - # Building from x86_64 to x86 is not a "real" cross build, so set build == host - build = tools.get_gnu_triplet(str(self.settings.os), str(self.settings.arch), str(self.settings.compiler)) - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder, build=build) - return self._autotools + ] + if not is_apple_os(self): + tc.extra_ldflags.append('-Wl,--as-needed') + + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + if Version(self.version) >= "3.11": + pkgdeps = PkgConfigDeps(self) + pkgdeps.generate() + + def generate(self): + VirtualRunEnv(self).generate(scope="build") + + if is_msvc(self): + # The msbuild generator only works with Visual Studio + deps = MSBuildDeps(self) + deps.generate() + # The toolchain.props is not injected yet, but it also generates VCVars + toolchain = MSBuildToolchain(self) + toolchain.properties["IncludeExternals"] = "true" + toolchain.generate() + else: + self._generate_autotools() + + def _msvc_project_path(self, name): + return os.path.join(self.source_folder, "PCBuild", f"{name}.vcxproj") + + def _regex_replace_in_file(self, filename, pattern, replacement): + content = load(self, filename) + content = re.sub(pattern, replacement, content) + save(self, filename, content) + + def _inject_conan_props_file(self, project_basename, dep_name, condition=True): + if condition: + search = '' + replace_in_file(self, + self._msvc_project_path(project_basename), + search, + search + f'') + + def _patch_setup_py(self): + setup_py = os.path.join(self.source_folder, "setup.py") + if Version(self.version) < "3.10": + replace_in_file(self, setup_py, ":libmpdec.so.2", "mpdec") + + if self.options.get_safe("with_curses", False): + libcurses = self.dependencies["ncurses"].cpp_info.components["libcurses"] + tinfo = self.dependencies["ncurses"].cpp_info.components["tinfo"] + libs = libcurses.libs + libcurses.system_libs + tinfo.libs + tinfo.system_libs + replace_in_file(self, setup_py, + "curses_libs = ", + "curses_libs = {} #".format(repr(libs))) + + if self._supports_modules: + openssl = self.dependencies["openssl"].cpp_info.aggregated_components() + zlib = self.dependencies["zlib"].cpp_info.aggregated_components() + if Version(self.version) < "3.11": + replace_in_file(self, setup_py, + "openssl_includes = ", + f"openssl_includes = {openssl.includedirs + zlib.includedirs} #") + replace_in_file(self, setup_py, + "openssl_libdirs = ", + f"openssl_libdirs = {openssl.libdirs + zlib.libdirs} #") + replace_in_file(self, setup_py, + "openssl_libs = ", + f"openssl_libs = {openssl.libs + zlib.libs} #") + + if Version(self.version) < "3.11": + replace_in_file(self, setup_py, "if (MACOS and self.detect_tkinter_darwin())", "if (False)") + + def _patch_msvc_projects(self): + # Don't build vendored bz2 + self._regex_replace_in_file(self._msvc_project_path("_bz2"), r'.*Include=\"\$\(bz2Dir\).*', "") + + if self._supports_modules: + # Don't import vendored libffi + replace_in_file(self, self._msvc_project_path("_ctypes"), '', "") + if Version(self.version) < "3.11": + # Don't add this define, it should be added conditionally by the libffi package + replace_in_file(self, self._msvc_project_path("_ctypes"), "FFI_BUILDING;", "") + + # Don't import vendored openssl + replace_in_file(self, self._msvc_project_path("_hashlib"), '', "") + replace_in_file(self, self._msvc_project_path("_ssl"), '', "") + + # For mpdecimal, we need to remove all headers and all c files *except* the main module file, _decimal.c + self._regex_replace_in_file(self._msvc_project_path("_decimal"), r'.*Include=\"\.\.\\Modules\\_decimal\\.*\.h.*', "") + self._regex_replace_in_file(self._msvc_project_path("_decimal"), r'.*Include=\"\.\.\\Modules\\_decimal\\libmpdec\\.*\.c.*', "") + # There is also an assembly file with a complicated build step as part of the mpdecimal build + replace_in_file(self, self._msvc_project_path("_decimal"), "", "-->") + # Remove extra include directory + replace_in_file(self, self._msvc_project_path("_decimal"), r"..\Modules\_decimal\libmpdec;", "") + + # Don't include vendored sqlite3 + replace_in_file(self, self._msvc_project_path("_sqlite3"), + '', + '') + + # Remove hardcoded reference to lzma library + replace_in_file(self, self._msvc_project_path("_lzma"), "$(OutDir)liblzma$(PyDebugExt).lib;", "") + # Don't include vendored lzma + replace_in_file(self, self._msvc_project_path("_lzma"), + '', + '') + + # Don't include vendored expat project + replace_in_file(self, self._msvc_project_path("pyexpat"), + r"$(PySourcePath)Modules\expat;", + "") + # Remove XML_STATIC, this should conditionally be set by the expat library. + # TODO: Why HAVE_EXPAT_H? (It is at least removed in later versions) + replace_in_file(self, self._msvc_project_path("pyexpat"), ("HAVE_EXPAT_H;" if Version(self.version) < "3.11" else "") + "XML_STATIC;", "") + self._regex_replace_in_file(self._msvc_project_path("pyexpat"), r'.*Include=\"\.\.\\Modules\\expat\\.*" />', "") + + # Don't include vendored expat headers + replace_in_file(self, self._msvc_project_path("_elementtree"), + r"..\Modules\expat;", + "") + # Remove XML_STATIC, this should conditionally be set by the expat library. + replace_in_file(self, self._msvc_project_path("_elementtree"), "XML_STATIC;", "") + # Remove vendored expat + self._regex_replace_in_file(self._msvc_project_path("_elementtree"), r'.*Include=\"\.\.\\Modules\\expat\\.*" />', "") + + if Version(self.version) >= "3.9": + # deflate.c has warning 4244 disabled, need special patching else it breaks the regex below + # Add an extra space to avoid being picked up by the regex + replace_in_file(self, self._msvc_project_path("pythoncore"), + r'', + r'') + # Don't use vendored zlib + self._regex_replace_in_file(self._msvc_project_path("pythoncore"), r'.*Include=\"\$\(zlibDir\).*', "") + + # Don't use vendored tcl/tk include dir + replace_in_file(self, self._msvc_project_path("_tkinter"), "$(tcltkDir)include;", "") + # Don't use hardcoded tcl/tk library + replace_in_file(self, self._msvc_project_path("_tkinter"), "$(tcltkLib);", "") + # TODO: Why? + replace_in_file(self, self._msvc_project_path("_tkinter"), + "", + "") + # Don't use vendored tcl/tk + self._regex_replace_in_file(self._msvc_project_path("_tkinter"), r'.*Include=\"\$\(tcltkdir\).*', "") + + # Disable "ValidateUcrtbase" target (TODO: Why?) + replace_in_file(self, self._msvc_project_path("python"), "$(Configuration) != 'PGInstrument'", "False") + + if Version(self.version) < "3.11": + # TODO: Why? + replace_in_file(self, self._msvc_project_path("_freeze_importlib"), + "', + r'') + + self._inject_conan_props_file("_bz2", "bzip2", self.options.get_safe("with_bz2")) + self._inject_conan_props_file("_elementtree", "expat", self._supports_modules) + self._inject_conan_props_file("pyexpat", "expat", self._supports_modules) + self._inject_conan_props_file("_hashlib", "openssl", self._supports_modules) + self._inject_conan_props_file("_ssl", "openssl", self._supports_modules) + self._inject_conan_props_file("_sqlite3", "sqlite3", self.options.get_safe("with_sqlite3")) + self._inject_conan_props_file("_tkinter", "tk", self.options.get_safe("with_tkinter")) + self._inject_conan_props_file("pythoncore", "zlib") + self._inject_conan_props_file("python", "zlib") + self._inject_conan_props_file("pythonw", "zlib") + self._inject_conan_props_file("_ctypes", "libffi", self._supports_modules) + self._inject_conan_props_file("_decimal", "mpdecimal", self._supports_modules) + self._inject_conan_props_file("_lzma", "xz_utils", self.options.get_safe("with_lzma")) + self._inject_conan_props_file("_bsddb", "libdb", self.options.get_safe("with_bsddb")) def _patch_sources(self): - for patch in self.conan_data.get("patches",{}).get(self.version, []): - tools.patch(**patch) - if self._is_py3 and tools.Version(self._version_number_only) < "3.10": - tools.replace_in_file(os.path.join(self._source_subfolder, "setup.py"), - ":libmpdec.so.2", "mpdec") - if self.settings.compiler == "Visual Studio": + apply_conandata_patches(self) + # <=3.10 requires a lot of manual injection of dependencies through setup.py + # 3.12 removes setup.py completely, and uses pkgconfig dependencies + # 3.11 is an in awkward transition state where some dependencies use pkgconfig, and others use setup.py + if Version(self.version) < "3.12": + self._patch_setup_py() + if Version(self.version) >= "3.11": + replace_in_file(self, os.path.join(self.source_folder, "configure"), + 'OPENSSL_LIBS="-lssl -lcrypto"', + 'OPENSSL_LIBS="-lssl -lcrypto -lz"') + if is_msvc(self): runtime_library = { "MT": "MultiThreaded", "MTd": "MultiThreadedDebug", "MD": "MultiThreadedDLL", "MDd": "MultiThreadedDebugDLL", - }[str(self.settings.compiler.runtime)] + }[msvc_runtime_flag(self)] self.output.info("Patching runtime") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pyproject.props"), - "MultiThreadedDLL", runtime_library) - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pyproject.props"), - "MultiThreadedDebugDLL", runtime_library) + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pyproject.props"), + "MultiThreadedDLL", runtime_library) + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pyproject.props"), + "MultiThreadedDebugDLL", runtime_library) # Remove vendored packages - tools.rmdir(os.path.join(self._source_subfolder, "Modules", "_decimal", "libmpdec")) - tools.rmdir(os.path.join(self._source_subfolder, "Modules", "expat")) + rmdir(self, os.path.join(self.source_folder, "Modules", "_decimal", "libmpdec")) + rmdir(self, os.path.join(self.source_folder, "Modules", "expat")) - if self.options.get_safe("with_curses", False): - # FIXME: this will link to ALL libraries of ncurses. Only need to link to ncurses(w) (+ eventually tinfo) - tools.replace_in_file(os.path.join(self._source_subfolder, "setup.py"), - "curses_libs = ", - "curses_libs = {} #".format(repr(self.deps_cpp_info["ncurses"].libs + self.deps_cpp_info["ncurses"].system_libs))) + if Version(self.version) < "3.12": + replace_in_file(self, os.path.join(self.source_folder, "Makefile.pre.in"), + "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'", + "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'") # Enable static MSVC cpython if not self.options.shared: - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythoncore.vcxproj"), - "","Py_NO_BUILD_SHARED;") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythoncore.vcxproj"), - "Py_ENABLE_SHARED", "Py_NO_ENABLE_SHARED") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythoncore.vcxproj"), - "DynamicLibrary", "StaticLibrary") - - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "python.vcxproj"), - "", "shlwapi.lib;ws2_32.lib;pathcch.lib;version.lib;%(AdditionalDependencies)") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "python.vcxproj"), - "", "Py_NO_ENABLE_SHARED;") - - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythonw.vcxproj"), - "", "shlwapi.lib;ws2_32.lib;pathcch.lib;version.lib;%(AdditionalDependencies)") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythonw.vcxproj"), - "", "Py_NO_ENABLE_SHARED;%(PreprocessorDefinitions)") - - def _upgrade_single_project_file(self, project_file): - """ - `devenv /upgrade ` will upgrade *ALL* projects referenced by the project. - By temporarily moving the solution project, only one project is upgraded - This is needed for static cpython or for disabled optional dependencies (e.g. tkinter=False) - Restore it afterwards because it is needed to build some targets. - """ - tools.rename(os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln"), - os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln.bak")) - tools.rename(os.path.join(self._source_subfolder, "PCbuild", "pcbuild.proj"), - os.path.join(self._source_subfolder, "PCbuild", "pcbuild.proj.bak")) - with tools.vcvars(self.settings): - self.run("devenv \"{}\" /upgrade".format(project_file), run_environment=True) - tools.rename(os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln.bak"), - os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln")) - tools.rename(os.path.join(self._source_subfolder, "PCbuild", "pcbuild.proj.bak"), - os.path.join(self._source_subfolder, "PCbuild", "pcbuild.proj")) + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythoncore.vcxproj"), + "", + "Py_NO_BUILD_SHARED;") + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythoncore.vcxproj"), + "Py_ENABLE_SHARED", + "Py_NO_ENABLE_SHARED") + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythoncore.vcxproj"), + "DynamicLibrary", + "StaticLibrary") + + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "python.vcxproj"), + "", + "shlwapi.lib;ws2_32.lib;pathcch.lib;version.lib;%(AdditionalDependencies)") + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "python.vcxproj"), + "", + "Py_NO_ENABLE_SHARED;") + + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythonw.vcxproj"), + "", + "shlwapi.lib;ws2_32.lib;pathcch.lib;version.lib;%(AdditionalDependencies)") + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythonw.vcxproj"), + "", + "Py_NO_ENABLE_SHARED;%(PreprocessorDefinitions)") + + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + replace_in_file( + self, os.path.join(self.source_folder, "PCbuild", "pythoncore.vcxproj"), + '', + f'', + ) + + if is_msvc(self): + self._patch_msvc_projects() @property def _solution_projects(self): if self.options.shared: - solution_path = os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln") - projects = set(m.group(1) for m in re.finditer("\"([^\"]+)\\.vcxproj\"", open(solution_path).read())) + solution_path = os.path.join(self.source_folder, "PCbuild", "pcbuild.sln") + projects = set(m.group(1) for m in re.finditer('"([^"]+)\\.vcxproj"', open(solution_path).read())) def project_build(name): if os.path.basename(name) in self._msvc_discarded_projects: @@ -341,39 +484,31 @@ def project_build(name): return False return True - def sort_importance(key): - importance = ( - "pythoncore", # The python library MUST be built first. All modules and executables depend on it - "python", # Build the python executable next (for convenience, when debugging) - ) - try: - return importance.index(key) - except ValueError: - return len(importance) - - projects = sorted((p for p in projects if project_build(p)), key=sort_importance) + projects = list(filter(project_build, projects)) return projects else: - return "pythoncore", "python", "pythonw" + return ["pythoncore", "python", "pythonw"] @property def _msvc_discarded_projects(self): - discarded = {"python_uwp", "pythonw_uwp"} + discarded = { + "python_uwp", + "pythonw_uwp", + "_freeze_importlib", + "sqlite3", + "bdist_wininst", + "liblzma", + "openssl", + "xxlimited", + } if not self.options.with_bz2: discarded.add("bz2") if not self.options.with_sqlite3: discarded.add("_sqlite3") if not self.options.with_tkinter: discarded.add("_tkinter") - if self._is_py2: - # Python 2 Visual Studio projects NOT to build - discarded = discarded.union({"bdist_wininst", "libeay", "ssleay", "sqlite3", "tcl", "tk", "tix"}) - if not self.options.with_bsddb: - discarded.add("_bsddb") - elif self._is_py3: - discarded = discarded.union({"bdist_wininst", "liblzma", "openssl", "sqlite3", "xxlimited"}) - if not self.options.with_lzma: - discarded.add("_lzma") + if not self.options.with_lzma: + discarded.add("_lzma") return discarded @property @@ -381,50 +516,31 @@ def _msvc_archs(self): archs = { "x86": "Win32", "x86_64": "x64", + "armv7": "ARM", + "armv8_32": "ARM", + "armv8": "ARM64", } - if tools.Version(self._version_number_only) >= "3.8": - archs.update({ - "armv7": "ARM", - "armv8_32": "ARM", - "armv8": "ARM64", - }) return archs def _msvc_build(self): msbuild = MSBuild(self) - msbuild_properties = { - "IncludeExternals": "true", - } + msbuild.platform = self._msvc_archs[str(self.settings.arch)] + projects = self._solution_projects - self.output.info("Building {} Visual Studio projects: {}".format(len(projects), projects)) + self.output.info(f"Building {len(projects)} Visual Studio projects: {projects}") - with tools.no_op(): - for project_i, project in enumerate(projects, 1): - self.output.info("[{}/{}] Building project '{}'...".format(project_i, len(projects), project)) - project_file = os.path.join(self._source_subfolder, "PCbuild", project + ".vcxproj") - self._upgrade_single_project_file(project_file) - msbuild.build(project_file, upgrade_project=False, build_type="Debug" if self.settings.build_type == "Debug" else "Release", - platforms=self._msvc_archs, properties=msbuild_properties) + sln = os.path.join(self.source_folder, "PCbuild", "pcbuild.sln") + # FIXME: Solution files do not pick up the toolset automatically. + cmd = msbuild.command(sln, targets=projects) + self.run(f"{cmd} /p:PlatformToolset={msvs_toolset(self)}") def build(self): - # FIXME: these checks belong in validate, but the versions of dependencies are not available there yet - if self._supports_modules: - if tools.Version(self._version_number_only) < "3.8.0": - if tools.Version(self.deps_cpp_info["mpdecimal"].version) >= "2.5.0": - raise ConanInvalidConfiguration("cpython versions lesser then 3.8.0 require a mpdecimal lesser then 2.5.0") - elif tools.Version(self._version_number_only) >= "3.9.0": - if tools.Version(self.deps_cpp_info["mpdecimal"].version) < "2.5.0": - raise ConanInvalidConfiguration("cpython 3.9.0 (and newer) requires (at least) mpdecimal 2.5.0") - - if self._with_libffi: - if tools.Version(self.deps_cpp_info["libffi"].version) >= "3.3" and self.settings.compiler == "Visual Studio" and "d" in str(self.settings.compiler.runtime): - raise ConanInvalidConfiguration("libffi versions >= 3.3 cause 'read access violations' when using a debug runtime (MTd/MDd)") - self._patch_sources() - if self.settings.compiler == "Visual Studio": + if is_msvc(self): self._msvc_build() else: - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() @property @@ -432,44 +548,40 @@ def _msvc_artifacts_path(self): build_subdir_lut = { "x86_64": "amd64", "x86": "win32", + "armv7": "arm32", + "armv8_32": "arm32", + "armv8": "arm64", } - if tools.Version(self._version_number_only) >= "3.8": - build_subdir_lut.update({ - "armv7": "arm32", - "armv8_32": "arm32", - "armv8": "arm64", - }) - return os.path.join(self._source_subfolder, "PCbuild", build_subdir_lut[str(self.settings.arch)]) + return os.path.join(self.source_folder, "PCbuild", build_subdir_lut[str(self.settings.arch)]) @property def _msvc_install_subprefix(self): return "bin" def _copy_essential_dlls(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): # Until MSVC builds support cross building, copy dll's of essential (shared) dependencies to python binary location. # These dll's are required when running the layout tool using the newly built python executable. dest_path = os.path.join(self.build_folder, self._msvc_artifacts_path) - if self._with_libffi: - for bin_path in self.deps_cpp_info["libffi"].bin_paths: - self.copy("*.dll", src=bin_path, dst=dest_path) - for bin_path in self.deps_cpp_info["expat"].bin_paths: - self.copy("*.dll", src=bin_path, dst=dest_path) - for bin_path in self.deps_cpp_info["zlib"].bin_paths: - self.copy("*.dll", src=bin_path, dst=dest_path) + for bin_path in self.dependencies["libffi"].cpp_info.bindirs: + copy(self, "*.dll", src=bin_path, dst=dest_path) + for bin_path in self.dependencies["expat"].cpp_info.bindirs: + copy(self, "*.dll", src=bin_path, dst=dest_path) + for bin_path in self.dependencies["zlib"].cpp_info.bindirs: + copy(self, "*.dll", src=bin_path, dst=dest_path) def _msvc_package_layout(self): self._copy_essential_dlls() install_prefix = os.path.join(self.package_folder, self._msvc_install_subprefix) - tools.mkdir(install_prefix) + mkdir(self, install_prefix) build_path = self._msvc_artifacts_path infix = "_d" if self.settings.build_type == "Debug" else "" # FIXME: if cross building, use a build python executable here - python_built = os.path.join(build_path, "python{}.exe".format(infix)) + python_built = os.path.join(build_path, f"python{infix}.exe") layout_args = [ - os.path.join(self._source_subfolder, "PC", "layout", "main.py"), + os.path.join(self.source_folder, "PC", "layout", "main.py"), "-v", - "-s", self._source_subfolder, + "-s", self.source_folder, "-b", build_path, "--copy", install_prefix, "-p", @@ -481,16 +593,12 @@ def _msvc_package_layout(self): layout_args.append("--include-tcltk") if self.settings.build_type == "Debug": layout_args.append("-d") - python_args = " ".join("\"{}\"".format(a) for a in layout_args) - self.run("{} {}".format(python_built, python_args), run_environment=True) + python_args = " ".join(f'"{a}"' for a in layout_args) + self.run(f"{python_built} {python_args}") - tools.rmdir(os.path.join(self.package_folder, "bin", "tcl")) + rmdir(self, os.path.join(self.package_folder, "bin", "tcl")) - for file in os.listdir(install_prefix): - if re.match("vcruntime.*", file): - os.unlink(os.path.join(install_prefix, file)) - continue - os.unlink(os.path.join(install_prefix, "LICENSE.txt")) + rm(self, "LICENSE.txt", install_prefix) for file in os.listdir(os.path.join(install_prefix, "libs")): if not re.match("python.*", file): os.unlink(os.path.join(install_prefix, "libs", file)) @@ -498,45 +606,64 @@ def _msvc_package_layout(self): def _msvc_package_copy(self): build_path = self._msvc_artifacts_path infix = "_d" if self.settings.build_type == "Debug" else "" - self.copy("*.exe", src=build_path, dst=os.path.join(self.package_folder, self._msvc_install_subprefix)) - self.copy("*.dll", src=build_path, dst=os.path.join(self.package_folder, self._msvc_install_subprefix)) - self.copy("*.pyd", src=build_path, dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "DLLs")) - self.copy("python{}{}.lib".format(self._version_suffix, infix), src=build_path, dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "libs")) - self.copy("*", src=os.path.join(self._source_subfolder, "Include"), dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "include")) - self.copy("pyconfig.h", src=os.path.join(self._source_subfolder, "PC"), dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "include")) - self.copy("*.py", src=os.path.join(self._source_subfolder, "lib"), dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib")) - tools.rmdir(os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib", "test")) + copy(self, "*.exe", + src=build_path, + dst=os.path.join(self.package_folder, self._msvc_install_subprefix)) + copy(self, "*.dll", + src=build_path, + dst=os.path.join(self.package_folder, self._msvc_install_subprefix)) + copy(self, "*.pyd", + src=build_path, + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "DLLs")) + copy(self, f"python{self._version_suffix}{infix}.lib", + src=build_path, + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "libs")) + copy(self, "*", + src=os.path.join(self.source_folder, "Include"), + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "include")) + copy(self, "pyconfig.h", + src=os.path.join(self.source_folder, "PC"), + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "include")) + copy(self, "*.py", + src=os.path.join(self.source_folder, "lib"), + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib")) + rmdir(self, os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib", "test")) packages = {} get_name_version = lambda fn: fn.split(".", 2)[:2] - whldir = os.path.join(self._source_subfolder, "Lib", "ensurepip", "_bundled") + whldir = os.path.join(self.source_folder, "Lib", "ensurepip", "_bundled") for fn in filter(lambda n: n.endswith(".whl"), os.listdir(whldir)): name, version = get_name_version(fn) add = True if name in packages: pname, pversion = get_name_version(packages[name]) - add = tools.Version(version) > tools.Version(pversion) + add = Version(version) > Version(pversion) if add: packages[name] = fn for fname in packages.values(): - tools.unzip(filename=os.path.join(whldir, fname), destination=os.path.join(self.package_folder, "bin", "Lib", "site-packages")) + unzip(self, filename=os.path.join(whldir, fname), + destination=os.path.join(self.package_folder, "bin", "Lib", "site-packages")) - self.run("{} -c \"import compileall; compileall.compile_dir('{}')\"".format(os.path.join(build_path, self._cpython_interpreter_name), os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib").replace("\\", "/")), - run_environment=True) + interpreter_path = os.path.join(build_path, self._cpython_interpreter_name) + lib_dir_path = os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib").replace("\\", "/") + self.run(f"{interpreter_path} -c \"import compileall; compileall.compile_dir('{lib_dir_path}')\"") def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - if self.settings.compiler == "Visual Studio": - if self._is_py2 or not self.options.shared: - self._msvc_package_copy() - else: + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + if self.options.shared: self._msvc_package_layout() - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "vcruntime*") + else: + self._msvc_package_copy() + rm(self, "vcruntime*", os.path.join(self.package_folder, "bin"), recursive=True) else: - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + autotools = Autotools(self) + if is_apple_os(self): + # FIXME: See https://github.com/python/cpython/issues/109796, this workaround is mentioned there + autotools.make(target="sharedinstall", args=["DESTDIR="]) + autotools.install(args=["DESTDIR="]) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) # Rewrite shebangs of python scripts for filename in os.listdir(os.path.join(self.package_folder, "bin")): @@ -550,23 +677,23 @@ def package(self): if not(firstline.startswith(b"#!") and b"/python" in firstline and b"/bin/sh" not in firstline): continue text = fn.read() - self.output.info("Rewriting shebang of {}".format(filename)) + self.output.info(f"Rewriting shebang of {filename}") with open(filepath, "wb") as fn: - fn.write(textwrap.dedent("""\ + fn.write(textwrap.dedent(f"""\ #!/bin/sh ''':' __file__="$0" while [ -L "$__file__" ]; do __file__="$(dirname "$__file__")/$(readlink "$__file__")" done - exec "$(dirname "$__file__")/python{}" "$0" "$@" + exec "$(dirname "$__file__")/python{self._version_suffix}" "$0" "$@" ''' - """.format(self._version_suffix)).encode()) + """).encode()) fn.write(text) if not os.path.exists(self._cpython_symlink): - os.symlink("python{}".format(self._version_suffix), self._cpython_symlink) - self._fix_install_name() + os.symlink(f"python{self._version_suffix}", self._cpython_symlink) + fix_apple_shared_install_name(self) @property def _cpython_symlink(self): @@ -577,14 +704,12 @@ def _cpython_symlink(self): @property def _cpython_interpreter_name(self): - if self.settings.compiler == "Visual Studio": - suffix = "" - else: - suffix = self._version_suffix - python = "python{}".format(suffix) - if self.settings.compiler == "Visual Studio": + python = "python" + if is_msvc(self): if self.settings.build_type == "Debug": python += "_d" + else: + python += self._version_suffix if self.settings.os == "Windows": python += ".exe" return python @@ -596,80 +721,71 @@ def _cpython_interpreter_path(self): @property def _abi_suffix(self): res = "" - if self._is_py3: - if self.settings.build_type == "Debug": - res += "d" - if tools.Version(self._version_number_only) < "3.8": - if self.options.get_safe("pymalloc", False): - res += "m" + if self.settings.build_type == "Debug": + res += "d" return res @property def _lib_name(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): if self.settings.build_type == "Debug": lib_ext = "_d" else: lib_ext = "" else: - lib_ext = self._abi_suffix + (".dll.a" if self.options.shared and self.settings.os == "Windows" else "") - return "python{}{}".format(self._version_suffix, lib_ext) - - def _fix_install_name(self): - if tools.is_apple_os(self.settings.os) and self.options.shared: - buffer = StringIO() - python = os.path.join(self.package_folder, "bin", "python") - self.run('otool -L "%s"' % python, output=buffer) - lines = buffer.getvalue().strip().split('\n')[1:] - for line in lines: - library = line.split()[0] - if library.startswith(self.package_folder): - new = library.replace(self.package_folder, "@executable_path/..") - self.output.info("patching {}, replace {} with {}".format(python, library, new)) - self.run("install_name_tool -change {} {} {}".format(library, new, python)) + lib_ext = self._abi_suffix + ( + ".dll.a" if self.options.shared and self.settings.os == "Windows" else "" + ) + return f"python{self._version_suffix}{lib_ext}" def package_info(self): # FIXME: conan components Python::Interpreter component, need a target type # self.cpp_info.names["cmake_find_package"] = "Python" # self.cpp_info.names["cmake_find_package_multi"] = "Python" - # FIXME: conan components need to generate multiple .pc files (python2, python-27) - py_version = tools.Version(self._version_number_only) + py_version = Version(self.version) # python component: "Build a C extension for Python" - if self.settings.compiler == "Visual Studio": + if is_msvc(self): self.cpp_info.components["python"].includedirs = [os.path.join(self._msvc_install_subprefix, "include")] libdir = os.path.join(self._msvc_install_subprefix, "libs") else: - self.cpp_info.components["python"].includedirs.append(os.path.join("include", "python{}{}".format(self._version_suffix, self._abi_suffix))) + self.cpp_info.components["python"].includedirs.append( + os.path.join("include", f"python{self._version_suffix}{self._abi_suffix}") + ) libdir = "lib" if self.options.shared: self.cpp_info.components["python"].defines.append("Py_ENABLE_SHARED") else: self.cpp_info.components["python"].defines.append("Py_NO_ENABLE_SHARED") - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["python"].system_libs.extend(["dl", "m", "pthread", "util"]) elif self.settings.os == "Windows": - self.cpp_info.components["python"].system_libs.extend(["pathcch", "shlwapi", "version", "ws2_32"]) + self.cpp_info.components["python"].system_libs.extend( + ["pathcch", "shlwapi", "version", "ws2_32"] + ) self.cpp_info.components["python"].requires = ["zlib::zlib"] if self.settings.os != "Windows": self.cpp_info.components["python"].requires.append("libxcrypt::libxcrypt") - self.cpp_info.components["python"].names["pkg_config"] = "python-{}.{}".format(py_version.major, py_version.minor) + self.cpp_info.components["python"].set_property( + "pkg_config_name", f"python-{py_version.major}.{py_version.minor}" + ) + self.cpp_info.components["python"].set_property( + "pkg_config_aliases", [f"python{py_version.major}"] + ) self.cpp_info.components["python"].libdirs = [] - self.cpp_info.components["_python_copy"].names["pkg_config"] = "python{}".format(py_version.major) - self.cpp_info.components["_python_copy"].requires = ["python"] - self.cpp_info.components["_python_copy"].libdirs = [] - # embed component: "Embed Python into an application" self.cpp_info.components["embed"].libs = [self._lib_name] self.cpp_info.components["embed"].libdirs = [libdir] - self.cpp_info.components["embed"].names["pkg_config"] = "python-{}.{}-embed".format(py_version.major, py_version.minor) + self.cpp_info.components["embed"].includedirs = [] + self.cpp_info.components["embed"].set_property( + "pkg_config_name", f"python-{py_version.major}.{py_version.minor}-embed" + ) + self.cpp_info.components["embed"].set_property( + "pkg_config_aliases", [f"python{py_version.major}-embed"] + ) self.cpp_info.components["embed"].requires = ["python"] - self.cpp_info.components["_embed_copy"].requires = ["embed"] - self.cpp_info.components["_embed_copy"].names["pkg_config"] = ["python{}-embed".format(py_version.major)] - self.cpp_info.components["_embed_copy"].libdirs = [] - if self._supports_modules: # hidden components: the C extensions of python are built as dynamically loaded shared libraries. # C extensions or applications with an embedded Python should not need to link to them.. @@ -677,12 +793,11 @@ def package_info(self): "openssl::openssl", "expat::expat", "mpdecimal::mpdecimal", + "libffi::libffi", ] - if self._with_libffi: - self.cpp_info.components["_hidden"].requires.append("libffi::libffi") if self.settings.os != "Windows": - if not tools.is_apple_os(self.settings.os): - self.cpp_info.components["_hidden"].requires.append("libuuid::libuuid") + if not is_apple_os(self): + self.cpp_info.components["_hidden"].requires.append("util-linux-libuuid::util-linux-libuuid") self.cpp_info.components["_hidden"].requires.append("libxcrypt::libxcrypt") if self.options.with_bz2: self.cpp_info.components["_hidden"].requires.append("bzip2::bzip2") @@ -692,47 +807,68 @@ def package_info(self): self.cpp_info.components["_hidden"].requires.append("sqlite3::sqlite3") if self.options.get_safe("with_curses", False): self.cpp_info.components["_hidden"].requires.append("ncurses::ncurses") - if self.options.get_safe("with_bsddb"): - self.cpp_info.components["_hidden"].requires.append("libdb::libdb") if self.options.get_safe("with_lzma"): self.cpp_info.components["_hidden"].requires.append("xz_utils::xz_utils") if self.options.get_safe("with_tkinter"): self.cpp_info.components["_hidden"].requires.append("tk::tk") + self.cpp_info.components["_hidden"].includedirs = [] self.cpp_info.components["_hidden"].libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_hidden"].system_libs.append("nsl") if self.options.env_vars: bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.runenv_info.append_path("PATH", bindir) + self.buildenv_info.append_path("PATH", bindir) + + # TODO remove once Conan 1.x is no longer supported + self.output.info(f"Appending PATH environment variable: {bindir}") self.env_info.PATH.append(bindir) python = self._cpython_interpreter_path + self.conf_info.define("user.cpython:python", python) self.user_info.python = python if self.options.env_vars: - self.output.info("Setting PYTHON environment variable: {}".format(python)) + self.runenv_info.append_path("PYTHON", python) + self.buildenv_info.append_path("PYTHON", python) + + # TODO remove once Conan 1.x is no longer supported + self.output.info(f"Appending PYTHON environment variable: {python}") self.env_info.PYTHON = python - if self.settings.compiler == "Visual Studio": + if is_msvc(self): pythonhome = os.path.join(self.package_folder, "bin") - elif tools.is_apple_os(self.settings.os): - pythonhome = self.package_folder else: - version = tools.Version(self._version_number_only) - pythonhome = os.path.join(self.package_folder, "lib", "python{}.{}".format(version.major, version.minor)) + pythonhome = self.package_folder + self.conf_info.define("user.cpython:pythonhome", pythonhome) self.user_info.pythonhome = pythonhome - pythonhome_required = self.settings.compiler == "Visual Studio" or tools.is_apple_os(self.settings.os) + pythonhome_required = is_msvc(self) or is_apple_os(self) + self.conf_info.define("user.cpython:module_requires_pythonhome", pythonhome_required) self.user_info.module_requires_pythonhome = pythonhome_required - if self.settings.compiler == "Visual Studio": + if is_msvc(self): if self.options.env_vars: - self.output.info("Setting PYTHONHOME environment variable: {}".format(pythonhome)) + # FIXME: On Windows, defining this breaks the packaged Python executable, but fixes + # separately built executables with an embedded interpreter trying to run standard Python + # modules. However, NOT defining this reverses the situation, normal Python executables + #work, but embedded interpreters break. + # The docs at https://python.readthedocs.io/en/latest/using/cmdline.html#envvar-PYTHONHOME + # seem to not be accurate to Windows (https://discuss.python.org/t/the-document-on-pythonhome-might-be-wrong/19614/5) + #self.runenv_info.append_path("PYTHONHOME", pythonhome) + #self.buildenv_info.append_path("PYTHONHOME", pythonhome) + + # TODO remove once Conan 1.x is no longer supported + self.output.info(f"Setting PYTHONHOME environment variable: {pythonhome}") self.env_info.PYTHONHOME = pythonhome - if self._is_py2: - python_root = "" - else: - python_root = self.package_folder - if self.options.env_vars: - self.output.info("Setting PYTHON_ROOT environment variable: {}".format(python_root)) - self.env_info.PYTHON_ROOT = python_root + python_root = self.package_folder + if self.options.env_vars: + self.runenv_info.append_path("PYTHON_ROOT", python_root) + self.buildenv_info.append_path("PYTHON_ROOT", python_root) + + # TODO remove once Conan 1.x is no longer supported + self.output.info(f"Setting PYTHON_ROOT environment variable: {python_root}") + self.env_info.PYTHON_ROOT = python_root + self.conf_info.define("user.cpython:python_root", python_root) self.user_info.python_root = python_root diff --git a/recipes/cpython/all/patches/2.7.18-0001-msvc.patch b/recipes/cpython/all/patches/2.7.18-0001-msvc.patch deleted file mode 100644 index 2c101049df531c..00000000000000 --- a/recipes/cpython/all/patches/2.7.18-0001-msvc.patch +++ /dev/null @@ -1,278 +0,0 @@ ---- PCbuild/_bsddb.vcxproj -+++ PCbuild/_bsddb.vcxproj -@@ -46,7 +46,7 @@ - NotSet - - -- -+ - - .pyd - -@@ -75,7 +75,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -64,7 +64,7 @@ - $(opensslIncludeDir);%(AdditionalIncludeDirectories) - - -- ws2_32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies) -+ ws2_32.lib;%(AdditionalDependencies) - - - -@@ -75,14 +75,14 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -96,10 +96,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -64,7 +64,7 @@ - $(opensslIncludeDir);%(AdditionalIncludeDirectories) - - -- ws2_32.lib;crypt32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies) -+ ws2_32.lib;crypt32.lib;%(AdditionalDependencies) - - - -@@ -75,14 +75,14 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - {86937f53-c189-40ef-8ce8-8759d8e7d480} - false ---- PCbuild/bz2.vcxproj -+++ PCbuild/bz2.vcxproj -@@ -47,7 +47,7 @@ - NotSet - - -- -+ - - .pyd - -@@ -72,13 +72,13 @@ - - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -61,15 +61,15 @@ - - - -- ..\Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - 0x1D100000 - - - -- -+ - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -58,19 +58,19 @@ - - - -- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -61,11 +61,11 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -77,12 +77,12 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - diff --git a/recipes/cpython/all/patches/2.7.18-0002-add-support-msvc-14.patch b/recipes/cpython/all/patches/2.7.18-0002-add-support-msvc-14.patch deleted file mode 100644 index 6034410d3d2652..00000000000000 --- a/recipes/cpython/all/patches/2.7.18-0002-add-support-msvc-14.patch +++ /dev/null @@ -1,59 +0,0 @@ -Patches from https://bugs.python.org/issue30742 - ---- Modules/posixmodule.c -+++ Modules/posixmodule.c -@@ -563,7 +563,10 @@ typedef struct { - char osfile; - } my_ioinfo; - -+#if _MSC_VER < 1900 // MSVS2013 and lower (https://bugs.python.org/issue30742) - extern __declspec(dllimport) char * __pioinfo[]; -+#endif -+ - #define IOINFO_L2E 5 - #define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) - #define IOINFO_ARRAYS 64 -@@ -575,6 +578,7 @@ extern __declspec(dllimport) char * __pioinfo[]; - int - _PyVerify_fd(int fd) - { -+#if _MSC_VER < 1900 // MSVS2013 and lower (https://bugs.python.org/issue30742) - const int i1 = fd >> IOINFO_L2E; - const int i2 = fd & ((1 << IOINFO_L2E) - 1); - -@@ -607,6 +611,13 @@ _PyVerify_fd(int fd) - fail: - errno = EBADF; - return 0; -+#else -+ //a call to _get_osfhandle with invalid fd sets errno to EBADF -+ if (_get_osfhandle(fd) == INVALID_HANDLE_VALUE) -+ return 0; -+ else -+ return 1; -+#endif - } - - /* the special case of checking dup2. The target fd must be in a sensible range */ ---- Modules/timemodule.c -+++ Modules/timemodule.c -@@ -803,7 +803,18 @@ inittimezone(PyObject *m) { - - And I'm lazy and hate C so nyer. - */ --#if defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__) -+#if defined(HAVE_TZNAME) && (_MSC_VER >= 1900) //MSVS2015+ (https://bugs.python.org/issue30742) -+ tzset(); -+ PyModule_AddIntConstant(m, "timezone", _timezone); -+#ifdef HAVE_ALTZONE -+ PyModule_AddIntConstant(m, "altzone", altzone); -+#else -+ PyModule_AddIntConstant(m, "altzone", _timezone - 3600); -+#endif -+ PyModule_AddIntConstant(m, "daylight", _daylight); -+ PyModule_AddObject(m, "tzname", -+ Py_BuildValue("(zz)", _tzname[0], _tzname[1])); -+#elif defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__) - tzset(); - #ifdef PYOS_OS2 - PyModule_AddIntConstant(m, "timezone", _timezone); diff --git a/recipes/cpython/all/patches/2.7.18-0003-msvc-fix-static.patch b/recipes/cpython/all/patches/2.7.18-0003-msvc-fix-static.patch deleted file mode 100644 index 9eb079402733d8..00000000000000 --- a/recipes/cpython/all/patches/2.7.18-0003-msvc-fix-static.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- PC/dl_nt.c -+++ PC/dl_nt.c -@@ -107,5 +107,7 @@ - } - return TRUE; - } -- -+#else -+ULONG_PTR _Py_ActivateActCtx() { return 0; } -+void _Py_DeactivateActCtx(ULONG_PTR cookie) {} - #endif /* Py_ENABLE_SHARED */ diff --git a/recipes/cpython/all/patches/2.7.18-0004-disable-macos-tcltk.patch b/recipes/cpython/all/patches/2.7.18-0004-disable-macos-tcltk.patch deleted file mode 100644 index 5c61acd74bd5cd..00000000000000 --- a/recipes/cpython/all/patches/2.7.18-0004-disable-macos-tcltk.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- setup.py -+++ setup.py -@@ -1928,9 +1928,9 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (host_platform == 'darwin' and -- self.detect_tkinter_darwin(inc_dirs, lib_dirs)): -- return -+ #if (host_platform == 'darwin' and -+ # self.detect_tkinter_darwin(inc_dirs, lib_dirs)): -+ # return - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.10.0-0001-msvc.patch b/recipes/cpython/all/patches/3.10.0-0001-msvc.patch deleted file mode 100644 index e9b1faf061f3bf..00000000000000 --- a/recipes/cpython/all/patches/3.10.0-0001-msvc.patch +++ /dev/null @@ -1,416 +0,0 @@ ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -58,2 +58,0 @@ --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" --EndProject ---- PCbuild/python.vcxproj -+++ PCbuild/python.vcxproj -@@ -120,1 +120,1 @@ -- -+ ---- PCbuild/_freeze_importlib.vcxproj -+++ PCbuild/_freeze_importlib.vcxproj -@@ -151,1 +151,1 @@ -- -+ --> ---- PCbuild/_bz2.vcxproj -+++ PCbuild/_bz2.vcxproj -@@ -71,7 +71,7 @@ - bz2 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -101,17 +101,17 @@ - - - -- -+ - - -- -- -+ - - - ---- PCbuild/_ctypes.vcxproj -+++ PCbuild/_ctypes.vcxproj -@@ -71,7 +71,7 @@ - _ctypes - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -94,7 +94,7 @@ - - - -- FFI_BUILDING;%(PreprocessorDefinitions) -+ %(PreprocessorDefinitions) - - - /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) ---- PCbuild/_decimal.vcxproj -+++ PCbuild/_decimal.vcxproj -@@ -71,7 +71,7 @@ - _decimal - Win32Proj - -- -+ - - - DynamicLibrary -@@ -98,11 +98,11 @@ - CONFIG_32;ANSI;%(PreprocessorDefinitions) - CONFIG_64;ANSI;%(PreprocessorDefinitions) - CONFIG_64;MASM;%(PreprocessorDefinitions) -- ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) -+ ..\Modules\_decimal;%(AdditionalIncludeDirectories) - - - -- -+ - - - -- -+ - - -- -+ - - - ---- PCbuild/_lzma.vcxproj -+++ PCbuild/_lzma.vcxproj -@@ -71,7 +71,7 @@ - lzma - Win32Proj - -- -+ - - - DynamicLibrary -@@ -94,10 +94,10 @@ - - - $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) -- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) -+ $(ConanPreprocessorDefinitions);WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) - - -- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -111,10 +111,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -74,1 +74,1 @@ -- -+ -@@ -129,4 +129,4 @@ -- -+ ---- PCbuild/pythoncore.vcxproj -+++ PCbuild/pythoncore.vcxproj -@@ -73,1 +73,1 @@ -- -+ -@@ -302,7 +302,7 @@ - - - -- -+ - - - -@@ -496,7 +496,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -71,7 +71,7 @@ - _hashlib - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -71,7 +71,7 @@ - _ssl - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -99,9 +99,9 @@ - - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -71,7 +71,7 @@ - _elementtree - Win32Proj - -- -+ - - - DynamicLibrary -@@ -93,12 +93,12 @@ - - - -- ..\Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - -- -+ - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -71,7 +71,7 @@ - {D06B6426-4762-44CC-8BAD-D79052507F2F} - pyexpat - -- -+ - - - DynamicLibrary -@@ -90,19 +90,19 @@ - - - -- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -77,7 +77,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -93,12 +93,12 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) -- Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) -+ - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -108,10 +108,10 @@ - - - -- -+ - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -9,9 +9,6 @@ - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" -- ProjectSection(ProjectDependencies) = postProject -- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} -- EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" - EndProject diff --git a/recipes/cpython/all/patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch b/recipes/cpython/all/patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch deleted file mode 100644 index 0288bdae92ee9f..00000000000000 --- a/recipes/cpython/all/patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.pre.in -+++ Makefile.pre.in -@@ -627,10 +627,10 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/recipes/cpython/all/patches/3.10.0-0005-disable-macos-tcltk.patch b/recipes/cpython/all/patches/3.10.0-0005-disable-macos-tcltk.patch deleted file mode 100644 index ec23890e0a717b..00000000000000 --- a/recipes/cpython/all/patches/3.10.0-0005-disable-macos-tcltk.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- setup.py -+++ setup.py -@@ -2094,8 +2094,8 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (MACOS and self.detect_tkinter_darwin()): -- return True -+ #if (MACOS and self.detect_tkinter_darwin()): -+ # return True - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.10.0-0003-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.10/3.10.0-0003-_ctypes-ffi.patch similarity index 100% rename from recipes/cpython/all/patches/3.10.0-0003-_ctypes-ffi.patch rename to recipes/cpython/all/patches/3.10/3.10.0-0003-_ctypes-ffi.patch diff --git a/recipes/cpython/all/patches/3.11/3.11.7-0001-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.11/3.11.7-0001-_ctypes-ffi.patch new file mode 100644 index 00000000000000..65027b60406fd8 --- /dev/null +++ b/recipes/cpython/all/patches/3.11/3.11.7-0001-_ctypes-ffi.patch @@ -0,0 +1,37 @@ +diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c +index 9bdf1db856..799f99e809 100644 +--- a/Modules/_ctypes/cfield.c ++++ b/Modules/_ctypes/cfield.c +@@ -1473,7 +1473,11 @@ P_get(void *ptr, Py_ssize_t size) + return PyLong_FromVoidPtr(*(void **)ptr); + } + +-static struct fielddesc formattable[] = { ++#define FORMATTABLE_SIZE 30 ++static struct fielddesc formattable[FORMATTABLE_SIZE]; ++ ++static void formattable_init(void) { ++struct fielddesc my_formattable[] = { + { 's', s_set, s_get, NULL}, + { 'b', b_set, b_get, NULL}, + { 'B', B_set, B_get, NULL}, +@@ -1510,6 +1514,11 @@ static struct fielddesc formattable[] = { + { 'O', O_set, O_get, NULL}, + { 0, NULL, NULL, NULL}, + }; ++ size_t nb = 1; ++ for (struct fielddesc *pos = my_formattable; pos->code; ++pos, ++nb); ++ if (FORMATTABLE_SIZE < nb) abort(); ++ memcpy(formattable, my_formattable, nb * sizeof(struct fielddesc)); ++} + + /* + Ideas: Implement VARIANT in this table, using 'V' code. +@@ -1597,6 +1606,7 @@ _ctypes_get_fielddesc(const char *fmt) + + if (!initialized) { + initialized = 1; ++ formattable_init(); + _ctypes_init_fielddesc(); + } + diff --git a/recipes/cpython/all/patches/3.12/3.12.1-0001-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.12/3.12.1-0001-_ctypes-ffi.patch new file mode 100644 index 00000000000000..06bb62c5abd9fc --- /dev/null +++ b/recipes/cpython/all/patches/3.12/3.12.1-0001-_ctypes-ffi.patch @@ -0,0 +1,37 @@ +diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c +index 128506a9ee..ee9ade67b8 100644 +--- a/Modules/_ctypes/cfield.c ++++ b/Modules/_ctypes/cfield.c +@@ -1448,7 +1448,11 @@ P_get(void *ptr, Py_ssize_t size) + return PyLong_FromVoidPtr(*(void **)ptr); + } + +-static struct fielddesc formattable[] = { ++#define FORMATTABLE_SIZE 30 ++static struct fielddesc formattable[FORMATTABLE_SIZE]; ++ ++static void formattable_init(void) { ++struct fielddesc my_formattable[] = { + { 's', s_set, s_get, NULL}, + { 'b', b_set, b_get, NULL}, + { 'B', B_set, B_get, NULL}, +@@ -1485,6 +1489,11 @@ static struct fielddesc formattable[] = { + { 'O', O_set, O_get, NULL}, + { 0, NULL, NULL, NULL}, + }; ++ size_t nb = 1; ++ for (struct fielddesc *pos = my_formattable; pos->code; ++pos, ++nb); ++ if (FORMATTABLE_SIZE < nb) abort(); ++ memcpy(formattable, my_formattable, nb * sizeof(struct fielddesc)); ++} + + /* + Ideas: Implement VARIANT in this table, using 'V' code. +@@ -1572,6 +1581,7 @@ _ctypes_get_fielddesc(const char *fmt) + + if (!initialized) { + initialized = 1; ++ formattable_init(); + _ctypes_init_fielddesc(); + } + diff --git a/recipes/cpython/all/patches/3.12/3.12.1-0002-remove-module-deps.patch b/recipes/cpython/all/patches/3.12/3.12.1-0002-remove-module-deps.patch new file mode 100644 index 00000000000000..1d9d31f011d72b --- /dev/null +++ b/recipes/cpython/all/patches/3.12/3.12.1-0002-remove-module-deps.patch @@ -0,0 +1,50 @@ +diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln +index bdddec60da..f6a30955bf 100644 +--- a/PCbuild/pcbuild.sln ++++ b/PCbuild/pcbuild.sln +@@ -9,45 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution + EndProjectSection + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" +- ProjectSection(ProjectDependencies) = postProject +- {9E48B300-37D1-11DD-8C41-005056C00008} = {9E48B300-37D1-11DD-8C41-005056C00008} +- {9EC7190A-249F-4180-A900-548FDCF3055F} = {9EC7190A-249F-4180-A900-548FDCF3055F} +- {78D80A15-BD8C-44E2-B49E-1F05B0A0A687} = {78D80A15-BD8C-44E2-B49E-1F05B0A0A687} +- {6901D91C-6E48-4BB7-9FEC-700C8131DF1D} = {6901D91C-6E48-4BB7-9FEC-700C8131DF1D} +- {54B1431F-B86B-4ACB-B28C-88BCF93191D8} = {54B1431F-B86B-4ACB-B28C-88BCF93191D8} +- {F749B822-B489-4CA5-A3AD-CE078F5F338A} = {F749B822-B489-4CA5-A3AD-CE078F5F338A} +- {D06B6426-4762-44CC-8BAD-D79052507F2F} = {D06B6426-4762-44CC-8BAD-D79052507F2F} +- {36D0C52C-DF4E-45D0-8BC7-E294C3ABC781} = {36D0C52C-DF4E-45D0-8BC7-E294C3ABC781} +- {CB435430-EBB1-478B-8F4E-C256F6838F55} = {CB435430-EBB1-478B-8F4E-C256F6838F55} +- {17E1E049-C309-4D79-843F-AE483C264AEA} = {17E1E049-C309-4D79-843F-AE483C264AEA} +- {384C224A-7474-476E-A01B-750EA7DE918C} = {384C224A-7474-476E-A01B-750EA7DE918C} +- {12728250-16EC-4DC6-94D7-E21DD88947F8} = {12728250-16EC-4DC6-94D7-E21DD88947F8} +- {86937F53-C189-40EF-8CE8-8759D8E7D480} = {86937F53-C189-40EF-8CE8-8759D8E7D480} +- {28B5D777-DDF2-4B6B-B34F-31D938813856} = {28B5D777-DDF2-4B6B-B34F-31D938813856} +- {31FFC478-7B4A-43E8-9954-8D03E2187E9C} = {31FFC478-7B4A-43E8-9954-8D03E2187E9C} +- {F9D71780-F393-11E0-BE50-0800200C9A66} = {F9D71780-F393-11E0-BE50-0800200C9A66} +- {494BAC80-A60C-43A9-99E7-ACB691CE2C4D} = {494BAC80-A60C-43A9-99E7-ACB691CE2C4D} +- {C6E20F84-3247-4AD6-B051-B073268F73BA} = {C6E20F84-3247-4AD6-B051-B073268F73BA} +- {B244E787-C445-441C-BDF4-5A4F1A3A1E51} = {B244E787-C445-441C-BDF4-5A4F1A3A1E51} +- {18CAE28C-B454-46C1-87A0-493D91D97F03} = {18CAE28C-B454-46C1-87A0-493D91D97F03} +- {13CECB97-4119-4316-9D42-8534019A5A44} = {13CECB97-4119-4316-9D42-8534019A5A44} +- {885D4898-D08D-4091-9C40-C700CFE3FC5A} = {885D4898-D08D-4091-9C40-C700CFE3FC5A} +- {447F05A8-F581-4CAC-A466-5AC7936E207E} = {447F05A8-F581-4CAC-A466-5AC7936E207E} +- {ECC7CEAC-A5E5-458E-BB9E-2413CC847881} = {ECC7CEAC-A5E5-458E-BB9E-2413CC847881} +- {4946ECAC-2E69-4BF8-A90A-F5136F5094DF} = {4946ECAC-2E69-4BF8-A90A-F5136F5094DF} +- {FDB84CBB-2FB6-47C8-A2D6-091E0833239D} = {FDB84CBB-2FB6-47C8-A2D6-091E0833239D} +- {73FCD2BD-F133-46B7-8EC1-144CD82A59D5} = {73FCD2BD-F133-46B7-8EC1-144CD82A59D5} +- {2097F1C1-597C-4167-93E3-656A7D6339B2} = {2097F1C1-597C-4167-93E3-656A7D6339B2} +- {A2697BD3-28C1-4AEC-9106-8B748639FD16} = {A2697BD3-28C1-4AEC-9106-8B748639FD16} +- {900342D7-516A-4469-B1AD-59A66E49A25F} = {900342D7-516A-4469-B1AD-59A66E49A25F} +- {6DAC66D9-E703-4624-BE03-49112AB5AA62} = {6DAC66D9-E703-4624-BE03-49112AB5AA62} +- {0E9791DB-593A-465F-98BC-681011311617} = {0E9791DB-593A-465F-98BC-681011311617} +- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} +- {EB6E69DD-04BF-4543-9B92-49FAABCEAC2E} = {EB6E69DD-04BF-4543-9B92-49FAABCEAC2E} +- {16BFE6F0-22EF-40B5-B831-7E937119EF10} = {16BFE6F0-22EF-40B5-B831-7E937119EF10} +- {FCBE1EF2-E0F0-40B1-88B5-00A35D378742} = {FCBE1EF2-E0F0-40B1-88B5-00A35D378742} +- {A840DDFB-ED50-484B-B527-B32E7CF90FD5} = {A840DDFB-ED50-484B-B527-B32E7CF90FD5} +- EndProjectSection + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" + ProjectSection(ProjectDependencies) = postProject diff --git a/recipes/cpython/all/patches/3.7.9-0001-msvc.patch b/recipes/cpython/all/patches/3.7.9-0001-msvc.patch deleted file mode 100644 index 29be01b13f5b59..00000000000000 --- a/recipes/cpython/all/patches/3.7.9-0001-msvc.patch +++ /dev/null @@ -1,416 +0,0 @@ ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -58,2 +58,0 @@ --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" --EndProject ---- PCbuild/python.vcxproj -+++ PCbuild/python.vcxproj -@@ -85,1 +85,1 @@ -- -+ ---- PCbuild/_freeze_importlib.vcxproj -+++ PCbuild/_freeze_importlib.vcxproj -@@ -110,1 +110,1 @@ -- -+ --> ---- PCbuild/_bz2.vcxproj -+++ PCbuild/_bz2.vcxproj -@@ -39,7 +39,7 @@ - bz2 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -69,17 +69,17 @@ - - - -- -+ - - -- -- -+ - - - ---- PCbuild/_decimal.vcxproj -+++ PCbuild/_decimal.vcxproj -@@ -39,7 +39,7 @@ - _decimal - Win32Proj - -- -+ - - - DynamicLibrary -@@ -64,11 +64,11 @@ - _CRT_SECURE_NO_WARNINGS;MASM;%(PreprocessorDefinitions) - CONFIG_32;PPRO;%(PreprocessorDefinitions) - CONFIG_64;%(PreprocessorDefinitions) -- ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) -+ ..\Modules\_decimal;%(AdditionalIncludeDirectories) - - - -- -+ - - - -- -+ - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -39,7 +39,7 @@ - _elementtree - Win32Proj - -- -+ - - - DynamicLibrary -@@ -65,8 +65,8 @@ -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - -- -+ - - - -- -+ - - - ---- PCbuild/_lzma.vcxproj -+++ PCbuild/_lzma.vcxproj -@@ -39,7 +39,7 @@ - lzma - Win32Proj - -- -+ - - - DynamicLibrary -@@ -62,10 +62,10 @@ - - - $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) -- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) -+ $(ConanPreprocessorDefinitions);WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) - - -- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -79,10 +79,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -39,7 +39,7 @@ - _sqlite3 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -95,10 +95,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/openssl.vcxproj -+++ PCbuild/openssl.vcxproj -@@ -74,6 +74,6 @@ nmake - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -39,7 +39,7 @@ - {D06B6426-4762-44CC-8BAD-D79052507F2F} - pyexpat - -- -+ - - - DynamicLibrary -@@ -58,19 +58,19 @@ - - - -- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/pythoncore.vcxproj -+++ PCbuild/pythoncore.vcxproj -@@ -38,7 +38,7 @@ - {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} - pythoncore - -- -+ - - - DynamicLibrary -@@ -215,7 +215,7 @@ - - - -- -+ - - - -@@ -409,7 +409,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -39,7 +39,7 @@ - _hashlib - Win32Proj - -- -+ - - - DynamicLibrary -@@ -54,7 +54,7 @@ - - - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -39,7 +39,7 @@ - _ssl - Win32Proj - -- -+ - - - DynamicLibrary -@@ -54,7 +54,7 @@ - - - -- -+ - - - -@@ -67,9 +67,9 @@ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -61,12 +61,12 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) -- Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) -+ - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -76,10 +76,10 @@ - - - -- -+ - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -9,9 +9,6 @@ - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" -- ProjectSection(ProjectDependencies) = postProject -- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} -- EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" - EndProject diff --git a/recipes/cpython/all/patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch b/recipes/cpython/all/patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch deleted file mode 100644 index 92e44c8ea6ee5e..00000000000000 --- a/recipes/cpython/all/patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.pre.in -+++ Makefile.pre.in -@@ -618,10 +618,10 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/recipes/cpython/all/patches/3.7.9-0003-disable-macos-tcltk.patch b/recipes/cpython/all/patches/3.7.9-0003-disable-macos-tcltk.patch deleted file mode 100644 index f5ffba2f61232a..00000000000000 --- a/recipes/cpython/all/patches/3.7.9-0003-disable-macos-tcltk.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- setup.py -+++ setup.py -@@ -1829,9 +1829,9 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (host_platform == 'darwin' and -- self.detect_tkinter_darwin(inc_dirs, lib_dirs)): -- return -+ #if (host_platform == 'darwin' and -+ # self.detect_tkinter_darwin(inc_dirs, lib_dirs)): -+ # return - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.8.12-0001-msvc.patch b/recipes/cpython/all/patches/3.8.12-0001-msvc.patch deleted file mode 100644 index 4e390810d2dde9..00000000000000 --- a/recipes/cpython/all/patches/3.8.12-0001-msvc.patch +++ /dev/null @@ -1,431 +0,0 @@ ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -60,2 +60,0 @@ --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" --EndProject ---- PCbuild/python.vcxproj -+++ PCbuild/python.vcxproj -@@ -118,1 +118,1 @@ -- -+ ---- PCbuild/_freeze_importlib.vcxproj -+++ PCbuild/_freeze_importlib.vcxproj -@@ -149,1 +149,1 @@ -- -+ --> ---- PCbuild/_bz2.vcxproj -+++ PCbuild/_bz2.vcxproj -@@ -71,7 +71,7 @@ - bz2 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -101,17 +101,17 @@ - - - -- -+ - - -- -- -+ - - - ---- PCbuild/_ctypes.vcxproj -+++ PCbuild/_ctypes.vcxproj -@@ -71,7 +71,7 @@ - _ctypes - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -94,7 +94,7 @@ - - - -- FFI_BUILDING;%(PreprocessorDefinitions) -+ %(PreprocessorDefinitions) - - - /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) ---- PCbuild/_decimal.vcxproj -+++ PCbuild/_decimal.vcxproj -@@ -71,7 +71,7 @@ - _decimal - Win32Proj - -- -+ - - - DynamicLibrary -@@ -98,11 +98,11 @@ - CONFIG_32;ANSI;%(PreprocessorDefinitions) - CONFIG_64;ANSI;%(PreprocessorDefinitions) - CONFIG_64;%(PreprocessorDefinitions) -- ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) -+ ..\Modules\_decimal;%(AdditionalIncludeDirectories) - - - -- -+ - - - -- -+ - - -- -+ - - - ---- PCbuild/_lzma.vcxproj -+++ PCbuild/_lzma.vcxproj -@@ -71,7 +71,7 @@ - lzma - Win32Proj - -- -+ - - - DynamicLibrary -@@ -94,10 +94,10 @@ - - - $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) -- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) -+ $(ConanPreprocessorDefinitions);WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) - - -- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -111,10 +111,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -71,7 +71,7 @@ - _sqlite3 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -127,10 +127,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/pythoncore.vcxproj -+++ PCbuild/pythoncore.vcxproj -@@ -70,7 +70,7 @@ - {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} - pythoncore - -- -+ - - - DynamicLibrary -@@ -272,7 +272,7 @@ - - - -- -+ - - - -@@ -468,7 +468,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -71,7 +71,7 @@ - _hashlib - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -71,7 +71,7 @@ - _ssl - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -99,9 +99,9 @@ - - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -71,7 +71,7 @@ - _elementtree - Win32Proj - -- -+ - - - DynamicLibrary -@@ -93,12 +93,12 @@ - - - -- ..\Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - -- -+ - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -71,7 +71,7 @@ - {D06B6426-4762-44CC-8BAD-D79052507F2F} - pyexpat - -- -+ - - - DynamicLibrary -@@ -91,18 +91,18 @@ - - - $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) -+ _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -77,7 +77,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -93,12 +93,12 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) -- Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) -+ - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -108,10 +108,10 @@ - - - -- -+ - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -9,9 +9,6 @@ - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" -- ProjectSection(ProjectDependencies) = postProject -- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} -- EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" - EndProject diff --git a/recipes/cpython/all/patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch b/recipes/cpython/all/patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch deleted file mode 100644 index 21527d0ed307f3..00000000000000 --- a/recipes/cpython/all/patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.pre.in -+++ Makefile.pre.in -@@ -606,10 +606,10 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/recipes/cpython/all/patches/3.8.12-0004-disable-macos-tcltk.patch b/recipes/cpython/all/patches/3.8.12-0004-disable-macos-tcltk.patch deleted file mode 100644 index 90af822b580708..00000000000000 --- a/recipes/cpython/all/patches/3.8.12-0004-disable-macos-tcltk.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- setup.py -+++ setup.py -@@ -1838,8 +1838,8 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (MACOS and self.detect_tkinter_darwin()): -- return True -+ #if (MACOS and self.detect_tkinter_darwin()): -+ # return True - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.8.12-0002-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.8/3.8.12-0002-_ctypes-ffi.patch similarity index 100% rename from recipes/cpython/all/patches/3.8.12-0002-_ctypes-ffi.patch rename to recipes/cpython/all/patches/3.8/3.8.12-0002-_ctypes-ffi.patch diff --git a/recipes/cpython/all/patches/3.9.7-0001-msvc.patch b/recipes/cpython/all/patches/3.9.7-0001-msvc.patch deleted file mode 100644 index fac9247123880b..00000000000000 --- a/recipes/cpython/all/patches/3.9.7-0001-msvc.patch +++ /dev/null @@ -1,434 +0,0 @@ ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -60,2 +60,0 @@ --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" --EndProject ---- PCbuild/python.vcxproj -+++ PCbuild/python.vcxproj -@@ -118,1 +118,1 @@ -- -+ ---- PCbuild/_freeze_importlib.vcxproj -+++ PCbuild/_freeze_importlib.vcxproj -@@ -149,1 +149,1 @@ -- -+ --> ---- PCbuild/_bz2.vcxproj -+++ PCbuild/_bz2.vcxproj -@@ -71,7 +71,7 @@ - bz2 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -101,17 +101,17 @@ - - - -- -+ - - -- -- -+ - - - ---- PCbuild/_ctypes.vcxproj -+++ PCbuild/_ctypes.vcxproj -@@ -71,7 +71,7 @@ - _ctypes - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -94,7 +94,7 @@ - - - -- FFI_BUILDING;%(PreprocessorDefinitions) -+ %(PreprocessorDefinitions) - - - /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) ---- PCbuild/_decimal.vcxproj -+++ PCbuild/_decimal.vcxproj -@@ -71,7 +71,7 @@ - _decimal - Win32Proj - -- -+ - - - DynamicLibrary -@@ -98,11 +98,11 @@ - CONFIG_32;ANSI;%(PreprocessorDefinitions) - CONFIG_64;ANSI;%(PreprocessorDefinitions) - CONFIG_64;%(PreprocessorDefinitions) -- ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) -+ ..\Modules\_decimal;%(AdditionalIncludeDirectories) - - - -- -+ - - - -- -+ - - -- -+ - - - ---- PCbuild/_lzma.vcxproj -+++ PCbuild/_lzma.vcxproj -@@ -71,7 +71,7 @@ - lzma - Win32Proj - -- -+ - - - DynamicLibrary -@@ -94,10 +94,10 @@ - - - $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) -- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) -+ $(ConanPreprocessorDefinitions);WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) - - -- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -111,10 +111,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -71,7 +71,7 @@ - _sqlite3 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -127,10 +127,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/pythoncore.vcxproj -+++ PCbuild/pythoncore.vcxproj -@@ -70,7 +70,7 @@ - {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} - pythoncore - -- -+ - - - DynamicLibrary -@@ -295,7 +295,7 @@ - - - -- -+ - - - -@@ -497,7 +497,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -71,7 +71,7 @@ - _hashlib - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -71,7 +71,7 @@ - _ssl - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -99,9 +99,9 @@ - - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -71,7 +71,7 @@ - _elementtree - Win32Proj - -- -+ - - - DynamicLibrary -@@ -93,12 +93,12 @@ - - - -- ..\Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - -- -+ - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -71,7 +71,7 @@ - {D06B6426-4762-44CC-8BAD-D79052507F2F} - pyexpat - -- -+ - - - DynamicLibrary -@@ -90,19 +90,19 @@ - - - -- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -77,7 +77,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -93,12 +93,12 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) -- Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) -+ - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -108,10 +108,10 @@ - - - -- -+ - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -9,9 +9,6 @@ - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" -- ProjectSection(ProjectDependencies) = postProject -- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} -- EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" - EndProject diff --git a/recipes/cpython/all/patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch b/recipes/cpython/all/patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch deleted file mode 100644 index 0bec735b3653d4..00000000000000 --- a/recipes/cpython/all/patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.pre.in -+++ Makefile.pre.in -@@ -630,10 +630,10 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/recipes/cpython/all/patches/3.9.7-0005-disable-macos-tcltk.patch b/recipes/cpython/all/patches/3.9.7-0005-disable-macos-tcltk.patch deleted file mode 100644 index 68a48853b30894..00000000000000 --- a/recipes/cpython/all/patches/3.9.7-0005-disable-macos-tcltk.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- setup.py -+++ setup.py -@@ -1986,8 +1986,8 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (MACOS and self.detect_tkinter_darwin()): -- return True -+ #if (MACOS and self.detect_tkinter_darwin()): -+ # return True - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.9.7-0002-_msi-vcxproj.patch b/recipes/cpython/all/patches/3.9/3.9.7-0002-_msi-vcxproj.patch similarity index 100% rename from recipes/cpython/all/patches/3.9.7-0002-_msi-vcxproj.patch rename to recipes/cpython/all/patches/3.9/3.9.7-0002-_msi-vcxproj.patch diff --git a/recipes/cpython/all/patches/3.9.7-0003-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.9/3.9.7-0003-_ctypes-ffi.patch similarity index 100% rename from recipes/cpython/all/patches/3.9.7-0003-_ctypes-ffi.patch rename to recipes/cpython/all/patches/3.9/3.9.7-0003-_ctypes-ffi.patch diff --git a/recipes/cpython/all/patches/3.x-0002-remove-module-deps.patch b/recipes/cpython/all/patches/3.x-0002-remove-module-deps.patch new file mode 100644 index 00000000000000..38a642520abb1b --- /dev/null +++ b/recipes/cpython/all/patches/3.x-0002-remove-module-deps.patch @@ -0,0 +1,10 @@ +--- PCbuild/pcbuild.sln ++++ PCbuild/pcbuild.sln +@@ -9,7 +9,4 @@ + EndProjectSection + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" +- ProjectSection(ProjectDependencies) = postProject +- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} +- EndProjectSection + EndProject diff --git a/recipes/cpython/all/test_package/CMakeLists.txt b/recipes/cpython/all/test_package/CMakeLists.txt index 525329324757f6..0d333d99af1e31 100644 --- a/recipes/cpython/all/test_package/CMakeLists.txt +++ b/recipes/cpython/all/test_package/CMakeLists.txt @@ -1,15 +1,19 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() +find_package(cpython REQUIRED CONFIG) -set(CACHE PY_VERSION_MAJOR "" CACHE STRING "MAJOR version of python") -set(CACHE PY_VERSION_MAJOR_MINOR "" CACHE STRING "MAJOR.MINOR version of python") -set(CACHE PY_VERSION "" CACHE STRING "Required version of python") -set(CACHE PY_VERSION_SUFFIX "" CACHE STRING "Suffix of python") +# FIXME: We can't modify CMake's FindPython to link dependencies pulled by +# Conan, so here we just include them globally. This is mainly necessary for +# MacOS missing crypt.h, which is available at configure time (in the main recipe) +# but otherwise not at build time (in consumer packages). +link_libraries(cpython::python) -set(Python_ADDITIONAL_VERSIONS ${PY_VERSION}${PY_VERSION_SUFFIX} ${PY_VERSION_MAJOR_MINOR}${PY_VERSION_SUFFIX} ${PY_VERSION_MAJOR}${PY_VERSION_SUFFIX} ${PY_VERSION} ${PY_VERSION_MAJOR_MINOR} ${PY_VERSION_MAJOR}) +set(PY_VERSION_MAJOR_MINOR "" CACHE STRING "MAJOR.MINOR version of python") +set(PY_VERSION "" CACHE STRING "Required version of python") +set(PY_VERSION_SUFFIX "" CACHE STRING "Suffix of python") + +set(Python_ADDITIONAL_VERSIONS ${PY_VERSION}${PY_VERSION_SUFFIX} ${PY_VERSION_MAJOR_MINOR}${PY_VERSION_SUFFIX} 3${PY_VERSION_SUFFIX} ${PY_VERSION} ${PY_VERSION_MAJOR_MINOR} 3) message("Using Python_ADDITIONAL_VERSIONS: ${Python_ADDITIONAL_VERSIONS}") find_package(PythonInterp REQUIRED) @@ -22,7 +26,6 @@ endif() message(STATUS "FindPythonInterp:") message(STATUS "PYTHON_VERSION_STRING: ${PYTHON_VERSION_STRING}") -message(STATUS "PYTHON_VERSION_MAJOR: ${PYTHON_VERSION_MAJOR}") message(STATUS "PYTHON_VERSION_MINOR: ${PYTHON_VERSION_MINOR}") message(STATUS "PYTHON_VERSION_PATCH: ${PYTHON_VERSION_PATCH}") message(STATUS "=============================================") @@ -45,8 +48,8 @@ if(PYTHON_VERSION_STRING) endif() if(PYTHONLIBS_VERSION_STRING) - if(NOT PYTHONLIBS_VERSION_STRING STREQUAL "${PY_FULL_VERSION}") - message("PYTHONLIBS_VERSION_STRING does not match PY_FULL_VERSION") + if(NOT PYTHONLIBS_VERSION_STRING STREQUAL "${PY_VERSION}") + message("PYTHONLIBS_VERSION_STRING does not match PY_VERSION") message(FATAL_ERROR "CMake detected wrong cpython version") endif() endif() @@ -54,7 +57,7 @@ endif() option(BUILD_MODULE "Build python module") if(BUILD_MODULE) - add_library(spam MODULE "py${PY_VERSION_MAJOR}/test_module.c") + add_library(spam MODULE "test_module.c") target_include_directories(spam PRIVATE ${PYTHON_INCLUDE_DIRS} @@ -64,37 +67,29 @@ if(BUILD_MODULE) ) set_property(TARGET spam PROPERTY PREFIX "") if(MSVC) - if(CONAN_SETTINGS_BUILD_TYPE STREQUAL "Debug") - set(SUFFIX "_d.pyd") - else() - set(SUFFIX ".pyd") - endif() - set_property(TARGET spam PROPERTY SUFFIX "${SUFFIX}") + set_target_properties(spam PROPERTIES + DEBUG_POSTFIX "_d" + SUFFIX ".pyd" + ) endif() option(USE_FINDPYTHON_X "Use new-style FindPythonX module") - if(USE_FINDPYTHON_X AND NOT (CMAKE_VERSION VERSION_LESS "3.16")) - # Require CMake 3.16 because this version introduces Python${PY_VERSION_MAJOR}_FIND_ABI - find_package(Python${PY_VERSION_MAJOR} REQUIRED COMPONENTS Interpreter Development) - message("Python${PY_VERSION_MAJOR}_EXECUTABLE: ${Python${PY_VERSION_MAJOR}_EXECUTABLE}") - message("Python${PY_VERSION_MAJOR}_INTERPRETER_ID: ${Python${PY_VERSION_MAJOR}_INTERPRETER_ID}") - message("Python${PY_VERSION_MAJOR}_VERSION: ${Python${PY_VERSION_MAJOR}_VERSION}") - message("Python${PY_VERSION_MAJOR}_INCLUDE_DIRS: ${Python${PY_VERSION_MAJOR}_INCLUDE_DIRS}") - message("Python${PY_VERSION_MAJOR}_LIBRARIES: ${Python${PY_VERSION_MAJOR}_LIBRARIES}") - if(NOT Python${PY_VERSION_MAJOR}_VERSION STREQUAL "${PY_VERSION}") + if(USE_FINDPYTHON_X AND NOT CMAKE_VERSION VERSION_LESS "3.16") + # Require CMake 3.16 because this version introduces Python3_FIND_ABI + find_package(Python3 REQUIRED COMPONENTS Interpreter Development) + message("Python3_EXECUTABLE: ${Python3_EXECUTABLE}") + message("Python3_INTERPRETER_ID: ${Python3_INTERPRETER_ID}") + message("Python3_VERSION: ${Python3_VERSION}") + message("Python3_INCLUDE_DIRS: ${Python3_INCLUDE_DIRS}") + message("Python3_LIBRARIES: ${Python3_LIBRARIES}") + if(NOT Python3_VERSION STREQUAL "${PY_VERSION}") message("Python_ADDITIONAL_VERSIONS does not match PY_VERSION") message(FATAL_ERROR "CMake detected wrong cpython version") endif() - if(PY_VERSION_MAJOR STREQUAL "2") - python2_add_library(spam2 "py${PY_VERSION_MAJOR}/test_module.c") - elseif(PY_VERSION_MAJOR STREQUAL "3") - python3_add_library(spam2 "py${PY_VERSION_MAJOR}/test_module.c") - else() - message(FATAL_ERROR "Unknown PY_VERSION_MAJOR") - endif() + python3_add_library(spam2 "test_module.c") endif() endif() -add_executable(${PROJECT_NAME} "py${PY_VERSION_MAJOR}/test_package.c") -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_executable(${PROJECT_NAME} "test_package.c") +target_link_libraries(${PROJECT_NAME} PRIVATE cpython::embed) diff --git a/recipes/cpython/all/test_package/conanfile.py b/recipes/cpython/all/test_package/conanfile.py index 8abc18e4492c5f..14cdda464a3d67 100644 --- a/recipes/cpython/all/test_package/conanfile.py +++ b/recipes/cpython/all/test_package/conanfile.py @@ -1,192 +1,202 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, CMake, tools, RunEnvironment -from conans.errors import ConanException -from io import StringIO import os -import re -import shutil +from io import StringIO +from conan import ConanFile, conan_version +from conan.errors import ConanException +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import Environment, VirtualRunEnv +from conan.tools.gnu import AutotoolsDeps +from conan.tools.microsoft import is_msvc, VCVars +from conan.tools.scm import Version -class CmakePython3Abi(object): - def __init__(self, debug, pymalloc, unicode): - self.debug, self.pymalloc, self.unicode = debug, pymalloc, unicode +conan2 = conan_version.major >= 2 - _cmake_lut = { - None: "ANY", - True: "ON", - False: "OFF", - } +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" - @property - def suffix(self): - return "{}{}{}".format( - "d" if self.debug else "", - "m" if self.pymalloc else "", - "u" if self.unicode else "", - ) + def requirements(self): + self.requires(self.tested_reference_str) - @property - def cmake_arg(self): - return ";".join(self._cmake_lut[a] for a in (self.debug, self.pymalloc, self.unicode)) + def build_requirements(self): + # The main recipe does not require CMake, but we test with it. + # The interesting problem that arises here is if you have CMake installed + # with your global pip, then it will fail to run in this test package. + # To avoid that, just add a requirement on CMake. + self.tool_requires("cmake/[>=3.15 <4]") - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def layout(self): + cmake_layout(self) @property - def _py_version(self): - return re.match(r"^([0-9.]+)", self.deps_cpp_info["cpython"].version).group(1) + def _python(self): + if conan2: + return self.dependencies["cpython"].conf_info.get("user.cpython:python", check_type=str) + else: + return self.deps_user_info["cpython"].python - @property - def _pymalloc(self): - return bool("pymalloc" in self.options["cpython"] and self.options["cpython"].pymalloc) + def _cpython_option(self, name): + if conan2: + return self.dependencies["cpython"].options.get_safe(name, False) + else: + try: + return getattr(self.options["cpython"], name, False) + except ConanException: + return False @property - def _cmake_abi(self): - if self._py_version < tools.Version("3.8"): - return CmakePython3Abi( - debug=self.settings.build_type == "Debug", - pymalloc=self._pymalloc, - unicode=False, - ) + def _py_version(self): + if conan2: + return Version(self.dependencies["cpython"].ref.version) else: - return CmakePython3Abi( - debug=self.settings.build_type == "Debug", - pymalloc=False, - unicode=False, - ) + return Version(self.deps_cpp_info["cpython"].version) + + @property + def _test_setuptools(self): + # TODO Should we still try to test this? + # https://github.com/python/cpython/pull/101039 + return can_run(self) and self._supports_modules and self._py_version < "3.12" @property def _cmake_try_FindPythonX(self): - if self.settings.compiler == "Visual Studio" and self.settings.build_type == "Debug": - return False - return True + return not is_msvc(self) or self.settings.build_type != "Debug" @property def _supports_modules(self): - return self.settings.compiler != "Visual Studio" or self.options["cpython"].shared + return not is_msvc(self) or self._cpython_option("shared") + + def generate(self): + tc = CMakeToolchain(self) + version = self._py_version + tc.cache_variables["BUILD_MODULE"] = self._supports_modules + tc.cache_variables["PY_VERSION_MAJOR_MINOR"] = f"{version.major}.{version.minor}" + tc.cache_variables["PY_VERSION"] = str(self._py_version) + tc.cache_variables["PY_VERSION_SUFFIX"] = "d" if self.settings.build_type == "Debug" else "" + tc.cache_variables["PYTHON_EXECUTABLE"] = self._python + tc.cache_variables["USE_FINDPYTHON_X"] = self._cmake_try_FindPythonX + tc.cache_variables["Python3_EXECUTABLE"] = self._python + tc.cache_variables["Python3_ROOT_DIR"] = self.dependencies["cpython"].package_folder + tc.cache_variables["Python3_USE_STATIC_LIBS"] = not self.dependencies["cpython"].options.shared + tc.cache_variables["Python3_FIND_FRAMEWORK"] = "NEVER" + tc.cache_variables["Python3_FIND_REGISTRY"] = "NEVER" + tc.cache_variables["Python3_FIND_IMPLEMENTATIONS"] = "CPython" + tc.cache_variables["Python3_FIND_STRATEGY"] = "LOCATION" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() - def build(self): - if not tools.cross_building(self, skip_x64_x86=True): - command = "{} --version".format(self.deps_user_info["cpython"].python) - buffer = StringIO() - self.run(command, output=buffer, ignore_errors=True, run_environment=True) - self.output.info("output: %s" % buffer.getvalue()) - self.run(command, run_environment=True) + try: + # CMakeToolchain might generate VCVars, but we need it + # unconditionally for the setuptools build. + VCVars(self).generate() + except ConanException: + pass + + # The build also needs access to the run environment to run the python executable + VirtualRunEnv(self).generate(scope="run") + VirtualRunEnv(self).generate(scope="build") + if self._test_setuptools: + # Just for the distutils build + AutotoolsDeps(self).generate(scope="build") + + def build(self): cmake = CMake(self) - py_major = self.deps_cpp_info["cpython"].version.split(".")[0] - cmake.definitions["BUILD_MODULE"] = self._supports_modules - cmake.definitions["PY_VERSION_MAJOR"] = py_major - cmake.definitions["PY_VERSION_MAJOR_MINOR"] = ".".join(self._py_version.split(".")[:2]) - cmake.definitions["PY_FULL_VERSION"] = self.deps_cpp_info["cpython"].version - cmake.definitions["PY_VERSION"] = self._py_version - cmake.definitions["PY_VERSION_SUFFIX"] = self._cmake_abi.suffix - cmake.definitions["PYTHON_EXECUTABLE"] = self.deps_user_info["cpython"].python - cmake.definitions["USE_FINDPYTHON_X".format(py_major)] = self._cmake_try_FindPythonX - cmake.definitions["Python{}_EXECUTABLE".format(py_major)] = self.deps_user_info["cpython"].python - cmake.definitions["Python{}_ROOT_DIR".format(py_major)] = self.deps_cpp_info["cpython"].rootpath - cmake.definitions["Python{}_USE_STATIC_LIBS".format(py_major)] = not self.options["cpython"].shared - cmake.definitions["Python{}_FIND_FRAMEWORK".format(py_major)] = "NEVER" - cmake.definitions["Python{}_FIND_REGISTRY".format(py_major)] = "NEVER" - cmake.definitions["Python{}_FIND_IMPLEMENTATIONS".format(py_major)] = "CPython" - cmake.definitions["Python{}_FIND_STRATEGY".format(py_major)] = "LOCATION" - - if self.settings.compiler != "Visual Studio": - if tools.Version(self._py_version) < tools.Version("3.8"): - cmake.definitions["Python{}_FIND_ABI".format(py_major)] = self._cmake_abi.cmake_arg - - with tools.environment_append(RunEnvironment(self).vars): - cmake.configure() + cmake.configure() cmake.build() - if not tools.cross_building(self, skip_x64_x86=True): - if self._supports_modules: - with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): - modsrcfolder = "py2" if tools.Version(self.deps_cpp_info["cpython"].version).major < "3" else "py3" - tools.mkdir(os.path.join(self.build_folder, modsrcfolder)) - for fn in os.listdir(os.path.join(self.source_folder, modsrcfolder)): - shutil.copy(os.path.join(self.source_folder, modsrcfolder, fn), os.path.join(self.build_folder, modsrcfolder, fn)) - shutil.copy(os.path.join(self.source_folder, "setup.py"), os.path.join(self.build_folder, "setup.py")) - env = { - "DISTUTILS_USE_SDK": "1", - "MSSdk": "1" - } - env.update(**AutoToolsBuildEnvironment(self).vars) - with tools.environment_append(env): - setup_args = [ - "{}/setup.py".format(self.source_folder), - # "conan", - # "--install-folder", self.build_folder, - "build", - "--build-base", self.build_folder, - "--build-platlib", os.path.join(self.build_folder, "lib_setuptools"), - ] - if self.settings.build_type == "Debug": - setup_args.append("--debug") - self.run("{} {}".format(self.deps_user_info["cpython"].python, " ".join("\"{}\"".format(a) for a in setup_args)), run_environment=True) + if self._test_setuptools: + os.environ["DISTUTILS_USE_SDK"] = "1" + os.environ["MSSdk"] = "1" + setup_args = [ + os.path.join(self.source_folder, "setup.py"), + "build", + "--build-base", self.build_folder, + "--build-platlib", os.path.join(self.build_folder, "lib_setuptools"), + # Bandaid fix: setuptools places temporary files in a subdirectory of the build folder where the + # entirety of the absolute path up to this folder is appended (with seemingly no way to stop this), + # essentially doubling the path length. This may run into Windows max path lengths, so we give ourselves + # a little bit of wiggle room by making this directory name as short as possible. One of the directory + # names goes from (for example) "temp.win-amd64-3.10-pydebug" to "t", saving us roughly 25 characters. + "--build-temp", "t", + ] + if self.settings.build_type == "Debug": + setup_args.append("--debug") + args = " ".join(f'"{a}"' for a in setup_args) + self.run(f"{self._python} {args}") def _test_module(self, module, should_work): try: - self.run("{} {}/test_package.py -b {} -t {} ".format( - self.deps_user_info["cpython"].python, self.source_folder, self.build_folder, module), run_environment=True) - works = True - except ConanException as e: - works = False - exception = e - if should_work == works: - self.output.info("Result of test was expected.") - else: - if works: - raise ConanException("Module '{}' works, but should not have worked".format(module)) - else: - self.output.warn("Module '{}' does not work, but should have worked".format(module)) - raise exception - - def _cpython_option(self, name): - try: - return getattr(self.options["cpython"], name, False) + self.run(f"{self._python} \"{self.source_folder}/test_package.py\" -b \"{self.build_folder}\" -t {module}", env="conanrun") except ConanException: - return False + if should_work: + self.output.warning(f"Module '{module}' does not work, but should have worked") + raise + self.output.info("Module failed as expected") + return + if not should_work: + raise ConanException(f"Module '{module}' works, but should not have worked") + self.output.info("Module worked as expected") def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - self.run("{} -c \"print('hello world')\"".format(self.deps_user_info["cpython"].python), run_environment=True) + if can_run(self): + self.run(f"{self._python} --version", env="conanrun") + + self.run(f"{self._python} -c \"print('hello world')\"", env="conanrun") buffer = StringIO() - self.run("{} -c \"import sys; print('.'.join(str(s) for s in sys.version_info[:3]))\"".format(self.deps_user_info["cpython"].python), run_environment=True, output=buffer) + self.run(f"{self._python} -c \"import sys; print('.'.join(str(s) for s in sys.version_info[:3]))\"", buffer, env="conanrun") self.output.info(buffer.getvalue()) version_detected = buffer.getvalue().splitlines()[-1].strip() if self._py_version != version_detected: - raise ConanException("python reported wrong version. Expected {exp}. Got {res}.".format(exp=self._py_version, res=version_detected)) + raise ConanException( + f"python reported wrong version. Expected {self._py_version}. Got {version_detected}." + ) if self._supports_modules: self._test_module("gdbm", self._cpython_option("with_gdbm")) self._test_module("bz2", self._cpython_option("with_bz2")) - self._test_module("bsddb", self._cpython_option("with_bsddb")) self._test_module("lzma", self._cpython_option("with_lzma")) self._test_module("tkinter", self._cpython_option("with_tkinter")) - with tools.environment_append({"TERM": "ansi"}): - self._test_module("curses", self._cpython_option("with_curses")) - + os.environ["TERM"] = "ansi" + self._test_module("curses", self._cpython_option("with_curses")) self._test_module("expat", True) - self._test_module("sqlite3", True) + self._test_module("sqlite3", self._cpython_option("with_sqlite3")) self._test_module("decimal", True) self._test_module("ctypes", True) - - if tools.is_apple_os(self.settings.os) and not self.options["cpython"].shared: - self.output.info("Not testing the module, because these seem not to work on apple when cpython is built as a static library") + env = Environment() + if self.settings.os != "Windows": + env.define_path("OPENSSL_CONF", os.path.join(os.sep, "dev", "null")) + with env.vars(self).apply(): + self._test_module("ssl", True) + + if is_apple_os(self) and not self._cpython_option("shared"): + self.output.info( + "Not testing the module, because these seem not to work on apple when cpython is built as" + " a static library" + ) # FIXME: find out why cpython on apple does not allow to use modules linked against a static python else: if self._supports_modules: - with tools.environment_append({"PYTHONPATH": [os.path.join(self.build_folder, "lib")]}): - self.output.info("Testing module (spam) using cmake built module") - self._test_module("spam", True) + os.environ["PYTHONPATH"] = os.path.join(self.build_folder, self.cpp.build.libdirs[0]) + self.output.info("Testing module (spam) using cmake built module") + self._test_module("spam", True) - with tools.environment_append({"PYTHONPATH": [os.path.join(self.build_folder, "lib_setuptools")]}): + if self._test_setuptools: + os.environ["PYTHONPATH"] = os.path.join(self.build_folder, "lib_setuptools") self.output.info("Testing module (spam) using setup.py built module") self._test_module("spam", True) - # MSVC builds need PYTHONHOME set. - with tools.environment_append({"PYTHONHOME": self.deps_user_info["cpython"].pythonhome}) if self.deps_user_info["cpython"].module_requires_pythonhome == "True" else tools.no_op(): - self.run(os.path.join("bin", "test_package"), run_environment=True) + del os.environ["PYTHONPATH"] + + # MSVC builds need PYTHONHOME set. Linux and Mac don't require it to be set if tested after building, + # but if the package is relocated then it needs to be set. + if conan2: + os.environ["PYTHONHOME"] = self.dependencies["cpython"].conf_info.get("user.cpython:pythonhome", check_type=str) + else: + os.environ["PYTHONHOME"] = self.deps_user_info["cpython"].pythonhome + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cpython/all/test_package/py2/test_module.c b/recipes/cpython/all/test_package/py2/test_module.c deleted file mode 100644 index 9c5af39ab391b2..00000000000000 --- a/recipes/cpython/all/test_package/py2/test_module.c +++ /dev/null @@ -1,42 +0,0 @@ -#include - -#include - -static PyObject *SpamError; - -static PyObject * -spam_system(PyObject *self, PyObject *args) -{ - const char *command; - int sts; - - if (!PyArg_ParseTuple(args, "s", &command)) - return NULL; - sts = system(command); - if (sts < 0) { - PyErr_SetString(SpamError, "System command failed"); - return NULL; - } - return PyLong_FromLong(sts); -} - -const char spam_doc[] = "This is an example spam doc."; - -static PyMethodDef SpamMethods[] = { - {"system", spam_system, METH_VARARGS, "Execute a shell command."}, - {NULL, NULL, 0, NULL} /* Sentinel */ -}; - -PyMODINIT_FUNC -initspam(void) -{ - PyObject *m; - - m = Py_InitModule("spam", SpamMethods); - if (m == NULL) - return; - PyModule_AddStringConstant(m, "__doc__", spam_doc); - SpamError = PyErr_NewException("spam.error", NULL, NULL); - Py_INCREF(SpamError); - PyModule_AddObject(m, "error", SpamError); -} diff --git a/recipes/cpython/all/test_package/py2/test_package.c b/recipes/cpython/all/test_package/py2/test_package.c deleted file mode 100644 index 5e5d839b5a6a14..00000000000000 --- a/recipes/cpython/all/test_package/py2/test_package.c +++ /dev/null @@ -1,12 +0,0 @@ -#include - -int -main(int argc, char *argv[]) -{ - Py_SetProgramName(argv[0]); /* optional but recommended */ - Py_Initialize(); - PyRun_SimpleString("from time import time,ctime\n" - "print 'Today is',ctime(time())\n"); - Py_Finalize(); - return 0; -} diff --git a/recipes/cpython/all/test_package/setup.py b/recipes/cpython/all/test_package/setup.py index cd1754cef81310..2cf4febef6264d 100644 --- a/recipes/cpython/all/test_package/setup.py +++ b/recipes/cpython/all/test_package/setup.py @@ -1,5 +1,4 @@ import os -import sys # Hack to work around Python 3.8+ secure dll loading: # see https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew @@ -8,24 +7,14 @@ if os.path.isdir(directory): os.add_dll_directory(directory) -PY2 = (2, 0) <= sys.version_info < (3, 0) -PY3 = (3, 0) <= sys.version_info < (4, 0) - -if PY2: - subdir = "py2" - from distutils.core import setup, Extension -elif PY3: - subdir = "py3" - from setuptools import setup, Extension -else: - raise Exception +from setuptools import setup, Extension +script_dir = os.path.dirname(os.path.realpath(__file__)) setup( name="test_package", version="1.0", - use_2to3=True, ext_modules=[ - Extension("spam", [os.path.join(subdir, "test_module.c")]), + Extension("spam", [os.path.join(script_dir, "test_module.c")]), ], ) diff --git a/recipes/cpython/all/test_package/py3/test_module.c b/recipes/cpython/all/test_package/test_module.c similarity index 100% rename from recipes/cpython/all/test_package/py3/test_module.c rename to recipes/cpython/all/test_package/test_module.c diff --git a/recipes/cpython/all/test_package/py3/test_package.c b/recipes/cpython/all/test_package/test_package.c similarity index 88% rename from recipes/cpython/all/test_package/py3/test_package.c rename to recipes/cpython/all/test_package/test_package.c index f5dfe41cd757ca..cf1688e39502a2 100644 --- a/recipes/cpython/all/test_package/py3/test_package.c +++ b/recipes/cpython/all/test_package/test_package.c @@ -9,7 +9,6 @@ main(int argc, char *argv[]) fprintf(stderr, "Fatal error: cannot decode argv[0]\n"); exit(1); } - Py_SetProgramName(program); /* optional but recommended */ Py_Initialize(); PyRun_SimpleString("from time import time, ctime\n" "print('Today is', ctime(time()))\n"); diff --git a/recipes/cpython/all/test_package/test_package.py b/recipes/cpython/all/test_package/test_package.py index f77d2837c6376a..bed43fac74c62b 100644 --- a/recipes/cpython/all/test_package/test_package.py +++ b/recipes/cpython/all/test_package/test_package.py @@ -14,12 +14,13 @@ def add_test(fn): global ALL_TESTS - name = fn.__name__[fn.__name__.find("_")+1:] + name = fn.__name__[fn.__name__.find("_") + 1 :] def inner_fn(): print("testing {}".format(name)) sys.stdout.flush() fn() + ALL_TESTS[name] = inner_fn return fn @@ -30,13 +31,13 @@ def test_expat(): # 3 handler functions def start_element(name, attrs): - print('Start element:', name, attrs) + print("Start element:", name, attrs) def end_element(name): - print('End element:', name) + print("End element:", name) def char_data(data): - print('Character data:', repr(data)) + print("Character data:", repr(data)) p = xml.parsers.expat.ParserCreate() @@ -44,18 +45,18 @@ def char_data(data): p.EndElementHandler = end_element p.CharacterDataHandler = char_data - p.Parse(""" + p.Parse( + """ Text goes here More text - """, 1) + """, + 1, + ) @add_test def test_gdbm(): - if sys.version_info < (3, 0): - import gdbm - else: - import dbm.gnu as gdbm + import dbm.gnu as gdbm dbfile = "gdbm.db" @@ -85,10 +86,8 @@ def test_spam(): if "This is an example spam doc." not in spam.__doc__: raise Exception("spam.__doc__ does not contain the expected text") - cmd = { - "Windows": "dir", - }.get(platform.system(), "ls") - print("About to run spam.system(\"{}\")".format(cmd)) + cmd = {"Windows": "dir"}.get(platform.system(), "ls") + print('About to run spam.system("{}")'.format(cmd)) sys.stdout.flush() spam.system(cmd) @@ -103,24 +102,6 @@ def test_bz2(): raise Exception("bz2.compress returned no data") -@add_test -def test_bsddb(): - import bsddb - - db = bsddb.btopen("bsddb.db", "c") - db["key1"] = "value1" - db["key2"] = "value2" - db.close() - - db = bsddb.btopen("bsddb.db", "r") - if len(db) != 2: - raise Exception("Wrong length") - if db["key1"] != "value1": - raise Exception("value1 incorrect {}".format(db["key1"])) - if db["key2"] != "value2": - raise Exception("value2 incorrect {}".format(db["key2"])) - - @add_test def test_lzma(): import lzma @@ -133,6 +114,7 @@ def test_lzma(): @add_test def test_sqlite3(): import sqlite3 + conn = sqlite3.connect("sqlite3.db") c = conn.cursor() @@ -141,16 +123,16 @@ def test_sqlite3(): c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)") conn.commit() - t = ('RHAT',) - c.execute('SELECT * FROM stocks WHERE symbol=?', t) + t = ("RHAT",) + c.execute("SELECT * FROM stocks WHERE symbol=?", t) # Larger example that inserts many records at a time purchases = [ - ('2006-03-28', 'BUY', 'IBM', 1000, 45.00), - ('2006-04-05', 'BUY', 'MSFT', 1000, 72.00), - ('2006-04-06', 'SELL', 'IBM', 500, 53.00), + ("2006-03-28", "BUY", "IBM", 1000, 45.00), + ("2006-04-05", "BUY", "MSFT", 1000, 72.00), + ("2006-04-06", "SELL", "IBM", 500, 53.00), ] - c.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases) + c.executemany("INSERT INTO stocks VALUES (?,?,?,?,?)", purchases) conn.commit() conn.close() conn = sqlite3.connect("sqlite3.db") @@ -161,15 +143,15 @@ def test_sqlite3(): raise Exception("Need 4 stocks") print(data) conn.close() + # Remove the file so subsequent tests don't fail + os.remove("sqlite3.db") @add_test def test_decimal(): - if sys.version_info >= (3, ): - # Check whether the _decimal package was built successfully - import _decimal as decimal - else: - import decimal + # Check whether the _decimal package was built successfully + import _decimal as decimal + decimal.getcontext().prec = 6 print("1/7 =", decimal.Decimal(1) / decimal.Decimal(7)) decimal.getcontext().prec = 40 @@ -199,6 +181,14 @@ def test_tkinter(): print("tk version: {}".format(_tkinter.TK_VERSION)) +@add_test +def test_ssl(): + import ssl + + default_context = ssl.create_default_context() + print("default_context.options={}".format(default_context.options)) + + def main(): parser = argparse.ArgumentParser() parser.add_argument("-b", dest="build_folder", help="build_folder", required=True) diff --git a/recipes/cpython/all/test_v1_package/CMakeLists.txt b/recipes/cpython/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..6014dcdd6efcb0 --- /dev/null +++ b/recipes/cpython/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,96 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +set(CACHE PY_VERSION_MAJOR "" CACHE STRING "MAJOR version of python") +set(CACHE PY_VERSION_MAJOR_MINOR "" CACHE STRING "MAJOR.MINOR version of python") +set(CACHE PY_VERSION "" CACHE STRING "Required version of python") +set(CACHE PY_VERSION_SUFFIX "" CACHE STRING "Suffix of python") + +set(Python_ADDITIONAL_VERSIONS ${PY_VERSION}${PY_VERSION_SUFFIX} ${PY_VERSION_MAJOR_MINOR}${PY_VERSION_SUFFIX} 3${PY_VERSION_SUFFIX} ${PY_VERSION} ${PY_VERSION_MAJOR_MINOR} 3) +message("Using Python_ADDITIONAL_VERSIONS: ${Python_ADDITIONAL_VERSIONS}") + +find_package(PythonInterp REQUIRED) +find_package(PythonLibs REQUIRED) + +string(FIND "${PYTHON_EXECUTABLE}" "${CONAN_CPYTHON_ROOT}" ROOT_SUBPOS) +if(ROOT_SUBPOS EQUAL -1) + message(FATAL_ERROR "found wrong python interpreter: ${PYTHON_EXECUTABLE}") +endif() + +message(STATUS "FindPythonInterp:") +message(STATUS "PYTHON_VERSION_STRING: ${PYTHON_VERSION_STRING}") +message(STATUS "PYTHON_VERSION_MAJOR: ${PYTHON_VERSION_MAJOR}") +message(STATUS "PYTHON_VERSION_MINOR: ${PYTHON_VERSION_MINOR}") +message(STATUS "PYTHON_VERSION_PATCH: ${PYTHON_VERSION_PATCH}") +message(STATUS "=============================================") +message(STATUS "FindPythonLibs:") +message(STATUS "PYTHON_LIBRARIES: ${PYTHON_LIBRARIES}") +message(STATUS "PYTHON_INCLUDE_PATH: ${PYTHON_INCLUDE_PATH} (deprecated)") +message(STATUS "PYTHON_INCLUDE_DIRS: ${PYTHON_INCLUDE_DIRS}") +message(STATUS "PYTHON_DEBUG_LIBRARIES: ${PYTHON_DEBUG_LIBRARIES} (deprecated)") +message(STATUS "PYTHONLIBS_VERSION_STRING: ${PYTHONLIBS_VERSION_STRING}") + +if(NOT PYTHON_VERSION_STRING AND NOT PYTHONLIBS_VERSION_STRING) + message(FATAL_ERROR "Version of python interpreter and libraries not found") +endif() + +if(PYTHON_VERSION_STRING) + if(NOT PYTHON_VERSION_STRING VERSION_EQUAL "${PY_VERSION}") + message("PYTHON_VERSION_STRING does not match PY_VERSION") + message(FATAL_ERROR "CMake detected wrong cpython version") + endif() +endif() + +if(PYTHONLIBS_VERSION_STRING) + if(NOT PYTHONLIBS_VERSION_STRING STREQUAL "${PY_FULL_VERSION}") + message("PYTHONLIBS_VERSION_STRING does not match PY_FULL_VERSION") + message(FATAL_ERROR "CMake detected wrong cpython version") + endif() +endif() + +option(BUILD_MODULE "Build python module") + +set(SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../test_package") + +if(BUILD_MODULE) + add_library(spam MODULE "${SOURCE_DIR}/test_module.c") + target_include_directories(spam + PRIVATE + ${PYTHON_INCLUDE_DIRS} + ) + target_link_libraries(spam PRIVATE + ${PYTHON_LIBRARIES} + ) + set_property(TARGET spam PROPERTY PREFIX "") + if(MSVC) + if(CONAN_SETTINGS_BUILD_TYPE STREQUAL "Debug") + set(SUFFIX "_d.pyd") + else() + set(SUFFIX ".pyd") + endif() + set_property(TARGET spam PROPERTY SUFFIX "${SUFFIX}") + endif() + + option(USE_FINDPYTHON_X "Use new-style FindPythonX module") + if(USE_FINDPYTHON_X AND NOT (CMAKE_VERSION VERSION_LESS "3.16")) + # Require CMake 3.16 because this version introduces Python3_FIND_ABI + find_package(Python3 REQUIRED COMPONENTS Interpreter Development) + message("Python3_EXECUTABLE: ${Python3_EXECUTABLE}") + message("Python3_INTERPRETER_ID: ${Python3_INTERPRETER_ID}") + message("Python3_VERSION: ${Python3_VERSION}") + message("Python3_INCLUDE_DIRS: ${Python3_INCLUDE_DIRS}") + message("Python3_LIBRARIES: ${Python3_LIBRARIES}") + if(NOT Python3_VERSION STREQUAL "${PY_VERSION}") + message("Python_ADDITIONAL_VERSIONS does not match PY_VERSION") + message(FATAL_ERROR "CMake detected wrong cpython version") + endif() + + python3_add_library(spam2 "${SOURCE_DIR}/test_module.c") + endif() +endif() + +add_executable(${PROJECT_NAME} "${SOURCE_DIR}/test_package.c") +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/cpython/all/test_v1_package/conanfile.py b/recipes/cpython/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..2fdcf049eb972b --- /dev/null +++ b/recipes/cpython/all/test_v1_package/conanfile.py @@ -0,0 +1,160 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, CMake, tools, RunEnvironment +from conans.errors import ConanException +from conan.tools.env import VirtualRunEnv +from io import StringIO +import os +import re + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + @property + def _py_version(self): + return re.match(r"^([0-9.]+)", self.deps_cpp_info["cpython"].version).group(1) + + @property + def _test_setuptools(self): + # TODO Should we still try to test this? + # https://github.com/python/cpython/pull/101039 + return not tools.cross_building(self, skip_x64_x86=True) and self._supports_modules and self._py_version < tools.Version("3.12") + + @property + def _cmake_try_FindPythonX(self): + if self.settings.compiler == "Visual Studio" and self.settings.build_type == "Debug": + return False + return True + + @property + def _supports_modules(self): + return self.settings.compiler != "Visual Studio" or self.options["cpython"].shared + + def generate(self): + # The build also needs access to the run environment to run the python executable + VirtualRunEnv(self).generate(scope="run") + VirtualRunEnv(self).generate(scope="build") + + def build_requirements(self): + # The main recipe does not require CMake, but we test with it. + # The interesting problem that arises here is if you have CMake installed + # with your global pip, then it will fail to run in this test package. + # To avoid that, just add a requirement on CMake. + self.tool_requires("cmake/[>=3.15 <4]") + + def build(self): + if not tools.cross_building(self, skip_x64_x86=True): + command = "{} --version".format(self.deps_user_info["cpython"].python) + buffer = StringIO() + self.run(command, output=buffer, ignore_errors=True, run_environment=True) + self.output.info("output: %s" % buffer.getvalue()) + self.run(command, run_environment=True) + + cmake = CMake(self) + cmake.definitions["BUILD_MODULE"] = self._supports_modules + cmake.definitions["PY_VERSION_MAJOR_MINOR"] = ".".join(self._py_version.split(".")[:2]) + cmake.definitions["PY_FULL_VERSION"] = self.deps_cpp_info["cpython"].version + cmake.definitions["PY_VERSION"] = self._py_version + cmake.definitions["PY_VERSION_SUFFIX"] = "d" if self.settings.build_type == "Debug" else "" + cmake.definitions["PYTHON_EXECUTABLE"] = self.deps_user_info["cpython"].python + cmake.definitions["USE_FINDPYTHON_X"] = self._cmake_try_FindPythonX + cmake.definitions["Python3_EXECUTABLE"] = self.deps_user_info["cpython"].python + cmake.definitions["Python3_ROOT_DIR"] = self.deps_cpp_info["cpython"].rootpath + cmake.definitions["Python3_USE_STATIC_LIBS"] = not self.options["cpython"].shared + cmake.definitions["Python3_FIND_FRAMEWORK"] = "NEVER" + cmake.definitions["Python3_FIND_REGISTRY"] = "NEVER" + cmake.definitions["Python3_FIND_IMPLEMENTATIONS"] = "CPython" + cmake.definitions["Python3_FIND_STRATEGY"] = "LOCATION" + + with tools.environment_append(RunEnvironment(self).vars): + cmake.configure() + cmake.build() + + if self._test_setuptools: + with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): + env = { + "DISTUTILS_USE_SDK": "1", + "MSSdk": "1" + } + env.update(**AutoToolsBuildEnvironment(self).vars) + with tools.environment_append(env): + setup_args = [ + os.path.join(self.source_folder, "..", "test_package", "setup.py"), + "build", + "--build-base", self.build_folder, + "--build-platlib", os.path.join(self.build_folder, "lib_setuptools"), + # Bandaid fix: setuptools places temporary files in a subdirectory of the build folder where the + # entirety of the absolute path up to this folder is appended (with seemingly no way to stop this), + # essentially doubling the path length. This may run into Windows max path lengths, so we give ourselves + # a little bit of wiggle room by making this directory name as short as possible. One of the directory + # names goes from (for example) "temp.win-amd64-3.10-pydebug" to "t", saving us roughly 25 characters. + "--build-temp", "t", + ] + if self.settings.build_type == "Debug": + setup_args.append("--debug") + self.run("{} {}".format(self.deps_user_info["cpython"].python, " ".join("\"{}\"".format(a) for a in setup_args)), run_environment=True) + + def _test_module(self, module, should_work): + try: + self.run("{} \"{}/../test_package/test_package.py\" -b \"{}\" -t {} ".format( + self.deps_user_info["cpython"].python, self.source_folder, self.build_folder, module), run_environment=True) + works = True + except ConanException as e: + works = False + exception = e + if should_work == works: + self.output.info("Result of test was expected.") + else: + if works: + raise ConanException("Module '{}' works, but should not have worked".format(module)) + else: + self.output.warn("Module '{}' does not work, but should have worked".format(module)) + raise exception + + def _cpython_option(self, name): + try: + return getattr(self.options["cpython"], name, False) + except ConanException: + return False + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + self.run("{} -c \"print('hello world')\"".format(self.deps_user_info["cpython"].python), run_environment=True) + + buffer = StringIO() + self.run("{} -c \"import sys; print('.'.join(str(s) for s in sys.version_info[:3]))\"".format(self.deps_user_info["cpython"].python), run_environment=True, output=buffer) + self.output.info(buffer.getvalue()) + version_detected = buffer.getvalue().splitlines()[-1].strip() + if self._py_version != version_detected: + raise ConanException("python reported wrong version. Expected {exp}. Got {res}.".format(exp=self._py_version, res=version_detected)) + + if self._supports_modules: + self._test_module("gdbm", self._cpython_option("with_gdbm")) + self._test_module("bz2", self._cpython_option("with_bz2")) + self._test_module("lzma", self._cpython_option("with_lzma")) + self._test_module("tkinter", self._cpython_option("with_tkinter")) + with tools.environment_append({"TERM": "ansi"}): + self._test_module("curses", self._cpython_option("with_curses")) + + self._test_module("expat", True) + self._test_module("sqlite3", True) + self._test_module("decimal", True) + self._test_module("ctypes", True) + + if tools.is_apple_os(self.settings.os) and not self.options["cpython"].shared: + self.output.info("Not testing the module, because these seem not to work on apple when cpython is built as a static library") + # FIXME: find out why cpython on apple does not allow to use modules linked against a static python + else: + if self._supports_modules: + with tools.environment_append({"PYTHONPATH": [os.path.join(self.build_folder, "lib")]}): + self.output.info("Testing module (spam) using cmake built module") + self._test_module("spam", True) + + if self._test_setuptools: + with tools.environment_append({"PYTHONPATH": [os.path.join(self.build_folder, "lib_setuptools")]}): + self.output.info("Testing module (spam) using setup.py built module") + self._test_module("spam", True) + + # MSVC builds need PYTHONHOME set. Linux and Mac don't require it to be set if tested after building, + # but if the package is relocated then it needs to be set. + with tools.environment_append({"PYTHONHOME": self.deps_user_info["cpython"].pythonhome}): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/cpython/config.yml b/recipes/cpython/config.yml index e3abf3ec8acb22..87dabe8bf898b1 100644 --- a/recipes/cpython/config.yml +++ b/recipes/cpython/config.yml @@ -1,11 +1,11 @@ versions: - "3.10.0": + "3.12.2": folder: "all" - "3.9.7": + "3.11.9": folder: "all" - "3.8.12": + "3.10.14": folder: "all" - "3.7.12": + "3.9.19": folder: "all" - "2.7.18": + "3.8.19": folder: "all" diff --git a/recipes/cyclonedds-cxx/all/conanfile.py b/recipes/cyclonedds-cxx/all/conanfile.py index 723b2660aff690..f2c688b39a5948 100644 --- a/recipes/cyclonedds-cxx/all/conanfile.py +++ b/recipes/cyclonedds-cxx/all/conanfile.py @@ -150,13 +150,15 @@ def package_info(self): self.cpp_info.includedirs = ["include/ddscxx"] self.cpp_info.builddirs = [self._module_path] self.cpp_info.components["ddscxx"].libs = ["ddscxx"] - self.cpp_info.components["ddscxx"].includedirs = ["include/ddscxx"] + self.cpp_info.components["ddscxx"].includedirs = [os.path.join("include", "ddscxx")] self.cpp_info.components["ddscxx"].set_property("cmake_target_name", "CycloneDDS-CXX::ddscxx") self.cpp_info.components["ddscxx"].set_property("pkg_config_name", "CycloneDDS-CXX") + self.cpp_info.components["ddscxx"].requires = ["cyclonedds::CycloneDDS"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["ddscxx"].system_libs = ["m"] self.cpp_info.components["idlcxx"].libs = ["cycloneddsidlcxx"] self.cpp_info.components["idlcxx"].set_property("cmake_target_name", "CycloneDDS-CXX::idlcxx") + self.cpp_info.components["idlcxx"].requires = ["cyclonedds::idl"] self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) self.buildenv_info.append_path("PATH", os.path.join(self.package_folder, "bin")) self.runenv_info.append_path("PATH", os.path.join(self.package_folder, "bin")) diff --git a/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt b/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt index 4092a05fa5b944..f43c4dca3ca61a 100644 --- a/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt +++ b/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt @@ -6,10 +6,10 @@ set(CMAKE_CXX_EXTENSIONS OFF) find_package(CycloneDDS-CXX REQUIRED) add_executable(test_package test_package.cpp) -target_link_libraries(test_package PRIVATE CycloneDDS-CXX::ddscxx CycloneDDS::ddsc) +target_link_libraries(test_package PRIVATE CycloneDDS-CXX::ddscxx) if(NOT CMAKE_CROSSCOMPILING) IDLCXX_GENERATE(TARGET MessageLib FILES Message.idl) add_executable(test_message test_message.cpp) - target_link_libraries(test_message PRIVATE MessageLib CycloneDDS-CXX::ddscxx CycloneDDS::ddsc) + target_link_libraries(test_message PRIVATE MessageLib CycloneDDS-CXX::ddscxx) endif() diff --git a/recipes/cyrus-sasl/all/conanfile.py b/recipes/cyrus-sasl/all/conanfile.py index e29d9fed196d86..78ec1f2f5f46af 100644 --- a/recipes/cyrus-sasl/all/conanfile.py +++ b/recipes/cyrus-sasl/all/conanfile.py @@ -41,6 +41,7 @@ class CyrusSaslConan(ConanFile): "with_postgresql": [True, False], "with_mysql": [True, False], "with_sqlite3": [True, False], + "with_saslauthd": [True, False], } default_options = { "shared": False, @@ -57,6 +58,7 @@ class CyrusSaslConan(ConanFile): "with_postgresql": False, "with_mysql": False, "with_sqlite3": False, + "with_saslauthd": True, } @property @@ -66,6 +68,9 @@ def _settings_build(self): 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 @@ -137,6 +142,7 @@ def _generate_autotools(self): "--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") @@ -242,7 +248,9 @@ def package_info(self): self.cpp_info.libs = ["sasl2"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["resolv", "crypt"] + 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"] diff --git a/recipes/dacap-clip/all/conandata.yml b/recipes/dacap-clip/all/conandata.yml index f4f5540f11df5c..4c3c17aeedcf54 100644 --- a/recipes/dacap-clip/all/conandata.yml +++ b/recipes/dacap-clip/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.9": + url: "https://github.com/dacap/clip/archive/refs/tags/v1.9.tar.gz" + sha256: "e8af414c720784a6005419afb087786c05602e998ec52b2efe9e3112b7535d30" + "1.8": + url: "https://github.com/dacap/clip/archive/refs/tags/v1.8.tar.gz" + sha256: "a54d243451fb483590ffd9239a3c55f8d8e672d44df63dc2b81da01a229074bc" "1.7": url: "https://github.com/dacap/clip/archive/refs/tags/v1.7.tar.gz" sha256: "f494d306f3425e984368cbd94ffb213e0a3b3d44c3ab169e5134788d3342535c" diff --git a/recipes/dacap-clip/all/conanfile.py b/recipes/dacap-clip/all/conanfile.py index c4021d403c55f7..9c743f68fab4ed 100644 --- a/recipes/dacap-clip/all/conanfile.py +++ b/recipes/dacap-clip/all/conanfile.py @@ -7,6 +7,7 @@ from conan.tools.microsoft import is_msvc from conan.tools.apple import is_apple_os from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -23,11 +24,13 @@ class DacapClipConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_png": [True, False], + "with_image": [True, False], } default_options = { "shared": False, "fPIC": True, "with_png": True, + "with_image": True, } @property @@ -37,19 +40,21 @@ def _min_cppstd(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_png + if Version(self.version) < "1.8": + del self.options.with_image def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - if self.settings.os not in ["Linux", "FreeBSD"]: - del self.options.with_png def layout(self): cmake_layout(self, src_folder="src") def requirements(self): if self.options.get_safe("with_png", False): - self.requires("libpng/1.6.37") + self.requires("libpng/[>=1.6 <2]") if self.settings.os == "Linux": self.requires("xorg/system") @@ -67,6 +72,7 @@ def generate(self): toolchain.variables["CLIP_EXAMPLES"] = False toolchain.variables["CLIP_TESTS"] = False toolchain.variables["CLIP_X11_WITH_PNG"] = self.options.get_safe("with_png", False) + toolchain.variables["CLIP_ENABLE_IMAGE"] = self.options.get_safe("with_image", False) if is_msvc(self): toolchain.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = bool(self.options.shared) toolchain.generate() @@ -93,6 +99,8 @@ def package_info(self): if self.options.get_safe("with_png", False): self.cpp_info.requires.append("libpng::libpng") + if self.options.get_safe("with_image", False): + self.cpp_info.defines.append("CLIP_ENABLE_IMAGE=1") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.requires.append("xorg::xcb") @@ -108,6 +116,6 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "clip") self.cpp_info.set_property("cmake_target_name", "clip::clip") - # TODO: Remove on Conan 2.0 + # TODO: Remove on Conan 2.0 self.cpp_info.names["cmake_find_package"] = "clip" self.cpp_info.names["cmake_find_package_multi"] = "clip" diff --git a/recipes/dacap-clip/config.yml b/recipes/dacap-clip/config.yml index f10766e09880a8..baafafbfe03c15 100644 --- a/recipes/dacap-clip/config.yml +++ b/recipes/dacap-clip/config.yml @@ -1,4 +1,8 @@ versions: + "1.9": + folder: "all" + "1.8": + folder: "all" "1.7": folder: "all" "1.6": diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py index c20fd3f03b189c..252b821357ceb5 100644 --- a/recipes/dbus/1.x.x/conanfile.py +++ b/recipes/dbus/1.x.x/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name, is_apple_os from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rm, rmdir, save +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 PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain @@ -10,12 +10,13 @@ import os import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class DbusConan(ConanFile): name = "dbus" - license = ("AFL-2.1", "GPL-2.0-or-later") + # license is AFL-2.1 OR GPL-2.0-or-later with several other compatible licenses for smaller sections of code + license = "(AFL-2.1 OR GPL-2.0-or-later) AND DocumentRef-COPYING" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.freedesktop.org/wiki/Software/dbus" description = "D-Bus is a simple system for interprocess communication and coordination." @@ -26,10 +27,12 @@ class DbusConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "dbus_user": ["ANY"], + "message_bus": [True, False], "system_socket": [None, "ANY"], "system_pid_file": [None, "ANY"], "with_x11": [True, False], - "with_glib": [True, False], + "with_glib": ["deprecated", True, False], "with_systemd": [True, False], "with_selinux": [True, False], "session_socket_dir": ["ANY"], @@ -37,54 +40,73 @@ class DbusConan(ConanFile): default_options = { "shared": False, "fPIC": True, + "dbus_user": "messagebus", + "message_bus": False, "system_socket": None, "system_pid_file": None, "with_x11": False, - "with_glib": False, + "with_glib": "deprecated", "with_systemd": False, "with_selinux": False, "session_socket_dir": "/tmp", } + @property + def _has_message_bus_option(self): + return Version(self.version) > "1.15.2" + def export_sources(self): export_conandata_patches(self) def config_options(self): - if self.settings.os not in ("Linux", "FreeBSD"): + if self.settings.os not in ["Linux", "FreeBSD"]: del self.options.with_systemd - if self.settings.os not in ("Linux", "FreeBSD"): del self.options.with_x11 + del self.options.with_selinux if self.settings.os == "Windows": del self.options.fPIC + if not self._has_message_bus_option: + self.options.rm_safe("message_bus") def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") if self.options.shared: self.options.rm_safe("fPIC") + if not self.options.get_safe("message_bus"): + self.options.rm_safe("dbus_user") def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") - if self.options.with_glib: - self.requires("glib/2.77.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.get_safe("with_systemd"): self.requires("libsystemd/253.6") - if self.options.with_selinux: - self.requires("libselinux/3.3") + if self.options.get_safe("with_selinux"): + self.requires("libselinux/3.5") if self.options.get_safe("with_x11"): - self.requires("xorg/system") + # X11 is only linked into an executable and should not be propagated as a library dependency. + # It should still be provided in a VirtualRunEnv context, though, + # but Conan as of v2.2 does not yet provide a fine-grained enough control over this. + self.requires("xorg/system", visible=False) + + def package_id(self): + del self.info.options.with_glib + # The dbus_user option only effects the installation of dbus during the package method. + # Otherwise, it only appears in the system.conf file in the package. + self.info.options.rm_safe("dbus_user") def validate(self): if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 7: raise ConanInvalidConfiguration(f"{self.ref} requires at least gcc 7.") + if self.options.with_glib != "deprecated": + raise ConanInvalidConfiguration("with_glib option is deprecated and should not be used - the option had no effect.") def build_requirements(self): - self.tool_requires("meson/1.2.0") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config",check_type=str): - self.tool_requires("pkgconf/1.9.5") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -95,45 +117,55 @@ def generate(self): tc = MesonToolchain(self) tc.project_options["asserts"] = not is_apple_os(self) tc.project_options["checks"] = False + tc.project_options["datadir"] = os.path.join("res", "share") + tc.project_options["localstatedir"] = os.path.join("res", "var") + tc.project_options["sysconfdir"] = os.path.join("res", "etc") tc.project_options["doxygen_docs"] = "disabled" + tc.project_options["ducktype_docs"] = "disabled" + tc.project_options["qt_help"] = "disabled" tc.project_options["modular_tests"] = "disabled" - tc.project_options["system_socket"] = str(self.options.get_safe("system_socket", "")) - tc.project_options["system_pid_file"] = str(self.options.get_safe("system_pid_file", "")) + tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux") else "disabled" tc.project_options["session_socket_dir"] = str(self.options.get_safe("session_socket_dir", "")) - tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux", False) else "disabled" - tc.project_options["systemd"] = "enabled" if self.options.get_safe("with_systemd", False) else "disabled" - if self.options.get_safe("with_systemd", False): - tc.project_options["systemd_system_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "system") - tc.project_options["systemd_user_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "user") + tc.project_options["systemd"] = "enabled" if self.options.get_safe("with_systemd") else "disabled" + if self.options.get_safe("with_systemd"): + tc.project_options["systemd_system_unitdir"] = "/res/lib/systemd/system" + tc.project_options["systemd_user_unitdir"] = "/res/usr/lib/systemd/system" + if self._has_message_bus_option: + tc.project_options["message_bus"] = bool(self.options.message_bus) + if self.options.get_safe("dbus_user"): + tc.project_options["dbus_user"] = str(self.options.dbus_user) + tc.project_options["system_pid_file"] = str(self.options.get_safe("system_pid_file", "")) + tc.project_options["system_socket"] = str(self.options.get_safe("system_socket", "")) if is_apple_os(self): - tc.project_options["launchd_agent_dir"] = os.path.join(self.package_folder, "res", "LaunchAgents") - tc.project_options["x11_autolaunch"] = "enabled" if self.options.get_safe("with_x11", False) else "disabled" + tc.project_options["launchd_agent_dir"] = os.path.join("res", "LaunchAgents") + tc.project_options["x11_autolaunch"] = "enabled" if self.options.get_safe("with_x11") else "disabled" tc.project_options["xml_docs"] = "disabled" tc.generate() deps = PkgConfigDeps(self) deps.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) - replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('test')", "# subdir('test')") + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "subdir('test')", "# subdir('test')") + + 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")) + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*", os.path.join(self.source_folder, "LICENSES"), os.path.join(self.package_folder, "licenses")) meson = Meson(self) meson.install() rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - rmdir(self, os.path.join(self.package_folder, "share", "doc")) - mkdir(self, os.path.join(self.package_folder, "res")) - for i in ["var", "share", "etc"]: - rename(self, os.path.join(self.package_folder, i), os.path.join(self.package_folder, "res", i)) + rmdir(self, os.path.join(self.package_folder, "res", "share", "doc")) 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, "lib", "systemd")) fix_apple_shared_install_name(self) if self.settings.os == "Windows" and not self.options.shared: rename(self, os.path.join(self.package_folder, "lib", "libdbus-1.a"), os.path.join(self.package_folder, "lib", "dbus-1.lib")) @@ -179,6 +211,12 @@ def package_info(self): if not self.options.shared: self.cpp_info.defines.append("DBUS_STATIC_BUILD") + self.cpp_info.requires.append("expat::expat") + if self.options.get_safe("with_systemd"): + self.cpp_info.requires.append("libsystemd::libsystemd") + if self.options.get_safe("with_selinux"): + self.cpp_info.requires.append("libselinux::selinux") + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed self.cpp_info.filenames["cmake_find_package"] = "DBus1" self.cpp_info.filenames["cmake_find_package_multi"] = "DBus1" diff --git a/recipes/dice-template-library/all/conandata.yml b/recipes/dice-template-library/all/conandata.yml index 8045d981c24dee..f3c3a88f7edef5 100644 --- a/recipes/dice-template-library/all/conandata.yml +++ b/recipes/dice-template-library/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.0": + url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.5.0.tar.gz" + sha256: "5ab4155097af5674dc9b34d1643db9ea8b30f78d15c1e547c58396ea31068ffd" "1.3.0": url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.3.0.tar.gz" sha256: "2e61e95eeedf31f7041a6694c0789c5d1a5e3f9e4db87546cb83c9189808d4f5" diff --git a/recipes/dice-template-library/config.yml b/recipes/dice-template-library/config.yml index 13451667044d0e..4b83ac8cb2f11e 100644 --- a/recipes/dice-template-library/config.yml +++ b/recipes/dice-template-library/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.0": + folder: all "1.3.0": folder: all "1.2.0": diff --git a/recipes/duckdb/all/conandata.yml b/recipes/duckdb/all/conandata.yml index 82ad639285d872..65a6c492898186 100644 --- a/recipes/duckdb/all/conandata.yml +++ b/recipes/duckdb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.10.1": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.10.1.tar.gz" + sha256: "83bd4944c070fd0bd287fbe62919fa887f35d7422ba0fa66e13d4ed098f3791a" "0.9.2": url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.9.2.tar.gz" sha256: "afff7bd925a98dc2af4039b8ab2159b0705cbf5e0ee05d97f7bb8dce5f880dc2" @@ -24,6 +27,13 @@ sources: url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.5.1.tar.gz" sha256: "3dab7ba0d0f8d024d3c73fd3d4fb8834203c31d7b0ddb1e8539ee266e11b0e9b" patches: + "0.10.1": + - patch_file: "patches/0.10.1-0001-fix-cmake.patch" + patch_description: "install static of shared library, add installation for odbc extention" + patch_type: "portability" + - patch_file: "patches/0.10.1-0002-msvc-bicobj.patch" + patch_description: "add /bigobj flag" + patch_type: "portability" "0.9.2": - patch_file: "patches/0.9.2-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" diff --git a/recipes/duckdb/all/conanfile.py b/recipes/duckdb/all/conanfile.py index bb764a9d7f7ea9..d1f59cd82e1820 100644 --- a/recipes/duckdb/all/conanfile.py +++ b/recipes/duckdb/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file -from conan.tools.build import check_min_cppstd +from conan.tools.build import check_min_cppstd, cross_building from conan.tools.scm import Version from conan.tools.microsoft import is_msvc from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout @@ -108,7 +108,7 @@ def generate(self): tc.variables["DUCKDB_MINOR_VERSION"] = Version(self.version).minor tc.variables["DUCKDB_PATCH_VERSION"] = Version(self.version).patch tc.variables["DUCKDB_DEV_ITERATION"] = 0 - + tc.variables["OVERRIDE_GIT_DESCRIBE"] = f"v{self.version}" if "with_parquet" in self.options: tc.variables["BUILD_PARQUET_EXTENSION"] = self.options.with_parquet @@ -159,6 +159,8 @@ def generate(self): tc.variables["ENABLE_UBSAN"] = False if is_msvc(self) and not self.options.shared: tc.preprocessor_definitions["DUCKDB_API"] = "" + if Version(self.version) >= "0.10.0" and cross_building(self): + tc.variables["DUCKDB_EXPLICIT_PLATFORM"] = f"{self.settings.os}_{self.settings.arch}" tc.generate() dpes = CMakeDeps(self) @@ -211,6 +213,8 @@ def package_info(self): ] if Version(self.version) >= "0.6.0": self.cpp_info.libs.append("duckdb_fsst") + if Version(self.version) >= "0.10.0": + self.cpp_info.libs.append("duckdb_skiplistlib") if self.options.with_autocomplete: self.cpp_info.libs.append("autocomplete_extension") @@ -228,7 +232,8 @@ def package_info(self): self.cpp_info.libs.append("visualizer_extension") if self.options.with_httpfs: self.cpp_info.libs.append("httpfs_extension") - if Version(self.version) >= "0.6.0" and self.settings.os == "Linux": + if (Version(self.version) >= "0.6.0" and self.settings.os == "Linux" and + (Version(self.version) < "0.10.1" or self.settings.arch == "x86_64")): self.cpp_info.libs.append("jemalloc_extension") if self.options.with_json: self.cpp_info.libs.append("json_extension") @@ -244,6 +249,9 @@ def package_info(self): if self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") + if Version(self.version) >= "0.10.0": + self.cpp_info.system_libs.extend(["rstrtmgr", "bcrypt"]) + if self.options.with_shell: binpath = os.path.join(self.package_folder, "bin") diff --git a/recipes/duckdb/all/patches/0.10.1-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.10.1-0001-fix-cmake.patch new file mode 100644 index 00000000000000..7843bec6ccf0e3 --- /dev/null +++ b/recipes/duckdb/all/patches/0.10.1-0001-fix-cmake.patch @@ -0,0 +1,118 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aebc060..4698e32 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -836,7 +836,7 @@ function(build_static_extension NAME PARAMETERS) + set(FILES ${ARGV}) + list(REMOVE_AT FILES 0) + add_library(${NAME}_extension STATIC ${FILES}) +- target_link_libraries(${NAME}_extension duckdb_static) ++# target_link_libraries(${NAME}_extension duckdb_static) + endfunction() + + # Internal extension register function +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index d45ae7f..c13ca96 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -92,21 +92,21 @@ else() + duckdb_fastpforlib + duckdb_skiplistlib + duckdb_mbedtls) +- ++ if(BUILD_SHARED_LIBS) + add_library(duckdb SHARED ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb ${DUCKDB_LINK_LIBS}) + link_threads(duckdb) + link_extension_libraries(duckdb) +- ++ endif() + add_library(duckdb_static STATIC ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb_static ${DUCKDB_LINK_LIBS}) + link_threads(duckdb_static) + link_extension_libraries(duckdb_static) +- ++ if(BUILD_SHARED_LIBS) + target_include_directories( + duckdb PUBLIC $ + $) +- ++ endif() + target_include_directories( + duckdb_static PUBLIC $ + $) +@@ -121,10 +121,18 @@ else() + DESTINATION "${INSTALL_INCLUDE_DIR}") + + endif() +- ++if(BUILD_SHARED_LIBS) + install( +- TARGETS duckdb duckdb_static ++ TARGETS duckdb + EXPORT "${DUCKDB_EXPORT_SET}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++else() ++install( ++ TARGETS duckdb_static ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++endif() +diff --git a/tools/odbc/CMakeLists.txt b/tools/odbc/CMakeLists.txt +index baf7823..4bef643 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -38,6 +38,14 @@ add_library(duckdb_odbc SHARED ${ALL_OBJECT_FILES} duckdb_odbc.def) + set_target_properties(duckdb_odbc PROPERTIES DEFINE_SYMBOL "DUCKDB_ODBC_API") + target_link_libraries(duckdb_odbc ${LINK_LIB_LIST} duckdb_static) + ++install( ++ TARGETS duckdb_odbc ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) ++ + if(NOT CLANG_TIDY) + add_subdirectory(test) + endif() +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index e29c33e..fb926b5 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -26,20 +26,20 @@ if(NOT AMALGAMATION_BUILD) + endif() + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32 AND NOT ZOS) ++if(BUILD_SHARED_LIBS AND NOT WIN32 AND NOT ZOS) + add_library(sqlite3_api_wrapper SHARED ${SQLITE_API_WRAPPER_FILES}) + target_link_libraries(sqlite3_api_wrapper duckdb ${DUCKDB_EXTRA_LINK_FLAGS}) + link_threads(sqlite3_api_wrapper) + endif() + +-include_directories(../../third_party/catch) ++# include_directories(../../third_party/catch) + +-include_directories(test/include) +-add_subdirectory(test) ++# include_directories(test/include) ++# add_subdirectory(test) + +-add_executable(test_sqlite3_api_wrapper ${SQLITE_TEST_FILES}) +-if(WIN32 OR ZOS) +- target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper_static) +-else() +- target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) +-endif() ++# add_executable(test_sqlite3_api_wrapper ${SQLITE_TEST_FILES}) ++# if(WIN32 OR ZOS) ++# target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper_static) ++# else() ++# target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) ++# endif() diff --git a/recipes/duckdb/all/patches/0.10.1-0002-msvc-bicobj.patch b/recipes/duckdb/all/patches/0.10.1-0002-msvc-bicobj.patch new file mode 100644 index 00000000000000..4dd0c46e338399 --- /dev/null +++ b/recipes/duckdb/all/patches/0.10.1-0002-msvc-bicobj.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aebc060..4a696b6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -508,7 +508,7 @@ if(NOT MSVC) + endif() + else() + set(CMAKE_CXX_WINDOWS_FLAGS +- "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8") ++ "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8 /bigobj") + if(TREAT_WARNINGS_AS_ERRORS) + set(CMAKE_CXX_WINDOWS_FLAGS "${CMAKE_CXX_WINDOWS_FLAGS} /WX") + endif() diff --git a/recipes/duckdb/config.yml b/recipes/duckdb/config.yml index 77e20cf10a7979..60b78863eb1bb3 100644 --- a/recipes/duckdb/config.yml +++ b/recipes/duckdb/config.yml @@ -1,4 +1,6 @@ versions: + "0.10.1": + folder: "all" "0.9.2": folder: "all" "0.9.0": diff --git a/recipes/enet/all/conandata.yml b/recipes/enet/all/conandata.yml index c03ba9c9c59fb1..346f8469ae0109 100644 --- a/recipes/enet/all/conandata.yml +++ b/recipes/enet/all/conandata.yml @@ -1,22 +1,17 @@ sources: + "1.3.18": + url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.18.tar.gz" + sha256: "28603c895f9ed24a846478180ee72c7376b39b4bb1287b73877e5eae7d96b0dd" "1.3.17": url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.17.tar.gz" sha256: "1e0b4bc0b7127a2d779dd7928f0b31830f5b3dcb7ec9588c5de70033e8d2434a" "1.3.16": url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.16.tar.gz" sha256: "b3aa85b43e4309fec9441b4e6639c268e22962a578bd5e2307bb3a7b6fe73714" - "1.3.15": - url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.15.tar.gz" - sha256: "e749887a19b5a4a0a16daae2d695fd7ed581ec517f3b15aedc3cdce2d999d471" - "1.3.14": - url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.14.tar.gz" - sha256: "3660e12d32164b2d814a897f50caa4e68db6396c00ef22806db45c2308b439e6" patches: + "1.3.18": + - patch_file: "patches/fix-cmake-1.3.18.patch" "1.3.17": - patch_file: "patches/fix-cmake.patch" "1.3.16": - patch_file: "patches/fix-cmake.patch" - "1.3.15": - - patch_file: "patches/fix-cmake.patch" - "1.3.14": - - patch_file: "patches/fix-cmake.patch" diff --git a/recipes/enet/all/patches/fix-cmake-1.3.18.patch b/recipes/enet/all/patches/fix-cmake-1.3.18.patch new file mode 100644 index 00000000000000..6a6af96885d57b --- /dev/null +++ b/recipes/enet/all/patches/fix-cmake-1.3.18.patch @@ -0,0 +1,41 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c6459b6..d7e68bd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -84,19 +84,27 @@ set(SOURCE_FILES + source_group(include FILES ${INCLUDE_FILES}) + source_group(source FILES ${SOURCE_FILES}) + +-add_library(enet STATIC ++if(MSVC AND BUILD_SHARED_LIBS) ++ add_definitions(-DENET_DLL) ++ add_definitions(-DENET_BUILDING_LIB) ++endif() ++add_library(enet + ${INCLUDE_FILES} + ${SOURCE_FILES} + ) + +-if (MINGW) ++if (WIN32) + target_link_libraries(enet winmm ws2_32) + endif() + +-install(TARGETS enet +- RUNTIME DESTINATION bin +- ARCHIVE DESTINATION lib/static +- LIBRARY DESTINATION lib) +- +-install(DIRECTORY include/ +- DESTINATION include) ++include(GNUInstallDirs) ++install( ++ TARGETS enet ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) ++install( ++ DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/enet ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) diff --git a/recipes/enet/config.yml b/recipes/enet/config.yml index 1e0720325112ae..9574bb80165a09 100644 --- a/recipes/enet/config.yml +++ b/recipes/enet/config.yml @@ -1,9 +1,7 @@ versions: + "1.3.18": + folder: all "1.3.17": folder: all "1.3.16": folder: all - "1.3.15": - folder: all - "1.3.14": - folder: all diff --git a/recipes/ensmallen/all/conandata.yml b/recipes/ensmallen/all/conandata.yml index a566be23b48935..31733be82e3835 100644 --- a/recipes/ensmallen/all/conandata.yml +++ b/recipes/ensmallen/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.21.0": + url: "https://ensmallen.org/files/ensmallen-2.21.0.tar.gz" + sha256: "076f9d84e1ebc84c0ae19ee63accfc8fd3ec850f8993784bd9277776c3af2932" "2.19.1": url: "https://ensmallen.org/files/ensmallen-2.19.1.tar.gz" sha256: "f36ad7f08b0688d2a8152e1c73dd437c56ed7a5af5facf65db6ffd977b275b2e" diff --git a/recipes/ensmallen/all/conanfile.py b/recipes/ensmallen/all/conanfile.py index 7b6250290ad813..093bca4ec6467b 100644 --- a/recipes/ensmallen/all/conanfile.py +++ b/recipes/ensmallen/all/conanfile.py @@ -25,7 +25,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("armadillo/12.2.0") + self.requires("armadillo/12.6.4") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/ensmallen/config.yml b/recipes/ensmallen/config.yml index 3af39348507628..0bd90f07549cf8 100644 --- a/recipes/ensmallen/config.yml +++ b/recipes/ensmallen/config.yml @@ -1,3 +1,5 @@ versions: + "2.21.0": + folder: all "2.19.1": folder: all diff --git a/recipes/erkir/all/conandata.yml b/recipes/erkir/all/conandata.yml index 24a6857c0b7eb9..f16d2da6950e65 100644 --- a/recipes/erkir/all/conandata.yml +++ b/recipes/erkir/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.1": + url: "https://github.com/vahancho/erkir/archive/refs/tags/v2.1.1.tar.gz" + sha256: "b314824c126bf933e2f08e5335e12b7ef3ded9ceb341d542276455d991e7e85d" "2.0.0": url: "https://github.com/vahancho/erkir/archive/refs/tags/v2.0.0.tar.gz" sha256: "98d095adcf0f2f11e3ba345bd5bbe890568cde69de9680b2c2a424f0008453ac" @@ -6,6 +9,16 @@ sources: url: "https://github.com/vahancho/erkir/archive/refs/tags/1.0.0.tar.gz" sha256: "0bc5122fe2fef0f9036de275483af7f8adb947f6e8dd63fc18ac085ef31e9421" patches: + "2.1.1": + - patch_file: "patches/2.0.0-0001-remove-specify-architecture.patch" + patch_description: "fix supported architectures limited to x86/x86_64" + patch_type: "conan" + - patch_file: "patches/2.1.1-0002-fix-cmake.patch" + patch_description: "disable shared and fPIC options" + patch_type: "conan" + - patch_file: "patches/2.1.1-0003-fix-erkir_export.patch" + patch_description: "define ERKIR_EXPORT as empty on static build" + patch_type: "conan" "2.0.0": - patch_file: "patches/2.0.0-0001-remove-specify-architecture.patch" patch_description: "fix supported architectures limited to x86/x86_64" diff --git a/recipes/erkir/all/conanfile.py b/recipes/erkir/all/conanfile.py index 941e33312f1212..10808e03cf409e 100644 --- a/recipes/erkir/all/conanfile.py +++ b/recipes/erkir/all/conanfile.py @@ -81,7 +81,11 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "erkir") - self.cpp_info.set_property("cmake_target_name", "erkir::erkir") postfix = "d" if Version(self.version) >= "2.0.0" and self.settings.build_type == "Debug" else "" self.cpp_info.libs = [f"erkir{postfix}"] + + if Version(self.version) >= "2.1.0" and self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + self.cpp_info.set_property("cmake_file_name", "erkir") + self.cpp_info.set_property("cmake_target_name", "erkir::erkir") diff --git a/recipes/erkir/all/patches/2.1.1-0002-fix-cmake.patch b/recipes/erkir/all/patches/2.1.1-0002-fix-cmake.patch new file mode 100644 index 00000000000000..0a92d7aabdffc4 --- /dev/null +++ b/recipes/erkir/all/patches/2.1.1-0002-fix-cmake.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d72f102..7bf1655 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.9) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # The project definition + project(erkir VERSION 2.1.1 +@@ -14,7 +14,7 @@ project(erkir VERSION 2.1.1 + include(GNUInstallDirs) + + # General options +-option(BUILD_SHARED_LIBS "Build using shared libraries" ON) ++# option(BUILD_SHARED_LIBS "Build using shared libraries" ON) + option(ENABLE_TESTING "Enable unit test build" OFF) + + if (0) diff --git a/recipes/erkir/all/patches/2.1.1-0003-fix-erkir_export.patch b/recipes/erkir/all/patches/2.1.1-0003-fix-erkir_export.patch new file mode 100644 index 00000000000000..a12676d0ed4009 --- /dev/null +++ b/recipes/erkir/all/patches/2.1.1-0003-fix-erkir_export.patch @@ -0,0 +1,28 @@ +diff --git a/include/export.h b/include/export.h +index edcb0b3..e090174 100644 +--- a/include/export.h ++++ b/include/export.h +@@ -1,7 +1,7 @@ + #ifndef __EXPORT_H_ + #define __EXPORT_H_ + +-#ifdef _WIN32 ++#if defined(_WIN32) && defined(ERKIR_SHARED) + #ifdef MAKEDLL + # define ERKIR_EXPORT __declspec(dllexport) + #else +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index ad88fd6..519a300 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -38,6 +38,10 @@ if (MSVC) + target_compile_definitions(${TARGET} PUBLIC MAKEDLL) + endif() + ++if (BUILD_SHARED_LIBS) ++ target_compile_definitions(${TARGET} PUBLIC ERKIR_SHARED) ++endif() ++ + ############################################################################### + # The installation and packaging + # diff --git a/recipes/erkir/config.yml b/recipes/erkir/config.yml index 870fb33e55af03..65dc9fbda01102 100644 --- a/recipes/erkir/config.yml +++ b/recipes/erkir/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.1": + folder: all "2.0.0": folder: all "1.0.0": diff --git a/recipes/exiv2/all/conandata.yml b/recipes/exiv2/all/conandata.yml index 55858f820d83f2..0b36cf903900da 100644 --- a/recipes/exiv2/all/conandata.yml +++ b/recipes/exiv2/all/conandata.yml @@ -1,10 +1,10 @@ sources: + "0.28.2": + url: "https://github.com/Exiv2/exiv2/archive/refs/tags/v0.28.2.tar.gz" + sha256: "543bead934135f20f438e0b6d8858c55c5fcb7ff80f5d1d55489965f1aad58b9" "0.28.1": url: "https://github.com/Exiv2/exiv2/archive/refs/tags/v0.28.1.tar.gz" sha256: "3078651f995cb6313b1041f07f4dd1bf0e9e4d394d6e2adc6e92ad0b621291fa" - "0.28.0": - url: "https://github.com/Exiv2/exiv2/releases/download/v0.28.0/exiv2-0.28.0-Source.tar.gz" - sha256: "89af3b5ef7277753ef7a7b5374ae017c6b9e304db3b688f1948e73e103491f3d" "0.27.5": url: "https://github.com/Exiv2/exiv2/releases/download/v0.27.5/exiv2-0.27.5-Source.tar.gz" sha256: "35a58618ab236a901ca4928b0ad8b31007ebdc0386d904409d825024e45ea6e2" diff --git a/recipes/exiv2/all/conanfile.py b/recipes/exiv2/all/conanfile.py index 84f13196b12f9a..749096cccd3727 100644 --- a/recipes/exiv2/all/conanfile.py +++ b/recipes/exiv2/all/conanfile.py @@ -76,13 +76,13 @@ def requirements(self): self.requires("libpng/[>=1.6 <2]") self.requires("zlib/[>=1.2.11 <2]") if self.options.with_xmp == "bundled": - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_curl: self.requires("libcurl/[>=7.78.0 <9]") if self.options.get_safe("with_brotli"): self.requires("brotli/1.1.0") if self.options.get_safe("with_inih"): - self.requires("inih/57") + self.requires("inih/58") def validate(self): if Version(self.version) >= "0.28.0": diff --git a/recipes/exiv2/config.yml b/recipes/exiv2/config.yml index d503f95292a288..f9244e625c48f3 100644 --- a/recipes/exiv2/config.yml +++ b/recipes/exiv2/config.yml @@ -1,7 +1,7 @@ versions: - "0.28.1": + "0.28.2": folder: all - "0.28.0": + "0.28.1": folder: all "0.27.5": folder: all diff --git a/recipes/fast-dds/all/conandata.yml b/recipes/fast-dds/all/conandata.yml index 38fe2366959a0f..02a8d037bcc072 100644 --- a/recipes/fast-dds/all/conandata.yml +++ b/recipes/fast-dds/all/conandata.yml @@ -20,7 +20,7 @@ patches: patch_type: "conan" patch_description: "Add gettid macro for glibc compat. See: eProsima/Fast-DDS#4565" "2.11.2": - - patch_file: "patches/2.11.1-0001-fix-find-asio-and-tinyxml2.patch" + - patch_file: "patches/2.10.1-0001-fix-find-asio-and-tinyxml2.patch" patch_type: "conan" patch_description: "Fixup find asio and tinyxml2" "2.10.1": diff --git a/recipes/fast-dds/all/patches/2.11.1-0001-fix-find-asio-and-tinyxml2.patch b/recipes/fast-dds/all/patches/2.11.1-0001-fix-find-asio-and-tinyxml2.patch deleted file mode 100644 index bada751126e810..00000000000000 --- a/recipes/fast-dds/all/patches/2.11.1-0001-fix-find-asio-and-tinyxml2.patch +++ /dev/null @@ -1,31 +0,0 @@ -From b8c533b0fb2b92e9bd2aada5e195d7a0b3c0c6a9 Mon Sep 17 00:00:00 2001 -From: Joakim Haugen -Date: Wed, 10 May 2023 13:17:11 +0200 -Subject: [PATCH] fix find asio and tinyxml2 - ---- - CMakeLists.txt | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b01b2c470..7867feff3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -232,9 +232,11 @@ if(NOT BUILD_SHARED_LIBS) - set(FASTDDS_STATIC ON) - endif() - --eprosima_find_package(fastcdr REQUIRED) --eprosima_find_thirdparty(Asio asio VERSION 1.10.8) --eprosima_find_thirdparty(TinyXML2 tinyxml2) -+eprosima_find_thirdparty(fastcdr REQUIRED) -+eprosima_find_thirdparty(asio REQUIRED) -+eprosima_find_thirdparty(tinyxml2 REQUIRED) -+set(TINYXML2_LIBRARY tinyxml2::tinyxml2) -+set(Asio_INCLUDE_DIR ${asio_INCLUDE_DIR}) - - find_package(foonathan_memory REQUIRED) - message(STATUS "Found foonathan_memory: ${foonathan_memory_DIR}") --- -2.30.2 - diff --git a/recipes/fast-dds/all/patches/2.3.2-0001-fix-find-asio-and-tinyxml2.patch b/recipes/fast-dds/all/patches/2.3.2-0001-fix-find-asio-and-tinyxml2.patch deleted file mode 100644 index 5d4d5bc2037bbd..00000000000000 --- a/recipes/fast-dds/all/patches/2.3.2-0001-fix-find-asio-and-tinyxml2.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8a9cb0209..400c681e7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -225,8 +225,8 @@ if(NOT BUILD_SHARED_LIBS) - endif() - - eprosima_find_package(fastcdr REQUIRED) --eprosima_find_thirdparty(Asio asio VERSION 1.10.8) --eprosima_find_thirdparty(TinyXML2 tinyxml2) -+eprosima_find_thirdparty(asio REQUIRED) -+eprosima_find_thirdparty(tinyxml2 REQUIRED) - - find_package(foonathan_memory REQUIRED) - message(STATUS "Found foonathan_memory: ${foonathan_memory_DIR}") -diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt -index 04d313bf2..efd1f9f7a 100644 ---- a/src/cpp/CMakeLists.txt -+++ b/src/cpp/CMakeLists.txt -@@ -434,7 +434,7 @@ elseif(NOT EPROSIMA_INSTALLER) - $ - $ - PRIVATE -- ${Asio_INCLUDE_DIR} -+ ${asio_INCLUDE_DIR} - ${TINYXML2_INCLUDE_DIR} - $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> - ${THIRDPARTY_BOOST_INCLUDE_DIR} -@@ -455,7 +455,7 @@ elseif(NOT EPROSIMA_INSTALLER) - # Link library to external libraries. - target_link_libraries(${PROJECT_NAME} ${PRIVACY} fastcdr foonathan_memory - ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} -- ${TINYXML2_LIBRARY} -+ tinyxml2::tinyxml2 - $<$:OpenSSL::SSL$OpenSSL::Crypto> - $<$:iphlpapi$Shlwapi> - ${THIRDPARTY_BOOST_LINK_LIBS} -@@ -536,7 +536,7 @@ if(UNIX AND EPROSIMA_INSTALLER) - COMPONENT headers - ) - -- set_public_headers_directory(${Asio_INCLUDE_DIR} "" -+ set_public_headers_directory(${asio_INCLUDE_DIR} "" - DESTINATION thirdparty/asio - COMPONENT headers - ) diff --git a/recipes/fixed-containers/all/conanfile.py b/recipes/fixed-containers/all/conanfile.py index cdfe73d72c2b9b..9729326c0e7253 100644 --- a/recipes/fixed-containers/all/conanfile.py +++ b/recipes/fixed-containers/all/conanfile.py @@ -37,6 +37,9 @@ def _compilers_minimum_version(self): def layout(self): basic_layout(self, src_folder="src") + def requirements(self): + self.requires("magic_enum/0.9.3", transitive_headers=True) + def package_id(self): self.info.clear() @@ -64,3 +67,6 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "fixed_containers") + self.cpp_info.set_property("cmake_target_name", "fixed_containers::fixed_containers") diff --git a/recipes/fixed-containers/all/test_package/CMakeLists.txt b/recipes/fixed-containers/all/test_package/CMakeLists.txt index 697ff29d18c1a0..24c19844b253bd 100644 --- a/recipes/fixed-containers/all/test_package/CMakeLists.txt +++ b/recipes/fixed-containers/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -find_package(fixed-containers REQUIRED CONFIG) +find_package(fixed_containers) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE fixed-containers::fixed-containers) +target_link_libraries(${PROJECT_NAME} PRIVATE fixed_containers::fixed_containers) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/fixed-containers/all/test_package/test_package.cpp b/recipes/fixed-containers/all/test_package/test_package.cpp index aed686f3d11070..d129e8622b3d90 100644 --- a/recipes/fixed-containers/all/test_package/test_package.cpp +++ b/recipes/fixed-containers/all/test_package/test_package.cpp @@ -1,10 +1,9 @@ #include "fixed_containers/fixed_vector.hpp" - -using namespace fixed_containers; +#include "fixed_containers/enum_utils.hpp" int main(void) { constexpr auto v1 = []() { - FixedVector v{}; + fixed_containers::FixedVector v{}; v.push_back(0); v.emplace_back(1); v.push_back(2); diff --git a/recipes/flatbuffers/all/conandata.yml b/recipes/flatbuffers/all/conandata.yml index 0cb168b6cedaa5..f334b7432aac31 100644 --- a/recipes/flatbuffers/all/conandata.yml +++ b/recipes/flatbuffers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "24.3.25": + url: "https://github.com/google/flatbuffers/archive/v24.3.25.tar.gz" + sha256: "4157c5cacdb59737c5d627e47ac26b140e9ee28b1102f812b36068aab728c1ed" "24.3.7": url: "https://github.com/google/flatbuffers/archive/v24.3.7.tar.gz" sha256: "bfff9d2150fcff88f844e8c608b02b2a0e94c92aea39b04c0624783464304784" diff --git a/recipes/flatbuffers/config.yml b/recipes/flatbuffers/config.yml index 7828770c7bd8ac..5bc4e9c3e21fdf 100644 --- a/recipes/flatbuffers/config.yml +++ b/recipes/flatbuffers/config.yml @@ -1,4 +1,6 @@ versions: + "24.3.25": + folder: all "24.3.7": folder: all "23.5.26": diff --git a/recipes/fontconfig/all/conandata.yml b/recipes/fontconfig/all/conandata.yml deleted file mode 100644 index d4f92f5455a44c..00000000000000 --- a/recipes/fontconfig/all/conandata.yml +++ /dev/null @@ -1,7 +0,0 @@ -sources: - "2.13.92": - url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.92.tar.gz" - sha256: "3406a05b83a42231e3df68d02bc0a0cf47b3f2e8f11c8ede62267daf5f130016" - "2.13.91": - url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.91.tar.gz" - sha256: "19e5b1bc9d013a52063a44e1307629711f0bfef35b9aca16f9c793971e2eb1e5" diff --git a/recipes/fontconfig/all/conanfile.py b/recipes/fontconfig/all/conanfile.py deleted file mode 100644 index 543e746cf6bf8c..00000000000000 --- a/recipes/fontconfig/all/conanfile.py +++ /dev/null @@ -1,150 +0,0 @@ -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, replace_in_file, rm, rmdir -from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps -from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc -import os - -required_conan_version = ">=1.54.0" - - -class FontconfigConan(ConanFile): - name = "fontconfig" - license = "MIT" - url = "https://github.com/conan-io/conan-center-index" - description = "Fontconfig is a library for configuring and customizing font access" - homepage = "https://gitlab.freedesktop.org/fontconfig/fontconfig" - topics = ("fonts", "freedesktop") - 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 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 requirements(self): - self.requires("freetype/2.13.2") - self.requires("expat/2.6.0") - if self.settings.os == "Linux": - self.requires("util-linux-libuuid/2.39.2") - - def validate(self): - if is_msvc(self): - raise ConanInvalidConfiguration("fontconfig does not support Visual Studio for versions < 2.13.93.") - - def build_requirements(self): - self.tool_requires("gperf/3.1") - if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") - 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() - 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-shared={yes_no(self.options.shared)}", - f"--enable-static={yes_no(not self.options.shared)}", - "--disable-docs", - "--disable-nls", - "--sysconfdir=${prefix}/bin/etc", - "--datadir=${prefix}/bin/share", - "--datarootdir=${prefix}/bin/share", - "--localstatedir=${prefix}/bin/var", - ]) - tc.generate() - - deps = AutotoolsDeps(self) - deps.generate() - deps = PkgConfigDeps(self) - deps.generate() - - def _patch_files(self): - # fontconfig requires libtool version number, change it for the corresponding freetype one - replace_in_file( - self, os.path.join(self.generators_folder, "freetype2.pc"), - "Version: {}".format(self.dependencies["freetype"].ref.version), - "Version: {}".format(self.dependencies["freetype"].conf_info.get("user.freetype:libtool_version")), - ) - # disable fc-cache test to enable cross compilation but also builds with shared libraries on MacOS - replace_in_file(self, - os.path.join(self.source_folder, "Makefile.in"), - "@CROSS_COMPILING_TRUE@RUN_FC_CACHE_TEST = false", - "RUN_FC_CACHE_TEST=false" - ) - - def build(self): - self._patch_files() - autotools = Autotools(self) - autotools.configure() - replace_in_file(self, os.path.join(self.build_folder, "Makefile"), "po-conf test", "po-conf") - 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() - rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - rm(self, "*.conf", os.path.join(self.package_folder, "bin", "etc", "fonts", "conf.d")) - rm(self, "*.def", os.path.join(self.package_folder, "lib")) - rm(self, "*.la", 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, "etc")) - rmdir(self, os.path.join(self.package_folder, "share")) - fix_apple_shared_install_name(self) - - def package_info(self): - self.cpp_info.set_property("cmake_find_mode", "both") - self.cpp_info.set_property("cmake_file_name", "Fontconfig") - self.cpp_info.set_property("cmake_target_name", "Fontconfig::Fontconfig") - self.cpp_info.set_property("pkg_config_name", "fontconfig") - self.cpp_info.libs = ["fontconfig"] - if self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.system_libs.extend(["m", "pthread"]) - - fontconfig_file = os.path.join(self.package_folder, "bin", "etc", "fonts", "fonts.conf") - self.runenv_info.prepend_path("FONTCONFIG_FILE", fontconfig_file) - - fontconfig_path = os.path.join(self.package_folder, "bin", "etc", "fonts") - self.runenv_info.prepend_path("FONTCONFIG_PATH", fontconfig_path) - - # TODO: to remove in conan v2 - self.cpp_info.names["cmake_find_package"] = "Fontconfig" - self.cpp_info.names["cmake_find_package_multi"] = "Fontconfig" - self.env_info.FONTCONFIG_FILE = fontconfig_file - self.env_info.FONTCONFIG_PATH = fontconfig_path diff --git a/recipes/fontconfig/all/test_package/CMakeLists.txt b/recipes/fontconfig/all/test_package/CMakeLists.txt deleted file mode 100644 index 5def13d67bcff8..00000000000000 --- a/recipes/fontconfig/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(test_package LANGUAGES C) - -find_package(Fontconfig REQUIRED) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE Fontconfig::Fontconfig) -target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/fontconfig/all/test_package/test_package.c b/recipes/fontconfig/all/test_package/test_package.c deleted file mode 100644 index 3d2556b9cca2e7..00000000000000 --- a/recipes/fontconfig/all/test_package/test_package.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() { - FcInit(); - return 0; -} diff --git a/recipes/fontconfig/all/test_v1_package/CMakeLists.txt b/recipes/fontconfig/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68b..00000000000000 --- a/recipes/fontconfig/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/recipes/fontconfig/config.yml b/recipes/fontconfig/config.yml index 41c4db45e111e9..dafaaf15309ac8 100644 --- a/recipes/fontconfig/config.yml +++ b/recipes/fontconfig/config.yml @@ -5,7 +5,3 @@ versions: folder: meson "2.13.93": folder: meson - "2.13.92": - folder: all - "2.13.91": - folder: all diff --git a/recipes/fontconfig/meson/conanfile.py b/recipes/fontconfig/meson/conanfile.py index 95e3579f0f5491..828bf72f6aba37 100644 --- a/recipes/fontconfig/meson/conanfile.py +++ b/recipes/fontconfig/meson/conanfile.py @@ -50,15 +50,15 @@ def layout(self): def requirements(self): self.requires("freetype/2.13.2") - self.requires("expat/2.6.0") + self.requires("expat/[>=2.6.2 <3]") if self.settings.os == "Linux": self.requires("util-linux-libuuid/2.39.2") def build_requirements(self): self.tool_requires("gperf/3.1") - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/freeglut/all/conanfile.py b/recipes/freeglut/all/conanfile.py index 9b7f21448c4162..dc8ac66bf9e42a 100644 --- a/recipes/freeglut/all/conanfile.py +++ b/recipes/freeglut/all/conanfile.py @@ -85,8 +85,6 @@ def configure(self): self.options["libglvnd"].gles2 = True if self._requires_libglvnd_glx: self.options["libglvnd"].glx = True - if self.options.get_safe("with_wayland"): - self.options["xkbcommon"].with_wayland = True def layout(self): cmake_layout(self, src_folder="src") @@ -126,8 +124,6 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} requires the gles2 option of libglvnd to be enabled when the gles option is enabled") if self._requires_libglvnd_glx and not self.dependencies["libglvnd"].options.glx: raise ConanInvalidConfiguration(f"{self.ref} requires the glx option of libglvnd to be enabled when the gles option is disabled") - if self.options.get_safe("with_wayland") and not self.dependencies["xkbcommon"].options.with_wayland: - raise ConanInvalidConfiguration(f"{self.ref} requires the with_wayland option of xkbcommon to be enabled when the with_wayland option is enabled") def source(self): diff --git a/recipes/freeglut/all/test_package/conanfile.py b/recipes/freeglut/all/test_package/conanfile.py index 6e146f0e386425..0a6bc68712d901 100644 --- a/recipes/freeglut/all/test_package/conanfile.py +++ b/recipes/freeglut/all/test_package/conanfile.py @@ -14,7 +14,6 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("opengl/system") def build(self): cmake = CMake(self) diff --git a/recipes/freeglut/all/test_package_module/conanfile.py b/recipes/freeglut/all/test_package_module/conanfile.py index 6e146f0e386425..0a6bc68712d901 100644 --- a/recipes/freeglut/all/test_package_module/conanfile.py +++ b/recipes/freeglut/all/test_package_module/conanfile.py @@ -14,7 +14,6 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("opengl/system") def build(self): cmake = CMake(self) diff --git a/recipes/freexl/all/conanfile.py b/recipes/freexl/all/conanfile.py index 6f97355b38f7c3..7cbab97fd7d077 100644 --- a/recipes/freexl/all/conanfile.py +++ b/recipes/freexl/all/conanfile.py @@ -54,7 +54,7 @@ def layout(self): def requirements(self): self.requires("libiconv/1.17") if Version(self.version) >= "2.0.0": - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("minizip/1.2.13") def build_requirements(self): diff --git a/recipes/frugally-deep/all/conandata.yml b/recipes/frugally-deep/all/conandata.yml index e666368bd2a72c..8e2ab1f676fe63 100644 --- a/recipes/frugally-deep/all/conandata.yml +++ b/recipes/frugally-deep/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.16.0": + url: "https://github.com/Dobiasd/frugally-deep/archive/v0.16.0.tar.gz" + sha256: "5ffe8dddb43a645094b2ca1d48e4ee78e685fbef3c89f08cea8425a39dad9865" "0.15.31": url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.31.tar.gz" sha256: "49bf5e30ad2d33e464433afbc8b6fe8536fc959474004a1ce2ac03d7c54bc8ba" @@ -8,24 +11,3 @@ sources: "0.15.29": url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.29.tar.gz" sha256: "032cd525d4a7b9b3ebe28fd5e3984ac3e569da496f65d52c81030aabd9d0c52e" - "0.15.25-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.25-p0.tar.gz" - sha256: "d1204bc13ace603e97696aa7a1331d6af819c3a9b4952b4fd1e3d72dd8f524c3" - "0.15.24-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.24-p0.tar.gz" - sha256: "118b0219a3f17c6d5a3535874acb145ee2079fd309e1fb83884facc684810baf" - "0.15.19-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.19-p0.tar.gz" - sha256: "acaba428ae19ef8d57a53b3767373cd96770c190dd57909e52d2759be89ac942" - "0.15.18-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.18-p0.tar.gz" - sha256: "b721bd7b2fa842a1a10f00008e079c057fab7a5cfc4c394d64238ee59ad7e189" - "0.15.16-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.16-p0.tar.gz" - sha256: "778b8cf0da847239a2ad21c611331b231831c6c175154c68ca30dd87489336a5" - "0.15.13-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.13-p0.tar.gz" - sha256: "ca18c7b8dc0df3a36dba3c2578df35592e61ff51e5bbaa1c1ed3e6c529e14075" - "0.15.1-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.1-p0.tar.gz" - sha256: "ab15cb540a8ddeffa56cd8235bfdf709f5d6b3b2543d9ec83658c5d9bad02f18" diff --git a/recipes/frugally-deep/all/conanfile.py b/recipes/frugally-deep/all/conanfile.py index 5fb9992a315dcf..f2070b97639e64 100644 --- a/recipes/frugally-deep/all/conanfile.py +++ b/recipes/frugally-deep/all/conanfile.py @@ -39,7 +39,7 @@ def layout(self): def requirements(self): self.requires("eigen/3.4.0") - self.requires("functionalplus/0.2.23") + self.requires("functionalplus/0.2.24") self.requires("nlohmann_json/3.11.3") def package_id(self): diff --git a/recipes/frugally-deep/config.yml b/recipes/frugally-deep/config.yml index ef73eeeb31a1b8..4b946ca53d49d1 100644 --- a/recipes/frugally-deep/config.yml +++ b/recipes/frugally-deep/config.yml @@ -1,21 +1,9 @@ versions: + "0.16.0": + folder: all "0.15.31": folder: all "0.15.30": folder: all "0.15.29": folder: all - "0.15.25-p0": - folder: all - "0.15.24-p0": - folder: all - "0.15.19-p0": - folder: all - "0.15.18-p0": - folder: all - "0.15.16-p0": - folder: all - "0.15.13-p0": - folder: all - "0.15.1-p0": - folder: all diff --git a/recipes/functionalplus/all/conandata.yml b/recipes/functionalplus/all/conandata.yml index a99f4612ba4dbd..995124a2aca904 100644 --- a/recipes/functionalplus/all/conandata.yml +++ b/recipes/functionalplus/all/conandata.yml @@ -1,28 +1,10 @@ sources: + "0.2.24": + url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.24.tar.gz" + sha256: "446c63ac3f2045e7587f694501882a3d7c7b962b70bcc08deacf5777bdaaff8c" "0.2.23": url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.23.tar.gz" sha256: "5c2d28d2ba7d0cdeab9e31bbf2e7f8a9d6f2ff6111a54bfc11d1b05422096f19" "0.2.22": url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.22.tar.gz" sha256: "79378668dff6ffa8abc1abde2c2fe37dc6fe1ac040c55d5ee7886924fa6a1376" - "0.2.20-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.20-p0.tar.gz" - sha256: "6a8e56bd7976b7d5a6a31001f36bc199c2997f1144994fa0b48a1a5b8497abbc" - "0.2.18-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.18-p0.tar.gz" - sha256: "ffc63fc86f89a205accafa85c35790eda307adf5f1d6d51bb7ceb5c5e21e013b" - "0.2.17-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.17-p0.tar.gz" - sha256: "c41514b24a81ad47a8f98b3ef3a3bd3fe8109085f7965e9678386b08721e3620" - "0.2.16": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.16-p0.tar.gz" - sha256: "6026e64260afbd6941aaf19559d6e5dc51cbb3e045ef8d8e158d96bcd8651ed6" - "0.2.15": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.15-p0.tar.gz" - sha256: "4c76104ec8f6da5e66ed768380bdf128e0ba01725056c40a3c1b850cf4b441ad" - "0.2.14-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/v0.2.14-p0.tar.gz" - sha256: "68a0e715aa18d2fe558fede06d65ec125959895efe4d0ef21b102037c9864ba1" - "0.2.13-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.13-p0.tar.gz" - sha256: "62f61ce6500859f0d77306b1644b5c6992287688de38e170b17b8a66b2448b54" diff --git a/recipes/functionalplus/config.yml b/recipes/functionalplus/config.yml index ebd7ef7a33637a..13685d2ebceafa 100644 --- a/recipes/functionalplus/config.yml +++ b/recipes/functionalplus/config.yml @@ -1,19 +1,7 @@ versions: + "0.2.24": + folder: all "0.2.23": folder: all "0.2.22": folder: all - "0.2.20-p0": - folder: all - "0.2.18-p0": - folder: all - "0.2.17-p0": - folder: all - "0.2.16": - folder: all - "0.2.15": - folder: all - "0.2.14-p0": - folder: all - "0.2.13-p0": - folder: all diff --git a/recipes/gdcm/all/conanfile.py b/recipes/gdcm/all/conanfile.py index 5a0b267df427da..226e90aa0ee71b 100644 --- a/recipes/gdcm/all/conanfile.py +++ b/recipes/gdcm/all/conanfile.py @@ -57,8 +57,8 @@ def layout(self): def requirements(self): self.requires("charls/2.4.2") - self.requires("expat/2.5.0") - self.requires("openjpeg/2.5.0") + self.requires("expat/[>=2.6.2 <3]") + self.requires("openjpeg/2.5.2") if self.options.with_zlibng: self.requires("zlib-ng/2.1.6") else: diff --git a/recipes/giflib/5.1.x/conanfile.py b/recipes/giflib/5.1.x/conanfile.py index 9853dbf433aced..ea0071d4e34681 100644 --- a/recipes/giflib/5.1.x/conanfile.py +++ b/recipes/giflib/5.1.x/conanfile.py @@ -1,19 +1,27 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os import shutil -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import chdir, copy, get, rename, 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, unix_path + +required_conan_version = ">=1.53.0" class GiflibConan(ConanFile): name = "giflib" description = "A library and utilities for reading and writing GIF images." - url = "https://github.com/conan-io/conan-center-index" license = "MIT" + url = "https://github.com/conan-io/conan-center-index" homepage = "http://giflib.sourceforge.net" - topics = ("giflib", "image", "multimedia", "format", "graphics") + topics = ("image", "multimedia", "format", "graphics") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,25 +32,16 @@ class GiflibConan(ConanFile): "fPIC": True, } - # The exported files I took them from https://github.com/bjornblissing/osg-3rdparty-cmake/tree/master/giflib - # refactored a little - exports_sources = ["unistd.h", "gif_lib.h"] - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) - @property - def _user_info_build(self): - return getattr(self, "user_info_build", self.deps_user_info) + def export_sources(self): + # The exported files I took them from + # https://github.com/bjornblissing/osg-3rdparty-cmake/tree/master/giflib + # refactored a little + copy(self, "unistd.h", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "gif_lib.h", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -50,110 +49,100 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + 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 build_requirements(self): - if not self._is_msvc: - self.build_requires("gnu-config/cci.20201022") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + if not is_msvc(self): + 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") + if is_msvc(self): + self.tool_requires("automake/1.16.5") 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 generate(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + if is_msvc(self): + tc.extra_defines.append("USE_GIF_DLL" if self.options.shared else "USE_GIF_LIB") + tc.extra_cflags.append("-FS") + tc.generate() + + if is_msvc(self): + env = Environment() + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-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") + # ar-lib wrapper is added by ./configure automatically + # env.define("AR", f'{ar_wrapper} "lib -nologo"') + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_msvc") + + def _patch_sources(self): + # disable util build - tools and internal libs + replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"), + "SUBDIRS = lib util pic $(am__append_1)", + "SUBDIRS = lib pic $(am__append_1)") + + if is_msvc(self): + # add unistd.h for VS + shutil.copy(os.path.join(self.export_sources_folder, "unistd.h"), + os.path.join(self.source_folder, "lib")) + # fully replace gif_lib.h for VS, with patched version + ver_components = self.version.split(".") + header_path = os.path.join(self.source_folder, "lib", "gif_lib.h") + shutil.copy(os.path.join(self.export_sources_folder, "gif_lib.h"), header_path) + replace_in_file(self, header_path, "@GIFLIB_MAJOR@", ver_components[0]) + replace_in_file(self, header_path, "@GIFLIB_MINOR@", ver_components[1]) + replace_in_file(self, header_path, "@GIFLIB_RELEASE@", ver_components[2]) + 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) + if is_apple_os(self): + # relocatable shared lib on macOS + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "-install_name \\$rpath/\\$soname", + "-install_name \\@rpath/\\$soname") def build(self): - # disable util build - tools and internal libs - tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.in"), - "SUBDIRS = lib util pic $(am__append_1)", - "SUBDIRS = lib pic $(am__append_1)") - - if self._is_msvc: - self.build_visual() - else: - self.build_configure() - - def build_visual(self): - # fully replace gif_lib.h for VS, with patched version - ver_components = self.version.split(".") - tools.replace_in_file("gif_lib.h", "@GIFLIB_MAJOR@", ver_components[0]) - tools.replace_in_file("gif_lib.h", "@GIFLIB_MINOR@", ver_components[1]) - tools.replace_in_file("gif_lib.h", "@GIFLIB_RELEASE@", ver_components[2]) - shutil.copy("gif_lib.h", os.path.join(self._source_subfolder, "lib")) - # add unistd.h for VS - shutil.copy("unistd.h", os.path.join(self._source_subfolder, "lib")) - - with tools.chdir(self._source_subfolder): - if self.settings.arch == "x86": - host = "i686-w64-mingw32" - elif self.settings.arch == "x86_64": - host = "x86_64-w64-mingw32" - else: - raise ConanInvalidConfiguration("unsupported architecture %s" % self.settings.arch) - if self.options.shared: - options = "--disable-static --enable-shared" - else: - options = "--enable-static --disable-shared" - - cflags = "" - if not self.options.shared: - cflags = "-DUSE_GIF_LIB" - - prefix = tools.unix_path(os.path.abspath(self.package_folder)) - with tools.vcvars(self.settings): - command = "./configure " \ - "{options} " \ - "--host={host} " \ - "--prefix={prefix} " \ - 'CC="$PWD/compile cl -nologo" ' \ - 'CFLAGS="-{runtime} {cflags}" ' \ - 'CXX="$PWD/compile cl -nologo" ' \ - 'CXXFLAGS="-{runtime} {cflags}" ' \ - 'CPPFLAGS="-I{prefix}/include" ' \ - 'LDFLAGS="-L{prefix}/lib" ' \ - 'LD="link" ' \ - 'NM="dumpbin -symbols" ' \ - 'STRIP=":" ' \ - 'AR="$PWD/ar-lib lib" ' \ - 'RANLIB=":" '.format(host=host, prefix=prefix, options=options, - runtime=self.settings.compiler.runtime, cflags=cflags) - self.run(command, win_bash=True) - self.run("make", win_bash=True) - self.run("make install", win_bash=True) - - def build_configure(self): - shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB, - os.path.join(self._source_subfolder, "config.sub")) - shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS, - os.path.join(self._source_subfolder, "config.guess")) - env_build = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - yes_no = lambda v: "yes" if v else "no" - args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - ] - with tools.chdir(self._source_subfolder): - if tools.is_apple_os(self.settings.os): - # relocatable shared lib on macOS - tools.replace_in_file( - "configure", - "-install_name \\$rpath/\\$soname", - "-install_name \\@rpath/\\$soname" - ) - - self.run("chmod +x configure") - env_build.configure(args=args) - env_build.make() - env_build.make(args=["install"]) + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy(pattern="COPYING*", dst="licenses", src=self._source_subfolder, ignore_case=True, keep_path=False) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "share")) - if self._is_msvc and self.options.shared: - tools.rename(os.path.join(self.package_folder, "lib", "gif.dll.lib"), + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + copy(self, "COPYING*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, keep_path=False) + rm(self, "*.la", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "share")) + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "gif.dll.lib"), os.path.join(self.package_folder, "lib", "gif.lib")) def package_info(self): @@ -161,9 +150,10 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "GIF") self.cpp_info.set_property("cmake_target_name", "GIF::GIF") - self.cpp_info.names["cmake_find_package"] = "GIF" - self.cpp_info.names["cmake_find_package_multi"] = "GIF" - self.cpp_info.libs = ["gif"] - if self._is_msvc: + if is_msvc(self): self.cpp_info.defines.append("USE_GIF_DLL" if self.options.shared else "USE_GIF_LIB") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "GIF" + self.cpp_info.names["cmake_find_package_multi"] = "GIF" diff --git a/recipes/giflib/5.1.x/test_package/CMakeLists.txt b/recipes/giflib/5.1.x/test_package/CMakeLists.txt index 95fca5bec20b23..b39dc8b19722de 100644 --- a/recipes/giflib/5.1.x/test_package/CMakeLists.txt +++ b/recipes/giflib/5.1.x/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(GIF REQUIRED) +find_package(GIF REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} GIF::GIF) diff --git a/recipes/giflib/5.1.x/test_package/conanfile.py b/recipes/giflib/5.1.x/test_package/conanfile.py index 9c22b9663e80c9..77c3c08f8b8ede 100644 --- a/recipes/giflib/5.1.x/test_package/conanfile.py +++ b/recipes/giflib/5.1.x/test_package/conanfile.py @@ -1,19 +1,29 @@ -from conans import ConanFile, CMake, tools +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_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) def build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": + if is_apple_os(self) and self.settings.arch == "armv8": # Workaround for CMake bug with error message: # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being # set. This could be because you are using a Mac OS X version less than 10.5 # or because CMake's platform configuration is corrupt. # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. - self.build_requires("cmake/3.22.0") + self.tool_requires("cmake/[>=3.22]") + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -21,8 +31,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): img_name = os.path.join(self.source_folder, "testimg.gif") - bin_path = os.path.join("bin", "test_package") - command = "{} {}".format(bin_path, img_name) - self.run(command, run_environment=True) + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(f"{bin_path} {img_name}", env="conanrun") diff --git a/recipes/libassert/all/test_v1_package/CMakeLists.txt b/recipes/giflib/5.1.x/test_v1_package/CMakeLists.txt similarity index 85% rename from recipes/libassert/all/test_v1_package/CMakeLists.txt rename to recipes/giflib/5.1.x/test_v1_package/CMakeLists.txt index 925ecbe19e448d..91630d79f4abb3 100644 --- a/recipes/libassert/all/test_v1_package/CMakeLists.txt +++ b/recipes/giflib/5.1.x/test_v1_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/giflib/5.1.x/test_v1_package/conanfile.py b/recipes/giflib/5.1.x/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..2b12681e5d894f --- /dev/null +++ b/recipes/giflib/5.1.x/test_v1_package/conanfile.py @@ -0,0 +1,29 @@ +from conan.tools.apple import is_apple_os +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_requirements(self): + if is_apple_os(self) and self.settings.arch == "armv8": + # Workaround for CMake bug with error message: + # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being + # set. This could be because you are using a Mac OS X version less than 10.5 + # or because CMake's platform configuration is corrupt. + # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. + self.build_requires("cmake/3.22.0") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + img_name = os.path.join(self.source_folder, "testimg.gif") + bin_path = os.path.join("bin", "test_package") + command = "{} {}".format(bin_path, img_name) + self.run(command, run_environment=True) diff --git a/recipes/giflib/5.2.x/conandata.yml b/recipes/giflib/5.2.x/conandata.yml index e36e2cd9d7be2d..ea8a0bcf52687d 100644 --- a/recipes/giflib/5.2.x/conandata.yml +++ b/recipes/giflib/5.2.x/conandata.yml @@ -1,7 +1,21 @@ sources: + "5.2.2": + url: "https://downloads.sourceforge.net/project/giflib/giflib-5.2.2.tar.gz" + sha256: "be7ffbd057cadebe2aa144542fd90c6838c6a083b5e8a9048b8ee3b66b29d5fb" "5.2.1": url: "https://downloads.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz" sha256: "31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd" patches: + "5.2.2": + - patch_file: "patches/0000-msvc-strtok_r.patch" + patch_description: "Use strtok_s instead of strtok_r with MSVC" + patch_type: "portability" + - patch_file: "patches/5.2.2-0001-msvc-export.patch" + patch_description: "export symbols with MSVC" + patch_type: "portability" "5.2.1": + - patch_file: "patches/0000-msvc-strtok_r.patch" + patch_description: "Use strtok_s instead of strtok_r with MSVC" + patch_type: "portability" - patch_file: "patches/0001-msvc-unistd.patch" + - patch_file: "patches/5.2.1-0002-msvc-export.patch" diff --git a/recipes/giflib/5.2.x/patches/0000-msvc-strtok_r.patch b/recipes/giflib/5.2.x/patches/0000-msvc-strtok_r.patch new file mode 100644 index 00000000000000..e9b7a0f9661b82 --- /dev/null +++ b/recipes/giflib/5.2.x/patches/0000-msvc-strtok_r.patch @@ -0,0 +1,15 @@ +diff --git a/gif_font.c b/gif_font.c +index d90783c..0fd20ed 100644 +--- a/gif_font.c ++++ b/gif_font.c +@@ -11,6 +11,10 @@ SPDX-License-Identifier: MIT + + #include "gif_lib.h" + ++#ifdef _MSC_VER ++# define strtok_r strtok_s ++#endif ++ + /***************************************************************************** + Ascii 8 by 8 regular font - only first 128 characters are supported. + *****************************************************************************/ diff --git a/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch b/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch index 05112f7bfb6f72..1a777f5c69b47e 100644 --- a/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch +++ b/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch @@ -1,18 +1,3 @@ -diff --git a/gif_font.c b/gif_font.c -index d90783c..0fd20ed 100644 ---- a/gif_font.c -+++ b/gif_font.c -@@ -11,6 +11,10 @@ SPDX-License-Identifier: MIT - - #include "gif_lib.h" - -+#ifdef _MSC_VER -+# define strtok_r strtok_s -+#endif -+ - /***************************************************************************** - Ascii 8 by 8 regular font - only first 128 characters are supported. - *****************************************************************************/ diff --git a/gif_hash.h b/gif_hash.h index 6a1b585..6311cd1 100644 --- a/gif_hash.h @@ -29,233 +14,3 @@ index 6a1b585..6311cd1 100644 #include #define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */ -diff --git a/gif_lib.h b/gif_lib.h -index ebdbd3c..bf0d373 100644 ---- a/gif_lib.h -+++ b/gif_lib.h -@@ -13,6 +13,20 @@ SPDX-License-Identifier: MIT - extern "C" { - #endif /* __cplusplus */ - -+#ifdef _MSC_VER -+ #ifdef USE_GIF_LIB -+ #define GIF_EXPORT -+ #else /* USE_GIF_LIB */ -+ #ifdef USE_GIF_DLL -+ #define GIF_EXPORT __declspec(dllimport) -+ #else /* USE_GIF_DLL */ -+ #define GIF_EXPORT __declspec(dllexport) -+ #endif /* USE_GIF_DLL */ -+ #endif /* USE_GIF_LIB */ -+#else -+ #define GIF_EXPORT -+#endif /* _MSC_VER */ -+ - #define GIFLIB_MAJOR 5 - #define GIFLIB_MINOR 2 - #define GIFLIB_RELEASE 1 -@@ -125,13 +139,13 @@ typedef struct GraphicsControlBlock { - ******************************************************************************/ - - /* Main entry points */ --GifFileType *EGifOpenFileName(const char *GifFileName, -+GIF_EXPORT GifFileType *EGifOpenFileName(const char *GifFileName, - const bool GifTestExistence, int *Error); --GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); --GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); --int EGifSpew(GifFileType * GifFile); --const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ --int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); -+GIF_EXPORT GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); -+GIF_EXPORT GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); -+GIF_EXPORT int EGifSpew(GifFileType * GifFile); -+GIF_EXPORT const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ -+GIF_EXPORT int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); - - #define E_GIF_SUCCEEDED 0 - #define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ -@@ -146,31 +160,31 @@ int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); - #define E_GIF_ERR_NOT_WRITEABLE 10 - - /* These are legacy. You probably do not want to call them directly */ --int EGifPutScreenDesc(GifFileType *GifFile, -+GIF_EXPORT int EGifPutScreenDesc(GifFileType *GifFile, - const int GifWidth, const int GifHeight, - const int GifColorRes, - const int GifBackGround, - const ColorMapObject *GifColorMap); --int EGifPutImageDesc(GifFileType *GifFile, -+GIF_EXPORT int EGifPutImageDesc(GifFileType *GifFile, - const int GifLeft, const int GifTop, - const int GifWidth, const int GifHeight, - const bool GifInterlace, - const ColorMapObject *GifColorMap); --void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); --int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, -+GIF_EXPORT void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); -+GIF_EXPORT int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, - int GifLineLen); --int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); --int EGifPutComment(GifFileType *GifFile, const char *GifComment); --int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); --int EGifPutExtensionBlock(GifFileType *GifFile, -+GIF_EXPORT int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); -+GIF_EXPORT int EGifPutComment(GifFileType *GifFile, const char *GifComment); -+GIF_EXPORT int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); -+GIF_EXPORT int EGifPutExtensionBlock(GifFileType *GifFile, - const int GifExtLen, const void *GifExtension); --int EGifPutExtensionTrailer(GifFileType *GifFile); --int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, -+GIF_EXPORT int EGifPutExtensionTrailer(GifFileType *GifFile); -+GIF_EXPORT int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, - const int GifExtLen, - const void *GifExtension); --int EGifPutCode(GifFileType *GifFile, int GifCodeSize, -+GIF_EXPORT int EGifPutCode(GifFileType *GifFile, int GifCodeSize, - const GifByteType *GifCodeBlock); --int EGifPutCodeNext(GifFileType *GifFile, -+GIF_EXPORT int EGifPutCodeNext(GifFileType *GifFile, - const GifByteType *GifCodeBlock); - - /****************************************************************************** -@@ -178,11 +192,11 @@ int EGifPutCodeNext(GifFileType *GifFile, - ******************************************************************************/ - - /* Main entry points */ --GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); --GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); --int DGifSlurp(GifFileType * GifFile); --GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ -- int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); -+GIF_EXPORT GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); -+GIF_EXPORT GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); -+GIF_EXPORT int DGifSlurp(GifFileType * GifFile); -+GIF_EXPORT GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ -+GIF_EXPORT int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); - - #define D_GIF_SUCCEEDED 0 - #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ -@@ -200,26 +214,26 @@ GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new - #define D_GIF_ERR_EOF_TOO_SOON 113 - - /* These are legacy. You probably do not want to call them directly */ --int DGifGetScreenDesc(GifFileType *GifFile); --int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); --int DGifGetImageHeader(GifFileType *GifFile); --int DGifGetImageDesc(GifFileType *GifFile); --int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); --int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); --int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, -+GIF_EXPORT int DGifGetScreenDesc(GifFileType *GifFile); -+GIF_EXPORT int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); -+GIF_EXPORT int DGifGetImageHeader(GifFileType *GifFile); -+GIF_EXPORT int DGifGetImageDesc(GifFileType *GifFile); -+GIF_EXPORT int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); -+GIF_EXPORT int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); -+GIF_EXPORT int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, - GifByteType **GifExtension); --int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); --int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, -+GIF_EXPORT int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); -+GIF_EXPORT int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, - GifByteType **GifCodeBlock); --int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); --int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); --const char *DGifGetGifVersion(GifFileType *GifFile); -+GIF_EXPORT int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); -+GIF_EXPORT int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); -+GIF_EXPORT const char *DGifGetGifVersion(GifFileType *GifFile); - - - /****************************************************************************** - Error handling and reporting. - ******************************************************************************/ --extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ -+GIF_EXPORT extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ - - /***************************************************************************** - Everything below this point is new after version 1.2, supporting `slurp -@@ -230,43 +244,43 @@ extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ - Color map handling from gif_alloc.c - ******************************************************************************/ - --extern ColorMapObject *GifMakeMapObject(int ColorCount, -+GIF_EXPORT extern ColorMapObject *GifMakeMapObject(int ColorCount, - const GifColorType *ColorMap); --extern void GifFreeMapObject(ColorMapObject *Object); --extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, -+GIF_EXPORT extern void GifFreeMapObject(ColorMapObject *Object); -+GIF_EXPORT extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, - const ColorMapObject *ColorIn2, - GifPixelType ColorTransIn2[]); --extern int GifBitSize(int n); -+GIF_EXPORT extern int GifBitSize(int n); - - /****************************************************************************** - Support for the in-core structures allocation (slurp mode). - ******************************************************************************/ - --extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); --extern int GifAddExtensionBlock(int *ExtensionBlock_Count, -+GIF_EXPORT extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); -+GIF_EXPORT extern int GifAddExtensionBlock(int *ExtensionBlock_Count, - ExtensionBlock **ExtensionBlocks, - int Function, - unsigned int Len, unsigned char ExtData[]); --extern void GifFreeExtensions(int *ExtensionBlock_Count, -+GIF_EXPORT extern void GifFreeExtensions(int *ExtensionBlock_Count, - ExtensionBlock **ExtensionBlocks); --extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, -+GIF_EXPORT extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, - const SavedImage *CopyFrom); --extern void GifFreeSavedImages(GifFileType *GifFile); -+GIF_EXPORT extern void GifFreeSavedImages(GifFileType *GifFile); - - /****************************************************************************** - 5.x functions for GIF89 graphics control blocks - ******************************************************************************/ - --int DGifExtensionToGCB(const size_t GifExtensionLength, -+GIF_EXPORT int DGifExtensionToGCB(const size_t GifExtensionLength, - const GifByteType *GifExtension, - GraphicsControlBlock *GCB); --size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, -+GIF_EXPORT size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, - GifByteType *GifExtension); - --int DGifSavedExtensionToGCB(GifFileType *GifFile, -+GIF_EXPORT int DGifSavedExtensionToGCB(GifFileType *GifFile, - int ImageIndex, - GraphicsControlBlock *GCB); --int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, -+GIF_EXPORT int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, - GifFileType *GifFile, - int ImageIndex); - -@@ -276,21 +290,21 @@ int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, - - #define GIF_FONT_WIDTH 8 - #define GIF_FONT_HEIGHT 8 --extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; -+GIF_EXPORT extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; - --extern void GifDrawText8x8(SavedImage *Image, -+GIF_EXPORT extern void GifDrawText8x8(SavedImage *Image, - const int x, const int y, - const char *legend, const int color); - --extern void GifDrawBox(SavedImage *Image, -+GIF_EXPORT extern void GifDrawBox(SavedImage *Image, - const int x, const int y, - const int w, const int d, const int color); - --extern void GifDrawRectangle(SavedImage *Image, -+GIF_EXPORT extern void GifDrawRectangle(SavedImage *Image, - const int x, const int y, - const int w, const int d, const int color); - --extern void GifDrawBoxedText8x8(SavedImage *Image, -+GIF_EXPORT extern void GifDrawBoxedText8x8(SavedImage *Image, - const int x, const int y, - const char *legend, - const int border, const int bg, const int fg); diff --git a/recipes/giflib/5.2.x/patches/5.2.1-0002-msvc-export.patch b/recipes/giflib/5.2.x/patches/5.2.1-0002-msvc-export.patch new file mode 100644 index 00000000000000..d9383c54a5729d --- /dev/null +++ b/recipes/giflib/5.2.x/patches/5.2.1-0002-msvc-export.patch @@ -0,0 +1,230 @@ +diff --git a/gif_lib.h b/gif_lib.h +index ebdbd3c..bf0d373 100644 +--- a/gif_lib.h ++++ b/gif_lib.h +@@ -13,6 +13,20 @@ SPDX-License-Identifier: MIT + extern "C" { + #endif /* __cplusplus */ + ++#ifdef _MSC_VER ++ #ifdef USE_GIF_LIB ++ #define GIF_EXPORT ++ #else /* USE_GIF_LIB */ ++ #ifdef USE_GIF_DLL ++ #define GIF_EXPORT __declspec(dllimport) ++ #else /* USE_GIF_DLL */ ++ #define GIF_EXPORT __declspec(dllexport) ++ #endif /* USE_GIF_DLL */ ++ #endif /* USE_GIF_LIB */ ++#else ++ #define GIF_EXPORT ++#endif /* _MSC_VER */ ++ + #define GIFLIB_MAJOR 5 + #define GIFLIB_MINOR 2 + #define GIFLIB_RELEASE 1 +@@ -125,13 +139,13 @@ typedef struct GraphicsControlBlock { + ******************************************************************************/ + + /* Main entry points */ +-GifFileType *EGifOpenFileName(const char *GifFileName, ++GIF_EXPORT GifFileType *EGifOpenFileName(const char *GifFileName, + const bool GifTestExistence, int *Error); +-GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); +-GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); +-int EGifSpew(GifFileType * GifFile); +-const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ +-int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); ++GIF_EXPORT GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); ++GIF_EXPORT GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); ++GIF_EXPORT int EGifSpew(GifFileType * GifFile); ++GIF_EXPORT const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ ++GIF_EXPORT int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); + + #define E_GIF_SUCCEEDED 0 + #define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ +@@ -146,31 +160,31 @@ int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); + #define E_GIF_ERR_NOT_WRITEABLE 10 + + /* These are legacy. You probably do not want to call them directly */ +-int EGifPutScreenDesc(GifFileType *GifFile, ++GIF_EXPORT int EGifPutScreenDesc(GifFileType *GifFile, + const int GifWidth, const int GifHeight, + const int GifColorRes, + const int GifBackGround, + const ColorMapObject *GifColorMap); +-int EGifPutImageDesc(GifFileType *GifFile, ++GIF_EXPORT int EGifPutImageDesc(GifFileType *GifFile, + const int GifLeft, const int GifTop, + const int GifWidth, const int GifHeight, + const bool GifInterlace, + const ColorMapObject *GifColorMap); +-void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); +-int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, ++GIF_EXPORT void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); ++GIF_EXPORT int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, + int GifLineLen); +-int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); +-int EGifPutComment(GifFileType *GifFile, const char *GifComment); +-int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); +-int EGifPutExtensionBlock(GifFileType *GifFile, ++GIF_EXPORT int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); ++GIF_EXPORT int EGifPutComment(GifFileType *GifFile, const char *GifComment); ++GIF_EXPORT int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); ++GIF_EXPORT int EGifPutExtensionBlock(GifFileType *GifFile, + const int GifExtLen, const void *GifExtension); +-int EGifPutExtensionTrailer(GifFileType *GifFile); +-int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, ++GIF_EXPORT int EGifPutExtensionTrailer(GifFileType *GifFile); ++GIF_EXPORT int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, + const int GifExtLen, + const void *GifExtension); +-int EGifPutCode(GifFileType *GifFile, int GifCodeSize, ++GIF_EXPORT int EGifPutCode(GifFileType *GifFile, int GifCodeSize, + const GifByteType *GifCodeBlock); +-int EGifPutCodeNext(GifFileType *GifFile, ++GIF_EXPORT int EGifPutCodeNext(GifFileType *GifFile, + const GifByteType *GifCodeBlock); + + /****************************************************************************** +@@ -178,11 +192,11 @@ int EGifPutCodeNext(GifFileType *GifFile, + ******************************************************************************/ + + /* Main entry points */ +-GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); +-GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); +-int DGifSlurp(GifFileType * GifFile); +-GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ +- int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); ++GIF_EXPORT GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); ++GIF_EXPORT GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); ++GIF_EXPORT int DGifSlurp(GifFileType * GifFile); ++GIF_EXPORT GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ ++GIF_EXPORT int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); + + #define D_GIF_SUCCEEDED 0 + #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ +@@ -200,26 +214,26 @@ GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new + #define D_GIF_ERR_EOF_TOO_SOON 113 + + /* These are legacy. You probably do not want to call them directly */ +-int DGifGetScreenDesc(GifFileType *GifFile); +-int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); +-int DGifGetImageHeader(GifFileType *GifFile); +-int DGifGetImageDesc(GifFileType *GifFile); +-int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); +-int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); +-int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, ++GIF_EXPORT int DGifGetScreenDesc(GifFileType *GifFile); ++GIF_EXPORT int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); ++GIF_EXPORT int DGifGetImageHeader(GifFileType *GifFile); ++GIF_EXPORT int DGifGetImageDesc(GifFileType *GifFile); ++GIF_EXPORT int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); ++GIF_EXPORT int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); ++GIF_EXPORT int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, + GifByteType **GifExtension); +-int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); +-int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, ++GIF_EXPORT int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); ++GIF_EXPORT int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, + GifByteType **GifCodeBlock); +-int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); +-int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); +-const char *DGifGetGifVersion(GifFileType *GifFile); ++GIF_EXPORT int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); ++GIF_EXPORT int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); ++GIF_EXPORT const char *DGifGetGifVersion(GifFileType *GifFile); + + + /****************************************************************************** + Error handling and reporting. + ******************************************************************************/ +-extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ ++GIF_EXPORT extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ + + /***************************************************************************** + Everything below this point is new after version 1.2, supporting `slurp +@@ -230,43 +244,43 @@ extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ + Color map handling from gif_alloc.c + ******************************************************************************/ + +-extern ColorMapObject *GifMakeMapObject(int ColorCount, ++GIF_EXPORT extern ColorMapObject *GifMakeMapObject(int ColorCount, + const GifColorType *ColorMap); +-extern void GifFreeMapObject(ColorMapObject *Object); +-extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, ++GIF_EXPORT extern void GifFreeMapObject(ColorMapObject *Object); ++GIF_EXPORT extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, + const ColorMapObject *ColorIn2, + GifPixelType ColorTransIn2[]); +-extern int GifBitSize(int n); ++GIF_EXPORT extern int GifBitSize(int n); + + /****************************************************************************** + Support for the in-core structures allocation (slurp mode). + ******************************************************************************/ + +-extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); +-extern int GifAddExtensionBlock(int *ExtensionBlock_Count, ++GIF_EXPORT extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); ++GIF_EXPORT extern int GifAddExtensionBlock(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks, + int Function, + unsigned int Len, unsigned char ExtData[]); +-extern void GifFreeExtensions(int *ExtensionBlock_Count, ++GIF_EXPORT extern void GifFreeExtensions(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks); +-extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, ++GIF_EXPORT extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, + const SavedImage *CopyFrom); +-extern void GifFreeSavedImages(GifFileType *GifFile); ++GIF_EXPORT extern void GifFreeSavedImages(GifFileType *GifFile); + + /****************************************************************************** + 5.x functions for GIF89 graphics control blocks + ******************************************************************************/ + +-int DGifExtensionToGCB(const size_t GifExtensionLength, ++GIF_EXPORT int DGifExtensionToGCB(const size_t GifExtensionLength, + const GifByteType *GifExtension, + GraphicsControlBlock *GCB); +-size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, ++GIF_EXPORT size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, + GifByteType *GifExtension); + +-int DGifSavedExtensionToGCB(GifFileType *GifFile, ++GIF_EXPORT int DGifSavedExtensionToGCB(GifFileType *GifFile, + int ImageIndex, + GraphicsControlBlock *GCB); +-int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, ++GIF_EXPORT int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, + GifFileType *GifFile, + int ImageIndex); + +@@ -276,21 +290,21 @@ int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, + + #define GIF_FONT_WIDTH 8 + #define GIF_FONT_HEIGHT 8 +-extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; ++GIF_EXPORT extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; + +-extern void GifDrawText8x8(SavedImage *Image, ++GIF_EXPORT extern void GifDrawText8x8(SavedImage *Image, + const int x, const int y, + const char *legend, const int color); + +-extern void GifDrawBox(SavedImage *Image, ++GIF_EXPORT extern void GifDrawBox(SavedImage *Image, + const int x, const int y, + const int w, const int d, const int color); + +-extern void GifDrawRectangle(SavedImage *Image, ++GIF_EXPORT extern void GifDrawRectangle(SavedImage *Image, + const int x, const int y, + const int w, const int d, const int color); + +-extern void GifDrawBoxedText8x8(SavedImage *Image, ++GIF_EXPORT extern void GifDrawBoxedText8x8(SavedImage *Image, + const int x, const int y, + const char *legend, + const int border, const int bg, const int fg); diff --git a/recipes/giflib/5.2.x/patches/5.2.2-0001-msvc-export.patch b/recipes/giflib/5.2.x/patches/5.2.2-0001-msvc-export.patch new file mode 100644 index 00000000000000..bdeb9f0885c6a5 --- /dev/null +++ b/recipes/giflib/5.2.x/patches/5.2.2-0001-msvc-export.patch @@ -0,0 +1,220 @@ +diff --git a/gif_lib.h b/gif_lib.h +--- a/gif_lib.h ++++ b/gif_lib.h +@@ -13,6 +13,20 @@ + extern "C" { + #endif /* __cplusplus */ + ++#ifdef _MSC_VER ++ #ifdef USE_GIF_LIB ++ #define GIF_EXPORT ++ #else /* USE_GIF_LIB */ ++ #ifdef USE_GIF_DLL ++ #define GIF_EXPORT __declspec(dllimport) ++ #else /* USE_GIF_DLL */ ++ #define GIF_EXPORT __declspec(dllexport) ++ #endif /* USE_GIF_DLL */ ++ #endif /* USE_GIF_LIB */ ++#else ++ #define GIF_EXPORT ++#endif /* _MSC_VER */ ++ + #define GIFLIB_MAJOR 5 + #define GIFLIB_MINOR 2 + #define GIFLIB_RELEASE 2 +@@ -125,13 +139,13 @@ + ******************************************************************************/ + + /* Main entry points */ +-GifFileType *EGifOpenFileName(const char *GifFileName, ++GIF_EXPORT GifFileType *EGifOpenFileName(const char *GifFileName, + const bool GifTestExistence, int *Error); +-GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); +-GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); +-int EGifSpew(GifFileType *GifFile); +-const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ +-int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); ++GIF_EXPORT GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); ++GIF_EXPORT GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); ++GIF_EXPORT int EGifSpew(GifFileType *GifFile); ++GIF_EXPORT const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ ++GIF_EXPORT int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); + + #define E_GIF_SUCCEEDED 0 + #define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ +@@ -146,39 +160,39 @@ + #define E_GIF_ERR_NOT_WRITEABLE 10 + + /* These are legacy. You probably do not want to call them directly */ +-int EGifPutScreenDesc(GifFileType *GifFile, const int GifWidth, ++GIF_EXPORT int EGifPutScreenDesc(GifFileType *GifFile, const int GifWidth, + const int GifHeight, const int GifColorRes, + const int GifBackGround, + const ColorMapObject *GifColorMap); +-int EGifPutImageDesc(GifFileType *GifFile, const int GifLeft, const int GifTop, ++GIF_EXPORT int EGifPutImageDesc(GifFileType *GifFile, const int GifLeft, const int GifTop, + const int GifWidth, const int GifHeight, + const bool GifInterlace, + const ColorMapObject *GifColorMap); +-void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); +-int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); +-int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); +-int EGifPutComment(GifFileType *GifFile, const char *GifComment); +-int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); +-int EGifPutExtensionBlock(GifFileType *GifFile, const int GifExtLen, ++GIF_EXPORT void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); ++GIF_EXPORT int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); ++GIF_EXPORT int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); ++GIF_EXPORT int EGifPutComment(GifFileType *GifFile, const char *GifComment); ++GIF_EXPORT int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); ++GIF_EXPORT int EGifPutExtensionBlock(GifFileType *GifFile, const int GifExtLen, + const void *GifExtension); +-int EGifPutExtensionTrailer(GifFileType *GifFile); +-int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, ++GIF_EXPORT int EGifPutExtensionTrailer(GifFileType *GifFile); ++GIF_EXPORT int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, + const int GifExtLen, const void *GifExtension); +-int EGifPutCode(GifFileType *GifFile, int GifCodeSize, ++GIF_EXPORT int EGifPutCode(GifFileType *GifFile, int GifCodeSize, + const GifByteType *GifCodeBlock); +-int EGifPutCodeNext(GifFileType *GifFile, const GifByteType *GifCodeBlock); ++GIF_EXPORT int EGifPutCodeNext(GifFileType *GifFile, const GifByteType *GifCodeBlock); + + /****************************************************************************** + GIF decoding routines + ******************************************************************************/ + + /* Main entry points */ +-GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); +-GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); +-int DGifSlurp(GifFileType *GifFile); +-GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, ++GIF_EXPORT GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); ++GIF_EXPORT GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); ++GIF_EXPORT int DGifSlurp(GifFileType *GifFile); ++GIF_EXPORT GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, + int *Error); /* new one (TVT) */ +-int DGifCloseFile(GifFileType *GifFile, int *ErrorCode); ++GIF_EXPORT int DGifCloseFile(GifFileType *GifFile, int *ErrorCode); + + #define D_GIF_SUCCEEDED 0 + #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ +@@ -196,25 +210,25 @@ + #define D_GIF_ERR_EOF_TOO_SOON 113 + + /* These are legacy. You probably do not want to call them directly */ +-int DGifGetScreenDesc(GifFileType *GifFile); +-int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); +-int DGifGetImageHeader(GifFileType *GifFile); +-int DGifGetImageDesc(GifFileType *GifFile); +-int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); +-int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); +-int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, ++GIF_EXPORT int DGifGetScreenDesc(GifFileType *GifFile); ++GIF_EXPORT int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); ++GIF_EXPORT int DGifGetImageHeader(GifFileType *GifFile); ++GIF_EXPORT int DGifGetImageDesc(GifFileType *GifFile); ++GIF_EXPORT int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); ++GIF_EXPORT int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); ++GIF_EXPORT int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, + GifByteType **GifExtension); +-int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); +-int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, ++GIF_EXPORT int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); ++GIF_EXPORT int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, + GifByteType **GifCodeBlock); +-int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); +-int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); +-const char *DGifGetGifVersion(GifFileType *GifFile); ++GIF_EXPORT int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); ++GIF_EXPORT int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); ++GIF_EXPORT const char *DGifGetGifVersion(GifFileType *GifFile); + + /****************************************************************************** + Error handling and reporting. + ******************************************************************************/ +-extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ ++GIF_EXPORT extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ + + /***************************************************************************** + Everything below this point is new after version 1.2, supporting `slurp +@@ -225,42 +239,42 @@ + Color map handling from gif_alloc.c + ******************************************************************************/ + +-extern ColorMapObject *GifMakeMapObject(int ColorCount, ++GIF_EXPORT extern ColorMapObject *GifMakeMapObject(int ColorCount, + const GifColorType *ColorMap); +-extern void GifFreeMapObject(ColorMapObject *Object); +-extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, ++GIF_EXPORT extern void GifFreeMapObject(ColorMapObject *Object); ++GIF_EXPORT extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, + const ColorMapObject *ColorIn2, + GifPixelType ColorTransIn2[]); +-extern int GifBitSize(int n); ++GIF_EXPORT extern int GifBitSize(int n); + + /****************************************************************************** + Support for the in-core structures allocation (slurp mode). + ******************************************************************************/ + +-extern void GifApplyTranslation(SavedImage *Image, ++GIF_EXPORT extern void GifApplyTranslation(SavedImage *Image, + const GifPixelType Translation[]); +-extern int GifAddExtensionBlock(int *ExtensionBlock_Count, ++GIF_EXPORT extern int GifAddExtensionBlock(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks, int Function, + unsigned int Len, unsigned char ExtData[]); +-extern void GifFreeExtensions(int *ExtensionBlock_Count, ++GIF_EXPORT extern void GifFreeExtensions(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks); +-extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, ++GIF_EXPORT extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, + const SavedImage *CopyFrom); +-extern void GifFreeSavedImages(GifFileType *GifFile); ++GIF_EXPORT extern void GifFreeSavedImages(GifFileType *GifFile); + + /****************************************************************************** + 5.x functions for GIF89 graphics control blocks + ******************************************************************************/ + +-int DGifExtensionToGCB(const size_t GifExtensionLength, ++GIF_EXPORT int DGifExtensionToGCB(const size_t GifExtensionLength, + const GifByteType *GifExtension, + GraphicsControlBlock *GCB); +-size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, ++GIF_EXPORT size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, + GifByteType *GifExtension); + +-int DGifSavedExtensionToGCB(GifFileType *GifFile, int ImageIndex, ++GIF_EXPORT int DGifSavedExtensionToGCB(GifFileType *GifFile, int ImageIndex, + GraphicsControlBlock *GCB); +-int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, ++GIF_EXPORT int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, + GifFileType *GifFile, int ImageIndex); + + /****************************************************************************** +@@ -269,18 +283,18 @@ + + #define GIF_FONT_WIDTH 8 + #define GIF_FONT_HEIGHT 8 +-extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; ++GIF_EXPORT extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; + +-extern void GifDrawText8x8(SavedImage *Image, const int x, const int y, ++GIF_EXPORT extern void GifDrawText8x8(SavedImage *Image, const int x, const int y, + const char *legend, const int color); + +-extern void GifDrawBox(SavedImage *Image, const int x, const int y, const int w, ++GIF_EXPORT extern void GifDrawBox(SavedImage *Image, const int x, const int y, const int w, + const int d, const int color); + +-extern void GifDrawRectangle(SavedImage *Image, const int x, const int y, ++GIF_EXPORT extern void GifDrawRectangle(SavedImage *Image, const int x, const int y, + const int w, const int d, const int color); + +-extern void GifDrawBoxedText8x8(SavedImage *Image, const int x, const int y, ++GIF_EXPORT extern void GifDrawBoxedText8x8(SavedImage *Image, const int x, const int y, + const char *legend, const int border, + const int bg, const int fg); + diff --git a/recipes/giflib/5.2.x/test_package/CMakeLists.txt b/recipes/giflib/5.2.x/test_package/CMakeLists.txt index 909c7abfcc3fc8..d40a4c2c931fb2 100644 --- a/recipes/giflib/5.2.x/test_package/CMakeLists.txt +++ b/recipes/giflib/5.2.x/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) -find_package(GIF REQUIRED) +find_package(GIF REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE GIF::GIF) diff --git a/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt b/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt index 0d20897301b68b..b21cc49efde95c 100644 --- a/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt +++ b/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/giflib/5.2.x/test_v1_package/conanfile.py b/recipes/giflib/5.2.x/test_v1_package/conanfile.py index 15e08a8cf48976..1b567782d0d2e3 100644 --- a/recipes/giflib/5.2.x/test_v1_package/conanfile.py +++ b/recipes/giflib/5.2.x/test_v1_package/conanfile.py @@ -4,7 +4,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) diff --git a/recipes/giflib/config.yml b/recipes/giflib/config.yml index 1ccf672c091354..c70c4f2d279f12 100644 --- a/recipes/giflib/config.yml +++ b/recipes/giflib/config.yml @@ -1,4 +1,6 @@ versions: + "5.2.2": + folder: "5.2.x" "5.2.1": folder: "5.2.x" "5.1.4": diff --git a/recipes/glaze/all/conandata.yml b/recipes/glaze/all/conandata.yml index a15ae462af46de..f5ff6f3fbd268d 100644 --- a/recipes/glaze/all/conandata.yml +++ b/recipes/glaze/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "2.5.3": + url: "https://github.com/stephenberry/glaze/archive/v2.5.3.tar.gz" + sha256: "f4c5eb83c80f1caa0feaa831715e9982203908ea140242cb061aead161e2b09b" + "2.4.0": + url: "https://github.com/stephenberry/glaze/archive/v2.4.0.tar.gz" + sha256: "be8cfb94c0b4b13c0a1fc846e2c112614d2dda02a49977fcdeea544876b3625b" + "2.3.2": + url: "https://github.com/stephenberry/glaze/archive/v2.3.2.tar.gz" + sha256: "360c1eab71afb69d59cc0f0e180d6b214653950340ac267a464a18c81dac585a" + "2.3.1": + url: "https://github.com/stephenberry/glaze/archive/v2.3.1.tar.gz" + sha256: "941bf3f8cea5b6a024895d37dceaaaa82071a9178af63e9935a1d9fd80caa451" "2.3.0": url: "https://github.com/stephenberry/glaze/archive/v2.3.0.tar.gz" sha256: "9963761337941f4709458155a045ce4ab5dc5edf5e60dca8cc290200fce8330e" @@ -8,31 +20,10 @@ sources: "2.1.9": url: "https://github.com/stephenberry/glaze/archive/v2.1.9.tar.gz" sha256: "678126f068e3c21c2b3d2e1ae914c72296b68610a004cf542ea050946ab06416" - "2.1.7": - url: "https://github.com/stephenberry/glaze/archive/v2.1.7.tar.gz" - sha256: "e110bfc6494ca3a0616beaec214e61a53d4e0bd1489d8f1a45ca6f87594a3502" # Keep 2.1.6 for now as 2.1.7 had some breaking changes "2.1.6": url: "https://github.com/stephenberry/glaze/archive/v2.1.6.tar.gz" sha256: "5ae31b1a48a5b54b84e115a12195341bfbe39f03f92bb3bcad074f984380f72d" - "2.1.4": - url: "https://github.com/stephenberry/glaze/archive/v2.1.4.tar.gz" - sha256: "cbaba4dfbaaf342c8be8e6834cb79933b080ac89f3aa1470bc7a83197d9ebc1a" - "2.1.0": - url: "https://github.com/stephenberry/glaze/archive/v2.1.0.tar.gz" - sha256: "b3bb4d886f17d266f37a6eec2c42b2e57e287918b20511297c4eb6b9960f0f8f" "2.0.9": url: "https://github.com/stephenberry/glaze/archive/v2.0.9.tar.gz" sha256: "c1ffede3db5c74d2c46a3abe576985dc729c95df1b48ab575079427b55488bbd" - "2.0.7": - url: "https://github.com/stephenberry/glaze/archive/v2.0.7.tar.gz" - sha256: "1bf981e72733fb5a02a91c9642d91fa39e4a1ebe42f81e8fc6a016c11ed762cb" - "2.0.6": - url: "https://github.com/stephenberry/glaze/archive/v2.0.6.tar.gz" - sha256: "aa5d4921382e9781998ebbf6d36964556daa3367a2aef5ca814122502b450abc" - "1.9.9": - url: "https://github.com/stephenberry/glaze/archive/v1.9.9.tar.gz" - sha256: "7e2605046742a89ec455887a5a0d6b3188ed5c14ea309c5eb9814848c26bedca" - "1.8.5": - url: "https://github.com/stephenberry/glaze/archive/v1.8.5.tar.gz" - sha256: "5d876eed5689f1947ea4eafd9f13a4e0b527611a6b1857c79a5d598a856287b4" diff --git a/recipes/glaze/all/conanfile.py b/recipes/glaze/all/conanfile.py index b7b6a8eb1447bd..5aa4f4a0b6446b 100644 --- a/recipes/glaze/all/conanfile.py +++ b/recipes/glaze/all/conanfile.py @@ -25,17 +25,14 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): - versions = { + return { "Visual Studio": "17", "msvc": "193", - "gcc": "10", + "gcc": "11", # glaze >= 2.1.6 uses std::bit_cast which is supported by clang >= 14 "clang": "12" if Version(self.version) < "2.1.6" else "14", "apple-clang": "13.1", } - if Version(self.version) >= "1.9.0": - versions["gcc"] = "11" - return versions def layout(self): basic_layout(self, src_folder="src") diff --git a/recipes/glaze/config.yml b/recipes/glaze/config.yml index de35ec863def5a..1c181d0a555d29 100644 --- a/recipes/glaze/config.yml +++ b/recipes/glaze/config.yml @@ -1,25 +1,19 @@ versions: + "2.5.3": + folder: all + "2.4.0": + folder: all + "2.3.2": + folder: all + "2.3.1": + folder: all "2.3.0": folder: all "2.2.1": folder: all "2.1.9": folder: all - "2.1.7": - folder: all "2.1.6": folder: all - "2.1.4": - folder: all - "2.1.0": - folder: all "2.0.9": folder: all - "2.0.7": - folder: all - "2.0.6": - folder: all - "1.9.9": - folder: all - "1.8.5": - folder: all diff --git a/recipes/google-cloud-cpp/2.x/conanfile.py b/recipes/google-cloud-cpp/2.x/conanfile.py index 31ff84a094f690..18e1843526a3ca 100644 --- a/recipes/google-cloud-cpp/2.x/conanfile.py +++ b/recipes/google-cloud-cpp/2.x/conanfile.py @@ -3,7 +3,7 @@ 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 +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 @@ -72,6 +72,10 @@ class GoogleCloudCppConan(ConanFile): "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) @@ -157,7 +161,8 @@ def requirements(self): def build_requirements(self): # For the `grpc-cpp-plugin` executable, and indirectly `protoc` - self.tool_requires("grpc/") + if not self._is_legacy_one_profile: + self.tool_requires("grpc/") def generate(self): tc = CMakeToolchain(self) @@ -166,7 +171,9 @@ def generate(self): tc.variables["GOOGLE_CLOUD_CPP_ENABLE_WERROR"] = False tc.variables["GOOGLE_CLOUD_CPP_ENABLE"] = ",".join(self._components()) tc.generate() - VirtualRunEnv(self).generate(scope="build") + VirtualBuildEnv(self).generate() + if self._is_legacy_one_profile: + VirtualRunEnv(self).generate(scope="build") deps = CMakeDeps(self) deps.generate() diff --git a/recipes/google-cloud-cpp/2.x/test_package/conanfile.py b/recipes/google-cloud-cpp/2.x/test_package/conanfile.py index 4544391b62f564..a1ab26b6de6540 100644 --- a/recipes/google-cloud-cpp/2.x/test_package/conanfile.py +++ b/recipes/google-cloud-cpp/2.x/test_package/conanfile.py @@ -3,7 +3,7 @@ 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 +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.scm import Version @@ -14,6 +14,10 @@ class TestPackageConan(ConanFile): 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) @@ -30,9 +34,12 @@ 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 - runenv = VirtualRunEnv(self) - runenv.generate(scope="run") + VirtualRunEnv(self).generate(scope="run") deps = CMakeDeps(self) deps.generate() diff --git a/recipes/gtest/all/conanfile.py b/recipes/gtest/all/conanfile.py index 556a1401b077b5..79d0749381a6f5 100644 --- a/recipes/gtest/all/conanfile.py +++ b/recipes/gtest/all/conanfile.py @@ -158,7 +158,8 @@ def package_info(self): 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") - self.cpp_info.components["libgtest"].system_libs.append("pthread") + 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: diff --git a/recipes/gtsam/all/conanfile.py b/recipes/gtsam/all/conanfile.py index bca7930e912c29..b0e2304308da8a 100644 --- a/recipes/gtsam/all/conanfile.py +++ b/recipes/gtsam/all/conanfile.py @@ -17,7 +17,8 @@ class GtsamConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = ("GTSAM is a library of C++ classes that implement " "smoothing and mapping (SAM) in robotics and vision") - topics = ("mapping", "smoothing", "optimization", "factor-graphs") + topics = ("mapping", "smoothing", "optimization", "factor-graphs", + "state-estimation", "computer-vision", "robotics") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -25,7 +26,6 @@ class GtsamConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "allow_deprecated": [True, False], - "allow_deprecated_since_V4": [True, False, "deprecated"], "build_type_postfixes": [True, False], "build_unstable": [True, False], "build_with_march_native": [True, False], @@ -55,7 +55,6 @@ class GtsamConan(ConanFile): "shared": False, "fPIC": True, "allow_deprecated": True, - "allow_deprecated_since_V4": "deprecated", "build_type_postfixes": True, "build_unstable": True, "build_with_march_native": False, @@ -64,14 +63,14 @@ class GtsamConan(ConanFile): "enable_consistency_checks": False, "install_cppunitlite": True, "install_matlab_toolbox": False, - "pose3_expmap": False, - "rot3_expmap": False, + "pose3_expmap": True, + "rot3_expmap": True, "slow_but_correct_betweenfactor": False, - "support_nested_dissection": False, - "tangent_preintegration": False, + "support_nested_dissection": True, + "tangent_preintegration": True, "throw_cheirality_exception": True, "use_quaternions": False, - "with_TBB": False, + "with_TBB": True, "with_eigen_MKL": False, "with_eigen_MKL_OPENMP": False, @@ -95,7 +94,7 @@ class GtsamConan(ConanFile): "rot3_expmap": ("Ignore if GTSAM_USE_QUATERNIONS is OFF (Rot3::EXPMAP by default). " "Otherwise, enable Rot3::EXPMAP, or if disabled, use Rot3::CAYLEY."), "slow_but_correct_betweenfactor": "Use the slower but correct version of BetweenFactor", - "support_nested_dissection": "Support Metis-based nested dissection", + "support_nested_dissection": "Support METIS-based nested dissection", "tangent_preintegration": "Use the new ImuFactor with integration on tangent space", "throw_cheirality_exception": "Throw exception when a triangulated point is behind a camera", "use_quaternions": ("Enable an internal Quaternion representation for rotations instead of rotation matrices. " @@ -130,29 +129,28 @@ def configure(self): self.options.rm_safe("fPIC") if self.options.with_TBB: self.options["onetbb"].tbbmalloc = True - if self.options.allow_deprecated_since_V4 != "deprecated": - self.output.warn("'allow_deprecated_since_V4' option is deprecated. Use 'allow_deprecated' instead.") - def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.83.0", transitive_headers=True) + self.requires("boost/1.84.0", transitive_headers=True) self.requires("eigen/3.4.0", transitive_headers=True) if self.options.with_TBB: - self.requires("onetbb/2021.10.0", transitive_headers=True) + if Version(self.version) >= "4.1": + self.requires("onetbb/2021.10.0", transitive_headers=True, transitive_libs=True) + else: + self.requires("onetbb/2020.3.3", transitive_headers=True, transitive_libs=True) if self.options.default_allocator == "tcmalloc": - self.requires("gperftools/2.11.0") - # TODO: add use_vendored_metis=False option - # if self.options.support_nested_dissection and not self.options.use_vendored_metis: - # # Used in a public header here: - # # https://github.com/borglab/gtsam/blob/4.2a9/gtsam_unstable/partition/FindSeparator-inl.h#L23-L27 - # self.requires("metis/5.1.1", transitive_headers=True) + self.requires("gperftools/2.15") + if self.options.support_nested_dissection: + # Used in a public header here: + # https://github.com/borglab/gtsam/blob/4.2.0/gtsam_unstable/partition/FindSeparator-inl.h#L23-L27 + self.requires("metis/5.2.1", transitive_headers=True, transitive_libs=True) @property def _required_boost_components(self): - # Based on https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleBoost.cmake#L26 + # Based on https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleBoost.cmake#L26 return [ "chrono", "date_time", @@ -181,10 +179,7 @@ def validate(self): if not self.dependencies["onetbb"].options.tbbmalloc: raise ConanInvalidConfiguration("GTSAM with TBB requires onetbb/*:tbbmalloc=True") elif self.options.default_allocator != "tcmalloc": - raise ConanInvalidConfiguration( - "with_TBB option cannot be used with" - f" default_allocator={self.options.default_allocator}" - ) + raise ConanInvalidConfiguration(f"with_TBB option cannot be used with default_allocator={self.options.default_allocator}") elif self.options.default_allocator == "TBB": raise ConanInvalidConfiguration("default_allocator=TBB requires with_TBB=True") @@ -198,18 +193,15 @@ def validate(self): else "https://github.com/borglab/gtsam/issues/1541" ) - if self.options.allow_deprecated_since_V4 != "deprecated": - self.output.warn( - "'allow_deprecated_since_V4' option is deprecated. Use 'allow_deprecated' instead." - ) + if self.options.support_nested_dissection and self.dependencies["metis"].options.with_64bit_types: + raise ConanInvalidConfiguration("GTSAM does not support METIS with 64-bit types") 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 - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleGeneralOptions.cmake + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleGeneralOptions.cmake tc.variables["GTSAM_BUILD_UNSTABLE"] = self.options.build_unstable tc.variables["GTSAM_UNSTABLE_BUILD_PYTHON"] = False tc.variables["GTSAM_UNSTABLE_INSTALL_MATLAB_TOOLBOX"] = self.options.install_matlab_toolbox @@ -224,8 +216,6 @@ def generate(self): tc.variables["GTSAM_BUILD_PYTHON"] = False tc.variables["GTSAM_INSTALL_MATLAB_TOOLBOX"] = self.options.install_matlab_toolbox tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V4"] = self.options.allow_deprecated - if self.options.allow_deprecated_since_V4 != "deprecated": - tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V4"] = self.options.allow_deprecated_since_V4 tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V41"] = self.options.allow_deprecated tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V42"] = self.options.allow_deprecated tc.variables["GTSAM_SUPPORT_NESTED_DISSECTION"] = self.options.support_nested_dissection @@ -234,30 +224,30 @@ def generate(self): if Version(self.version) >= "4.1": tc.variables["GTSAM_SLOW_BUT_CORRECT_BETWEENFACTOR"] = self.options.slow_but_correct_betweenfactor tc.variables["GTSAM_BUILD_WITH_CCACHE"] = False - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleAllocators.cmake + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleAllocators.cmake if self.options.default_allocator is not None: tc.variables["GTSAM_DEFAULT_ALLOCATOR"] = self.options.default_allocator - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/GtsamBuildTypes.cmake#L59 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/GtsamBuildTypes.cmake#L59 tc.variables["GTSAM_BUILD_TYPE_POSTFIXES"] = self.options.build_type_postfixes - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/GtsamBuildTypes.cmake#L193 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/GtsamBuildTypes.cmake#L193 tc.variables["GTSAM_BUILD_WITH_MARCH_NATIVE"] = self.options.build_with_march_native - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleBoost.cmake#L36 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleBoost.cmake#L36 tc.variables["GTSAM_DISABLE_NEW_TIMERS"] = self.options.disable_new_timers - # https://github.com/borglab/gtsam/blob/4.2a9/CppUnitLite/CMakeLists.txt#L13 + # https://github.com/borglab/gtsam/blob/4.2.0/CppUnitLite/CMakeLists.txt#L13 tc.variables["GTSAM_INSTALL_CPPUNITLITE"] = self.options.install_cppunitlite - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleEigen.cmake#L3 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleEigen.cmake#L3 tc.variables["GTSAM_USE_SYSTEM_EIGEN"] = True - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleMetis.cmake#L11 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleMetis.cmake#L11 tc.variables["GTSAM_USE_SYSTEM_METIS"] = False - # https://github.com/borglab/gtsam/blob/4.2a9/gtsam/3rdparty/CMakeLists.txt#L76 + # https://github.com/borglab/gtsam/blob/4.2.0/gtsam/3rdparty/CMakeLists.txt#L76 tc.variables["GTSAM_INSTALL_GEOGRAPHICLIB"] = False - # https://github.com/borglab/gtsam/blob/4.2a9/matlab/CMakeLists.txt#L14-L15 + # https://github.com/borglab/gtsam/blob/4.2.0/matlab/CMakeLists.txt#L14-L15 tc.variables["GTSAM_MEX_BUILD_STATIC_MODULE"] = False - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/GtsamTesting.cmake#L89-L91 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/GtsamTesting.cmake#L89-L91 tc.variables["GTSAM_BUILD_TESTS"] = False tc.variables["GTSAM_BUILD_EXAMPLES_ALWAYS"] = False tc.variables["GTSAM_BUILD_TIMING_ALWAYS"] = False - # https://github.com/borglab/gtsam/blob/4.2a9/doc/CMakeLists.txt + # https://github.com/borglab/gtsam/blob/4.2.0/doc/CMakeLists.txt tc.variables["GTSAM_BUILD_DOCS"] = False tc.variables["GTSAM_BUILD_DOC_HTML"] = False tc.variables["GTSAM_BUILD_DOC_LATEX"] = False @@ -273,9 +263,15 @@ def generate(self): tc.variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared tc.variables["Boost_NO_SYSTEM_PATHS"] = True + + if Version(self.version) < "4.1": + # Fix "The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated" + tc.preprocessor_definitions["BOOST_BIND_GLOBAL_PLACEHOLDERS"] = "" + tc.generate() deps = CMakeDeps(self) + deps.set_property("metis", "cmake_target_name", "metis-gtsam-if") deps.generate() def _patch_sources(self): @@ -287,22 +283,39 @@ def _patch_sources(self): replace_in_file(self, gtsam_build_types_cmake, "/MD ", f"/{msvc_runtime_flag(self)} ") replace_in_file(self, gtsam_build_types_cmake, "/MDd ", f"/{msvc_runtime_flag(self)} ") + # Ensure a newer CMake standard is used for non-cache_variables support and other policies + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "cmake_minimum_required(VERSION 3.0)", + "cmake_minimum_required(VERSION 3.15)") + + # Fix tcmalloc / gperftools handling if self.options.default_allocator == "tcmalloc": handle_allocators_path = os.path.join(self.source_folder, "cmake", "HandleAllocators.cmake") if Version(self.version) < "4.1": handle_allocators_path = os.path.join(self.source_folder, "CMakeLists.txt") - replace_in_file( - self, - handle_allocators_path, - "if(GOOGLE", - "find_package(gperftools REQUIRED)\nset(GOOGLE_PERFTOOLS_FOUND TRUE)\nif(GOOGLE", - ) - replace_in_file( - self, - handle_allocators_path, - 'GTSAM_ADDITIONAL_LIBRARIES "tcmalloc"', - 'GTSAM_ADDITIONAL_LIBRARIES "gperftools::gperftools"', - ) + replace_in_file(self, handle_allocators_path, + "if(GOOGLE", + ("find_package(gperftools REQUIRED)\n" + "set(GOOGLE_PERFTOOLS_FOUND TRUE)\n" + "if(GOOGLE")) + replace_in_file(self, handle_allocators_path, + 'GTSAM_ADDITIONAL_LIBRARIES "tcmalloc"', + 'GTSAM_ADDITIONAL_LIBRARIES "gperftools::gperftools"') + + # Fix HandleMetis.cmake incompatibility with METIS from Conan + save(self, os.path.join(self.source_folder, "cmake", "HandleMetis.cmake"), + "find_package(metis REQUIRED CONFIG)\n") + + # Fix TBB handling + handle_tbb_path = os.path.join(self.source_folder, "cmake", "HandleTBB.cmake") + if Version(self.version) < "4.1": + handle_tbb_path = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, handle_tbb_path, "find_package(TBB 4.4 ", "find_package(TBB ") + if Version(self.version) < "4.2.1": + replace_in_file(self, handle_tbb_path, + "list(APPEND GTSAM_ADDITIONAL_LIBRARIES tbb tbbmalloc)", + "list(APPEND GTSAM_ADDITIONAL_LIBRARIES TBB::tbb TBB::tbbmalloc)") + def build(self): self._patch_sources() @@ -345,6 +358,8 @@ def _module_file_rel_path(self): return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): + # GTSAM uses targets without a namespace prefix: + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/example_cmake_find_gtsam/CMakeLists.txt self.cpp_info.set_property("cmake_file_name", "GTSAM") gtsam = self.cpp_info.components["libgtsam"] @@ -356,10 +371,11 @@ def package_info(self): gtsam.requires.append("onetbb::onetbb") if self.options.default_allocator == "tcmalloc": gtsam.requires.append("gperftools::gperftools") - if self.options.support_nested_dissection: - gtsam.requires.append("libmetis-gtsam") if self.settings.os == "Windows": gtsam.system_libs = ["dbghelp"] + if Version(self.version) < "4.1": + # Fix "The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated" + gtsam.defines.append("BOOST_BIND_GLOBAL_PLACEHOLDERS") if self.options.build_unstable: gtsam_unstable = self.cpp_info.components["libgtsam_unstable"] @@ -368,13 +384,7 @@ def package_info(self): gtsam_unstable.requires = ["libgtsam"] if self.options.support_nested_dissection: - metis = self.cpp_info.components["libmetis-gtsam"] - metis.set_property("cmake_target_name", "metis-gtsam") - if Version(self.version) >= "4.1": - metis.libs = ["metis-gtsam"] - else: - metis.libs = ["metis"] - metis.names["pkg_config"] = "metis-gtsam" + gtsam.requires.append("metis::metis") if self.options.install_cppunitlite: cppunitlite = self.cpp_info.components["gtsam_CppUnitLite"] diff --git a/recipes/harfbuzz/all/conanfile.py b/recipes/harfbuzz/all/conanfile.py index a0f1c1c55554ac..873c8a5081e27d 100644 --- a/recipes/harfbuzz/all/conanfile.py +++ b/recipes/harfbuzz/all/conanfile.py @@ -84,7 +84,7 @@ def requirements(self): if self.options.with_icu: self.requires("icu/74.1") if self.options.with_glib: - self.requires("glib/2.78.1") + self.requires("glib/2.78.3") def validate(self): if self.options.shared and self.options.with_glib and not self.dependencies["glib"].options.shared: @@ -100,7 +100,7 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.3.2") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/2.1.0") if self.options.with_glib: diff --git a/recipes/hictk/all/conandata.yml b/recipes/hictk/all/conandata.yml index ba37c76167468c..950caed4f27fb5 100644 --- a/recipes/hictk/all/conandata.yml +++ b/recipes/hictk/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.0.12": + url: "https://github.com/paulsengroup/hictk/archive/refs/tags/v0.0.12.tar.gz" + sha256: "03e8f7c0076ea6209fdfee1580658e871895f6a59b895407c4a25512b9558fb7" "0.0.10": url: "https://github.com/paulsengroup/hictk/archive/refs/tags/v0.0.10.tar.gz" sha256: "0b2d60af73578b292317e5ab513f24965176f9852ceda29e8d02007a434588c3" diff --git a/recipes/hictk/all/conanfile.py b/recipes/hictk/all/conanfile.py index 5993c72d215675..287868ebce18c9 100644 --- a/recipes/hictk/all/conanfile.py +++ b/recipes/hictk/all/conanfile.py @@ -40,8 +40,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("bshoshany-thread-pool/4.0.1", transitive_headers=True) - self.requires("fast_float/6.1.0", transitive_headers=True) + self.requires("bshoshany-thread-pool/4.1.0", transitive_headers=True) + self.requires("fast_float/6.1.1", transitive_headers=True) if self.options.with_eigen: self.requires("eigen/3.4.0", transitive_headers=True) self.requires("fmt/10.2.1", transitive_headers=True) @@ -49,9 +49,9 @@ def requirements(self): self.requires("highfive/2.9.0", transitive_headers=True) self.requires("libdeflate/1.19", transitive_headers=True) self.requires("parallel-hashmap/1.3.11", transitive_headers=True) # Note: v1.3.11 is more recent than v1.37 - self.requires("span-lite/0.10.3", transitive_headers=True) + self.requires("span-lite/0.11.0", transitive_headers=True) self.requires("spdlog/1.13.0", transitive_headers=True) - self.requires("zstd/1.5.5", transitive_headers=True) + self.requires("zstd/1.5.6", transitive_headers=True) if Version(self.version) == "0.0.3": self.requires("xxhash/0.8.2", transitive_headers=True) @@ -121,3 +121,6 @@ def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.set_property("cmake_file_name", "hictk") self.cpp_info.set_property("cmake_target_name", "hictk::libhictk") + + if self.options.with_eigen: + self.cpp_info.defines.append("HICTK_WITH_EIGEN") diff --git a/recipes/hictk/all/test_package/test_package.cpp b/recipes/hictk/all/test_package/test_package.cpp index bbe13ab6a32190..30467b8f8512b4 100644 --- a/recipes/hictk/all/test_package/test_package.cpp +++ b/recipes/hictk/all/test_package/test_package.cpp @@ -1,8 +1,13 @@ -#include -#include "hictk/fmt.hpp" -#include "hictk/cooler/utils.hpp" +#include + +#include "hictk/file.hpp" int main(int argc, char** argv) { - fmt::print("{}\n", hictk::cooler::utils::is_cooler(argv[0])); + try { + const hictk::File f(argv[0], 10); // This is expected to throw + return 1; + } catch (const std::exception& e) { + return 0; + } } diff --git a/recipes/hictk/config.yml b/recipes/hictk/config.yml index 351a3e971990d9..2b16ffcd223a6e 100644 --- a/recipes/hictk/config.yml +++ b/recipes/hictk/config.yml @@ -1,4 +1,6 @@ versions: + "0.0.12": + folder: all "0.0.10": folder: all "0.0.9": diff --git a/recipes/hwloc/all/conanfile.py b/recipes/hwloc/all/conanfile.py index 231701d41f5878..ff20e76545daeb 100644 --- a/recipes/hwloc/all/conanfile.py +++ b/recipes/hwloc/all/conanfile.py @@ -32,7 +32,7 @@ def configure(self): def requirements(self): if self.options.with_libxml2: - self.requires("libxml2/2.12.3") + self.requires("libxml2/[>=2.12.5 <3]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/iconfontcppheaders/all/conandata.yml b/recipes/iconfontcppheaders/all/conandata.yml index 9cba4ae5061fd3..499df05a59976b 100644 --- a/recipes/iconfontcppheaders/all/conandata.yml +++ b/recipes/iconfontcppheaders/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20240128": + sha256: de946a4471dca969426b2e7863d79136a91f2e4e4cc7a766df31bbb8412571f9 + url: https://github.com/juliettef/IconFontCppHeaders/archive/8886c5657bac22b8fee34354871e3ade2a596433/main.zip "cci.20231102": sha256: 7618e844dcbfea2404c209e8b52158a37c2368a79cc77e94087375a8186442c4 url: https://github.com/juliettef/IconFontCppHeaders/archive/41b304750e83c0a89375cc1834f65c1204308b4a/main.zip diff --git a/recipes/iconfontcppheaders/config.yml b/recipes/iconfontcppheaders/config.yml index 4c1b72279193a2..c603b02a80db46 100644 --- a/recipes/iconfontcppheaders/config.yml +++ b/recipes/iconfontcppheaders/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20240128": + folder: all "cci.20231102": folder: all "cci.20231026": diff --git a/recipes/imath/all/conandata.yml b/recipes/imath/all/conandata.yml index 605325978acfe7..3f20468a0db96a 100644 --- a/recipes/imath/all/conandata.yml +++ b/recipes/imath/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.11": + url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.11.tar.gz" + sha256: "9057849585e49b8b85abe7cc1e76e22963b01bfdc3b6d83eac90c499cd760063" "3.1.10": url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.10.tar.gz" sha256: "f2943e86bfb694e216c60b9a169e5356f8a90f18fbd34d7b6e3450be14f60b10" @@ -8,18 +11,6 @@ sources: "3.1.8": url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.8.tar.gz" sha256: "a23a4e2160ca8ff68607a4e129e484edd1d0d13f707394d32af7aed659020803" - "3.1.7": - url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.7.tar.gz" - sha256: "bff1fa140f4af0e7f02c6cb78d41b9a7d5508e6bcdfda3a583e35460eb6d4b47" - "3.1.6": - url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.6.tar.gz" - sha256: "ea5592230f5ab917bea3ceab266cf38eb4aa4a523078d46eac0f5a89c52304db" - "3.1.5": - url: "https://github.com/AcademySoftwareFoundation/Imath/archive/refs/tags/v3.1.5.tar.gz" - sha256: "1e9c7c94797cf7b7e61908aed1f80a331088cc7d8873318f70376e4aed5f25fb" - "3.1.4": - url: "https://github.com/AcademySoftwareFoundation/Imath/archive/refs/tags/v3.1.4.tar.gz" - sha256: "fcca5fbb37d375a252bacd8a29935569bdc28b888f01ef1d9299ca0c9e87c17a" patches: "3.1.10": - patch_file: "patches/3.1.10-gcc5-backport.patch" diff --git a/recipes/imath/config.yml b/recipes/imath/config.yml index a3cca600992b65..61b9f04e8a57f0 100644 --- a/recipes/imath/config.yml +++ b/recipes/imath/config.yml @@ -1,15 +1,9 @@ versions: + "3.1.11": + folder: all "3.1.10": folder: all "3.1.9": folder: all "3.1.8": 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/recipes/imgui/all/conandata.yml b/recipes/imgui/all/conandata.yml index e9eda4969aa9b4..bc951cc1d225cf 100644 --- a/recipes/imgui/all/conandata.yml +++ b/recipes/imgui/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.90.5": + url: "https://github.com/ocornut/imgui/archive/v1.90.5.tar.gz" + sha256: "e94b48dba7311c85ba8e3e6fe7c734d76a0eed21b2b42c5180fd5706d1562241" + "1.90.5-docking": + url: "https://github.com/ocornut/imgui/archive/v1.90.5-docking.tar.gz" + sha256: "8a5e1e594d6c8552e46e4c1ba8dd9deb51262067f04937904babc04384533ccc" "1.90.4": url: "https://github.com/ocornut/imgui/archive/v1.90.4.tar.gz" sha256: "5d9dc738af74efa357f2a9fc39fe4a28d29ef1dfc725dd2977ccf3f3194e996e" diff --git a/recipes/imgui/config.yml b/recipes/imgui/config.yml index 9443d0df2e2103..a1dfb0d79179ab 100644 --- a/recipes/imgui/config.yml +++ b/recipes/imgui/config.yml @@ -1,4 +1,8 @@ versions: + "1.90.5": + folder: all + "1.90.5-docking": + folder: all "1.90.4": folder: all "1.90.4-docking": diff --git a/recipes/imguizmo/all/conanfile.py b/recipes/imguizmo/all/conanfile.py index 57281934555cff..5246d80ba03c1f 100644 --- a/recipes/imguizmo/all/conanfile.py +++ b/recipes/imguizmo/all/conanfile.py @@ -2,7 +2,8 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get +from conan.tools.files import copy, get, replace_in_file +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -41,21 +42,26 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - # 1.89 is the newest imgui version compatible with imguizmo - self.requires("imgui/1.89.3", transitive_headers=True) + self.requires("imgui/1.90.5", transitive_headers=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) + tc.preprocessor_definitions["IMGUI_DEFINE_MATH_OPERATORS"] = "" tc.generate() tc = CMakeDeps(self) tc.generate() def build(self): + if Version(self.dependencies["imgui"].ref.version) >= "1.89.4": + # Related to a breaking change: https://github.com/ocornut/imgui/blob/master/docs/CHANGELOG.txt#L912 + # Redirection: ImDrawList::AddBezierCurve() -> use ImDrawList::AddBezierCubic() + replace_in_file(self, os.path.join(self.source_folder, "GraphEditor.cpp"), + "AddBezierCurve", "AddBezierCubic") cmake = CMake(self) - cmake.configure(build_script_folder=self.export_sources_folder) + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): diff --git a/recipes/iowow/all/conandata.yml b/recipes/iowow/all/conandata.yml index 3dc81fcb105884..047330d4f8fd99 100644 --- a/recipes/iowow/all/conandata.yml +++ b/recipes/iowow/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.18": + url: "https://github.com/Softmotions/iowow/archive/refs/tags/v1.4.18.tar.gz" + sha256: "ef4ee56dd77ce326fff25b6f41e7d78303322cca3f11cf5683ce9abfda34faf9" "1.4.17": url: "https://github.com/Softmotions/iowow/archive/refs/tags/v1.4.17.tar.gz" sha256: "13a851026dbc1f31583fba96986e86e94a7554f9e7d38aa12a9ea5dbebdf328b" @@ -6,6 +9,10 @@ sources: url: "https://github.com/Softmotions/iowow/archive/refs/tags/v1.4.16.tar.gz" sha256: "6e3b92b6c342ef6ef4a2731ca2d43368749d66ca876b24b773587364cff01003" patches: + "1.4.18": + - patch_file: "patches/1.4.18-0002-fix-uint64_t-format.patch" + patch_description: "fix uint64_t printf format" + patch_type: "portability" "1.4.17": - patch_file: "patches/1.4.16-0002-fix-uint64_t-format.patch" patch_description: "fix uint64_t printf format" diff --git a/recipes/iowow/all/patches/1.4.18-0002-fix-uint64_t-format.patch b/recipes/iowow/all/patches/1.4.18-0002-fix-uint64_t-format.patch new file mode 100644 index 00000000000000..3253bb3ff1bddb --- /dev/null +++ b/recipes/iowow/all/patches/1.4.18-0002-fix-uint64_t-format.patch @@ -0,0 +1,13 @@ +diff --git a/src/fs/iwfsmfile.c b/src/fs/iwfsmfile.c +index 2d1452a..121e989 100644 +--- a/src/fs/iwfsmfile.c ++++ b/src/fs/iwfsmfile.c +@@ -1339,7 +1339,7 @@ static iwrc _fsm_read_meta_lr(struct fsm *fsm) { + fsm->bmlen = llv; + if (llv & (64 - 1)) { + rc = IWFS_ERROR_INVALID_FILEMETA; +- iwlog_ecode_error(rc, "Free-space bitmap length is not 64bit aligned: %" PRIuMAX "", fsm->bmlen); ++ iwlog_ecode_error(rc, "Free-space bitmap length is not 64bit aligned: %" PRIx64 "", fsm->bmlen); + } + rp += sizeof(llv); + diff --git a/recipes/iowow/config.yml b/recipes/iowow/config.yml index 764e66b7855a67..c30ae14aca3320 100644 --- a/recipes/iowow/config.yml +++ b/recipes/iowow/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.18": + folder: all "1.4.17": folder: all "1.4.16": diff --git a/recipes/ipaddress/all/conandata.yml b/recipes/ipaddress/all/conandata.yml new file mode 100644 index 00000000000000..05cfe6de06df95 --- /dev/null +++ b/recipes/ipaddress/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.1": + url: "https://github.com/VladimirShaleev/ipaddress/archive/v1.0.1.tar.gz" + sha256: "49c16294f06fe95ffc66cae828dc08d116efb4a1ede3dddd21dcc182a2eceb03" diff --git a/recipes/ipaddress/all/conanfile.py b/recipes/ipaddress/all/conanfile.py new file mode 100644 index 00000000000000..1bdda098db7d55 --- /dev/null +++ b/recipes/ipaddress/all/conanfile.py @@ -0,0 +1,89 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.52.0" + + +class IpAddressConan(ConanFile): + name = "ipaddress" + description = "A library for working and manipulating IPv4/IPv6 addresses and networks" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/VladimirShaleev/ipaddress" + topics = ("ipv4", "ipv6", "ipaddress", "ip", "network", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + options = { + "exceptions": [True, False], + "overload_std": [True, False], + "ipv6_scope": [True, False], + "ipv6_scope_max_length": ["ANY"], + } + default_options = { + "exceptions": True, + "overload_std": True, + "ipv6_scope": True, + "ipv6_scope_max_length": 16, + } + + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "13.0", + "clang": "6.0", + "gcc": "7.5", + "msvc": "192", + "Visual Studio": "16", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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} doesn't support {self.settings.compiler} < {minimum_version}" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.hpp", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include") + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if not self.options.exceptions: + self.cpp_info.defines.append("IPADDRESS_NO_EXCEPTIONS") + if not self.options.overload_std: + self.cpp_info.defines.append("IPADDRESS_NO_OVERLOAD_STD") + if not self.options.ipv6_scope: + self.cpp_info.defines.append("IPADDRESS_NO_IPV6_SCOPE") + else: + self.cpp_info.defines.append(f"IPADDRESS_IPV6_SCOPE_MAX_LENGTH={int(self.options.ipv6_scope_max_length)}") diff --git a/recipes/ipaddress/all/test_package/CMakeLists.txt b/recipes/ipaddress/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..f9368cb4ca1085 --- /dev/null +++ b/recipes/ipaddress/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ipaddress CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ipaddress::ipaddress) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/ipaddress/all/test_package/conanfile.py b/recipes/ipaddress/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/ipaddress/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ipaddress/all/test_package/test_package.cpp b/recipes/ipaddress/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..1e0a4a4597eaff --- /dev/null +++ b/recipes/ipaddress/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include +#include "ipaddress/ipaddress.hpp" + + +int main(void) { + auto ip = ipaddress::ipv6_address::parse("fec0::1ff:fe23:4567:890a%eth2"); + std::cout << "Parsing ipv6: " << ip << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/ipaddress/config.yml b/recipes/ipaddress/config.yml new file mode 100644 index 00000000000000..715e55357a17be --- /dev/null +++ b/recipes/ipaddress/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: all diff --git a/recipes/jom/all/conandata.yml b/recipes/jom/all/conandata.yml index 0fe464cf0c395e..0b87aa433e46ad 100644 --- a/recipes/jom/all/conandata.yml +++ b/recipes/jom/all/conandata.yml @@ -1,4 +1,15 @@ sources: + "1.1.4": + x86_64: + url: "http://download.qt.io/official_releases/jom/jom_1_1_4.zip" + sha256: "d533c1ef49214229681e90196ed2094691e8c4a0a0bef0b2c901debcb562682b" + license: + url: "https://code.qt.io/cgit/qt-labs/jom.git/plain/LICENSE.GPL?h=v1.1.3" + sha256: "d3d9052b838761dbe00067168ed9ebc437734d53ebf71dea1c8e9f7532a5333b" "1.1.3": - sha256: "128fdd846fe24f8594eed37d1d8929a0ea78df563537c0c1b1861a635013fff8" - url: "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" + x86_64: + url: "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" + sha256: "128fdd846fe24f8594eed37d1d8929a0ea78df563537c0c1b1861a635013fff8" + license: + url: "https://code.qt.io/cgit/qt-labs/jom.git/plain/LICENSE.GPL?h=v1.1.3" + sha256: "d3d9052b838761dbe00067168ed9ebc437734d53ebf71dea1c8e9f7532a5333b" diff --git a/recipes/jom/all/conanfile.py b/recipes/jom/all/conanfile.py index 4962bc3e3e42fb..6605c75c3ffa37 100644 --- a/recipes/jom/all/conanfile.py +++ b/recipes/jom/all/conanfile.py @@ -30,8 +30,8 @@ def source(self): pass def build(self): - get(self, **self.conan_data["sources"][self.version]) - download(self, f"https://code.qt.io/cgit/qt-labs/jom.git/plain/LICENSE.GPL?h=v{self.version}", filename="LICENSE.GPL") + get(self, **self.conan_data["sources"][self.version]["x86_64"]) + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE.GPL") def package(self): copy(self, "LICENSE.GPL", self.build_folder, os.path.join(self.package_folder, "licenses")) diff --git a/recipes/jom/config.yml b/recipes/jom/config.yml index e1c4f3be249832..7f3d713ab8481e 100644 --- a/recipes/jom/config.yml +++ b/recipes/jom/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.4": + folder: all "1.1.3": folder: all diff --git a/recipes/jsbsim/all/conanfile.py b/recipes/jsbsim/all/conanfile.py index 3d180281b56495..048e4a19a18e04 100644 --- a/recipes/jsbsim/all/conanfile.py +++ b/recipes/jsbsim/all/conanfile.py @@ -48,7 +48,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/kuba-zip/all/conandata.yml b/recipes/kuba-zip/all/conandata.yml index 707848aa88e1ed..2c9419a46ca412 100644 --- a/recipes/kuba-zip/all/conandata.yml +++ b/recipes/kuba-zip/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.3.2": + url: "https://github.com/kuba--/zip/archive/v0.3.2.tar.gz" + sha256: "0c33740aec7a3913bca07df360420c19cac5e794e0f602f14f798cb2e6f710e5" "0.3.1": url: "https://github.com/kuba--/zip/archive/v0.3.1.tar.gz" sha256: "775b8a44b53e72a55c13839bf507219c2cf30b26f62e70f1a20bb727db54438f" diff --git a/recipes/kuba-zip/config.yml b/recipes/kuba-zip/config.yml index ab67eaba39ebb7..b1201b1eaf043d 100644 --- a/recipes/kuba-zip/config.yml +++ b/recipes/kuba-zip/config.yml @@ -1,4 +1,6 @@ versions: + "0.3.2": + folder: "all" "0.3.1": folder: "all" "0.3.0": diff --git a/recipes/kuliya/all/conandata.yml b/recipes/kuliya/all/conandata.yml new file mode 100644 index 00000000000000..06675980fd0942 --- /dev/null +++ b/recipes/kuliya/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.0": + release: + url: "https://github.com/dzcode-io/kuliya/releases/download/c-v1.0.0/c-release.tar.gz" + sha256: "a0e064d29358e40245dc8b7b35160a6b15e10059e4bd42d9dc4f0af76d031e5f" + # Old versions don't have the license embed in the release tar, download it separatedly for now + # from the commit of the upstream tag + license: + url: "https://raw.githubusercontent.com/dzcode-io/kuliya/c-v1.0.0/LICENSE" + sha256: "70884fb7eff4f91c8d776f8cf7bd93cce0c93213f57153956189b488cfd911be" diff --git a/recipes/kuliya/all/conanfile.py b/recipes/kuliya/all/conanfile.py new file mode 100644 index 00000000000000..ad769bd5235f67 --- /dev/null +++ b/recipes/kuliya/all/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.files import copy, get, download +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class JsmnConan(ConanFile): + name = "kuliya" + description = "Algeria's college hierarchy dataset as a C library." + license = "MIT" + topics = ("dataset", "api", "dz", "header-only") + homepage = "https://github.com/dzcode-io/kuliya" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + 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]["release"], strip_root=True) + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE") + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "kuliya.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "data.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/kuliya/all/test_package/CMakeLists.txt b/recipes/kuliya/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..6ca62a693d64a8 --- /dev/null +++ b/recipes/kuliya/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(kuliya REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE kuliya::kuliya) diff --git a/recipes/xz_utils/cmake/test_package/conanfile.py b/recipes/kuliya/all/test_package/conanfile.py similarity index 100% rename from recipes/xz_utils/cmake/test_package/conanfile.py rename to recipes/kuliya/all/test_package/conanfile.py diff --git a/recipes/kuliya/all/test_package/test_package.c b/recipes/kuliya/all/test_package/test_package.c new file mode 100644 index 00000000000000..5e3b275cf27470 --- /dev/null +++ b/recipes/kuliya/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#undef NDEBUG + +#include +#include +#include + +int main() +{ + kuliya_init(); + kuliya_schema *res = get_node_by_path("umkb/fst"); + assert(strcmp(res->name.en, "Faculty of Science and Technology") == 0); + kuliya_deinit(); +} diff --git a/recipes/kuliya/config.yml b/recipes/kuliya/config.yml new file mode 100644 index 00000000000000..40341aa3db6cd3 --- /dev/null +++ b/recipes/kuliya/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/leopard/all/conandata.yml b/recipes/leopard/all/conandata.yml new file mode 100644 index 00000000000000..8db107b9626354 --- /dev/null +++ b/recipes/leopard/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.0": + url: "https://github.com/hosseinmoein/Leopard/archive/refs/tags/2.0.0.tar.gz" + sha256: "c24ac5d2555c4496f26662925061a52ae1b2265ae9fc91b0cce19d1647d62699" diff --git a/recipes/leopard/all/conanfile.py b/recipes/leopard/all/conanfile.py new file mode 100644 index 00000000000000..f2a3c9d5554775 --- /dev/null +++ b/recipes/leopard/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.52.0" + + +class LeopardConan(ConanFile): + name = "leopard" + description = "C++ light-weight Thread Pool library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hosseinmoein/Leopard" + topics = ("async", "concurrency", "multithreading", "threadpool", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "apple-clang": "14", + "Visual Studio": "16", + "msvc": "192", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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 package(self): + copy(self, pattern="License", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + copy( + self, + pattern="*.tcc", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "ThreadPool") + self.cpp_info.set_property("cmake_target_name", "ThreadPool::ThreadPool") + self.cpp_info.set_property("pkg_config_name", "ThreadPool") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "dl", "m"]) diff --git a/recipes/leopard/all/test_package/CMakeLists.txt b/recipes/leopard/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..f4cfdb829d7c96 --- /dev/null +++ b/recipes/leopard/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ThreadPool REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ThreadPool::ThreadPool) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/leopard/all/test_package/conanfile.py b/recipes/leopard/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/leopard/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/leopard/all/test_package/test_package.cpp b/recipes/leopard/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..f04dada22a2ec1 --- /dev/null +++ b/recipes/leopard/all/test_package/test_package.cpp @@ -0,0 +1,65 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace hmthrp; + +// ---------------------------------------------------------------------------- + +static constexpr std::size_t THREAD_COUNT = 5; + +// ---------------------------------------------------------------------------- + +static void parallel_accumulate() { + + std::cout << "Running parallel_accumulate() ..." << std::endl; + + constexpr std::size_t n { 10003 }; + constexpr std::size_t the_sum { (n * (n + 1)) / 2 }; + std::vector vec (n); + + std::iota(vec.begin(), vec.end(), 1); + + constexpr std::size_t block_size { n / THREAD_COUNT }; + std::vector> futs; + auto block_start = vec.begin(); + ThreadPool thr_pool { THREAD_COUNT }; + + futs.reserve(THREAD_COUNT - 1); + for (std::size_t i = 0; i < (THREAD_COUNT - 1); ++i) { + const auto block_end { block_start + block_size }; + + futs.push_back( + thr_pool.dispatch( + false, + std::accumulate, + block_start, block_end, 0)); + block_start = block_end; + } + + // Last result + // + std::size_t result { std::accumulate(block_start, vec.end(), 0UL) }; + + for (std::size_t i = 0; i < futs.size(); ++i) + result += futs[i].get(); + + assert(result == the_sum); + return; +} + +// ---------------------------------------------------------------------------- + +int main (int, char *[]) { + + parallel_accumulate(); + + return (EXIT_SUCCESS); +} diff --git a/recipes/leopard/config.yml b/recipes/leopard/config.yml new file mode 100644 index 00000000000000..d77ad03cbf5108 --- /dev/null +++ b/recipes/leopard/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.0": + folder: all diff --git a/recipes/libarchive/all/conandata.yml b/recipes/libarchive/all/conandata.yml index b08c943036aa4d..01c85d94ab821a 100644 --- a/recipes/libarchive/all/conandata.yml +++ b/recipes/libarchive/all/conandata.yml @@ -1,32 +1,27 @@ sources: + "3.7.3": + url: "https://github.com/libarchive/libarchive/releases/download/v3.7.3/libarchive-3.7.3.tar.xz" + sha256: "63e7a7174638fc7d6b79b4c8b0ad954e0f4f45abe7239c1ecb200232aa9a43d2" "3.7.2": url: "https://github.com/libarchive/libarchive/releases/download/v3.7.2/libarchive-3.7.2.tar.xz" sha256: "04357661e6717b6941682cde02ad741ae4819c67a260593dfb2431861b251acb" "3.7.1": url: "https://github.com/libarchive/libarchive/releases/download/v3.7.1/libarchive-3.7.1.tar.xz" sha256: "b17403ce670ff18d8e06fea05a9ea9accf70678c88f1b9392a2e29b51127895f" - "3.6.2": - url: "https://github.com/libarchive/libarchive/releases/download/v3.6.2/libarchive-3.6.2.tar.xz" - sha256: "9e2c1b80d5fbe59b61308fdfab6c79b5021d7ff4ff2489fb12daf0a96a83551d" - "3.6.1": - url: "https://github.com/libarchive/libarchive/releases/download/v3.6.1/libarchive-3.6.1.tar.xz" - sha256: "5a411aceb978f43e626f0c2d1812ddd8807b645ed892453acabd532376c148e6" - "3.6.0": - url: "https://github.com/libarchive/libarchive/releases/download/v3.6.0/libarchive-3.6.0.tar.xz" - sha256: "df283917799cb88659a5b33c0a598f04352d61936abcd8a48fe7b64e74950de7" - "3.5.2": - url: "https://github.com/libarchive/libarchive/releases/download/v3.5.2/libarchive-3.5.2.tar.xz" - sha256: "f0b19ff39c3c9a5898a219497ababbadab99d8178acc980155c7e1271089b5a0" - "3.5.1": - url: "https://github.com/libarchive/libarchive/releases/download/v3.5.1/libarchive-3.5.1.tar.xz" - sha256: "0e17d3a8d0b206018693b27f08029b598f6ef03600c2b5d10c94ce58692e299b" - "3.4.3": - url: "https://github.com/libarchive/libarchive/releases/download/v3.4.3/libarchive-3.4.3.tar.xz" - sha256: "0bfc3fd40491768a88af8d9b86bf04a9e95b6d41a94f9292dbc0ec342288c05f" - "3.4.0": - url: "https://github.com/libarchive/libarchive/releases/download/v3.4.0/libarchive-3.4.0.tar.gz" - sha256: "8643d50ed40c759f5412a3af4e353cffbce4fdf3b5cf321cb72cacf06b2d825e" patches: + "3.7.3": + - patch_file: "patches/0001-3.7.3-zlib-winapi.patch" + patch_description: "Remove broken ZLIB WINAPI check" + patch_type: "portability" + - patch_file: "patches/0003-3.7.3-cmake.patch" + patch_description: "Make CMake build-system compatible with Conan" + patch_type: "conan" + - patch_file: "patches/0005-3.7.3-try-compile-cmakedeps.patch" + patch_description: "Patch try_compile check to work with imported CMake targets from Conan packages" + patch_type: "conan" + - patch_file: "patches/0006-3.7.3-fix-msvc-build.patch" + patch_description: "Fix MSVC build" + patch_type: "conan" "3.7.2": - patch_file: "patches/0001-3.7.2-zlib-winapi.patch" patch_description: "Remove broken ZLIB WINAPI check" @@ -57,67 +52,3 @@ patches: - patch_file: "patches/0006-3.7.1-fix-msvc-build.patch" patch_description: "Fix MSVC build" patch_type: "conan" - "3.6.2": - - patch_file: "patches/0001-3.6.2-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0003-3.6.2-cmake.patch" - patch_description: "Make CMake build-system compatible with Conan" - patch_type: "conan" - - patch_file: "patches/0005-3.6.2-try-compile-cmakedeps.patch" - patch_description: "Patch try_compile check to work with imported CMake targets from Conan packages" - patch_type: "conan" - - patch_file: "patches/0006-3.6.2-fix-msvc-build.patch" - patch_description: "Fix MSVC build" - patch_type: "conan" - "3.6.1": - - patch_file: "patches/0001-3.6.0-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0003-3.6.0-cmake.patch" - patch_description: "Make CMake build-system compatible with Conan" - patch_type: "conan" - - patch_file: "patches/0004-3.6.0-android.patch" - patch_description: "Add missing include directory for Android" - patch_type: "portability" - "3.6.0": - - patch_file: "patches/0001-3.6.0-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0003-3.6.0-cmake.patch" - patch_description: "Make CMake cooperate with Conan" - patch_type: "conan" - - patch_file: "patches/0004-3.6.0-android.patch" - patch_description: "Add missing include directory for Android" - patch_type: "portability" - "3.5.2": - - patch_file: "patches/0001-3.4.3-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0003-3.5.2-cmake.patch" - patch_description: "Make CMake cooperate with Conan" - patch_type: "conan" - "3.5.1": - - patch_file: "patches/0001-3.4.3-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0003-3.5.1-cmake.patch" - patch_description: "Make CMake cooperate with Conan" - patch_type: "conan" - "3.4.3": - - patch_file: "patches/0001-3.4.3-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0003-3.4.3-cmake.patch" - patch_description: "Make CMake cooperate with Conan" - patch_type: "conan" - "3.4.0": - - patch_file: "patches/0001-3.4.0-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0002-3.4.0-msvc-no-we4061.patch" - patch_description: "Remove MSVC compiler warning e4061" - patch_type: "portability" - - patch_file: "patches/0003-3.4.0-cmake.patch" - patch_description: "Make CMake cooperate with Conan" - patch_type: "conan" diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 2f2b32fea96257..c68aabe657d310 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -38,6 +38,7 @@ class LibarchiveConan(ConanFile): "with_zstd": [True, False], "with_mbedtls": [True, False], "with_xattr": [True, False], + "with_pcre2": [True, False], } default_options = { "shared": False, @@ -59,6 +60,7 @@ class LibarchiveConan(ConanFile): "with_zstd": False, "with_mbedtls": False, "with_xattr": False, + "with_pcre2": False, } def export_sources(self): @@ -67,8 +69,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if Version(self.version) < "3.4.2": - del self.options.with_mbedtls + if Version(self.version) < "3.7.3": + del self.options.with_pcre2 def configure(self): if self.options.shared: @@ -85,9 +87,9 @@ def requirements(self): if self.options.with_bzip2: self.requires("bzip2/1.0.8") if self.options.with_libxml2: - self.requires("libxml2/2.12.3") + self.requires("libxml2/[>=2.12.5 <3]") if self.options.with_expat: - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_iconv: self.requires("libiconv/1.17") if self.options.with_pcreposix: @@ -108,6 +110,8 @@ def requirements(self): self.requires("zstd/1.5.5") if self.options.get_safe("with_mbedtls"): self.requires("mbedtls/3.5.1") + if self.options.get_safe("with_pcre2"): + self.requires("pcre2/10.43") def validate(self): if self.settings.os != "Windows" and self.options.with_cng: @@ -152,8 +156,9 @@ def generate(self): tc.variables["ENABLE_UNZIP"] = False # too strict check tc.variables["ENABLE_WERROR"] = False - if Version(self.version) >= "3.4.2": - tc.variables["ENABLE_MBEDTLS"] = self.options.with_mbedtls + tc.variables["ENABLE_MBEDTLS"] = self.options.with_mbedtls + if Version(self.version) >= "3.7.3": + tc.variables["ENABLE_PCRE2POSIX"] = self.options.with_pcre2 tc.variables["ENABLE_XATTR"] = self.options.with_xattr # TODO: Remove after fixing https://github.com/conan-io/conan/issues/12012 if is_msvc(self): diff --git a/recipes/libarchive/all/patches/0001-3.4.0-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.4.0-zlib-winapi.patch deleted file mode 100644 index 5acce6e86c2cd2..00000000000000 --- a/recipes/libarchive/all/patches/0001-3.4.0-zlib-winapi.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4fd93d04..922efd15 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -415,14 +415,7 @@ IF(ZLIB_FOUND) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) - IF(WIN32 AND NOT CYGWIN) -- # -- # Test if ZLIB_WINAPI macro is needed to use. -- # -- TRY_MACRO_FOR_LIBRARY( -- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" -- RUNS -- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" -- ZLIB_WINAPI) -+ set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) - ADD_DEFINITIONS(-DZLIB_WINAPI) - ELSE(ZLIB_WINAPI) diff --git a/recipes/libarchive/all/patches/0001-3.4.3-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.4.3-zlib-winapi.patch deleted file mode 100644 index b0d70de9dec3b1..00000000000000 --- a/recipes/libarchive/all/patches/0001-3.4.3-zlib-winapi.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6b00410c..e0359b51 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -420,14 +420,7 @@ IF(ZLIB_FOUND) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) - IF(WIN32 AND NOT CYGWIN) -- # -- # Test if ZLIB_WINAPI macro is needed to use. -- # -- TRY_MACRO_FOR_LIBRARY( -- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" -- RUNS -- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" -- ZLIB_WINAPI) -+ set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) - ADD_DEFINITIONS(-DZLIB_WINAPI) - ELSE(ZLIB_WINAPI) diff --git a/recipes/libarchive/all/patches/0001-3.6.0-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.6.0-zlib-winapi.patch deleted file mode 100644 index dceed2848f701a..00000000000000 --- a/recipes/libarchive/all/patches/0001-3.6.0-zlib-winapi.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7a0d300a..646e5ce7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -426,14 +426,7 @@ IF(ZLIB_FOUND) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) - IF(WIN32 AND NOT CYGWIN) -- # -- # Test if ZLIB_WINAPI macro is needed to use. -- # -- TRY_MACRO_FOR_LIBRARY( -- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" -- RUNS -- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" -- ZLIB_WINAPI) -+ set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) - ADD_DEFINITIONS(-DZLIB_WINAPI) - ELSE(ZLIB_WINAPI) diff --git a/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch deleted file mode 100644 index 9e88323972df92..00000000000000 --- a/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 713e3bc..2315da5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -430,14 +430,14 @@ IF(ZLIB_FOUND) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) - IF(WIN32 AND NOT CYGWIN) -- # -- # Test if ZLIB_WINAPI macro is needed to use. -- # -- TRY_MACRO_FOR_LIBRARY( -- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" -- RUNS -- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" -- ZLIB_WINAPI) -+ -+ -+ -+ -+ -+ -+ -+ set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) - ADD_DEFINITIONS(-DZLIB_WINAPI) - ELSE(ZLIB_WINAPI) diff --git a/recipes/libarchive/all/patches/0001-3.7.3-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.7.3-zlib-winapi.patch new file mode 100644 index 00000000000000..ca141ca403e55b --- /dev/null +++ b/recipes/libarchive/all/patches/0001-3.7.3-zlib-winapi.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c0fbd70..44ca23d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -454,12 +454,12 @@ IF(ZLIB_FOUND) + # + # Test if ZLIB_WINAPI macro is needed to use. + # +- TRY_MACRO_FOR_LIBRARY( +- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" +- RUNS +- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" +- ZLIB_WINAPI) +- IF(ZLIB_WINAPI) ++ # TRY_MACRO_FOR_LIBRARY( ++ # "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" ++ # RUNS ++ # "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" ++ # ZLIB_WINAPI) ++ IF(TRUE) + ADD_DEFINITIONS(-DZLIB_WINAPI) + ELSE(ZLIB_WINAPI) + # Test if a macro is needed for the library. diff --git a/recipes/libarchive/all/patches/0002-3.4.0-msvc-no-we4061.patch b/recipes/libarchive/all/patches/0002-3.4.0-msvc-no-we4061.patch deleted file mode 100644 index ff6f218ef3e366..00000000000000 --- a/recipes/libarchive/all/patches/0002-3.4.0-msvc-no-we4061.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 922efd15..4ffd0930 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -157,7 +157,6 @@ IF (MSVC) - # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" - # Enable level 4 C4061: The enumerate has no associated handler in a switch - # statement. -- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4061") - # Enable level 4 C4254: A larger bit field was assigned to a smaller bit - # field. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254") diff --git a/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch b/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch deleted file mode 100644 index 7b34085f1a3a25..00000000000000 --- a/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch +++ /dev/null @@ -1,142 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4ffd0930..01e8592c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,7 +6,7 @@ endif() - # - PROJECT(libarchive C) - # --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") - if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) - endif() -@@ -412,7 +412,7 @@ IF(ZLIB_FOUND) - SET(HAVE_LIBZ 1) - SET(HAVE_ZLIB_H 1) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) -- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) -+ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) - IF(WIN32 AND NOT CYGWIN) - set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) -@@ -474,7 +474,7 @@ IF(LIBLZMA_FOUND) - SET(HAVE_LIBLZMA 1) - SET(HAVE_LZMA_H 1) - CMAKE_PUSH_CHECK_STATE() -- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -+ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) - LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -491,7 +491,7 @@ IF(LIBLZMA_FOUND) - ELSE(LIBLZMA_FOUND) - # LZMA not found and will not be used. - ENDIF(LIBLZMA_FOUND) --MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) -+MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) - MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) - - # -@@ -561,7 +561,7 @@ IF(ENABLE_LZ4) - ENDIF (LZ4_INCLUDE_DIR) - - FIND_PATH(LZ4_INCLUDE_DIR lz4.h) -- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) -+ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) - ELSE(ENABLE_LZ4) -@@ -757,7 +757,7 @@ ENDIF(ENABLE_NETTLE) - # Find OpenSSL - # (Except on Mac, where OpenSSL is deprecated.) - # --IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") -+IF(ENABLE_OPENSSL) - FIND_PACKAGE(OpenSSL) - IF(OPENSSL_FOUND) - SET(HAVE_LIBCRYPTO 1) -@@ -1316,7 +1316,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) - CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) - CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) --CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) - CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) - CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) - CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1348,11 +1348,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) - CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) - CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) --CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) --CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) --CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) --CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) --CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) - CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) - CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1364,10 +1364,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) - CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) --CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) --CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) --CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) --CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) - - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index ec775bb4..8ef2d620 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -235,11 +235,15 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - ENDIF() - - # Libarchive is a shared library -+if (BUILD_SHARED_LIBS) -+ - ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) - -+else() -+ - # archive_static is a static library - ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) -@@ -249,13 +253,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS - IF(NOT WIN32 OR CYGWIN) - SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) - ENDIF(NOT WIN32 OR CYGWIN) -+endif() - - IF(ENABLE_INSTALL) - # How to install the libraries -- INSTALL(TARGETS archive archive_static -+ if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) -+ else() -+ INSTALL(TARGETS archive_static - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -+ endif() - INSTALL_MAN(${libarchive_MANS}) - INSTALL(FILES ${include_HEADERS} DESTINATION include) - ENDIF() diff --git a/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch b/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch deleted file mode 100644 index 45a9561474f8e2..00000000000000 --- a/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch +++ /dev/null @@ -1,150 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6013d9e6..125b1cb3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,7 +6,7 @@ endif() - # - PROJECT(libarchive C) - # --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") - if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) - endif() -@@ -418,7 +418,7 @@ IF(ZLIB_FOUND) - SET(HAVE_LIBZ 1) - SET(HAVE_ZLIB_H 1) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) -- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) -+ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) - IF(WIN32 AND NOT CYGWIN) - set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) -@@ -480,7 +480,7 @@ IF(LIBLZMA_FOUND) - SET(HAVE_LIBLZMA 1) - SET(HAVE_LZMA_H 1) - CMAKE_PUSH_CHECK_STATE() -- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -+ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) - LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -497,7 +497,7 @@ IF(LIBLZMA_FOUND) - ELSE(LIBLZMA_FOUND) - # LZMA not found and will not be used. - ENDIF(LIBLZMA_FOUND) --MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) -+MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) - MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) - - # -@@ -567,7 +567,7 @@ IF(ENABLE_LZ4) - ENDIF (LZ4_INCLUDE_DIR) - - FIND_PATH(LZ4_INCLUDE_DIR lz4.h) -- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) -+ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) - ELSE(ENABLE_LZ4) -@@ -783,7 +783,7 @@ ENDIF(ENABLE_NETTLE) - # Find OpenSSL - # (Except on Mac, where OpenSSL is deprecated.) - # --IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") -+IF(ENABLE_OPENSSL) - FIND_PACKAGE(OpenSSL) - IF(OPENSSL_FOUND) - SET(HAVE_LIBCRYPTO 1) -@@ -1349,7 +1349,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) - CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) - CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) --CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) - CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) - CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) - CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1371,6 +1371,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(strchr HAVE_STRCHR) - CHECK_FUNCTION_EXISTS_GLIBC(strdup HAVE_STRDUP) - CHECK_FUNCTION_EXISTS_GLIBC(strerror HAVE_STRERROR) - CHECK_FUNCTION_EXISTS_GLIBC(strncpy_s HAVE_STRNCPY_S) -+CHECK_FUNCTION_EXISTS_GLIBC(strnlen HAVE_STRNLEN) - CHECK_FUNCTION_EXISTS_GLIBC(strrchr HAVE_STRRCHR) - CHECK_FUNCTION_EXISTS_GLIBC(symlink HAVE_SYMLINK) - CHECK_FUNCTION_EXISTS_GLIBC(timegm HAVE_TIMEGM) -@@ -1381,11 +1382,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) - CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) - CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) --CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) --CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) --CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) --CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) --CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) - CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) - CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1398,10 +1399,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) - CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) --CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) --CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) --CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) --CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) - - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index 9389bbc9..76e0b5c7 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -236,11 +236,15 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - ENDIF() - - # Libarchive is a shared library -+if (BUILD_SHARED_LIBS) -+ - ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) - -+else() -+ - # archive_static is a static library - ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) -@@ -250,13 +254,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS - IF(NOT WIN32 OR CYGWIN) - SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) - ENDIF(NOT WIN32 OR CYGWIN) -+endif() - - IF(ENABLE_INSTALL) - # How to install the libraries -- INSTALL(TARGETS archive archive_static -+ if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) -+ else() -+ INSTALL(TARGETS archive_static - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -+ endif() - INSTALL_MAN(${libarchive_MANS}) - INSTALL(FILES ${include_HEADERS} DESTINATION include) - ENDIF() diff --git a/recipes/libarchive/all/patches/0003-3.5.1-cmake.patch b/recipes/libarchive/all/patches/0003-3.5.1-cmake.patch deleted file mode 100644 index 181a183093fc3e..00000000000000 --- a/recipes/libarchive/all/patches/0003-3.5.1-cmake.patch +++ /dev/null @@ -1,142 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 256b966e..30c42967 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,7 +6,7 @@ endif() - # - PROJECT(libarchive C) - # --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") - if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) - endif() -@@ -418,7 +418,7 @@ IF(ZLIB_FOUND) - SET(HAVE_LIBZ 1) - SET(HAVE_ZLIB_H 1) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) -- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) -+ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) - IF(WIN32 AND NOT CYGWIN) - set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) -@@ -480,7 +480,7 @@ IF(LIBLZMA_FOUND) - SET(HAVE_LIBLZMA 1) - SET(HAVE_LZMA_H 1) - CMAKE_PUSH_CHECK_STATE() -- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -+ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) - LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -497,7 +497,7 @@ IF(LIBLZMA_FOUND) - ELSE(LIBLZMA_FOUND) - # LZMA not found and will not be used. - ENDIF(LIBLZMA_FOUND) --MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) -+MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) - MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) - - # -@@ -567,7 +567,7 @@ IF(ENABLE_LZ4) - ENDIF (LZ4_INCLUDE_DIR) - - FIND_PATH(LZ4_INCLUDE_DIR lz4.h) -- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) -+ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) - ELSE(ENABLE_LZ4) -@@ -783,7 +783,7 @@ ENDIF(ENABLE_NETTLE) - # Find OpenSSL - # (Except on Mac, where OpenSSL is deprecated.) - # --IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") -+IF(ENABLE_OPENSSL) - FIND_PACKAGE(OpenSSL) - IF(OPENSSL_FOUND) - SET(HAVE_LIBCRYPTO 1) -@@ -1349,7 +1349,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) - CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) - CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) --CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) - CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) - CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) - CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1382,11 +1382,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) - CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) - CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) --CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) --CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) --CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) --CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) --CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) - CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) - CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1399,10 +1399,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) - CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) --CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) --CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) --CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) --CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) - - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index 9389bbc9..76e0b5c7 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -236,11 +236,15 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - ENDIF() - - # Libarchive is a shared library -+if (BUILD_SHARED_LIBS) -+ - ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) - -+else() -+ - # archive_static is a static library - ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) -@@ -250,13 +254,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS - IF(NOT WIN32 OR CYGWIN) - SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) - ENDIF(NOT WIN32 OR CYGWIN) -+endif() - - IF(ENABLE_INSTALL) - # How to install the libraries -- INSTALL(TARGETS archive archive_static -+ if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) -+ else() -+ INSTALL(TARGETS archive_static - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -+ endif() - INSTALL_MAN(${libarchive_MANS}) - INSTALL(FILES ${include_HEADERS} DESTINATION include) - ENDIF() diff --git a/recipes/libarchive/all/patches/0003-3.5.2-cmake.patch b/recipes/libarchive/all/patches/0003-3.5.2-cmake.patch deleted file mode 100644 index 46955b7f8f7ce1..00000000000000 --- a/recipes/libarchive/all/patches/0003-3.5.2-cmake.patch +++ /dev/null @@ -1,142 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e0359b51..3927a742 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,7 +6,7 @@ endif() - # - PROJECT(libarchive C) - # --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") - if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) - endif() -@@ -418,7 +418,7 @@ IF(ZLIB_FOUND) - SET(HAVE_LIBZ 1) - SET(HAVE_ZLIB_H 1) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) -- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) -+ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) - IF(WIN32 AND NOT CYGWIN) - set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) -@@ -480,7 +480,7 @@ IF(LIBLZMA_FOUND) - SET(HAVE_LIBLZMA 1) - SET(HAVE_LZMA_H 1) - CMAKE_PUSH_CHECK_STATE() -- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -+ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) - LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -497,7 +497,7 @@ IF(LIBLZMA_FOUND) - ELSE(LIBLZMA_FOUND) - # LZMA not found and will not be used. - ENDIF(LIBLZMA_FOUND) --MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) -+MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) - MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) - - # -@@ -567,7 +567,7 @@ IF(ENABLE_LZ4) - ENDIF (LZ4_INCLUDE_DIR) - - FIND_PATH(LZ4_INCLUDE_DIR lz4.h) -- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) -+ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) - ELSE(ENABLE_LZ4) -@@ -783,7 +783,7 @@ ENDIF(ENABLE_NETTLE) - # Find OpenSSL - # (Except on Mac, where OpenSSL is deprecated.) - # --IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") -+IF(ENABLE_OPENSSL) - FIND_PACKAGE(OpenSSL) - IF(OPENSSL_FOUND) - SET(HAVE_LIBCRYPTO 1) -@@ -1350,7 +1350,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) - CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) - CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) --CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) - CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) - CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) - CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1383,11 +1383,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) - CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) - CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) --CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) --CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) --CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) --CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) --CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) - CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) - CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1400,10 +1400,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) - CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) --CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) --CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) --CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) --CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) - - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index e1d76a51..792b26b3 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -238,11 +238,15 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - ENDIF() - - # Libarchive is a shared library -+if (BUILD_SHARED_LIBS) -+ - ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) - -+else() -+ - # archive_static is a static library - ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) -@@ -252,13 +256,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS - IF(NOT WIN32 OR CYGWIN) - SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) - ENDIF(NOT WIN32 OR CYGWIN) -+endif() - - IF(ENABLE_INSTALL) - # How to install the libraries -- INSTALL(TARGETS archive archive_static -+ if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) -+ else() -+ INSTALL(TARGETS archive_static - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -+ endif() - INSTALL_MAN(${libarchive_MANS}) - INSTALL(FILES ${include_HEADERS} DESTINATION include) - ENDIF() diff --git a/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch b/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch deleted file mode 100644 index 3c89010df2abab..00000000000000 --- a/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch +++ /dev/null @@ -1,153 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 646e5ce7..9bca273f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -9,7 +9,7 @@ endif() - # - PROJECT(libarchive C) - # --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") - if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) - endif() -@@ -424,7 +424,7 @@ IF(ZLIB_FOUND) - SET(HAVE_LIBZ 1) - SET(HAVE_ZLIB_H 1) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) -- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) -+ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) - IF(WIN32 AND NOT CYGWIN) - set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) -@@ -486,7 +486,7 @@ IF(LIBLZMA_FOUND) - SET(HAVE_LIBLZMA 1) - SET(HAVE_LZMA_H 1) - CMAKE_PUSH_CHECK_STATE() -- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -+ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) - LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -503,7 +503,7 @@ IF(LIBLZMA_FOUND) - ELSE(LIBLZMA_FOUND) - # LZMA not found and will not be used. - ENDIF(LIBLZMA_FOUND) --MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) -+MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) - MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) - - # -@@ -573,7 +573,7 @@ IF(ENABLE_LZ4) - ENDIF (LZ4_INCLUDE_DIR) - - FIND_PATH(LZ4_INCLUDE_DIR lz4.h) -- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) -+ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) - ELSE(ENABLE_LZ4) -@@ -790,7 +790,7 @@ ENDIF(ENABLE_NETTLE) - # Find OpenSSL - # (Except on Mac, where OpenSSL is deprecated.) - # --IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") -+IF(ENABLE_OPENSSL) - FIND_PACKAGE(OpenSSL) - IF(OPENSSL_FOUND) - SET(HAVE_LIBCRYPTO 1) -@@ -1357,7 +1357,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) - CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) - CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) --CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) - CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) - CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) - CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1390,11 +1390,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) - CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) - CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) --CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) --CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) --CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) --CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) --CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) - CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) - CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1407,10 +1407,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) - CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) --CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) --CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) --CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) --CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) - - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index e1d76a51..713c6496 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -5,6 +5,10 @@ - # - ############################################ - -+if (ANDROID) -+ include_directories(${PROJECT_SOURCE_DIR}/contrib/android/include) -+endif() -+ - # Public headers - SET(include_HEADERS - archive.h -@@ -238,11 +242,15 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - ENDIF() - - # Libarchive is a shared library -+if (BUILD_SHARED_LIBS) -+ - ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) - -+else() -+ - # archive_static is a static library - ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) -@@ -252,13 +260,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS - IF(NOT WIN32 OR CYGWIN) - SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) - ENDIF(NOT WIN32 OR CYGWIN) -+endif() - - IF(ENABLE_INSTALL) - # How to install the libraries -- INSTALL(TARGETS archive archive_static -+ if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) -+ else() -+ INSTALL(TARGETS archive_static - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -+ endif() - INSTALL_MAN(${libarchive_MANS}) - INSTALL(FILES ${include_HEADERS} DESTINATION include) - ENDIF() diff --git a/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch b/recipes/libarchive/all/patches/0003-3.7.3-cmake.patch similarity index 58% rename from recipes/libarchive/all/patches/0003-3.6.2-cmake.patch rename to recipes/libarchive/all/patches/0003-3.7.3-cmake.patch index aca2961950d2df..a4c5151bebe08b 100644 --- a/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch +++ b/recipes/libarchive/all/patches/0003-3.7.3-cmake.patch @@ -1,26 +1,26 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index a4a9284a..f5dbccac 100644 +index 44ca23d..40439ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -9,7 +9,7 @@ endif() +@@ -12,7 +12,7 @@ endif() # PROJECT(libarchive C) # -SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") ++LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) endif() -@@ -428,7 +428,7 @@ IF(ZLIB_FOUND) +@@ -449,7 +449,7 @@ IF(ZLIB_FOUND) SET(HAVE_LIBZ 1) SET(HAVE_ZLIB_H 1) INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) + LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) IF(WIN32 AND NOT CYGWIN) - - -@@ -497,7 +497,7 @@ IF(LIBLZMA_FOUND) + # + # Test if ZLIB_WINAPI macro is needed to use. +@@ -518,7 +518,7 @@ IF(LIBLZMA_FOUND) SET(HAVE_LIBLZMA 1) SET(HAVE_LZMA_H 1) CMAKE_PUSH_CHECK_STATE() @@ -29,16 +29,16 @@ index a4a9284a..f5dbccac 100644 SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -514,7 +514,7 @@ IF(LIBLZMA_FOUND) - ELSE(LIBLZMA_FOUND) +@@ -539,7 +539,7 @@ ELSE(LIBLZMA_FOUND) # LZMA not found and will not be used. + SET(HAVE_LZMA_STREAM_ENCODER_MT 0) ENDIF(LIBLZMA_FOUND) -MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) +MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) # -@@ -584,7 +584,7 @@ IF(ENABLE_LZ4) +@@ -610,7 +610,7 @@ IF(ENABLE_LZ4) ENDIF (LZ4_INCLUDE_DIR) FIND_PATH(LZ4_INCLUDE_DIR lz4.h) @@ -47,7 +47,7 @@ index a4a9284a..f5dbccac 100644 INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) ELSE(ENABLE_LZ4) -@@ -806,7 +806,7 @@ ENDIF(ENABLE_NETTLE) +@@ -834,7 +834,7 @@ ENDIF(ENABLE_NETTLE) # Find OpenSSL # (Except on Mac, where OpenSSL is deprecated.) # @@ -57,41 +57,35 @@ index a4a9284a..f5dbccac 100644 IF(OPENSSL_FOUND) SET(HAVE_LIBCRYPTO 1) diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index ff7ade00..8c867130 100644 +index b79091c..bd9e980 100644 --- a/libarchive/CMakeLists.txt +++ b/libarchive/CMakeLists.txt -@@ -242,13 +242,13 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - LIST(APPEND libarchive_SOURCES archive_disk_acl_sunos.c) - ENDIF() - --# Libarchive is a shared library -+if (BUILD_SHARED_LIBS) - ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) +@@ -251,6 +251,7 @@ IF(BUILD_SHARED_LIBS) + ENDIF(BUILD_SHARED_LIBS) --# archive_static is a static library -+else() + # archive_static is a static library ++if(NOT BUILD_SHARED_LIBS) ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) + TARGET_INCLUDE_DIRECTORIES(archive_static PUBLIC .) TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS -@@ -257,13 +257,13 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS - IF(NOT WIN32 OR CYGWIN) +@@ -260,7 +261,7 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS + IF(NOT WIN32 OR CYGWIN OR NOT BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) - ENDIF(NOT WIN32 OR CYGWIN) + ENDIF(NOT WIN32 OR CYGWIN OR NOT BUILD_SHARED_LIBS) - +endif() IF(ENABLE_INSTALL) -- # How to install the libraries -- INSTALL(TARGETS archive archive_static -- RUNTIME DESTINATION bin -- LIBRARY DESTINATION lib -- ARCHIVE DESTINATION lib) -+ if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -+ else() -+ INSTALL(TARGETS archive_static RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + # How to install the libraries + IF(BUILD_SHARED_LIBS) +@@ -269,10 +270,12 @@ IF(ENABLE_INSTALL) + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + ENDIF(BUILD_SHARED_LIBS) ++ if(NOT BUILD_SHARED_LIBS) + INSTALL(TARGETS archive_static + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + endif() INSTALL_MAN(${libarchive_MANS}) INSTALL(FILES ${include_HEADERS} DESTINATION include) diff --git a/recipes/libarchive/all/patches/0004-3.6.0-android.patch b/recipes/libarchive/all/patches/0004-3.6.0-android.patch deleted file mode 100644 index c4c91d3ecb18a1..00000000000000 --- a/recipes/libarchive/all/patches/0004-3.6.0-android.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index 792b26b3..713c6496 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -5,6 +5,10 @@ - # - ############################################ - -+if (ANDROID) -+ include_directories(${PROJECT_SOURCE_DIR}/contrib/android/include) -+endif() -+ - # Public headers - SET(include_HEADERS - archive.h diff --git a/recipes/libarchive/all/patches/0005-3.6.2-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.6.2-try-compile-cmakedeps.patch deleted file mode 100644 index 69e42f1f5678b4..00000000000000 --- a/recipes/libarchive/all/patches/0005-3.6.2-try-compile-cmakedeps.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f5dbccac..ea7ff16a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -830,12 +830,11 @@ IF(NOT OPENSSL_FOUND) - ENDIF(NOT OPENSSL_FOUND) - - # --# How to prove that CRYPTO functions, which have several names on various --# platforms, just see if archive_digest.c can compile and link against --# required libraries. - # - MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) -- FOREACH(ALGORITHM ${ALGORITHMS}) -+ FOREACH(ALGORITHM ${ALGORITHMS}) -+ include(CMakePushCheckState) -+ cmake_push_check_state() - IF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) - STRING(TOLOWER "${ALGORITHM}" lower_algorithm) - STRING(TOUPPER "${ALGORITHM}" algorithm) -@@ -856,8 +855,8 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) - IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) - SET(TRY_CRYPTO_REQUIRED_INCLUDES - "${TRY_CRYPTO_REQUIRED_INCLUDES};${OPENSSL_INCLUDE_DIR}") -- SET(TRY_CRYPTO_REQUIRED_LIBS -- "-DLINK_LIBRARIES:STRING=${OPENSSL_LIBRARIES}") -+ set(CMAKE_REQUIRED_LIBRARIES -+ ${OPENSSL_LIBRARIES}) - ELSEIF("${IMPLEMENTATION}" MATCHES "^MBEDTLS$" AND MBEDTLS_FOUND) - SET(TRY_CRYPTO_REQUIRED_INCLUDES - "${TRY_CRYPTO_REQUIRED_INCLUDES};${MBEDTLS_INCLUDE_DIRS}") -@@ -934,6 +933,7 @@ main(int argc, char **argv) - ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) - ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) - ENDIF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) -+ cmake_pop_check_state() - ENDFOREACH(ALGORITHM ${ALGORITHMS}) - ENDMACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) - diff --git a/recipes/libarchive/all/patches/0005-3.7.3-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.7.3-try-compile-cmakedeps.patch new file mode 100644 index 00000000000000..a55e8c8709b687 --- /dev/null +++ b/recipes/libarchive/all/patches/0005-3.7.3-try-compile-cmakedeps.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 40439ca..6845238 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -867,8 +867,10 @@ ENDIF(NOT OPENSSL_FOUND) + # required libraries. + # + MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) ++ include(CMakePushCheckState) + FOREACH(ALGORITHM ${ALGORITHMS}) + IF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) ++ cmake_push_check_state() + STRING(TOLOWER "${ALGORITHM}" lower_algorithm) + STRING(TOUPPER "${ALGORITHM}" algorithm) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND NOT OPENSSL_FOUND) +@@ -901,8 +903,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND) +- SET(TRY_CRYPTO_REQUIRED_LIBS +- "-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}") ++ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in diff --git a/recipes/libarchive/all/patches/0006-3.6.2-fix-msvc-build.patch b/recipes/libarchive/all/patches/0006-3.7.3-fix-msvc-build.patch similarity index 73% rename from recipes/libarchive/all/patches/0006-3.6.2-fix-msvc-build.patch rename to recipes/libarchive/all/patches/0006-3.7.3-fix-msvc-build.patch index c0903cf80cf947..d25d36378b560f 100644 --- a/recipes/libarchive/all/patches/0006-3.6.2-fix-msvc-build.patch +++ b/recipes/libarchive/all/patches/0006-3.7.3-fix-msvc-build.patch @@ -1,17 +1,17 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 713e3bc5..9bc36214 100644 +index 6845238..489936a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1374,7 +1374,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) +@@ -1471,7 +1471,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) -CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) ++SET(HAVE_MEMMOVE 1) CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1407,11 +1407,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) +@@ -1504,11 +1504,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) @@ -20,15 +20,15 @@ index 713e3bc5..9bc36214 100644 -CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) -CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) -CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) ++SET(HAVE_WCRTOMB 1) ++SET(HAVE_WCSCMP 1) ++SET(HAVE_WCSCPY 1) ++SET(HAVE_WCSLEN 1) ++SET(HAVE_WCTOMB 1) CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1424,10 +1424,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_SYMBOL_EXISTS(ctime_s "time.h" HAVE_CTIME_S) +@@ -1521,10 +1521,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) @@ -36,13 +36,10 @@ index 713e3bc5..9bc36214 100644 -CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) -CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) -CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) ++SET(HAVE_VPRINTF 1) ++SET(HAVE_WMEMCMP 1) ++SET(HAVE_WMEMCPY 1) ++SET(HAVE_WMEMMOVE 1) CMAKE_POP_CHECK_STATE() # Restore the state of the variables --- -2.33.0.windows.1 - diff --git a/recipes/libarchive/config.yml b/recipes/libarchive/config.yml index 03318759191465..c448b0fce710b5 100644 --- a/recipes/libarchive/config.yml +++ b/recipes/libarchive/config.yml @@ -1,19 +1,7 @@ versions: + "3.7.3": + folder: all "3.7.2": folder: all "3.7.1": folder: all - "3.6.2": - folder: all - "3.6.1": - folder: all - "3.6.0": - folder: all - "3.5.2": - folder: all - "3.5.1": - folder: all - "3.4.3": - folder: all - "3.4.0": - folder: all diff --git a/recipes/libassert/config.yml b/recipes/libassert/config.yml index 8ade5083845352..bd98ac7180d134 100644 --- a/recipes/libassert/config.yml +++ b/recipes/libassert/config.yml @@ -1,10 +1,14 @@ versions: # Newer versions at the top + "2.0.1": + folder: v2 + "2.0.0": + folder: v2 "1.2.2": - folder: all + folder: v1 "1.2.1": - folder: all + folder: v1 "1.1": - folder: all + folder: v1 "1.0": - folder: all + folder: v1 diff --git a/recipes/libassert/all/conandata.yml b/recipes/libassert/v1/conandata.yml similarity index 100% rename from recipes/libassert/all/conandata.yml rename to recipes/libassert/v1/conandata.yml diff --git a/recipes/libassert/all/conanfile.py b/recipes/libassert/v1/conanfile.py similarity index 87% rename from recipes/libassert/all/conanfile.py rename to recipes/libassert/v1/conanfile.py index c596be696aeb2e..8ccc475577fbca 100644 --- a/recipes/libassert/all/conanfile.py +++ b/recipes/libassert/v1/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.apple import is_apple_os from conan.tools.files import get, copy, rm, rmdir from conan.tools.build import check_min_cppstd from conan.tools.scm import Version @@ -52,14 +53,14 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if Version(self.version) >= Version("1.2.2"): + if Version(self.version) >= "1.2.2": self.requires("cpptrace/0.3.1") - elif Version(self.version) >= Version("1.2.1"): + elif Version(self.version) >= "1.2.1": self.requires("cpptrace/0.2.1") def validate(self): - if self.settings.compiler == "apple-clang": - raise ConanInvalidConfiguration("apple-clang not supported") + if is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Mac. Please, update to version >=2.0.0") if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) @@ -82,12 +83,11 @@ def generate(self): if is_msvc(self): tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) - if Version(self.version) >= Version("1.2.1"): - if not self.options.shared: - tc.variables["ASSERT_STATIC"] = True - tc.variables["ASSERT_USE_EXTERNAL_CPPTRACE"] = True - deps = CMakeDeps(self) - deps.generate() + if not self.options.shared: + tc.variables["ASSERT_STATIC"] = True + tc.variables["ASSERT_USE_EXTERNAL_CPPTRACE"] = True + deps = CMakeDeps(self) + deps.generate() tc.generate() @@ -136,8 +136,11 @@ def package_info(self): self.cpp_info.filenames["cmake_find_package_multi"] = "assert" self.cpp_info.names["cmake_find_package"] = "assert" self.cpp_info.names["cmake_find_package_multi"] = "assert" + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") - if Version(self.version) < Version("1.2.1"): + if Version(self.version) < "1.2.1": # pre-cpptrace if self.settings.os == "Linux": self.cpp_info.system_libs.append("dl") diff --git a/recipes/libassert/all/patches/1.0/0001-add-cstring-include.patch b/recipes/libassert/v1/patches/1.0/0001-add-cstring-include.patch similarity index 100% rename from recipes/libassert/all/patches/1.0/0001-add-cstring-include.patch rename to recipes/libassert/v1/patches/1.0/0001-add-cstring-include.patch diff --git a/recipes/libassert/all/patches/1.0/0002-cmake-backport.patch b/recipes/libassert/v1/patches/1.0/0002-cmake-backport.patch similarity index 100% rename from recipes/libassert/all/patches/1.0/0002-cmake-backport.patch rename to recipes/libassert/v1/patches/1.0/0002-cmake-backport.patch diff --git a/recipes/libassert/all/patches/1.0/0003-fix-max_line_number_width-miscalculation.patch b/recipes/libassert/v1/patches/1.0/0003-fix-max_line_number_width-miscalculation.patch similarity index 100% rename from recipes/libassert/all/patches/1.0/0003-fix-max_line_number_width-miscalculation.patch rename to recipes/libassert/v1/patches/1.0/0003-fix-max_line_number_width-miscalculation.patch diff --git a/recipes/libassert/all/patches/1.1/0001-fix-max_line_number_width-miscalculation.patch b/recipes/libassert/v1/patches/1.1/0001-fix-max_line_number_width-miscalculation.patch similarity index 100% rename from recipes/libassert/all/patches/1.1/0001-fix-max_line_number_width-miscalculation.patch rename to recipes/libassert/v1/patches/1.1/0001-fix-max_line_number_width-miscalculation.patch diff --git a/recipes/libassert/all/patches/1.1/0002-binary_diagnostics_descriptor-noexcept.patch b/recipes/libassert/v1/patches/1.1/0002-binary_diagnostics_descriptor-noexcept.patch similarity index 100% rename from recipes/libassert/all/patches/1.1/0002-binary_diagnostics_descriptor-noexcept.patch rename to recipes/libassert/v1/patches/1.1/0002-binary_diagnostics_descriptor-noexcept.patch diff --git a/recipes/libassert/all/patches/1.1/0003-cmake-windows.patch b/recipes/libassert/v1/patches/1.1/0003-cmake-windows.patch similarity index 100% rename from recipes/libassert/all/patches/1.1/0003-cmake-windows.patch rename to recipes/libassert/v1/patches/1.1/0003-cmake-windows.patch diff --git a/recipes/libassert/all/patches/1.2.1/0001-cpptrace-dll-copy.patch b/recipes/libassert/v1/patches/1.2.1/0001-cpptrace-dll-copy.patch similarity index 100% rename from recipes/libassert/all/patches/1.2.1/0001-cpptrace-dll-copy.patch rename to recipes/libassert/v1/patches/1.2.1/0001-cpptrace-dll-copy.patch diff --git a/recipes/libassert/all/patches/1.2.2/0001-cpptrace-dll-copy.patch b/recipes/libassert/v1/patches/1.2.2/0001-cpptrace-dll-copy.patch similarity index 100% rename from recipes/libassert/all/patches/1.2.2/0001-cpptrace-dll-copy.patch rename to recipes/libassert/v1/patches/1.2.2/0001-cpptrace-dll-copy.patch diff --git a/recipes/libassert/all/test_package/CMakeLists.txt b/recipes/libassert/v1/test_package/CMakeLists.txt similarity index 61% rename from recipes/libassert/all/test_package/CMakeLists.txt rename to recipes/libassert/v1/test_package/CMakeLists.txt index 97d2bfbc982a39..7e6204817489c2 100644 --- a/recipes/libassert/all/test_package/CMakeLists.txt +++ b/recipes/libassert/v1/test_package/CMakeLists.txt @@ -1,11 +1,12 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -find_package(assert REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -# don't link to ${CONAN_LIBS} or CONAN_PKG::package + +find_package(assert REQUIRED CONFIG) target_link_libraries(${PROJECT_NAME} PRIVATE assert::assert) -# In case the target project need a specific C++ standard + + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libassert/v1/test_package/conanfile.py b/recipes/libassert/v1/test_package/conanfile.py new file mode 100644 index 00000000000000..a804618d0f86f8 --- /dev/null +++ b/recipes/libassert/v1/test_package/conanfile.py @@ -0,0 +1,30 @@ +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 requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libassert/all/test_package/test_package.cpp b/recipes/libassert/v1/test_package/test_package.cpp similarity index 100% rename from recipes/libassert/all/test_package/test_package.cpp rename to recipes/libassert/v1/test_package/test_package.cpp diff --git a/recipes/cairo/all/test_v1_package/CMakeLists.txt b/recipes/libassert/v1/test_v1_package/CMakeLists.txt similarity index 76% rename from recipes/cairo/all/test_v1_package/CMakeLists.txt rename to recipes/libassert/v1/test_v1_package/CMakeLists.txt index 692a4909c85a77..91630d79f4abb3 100644 --- a/recipes/cairo/all/test_v1_package/CMakeLists.txt +++ b/recipes/libassert/v1/test_v1_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.1.2) -project(test_package C) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) diff --git a/recipes/libassert/all/test_v1_package/conanfile.py b/recipes/libassert/v1/test_v1_package/conanfile.py similarity index 99% rename from recipes/libassert/all/test_v1_package/conanfile.py rename to recipes/libassert/v1/test_v1_package/conanfile.py index 7e264aad8e8ec8..c492184eec19c2 100644 --- a/recipes/libassert/all/test_v1_package/conanfile.py +++ b/recipes/libassert/v1/test_v1_package/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.build import cross_building import os + # legacy validation with Conan 1.x class TestPackageV1Conan(ConanFile): settings = "os", "arch", "compiler", "build_type" diff --git a/recipes/libassert/v2/conandata.yml b/recipes/libassert/v2/conandata.yml new file mode 100644 index 00000000000000..31e3f085fe933e --- /dev/null +++ b/recipes/libassert/v2/conandata.yml @@ -0,0 +1,22 @@ +sources: + # Newer versions at the top + "2.0.1": + url: + - "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.0.1.tar.gz" + sha256: "405a44c14c5e40de5b81b01538ba12ef9d7c1f57e2c29f81b929e7e179847d4c" + "2.0.0": + url: + - "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.0.0.tar.gz" + sha256: "d4b2da2179a94637b34d18813a814531a1eceb0ddc6dd6db6098050dd638f4a1" + +patches: + "2.0.1": + - patch_file: "patches/2.0.1/0001-fix-string_view-detection.patch" + patch_type: "portability" + patch_source: https://github.com/jeremy-rifkin/libassert/commit/1825976ebc7ccb34687d75aaaaf2a961dafc5450 + patch_description: "Update #if checks for string_view support" + "2.0.0": + - patch_file: "patches/2.0.0/0001-fix-export-and-include.patch" + patch_type: "bugfix" + patch_source: https://github.com/jeremy-rifkin/libassert/commit/25c1f3e43737ab18490a0d9430cb1c70f976a662 + patch_description: "Fix export header and an incorrect #include" diff --git a/recipes/libassert/v2/conanfile.py b/recipes/libassert/v2/conanfile.py new file mode 100644 index 00000000000000..5beca1484870e1 --- /dev/null +++ b/recipes/libassert/v2/conanfile.py @@ -0,0 +1,141 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.apple import is_apple_os +from conan.tools.files import get, copy, rm, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches +import os + +required_conan_version = ">=1.53.0" + +class LibassertConan(ConanFile): + name = "libassert" + description = "The most over-engineered C++ assertion library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jeremy-rifkin/libassert" + package_type = "library" + + topics = ("assert", "library", "assertions", "stacktrace", "diagnostics", "defensive programming", "testing") + 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 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "9" + } + + 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("cpptrace/0.5.1", transitive_headers=True, transitive_libs=True) + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + check_min_vs(self, 192) + if not is_msvc(self): + 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 export_sources(self): + export_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + + tc.variables["LIBASSERT_USE_EXTERNAL_CPPTRACE"] = True + deps = CMakeDeps(self) + deps.generate() + + tc.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() + + if self.settings.os == "Windows" and self.options.shared: + copy( + self, + "*.dll", + src=self.build_folder, + dst=os.path.join(self.package_folder, "bin"), + keep_path=False + ) + + 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")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.libs = ["assert"] + + self.cpp_info.set_property("cmake_file_name", "libassert") + self.cpp_info.set_property("cmake_target_name", "libassert::assert") + + # the first version of this library used assert/assert as include folder + # appending this one but not removing the default to not break consumers + self.cpp_info.includedirs.append(os.path.join("include", "libassert")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "libassert" + self.cpp_info.filenames["cmake_find_package_multi"] = "libassert" + self.cpp_info.names["cmake_find_package"] = "libassert" + self.cpp_info.names["cmake_find_package_multi"] = "libassert" + + self.cpp_info.components["assert"].names["cmake_find_package"] = "assert" + self.cpp_info.components["assert"].names["cmake_find_package_multi"] = "assert" + self.cpp_info.components["assert"].requires = ["cpptrace::cpptrace"] + self.cpp_info.components["assert"].libs = ["assert"] + if not self.options.shared: + self.cpp_info.components["assert"].defines.append("LIBASSERT_STATIC_DEFINE") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.requires = ["cpptrace::cpptrace"] diff --git a/recipes/libassert/v2/patches/2.0.0/0001-fix-export-and-include.patch b/recipes/libassert/v2/patches/2.0.0/0001-fix-export-and-include.patch new file mode 100644 index 00000000000000..199fdd0350b428 --- /dev/null +++ b/recipes/libassert/v2/patches/2.0.0/0001-fix-export-and-include.patch @@ -0,0 +1,13 @@ +diff --git a/include/libassert/assert-gtest.hpp b/include/libassert/assert-gtest.hpp +index 912da40..57dbc91 100644 +--- a/include/libassert/assert-gtest.hpp ++++ b/include/libassert/assert-gtest.hpp +@@ -6,8 +6,6 @@ + #define LIBASSERT_PREFIX_ASSERTIONS + #include + +-#include "tokenizer.hpp" +- + #if defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL != 0 + #error "Libassert integration does not work with MSVC's non-conformant preprocessor. /Zc:preprocessor must be used." + #endif diff --git a/recipes/libassert/v2/patches/2.0.1/0001-fix-string_view-detection.patch b/recipes/libassert/v2/patches/2.0.1/0001-fix-string_view-detection.patch new file mode 100644 index 00000000000000..ca09e305589b69 --- /dev/null +++ b/recipes/libassert/v2/patches/2.0.1/0001-fix-string_view-detection.patch @@ -0,0 +1,58 @@ +diff --git a/src/microfmt.hpp b/src/microfmt.hpp +index 0f750c3..59f5eea 100644 +--- a/src/microfmt.hpp ++++ b/src/microfmt.hpp +@@ -10,7 +10,7 @@ + #include + #include + #include +-#if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #include + #endif + #ifdef _MSC_VER +@@ -118,7 +118,7 @@ namespace microfmt { + int64_value, + uint64_value, + string_value, +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + string_view_value, + #endif + c_string_value, +@@ -128,7 +128,7 @@ namespace microfmt { + std::int64_t int64_value; + std::uint64_t uint64_value; + const std::string* string_value; +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + std::string_view string_view_value; + #endif + const char* c_string_value; +@@ -147,7 +147,7 @@ namespace microfmt { + format_value(unsigned long int_val) : uint64_value(int_val), value(value_type::uint64_value) {} + format_value(unsigned long long int_val) : uint64_value(int_val), value(value_type::uint64_value) {} + format_value(const std::string& string) : string_value(&string), value(value_type::string_value) {} +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + format_value(std::string_view sv) : string_view_value(sv), value(value_type::string_view_value) {} + #endif + format_value(const char* c_string) : c_string_value(c_string), value(value_type::c_string_value) {} +@@ -187,7 +187,7 @@ namespace microfmt { + case value_type::string_value: + do_write(out, string_value->begin(), string_value->end(), options); + break; +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + case value_type::string_view_value: + do_write(out, string_view_value.begin(), string_view_value.end(), options); + break; +@@ -302,7 +302,7 @@ namespace microfmt { + } + } + +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + template + std::string format(std::string_view fmt, Args&&... args) { + return detail::format(fmt.begin(), fmt.end(), {detail::format_value(args)...}); diff --git a/recipes/libassert/v2/test_package/CMakeLists.txt b/recipes/libassert/v2/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..af9ab923ee8f6a --- /dev/null +++ b/recipes/libassert/v2/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + + +add_executable(${PROJECT_NAME} test_package.cpp) + +find_package(libassert REQUIRED CONFIG) +target_link_libraries(${PROJECT_NAME} PRIVATE libassert::assert) + +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libassert/v2/test_package/conanfile.py b/recipes/libassert/v2/test_package/conanfile.py new file mode 100644 index 00000000000000..a804618d0f86f8 --- /dev/null +++ b/recipes/libassert/v2/test_package/conanfile.py @@ -0,0 +1,30 @@ +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 requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libassert/v2/test_package/test_package.cpp b/recipes/libassert/v2/test_package/test_package.cpp new file mode 100644 index 00000000000000..2b1f1ea26d9eea --- /dev/null +++ b/recipes/libassert/v2/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include +#include +#include + +int main(void) { + std::cout << "Testing libassert\n"; + + libassert::set_failure_handler([](const libassert::assertion_info& info) { + std::cerr< + +#include + +int main() { + boxes::RingBuffer buf; + buf.push_back(123); + + if (buf.size() == 1 && buf.front() == 123) { + std::cout << "libboxes::RingBuffer works!" << std::endl; + } else { + std::cout << "libboxes::RingBuffer is broken!" << std::endl; + } + + return 0; +} diff --git a/recipes/libboxes/config.yml b/recipes/libboxes/config.yml new file mode 100644 index 00000000000000..b893ff21f7c232 --- /dev/null +++ b/recipes/libboxes/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.1": + folder: all diff --git a/recipes/libcurl/all/conanfile.py b/recipes/libcurl/all/conanfile.py index 41ce8fa327a980..ee8cb69990cd0f 100644 --- a/recipes/libcurl/all/conanfile.py +++ b/recipes/libcurl/all/conanfile.py @@ -188,7 +188,7 @@ def requirements(self): if self.options.with_zstd: self.requires("zstd/1.5.5") if self.options.with_c_ares: - self.requires("c-ares/1.25.0") + self.requires("c-ares/1.27.0") if self.options.get_safe("with_libpsl"): self.requires("libpsl/0.21.1") diff --git a/recipes/libcvd/all/conandata.yml b/recipes/libcvd/all/conandata.yml new file mode 100644 index 00000000000000..8c0de4fe107317 --- /dev/null +++ b/recipes/libcvd/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.5.1": + url: "https://github.com/edrosten/libcvd/archive/refs/tags/RELEASE_2_5_1.tar.gz" + sha256: "c077e426e1bd6e6c7af3b9330ec1496a59789f2d0c529dc18049fc653947dd6e" diff --git a/recipes/libcvd/all/conanfile.py b/recipes/libcvd/all/conanfile.py new file mode 100644 index 00000000000000..a272a22ebfe97b --- /dev/null +++ b/recipes/libcvd/all/conanfile.py @@ -0,0 +1,177 @@ +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, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, save, rmdir, replace_in_file +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class LibCVDConan(ConanFile): + name = "libcvd" + description = "libCVD - efficient and easy-to-use C++ computer vision library" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/edrosten/libcvd" + topics = ("computer-vision",) + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libjpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], + "with_libpng": [True, False], + "with_libtiff": [True, False], + "with_ffmpeg": [True, False], + "with_libdc1394": [True, False], + "with_opengl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libjpeg": "libjpeg", + "with_libpng": True, + "with_libtiff": True, + # Build without video support by default + "with_ffmpeg": False, + "with_libdc1394": False, + "with_opengl": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "5", + "apple-clang": "10", + "msvc": "191", + "Visual Studio": "15", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + # OpenGL is always used on Windows + del self.options.with_opengl + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # https://github.com/edrosten/libcvd/blob/main/cmake/CVDFindAllDeps.cmake + if self.options.with_ffmpeg: + # FFMPEG v5.x+ are not supported + self.requires("ffmpeg/4.4.4", transitive_libs=True) + if self.options.with_libdc1394: + self.requires("libdc1394/2.2.7") + # FIXME: libidc1394 seems to be missing raw1394 dependency + # test_package fails with "undefined reference to `raw1394_new_handle'" etc + if self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/3.0.2") + elif self.options.with_libjpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_libjpeg == "mozjpeg": + self.requires("mozjpeg/4.1.5") + if self.options.with_libpng: + self.requires("libpng/[>=1.6 <2]") + if self.options.with_libtiff: + self.requires("libtiff/4.6.0") + if self.options.get_safe("with_opengl", True): + # https://github.com/edrosten/libcvd/blob/RELEASE_2_5_0/cvd/videodisplay.h#L18-L20 + if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("libglvnd/1.7.0", transitive_headers=True, transitive_libs=True) + self.requires("xorg/system", transitive_headers=True, transitive_libs=True) + else: + self.requires("opengl/system", transitive_headers=True, transitive_libs=True) + # TODO: https://github.com/ankurhanda/TooN + # https://github.com/edrosten/libcvd/blob/RELEASE_2_5_0/cvd/canny.h#L4 + # self.requires("toon/3.1.1", transitive_headers=True, transitive_libs=True) + + 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." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CVD_ENABLE_TESTS"] = False + tc.variables["CVD_ENABLE_PROGS"] = False + tc.variables["CVD_ENABLE_EXAMPLES"] = False + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_ffmpeg"] = not self.options.with_ffmpeg + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_libdc1394"] = not self.options.with_libdc1394 + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_JPEG"] = not self.options.with_libjpeg + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_PNG"] = not self.options.with_libpng + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_TIFF"] = not self.options.with_libtiff + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_OpenGL"] = not self.options.get_safe("with_opengl", True) + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_X11"] = not self.options.get_safe("with_opengl", True) + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_TooN"] = True + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("ffmpeg", "cmake_file_name", "CVD_FFMPEG") + deps.set_property("libdc1394", "cmake_file_name", "CVD_dc1394v2") + deps.set_property("toon", "cmake_file_name", "CVD_TooN") + deps.generate() + + def _patch_sources(self): + # Use deps from Conan + save(self, os.path.join(self.source_folder, "cmake", "CVDFindFFMPEG.cmake"), + "find_package(CVD_FFMPEG REQUIRED)\n" if self.options.with_ffmpeg else "") + save(self, os.path.join(self.source_folder, "cmake", "CVDFinddc1394v2.cmake"), + "find_package(CVD_dc1394v2 REQUIRED)\n" if self.options.with_libdc1394 else "") + save(self, os.path.join(self.source_folder, "cmake", "CVDFindTooN.cmake"), + "set(CVD_TooN_FOUND FALSE)\n") + + # For debugging + save(self, os.path.join(self.source_folder, "cmake", "CVDFindAllDeps.cmake"), + '\nmessage(INFO "CVD_DEP_LIBS: ${CVD_DEP_LIBS}")\n', append=True) + + # Install DLL + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)", + "install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin)") + + + 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, "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CVD") + self.cpp_info.set_property("cmake_target_name", "cvd") + self.cpp_info.set_property("cmake_find_mode", "both") + + postfix = "_debug" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = ["cvd" + postfix] + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/libcvd/all/test_package/CMakeLists.txt b/recipes/libcvd/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..22605b8561ab7c --- /dev/null +++ b/recipes/libcvd/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(CVD REQUIRED MODULE) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ${CVD_LIBRARIES}) +target_include_directories(${PROJECT_NAME} PRIVATE ${CVD_INCLUDE_DIRS}) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libcvd/all/test_package/conanfile.py b/recipes/libcvd/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/libcvd/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libcvd/all/test_package/test_package.cpp b/recipes/libcvd/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..4e0988c93bbd28 --- /dev/null +++ b/recipes/libcvd/all/test_package/test_package.cpp @@ -0,0 +1,85 @@ +// https://github.com/edrosten/libcvd/blob/RELEASE_2_5_0/examples/distance_transform.cc + +// Copyright (c) 2005--2013, The Authors +// All rights reserved. +// +// 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. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#include +#include + +using CVD::byte; +using CVD::euclidean_distance_transform_sq; +using CVD::Image; +using CVD::ImageRef; +using CVD::img_save; +using CVD::Rgb; +using std::max_element; +using std::mt19937; +using std::uniform_int_distribution; + +int main() +{ + //Create a blank image. + Image im(ImageRef(128, 128), 0); + + mt19937 engine; + uniform_int_distribution rand_x(0, im.size().x - 1); + uniform_int_distribution rand_y(0, im.size().y - 1); + + //Scatter down 7 points at random. + for(int i = 1; i < 8; i++) + im[rand_y(engine)][rand_x(engine)] = i; + + Image dt(im.size()); + Image inverse_dt(im.size()); + + //Perform the distance transform + euclidean_distance_transform_sq(im, dt, inverse_dt); + + //Create an output which is the distance transfom of the input, + //but coloured according to which pixel is closest. + int largest_distance = *max_element(dt.begin(), dt.end()); + + Image> out(im.size()); + + for(int y = 0; y < im.size().y; y++) + for(int x = 0; x < im.size().x; x++) + { + int c = floor(sqrt(dt[y][x] * 1.0 / largest_distance) * 255 + .5); + + Rgb r(0, 0, 0); + if(im[inverse_dt[y][x]] & 1) + r.red = c; + if(im[inverse_dt[y][x]] & 2) + r.green = c; + if(im[inverse_dt[y][x]] & 4) + r.blue = c; + + out[y][x] = r; + } + + img_save(out, "distance_transform_result.png"); +} diff --git a/recipes/libcvd/config.yml b/recipes/libcvd/config.yml new file mode 100644 index 00000000000000..eab83a303df52d --- /dev/null +++ b/recipes/libcvd/config.yml @@ -0,0 +1,3 @@ +versions: + "2.5.1": + folder: all diff --git a/recipes/libdrm/all/conanfile.py b/recipes/libdrm/all/conanfile.py index af355e6b5b875c..77ae8bd664da42 100644 --- a/recipes/libdrm/all/conanfile.py +++ b/recipes/libdrm/all/conanfile.py @@ -9,7 +9,7 @@ from conan.tools.meson import MesonToolchain, Meson from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class LibdrmConan(ConanFile): @@ -80,7 +80,7 @@ def layout(self): def requirements(self): if self.options.intel: self.requires("libpciaccess/0.17") - if self.settings.os in ["Linux", "FreeBSD"]: + if self.settings.os == "Linux": self.requires("linux-headers-generic/6.5.9") def validate(self): @@ -88,7 +88,7 @@ def validate(self): raise ConanInvalidConfiguration("libdrm supports only Linux or FreeBSD") def build_requirements(self): - self.tool_requires("meson/1.3.0") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.1.0") @@ -116,8 +116,8 @@ def generate(self): else: tc.project_options[o] = "true" if getattr(self.options, o) else "false" - tc.project_options["datadir"] = os.path.join(self.package_folder, "res") - tc.project_options["mandir"] = os.path.join(self.package_folder, "res", "man") + tc.project_options["datadir"] = "res" + tc.project_options["mandir"] = os.path.join("res", "man") tc.generate() def build(self): @@ -139,7 +139,7 @@ def package_info(self): self.cpp_info.components["libdrm_libdrm"].libs = ["drm"] self.cpp_info.components["libdrm_libdrm"].includedirs.append(os.path.join("include", "libdrm")) self.cpp_info.components["libdrm_libdrm"].set_property("pkg_config_name", "libdrm") - if self.settings.os in ["Linux", "FreeBSD"]: + if self.settings.os == "Linux": self.cpp_info.components["libdrm_libdrm"].requires = ["linux-headers-generic::linux-headers-generic"] if Version(self.version) < "2.4.111": diff --git a/recipes/libftp/all/conandata.yml b/recipes/libftp/all/conandata.yml new file mode 100644 index 00000000000000..6f6b3ca9dc5827 --- /dev/null +++ b/recipes/libftp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.1": + url: "https://github.com/deniskovalchuk/libftp/archive/refs/tags/v0.4.1.tar.gz" + sha256: "873dd7647234f72fecfe57150b0a4a60f4c16611d26ad7eb687e0561f54b9eec" diff --git a/recipes/libftp/all/conanfile.py b/recipes/libftp/all/conanfile.py new file mode 100644 index 00000000000000..a3d283d843da6c --- /dev/null +++ b/recipes/libftp/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, CMakeDeps, CMakeToolchain, cmake_layout +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 +import os + +required_conan_version = ">=1.53.0" + + +class LibFTPConan(ConanFile): + name = "libftp" + description = "A cross-platform FTP client library based on Boost.Asio" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/deniskovalchuk/libftp" + topics = ("ftp", "boost") + 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 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + 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.84.0", transitive_headers=True) + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared builds with Visual Studio.") + 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." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBFTP_BUILD_TEST"] = False + tc.variables["LIBFTP_BUILD_EXAMPLE"] = False + tc.variables["LIBFTP_BUILD_CMDLINE_CLIENT"] = False + 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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["ftp"] + + self.cpp_info.set_property("cmake_file_name", "ftp") + self.cpp_info.set_property("cmake_target_name", "ftp::ftp") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/libftp/all/test_package/CMakeLists.txt b/recipes/libftp/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..d4b87e9e23e3af --- /dev/null +++ b/recipes/libftp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ftp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ftp::ftp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libftp/all/test_package/conanfile.py b/recipes/libftp/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/libftp/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libftp/all/test_package/test_package.cpp b/recipes/libftp/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..8c6d986925378e --- /dev/null +++ b/recipes/libftp/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include "ftp/client.hpp" + +int main(void) { + try { + ftp::client client; + client.get_current_directory(); + client.disconnect(); + } + catch (const std::exception & ex) { + std::cerr << ex.what() << std::endl; + } + return 0; +} diff --git a/recipes/libftp/config.yml b/recipes/libftp/config.yml new file mode 100644 index 00000000000000..3a9d5538921fcd --- /dev/null +++ b/recipes/libftp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.1": + folder: all diff --git a/recipes/libgd/all/conandata.yml b/recipes/libgd/all/conandata.yml index 235cf46164b0a2..1c4db40fa14b04 100644 --- a/recipes/libgd/all/conandata.yml +++ b/recipes/libgd/all/conandata.yml @@ -48,9 +48,6 @@ patches: - patch_file: "patches/2.3.x-png-msvc.patch" patch_description: "support png on msvc" patch_type: "portability" - - patch_file: "patches/2.3.1-use-cci.patch" - patch_description: "use cci's package" - patch_type: "conan" "2.3.0": - patch_file: "patches/remove-unistd-h.patch" patch_description: "remove unistd.h to fix build error" @@ -61,9 +58,6 @@ patches: - patch_file: "patches/2.3.x-png-msvc.patch" patch_description: "support png on msvc" patch_type: "conan" - - patch_file: "patches/2.3.0-use-cci.patch" - patch_description: "use cci's package" - patch_type: "conan" "2.2.5": - patch_file: "patches/2.2.5-msvc-static-lib.patch" patch_description: "support static build on msvc" @@ -71,6 +65,3 @@ patches: - patch_file: "patches/2.2.5-qualify-nondll.patch" patch_description: "use BGD_NONDLL instead NONDLL" patch_type: "conan" - - patch_file: "patches/2.2.5-use-cci.patch" - patch_description: "use cci's package" - patch_type: "conan" diff --git a/recipes/libgd/all/conanfile.py b/recipes/libgd/all/conanfile.py index 0c18187731da25..ffc0a4e68966c5 100644 --- a/recipes/libgd/all/conanfile.py +++ b/recipes/libgd/all/conanfile.py @@ -26,6 +26,8 @@ class LibgdConan(ConanFile): "with_freetype": [True, False], "with_xpm": [True, False], "with_webp": [True, False], + "with_heif": [True, False], + "with_avif": [True, False], } default_options = { "shared": False, @@ -36,6 +38,8 @@ class LibgdConan(ConanFile): "with_freetype": False, "with_xpm": False, "with_webp": False, + "with_heif": False, + "with_avif": False, } def export_sources(self): @@ -44,6 +48,9 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "2.3.2": + del self.options.with_heif + del self.options.with_avif def configure(self): if self.options.shared: @@ -70,6 +77,10 @@ def requirements(self): self.requires("libxpm/3.5.13") if self.options.with_webp: self.requires("libwebp/1.3.2") + if self.options.get_safe("with_heif"): + self.requires("libheif/1.16.2") + if self.options.get_safe("with_avif"): + self.requires("libavif/1.0.4") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -90,14 +101,18 @@ def generate(self): tc.variables["ENABLE_FONTCONFIG"] = False tc.variables["ENABLE_WEBP"] = self.options.with_webp if Version(self.version) >= "2.3.2": - tc.variables["ENABLE_HEIF"] = False - tc.variables["ENABLE_AVIF"] = False + tc.variables["ENABLE_HEIF"] = self.options.get_safe("with_heif", False) + tc.variables["ENABLE_AVIF"] = self.options.get_safe("with_avif", False) if Version(self.version) >= "2.3.0": tc.variables["ENABLE_RAQM"] = False tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) + deps.set_property("libheif", "cmake_file_name", "HEIF") + deps.set_property("webp", "cmake_file_name", "WEBP") + deps.set_property("libxpm", "cmake_file_name", "XPM") + deps.set_property("freetype", "cmake_file_name", "FREETYPE") deps.generate() def _patch(self): diff --git a/recipes/libgd/all/patches/2.2.5-use-cci.patch b/recipes/libgd/all/patches/2.2.5-use-cci.patch deleted file mode 100644 index 63805346e86b37..00000000000000 --- a/recipes/libgd/all/patches/2.2.5-use-cci.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8c99816..63775fd 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -97,7 +97,7 @@ else (USE_EXT_GD) - FIND_PACKAGE(ZLIB) - - IF (ENABLE_WEBP) -- FIND_PACKAGE(WEBP) -+ FIND_PACKAGE(WebP) - ENDIF (ENABLE_WEBP) - - IF (ENABLE_LIQ) -@@ -121,7 +121,7 @@ else (USE_EXT_GD) - endif (ENABLE_FREETYPE) - - if (ENABLE_XPM) -- FIND_PACKAGE(XPM) -+ FIND_PACKAGE(libxpm) - endif (ENABLE_XPM) - - if (ENABLE_FONTCONFIG) -@@ -140,7 +140,7 @@ else (USE_EXT_GD) - ENDIF(ZLIB_FOUND) - - IF(WEBP_FOUND) -- INCLUDE_DIRECTORIES(${WEBP_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${WebP_INCLUDE_DIR}) - SET(HAVE_LIBWEBP 1) - ENDIF(WEBP_FOUND) - -@@ -161,7 +161,7 @@ else (USE_EXT_GD) - ENDIF(LIQ_FOUND) - - IF(XPM_FOUND) -- INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${libxpm_INCLUDE_DIR}) - SET(HAVE_LIBXPM 1) - ENDIF(XPM_FOUND) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 5b764eb..11d3a46 100755 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -110,15 +110,15 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S - - SET(LIBGD_DEP_LIBS - ${ZLIB_LIBRARIES} -- ${FREETYPE_LIBRARIES} -+ ${freetype_LIBRARIES} - ${PNG_LIBRARIES} - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} - ${JPEG_LIBRARIES} - ${TIFF_LIBRARIES} -- ${XPM_LIBRARIES} -+ ${libxpm_LIBRARIES} - ${FONTCONFIG_LIBRARY} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ) - if (BUILD_SHARED_LIBS) - target_link_libraries(${GD_LIB} ${LIBGD_DEP_LIBS}) diff --git a/recipes/libgd/all/patches/2.3.0-use-cci.patch b/recipes/libgd/all/patches/2.3.0-use-cci.patch deleted file mode 100644 index 6083253b1e3db7..00000000000000 --- a/recipes/libgd/all/patches/2.3.0-use-cci.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fc76868..f503436 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -113,7 +113,7 @@ else (USE_EXT_GD) - FIND_PACKAGE(ZLIB) - - IF (ENABLE_WEBP) -- FIND_PACKAGE(WEBP) -+ FIND_PACKAGE(WebP) - ENDIF (ENABLE_WEBP) - - IF (ENABLE_LIQ) -@@ -137,7 +137,7 @@ else (USE_EXT_GD) - endif (ENABLE_FREETYPE) - - if (ENABLE_XPM) -- FIND_PACKAGE(XPM) -+ FIND_PACKAGE(libxpm) - endif (ENABLE_XPM) - - if (ENABLE_FONTCONFIG) -@@ -162,7 +162,7 @@ else (USE_EXT_GD) - ENDIF(ZLIB_FOUND) - - IF(WEBP_FOUND) -- INCLUDE_DIRECTORIES(${WEBP_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${WebP_INCLUDE_DIR}) - SET(HAVE_LIBWEBP 1) - ENDIF(WEBP_FOUND) - -@@ -183,7 +183,7 @@ else (USE_EXT_GD) - ENDIF(LIQ_FOUND) - - IF(XPM_FOUND) -- INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${libxpm_INCLUDE_DIR}) - SET(HAVE_LIBXPM 1) - ENDIF(XPM_FOUND) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 98b9e64..0d676ba 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -125,14 +125,14 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S - - SET(LIBGD_DEP_LIBS - ${ZLIB_LIBRARIES} -- ${FREETYPE_LIBRARIES} -+ ${freetype_LIBRARIES} - ${PNG_LIBRARIES} - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} - ${JPEG_LIBRARIES} - ${TIFF_LIBRARIES} -- ${XPM_LIBRARIES} -+ ${libxpm_LIBRARIES} - ${FONTCONFIG_LIBRARY} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ${RAQM_LIBRARIES} - ) - if (BUILD_SHARED_LIBS) diff --git a/recipes/libgd/all/patches/2.3.1-use-cci.patch b/recipes/libgd/all/patches/2.3.1-use-cci.patch deleted file mode 100644 index 540439b9bf43a9..00000000000000 --- a/recipes/libgd/all/patches/2.3.1-use-cci.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bf7836f..c4995b0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -116,7 +116,7 @@ else (USE_EXT_GD) - endif (ENABLE_ICONV) - - IF (ENABLE_WEBP) -- FIND_PACKAGE(WEBP REQUIRED) -+ FIND_PACKAGE(WebP REQUIRED) - ENDIF (ENABLE_WEBP) - - IF (ENABLE_LIQ) -@@ -140,7 +140,7 @@ else (USE_EXT_GD) - endif (ENABLE_FREETYPE) - - if (ENABLE_XPM) -- FIND_PACKAGE(XPM REQUIRED) -+ FIND_PACKAGE(libxpm REQUIRED) - endif (ENABLE_XPM) - - if (ENABLE_FONTCONFIG) -@@ -167,7 +167,7 @@ else (USE_EXT_GD) - ENDIF(ZLIB_FOUND) - - IF(WEBP_FOUND) -- INCLUDE_DIRECTORIES(${WEBP_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${WebP_INCLUDE_DIR}) - SET(HAVE_LIBWEBP 1) - ENDIF(WEBP_FOUND) - -@@ -189,7 +189,7 @@ else (USE_EXT_GD) - ENDIF(LIQ_FOUND) - - IF(XPM_FOUND) -- INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${libxpm_INCLUDE_DIR}) - SET(HAVE_LIBXPM 1) - LIST(APPEND PKG_REQUIRES_PRIVATES xpm) - ENDIF(XPM_FOUND) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index e1f8eda..47b1ee8 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -125,15 +125,15 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S - - SET(LIBGD_DEP_LIBS - ${ZLIB_LIBRARIES} -- ${FREETYPE_LIBRARIES} -+ ${freetype_LIBRARIES} - ${PNG_LIBRARIES} - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} - ${JPEG_LIBRARIES} - ${TIFF_LIBRARIES} -- ${XPM_LIBRARIES} -+ ${libxpm_LIBRARIES} - ${FONTCONFIG_LIBRARY} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ${RAQM_LIBRARIES} - ) - if (BUILD_SHARED_LIBS) -@@ -146,7 +146,7 @@ endif() - SET(LIBS_PRIVATES - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ) - - set(GD_PROGRAMS gdcmpgif) diff --git a/recipes/libgd/all/patches/2.3.2-use-cci.patch b/recipes/libgd/all/patches/2.3.2-use-cci.patch index 758709ea2bdc7e..57724df5d1cec3 100644 --- a/recipes/libgd/all/patches/2.3.2-use-cci.patch +++ b/recipes/libgd/all/patches/2.3.2-use-cci.patch @@ -1,69 +1,27 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 57cd95d..11a8409 100644 +index 57cd95d..f7640c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -118,7 +118,7 @@ else (USE_EXT_GD) - endif (ENABLE_ICONV) - - IF (ENABLE_WEBP) -- FIND_PACKAGE(WEBP REQUIRED) -+ FIND_PACKAGE(WebP REQUIRED) - ENDIF (ENABLE_WEBP) - - IF (ENABLE_HEIF) -@@ -153,7 +153,7 @@ else (USE_EXT_GD) - endif (ENABLE_FREETYPE) - - if (ENABLE_XPM) -- FIND_PACKAGE(XPM REQUIRED) -+ FIND_PACKAGE(libxpm REQUIRED) - endif (ENABLE_XPM) - - if (ENABLE_FONTCONFIG) -@@ -180,7 +180,7 @@ else (USE_EXT_GD) - ENDIF(ZLIB_FOUND) - - IF(WEBP_FOUND) -- INCLUDE_DIRECTORIES(${WEBP_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${WebP_INCLUDE_DIR}) - SET(HAVE_LIBWEBP 1) - ENDIF(WEBP_FOUND) - -@@ -207,7 +207,7 @@ else (USE_EXT_GD) - ENDIF(LIQ_FOUND) - - IF(XPM_FOUND) -- INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${libxpm_INCLUDE_DIR}) - SET(HAVE_LIBXPM 1) +@@ -126,7 +126,7 @@ else (USE_EXT_GD) + ENDIF (ENABLE_HEIF) + + IF (ENABLE_AVIF) +- FIND_PACKAGE(libavif 0.8.2 REQUIRED CONFIG) ++ FIND_PACKAGE(libavif REQUIRED CONFIG) + SET(HAVE_LIBAVIF 1) + SET(AVIF_LIBRARIES avif) + SET(AVIF_FOUND 1) +@@ -212,11 +212,11 @@ else (USE_EXT_GD) LIST(APPEND PKG_REQUIRES_PRIVATES xpm) ENDIF(XPM_FOUND) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 1d1be42..2843193 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -122,13 +122,13 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S - SET(LIBGD_DEP_LIBS - ${ZLIB_LIBRARIES} -- ${FREETYPE_LIBRARIES} -+ ${freetype_LIBRARIES} - ${PNG_LIBRARIES} - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} - ${JPEG_LIBRARIES} - ${TIFF_LIBRARIES} -- ${XPM_LIBRARIES} -+ ${libxpm_LIBRARIES} - ${FONTCONFIG_LIBRARY} - ${WEBP_LIBRARIES} - ${AVIF_LIBRARIES} -@@ -145,7 +145,7 @@ endif() - SET(LIBS_PRIVATES - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ) +- IF(JPEG_FOUND) ++ IF(ENABLE_JPEG AND JPEG_FOUND) + INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR}) + SET(HAVE_LIBJPEG 1) + LIST(APPEND PKG_REQUIRES_PRIVATES libjpeg) +- ENDIF(JPEG_FOUND) ++ ENDIF() - set(GD_PROGRAMS gdcmpgif) + IF(TIFF_FOUND) + INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR}) diff --git a/recipes/libgd/all/patches/2.3.3-use-cci.patch b/recipes/libgd/all/patches/2.3.3-use-cci.patch index fb8b6373806210..561c4e9f127a00 100644 --- a/recipes/libgd/all/patches/2.3.3-use-cci.patch +++ b/recipes/libgd/all/patches/2.3.3-use-cci.patch @@ -1,72 +1,27 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6b3e5b3..2536fc6 100644 +index 6b3e5b3..2b71c74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -134,7 +134,7 @@ else (USE_EXT_GD) - endif (ENABLE_ICONV) - - IF (ENABLE_WEBP) -- FIND_PACKAGE(WEBP REQUIRED) -+ FIND_PACKAGE(WebP REQUIRED) - ENDIF (ENABLE_WEBP) - - IF (ENABLE_HEIF) -@@ -169,7 +169,7 @@ else (USE_EXT_GD) - endif (ENABLE_FREETYPE) - - if (ENABLE_XPM) -- FIND_PACKAGE(XPM REQUIRED) -+ FIND_PACKAGE(libxpm REQUIRED) - endif (ENABLE_XPM) - - if (ENABLE_FONTCONFIG) -@@ -196,7 +196,7 @@ else (USE_EXT_GD) - ENDIF(ZLIB_FOUND) - - IF(WEBP_FOUND) -- INCLUDE_DIRECTORIES(${WEBP_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${WebP_INCLUDE_DIR}) - SET(HAVE_LIBWEBP 1) - ENDIF(WEBP_FOUND) - -@@ -223,7 +223,7 @@ else (USE_EXT_GD) - ENDIF(LIQ_FOUND) - - IF(XPM_FOUND) -- INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${libxpm_INCLUDE_DIR}) - SET(HAVE_LIBXPM 1) +@@ -142,7 +142,7 @@ else (USE_EXT_GD) + ENDIF (ENABLE_HEIF) + + IF (ENABLE_AVIF) +- FIND_PACKAGE(libavif 0.8.2 REQUIRED CONFIG) ++ FIND_PACKAGE(libavif REQUIRED CONFIG) + SET(HAVE_LIBAVIF 1) + SET(AVIF_LIBRARIES avif) + SET(AVIF_FOUND 1) +@@ -228,11 +228,11 @@ else (USE_EXT_GD) LIST(APPEND PKG_REQUIRES_PRIVATES xpm) ENDIF(XPM_FOUND) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 3b271a8..55a8095 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -102,15 +102,15 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S - SET(LIBGD_DEP_LIBS - ${ZLIB_LIBRARIES} -- ${FREETYPE_LIBRARIES} -+ ${freetype_LIBRARIES} - ${PNG_LIBRARIES} - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} - ${JPEG_LIBRARIES} - ${TIFF_LIBRARIES} -- ${XPM_LIBRARIES} -+ ${libxpm_LIBRARIES} - ${FONTCONFIG_LIBRARY} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ${AVIF_LIBRARIES} - ${RAQM_LIBRARIES} - ${HEIF_LIBRARIES} -@@ -125,7 +125,7 @@ endif() - SET(LIBS_PRIVATES - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ) +- IF(JPEG_FOUND) ++ IF(ENABLE_JPEG AND JPEG_FOUND) + INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR}) + SET(HAVE_LIBJPEG 1) + LIST(APPEND PKG_REQUIRES_PRIVATES libjpeg) +- ENDIF(JPEG_FOUND) ++ ENDIF() - set(GD_PROGRAMS gdcmpgif) + IF(TIFF_FOUND) + INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR}) diff --git a/recipes/libglvnd/all/conanfile.py b/recipes/libglvnd/all/conanfile.py index 2362f8db4e5aaf..422acffdcd2c70 100644 --- a/recipes/libglvnd/all/conanfile.py +++ b/recipes/libglvnd/all/conanfile.py @@ -8,7 +8,7 @@ import os import textwrap -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class LibGlvndConan(ConanFile): name = "libglvnd" @@ -59,7 +59,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.name} is only compatible with Linux and FreeBSD") def build_requirements(self): - self.tool_requires("meson/1.3.2") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.1.0") @@ -87,6 +87,10 @@ def generate(self): tc.project_options["headers"] = self.options.headers tc.project_options["entrypoint-patching"] = "enabled" if self.options.entrypoint_patching else "disabled" tc.project_options["libdir"] = "lib" + # Configure the data directory so that it defaults to the correct location for ICD discovery on the local system. + tc.project_options["datadir"] = os.path.join("usr", "share") if self.settings.os == "Linux" else os.path.join("usr", "local", "share") + if self.settings.os == "FreeBSD": + tc.project_options["sysconfdir"] = os.path.join("usr", "local", "etc") tc.generate() def build(self): diff --git a/recipes/libidn/all/conandata.yml b/recipes/libidn/all/conandata.yml index 8be8baf6f09f34..fcb454914799ba 100644 --- a/recipes/libidn/all/conandata.yml +++ b/recipes/libidn/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "1.36": - patch_file: "patches/0001-unconditional-system-stdint-h.patch" - base_path: "source_subfolder" diff --git a/recipes/libidn/all/conanfile.py b/recipes/libidn/all/conanfile.py index 49221670d5e8e9..2512e8efab52b3 100644 --- a/recipes/libidn/all/conanfile.py +++ b/recipes/libidn/all/conanfile.py @@ -1,13 +1,14 @@ -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, rmdir -from conan.tools.scm import Version -from conans import AutoToolsBuildEnvironment, tools -import contextlib -import functools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv, Environment +from conan.tools.files import get, rmdir, export_conandata_patches, apply_conandata_patches, copy, replace_in_file, rm, save +from conan.tools.gnu import AutotoolsToolchain, Autotools, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path, is_msvc + +required_conan_version = ">=1.53.0" class LibIdnConan(ConanFile): @@ -17,6 +18,8 @@ class LibIdnConan(ConanFile): topics = ("libidn", "encode", "decode", "internationalized", "domain", "name") license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,17 +32,12 @@ class LibIdnConan(ConanFile): "threads": True, } - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) def export_sources(self): - 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": @@ -47,91 +45,120 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + 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("libiconv/1.17") - def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Shared libraries are not supported on Windows due to libtool limitation") - def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - if self.settings.compiler == "Visual Studio": - self.build_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") + if is_msvc(self): + self.tool_requires("automake/1.16.5") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env = { - "CC": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "CXX": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "LD": "{} link -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), - } - with tools.environment_append(env): - yield - else: - yield + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.libs = [] + tc = AutotoolsToolchain(self) if not self.options.shared: - autotools.defines.append("LIBIDN_STATIC") - if self.settings.compiler == "Visual Studio": - if Version(self.settings.compiler.version) >= "12": - autotools.flags.append("-FS") - autotools.link_flags.extend("-L{}".format(p.replace("\\", "/")) for p in self.deps_cpp_info.lib_paths) + tc.extra_defines.append("LIBIDN_STATIC") yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), + tc.configure_args += [ "--enable-threads={}".format(yes_no(self.options.threads)), - "--with-libiconv-prefix={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath)), + "--with-libiconv-prefix={}".format(unix_path(self, self.dependencies["libiconv"].package_folder)), + "--disable-csharp", "--disable-nls", "--disable-rpath", ] - autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return autotools - - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if self.settings.compiler == "Visual Studio": + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.generate() + + if is_msvc(self): + env = Environment() + dep_info = self.dependencies["libiconv"].cpp_info.aggregated_components() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in dep_info.includedirs] + [f"-D{d}" for d in dep_info.defines]) + env.append("_LINK_", [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in (dep_info.libs + dep_info.system_libs)]) + env.append("LDFLAGS", [f"-L{unix_path(self, p)}" for p in dep_info.libdirs] + dep_info.sharedlinkflags + dep_info.exelinkflags) + env.append("CFLAGS", dep_info.cflags) + env.vars(self).save_script("conanautotoolsdeps_cl_workaround") + else: + deps = AutotoolsDeps(self) + deps.generate() + + if is_msvc(self): + env = Environment() + 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)) + # Workaround for iconv.lib not being found due to linker flag order + libiconv_libdir = unix_path(self, self.dependencies["libiconv"].cpp_info.aggregated_components().libdir) + env.define("CC", f"{compile_wrapper} cl -nologo -L{libiconv_libdir}") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f'{ar_wrapper} lib') + env.vars(self).save_script("conanbuild_msvc") + + def _patch_sources(self): + apply_conandata_patches(self) + # Disable examples and tests + for subdir in ["examples", "tests", "fuzz", "gltests", os.path.join("lib", "gltests"), "doc"]: + save(self, os.path.join(self.source_folder, subdir, "Makefile.in"), "all:\ninstall:\n") + + if is_msvc(self): if self.settings.arch in ("x86_64", "armv8", "armv8.3"): ssize = "signed long long int" else: ssize = "signed long int" - tools.replace_in_file(os.path.join(self._source_subfolder, "lib", "stringprep.h"), - "ssize_t", ssize) - with self._build_context(): - autotools = self._configure_autotools() - autotools.make(args=["V=1"]) + replace_in_file(self, os.path.join(self.source_folder, "lib", "stringprep.h"), "ssize_t", ssize) - def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() + if self.settings.os == "Windows": + # Otherwise tries to create a symlink from GNUmakefile to itself, which fails on Windows + replace_in_file(self, os.path.join(self.source_folder, "configure"), + '"$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;;', "") + replace_in_file(self, os.path.join(self.source_folder, "configure"), + 'ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"', "") + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + + if is_msvc(self) and self.options.shared: + os.rename(os.path.join(self.package_folder, "lib", "idn.dll.lib"), + os.path.join(self.package_folder, "lib", "idn-12.lib")) def package_info(self): - self.cpp_info.libs = ["idn"] - self.cpp_info.names["pkg_config"] = "libidn" + if is_msvc(self) and self.options.shared: + self.cpp_info.libs = ["idn-12"] + else: + self.cpp_info.libs = ["idn"] + self.cpp_info.set_property("pkg_config_name", "libidn") if self.settings.os in ["Linux", "FreeBSD"]: if self.options.threads: self.cpp_info.system_libs = ["pthread"] @@ -139,7 +166,6 @@ def package_info(self): if not self.options.shared: self.cpp_info.defines = ["LIBIDN_STATIC"] + # TODO: to remove in conan v2 bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) self.env_info.PATH.append(bin_path) - diff --git a/recipes/libidn/all/test_package/CMakeLists.txt b/recipes/libidn/all/test_package/CMakeLists.txt index 7b9b613cbb24a3..3482998466c6b6 100644 --- a/recipes/libidn/all/test_package/CMakeLists.txt +++ b/recipes/libidn/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libidn REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libidn::libidn) diff --git a/recipes/libidn/all/test_package/conanfile.py b/recipes/libidn/all/test_package/conanfile.py index 07c965844de9b8..441cef7471a37e 100644 --- a/recipes/libidn/all/test_package/conanfile.py +++ b/recipes/libidn/all/test_package/conanfile.py @@ -1,10 +1,20 @@ -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_layout, CMake + 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, run=True) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,8 +22,8 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run("idn --help", run_environment=True) + if can_run(self): + self.run("idn --help", env="conanrun") - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libidn/all/test_v1_package/CMakeLists.txt b/recipes/libidn/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libidn/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/recipes/libidn/all/test_v1_package/conanfile.py b/recipes/libidn/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..3eaa9f01025382 --- /dev/null +++ b/recipes/libidn/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +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): + self.run("idn --help", run_environment=True) + + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libidn2/all/conandata.yml b/recipes/libidn2/all/conandata.yml index b710e69645f11f..d33653d85c4f69 100644 --- a/recipes/libidn2/all/conandata.yml +++ b/recipes/libidn2/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "2.3.0": - patch_file: "patches/0001-no-versioning-of-symbols.patch" - base_path: "source_subfolder" diff --git a/recipes/libidn2/all/conanfile.py b/recipes/libidn2/all/conanfile.py index 0a83958ffe3fd4..18257e8db29d21 100644 --- a/recipes/libidn2/all/conanfile.py +++ b/recipes/libidn2/all/conanfile.py @@ -1,18 +1,30 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from contextlib import contextmanager import os -required_conan_version = ">=1.33.0" +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 Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path + +required_conan_version = ">=1.53.0" class LibIdn(ConanFile): name = "libidn2" - description = "GNU Libidn is a fully documented implementation of the Stringprep, Punycode and IDNA 2003 specifications." - homepage = "https://www.gnu.org/software/libidn/" - topics = ("libidn", "encode", "decode", "internationalized", "domain", "name") + description = ( + "GNU Libidn is a fully documented implementation of the Stringprep, Punycode and IDNA 2003" + " specifications." + ) license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/libidn/" + topics = ("libidn", "encode", "decode", "internationalized", "domain", "name") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -21,17 +33,13 @@ class LibIdn(ConanFile): "shared": False, "fPIC": True, } - settings = "os", "arch", "compiler", "build_type" - - _autotools = None @property - def _source_subfolder(self): - return "source_subfolder" + def _settings_build(self): + return getattr(self, "settings_build", self.settings) def export_sources(self): - 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": @@ -39,93 +47,104 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") - def requirements(self): - self.requires("libiconv/1.16") - - def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Shared libraries are not supported on Windows due to libtool limitation") + def layout(self): + basic_layout(self, src_folder="src") - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + def requirements(self): + self.requires("libiconv/1.17") def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - if self.settings.compiler == "Visual Studio": - self.build_requires("automake/1.16.4") + 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): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - env = { - "CC": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "CXX": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "LD": "{} link -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), - } - with tools.environment_append(env): - yield - else: - yield + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.libs = [] + tc = AutotoolsToolchain(self) if not self.options.shared: - self._autotools.defines.append("IDN2_STATIC") - if self.settings.compiler == "Visual Studio": - if tools.Version(self.settings.compiler.version) >= "12": - self._autotools.flags.append("-FS") - self._autotools.link_flags.extend("-L{}".format(p.replace("\\", "/")) for p in self.deps_cpp_info.lib_paths) - yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - "--with-libiconv-prefix={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath)), + tc.extra_defines.append("IDN2_STATIC") + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.configure_args += [ + f"--with-libiconv-prefix={unix_path(self, self.dependencies['libiconv'].package_folder)}", "--disable-nls", "--disable-rpath", ] - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools + tc.generate() + + if is_msvc(self): + env = Environment() + dep_info = self.dependencies["libiconv"].cpp_info.aggregated_components() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in dep_info.includedirs] + [f"-D{d}" for d in dep_info.defines]) + env.append("_LINK_", [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in (dep_info.libs + dep_info.system_libs)]) + env.append("LDFLAGS", [f"-L{unix_path(self, p)}" for p in dep_info.libdirs] + dep_info.sharedlinkflags + dep_info.exelinkflags) + env.append("CFLAGS", dep_info.cflags) + env.vars(self).save_script("conanautotoolsdeps_cl_workaround") + else: + deps = AutotoolsDeps(self) + deps.generate() + + if is_msvc(self): + env = Environment() + 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)) + dumpbin_nm = unix_path(self, os.path.join(self.source_folder, "dumpbin_nm.py")) + 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.vars(self).save_script("conanbuild_msvc") def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() os.unlink(os.path.join(self.package_folder, "lib", "libidn2.la")) + 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) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + if is_msvc(self) and self.options.shared: + os.rename(os.path.join(self.package_folder, "lib", "idn2.dll.lib"), + os.path.join(self.package_folder, "lib", "idn2-0.lib")) + copy(self, "idn2.exe", + os.path.join(self.build_folder, "src", ".libs"), + os.path.join(self.package_folder, "bin")) def package_info(self): - self.cpp_info.libs = ["idn2"] - self.cpp_info.names["pkg_config"] = "libidn2" + if is_msvc(self) and self.options.shared: + self.cpp_info.libs = ["idn2-0"] + else: + self.cpp_info.libs = ["idn2"] + self.cpp_info.set_property("pkg_config_name", "libidn2") if self.settings.os == "Windows": if not self.options.shared: self.cpp_info.defines = ["IDN2_STATIC"] bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) self.env_info.PATH.append(bin_path) diff --git a/recipes/libidn2/all/test_package/CMakeLists.txt b/recipes/libidn2/all/test_package/CMakeLists.txt index 7b9b613cbb24a3..2279e3cb07d2a0 100644 --- a/recipes/libidn2/all/test_package/CMakeLists.txt +++ b/recipes/libidn2/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libidn2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libidn2::libidn2) diff --git a/recipes/libidn2/all/test_package/conanfile.py b/recipes/libidn2/all/test_package/conanfile.py index ae0c2ab3c933c0..f56ad0548e3d9f 100644 --- a/recipes/libidn2/all/test_package/conanfile.py +++ b/recipes/libidn2/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", "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, run=True) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,9 +21,8 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run("idn2 --help", run_environment=True) - - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + self.run("idn2 --help", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libidn2/all/test_v1_package/CMakeLists.txt b/recipes/libidn2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libidn2/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/recipes/libidn2/all/test_v1_package/conanfile.py b/recipes/libidn2/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a5e01055d39334 --- /dev/null +++ b/recipes/libidn2/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +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.settings): + self.run("idn2 --help", run_environment=True) + + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + diff --git a/recipes/libinput/all/conandata.yml b/recipes/libinput/all/conandata.yml new file mode 100644 index 00000000000000..541bad5e261c85 --- /dev/null +++ b/recipes/libinput/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.25.0": + url: "https://gitlab.freedesktop.org/libinput/libinput/-/archive/1.25.0/libinput-1.25.0.tar.bz2" + sha256: "193bd592298bd9e369c0ef3e5d83a6a9d68ddc4cd3dfc84bbe77920a8d0d57df" diff --git a/recipes/libinput/all/conanfile.py b/recipes/libinput/all/conanfile.py new file mode 100644 index 00000000000000..93eb56ba01fa46 --- /dev/null +++ b/recipes/libinput/all/conanfile.py @@ -0,0 +1,152 @@ +import os +import textwrap + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rmdir, save +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain + + +required_conan_version = ">=1.53.0" + + +class LibinputConan(ConanFile): + name = "libinput" + description = "libinput is a library that handles input devices for display servers and other applications that need to directly deal with input devices." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.freedesktop.org/wiki/Software/libinput/" + topics = ("device", "display", "event", "input") + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "epoll_dir": [None, "ANY"], + "debug_gui": [True, False], + "with_libudev": ["eudev", "systemd"], + "with_libwacom": [True, False], + "with_wayland": [True, False], + "with_x11": [True, False], + } + default_options = { + "epoll_dir": None, + "debug_gui": False, + "with_libudev": "systemd", + # todo Package libwacom and enable this option by default. + "with_libwacom": False, + "with_wayland": True, + "with_x11": True, + } + + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + if not self.options.debug_gui: + self.options.rm_safe("with_wayland") + self.options.rm_safe("with_x11") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("mtdev/1.1.6") + self.requires("libevdev/1.13.1") + + if self.options.debug_gui: + self.requires("cairo/1.18.0") + self.requires("glib/2.78.3") + self.requires("gtk/system") + if self.options.with_wayland: + self.requires("wayland/1.22.0") + if self.options.with_x11: + self.requires("xorg/system") + + if self.options.with_libudev == "systemd": + self.requires("libudev/system", transitive_libs=True) + elif self.options.with_libudev == "eudev": + self.requires("eudev/3.2.14", transitive_libs=True) + + def validate(self): + if self.settings.os not in ["FreeBSD", "Linux"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + if self.options.with_libwacom: + raise ConanInvalidConfiguration(f"The with_libwacom option for {self.ref} is not yet supported. Contributions welcome.") + + def build_requirements(self): + self.tool_requires("meson/1.3.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + if self.options.get_safe("with_wayland"): + if self._has_build_profile: + self.tool_requires("wayland/") + self.tool_requires("wayland-protocols/1.33") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = MesonToolchain(self) + tc.project_options["build.pkg_config_path"] = self.generators_folder + tc.project_options["coverity"] = False + tc.project_options["datadir"] = "res" + tc.project_options["documentation"] = False + tc.project_options["epoll-dir"] = '' if self.options.epoll_dir is None else str(self.options.epoll_dir) + tc.project_options["debug-gui"] = self.options.debug_gui + tc.project_options["install-tests"] = False + # Change libexecdir so that the libinput subdirectory in the bin directory doesn't conflict with the libinput executable. + tc.project_options["libexecdir"] = "libexec" + tc.project_options["libwacom"] = self.options.with_libwacom + tc.project_options["tests"] = False + tc.generate() + pkg_config_deps = PkgConfigDeps(self) + if self.options.get_safe("with_wayland"): + if self._has_build_profile: + pkg_config_deps.build_context_activated = ["wayland-protocols"] + else: + # Manually generate pkgconfig file of wayland-protocols since + # PkgConfigDeps.build_context_activated can't work with legacy 1 profile + # We must use legacy conan v1 deps_cpp_info because self.dependencies doesn't + # contain build requirements when using 1 profile. + wp_prefix = self.deps_cpp_info["wayland-protocols"].rootpath + wp_version = self.deps_cpp_info["wayland-protocols"].version + wp_pkg_content = textwrap.dedent(f"""\ + prefix={wp_prefix} + datarootdir=${{prefix}}/res + pkgdatadir=${{datarootdir}}/wayland-protocols + Name: Wayland Protocols + Description: Wayland protocol files + Version: {wp_version} + """) + save(self, os.path.join(self.generators_folder, "wayland-protocols.pc"), wp_pkg_content) + pkg_config_deps.generate() + tc = VirtualBuildEnv(self) + tc.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + + copy(self, f"{self.name}-*", os.path.join(self.package_folder, "libexec", self.name), os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "libexec")) + + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "res", "zsh")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["input"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "rt"]) diff --git a/recipes/libinput/all/test_package/conanfile.py b/recipes/libinput/all/test_package/conanfile.py new file mode 100644 index 00000000000000..cdcf9b281723d9 --- /dev/null +++ b/recipes/libinput/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "PkgConfigDeps", "MesonToolchain", "VirtualRunEnv", "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires("meson/1.3.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + def build(self): + meson = Meson(self) + meson.configure() + meson.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/recipes/libinput/all/test_package/meson.build b/recipes/libinput/all/test_package/meson.build new file mode 100644 index 00000000000000..2dea5d2c4a326d --- /dev/null +++ b/recipes/libinput/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('libinput') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/libinput/all/test_package/test_package.c b/recipes/libinput/all/test_package/test_package.c new file mode 100644 index 00000000000000..6a8e1e6d99fe9d --- /dev/null +++ b/recipes/libinput/all/test_package/test_package.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include +#include + +#include +#include + +static int +open_restricted(const char *path, int flags, void *user_data) +{ + int fd = open(path, flags); + return fd < 0 ? -1 : fd; +} + +static void +close_restricted(int fd, void *user_data) +{ + close(fd); +} + +static const struct libinput_interface interface = { + .open_restricted = open_restricted, + .close_restricted = close_restricted, +}; + +int main(void) { + bool grab = false; + struct libinput *li; + struct udev *udev = udev_new(); + if (!udev) { + fprintf(stderr, "Failed to initialize udev\n"); + return EXIT_FAILURE; + } + + li = libinput_udev_create_context(&interface, &grab, udev); + if (!li) { + fprintf(stderr, "Failed to initialize libinput context from udev\n"); + udev_unref(udev); + return EXIT_FAILURE; + } + + if (libinput_udev_assign_seat(li, "seat0")) { + fprintf(stderr, "Failed to set seat\n"); + libinput_unref(li); + li = NULL; + udev_unref(udev); + return EXIT_FAILURE; + } + + udev_unref(udev); + return EXIT_SUCCESS; +} diff --git a/recipes/libinput/config.yml b/recipes/libinput/config.yml new file mode 100644 index 00000000000000..3f07e920910b2a --- /dev/null +++ b/recipes/libinput/config.yml @@ -0,0 +1,3 @@ +versions: + "1.25.0": + folder: all diff --git a/recipes/libliftoff/all/conanfile.py b/recipes/libliftoff/all/conanfile.py index 28626c0146534f..372fffe6e790f3 100644 --- a/recipes/libliftoff/all/conanfile.py +++ b/recipes/libliftoff/all/conanfile.py @@ -39,16 +39,16 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libdrm/2.4.114") + self.requires("libdrm/2.4.119") def validate(self): if self.settings.os not in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration(f"{self.name} only supports FreeBSD and Linux") def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.3.2") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libliftoff/all/test_package/conanfile.py b/recipes/libliftoff/all/test_package/conanfile.py index 5aab0703e7a4ef..cdcf9b281723d9 100644 --- a/recipes/libliftoff/all/test_package/conanfile.py +++ b/recipes/libliftoff/all/test_package/conanfile.py @@ -17,9 +17,9 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.3.2") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def build(self): meson = Meson(self) diff --git a/recipes/liblzf/all/CMakeLists.txt b/recipes/liblzf/all/CMakeLists.txt index a501b15938468d..c20ae859c17707 100644 --- a/recipes/liblzf/all/CMakeLists.txt +++ b/recipes/liblzf/all/CMakeLists.txt @@ -2,8 +2,9 @@ cmake_minimum_required(VERSION 3.15) project(liblzf LANGUAGES C) add_library(liblzf - src/lzf_c.c - src/lzf_d.c + lzf_c.c + lzf_d.c + liblzf.def ) set_target_properties(liblzf PROPERTIES OUTPUT_NAME lzf) @@ -20,14 +21,10 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") target_compile_options(liblzf PRIVATE "-funroll-all-loops") endif() -set_target_properties(liblzf PROPERTIES - WINDOWS_EXPORT_ALL_SYMBOLS ON - PUBLIC_HEADER src/lzf.h -) - +include(GNUInstallDirs) install(TARGETS liblzf RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) +install(FILES lzf.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/liblzf/all/conanfile.py b/recipes/liblzf/all/conanfile.py index 70d2ac9f7171b2..0796e45c4ac601 100644 --- a/recipes/liblzf/all/conanfile.py +++ b/recipes/liblzf/all/conanfile.py @@ -29,7 +29,8 @@ class LiblzfConan(ConanFile): } def export_sources(self): - copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + copy(self, "liblzf.def", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) export_conandata_patches(self) def config_options(self): @@ -55,11 +56,11 @@ def generate(self): def build(self): apply_conandata_patches(self) cmake = CMake(self) - cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + 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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() diff --git a/recipes/liblzf/all/liblzf.def b/recipes/liblzf/all/liblzf.def new file mode 100644 index 00000000000000..2d8efa48df7f72 --- /dev/null +++ b/recipes/liblzf/all/liblzf.def @@ -0,0 +1,3 @@ +EXPORTS + lzf_compress + lzf_decompress diff --git a/recipes/libmetalink/all/conanfile.py b/recipes/libmetalink/all/conanfile.py index 10c23cc875879e..57b9b280bec17a 100644 --- a/recipes/libmetalink/all/conanfile.py +++ b/recipes/libmetalink/all/conanfile.py @@ -53,9 +53,9 @@ def layout(self): def requirements(self): if self.options.xml_backend == "expat": - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") elif self.options.xml_backend == "libxml2": - self.requires("libxml2/2.12.3") + self.requires("libxml2/[>=2.12.5 <3]") def validate(self): if is_msvc(self): diff --git a/recipes/libnghttp2/all/conandata.yml b/recipes/libnghttp2/all/conandata.yml index 66dd4333f96a2e..c95a58d3fe33df 100644 --- a/recipes/libnghttp2/all/conandata.yml +++ b/recipes/libnghttp2/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.61.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.61.0/nghttp2-1.61.0.tar.bz2" + sha256: "4e8cf7ec32d4c5a430966242d72035d255cd9470a8766d61eed7a0190dd544fd" + "1.60.0": + url: "https://github.com/nghttp2/nghttp2/archive/v1.60.0.tar.gz" + sha256: "3cc9403c64e0a133868f62132ff0884cd5dc567eee5bd7b2d03ac81293695d6b" "1.59.0": url: "https://github.com/nghttp2/nghttp2/archive/v1.59.0.tar.gz" sha256: "0dd5c980f1262ff5f03676fd99f46f250b66c842f7d864fa1ca9f8453e5f8868" diff --git a/recipes/libnghttp2/all/conanfile.py b/recipes/libnghttp2/all/conanfile.py index 7e54ec938b2f37..8fa456dd4d7832 100644 --- a/recipes/libnghttp2/all/conanfile.py +++ b/recipes/libnghttp2/all/conanfile.py @@ -83,8 +83,11 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["ENABLE_SHARED_LIB"] = self.options.shared - tc.variables["ENABLE_STATIC_LIB"] = not self.options.shared + if Version(self.version) < "1.60.0": + tc.variables["ENABLE_SHARED_LIB"] = self.options.shared + tc.variables["ENABLE_STATIC_LIB"] = not self.options.shared + else: + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared tc.variables["ENABLE_HPACK_TOOLS"] = self.options.with_hpack tc.variables["ENABLE_APP"] = self.options.with_app tc.variables["ENABLE_EXAMPLES"] = False @@ -96,6 +99,9 @@ def generate(self): tc.variables["WITH_JEMALLOC"] = self.options.get_safe("with_jemalloc", False) if Version(self.version) < "1.52.0": tc.variables["ENABLE_ASIO_LIB"] = self.options.with_asio + # To avoid overwriting dll import lib by static lib + if Version(self.version) >= "1.60.0" and self.options.shared: + tc.variables["STATIC_LIB_SUFFIX"] = "-static" if is_apple_os(self): # workaround for: install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False @@ -107,7 +113,7 @@ def generate(self): tc.generate() def _patch_sources(self): - if not self.options.shared: + if not self.options.shared and Version(self.version) < "1.60.0": # easier to patch here rather than have patch 'nghttp_static_include_directories' for each version save(self, os.path.join(self.source_folder, "lib", "CMakeLists.txt"), "target_include_directories(nghttp2_static INTERFACE\n" @@ -135,6 +141,8 @@ def _patch_sources(self): "\n" " target_link_libraries(nghttp2_asio\n" f" {target_libnghttp2}\n") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(examples)", "") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(tests)", "") def build(self): self._patch_sources() @@ -148,6 +156,7 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.components["nghttp2"].set_property("pkg_config_name", "libnghttp2") diff --git a/recipes/libnghttp2/config.yml b/recipes/libnghttp2/config.yml index 3479f13f33830c..99922e9441daf2 100644 --- a/recipes/libnghttp2/config.yml +++ b/recipes/libnghttp2/config.yml @@ -1,4 +1,8 @@ versions: + "1.61.0": + folder: all + "1.60.0": + folder: all "1.59.0": folder: all "1.58.0": diff --git a/recipes/libpq/all/conandata.yml b/recipes/libpq/all/conandata.yml index 58acf20d0817e4..bad003ca4bd768 100644 --- a/recipes/libpq/all/conandata.yml +++ b/recipes/libpq/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "15.5": + url: "https://ftp.postgresql.org/pub/source/v15.5/postgresql-15.5.tar.bz2" + sha256: "8f53aa95d78eb8e82536ea46b68187793b42bba3b4f65aa342f540b23c9b10a6" "15.4": url: "https://ftp.postgresql.org/pub/source/v15.4/postgresql-15.4.tar.bz2" sha256: "baec5a4bdc4437336653b6cb5d9ed89be5bd5c0c58b94e0becee0a999e63c8f9" @@ -24,6 +27,10 @@ sources: url: "https://ftp.postgresql.org/pub/source/v9.6.24/postgresql-9.6.24.tar.gz" sha256: "52947ecc119846eace5164399d173576c0d4a47ec116ae58a46a8fd0c576c7c3" patches: + "15.5": + - patch_file: "patches/15/001-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" "15.4": - patch_file: "patches/15/001-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." diff --git a/recipes/libpq/config.yml b/recipes/libpq/config.yml index e010db029229d5..d16e671201aae2 100644 --- a/recipes/libpq/config.yml +++ b/recipes/libpq/config.yml @@ -1,4 +1,6 @@ versions: + "15.5": + folder: all "15.4": folder: all "15.3": diff --git a/recipes/libressl/all/conandata.yml b/recipes/libressl/all/conandata.yml index 8d70158fca32f5..c4fc1016c6f77a 100644 --- a/recipes/libressl/all/conandata.yml +++ b/recipes/libressl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.9.1": + url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.9.1.tar.gz" + sha256: "6da0b954695f7ee62b03f64200a8a4f02af93717b60cce04ab6c8df262c07a51" "3.5.3": url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.3.tar.gz" sha256: "3ab5e5eaef69ce20c6b170ee64d785b42235f48f2e62b095fca5d7b6672b8b28" diff --git a/recipes/libressl/all/conanfile.py b/recipes/libressl/all/conanfile.py index 83b9b2abeb1314..01fe7dba222cd5 100644 --- a/recipes/libressl/all/conanfile.py +++ b/recipes/libressl/all/conanfile.py @@ -88,6 +88,7 @@ def package(self): cmake.install() rm(self, "*.cmake", os.path.join(self.package_folder, "include")) rmdir(self, os.path.join(self.package_folder, "include", "CMakeFiles")) + 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")) diff --git a/recipes/libressl/config.yml b/recipes/libressl/config.yml index bfca6d19b58d7c..10de737dfb8f54 100644 --- a/recipes/libressl/config.yml +++ b/recipes/libressl/config.yml @@ -1,4 +1,6 @@ versions: + "3.9.1": + folder: all "3.5.3": folder: all "3.5.2": diff --git a/recipes/libsrtp/all/conandata.yml b/recipes/libsrtp/all/conandata.yml index d7ca622cbdb825..04f0998b865176 100644 --- a/recipes/libsrtp/all/conandata.yml +++ b/recipes/libsrtp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.6.0": + url: "https://github.com/cisco/libsrtp/archive/v2.6.0.tar.gz" + sha256: "bf641aa654861be10570bfc137d1441283822418e9757dc71ebb69a6cf84ea6b" "2.5.0": url: "https://github.com/cisco/libsrtp/archive/v2.5.0.tar.gz" sha256: "8a43ef8e9ae2b665292591af62aa1a4ae41e468b6d98d8258f91478735da4e09" diff --git a/recipes/libsrtp/all/conanfile.py b/recipes/libsrtp/all/conanfile.py index 8a081d12ab6ba0..38334eef956956 100644 --- a/recipes/libsrtp/all/conanfile.py +++ b/recipes/libsrtp/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import collect_libs, copy, get, save, rmdir from conan.tools.scm import Version +from conan.tools.env import VirtualBuildEnv import os required_conan_version = ">=1.53.0" @@ -14,10 +15,10 @@ class LibsrtpRecipe(ConanFile): "Protocol (SRTP), the Universal Security Transform (UST), and a supporting" "cryptographic kernel." ) - topics = ("srtp",) - homepage = "https://github.com/cisco/libsrtp" - url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cisco/libsrtp" + topics = ("srtp",) package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -48,21 +49,34 @@ def requirements(self): if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") + def build_requirements(self): + if Version(self.version) >= "2.6.0": + self.tool_requires("cmake/[>=3.21 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) tc.variables["ENABLE_OPENSSL"] = self.options.with_openssl - tc.variables["TEST_APPS"] = False + if Version(self.version) < "2.6.0": + tc.variables["TEST_APPS"] = False + else: + tc.variables["LIBSRTP_TEST_APPS"] = False if Version(self.version) < "2.4.0": # Relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - if Version(self.version) >= "2.5.0": + if "2.5.0" <= Version(self.version) < "2.6.0": tc.cache_variables["BUILD_WITH_WARNINGS"] = False + if "2.6.0" <= Version(self.version): + tc.cache_variables["ENABLE_WARNINGS"] = False + tc.cache_variables["ENABLE_WARNINGS_AS_ERRORS"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) deps.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") def _patch_sources(self): save(self, os.path.join(self.source_folder, "CMakeLists.txt"), diff --git a/recipes/libsrtp/config.yml b/recipes/libsrtp/config.yml index 0abd910fd2126b..8daa9e28d8c534 100644 --- a/recipes/libsrtp/config.yml +++ b/recipes/libsrtp/config.yml @@ -1,4 +1,6 @@ versions: + "2.6.0": + folder: all "2.5.0": folder: all "2.4.2": diff --git a/recipes/libssh/all/conandata.yml b/recipes/libssh/all/conandata.yml new file mode 100644 index 00000000000000..87451579acb9cd --- /dev/null +++ b/recipes/libssh/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.10.6": + url: "https://www.libssh.org/files/0.10/libssh-0.10.6.tar.xz" + sha256: "1861d498f5b6f1741b6abc73e608478491edcf9c9d4b6630eef6e74596de9dc1" +patches: + "0.10.6": + - patch_file: patches/0.10.6-0001-fix-cmake.patch + patch_description: "cmake: fix OpenSSL compatibility checks, fix ZLIB targets" + patch_type: "conan" + - patch_file: patches/0.10.6-0002-fix-cmake.patch + patch_description: "cmake: fix MbedTLS and GCrypt compatibility" + patch_type: "conan" + - patch_file: patches/0.10.6-0003-fix-mbedtls-private-struct.patch + patch_description: "Fix mbedTLS issues caused by v3 API changes" + patch_type: "bugfix" + patch_source: "https://gitlab.com/libssh/libssh-mirror/-/merge_requests/480" diff --git a/recipes/libssh/all/conanfile.py b/recipes/libssh/all/conanfile.py new file mode 100644 index 00000000000000..048a5fb46c2ed6 --- /dev/null +++ b/recipes/libssh/all/conanfile.py @@ -0,0 +1,125 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +import os + + +required_conan_version = ">=1.54.0" + + +class LibSSHRecipe(ConanFile): + name = "libssh" + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.libssh.org/" + description = "multiplatform C library implementing the SSHv2 protocol on client and server side" + topics = ("ssh", "shell", "ssh2", "connection") + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + "crypto_backend": ["openssl", "gcrypt", "mbedtls"], + "with_symbol_versioning": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + "crypto_backend": "openssl", + "with_symbol_versioning": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.with_symbol_versioning + + 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 requirements(self): + if self.options.with_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.crypto_backend =="openssl": + self.requires("openssl/[>=1.1 <4]") + elif self.options.crypto_backend == "gcrypt": + self.requires("libgcrypt/1.8.4") + elif self.options.crypto_backend == "mbedtls": + self.requires("mbedtls/3.6.0") + + def validate(self): + if self.options.crypto_backend == "mbedtls" and not self.dependencies["mbedtls"].options.enable_threading: + raise ConanInvalidConfiguration(f"{self.ref} requires '-o mbedtls/*:enable_threading=True' when using '-o libssh/*:crypto_backend=mbedtls'") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CLIENT_TESTING"] = False + tc.variables["SERVER_TESTING"] = False + tc.variables["WITH_EXAMPLES"] = False + tc.variables["WITH_GCRYPT"] = self.options.crypto_backend == "gcrypt" + tc.variables["WITH_GSSAPI"] = False + tc.variables["WITH_MBEDTLS"] = self.options.crypto_backend == "mbedtls" + tc.variables["WITH_NACL"] = False + tc.variables["WITH_SYMBOL_VERSIONING"] = self.options.get_safe("with_symbol_versioning", True) + tc.variables["WITH_ZLIB"] = self.options.with_zlib + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + 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, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["ssh"] + if not self.options.shared: + self.cpp_info.defines.append("LIBSSH_STATIC=ON") + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["ws2_32", "iphlpapi"]) + + self.cpp_info.set_property("cmake_file_name", "libssh") + # target and alias names defined at: + # ssh https://git.libssh.org/projects/libssh.git/tree/src/CMakeLists.txt?h=libssh-0.10.6#n351 + # ssh::ssh https://git.libssh.org/projects/libssh.git/tree/src/CMakeLists.txt?h=libssh-0.10.6#n371 + # ssh-static https://git.libssh.org/projects/libssh.git/tree/src/CMakeLists.txt?h=libssh-0.10.6#n413 + # ssh::static https://git.libssh.org/projects/libssh.git/tree/src/CMakeLists.txt?h=libssh-0.10.6#n428 + self.cpp_info.set_property("cmake_target_name", "ssh::ssh") + self.cpp_info.set_property( + "cmake_target_aliases", + ["ssh"] if self.options.shared else ["ssh", "ssh-static", "ssh::static"], + ) + # pkg-config defined at https://git.libssh.org/projects/libssh.git/tree/CMakeLists.txt?h=libssh-0.10.6#n124 + self.cpp_info.set_property("pkg_config_name", "libssh") + diff --git a/recipes/libssh/all/patches/0.10.6-0001-fix-cmake.patch b/recipes/libssh/all/patches/0.10.6-0001-fix-cmake.patch new file mode 100644 index 00000000000000..22ccde99a90738 --- /dev/null +++ b/recipes/libssh/all/patches/0.10.6-0001-fix-cmake.patch @@ -0,0 +1,110 @@ +diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake +index 9de10225..6f881775 100644 +--- a/ConfigureChecks.cmake ++++ b/ConfigureChecks.cmake +@@ -101,41 +101,41 @@ if (OPENSSL_FOUND) + check_include_file(openssl/ecdsa.h HAVE_OPENSSL_ECDSA_H) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_KDF_CTX_new_id HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_KDF_CTX_new HAVE_OPENSSL_EVP_KDF_CTX_NEW) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(FIPS_mode HAVE_OPENSSL_FIPS_MODE) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(RAND_priv_bytes HAVE_OPENSSL_RAND_PRIV_BYTES) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_DigestSign HAVE_OPENSSL_EVP_DIGESTSIGN) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_DigestVerify HAVE_OPENSSL_EVP_DIGESTVERIFY) + + check_function_exists(OPENSSL_ia32cap_loc HAVE_OPENSSL_IA32CAP_LOC) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_symbol_exists(EVP_PKEY_ED25519 "openssl/evp.h" FOUND_OPENSSL_ED25519) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_chacha20 HAVE_OPENSSL_EVP_CHACHA20) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_symbol_exists(EVP_PKEY_POLY1305 "openssl/evp.h" HAVE_OPENSSL_EVP_POLY1305) + + if (HAVE_OPENSSL_EVP_DIGESTSIGN AND HAVE_OPENSSL_EVP_DIGESTVERIFY AND +@@ -144,7 +144,7 @@ if (OPENSSL_FOUND) + endif() + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_symbol_exists(EVP_PKEY_X25519 "openssl/evp.h" HAVE_OPENSSL_X25519) + + unset(CMAKE_REQUIRED_INCLUDES) +@@ -494,7 +494,7 @@ if (WITH_PKCS11_URI) + message(FATAL_ERROR "PKCS #11 is not supported for mbedcrypto") + set(WITH_PKCS11_URI 0) + endif() +- if (HAVE_OPENSSL AND NOT OPENSSL_VERSION VERSION_GREATER_EQUAL "1.1.1") ++ if (HAVE_OPENSSL AND NOT OpenSSL_VERSION VERSION_GREATER_EQUAL "1.1.1") + message(FATAL_ERROR "PKCS #11 requires at least OpenSSL 1.1.1") + set(WITH_PKCS11_URI 0) + endif() +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 807313b5..91f85094 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -17,7 +17,7 @@ if (OPENSSL_CRYPTO_LIBRARIES) + + set(LIBSSH_LINK_LIBRARIES + ${LIBSSH_LINK_LIBRARIES} +- ${OPENSSL_CRYPTO_LIBRARIES} ++ OpenSSL::Crypto + ) + endif (OPENSSL_CRYPTO_LIBRARIES) + +@@ -46,12 +46,12 @@ endif() + if (WITH_ZLIB) + set(LIBSSH_PRIVATE_INCLUDE_DIRS + ${LIBSSH_PRIVATE_INCLUDE_DIRS} +- ${ZLIB_INCLUDE_DIR} ++ ${ZLIB_INCLUDE_DIRS} + ) + + set(LIBSSH_LINK_LIBRARIES + ${LIBSSH_LINK_LIBRARIES} +- ${ZLIB_LIBRARY} ++ ${ZLIB_LIBRARIES} + ) + endif (WITH_ZLIB) + +@@ -257,7 +257,7 @@ else (WITH_GCRYPT) + chachapoly.c + ) + endif (NOT (HAVE_OPENSSL_EVP_CHACHA20 AND HAVE_OPENSSL_EVP_POLY1305)) +- if(OPENSSL_VERSION VERSION_LESS "1.1.0") ++ if(OpenSSL_VERSION VERSION_LESS "1.1.0") + set(libssh_SRCS ${libssh_SRCS} libcrypto-compat.c) + endif() + endif (WITH_GCRYPT) diff --git a/recipes/libssh/all/patches/0.10.6-0002-fix-cmake.patch b/recipes/libssh/all/patches/0.10.6-0002-fix-cmake.patch new file mode 100644 index 00000000000000..53b9b66c536c75 --- /dev/null +++ b/recipes/libssh/all/patches/0.10.6-0002-fix-cmake.patch @@ -0,0 +1,123 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a64b7708..6647076b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -48,15 +48,15 @@ if (WITH_ZLIB) + endif (WITH_ZLIB) + + if (WITH_GCRYPT) +- find_package(GCrypt 1.5.0 REQUIRED) +- if (NOT GCRYPT_FOUND) ++ find_package(libgcrypt 1.5.0 REQUIRED) ++ if (NOT libgcrypt_FOUND) + message(FATAL_ERROR "Could not find GCrypt") +- endif (NOT GCRYPT_FOUND) ++ endif (NOT libgcrypt_FOUND) + elseif(WITH_MBEDTLS) + find_package(MbedTLS REQUIRED) +- if (NOT MBEDTLS_FOUND) ++ if (NOT MbedTLS_FOUND) + message(FATAL_ERROR "Could not find mbedTLS") +- endif (NOT MBEDTLS_FOUND) ++ endif (NOT MbedTLS_FOUND) + else (WITH_GCRYPT) + find_package(OpenSSL 1.0.1) + if (OPENSSL_FOUND) +@@ -66,13 +66,13 @@ else (WITH_GCRYPT) + set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY}) + endif (NOT DEFINED OPENSSL_CRYPTO_LIBRARIES) + else (OPENSSL_FOUND) +- find_package(GCrypt) +- if (NOT GCRYPT_FOUND) ++ find_package(libgcrypt) ++ if (NOT libgcrypt_FOUND) + find_package(MbedTLS) +- if (NOT MBEDTLS_FOUND) ++ if (NOT MbedTLS_FOUND) + message(FATAL_ERROR "Could not find OpenSSL, GCrypt or mbedTLS") +- endif (NOT MBEDTLS_FOUND) +- endif (NOT GCRYPT_FOUND) ++ endif (NOT MbedTLS_FOUND) ++ endif (NOT libgcrypt_FOUND) + endif (OPENSSL_FOUND) + endif(WITH_GCRYPT) + +diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake +index 6f881775..12585117 100644 +--- a/ConfigureChecks.cmake ++++ b/ConfigureChecks.cmake +@@ -267,27 +267,27 @@ if (OPENSSL_FOUND) + set(HAVE_LIBCRYPTO 1) + endif (OPENSSL_FOUND) + +-if (GCRYPT_FOUND) ++if (libgcrypt_FOUND) + set(HAVE_LIBGCRYPT 1) +- if (GCRYPT_VERSION VERSION_GREATER "1.4.6") ++ if (libgcrypt_VERSION VERSION_GREATER "1.4.6") + set(HAVE_GCRYPT_ECC 1) + set(HAVE_ECC 1) +- endif (GCRYPT_VERSION VERSION_GREATER "1.4.6") +- if (NOT GCRYPT_VERSION VERSION_LESS "1.7.0") ++ endif (libgcrypt_VERSION VERSION_GREATER "1.4.6") ++ if (NOT libgcrypt_VERSION VERSION_LESS "1.7.0") + set(HAVE_GCRYPT_CHACHA_POLY 1) +- endif (NOT GCRYPT_VERSION VERSION_LESS "1.7.0") +-endif (GCRYPT_FOUND) ++ endif (NOT libgcrypt_VERSION VERSION_LESS "1.7.0") ++endif (libgcrypt_FOUND) + +-if (MBEDTLS_FOUND) ++if (MbedTLS_FOUND) + set(HAVE_LIBMBEDCRYPTO 1) + set(HAVE_ECC 1) + +- set(CMAKE_REQUIRED_INCLUDES "${MBEDTLS_INCLUDE_DIR}/mbedtls") ++ set(CMAKE_REQUIRED_INCLUDES "${MbedTLS_INCLUDE_DIR}/mbedtls") + check_include_file(chacha20.h HAVE_MBEDTLS_CHACHA20_H) + check_include_file(poly1305.h HAVE_MBEDTLS_POLY1305_H) + unset(CMAKE_REQUIRED_INCLUDES) + +-endif (MBEDTLS_FOUND) ++endif (MbedTLS_FOUND) + + if (CMAKE_USE_PTHREADS_INIT) + set(HAVE_PTHREAD 1) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 91f85094..839271ad 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -21,27 +21,13 @@ if (OPENSSL_CRYPTO_LIBRARIES) + ) + endif (OPENSSL_CRYPTO_LIBRARIES) + +-if (MBEDTLS_CRYPTO_LIBRARY) +- set(LIBSSH_PRIVATE_INCLUDE_DIRS +- ${LIBSSH_PRIVATE_INCLUDE_DIRS} +- ${MBEDTLS_INCLUDE_DIR} +- ) +- set(LIBSSH_LINK_LIBRARIES +- ${LIBSSH_LINK_LIBRARIES} +- ${MBEDTLS_CRYPTO_LIBRARY} +- ) +-endif (MBEDTLS_CRYPTO_LIBRARY) +- +-if (GCRYPT_LIBRARIES) +- set(LIBSSH_PRIVATE_INCLUDE_DIRS +- ${LIBSSH_PRIVATE_INCLUDE_DIRS} +- ${GCRYPT_INCLUDE_DIR} +- ) ++if (TARGET MbedTLS::mbedcrypto) ++ list(APPEND LIBSSH_LINK_LIBRARIES MbedTLS::mbedcrypto) ++endif () + +- set(LIBSSH_LINK_LIBRARIES +- ${LIBSSH_LINK_LIBRARIES} +- ${GCRYPT_LIBRARIES}) +-endif() ++if (TARGET libgcrypt::libgcrypt) ++ list(APPEND LIBSSH_LINK_LIBRARIES libgcrypt::libgcrypt) ++endif () + + if (WITH_ZLIB) + set(LIBSSH_PRIVATE_INCLUDE_DIRS diff --git a/recipes/libssh/all/patches/0.10.6-0003-fix-mbedtls-private-struct.patch b/recipes/libssh/all/patches/0.10.6-0003-fix-mbedtls-private-struct.patch new file mode 100644 index 00000000000000..b71b2c3e3e4eeb --- /dev/null +++ b/recipes/libssh/all/patches/0.10.6-0003-fix-mbedtls-private-struct.patch @@ -0,0 +1,13 @@ +diff --git a/src/libmbedcrypto.c b/src/libmbedcrypto.c +index caa3b6e9..69910a24 100644 +--- a/src/libmbedcrypto.c ++++ b/src/libmbedcrypto.c +@@ -119,7 +119,7 @@ int hmac_update(HMACCTX c, const void *data, size_t len) + int hmac_final(HMACCTX c, unsigned char *hashmacbuf, size_t *len) + { + int rc; +- *len = (unsigned int)mbedtls_md_get_size(c->md_info); ++ *len = (unsigned int)mbedtls_md_get_size(c->MBEDTLS_PRIVATE(md_info)); + rc = !mbedtls_md_hmac_finish(c, hashmacbuf); + mbedtls_md_free(c); + SAFE_FREE(c); diff --git a/recipes/libssh/all/test_package/CMakeLists.txt b/recipes/libssh/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..028fc387621458 --- /dev/null +++ b/recipes/libssh/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES C) + +find_package(libssh CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ssh) diff --git a/recipes/fontconfig/all/test_package/conanfile.py b/recipes/libssh/all/test_package/conanfile.py similarity index 92% rename from recipes/fontconfig/all/test_package/conanfile.py rename to recipes/libssh/all/test_package/conanfile.py index 98ab55852ad565..a9fb96656f2039 100644 --- a/recipes/fontconfig/all/test_package/conanfile.py +++ b/recipes/libssh/all/test_package/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake, cmake_layout +from conan.tools.cmake import cmake_layout, CMake import os @@ -9,12 +9,12 @@ class TestPackageConan(ConanFile): generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" - def layout(self): - cmake_layout(self) - def requirements(self): self.requires(self.tested_reference_str) + def layout(self): + cmake_layout(self) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/libssh/all/test_package/test_package.c b/recipes/libssh/all/test_package/test_package.c new file mode 100644 index 00000000000000..a6b34889b06527 --- /dev/null +++ b/recipes/libssh/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +int main(int argc, char *argv[]) { + ssh_session session = ssh_new(); + if (session == NULL) { + return -1; + } + + return 0; +} diff --git a/recipes/libssh/config.yml b/recipes/libssh/config.yml new file mode 100644 index 00000000000000..e9995a4dcd5e92 --- /dev/null +++ b/recipes/libssh/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.6": + folder: all diff --git a/recipes/libstudxml/1.1.x/conanfile.py b/recipes/libstudxml/1.1.x/conanfile.py index 42db9e71046d4b..f5228bce1c8240 100644 --- a/recipes/libstudxml/1.1.x/conanfile.py +++ b/recipes/libstudxml/1.1.x/conanfile.py @@ -38,7 +38,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0", transitive_headers=True, transitive_libs=True) + self.requires("expat/[>=2.6.2 <3]", transitive_headers=True, transitive_libs=True) def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/libunwind/all/conanfile.py b/recipes/libunwind/all/conanfile.py index 002c9bf613f236..d96b4cec23a078 100644 --- a/recipes/libunwind/all/conanfile.py +++ b/recipes/libunwind/all/conanfile.py @@ -2,7 +2,14 @@ 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.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 @@ -11,6 +18,7 @@ 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." @@ -59,7 +67,9 @@ def requirements(self): def validate(self): if self.settings.os not in ["Linux", "FreeBSD"]: - raise ConanInvalidConfiguration("libunwind is only supported on Linux and 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) @@ -71,15 +81,17 @@ def generate(self): 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.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) @@ -92,7 +104,12 @@ def build(self): autotools.make() def package(self): - copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + 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")) @@ -102,8 +119,10 @@ def package(self): # 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) + 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) @@ -116,18 +135,26 @@ def package_info(self): 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"].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"].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"].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"].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/recipes/libva/all/conanfile.py b/recipes/libva/all/conanfile.py index 4020db9e7c63ea..d92edb9da1d881 100644 --- a/recipes/libva/all/conanfile.py +++ b/recipes/libva/all/conanfile.py @@ -1,15 +1,16 @@ +import os + 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, rm, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain -import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0 <2 || >=2.0.6" class PackageConan(ConanFile): @@ -37,6 +38,10 @@ class PackageConan(ConanFile): "with_win32": True, } + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") + def export_sources(self): export_conandata_patches(self) @@ -76,9 +81,9 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} can not be built without at least one backend dev files.") def build_requirements(self): - if self.options.get_safe("with_wayland"): - self.tool_requires("wayland/1.22.0") - self.tool_requires("meson/1.3.1") + if self.options.get_safe("with_wayland") and self._has_build_profile: + self.tool_requires("wayland/") + self.tool_requires("meson/1.3.2") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.1.0") @@ -90,14 +95,30 @@ def generate(self): tc.project_options["disable_drm"] = not self.options.get_safe("with_drm") for opt in ['with_x11', 'with_glx', 'with_wayland', 'with_win32']: tc.project_options[opt] = "yes" if self.options.get_safe(opt) else "no" + tc.project_options["build.pkg_config_path"] = self.generators_folder tc.generate() - tc = PkgConfigDeps(self) - tc.generate() + pkg_config_deps = PkgConfigDeps(self) + if self.options.get_safe("with_wayland") and self._has_build_profile: + pkg_config_deps.build_context_activated = ["wayland"] + pkg_config_deps.build_context_suffix = {"wayland": "_BUILD"} + pkg_config_deps.generate() tc = VirtualBuildEnv(self) tc.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + if self.options.get_safe("with_wayland") and self._has_build_profile: + # Patch the build system to use the pkg-config files generated for the build context. + meson_build_file = os.path.join(self.source_folder, "meson.build") + replace_in_file( + self, + meson_build_file, + "wayland_scanner_dep = dependency('wayland-scanner',", + "wayland_scanner_dep = dependency('wayland-scanner_BUILD',", + ) + + def build(self): + self._patch_sources() meson = Meson(self) meson.configure() meson.build() diff --git a/recipes/libvips/all/conandata.yml b/recipes/libvips/all/conandata.yml index ebae63c90e5b27..ef20d5b718d8d9 100644 --- a/recipes/libvips/all/conandata.yml +++ b/recipes/libvips/all/conandata.yml @@ -1,6 +1,6 @@ sources: "8.15.2": - url: "https://github.com/libvips/libvips/releases/download/v8.15.2a/vips-8.15.2.tar.xz" + url: "https://github.com/libvips/libvips/releases/download/v8.15.2/vips-8.15.2.tar.xz" sha256: "a2ab15946776ca7721d11cae3215f20f1f097b370ff580cd44fc0f19387aee84" "8.15.1": url: "https://github.com/libvips/libvips/releases/download/v8.15.1/vips-8.15.1.tar.xz" diff --git a/recipes/libvips/all/conanfile.py b/recipes/libvips/all/conanfile.py index 4e2008334f2bb8..bad73d4834f39a 100644 --- a/recipes/libvips/all/conanfile.py +++ b/recipes/libvips/all/conanfile.py @@ -126,7 +126,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("glib/2.78.3", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_archive"): self.requires("libarchive/3.7.2") @@ -139,7 +139,7 @@ def requirements(self): if self.options.with_fftw: self.requires("fftw/3.3.10") if self.options.with_fontconfig: - self.requires("fontconfig/2.14.2") + self.requires("fontconfig/2.15.0") if self.options.with_heif: self.requires("libheif/1.16.2") if self.options.get_safe("with_highway"): @@ -147,7 +147,7 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.1") + self.requires("libjpeg-turbo/3.0.2") elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.5") if self.options.with_jpeg_xl: @@ -159,15 +159,15 @@ def requirements(self): if self.options.with_matio: self.requires("matio/1.5.24") if self.options.with_openexr: - self.requires("openexr/3.2.1") + self.requires("openexr/3.2.3") if self.options.with_openjpeg: - self.requires("openjpeg/2.5.0") + self.requires("openjpeg/2.5.2") if self.options.with_pangocairo: self.requires("pango/1.50.10") if self.options.with_pdfium: self.requires("pdfium/95.0.4629") if self.options.with_png == "libpng": - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") elif self.options.with_png == "libspng": self.requires("libspng/0.7.4") if self.options.with_poppler: @@ -215,7 +215,7 @@ def validate(self): raise ConanInvalidConfiguration("librsvg recipe not available in conancenter yet") def build_requirements(self): - self.tool_requires("meson/1.3.0") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/2.1.0") if self.options.introspection: @@ -227,7 +227,7 @@ def build_requirements(self): # a different/incompatible libiconv than the one being exposed # in the runtime environment (DYLD_LIBRARY_PATH) # See https://github.com/conan-io/conan-center-index/pull/17502#issuecomment-1542492466 - self.tool_requires("gettext/0.21") + self.tool_requires("gettext/0.22.5") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libwebp/all/conandata.yml b/recipes/libwebp/all/conandata.yml index 0aaa6446c54828..a68caa1df2fd92 100644 --- a/recipes/libwebp/all/conandata.yml +++ b/recipes/libwebp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.0": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.4.0.tar.gz" + sha256: "61f873ec69e3be1b99535634340d5bde750b2e4447caa1db9f61be3fd49ab1e5" "1.3.2": url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.2.tar.gz" sha256: "2a499607df669e40258e53d0ade8035ba4ec0175244869d1025d460562aa09b4" @@ -12,6 +15,10 @@ sources: url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.1.0.tar.gz" sha256: "98a052268cc4d5ece27f76572a7f50293f439c17a98e67c4ea0c7ed6f50ef043" patches: + "1.4.0": + - patch_file: "patches/1.4.0-0001-fix-cmake.patch" + patch_description: "disable PIC, disable prefix library name on MSVC" + patch_type: "conan" "1.3.2": - patch_file: "patches/1.3.1-0001-fix-cmake.patch" patch_description: "disable PIC, disable prefix library name on MSVC" diff --git a/recipes/libwebp/all/patches/1.4.0-0001-fix-cmake.patch b/recipes/libwebp/all/patches/1.4.0-0001-fix-cmake.patch new file mode 100644 index 00000000000000..f819b1e43d2359 --- /dev/null +++ b/recipes/libwebp/all/patches/1.4.0-0001-fix-cmake.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad5e14c3..89c836f3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -60,7 +60,6 @@ if(WEBP_LINK_STATIC) + else() + set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + endif() +- set(CMAKE_POSITION_INDEPENDENT_CODE ON) + # vwebp does not compile on Ubuntu with static libraries so disabling it for + # now. + set(WEBP_BUILD_VWEBP OFF) +@@ -155,7 +154,7 @@ endif() + set(PTHREAD_LIBS ${CMAKE_THREAD_LIBS_INIT}) + set(INSTALLED_LIBRARIES) + +-if(MSVC) ++if(0) + # match the naming convention used by nmake + set(webp_libname_prefix "lib") + set(CMAKE_SHARED_LIBRARY_PREFIX "${webp_libname_prefix}") diff --git a/recipes/libwebp/config.yml b/recipes/libwebp/config.yml index e184761fe568e1..c2fa30e005fdd5 100644 --- a/recipes/libwebp/config.yml +++ b/recipes/libwebp/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.0": + folder: all "1.3.2": folder: all "1.3.1": diff --git a/recipes/libxlsxwriter/all/conandata.yml b/recipes/libxlsxwriter/all/conandata.yml index 44eb2bad3dada6..2cd855a6df663d 100644 --- a/recipes/libxlsxwriter/all/conandata.yml +++ b/recipes/libxlsxwriter/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.7": + url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.1.7.tar.gz" + sha256: "1f378e25d8bb5be258d3e04d3d24b8c23ff21bf206e6e206661844a96ca25eda" "1.1.5": url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.1.5.tar.gz" sha256: "12843587d591cf679e6ec63ecc629245befec2951736804a837696cdb5d61946" @@ -12,6 +15,10 @@ sources: url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.0.0.tar.gz" sha256: "8b353379333c323d14a9d265cd2491d3a6c0032c8d6ec2141f10b82ab66a087c" patches: + "1.1.7": + - patch_file: "patches/1.1.7-0001-fix-cmake.patch" + patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" + patch_type: "conan" "1.1.5": - patch_file: "patches/1.1.5-0001-fix-cmake.patch" patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" diff --git a/recipes/libxlsxwriter/all/patches/1.1.7-0001-fix-cmake.patch b/recipes/libxlsxwriter/all/patches/1.1.7-0001-fix-cmake.patch new file mode 100644 index 00000000000000..715f1026730997 --- /dev/null +++ b/recipes/libxlsxwriter/all/patches/1.1.7-0001-fix-cmake.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0e855c7..f38f37a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -183,9 +183,9 @@ endif() + + if(NOT BUILD_SHARED_LIBS) + if(UNIX) +- set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + elseif(MINGW OR MSYS) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -static-libgcc -Wno-char-subscripts -Wno-long-long") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-char-subscripts -Wno-long-long") + list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_FILE32API) + elseif(MSVC) + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Fd\"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb\"") +@@ -224,7 +224,7 @@ enable_language(CXX) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + + # ZLIB +-find_package(ZLIB "1.0" REQUIRED) ++find_package(ZLIB REQUIRED CONFIG) + list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) + message("zlib version: " ${ZLIB_VERSION}) + +@@ -294,9 +294,11 @@ target_sources(${PROJECT_NAME} + PRIVATE ${LXW_SOURCES} + PUBLIC ${LXW_HEADERS} + ) +-target_link_libraries(${PROJECT_NAME} LINK_PUBLIC ${ZLIB_LIBRARIES} ${MINIZIP_LIBRARIES} ${LIB_CRYPTO} ${OPENSSL_CRYPTO_LIBRARY}) ++target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB minizip::minizip) ++if(USE_OPENSSL_MD5) ++ target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::Crypto) ++endif() + target_compile_definitions(${PROJECT_NAME} PRIVATE ${LXW_PRIVATE_COMPILE_DEFINITIONS}) +- + # /utf-8 needs VS2015 Update 2 or above. + # In CMake 3.7 and above, we can use (MSVC_VERSION GREATER_EQUAL 1900) here. + if(MSVC AND NOT (MSVC_VERSION LESS 1900)) diff --git a/recipes/libxlsxwriter/config.yml b/recipes/libxlsxwriter/config.yml index 4690b80fd5fb3a..5eb935f412b853 100644 --- a/recipes/libxlsxwriter/config.yml +++ b/recipes/libxlsxwriter/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.7": + folder: "all" "1.1.5": folder: "all" "1.1.4": diff --git a/recipes/libxml2/all/conandata.yml b/recipes/libxml2/all/conandata.yml index a0070b6bc4a607..6bc7dcf31e2ca9 100644 --- a/recipes/libxml2/all/conandata.yml +++ b/recipes/libxml2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.12.6": + url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.6.tar.xz" + sha256: "889c593a881a3db5fdd96cc9318c87df34eb648edfc458272ad46fd607353fbb" "2.12.5": url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.5.tar.xz" sha256: "a972796696afd38073e0f59c283c3a2f5a560b5268b4babc391b286166526b21" @@ -8,12 +11,6 @@ sources: "2.12.3": url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.3.tar.xz" sha256: "8c8f1092340a89ff32bc44ad5c9693aff9bc8a7a3e161bb239666e5d15ac9aaa" - "2.12.2": - url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.2.tar.xz" - sha256: "3f2e6464fa15073eb8f3d18602d54fafc489b7715171064615a40490c6be9f4f" - "2.12.1": - url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.1.tar.xz" - sha256: "8982b9ccdf7f456e30d8f7012d50858c6623e495333b6191def455c7e95427eb" "2.11.7": url: "https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.7.tar.xz" sha256: "fb27720e25eaf457f94fd3d7189bcf2626c6dccf4201553bc8874d50e3560162" @@ -32,9 +29,6 @@ sources: "2.9.14": url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.tar.xz" sha256: "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee" - "2.9.13": - url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.13.tar.xz" - sha256: "276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e" "2.9.12": url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.12.tar.xz" sha256: "28a92f6ab1f311acf5e478564c49088ef0ac77090d9c719bbc5d518f1fe62eb9" diff --git a/recipes/libxml2/config.yml b/recipes/libxml2/config.yml index 1c968c066198af..b6d3d1fca3e563 100644 --- a/recipes/libxml2/config.yml +++ b/recipes/libxml2/config.yml @@ -1,14 +1,12 @@ versions: + "2.12.6": + folder: all "2.12.5": folder: all "2.12.4": folder: all "2.12.3": folder: all - "2.12.2": - folder: all - "2.12.1": - folder: all "2.11.7": folder: all "2.11.6": @@ -21,8 +19,6 @@ versions: folder: all "2.9.14": folder: all - "2.9.13": - folder: all "2.9.12": folder: all "2.9.10": diff --git a/recipes/libxslt/all/conanfile.py b/recipes/libxslt/all/conanfile.py index 711c11f5938b03..ebed177675bb03 100644 --- a/recipes/libxslt/all/conanfile.py +++ b/recipes/libxslt/all/conanfile.py @@ -62,7 +62,7 @@ def layout(self): def requirements(self): if Version(self.version) >= "1.1.39": # see https://github.com/conan-io/conan-center-index/pull/16205#discussion_r1149570846 - self.requires("libxml2/2.12.3", transitive_headers=True, transitive_libs=True) + self.requires("libxml2/[>=2.12.5 <3]", transitive_headers=True, transitive_libs=True) else: self.requires("libxml2/2.11.6", transitive_headers=True, transitive_libs=True) diff --git a/recipes/logfault/all/conandata.yml b/recipes/logfault/all/conandata.yml new file mode 100644 index 00000000000000..4ef9e5e9edbe38 --- /dev/null +++ b/recipes/logfault/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + 0.5.2: + url: + - https://github.com/jgaa/logfault/archive/refs/tags/v0.5.2.tar.gz + sha256: b6c7a4faca340bb7e3105c2094acd2afd52ce1bcfbe7e3ed2233c1ec933a904f diff --git a/recipes/logfault/all/conanfile.py b/recipes/logfault/all/conanfile.py new file mode 100644 index 00000000000000..d93b9976fa00f9 --- /dev/null +++ b/recipes/logfault/all/conanfile.py @@ -0,0 +1,69 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain +import os + + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "logfault" + description = "Simple to use, header only C++ library for application-logging on all major platforms." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jgaa/logfault" + topics = ("logging", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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 package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.h", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + diff --git a/recipes/logfault/all/test_package/CMakeLists.txt b/recipes/logfault/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..fcdef5afc68170 --- /dev/null +++ b/recipes/logfault/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(LOGFAULT REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE logfault::logfault) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logfault/all/test_package/conanfile.py b/recipes/logfault/all/test_package/conanfile.py new file mode 100644 index 00000000000000..0a808db45f2453 --- /dev/null +++ b/recipes/logfault/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_layout, CMake +import os + + +# It will become the standard on Conan 2.x +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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/logfault/all/test_package/test_package.cpp b/recipes/logfault/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..a80ce4ba7c1ffd --- /dev/null +++ b/recipes/logfault/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ + +// General tests for manual testing during development + +#include +#include "logfault/logfault.h" + +using namespace std; + +int main( int argc, char *argv[]) { + + logfault::LogManager::Instance().AddHandler(std::make_unique(clog, logfault::LogLevel::DEBUGGING)); + LFLOG_INFO << "Testing" << 1 << 2 << 3; +} diff --git a/recipes/logfault/config.yml b/recipes/logfault/config.yml new file mode 100644 index 00000000000000..ccf525f369b0ec --- /dev/null +++ b/recipes/logfault/config.yml @@ -0,0 +1,3 @@ +versions: + "0.5.2": + folder: all diff --git a/recipes/luau/all/conandata.yml b/recipes/luau/all/conandata.yml index 9d1d69b7d26811..dfd67db933c9e9 100644 --- a/recipes/luau/all/conandata.yml +++ b/recipes/luau/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.620": + url: "https://github.com/Roblox/luau/archive/0.620.tar.gz" + sha256: "a6ae1f0396334e72b1241dabb73aa123037613f3276bf2e71d0dc75568b1eb52" "0.615": url: "https://github.com/Roblox/luau/archive/0.615.tar.gz" sha256: "264192ff1cb1bc3d5c223e5fbe9c4c628d203e2ac6ff72100e09640f43f60a60" diff --git a/recipes/luau/config.yml b/recipes/luau/config.yml index 8d347f4e40ba92..f0ef8a9cb387e9 100644 --- a/recipes/luau/config.yml +++ b/recipes/luau/config.yml @@ -1,4 +1,6 @@ versions: + "0.620": + folder: all "0.615": folder: all "0.610": diff --git a/recipes/macdylibbundler/all/conandata.yml b/recipes/macdylibbundler/all/conandata.yml new file mode 100644 index 00000000000000..014ef59305c053 --- /dev/null +++ b/recipes/macdylibbundler/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.5": + url: "https://github.com/auriamg/macdylibbundler/archive/refs/tags/1.0.5.tar.gz" + sha256: "13384ebe7ca841ec392ac49dc5e50b1470190466623fa0e5cd30f1c634858530" diff --git a/recipes/macdylibbundler/all/conanfile.py b/recipes/macdylibbundler/all/conanfile.py new file mode 100644 index 00000000000000..774cb3deaaf5d6 --- /dev/null +++ b/recipes/macdylibbundler/all/conanfile.py @@ -0,0 +1,50 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.files import copy, get +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.53.0" + + +class MacDylibBundlerConan(ConanFile): + name = "macdylibbundler" + package_type = "application" + description = ( + "mac dylib bundler is a tool for use when bundling mac applications" + ) + topics = ("build", "dylib", "installer", "mac") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/auriamg/macdylibbundler" + license = "MIT" + settings = "os", "arch", "build_type" + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if not is_apple_os(self): + raise ConanInvalidConfiguration("This tool is for macOS only") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + 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")) + # The CMakeLists.txt misses the install command, so for simplicity the executable is copied manually + copy(self, "dylibbundler", src=self.build_folder, dst=os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/macdylibbundler/all/test_package/conanfile.py b/recipes/macdylibbundler/all/test_package/conanfile.py new file mode 100644 index 00000000000000..7909754cbfd68b --- /dev/null +++ b/recipes/macdylibbundler/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + if can_run(self): + self.run("dylibbundler -h") diff --git a/recipes/macdylibbundler/config.yml b/recipes/macdylibbundler/config.yml new file mode 100644 index 00000000000000..84f5016ed4a14e --- /dev/null +++ b/recipes/macdylibbundler/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.5": + folder: all diff --git a/recipes/mathter/all/conandata.yml b/recipes/mathter/all/conandata.yml index d93f0abf244639..10ce98e0118c4f 100644 --- a/recipes/mathter/all/conandata.yml +++ b/recipes/mathter/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/petiaccja/Mathter/archive/v1.1.0.tar.gz" + sha256: "a9a82126ecd80112854098a5646d38f72f0af03e9655b28ab8fa38b4c03b0870" "1.0.1": url: "https://github.com/petiaccja/Mathter/archive/v1.0.1.tar.gz" sha256: "ab90736abfa8774103b53fe2b8962981c5f117dc582b01698c18d66cd2398b8c" diff --git a/recipes/mathter/all/conanfile.py b/recipes/mathter/all/conanfile.py index b25becfd19c5b8..82cdb44fbd38a9 100644 --- a/recipes/mathter/all/conanfile.py +++ b/recipes/mathter/all/conanfile.py @@ -20,6 +20,12 @@ class MathterConan(ConanFile): package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + options = { + "with_xsimd": [True, False] # XSimd is optionally used for hand-rolled vectorization. + } + default_options = { + "with_xsimd": True + } no_copy_source = True @property @@ -34,6 +40,10 @@ def _compilers_minimum_version(self): "gcc": 7, "Visual Studio": 16, } + + def config_options(self): + if Version(self.version) < "1.1": + del self.options.with_xsimd def layout(self): basic_layout(self, src_folder="src") @@ -53,6 +63,10 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def requirements(self): + if self.options.get_safe("with_xsimd"): + self.requires("xsimd/11.1.0") + def package(self): if self.version == "1.0.0": copy(self, "LICENCE", self.source_folder, os.path.join(self.package_folder, "licenses")) @@ -66,3 +80,5 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + if self.options.get_safe("with_xsimd"): + self.cpp_info.defines = ["MATHTER_USE_XSIMD=1"] diff --git a/recipes/mathter/all/test_package/test_package.cpp b/recipes/mathter/all/test_package/test_package.cpp index f9de5516290387..c46788d9d6a1cc 100644 --- a/recipes/mathter/all/test_package/test_package.cpp +++ b/recipes/mathter/all/test_package/test_package.cpp @@ -7,5 +7,10 @@ int main() { Vec3 v2 = {2, 5, 3}; auto r = v1 + v2; std::cout << "Mathter installation works." << std::endl; +#ifdef MATHTER_USE_XSIMD + std::cout << "XSimd enabled." << std::endl; +#else + std::cout << "XSimd disabled." << std::endl; +#endif return 0; } diff --git a/recipes/mathter/config.yml b/recipes/mathter/config.yml index af3bb0714e65c0..d27c249ae17bf5 100644 --- a/recipes/mathter/config.yml +++ b/recipes/mathter/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.0": + folder: all "1.0.1": folder: all "1.0.0": diff --git a/recipes/matio/all/conandata.yml b/recipes/matio/all/conandata.yml index 0850bf3d72ee4b..9a389d571f858f 100644 --- a/recipes/matio/all/conandata.yml +++ b/recipes/matio/all/conandata.yml @@ -1,36 +1,20 @@ sources: - "1.5.18": - url: "https://downloads.sourceforge.net/project/matio/matio/1.5.18/matio-1.5.18.tar.gz" - sha256: "5fad71a63a854d821cc6f4e8c84da837149dd5fb57e1e2baeffd85fa0f28fe25" - "1.5.19": - url: "https://downloads.sourceforge.net/project/matio/matio/1.5.19/matio-1.5.19.tar.gz" - sha256: "a4fa4d248b0414fc72f3d6155f710c470d5628d3c31af834f8d5ccf06b60286f" - "1.5.21": - url: "https://downloads.sourceforge.net/project/matio/matio/1.5.21/matio-1.5.21.tar.gz" - sha256: "21809177e55839e7c94dada744ee55c1dea7d757ddaab89605776d50122fb065" "1.5.23": url: "https://downloads.sourceforge.net/project/matio/matio/1.5.23/matio-1.5.23.tar.gz" sha256: "9f91eae661df46ea53c311a1b2dcff72051095b023c612d7cbfc09406c9f4d6e" "1.5.24": url: "https://downloads.sourceforge.net/project/matio/matio/1.5.24/matio-1.5.24.tar.gz" sha256: "5106ebed5b40d02a2bb968b57bef8876701c566e039e6ebe134bab779c436f7c" + "1.5.26": + url: "https://downloads.sourceforge.net/project/matio/matio/1.5.26/matio-1.5.26.tar.gz" + sha256: "8b47c29f58e468dba7a5555371c6a72ad4c6aa8b15f459b2b0b65a303c063933" patches: - "1.5.18": - - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/disable-hdf5-target.patch" - - patch_file: "patches/patch-apple-no-undefined.patch" - - patch_file: "patches/cmake-install-bundle.patch" - "1.5.19": - - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/patch-apple-no-undefined.patch" - - patch_file: "patches/cmake-install-bundle.patch" - "1.5.21": - - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/patch-apple-no-undefined.patch" - - patch_file: "patches/cmake-install-bundle.patch" "1.5.23": - patch_file: "patches/require-cmake-3.10.patch" - patch_file: "patches/cmake-install-bundle.patch" "1.5.24": - patch_file: "patches/require-cmake-3.10.patch" - patch_file: "patches/cmake-install-bundle.patch" + "1.5.26": + - patch_file: "patches/require-cmake-3.10.patch" + - patch_file: "patches/cmake-install-bundle.patch" diff --git a/recipes/matio/all/conanfile.py b/recipes/matio/all/conanfile.py index 199bb98823415b..74cf617347b43e 100644 --- a/recipes/matio/all/conanfile.py +++ b/recipes/matio/all/conanfile.py @@ -54,7 +54,7 @@ def layout(self): def requirements(self): if self.options.with_hdf5: - self.requires("hdf5/1.14.1") + self.requires("hdf5/1.14.3") if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") diff --git a/recipes/matio/all/patches/disable-hdf5-target.patch b/recipes/matio/all/patches/disable-hdf5-target.patch deleted file mode 100644 index 8f9c45cb87de8a..00000000000000 --- a/recipes/matio/all/patches/disable-hdf5-target.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/cmake/thirdParties.cmake -+++ b/cmake/thirdParties.cmake -@@ -29,8 +29,8 @@ if(MATIO_WITH_HDF5) - endif() - endif() - --if(HDF5_FOUND) - set(HAVE_HDF5 1) -+if(0) - add_library(HDF5::HDF5 INTERFACE IMPORTED) - if(MATIO_USE_CONAN AND TARGET CONAN_PKG::hdf5) - # target from Conan diff --git a/recipes/matio/all/patches/patch-apple-no-undefined.patch b/recipes/matio/all/patches/patch-apple-no-undefined.patch deleted file mode 100644 index 6dbb97ff53471e..00000000000000 --- a/recipes/matio/all/patches/patch-apple-no-undefined.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/cmake/src.cmake -+++ b/cmake/src.cmake -@@ -37,8 +37,12 @@ if(STDINT_MSVC) - endif() - - if(NOT MSVC) -- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") -- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--retain-symbols-file,${PROJECT_SOURCE_DIR}/src/matio.sym") -+ if(APPLE) -+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error") -+ else() -+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") -+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--retain-symbols-file,${PROJECT_SOURCE_DIR}/src/matio.sym") -+ endif() - endif() - - if(MATIO_SHARED) diff --git a/recipes/matio/config.yml b/recipes/matio/config.yml index 32213bb4d952d6..aa1f75ac7dd6a9 100644 --- a/recipes/matio/config.yml +++ b/recipes/matio/config.yml @@ -1,11 +1,7 @@ versions: - "1.5.18": + "1.5.26": folder: all - "1.5.19": - folder: all - "1.5.21": + "1.5.24": folder: all "1.5.23": folder: all - "1.5.24": - folder: all diff --git a/recipes/mbedtls/all/conandata.yml b/recipes/mbedtls/all/conandata.yml index 4fc47c13a49df5..bc6f67303c8e39 100644 --- a/recipes/mbedtls/all/conandata.yml +++ b/recipes/mbedtls/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.6.0": + url: "https://github.com/Mbed-TLS/mbedtls/releases/download/v3.6.0/mbedtls-3.6.0.tar.bz2" + sha256: "3ecf94fcfdaacafb757786a01b7538a61750ebd85c4b024f56ff8ba1490fcd38" "3.5.2": url: "https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.5.2.tar.gz" sha256: "eedecc468b3f8d052ef05a9d42bf63f04c8a1c50d1c5a94c251c681365a2c723" diff --git a/recipes/mbedtls/all/conanfile.py b/recipes/mbedtls/all/conanfile.py index 6b9782288fcdd6..4ccbcab9405bcb 100644 --- a/recipes/mbedtls/all/conanfile.py +++ b/recipes/mbedtls/all/conanfile.py @@ -26,11 +26,13 @@ class MBedTLSConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_zlib": [True, False], + "enable_threading": [True, False], } default_options = { "shared": False, "fPIC": True, "with_zlib": True, + "enable_threading": False, } def config_options(self): @@ -54,8 +56,12 @@ def requirements(self): self.requires("zlib/[>=1.2.11 <2]") def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} does not support shared build on Windows") + if self.settings.os == "Windows": + if self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not support shared build on Windows") + if self.options.enable_threading: + # INFO: Planned: https://github.com/Mbed-TLS/mbedtls/issues/8455 + raise ConanInvalidConfiguration(f"{self.ref} does not support the option enable_threading on Windows") if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": # The command line flags set are not supported on older versions of gcc @@ -86,6 +92,10 @@ def generate(self): tc.preprocessor_definitions["MBEDTLS_PLATFORM_SNPRINTF_MACRO"] = "snprintf" else: tc.preprocessor_definitions["MBEDTLS_PLATFORM_SNPRINTF_MACRO"] = "MBEDTLS_PLATFORM_STD_SNPRINTF" + if self.options.enable_threading: + tc.preprocessor_definitions["MBEDTLS_THREADING_C"] = True + tc.preprocessor_definitions["MBEDTLS_THREADING_PTHREAD"] = True + tc.generate() tc = CMakeDeps(self) tc.generate() @@ -100,6 +110,7 @@ def package(self): 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, "cmake")) def package_info(self): @@ -110,16 +121,26 @@ def package_info(self): self.cpp_info.components["mbedcrypto"].libs = ["mbedcrypto"] if self.settings.os == "Windows": self.cpp_info.components["mbedcrypto"].system_libs = ["bcrypt"] + if Version(self.version) >= "3.6.0": + self.cpp_info.components["mbedcrypto"].set_property("pkg_config_name", "mbedcrypto") + if self.options.enable_threading: + self.cpp_info.components["mbedcrypto"].defines.extend(["MBEDTLS_THREADING_C=1", "MBEDTLS_THREADING_PTHREAD=1"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["mbedcrypto"].system_libs.append("pthread") self.cpp_info.components["mbedx509"].set_property("cmake_target_name", "MbedTLS::mbedx509") self.cpp_info.components["mbedx509"].libs = ["mbedx509"] if self.settings.os == "Windows": self.cpp_info.components["mbedx509"].system_libs = ["ws2_32"] self.cpp_info.components["mbedx509"].requires = ["mbedcrypto"] + if Version(self.version) >= "3.6.0": + self.cpp_info.components["mbedx509"].set_property("pkg_config_name", "mbedx509") self.cpp_info.components["libembedtls"].set_property("cmake_target_name", "MbedTLS::mbedtls") self.cpp_info.components["libembedtls"].libs = ["mbedtls"] self.cpp_info.components["libembedtls"].requires = ["mbedx509"] + if Version(self.version) >= "3.6.0": + self.cpp_info.components["libembedtls"].set_property("pkg_config_name", "embedtls") if self.options.get_safe("with_zlib"): for component in self.cpp_info.components: diff --git a/recipes/mbedtls/config.yml b/recipes/mbedtls/config.yml index 0b85d9e34743c0..1fa588f3972ec9 100644 --- a/recipes/mbedtls/config.yml +++ b/recipes/mbedtls/config.yml @@ -1,4 +1,6 @@ versions: + "3.6.0": + folder: all "3.5.2": folder: all "3.5.1": diff --git a/recipes/mbits-utfconv/all/conandata.yml b/recipes/mbits-utfconv/all/conandata.yml index f315fc7cf457d2..321d37c79ca7e2 100644 --- a/recipes/mbits-utfconv/all/conandata.yml +++ b/recipes/mbits-utfconv/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.4": + url: "https://github.com/mbits-libs/utfconv/archive/v1.0.4.tar.gz" + sha256: "cd4b6cbed75d67a02399add312b93c4c1de9ac53cf33a8bf44baece038fabb60" "1.0.3": url: "https://github.com/mbits-libs/utfconv/archive/v1.0.3.tar.gz" sha256: "2077e3dcb999dc76d2bdc06cc141b38e10f15762975c261f72cc1a8c2519a27a" diff --git a/recipes/mbits-utfconv/config.yml b/recipes/mbits-utfconv/config.yml index 372dd1cb646bd1..20b5bf02cf8c78 100644 --- a/recipes/mbits-utfconv/config.yml +++ b/recipes/mbits-utfconv/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.4": + folder: all "1.0.3": folder: all diff --git a/recipes/mcap/all/conandata.yml b/recipes/mcap/all/conandata.yml index 4ede1237bc36ce..86d2a620395b92 100644 --- a/recipes/mcap/all/conandata.yml +++ b/recipes/mcap/all/conandata.yml @@ -1,37 +1,40 @@ sources: + "1.4.0": + url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.4.0.tar.gz" + sha256: "64ff3e51119f37ffcfaf9deecbd987a7cb4d4d9035d74a3fd3773395a470fda1" "1.3.0": url: "https://github.com/foxglove/mcap/archive/releases/cpp/v1.3.0.tar.gz" sha256: "41acf6e85d75556c64407f077e05492d31db1f099e07242ef04364bb2939acf1" "1.2.1": url: "https://github.com/foxglove/mcap/archive/releases/cpp/v1.2.1.tar.gz" sha256: "fdc0c351bbcf8883fec0047ff84fed74da88446859083beb6624a584e2cde669" - 1.2.0: + "1.2.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.2.0/main.tar.gz" sha256: "11a6badecac2b10e9687e912648a6e9679ef8731e4ab9570346ae9845ae64a65" - 1.1.0: + "1.1.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.1.0/main.tar.gz" sha256: "1cb2ae9f2e910eeb2e93b3ab722744d1805b9da45764e4fd88703b669413350d" - 1.0.0: + "1.0.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.0.0/main.tar.gz" sha256: "e36169e46a67a9431f73df335f67488461817bc423f9af63ac0af7f29e0bd696" - 0.9.0: + "0.9.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.9.0/main.tar.gz" sha256: "e17702fcc0259bf72eab0d84d3fa6e02c051256357ab7ba4421462f2c02b434f" - 0.5.0: + "0.5.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.5.0/main.tar.gz" sha256: "408e255a6c6419b16de38a9ecbdd9729d60adc657767b2d52a234d1da1185349" - 0.4.0: + "0.4.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.4.0/main.tar.gz" sha256: "c0ab99e51005fa8b74fe9ca1ed23b205cf532b8b0723eedd243f35a28d7b466b" - 0.3.0: + "0.3.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.3.0/main.tar.gz" sha256: "ef29ea4c09520b8aaa2d78ce5e79cbbcd87511ed14d6abf3c4b249ae67a4153b" - 0.1.2: + "0.1.2": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.1.2/main.tar.gz" sha256: "0f456d6c53730445c3dbf57afd285493cf748c66a02f77d6e48c075128fd0896" - 0.1.1: + "0.1.1": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.1.1/main.tar.gz" sha256: "a9ea899315851bfacdb234b7acc917b1a9c67593f0d68e1920321a8f6fa2cfbf" - 0.1.0: + "0.1.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.1.0/main.tar.gz" sha256: "a936abb1493b0d189d7909a79c45bdc6703b6016801e10b5cd129ba39642d2b2" diff --git a/recipes/mcap/config.yml b/recipes/mcap/config.yml index fb6aa455469ead..693870396f82a9 100644 --- a/recipes/mcap/config.yml +++ b/recipes/mcap/config.yml @@ -1,25 +1,27 @@ versions: + "1.4.0": + folder: all "1.3.0": folder: all "1.2.1": folder: all - 1.2.0: + "1.2.0": folder: all - 1.1.0: + "1.1.0": folder: all - 1.0.0: + "1.0.0": folder: all - 0.9.0: + "0.9.0": folder: all - 0.5.0: + "0.5.0": folder: all - 0.4.0: + "0.4.0": folder: all - 0.3.0: + "0.3.0": folder: all - 0.1.2: + "0.1.2": folder: all - 0.1.1: + "0.1.1": folder: all - 0.1.0: + "0.1.0": folder: all diff --git a/recipes/md4qt/all/conandata.yml b/recipes/md4qt/all/conandata.yml index 46312df8b8947f..e21deda7ceec5c 100644 --- a/recipes/md4qt/all/conandata.yml +++ b/recipes/md4qt/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.8.1": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.8.1.tar.gz" + sha256: "02a046c1586da820be0c5dd36f635ca50060f893fe638b542546f4a7a07d3164" "2.8.0": url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.8.0.tar.gz" sha256: "82ef6acc84ea3a7891e4547f7d79af4caaef0f4d6f152bdab2a5c6ed5a48d11b" diff --git a/recipes/md4qt/config.yml b/recipes/md4qt/config.yml index fb12b4088b445c..88cab2028c7e07 100644 --- a/recipes/md4qt/config.yml +++ b/recipes/md4qt/config.yml @@ -1,4 +1,6 @@ versions: + "2.8.1": + folder: all "2.8.0": folder: all "2.7.4": diff --git a/recipes/meson/all/conandata.yml b/recipes/meson/all/conandata.yml index 775660b3d07c23..f567bf8d560876 100644 --- a/recipes/meson/all/conandata.yml +++ b/recipes/meson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "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" diff --git a/recipes/meson/config.yml b/recipes/meson/config.yml index 0e150ef5dedd69..2b56413242adfe 100644 --- a/recipes/meson/config.yml +++ b/recipes/meson/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.0": + folder: all "1.3.2": folder: all "1.3.1": diff --git a/recipes/metis/all/conanfile.py b/recipes/metis/all/conanfile.py index 7782c2735e1246..d935fb4c025d24 100644 --- a/recipes/metis/all/conanfile.py +++ b/recipes/metis/all/conanfile.py @@ -34,7 +34,7 @@ class METISConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "with_64bit_types": True, + "with_64bit_types": False, "enable_gkrand": False, "enable_gkregex": False, "with_openmp": False, @@ -45,12 +45,7 @@ class METISConan(ConanFile): def export_sources(self): export_conandata_patches(self) copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) - copy( - self, - "gkbuild.cmake", - self.recipe_folder, - os.path.join(self.export_sources_folder, "src"), - ) + copy(self, "gkbuild.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -76,11 +71,11 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.cache_variables["VALGRIND"] = self.options.with_valgrind - tc.cache_variables["OPENMP"] = self.options.with_openmp - tc.cache_variables["PCRE"] = self.options.with_pcre - tc.cache_variables["GKREGEX"] = self.settings.os == "Windows" or self.options.enable_gkregex - tc.cache_variables["GKRAND"] = self.options.enable_gkrand + tc.variables["VALGRIND"] = self.options.with_valgrind + tc.variables["OPENMP"] = self.options.with_openmp + tc.variables["PCRE"] = self.options.with_pcre + tc.variables["GKREGEX"] = self.settings.os == "Windows" or self.options.enable_gkregex + tc.variables["GKRAND"] = self.options.enable_gkrand if self.settings.build_type == "Debug": tc.preprocessor_definitions["DEBUG"] = "" else: @@ -104,12 +99,7 @@ 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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rm(self, "*.cmake", self.package_folder, recursive=True) diff --git a/recipes/minicoro/all/conandata.yml b/recipes/minicoro/all/conandata.yml new file mode 100644 index 00000000000000..26ecba7b50b2a1 --- /dev/null +++ b/recipes/minicoro/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.3": + url: "https://github.com/edubart/minicoro/archive/refs/tags/v0.1.3.tar.gz" + sha256: "4f9d4c3b5f6473f8141ee45e9947a6e7e7ee6665b4d9a8c373c0602495c5f6c9" diff --git a/recipes/minicoro/all/conanfile.py b/recipes/minicoro/all/conanfile.py new file mode 100644 index 00000000000000..77385609248b9e --- /dev/null +++ b/recipes/minicoro/all/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "minicoro" + description = "Single header stackful cross-platform coroutine library in pure C" + license = ("Unlicense", "MIT-0") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/edubart/minicoro" + topics = ("lua", "coroutine", "fibers", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + 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): + pass + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", self.source_folder, os.path.join(self.package_folder, "include", "minicoro")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "minicoro")) diff --git a/recipes/minicoro/all/test_package/CMakeLists.txt b/recipes/minicoro/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..2862cc47440066 --- /dev/null +++ b/recipes/minicoro/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(minicoro REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE minicoro::minicoro) diff --git a/recipes/minicoro/all/test_package/conanfile.py b/recipes/minicoro/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/minicoro/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/minicoro/all/test_package/test_package.c b/recipes/minicoro/all/test_package/test_package.c new file mode 100644 index 00000000000000..5c333058e93504 --- /dev/null +++ b/recipes/minicoro/all/test_package/test_package.c @@ -0,0 +1,22 @@ +#define MINICORO_IMPL +#include "minicoro.h" + +#include +#include +#include + +void coro_entry(mco_coro* co) { + printf("coroutine 1\n"); + mco_yield(co); + printf("coroutine 2\n"); +} + +int main(void) { + mco_desc desc = mco_desc_init(coro_entry, 0); + desc.user_data = NULL; + mco_coro* co; + mco_create(&co, &desc); + mco_destroy(co); + + return EXIT_SUCCESS; +} diff --git a/recipes/minicoro/config.yml b/recipes/minicoro/config.yml new file mode 100644 index 00000000000000..b7f57204004e43 --- /dev/null +++ b/recipes/minicoro/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.3": + folder: all diff --git a/recipes/minizip-ng/all/conanfile.py b/recipes/minizip-ng/all/conanfile.py index 7d26ebb7bc61f1..6185768b2d0c89 100644 --- a/recipes/minizip-ng/all/conanfile.py +++ b/recipes/minizip-ng/all/conanfile.py @@ -197,6 +197,8 @@ def package_info(self): self.cpp_info.components["minizip"].requires.append("openssl::openssl") elif is_apple_os(self): self.cpp_info.components["minizip"].frameworks.extend(["CoreFoundation", "Security"]) + elif self.settings.os == "Windows": + self.cpp_info.components["minizip"].system_libs.append("crypt32") if self.settings.os != "Windows" and self.options.with_iconv: self.cpp_info.components["minizip"].requires.append("libiconv::libiconv") diff --git a/recipes/mocknetworkaccessmanager/all/conandata.yml b/recipes/mocknetworkaccessmanager/all/conandata.yml new file mode 100644 index 00000000000000..74e9cd9518fafd --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "0.12.0": + url: "https://gitlab.com/julrich/MockNetworkAccessManager/-/archive/0.12.0/MockNetworkAccessManager-0.12.0.tar.gz" + sha256: "ac9ffb5e6e5ccdc1b7c76da7a92b5d845ec12eb48a39b0423005da4f6431b09f" +patches: + "0.12.0": + - patch_file: "patches/0.12.0-0001-add-install-step.patch" + patch_description: "Add install step" + patch_type: "conan" + patch_source: "https://gitlab.com/julrich/MockNetworkAccessManager/-/merge_requests/75" + - patch_file: "patches/0.12.0-0002-fix-target-without-location.patch" + patch_description: "Fix target without location" + patch_type: "conan" + patch_source: "https://gitlab.com/julrich/MockNetworkAccessManager/-/merge_requests/75" diff --git a/recipes/mocknetworkaccessmanager/all/conanfile.py b/recipes/mocknetworkaccessmanager/all/conanfile.py new file mode 100644 index 00000000000000..02cad6660ab56a --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +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, copy, export_conandata_patches, get +import os + + +required_conan_version = ">=1.52.0" + + +class MockNetworkAccessManagerConan(ConanFile): + name = "mocknetworkaccessmanager" + description = "Mocking network communication for Qt applications" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.com/julrich/MockNetworkAccessManager" + topics = ("qt", "mock", "network", "QNetworkAccessManager", "unit test", "test") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_qt": [5, 6], + } + default_options = { + "fPIC": True, + "with_qt": 5, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_qt == 5: + self.requires("qt/5.15.12", transitive_headers=True) + else: + self.requires("qt/6.6.1", transitive_headers=True) + + 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["BUILD_TESTING"] = False + tc.variables["FORCE_QT5"] = self.options.with_qt == 5 + 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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["MockNetworkAccessManager"] diff --git a/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0001-add-install-step.patch b/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0001-add-install-step.patch new file mode 100644 index 00000000000000..5ab7046d5c2733 --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0001-add-install-step.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 61ed3ed..6d0de20 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -107,3 +107,10 @@ add_library( MockNetworkAccessManager STATIC EXCLUDE_FROM_ALL "MockNetworkAccess + target_include_directories( MockNetworkAccessManager PUBLIC "${PROJECT_SOURCE_DIR}" ) + target_link_libraries( MockNetworkAccessManager Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network ) + ++install(TARGETS MockNetworkAccessManager ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++ ++install(FILES "${PROJECT_SOURCE_DIR}/MockNetworkAccessManager.hpp" ++ DESTINATION include) ++ diff --git a/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0002-fix-target-without-location.patch b/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0002-fix-target-without-location.patch new file mode 100644 index 00000000000000..30e7bf6374a71c --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0002-fix-target-without-location.patch @@ -0,0 +1,20 @@ +commit e28d1f3868db8c7f5ff654a205d80d5d7ed203c4 +Author: Martin Delille +Date: Fri Jan 19 18:06:56 2024 +0100 + + Fix target without LOCATION property + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6d0de20..dbfbed3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,8 +26,7 @@ if( NOT Qt5_FOUND OR NOT Qt6_FOUND ) + find_package( Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network ) + endif() + +-get_target_property( QTCORE_LOCATION Qt${QT_VERSION_MAJOR}::Core LOCATION ) +-get_filename_component( QT_BIN_DIR ${QTCORE_LOCATION} DIRECTORY ) ++get_filename_component(QT_BIN_DIR "$" ABSOLUTE) + set( CMAKE_MSVCIDE_RUN_PATH ${QT_BIN_DIR} ) + set_property( DIRECTORY "." APPEND PROPERTY COMPILE_DEFINITIONS "QT_DEPRECATED_WARNINGS" ) + diff --git a/recipes/mocknetworkaccessmanager/all/test_package/CMakeLists.txt b/recipes/mocknetworkaccessmanager/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..679b5058fe4c87 --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(mocknetworkaccessmanager REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mocknetworkaccessmanager::mocknetworkaccessmanager) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mocknetworkaccessmanager/all/test_package/conanfile.py b/recipes/mocknetworkaccessmanager/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/mocknetworkaccessmanager/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mocknetworkaccessmanager/all/test_package/test_package.cpp b/recipes/mocknetworkaccessmanager/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..16d39eccc870fd --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include "MockNetworkAccessManager.hpp" + +int main(int argc, char *argv[]) { + QCoreApplication app(argc, argv); + MockNetworkAccess::Manager< QNetworkAccessManager > mnam; + + mnam.whenGet( QUrl( "http://example.com/hello" ) ) + .has( MockNetworkAccess::Predicates::HeaderMatching( QNetworkRequest::UserAgentHeader, + QRegularExpression( ".*MyNetworkClient/.*" ) ) ) + .reply().withBody( QJsonDocument::fromJson( "{\"hello\":\"world\"}" ) ); + + return 0; +} diff --git a/recipes/mocknetworkaccessmanager/config.yml b/recipes/mocknetworkaccessmanager/config.yml new file mode 100644 index 00000000000000..bd3e719c29dbd0 --- /dev/null +++ b/recipes/mocknetworkaccessmanager/config.yml @@ -0,0 +1,3 @@ +versions: + "0.12.0": + folder: all diff --git a/recipes/mold/all/conandata.yml b/recipes/mold/all/conandata.yml index 27fad647a9723b..a7ab499712b323 100644 --- a/recipes/mold/all/conandata.yml +++ b/recipes/mold/all/conandata.yml @@ -5,6 +5,9 @@ sources: "2.0.0": url: "https://github.com/rui314/mold/archive/refs/tags/v2.0.0.tar.gz" sha256: "2ae8a22db09cbff626df74c945079fa29c1e5f60bbe02502dcf69191cf43527b" + "1.11.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v1.11.0.tar.gz" + sha256: "99318eced81b09a77e4c657011076cc8ec3d4b6867bd324b8677974545bc4d6f" "1.4.2": url: "https://github.com/rui314/mold/archive/refs/tags/v1.4.2.tar.gz" sha256: "47e6c48d20f49e5b47dfb8197dd9ffcb11a8833d614f7a03bd29741c658a69cd" @@ -17,6 +20,3 @@ sources: "1.8.0": url: "https://github.com/rui314/mold/archive/refs/tags/v1.8.0.tar.gz" sha256: "7210225478796c2528aae30320232a5a3b93a640292575a8c55aa2b140041b5c" - "1.11.0": - url: "https://github.com/rui314/mold/archive/refs/tags/v1.11.0.tar.gz" - sha256: "99318eced81b09a77e4c657011076cc8ec3d4b6867bd324b8677974545bc4d6f" diff --git a/recipes/mold/all/conanfile.py b/recipes/mold/all/conanfile.py index a760cce0d4728f..68b6db435177aa 100644 --- a/recipes/mold/all/conanfile.py +++ b/recipes/mold/all/conanfile.py @@ -40,11 +40,12 @@ def layout(self): def requirements(self): self.requires("zlib/[>=1.2.11 <2]") - self.requires("openssl/[>=1.1 <4]") self.requires("xxhash/0.8.2") - self.requires("onetbb/2021.10.0") if self.options.with_mimalloc: self.requires("mimalloc/2.1.2") + if Version(self.version) < "2.2.0": + # Newer versions use vendored-in BLAKE3 + self.requires("openssl/[>=1.1 <4]") def package_id(self): del self.info.settings.compiler @@ -75,7 +76,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["MOLD_USE_MIMALLOC"] = self.options.with_mimalloc tc.variables["MOLD_USE_SYSTEM_MIMALLOC"] = True - tc.variables["MOLD_USE_SYSTEM_TBB"] = True + tc.variables["MOLD_USE_SYSTEM_TBB"] = False # see https://github.com/conan-io/conan-center-index/pull/23575#issuecomment-2059154281 tc.variables["CMAKE_INSTALL_LIBEXECDIR"] = "libexec" tc.generate() diff --git a/recipes/mold/config.yml b/recipes/mold/config.yml index b4070800652f5f..d74f43310778ec 100644 --- a/recipes/mold/config.yml +++ b/recipes/mold/config.yml @@ -3,6 +3,8 @@ versions: folder: all "2.0.0": folder: all + "1.11.0": + folder: all "1.4.2": folder: all "1.5.1": @@ -11,5 +13,3 @@ versions: folder: all "1.8.0": folder: all - "1.11.0": - folder: all diff --git a/recipes/mpir/all/conandata.yml b/recipes/mpir/all/conandata.yml index c5a67d7b84dcad..815ad473b44e75 100644 --- a/recipes/mpir/all/conandata.yml +++ b/recipes/mpir/all/conandata.yml @@ -1,4 +1,10 @@ sources: "3.0.0": - url: "http://mpir.org/mpir-3.0.0.zip" - sha256: "6277d3cc36ff39c98e4d4cc17b46b5a6ff42a22d30a4130b2d49255f98dd8c1f" + url: "https://github.com/wbhart/mpir/archive/refs/tags/mpir-3.0.0.tar.gz" + sha256: "86a5039badc3e6738219a262873a1db5513405e15ece9527b718fcd0fac09bb2" +patches: + "3.0.0": + - patch_file: "patches/fix_xcode_12_configure.patch" + patch_type: "backport" + patch_source: https://github.com/wbhart/mpir/commit/bbc43ca6ae0bec4f64e69c9cd4c967005d6470eb + patch_description: "Fix warnings (turned to errors) that causes XCode 12+ configure to fail" diff --git a/recipes/mpir/all/conanfile.py b/recipes/mpir/all/conanfile.py index 3c6c16a085f0bc..d9ae778b935b21 100644 --- a/recipes/mpir/all/conanfile.py +++ b/recipes/mpir/all/conanfile.py @@ -1,26 +1,28 @@ +import os + from conan import ConanFile -from conan.tools.microsoft import msvc_runtime_flag, is_msvc -from conan.tools.build import cross_building -from conan.tools.files import get, copy, replace_in_file, chdir, rmdir, rm -from conan.tools.scm import Version -from conans import tools, AutoToolsBuildEnvironment, MSBuild from conan.errors import ConanInvalidConfiguration -import contextlib -import os +from conan.tools.apple import XCRun, to_apple_arch +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, 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 MSBuild, MSBuildToolchain, is_msvc, is_msvc_static_runtime, msvc_runtime_flag + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.50.0" class MpirConan(ConanFile): name = "mpir" - description = "MPIR is a highly optimised library for bignum arithmetic" \ - "forked from the GMP bignum library." - topics = ("mpir", "multiprecision", "math", "mathematics") - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://mpir.org/" + description = ("MPIR is a highly optimised library for bignum arithmetic " + "forked from the GMP bignum library.") license = "LGPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/wbhart/mpir" + topics = ("multiprecision", "math", "mathematics") - provides = [] - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -35,45 +37,84 @@ class MpirConan(ConanFile): "enable_gmpcompat": True, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @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: - del self.options.fPIC + self.options.rm_safe("fPIC") if is_msvc(self) and self.options.shared: del self.options.enable_cxx if not self.options.get_safe("enable_cxx", False): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") if self.options.enable_gmpcompat: - self.provides.append("gmp") + self.provides = ["gmp"] + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): raise ConanInvalidConfiguration("Cross-building doesn't work (yet)") def build_requirements(self): + self.tool_requires("libtool/2.4.7") self.tool_requires("yasm/1.3.0") if not is_msvc(self): self.tool_requires("m4/1.4.19") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.tool_requires("msys2/cci.latest") + 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, keep_permissions=True, **self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True, keep_permissions=True) + + def _generate_msvc(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MSBuildToolchain(self) + tc.generate() + + def _generate_autotools(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-silent-rules") + tc.configure_args.append("--enable-cxx" if self.options.get_safe("enable_cxx") else "--disable-cxx") + tc.configure_args.append("--enable-gmpcompat" if self.options.enable_gmpcompat else "--disable-gmpcompat") + + # compiler checks are written for C89 but compilers that default to C99 treat implicit functions as error + tc.extra_cxxflags.append("-Wno-implicit-function-declaration") + + if self.settings.compiler == "apple-clang": + if hasattr(self, "settings_build"): + # there is no CFLAGS_FOR_BUILD/CXXFLAGS_FOR_BUILD + sdk_path = XCRun(self).sdk_path + tc.extra_cxxflags += [ + "-Wno-implicit-function-declaration", + "-isysroot", sdk_path, + "-arch", to_apple_arch(self), + ] + # Disable docs + tc.make_args.append("MAKEINFO=true") + tc.generate() + + def generate(self): + if is_msvc(self): + self._generate_msvc() + else: + self._generate_autotools() @property def _platforms(self): @@ -83,75 +124,41 @@ def _platforms(self): def _dll_or_lib(self): return "dll" if self.options.shared else "lib" + @property + def _vs_ide_version(self): + if str(self.settings.compiler) == "Visual Studio": + return self.settings.compiler.version + msvc_to_ide = {"170": "11", "180": "12", "190": "14", "191": "15", "192": "16", "193": "17"} + return msvc_to_ide.get(str(self.settings.compiler.version), "17") + @property def _vcxproj_paths(self): - compiler_version = self.settings.compiler.version if Version(self.settings.compiler.version) <= "17" else "17" - build_subdir = "build.vc{}".format(compiler_version) + build_subdir = f"build.vc{self._vs_ide_version}" vcxproj_paths = [ - os.path.join(self._source_subfolder, build_subdir, - "{}_mpir_gc".format(self._dll_or_lib), - "{}_mpir_gc.vcxproj".format(self._dll_or_lib)) + os.path.join(self.source_folder, build_subdir, f"{self._dll_or_lib}_mpir_gc", f"{self._dll_or_lib}_mpir_gc.vcxproj") ] if self.options.get_safe("enable_cxx"): - vcxproj_paths.append(os.path.join(self._source_subfolder, build_subdir, + vcxproj_paths.append(os.path.join(self.source_folder, build_subdir, "lib_mpir_cxx", "lib_mpir_cxx.vcxproj")) return vcxproj_paths - def _build_visual_studio(self): - if not self.options.shared: # RuntimeLibrary only defined in lib props files + def _build_msvc(self): + if not self.options.shared: # RuntimeLibrary only defined in lib props files build_type = "debug" if self.settings.build_type == "Debug" else "release" - props_path = os.path.join(self._source_subfolder, "build.vc", - "mpir_{}_lib.props".format(build_type)) - old_runtime = "MultiThreaded{}".format( - "Debug" if build_type == "debug" else "", - ) + props_path = os.path.join(self.source_folder, "build.vc", f"mpir_{build_type}_lib.props") + old_runtime = "MultiThreaded{}".format("Debug" if build_type == "debug" else "") new_runtime = "MultiThreaded{}{}".format( "Debug" if "d" in msvc_runtime_flag(self) else "", - "DLL" if "MD" in msvc_runtime_flag(self) else "", + "DLL" if not is_msvc_static_runtime(self) else "", ) replace_in_file(self, props_path, old_runtime, new_runtime) msbuild = MSBuild(self) for vcxproj_path in self._vcxproj_paths: - msbuild.build(vcxproj_path, platforms=self._platforms, upgrade_project=False) - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "apple-clang": - env_build = {"CC": tools.XCRun(self.settings).cc, - "CXX": tools.XCRun(self.settings).cxx} - if hasattr(self, "settings_build"): - # there is no CFLAGS_FOR_BUILD/CXXFLAGS_FOR_BUILD - xcrun = tools.XCRun(self.settings_build) - flags = " -Wno-implicit-function-declaration -isysroot {} -arch {}".format(xcrun.sdk_path, tools.to_apple_arch(self.settings_build.arch)) - env_build["CC_FOR_BUILD"] = xcrun.cc + flags - env_build["CXX_FOR_BUILD"] = xcrun.cxx + flags - with tools.environment_append(env_build): - yield - else: - yield - - def _configure_autotools(self): - if not self._autotools: - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - args = [] - if self.options.shared: - args.extend(["--disable-static", "--enable-shared"]) - else: - args.extend(["--disable-shared", "--enable-static"]) - args.append("--with-pic" if self.options.get_safe("fPIC", True) else "--without-pic") - - args.append("--disable-silent-rules") - args.append("--enable-cxx" if self.options.get_safe("enable_cxx") else "--disable-cxx") - args.append("--enable-gmpcompat" if self.options.enable_gmpcompat else "--disable-gmpcompat") - - # compiler checks are written for C89 but compilers that default to C99 treat implicit functions as error - self._autotools.flags.append("-Wno-implicit-function-declaration") - self._autotools.configure(args=args) - return self._autotools + msbuild.build(vcxproj_path) def _patch_new_msvc_version(self, ver, toolset): - new_dir = os.path.join(self._source_subfolder, f'build.vc{ver}') - copy(self, pattern="*", src=os.path.join(self._source_subfolder, 'build.vc15'), dst=new_dir) + new_dir = os.path.join(self.source_folder, f"build.vc{ver}") + copy(self, pattern="*", src=os.path.join(self.source_folder, "build.vc15"), dst=new_dir) for root, _, files in os.walk(new_dir): for file in files: @@ -167,6 +174,7 @@ def _patch_new_msvc_version(self, ver, toolset): replace_in_file(self, full_file, 'check_config $(Platform) $(Configuration) 15', f'check_config $(Platform) $(Configuration) {ver}', strict=False) def _patch_sources(self): + apply_conandata_patches(self) if is_msvc(self): self._patch_new_msvc_version(16, "v142") self._patch_new_msvc_version(17, "v143") @@ -174,20 +182,25 @@ def _patch_sources(self): def build(self): self._patch_sources() if is_msvc(self): - self._build_visual_studio() + self._build_msvc() else: - with chdir(self, self._source_subfolder), self._build_context(): + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.autoreconf() # relocatable shared lib on macOS replace_in_file(self, "configure", "-install_name \\$rpath/", "-install_name @rpath/") - autotools = self._configure_autotools() + autotools.configure() autotools.make() def package(self): - copy(self, "COPYING*", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, self._source_subfolder)) + copy(self, "COPYING*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) if is_msvc(self): - lib_folder = os.path.join(self.build_folder, self._source_subfolder, self._dll_or_lib, - self._platforms.get(str(self.settings.arch)), - str(self.settings.build_type)) + lib_folder = os.path.join( + self.source_folder, + self._dll_or_lib, + self._platforms.get(str(self.settings.arch)), + str(self.settings.build_type), + ) include_folder = os.path.join(self.package_folder, "include") copy(self, "mpir.h", dst=include_folder, src=lib_folder, keep_path=True) if self.options.enable_gmpcompat: @@ -196,11 +209,11 @@ def package(self): copy(self, "mpirxx.h", dst=include_folder, src=lib_folder, keep_path=True) if self.options.enable_gmpcompat: copy(self, "gmpxx.h", dst=include_folder, src=lib_folder, keep_path=True) - copy(self, pattern="*.dll*", dst=os.path.join(self.package_folder, "bin"), src=lib_folder, keep_path=False) - copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=lib_folder, keep_path=False) + copy(self, "*.dll*", dst=os.path.join(self.package_folder, "bin"), src=lib_folder, keep_path=False) + copy(self, "*.lib", dst=os.path.join(self.package_folder, "lib"), src=lib_folder, keep_path=False) else: - with chdir(self, self._source_subfolder), self._build_context(): - autotools = self._configure_autotools() + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.install() rmdir(self, os.path.join(self.package_folder, "share")) rm(self, "*.la", os.path.join(self.package_folder, "lib")) diff --git a/recipes/mpir/all/patches/fix_xcode_12_configure.patch b/recipes/mpir/all/patches/fix_xcode_12_configure.patch new file mode 100644 index 00000000000000..13454c5f7d3212 --- /dev/null +++ b/recipes/mpir/all/patches/fix_xcode_12_configure.patch @@ -0,0 +1,113 @@ +From bbc43ca6ae0bec4f64e69c9cd4c967005d6470eb Mon Sep 17 00:00:00 2001 +From: Mitchell Blank Jr +Date: Mon, 21 Dec 2020 12:05:19 +0000 +Subject: [PATCH] Fix configure failures with Xcode12 + +Changes are needed becuase Xcode12 includes a default of +-Werror,-Wimplicit-function-declaration which means that +even something like calling "exit(0);" is a compile failure +if you haven't done a "#include " first (as C99 +requires, but most other compilers will just warn about) + +I don't know if the "long long reliability test 2" test which +tries to provoke a crash on a particular gcc 3.3 build still +does what it was originally intended to do with my change. +Of course, I doubt anyone has tried to use that compiler in +years. + +Fixes #290 +--- + acinclude.m4 | 24 +++++++++++++----------- + 1 file changed, 13 insertions(+), 11 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 91c35bc23..620a629ef 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -589,9 +589,9 @@ extern + #endif + __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) + {t1 c,x,r;int i;if(v0){c=1;for(i=1;iconftest.c <conftest.c < + int + main () + { +- exit(0); ++ return 0; + } + double d; + double diff --git a/recipes/mpir/all/test_package/CMakeLists.txt b/recipes/mpir/all/test_package/CMakeLists.txt index d64654ce1f75ac..532d088505a3ef 100644 --- a/recipes/mpir/all/test_package/CMakeLists.txt +++ b/recipes/mpir/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(mpir CONFIG REQUIRED) +find_package(mpir REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} mpir::mpir) diff --git a/recipes/mpir/all/test_package/conanfile.py b/recipes/mpir/all/test_package/conanfile.py index 2490acfa82ff81..ef5d7042163ecc 100644 --- a/recipes/mpir/all/test_package/conanfile.py +++ b/recipes/mpir/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building +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 requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): 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) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mpir/all/test_v1_package/CMakeLists.txt b/recipes/mpir/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/mpir/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/recipes/mpir/all/test_v1_package/conanfile.py b/recipes/mpir/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..2490acfa82ff81 --- /dev/null +++ b/recipes/mpir/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/recipes/msgpack-cxx/all/conandata.yml b/recipes/msgpack-cxx/all/conandata.yml index 6af577efebddf0..7f56a30465e393 100644 --- a/recipes/msgpack-cxx/all/conandata.yml +++ b/recipes/msgpack-cxx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.1.1": + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-6.1.1/msgpack-cxx-6.1.1.tar.gz" + sha256: "5fd555742e37bbd58d166199e669f01f743c7b3c6177191dd7b31fb0c37fa191" "6.1.0": url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-6.1.0/msgpack-cxx-6.1.0.tar.gz" sha256: "23ede7e93c8efee343ad8c6514c28f3708207e5106af3b3e4969b3a9ed7039e7" diff --git a/recipes/msgpack-cxx/config.yml b/recipes/msgpack-cxx/config.yml index 934a0432a27c72..ed41d0a75c6347 100644 --- a/recipes/msgpack-cxx/config.yml +++ b/recipes/msgpack-cxx/config.yml @@ -1,4 +1,6 @@ versions: + "6.1.1": + folder: all "6.1.0": folder: all "6.0.0": diff --git a/recipes/ninja/all/conandata.yml b/recipes/ninja/all/conandata.yml index 02891869efb974..1d5bfd04329472 100644 --- a/recipes/ninja/all/conandata.yml +++ b/recipes/ninja/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "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" diff --git a/recipes/ninja/config.yml b/recipes/ninja/config.yml index 0a0061dfb232df..cad99de344ea1e 100644 --- a/recipes/ninja/config.yml +++ b/recipes/ninja/config.yml @@ -1,4 +1,6 @@ versions: + "1.12.0": + folder: all "1.11.1": folder: all "1.11.0": diff --git a/recipes/nmos-cpp/all/conanfile.py b/recipes/nmos-cpp/all/conanfile.py index c34c0db4db93cf..82bc34f86af529 100644 --- a/recipes/nmos-cpp/all/conanfile.py +++ b/recipes/nmos-cpp/all/conanfile.py @@ -57,7 +57,6 @@ def requirements(self): self.requires("openssl/[>=1.1 <4]") self.requires("json-schema-validator/2.3.0") self.requires("nlohmann_json/3.11.3") - self.requires("zlib/[>=1.2.11 <2]") if Version(self.version) >= "cci.20240222": self.requires("jwt-cpp/0.7.0") @@ -127,7 +126,7 @@ def _create_components_file_from_cmake_target_file(self, target_file_path): target_content = files.load(self, target_file_path) - cmake_functions = re.findall(r"(?Padd_library|set_target_properties)[\n|\s]*\([\n|\s]*(?P[^)]*)\)", target_content) + cmake_functions = re.findall(r"(?Padd_executable|add_library|set_target_properties)[\n|\s]*\([\n|\s]*(?P[^)]*)\)", 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) @@ -140,7 +139,9 @@ def _create_components_file_from_cmake_target_file(self, target_file_path): components.setdefault(component_name, {"cmake_target": cmake_target_nonamespace}) - if cmake_function_name == "add_library": + if cmake_function_name == "add_executable": + components[component_name]["exe"] = True + elif cmake_function_name == "add_library": cmake_imported_target_type = cmake_function_args[1] if cmake_imported_target_type in ["STATIC", "SHARED"]: # library filenames are based on the target name by default @@ -211,6 +212,11 @@ def _create_components_file_from_cmake_target_file(self, target_file_path): else: self.output.warn(f"{self.name} recipe does not handle {property_type} (yet)") + # until https://github.com/sony/nmos-cpp/commit/9489d84098ddc8cc514b7e4d5afe740dee4518ee + # direct dependency on nlohmann_json was missing + if Version(self.version) < "cci.20221203": + components["json_schema_validator"].setdefault("requires", []).append("nlohmann_json::nlohmann_json") + # Save components informations in json file with open(self._components_helper_filepath, "w", encoding="utf-8") as json_file: json.dump(components, json_file, indent=4) @@ -229,7 +235,6 @@ def package_info(self): libdir = os.path.join(libdir, config_install_dir) self.cpp_info.bindirs = [bindir] self.cpp_info.libdirs = [libdir] - self.cpp_info.requires = ["nlohmann_json::nlohmann_json", "zlib::zlib"] def _register_components(): components_json_file = files.load(self, self._components_helper_filepath) @@ -238,6 +243,7 @@ def _register_components(): cmake_target = values["cmake_target"] self.cpp_info.components[component_name].names["cmake_find_package"] = cmake_target self.cpp_info.components[component_name].names["cmake_find_package_multi"] = cmake_target + self.cpp_info.components[component_name].bindirs = [bindir] if values.get("exe") else [] self.cpp_info.components[component_name].libs = values.get("libs", []) self.cpp_info.components[component_name].libdirs = [libdir] self.cpp_info.components[component_name].defines = values.get("defines", []) diff --git a/recipes/norm/all/conanfile.py b/recipes/norm/all/conanfile.py index 06df6975769c25..3d4877a41e6422 100644 --- a/recipes/norm/all/conanfile.py +++ b/recipes/norm/all/conanfile.py @@ -39,7 +39,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libxml2/2.12.3") # dependency of protolib actually + self.requires("libxml2/[>=2.12.5 <3]") # dependency of protolib actually def source(self): get(self, **self.conan_data["sources"][self.version]) diff --git a/recipes/nsync/all/conandata.yml b/recipes/nsync/all/conandata.yml index b694103d49b84e..f620b793bde604 100644 --- a/recipes/nsync/all/conandata.yml +++ b/recipes/nsync/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.27.0": + url: "https://github.com/google/nsync/archive/1.27.0.tar.gz" + sha256: "e8e552a358f4a28e844207a7c5cb51767e4aeb0b29e22d23ac2a09924130f761" "1.26.0": url: "https://github.com/google/nsync/archive/1.26.0.tar.gz" sha256: "80fc1e605bb3cf5f272811ece39c4fb6761ffcb9b30563301845cc9ff381eb8b" @@ -12,6 +15,8 @@ sources: sha256: "b7e75b17957c62bd02dd73890bde22da3a564903fcaad651b395453d41d3325b" url: "https://github.com/google/nsync/archive/refs/tags/1.23.0.tar.gz" patches: + "1.27.0": + - patch_file: "patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" "1.26.0": - patch_file: "patches/0001-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" "1.25.0": diff --git a/recipes/nsync/all/patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch b/recipes/nsync/all/patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch new file mode 100644 index 00000000000000..1f3fd759993357 --- /dev/null +++ b/recipes/nsync/all/patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -125,7 +125,6 @@ + ${NSYNC_OS_CPP_SRC} + "platform/c++11/src/nsync_semaphore_mutex.cc" + "platform/posix/src/clock_gettime.c" +- "platform/posix/src/nsync_semaphore_mutex.c" + ) + elseif ("${CMAKE_SYSTEM_NAME}X" STREQUAL "LinuxX") + set (NSYNC_POSIX ON) diff --git a/recipes/nsync/config.yml b/recipes/nsync/config.yml index 960f98574a7081..b5fdbb8ed55be4 100644 --- a/recipes/nsync/config.yml +++ b/recipes/nsync/config.yml @@ -1,4 +1,6 @@ versions: + "1.27.0": + folder: "all" "1.26.0": folder: "all" "1.25.0": diff --git a/recipes/nvcloth/1.1.6/CMakeLists.txt b/recipes/nvcloth/1.1.6/CMakeLists.txt index a236130272a845..4cd8eda7866f88 100644 --- a/recipes/nvcloth/1.1.6/CMakeLists.txt +++ b/recipes/nvcloth/1.1.6/CMakeLists.txt @@ -1,7 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) +# Using a CMake wrapper because the project's CMakeLists.txt does not set project() +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper CXX) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder/NvCloth/compiler/cmake/${TARGET_BUILD_PLATFORM}") +add_subdirectory("src/NvCloth/compiler/cmake/${TARGET_BUILD_PLATFORM}") diff --git a/recipes/nvcloth/1.1.6/conandata.yml b/recipes/nvcloth/1.1.6/conandata.yml index c37596cc7f7b66..657fa6c95ca38c 100644 --- a/recipes/nvcloth/1.1.6/conandata.yml +++ b/recipes/nvcloth/1.1.6/conandata.yml @@ -5,8 +5,5 @@ sources: patches: "1.1.6": - patch_file: "patches/0001-PsAllocator-include-typeinfo.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-CallbackFix.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-PsAllocator.patch" - base_path: "source_subfolder" diff --git a/recipes/nvcloth/1.1.6/conanfile.py b/recipes/nvcloth/1.1.6/conanfile.py index c303576ad28c2a..abfae884a66d8d 100644 --- a/recipes/nvcloth/1.1.6/conanfile.py +++ b/recipes/nvcloth/1.1.6/conanfile.py @@ -1,175 +1,152 @@ import os import shutil -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -from conan.tools.microsoft import msvc_runtime_flag, is_msvc_static_runtime, is_msvc +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.env import Environment +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_static_runtime + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.35.0" class NvclothConan(ConanFile): name = "nvcloth" + description = "NvCloth is a library that provides low level access to a cloth solver designed for realtime interactive applications." license = "Nvidia Source Code License (1-Way Commercial)" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/NVIDIAGameWorks/NvCloth" - description = "NvCloth is a library that provides low level access to a cloth solver designed for realtime interactive applications." topics = ("physics", "physics-engine", "physics-simulation", "game-development", "cuda") - # Binary configuration - settings = "os", "compiler", "build_type", "arch" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "use_cuda": [True, False], - "use_dx11": [True, False] + "use_dx11": [True, False], } default_options = { "shared": False, "fPIC": True, "use_cuda": False, - "use_dx11": False + "use_dx11": False, } - generators = "cmake" + def export_sources(self): + export_conandata_patches(self) + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) - @property - def _source_subfolder(self): - return "source_subfolder" + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC - @property - def _build_subfolder(self): - return "build_subfolder" - - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") - 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 validate(self): - if self.settings.os not in ["Windows", "Linux", "Macos", "Android", "iOS"]: - raise ConanInvalidConfiguration("Current os is not supported") + if self.settings.os not in ["Windows", "Linux", "FreeBSD", "Macos", "Android", "iOS"]: + raise ConanInvalidConfiguration(f"{self.settings.os} is not supported") - build_type = self.settings.build_type - if build_type not in ["Debug", "RelWithDebInfo", "Release"]: - raise ConanInvalidConfiguration("Current build_type is not supported") + if self.settings.os in ["Windows", "Macos"] and not self.options.shared: + raise ConanInvalidConfiguration(f"Static builds are not supported on {self.settings.os}") + if self.settings.os in ["iOS", "Android"] and self.options.shared: + raise ConanInvalidConfiguration(f"Shared builds are not supported on {self.settings.os}") - if is_msvc(self) and tools.Version(self.settings.compiler.version) < 9: - raise ConanInvalidConfiguration("Visual Studio versions < 9 are not supported") + if self.settings.build_type not in ["Debug", "RelWithDebInfo", "Release"]: + raise ConanInvalidConfiguration(f"{self.settings.build_type} build_type is not supported") - def _configure_cmake(self): - cmake = CMake(self) - if not self.options.shared: - cmake.definitions["PX_STATIC_LIBRARIES"] = 1 - cmake.definitions["STATIC_WINCRT"] = is_msvc_static_runtime(self) + check_min_vs(self, 150) + check_min_cppstd(self, 11) - cmake.definitions["NV_CLOTH_ENABLE_CUDA"] = self.options.use_cuda - cmake.definitions["NV_CLOTH_ENABLE_DX11"] = self.options.use_dx11 + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - cmake.definitions["TARGET_BUILD_PLATFORM"] = self._get_target_build_platform() + @property + def _target_build_platform(self): + return { + "Windows": "windows", + "Linux": "linux", + "Macos": "mac", + "Android": "android", + "iOS": "ios", + }.get(str(self.settings.os)) + + def generate(self): + tc = CMakeToolchain(self) + if not self.options.shared: + tc.variables["PX_STATIC_LIBRARIES"] = 1 + tc.variables["STATIC_WINCRT"] = is_msvc_static_runtime(self) + tc.variables["NV_CLOTH_ENABLE_CUDA"] = self.options.use_cuda + tc.variables["NV_CLOTH_ENABLE_DX11"] = self.options.use_dx11 + tc.variables["TARGET_BUILD_PLATFORM"] = self._target_build_platform + tc.generate() + + env = Environment() + env.define_path("GW_DEPS_ROOT", self.source_folder) + env.vars(self).save_script("conan_build_vars") - cmake.configure( - build_folder=os.path.join(self.build_folder, self._build_subfolder) - ) - return cmake - def _remove_samples(self): - tools.rmdir(os.path.join(self._source_subfolder, "NvCloth", "samples")) + rmdir(self, os.path.join(self.source_folder, "NvCloth", "samples")) def _patch_sources(self): # There is no reason to force consumer of PhysX public headers to use one of # NDEBUG or _DEBUG, since none of them relies on NDEBUG or _DEBUG - tools.replace_in_file(os.path.join(self.build_folder, self._source_subfolder, "PxShared", "include", "foundation", "PxPreprocessor.h"), - "#error Exactly one of NDEBUG and _DEBUG needs to be defined!", - "// #error Exactly one of NDEBUG and _DEBUG needs to be defined!") - shutil.copy( - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h"), - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h.origin") - ) - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - - if self.settings.build_type == "Debug": - shutil.copy( - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h"), - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h.patched") - ) - shutil.copy( - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h.origin"), - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h") - ) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + replace_in_file(self, os.path.join(self.source_folder, "PxShared", "include", "foundation", "PxPreprocessor.h"), + "#error Exactly one of NDEBUG and _DEBUG needs to be defined!", + "// #error Exactly one of NDEBUG and _DEBUG needs to be defined!") + shutil.copy(os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h"), + os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h.origin")) + apply_conandata_patches(self) - def configure(self): - if self.options.shared: - del self.options.fPIC + if self.settings.build_type == "Debug": + shutil.copy(os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h"), + os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h.patched")) + shutil.copy(os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h.origin"), + os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h")) def build(self): - with tools.environment_append({"GW_DEPS_ROOT": os.path.abspath(self._source_subfolder)}): - self._patch_sources() - self._remove_samples() - cmake = self._configure_cmake() - cmake.build() - - def _get_build_type(self): - if self.settings.build_type == "Debug": - return "debug" - elif self.settings.build_type == "RelWithDebInfo": - return "checked" - elif self.settings.build_type == "Release": - return "release" - - def _get_target_build_platform(self): - return { - "Windows" : "windows", - "Linux" : "linux", - "Macos" : "mac", - "Android" : "android", - "iOS" : "ios" - }.get(str(self.settings.os)) + self._patch_sources() + self._remove_samples() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) + cmake.build() def package(self): if self.settings.build_type == "Debug": - shutil.copy( - os.path.join(self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h.patched"), - os.path.join(self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h") - ) - nvcloth_source_subfolder = os.path.join(self.build_folder, self._source_subfolder) - nvcloth_build_subfolder = os.path.join(self.build_folder, self._build_subfolder) - - self.copy(pattern="NvCloth/license.txt", dst="licenses", src=nvcloth_source_subfolder, keep_path=False) - self.copy("*.h", dst="include", src=os.path.join(nvcloth_source_subfolder, "NvCloth", "include")) - self.copy("*.h", dst="include", src=os.path.join(nvcloth_source_subfolder, "NvCloth", "extensions", "include")) - self.copy("*.h", dst="include", src=os.path.join(nvcloth_source_subfolder, "PxShared", "include")) - self.copy("*.a", dst="lib", src=nvcloth_build_subfolder, keep_path=False) - self.copy("*.lib", dst="lib", src=nvcloth_build_subfolder, keep_path=False) - self.copy("*.dylib*", dst="lib", src=nvcloth_build_subfolder, keep_path=False) - self.copy("*.dll", dst="bin", src=nvcloth_build_subfolder, keep_path=False) - self.copy("*.so", dst="lib", src=nvcloth_build_subfolder, keep_path=False) + shutil.copy(os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h.patched"), + os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h")) + copy(self, "NvCloth/license.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder, keep_path=False) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "NvCloth", "include")) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "NvCloth", "extensions", "include")) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "PxShared", "include")) + copy(self, "*.a", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, "*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, "*.dylib*", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, "*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder, keep_path=False) + copy(self, "*.so", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "nvcloth" - self.cpp_info.names["cmake_find_package_multi"] = "nvcloth" + self.cpp_info.set_property("cmake_file_name", "nvcloth") + self.cpp_info.set_property("cmake_target_name", "nvcloth::nvcloth") if self.settings.build_type == "Debug": debug_suffix = "DEBUG" else: debug_suffix = "" - if self.settings.os == "Windows": - if self.settings.arch == "x86_64": - arch_suffix = "x64" - else: - arch_suffix = "" - self.cpp_info.libs = ["NvCloth{}_{}".format(debug_suffix, arch_suffix)] + if self.settings.os == "Windows" and self.settings.arch == "x86_64": + arch_suffix = "_x64" else: - self.cpp_info.libs = ["NvCloth{}".format(debug_suffix)] + arch_suffix = "" - if not self.options.shared: - if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.system_libs.append("m") + self.cpp_info.libs = [f"NvCloth{debug_suffix}{arch_suffix}"] + + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs.append("m") diff --git a/recipes/nvcloth/1.1.6/test_package/CMakeLists.txt b/recipes/nvcloth/1.1.6/test_package/CMakeLists.txt index e0165aeedb7a26..d8a9e2773d7d6d 100644 --- a/recipes/nvcloth/1.1.6/test_package/CMakeLists.txt +++ b/recipes/nvcloth/1.1.6/test_package/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(nvcloth REQUIRED CONFIG) find_package(nvcloth REQUIRED nvcloth CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} nvcloth::nvcloth) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/nvcloth/1.1.6/test_package/conanfile.py b/recipes/nvcloth/1.1.6/test_package/conanfile.py index e290e81a631faa..ef5d7042163ecc 100644 --- a/recipes/nvcloth/1.1.6/test_package/conanfile.py +++ b/recipes/nvcloth/1.1.6/test_package/conanfile.py @@ -1,9 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class NvClothTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + +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) @@ -11,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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nvcloth/1.1.6/test_v1_package/CMakeLists.txt b/recipes/nvcloth/1.1.6/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/nvcloth/1.1.6/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/recipes/nvcloth/1.1.6/test_v1_package/conanfile.py b/recipes/nvcloth/1.1.6/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..e290e81a631faa --- /dev/null +++ b/recipes/nvcloth/1.1.6/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class NvClothTestConan(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/recipes/octo-logger-cpp/all/conandata.yml b/recipes/octo-logger-cpp/all/conandata.yml index 92395bec9bd216..da0e55d721a426 100644 --- a/recipes/octo-logger-cpp/all/conandata.yml +++ b/recipes/octo-logger-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.1": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.6.1.tar.gz" + sha256: "02c1d5303d8c129cb2527a92d49677229230a5feaec002791f96d47de3bccb5a" "1.5.0": url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.5.0.tar.gz" sha256: "e62e4a54700f7c235111fd2b75c51d96f0b4deaf2c24ce7bc9ef1751ce31ea20" diff --git a/recipes/octo-logger-cpp/config.yml b/recipes/octo-logger-cpp/config.yml index 76947dd2891c25..c67832833d08ae 100644 --- a/recipes/octo-logger-cpp/config.yml +++ b/recipes/octo-logger-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.1": + folder: "all" "1.5.0": folder: "all" "1.4.0": diff --git a/recipes/octomap/all/conandata.yml b/recipes/octomap/all/conandata.yml index 4699a071746f81..24483c3d1fc425 100644 --- a/recipes/octomap/all/conandata.yml +++ b/recipes/octomap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.10.0": + url: "https://github.com/OctoMap/octomap/archive/v1.10.0.tar.gz" + sha256: "8da2576ec6a0993e8900db7f91083be8682d8397a7be0752c85d1b7dd1b8e992" "1.9.8": url: "https://github.com/OctoMap/octomap/archive/v1.9.8.tar.gz" sha256: "417af6da4e855e9a83b93458aa98b01a2c88f880088baad2b59d323ce162586e" @@ -15,6 +18,10 @@ sources: url: "https://github.com/OctoMap/octomap/archive/v1.9.3.tar.gz" sha256: "8488de97ed2c8f4757bfbaf3225e82a9e36783dce1f573b3bde1cf968aa89696" patches: + "1.10.0": + - patch_file: "patches/1.10.0-0001-separate-static-shared-build.patch" + patch_description: "CMake: build either shared or static" + patch_type: "conan" "1.9.8": - patch_file: "patches/1.9.5-0001-targets-outputname-collision.patch" patch_description: "CMake: build either shared or static, and avoid name collision" diff --git a/recipes/octomap/all/conanfile.py b/recipes/octomap/all/conanfile.py index 52d010aca9b55a..ced4e906103b01 100644 --- a/recipes/octomap/all/conanfile.py +++ b/recipes/octomap/all/conanfile.py @@ -4,12 +4,12 @@ from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd import os import textwrap required_conan_version = ">=1.53.0" - class OctomapConan(ConanFile): name = "octomap" description = "An Efficient Probabilistic 3D Mapping Framework Based on Octrees." @@ -31,6 +31,10 @@ class OctomapConan(ConanFile): "openmp": False, } + @property + def _min_cppstd(self): + return 11 + def export_sources(self): export_conandata_patches(self) @@ -49,6 +53,9 @@ def validate(self): if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("shared octomap doesn't support MT runtime") + if Version(self.version) >= "1.10.0" and self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -58,6 +65,8 @@ def generate(self): tc.variables["BUILD_TESTING"] = False if is_msvc(self) and self.options.shared: tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + if Version(self.version) >= "1.10.0": + tc.variables["CMAKE_CXX_STANDARD"] = self.settings.compiler.get_safe("cppstd", "11").replace("gnu", "") tc.generate() def _patch_sources(self): diff --git a/recipes/octomap/all/patches/1.10.0-0001-separate-static-shared-build.patch b/recipes/octomap/all/patches/1.10.0-0001-separate-static-shared-build.patch new file mode 100644 index 00000000000000..bf38e33037d868 --- /dev/null +++ b/recipes/octomap/all/patches/1.10.0-0001-separate-static-shared-build.patch @@ -0,0 +1,120 @@ +diff --git a/octomap/src/CMakeLists.txt b/octomap/src/CMakeLists.txt +index 45b384f..e870608 100644 +--- a/octomap/src/CMakeLists.txt ++++ b/octomap/src/CMakeLists.txt +@@ -11,24 +11,32 @@ SET (octomap_SRCS + ) + + # dynamic and static libs, see CMake FAQ: ++if(BUILD_SHARED_LIBS) + ADD_LIBRARY( octomap SHARED ${octomap_SRCS}) + set_target_properties( octomap PROPERTIES + VERSION ${OCTOMAP_VERSION} + SOVERSION ${OCTOMAP_SOVERSION} + ) ++TARGET_LINK_LIBRARIES(octomap octomath) ++else() + ADD_LIBRARY( octomap-static STATIC ${octomap_SRCS}) + SET_TARGET_PROPERTIES(octomap-static PROPERTIES OUTPUT_NAME "octomap") + add_dependencies(octomap-static octomath-static) +- +-TARGET_LINK_LIBRARIES(octomap octomath) ++TARGET_LINK_LIBRARIES(octomap-static octomath-static) ++endif() + + if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + endif() + +-export(TARGETS octomap octomap-static ++if(BUILD_SHARED_LIBS) ++export(TARGETS octomap + APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") +- ++else() ++export(TARGETS octomap-static ++ APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") ++endif() ++if(0) + ADD_SUBDIRECTORY( testing ) + + ADD_EXECUTABLE(graph2tree graph2tree.cpp) +@@ -66,14 +74,22 @@ TARGET_LINK_LIBRARIES(intersection_example octomap) + + ADD_EXECUTABLE(octree2pointcloud octree2pointcloud.cpp) + TARGET_LINK_LIBRARIES(octree2pointcloud octomap) +- +-install(TARGETS octomap octomap-static ++endif() ++if(BUILD_SHARED_LIBS) ++install(TARGETS octomap + EXPORT octomap-targets + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ${INSTALL_TARGETS_DEFAULT_ARGS} + ) ++else() ++install(TARGETS octomap-static ++ EXPORT octomap-targets ++ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ++ ${INSTALL_TARGETS_DEFAULT_ARGS} ++) ++endif() + install(EXPORT octomap-targets DESTINATION "${CMAKE_INSTALL_DATADIR}/octomap") +- ++if(0) + install(TARGETS + graph2tree + log2graph +@@ -85,4 +101,4 @@ install(TARGETS + compare_octrees + ${INSTALL_TARGETS_DEFAULT_ARGS} + ) +- ++endif() +diff --git a/octomap/src/math/CMakeLists.txt b/octomap/src/math/CMakeLists.txt +index 3b47ec4..596f7d8 100644 +--- a/octomap/src/math/CMakeLists.txt ++++ b/octomap/src/math/CMakeLists.txt +@@ -4,26 +4,37 @@ SET (octomath_SRCS + Pose6D.cpp + ) + +- ++if(BUILD_SHARED_LIBS) + ADD_LIBRARY( octomath SHARED ${octomath_SRCS}) + + SET_TARGET_PROPERTIES( octomath PROPERTIES + VERSION ${OCTOMAP_VERSION} + SOVERSION ${OCTOMAP_SOVERSION} + ) +- ++else() + ADD_LIBRARY( octomath-static STATIC ${octomath_SRCS}) + SET_TARGET_PROPERTIES(octomath-static PROPERTIES OUTPUT_NAME "octomath") +- ++endif() + if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + endif() + +-export(TARGETS octomath octomath-static ++if(BUILD_SHARED_LIBS) ++export(TARGETS octomath + APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") + +-install(TARGETS octomath octomath-static ++install(TARGETS octomath + EXPORT octomap-targets + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ${INSTALL_TARGETS_DEFAULT_ARGS} + ) ++else() ++export(TARGETS octomath-static ++ APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") ++ ++install(TARGETS octomath-static ++ EXPORT octomap-targets ++ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ++ ${INSTALL_TARGETS_DEFAULT_ARGS} ++) ++endif() diff --git a/recipes/octomap/all/test_package/CMakeLists.txt b/recipes/octomap/all/test_package/CMakeLists.txt index bb595de7484c4f..4ec2de09236c3e 100644 --- a/recipes/octomap/all/test_package/CMakeLists.txt +++ b/recipes/octomap/all/test_package/CMakeLists.txt @@ -9,3 +9,7 @@ if(TARGET octomap-static) else() target_link_libraries(${PROJECT_NAME} PRIVATE octomap octomath) endif() + +if(octomap_VERSION VERSION_GREATER_EQUAL "1.10.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/octomap/config.yml b/recipes/octomap/config.yml index 7b6ae3353a6fd9..83dd314d86186c 100644 --- a/recipes/octomap/config.yml +++ b/recipes/octomap/config.yml @@ -1,4 +1,6 @@ versions: + "1.10.0": + folder: all "1.9.8": folder: all "1.9.7": diff --git a/recipes/onetbb/all/conandata.yml b/recipes/onetbb/all/conandata.yml index 4839476518f75e..d6288f698e49a0 100644 --- a/recipes/onetbb/all/conandata.yml +++ b/recipes/onetbb/all/conandata.yml @@ -1,4 +1,7 @@ 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" diff --git a/recipes/onetbb/all/conanfile.py b/recipes/onetbb/all/conanfile.py index b0c66b51e58565..7031f90417a736 100644 --- a/recipes/onetbb/all/conanfile.py +++ b/recipes/onetbb/all/conanfile.py @@ -3,7 +3,7 @@ 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 +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 @@ -52,7 +52,7 @@ def _tbbbind_hwloc_version(self): @property def _tbbbind_supported(self): - return self.settings.os != "Macos" + return self.settings.os != "Macos" or Version(self.version) >= "2021.11.0" @property def _tbbbind_build(self): @@ -120,7 +120,9 @@ def generate(self): 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.so" + 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"] = \ @@ -147,6 +149,7 @@ def package(self): 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") diff --git a/recipes/onetbb/config.yml b/recipes/onetbb/config.yml index 39b37264743028..4ef9dafa04d031 100644 --- a/recipes/onetbb/config.yml +++ b/recipes/onetbb/config.yml @@ -1,4 +1,6 @@ versions: + "2021.12.0": + folder: all "2021.10.0": folder: all "2021.9.0": diff --git a/recipes/onnx/all/conandata.yml b/recipes/onnx/all/conandata.yml index ccb0c203d72392..f058303147df0b 100644 --- a/recipes/onnx/all/conandata.yml +++ b/recipes/onnx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.16.0": + url: "https://github.com/onnx/onnx/archive/v1.16.0.tar.gz" + sha256: "0ce153e26ce2c00afca01c331a447d86fbf21b166b640551fe04258b4acfc6a4" "1.15.0": url: "https://github.com/onnx/onnx/archive/v1.15.0.tar.gz" sha256: "c757132e018dd0dd171499ef74fca88b74c5430a20781ec53da19eb7f937ef68" @@ -11,9 +14,3 @@ sources: "1.13.1": url: "https://github.com/onnx/onnx/archive/refs/tags/v1.13.1.tar.gz" sha256: "090d3e10ec662a98a2a72f1bf053f793efc645824f0d4b779e0ce47468a0890e" - "1.12.0": - url: "https://github.com/onnx/onnx/archive/refs/tags/v1.12.0.tar.gz" - sha256: "052ad3d5dad358a33606e0fc89483f8150bb0655c99b12a43aa58b5b7f0cc507" -patches: - "1.12.0": - - patch_file: "patches/0001-fix-concurrent-proto3-remove-1.12.0.patch" diff --git a/recipes/onnx/all/conanfile.py b/recipes/onnx/all/conanfile.py index 4c5cfb0ecfc0d6..02c220e3798ce9 100644 --- a/recipes/onnx/all/conanfile.py +++ b/recipes/onnx/all/conanfile.py @@ -49,10 +49,19 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): + if Version(self.version) < "1.16.0": + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "5", + "apple-clang": "10", + } + # 1.16.0+ requires header available with gcc8+ return { "Visual Studio": "15", "msvc": "191", - "gcc": "7", + "gcc": "8", "clang": "5", "apple-clang": "10", } @@ -113,9 +122,6 @@ def generate(self): tc.variables["ONNX_BUILD_TESTS"] = False tc.variables["ONNX_USE_LITE_PROTO"] = self.dependencies.host["protobuf"].options.lite tc.variables["ONNX_ML"] = True - if Version(self.version) < "1.13.0": - tc.variables["ONNXIFI_ENABLE_EXT"] = False - tc.variables["ONNXIFI_DUMMY_BACKEND"] = False tc.variables["ONNX_VERIFY_PROTO3"] = Version(self.dependencies.host["protobuf"].ref.version).major == "3" if is_msvc(self): tc.variables["ONNX_USE_MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) @@ -174,28 +180,6 @@ def _onnx_components(self): "requires": ["protobuf::libprotobuf"] } } - if Version(self.version) < "1.13.0": - components.update( - { - "onnxifi": { - "target": "onnxifi", - "system_libs": [(self.settings.os in ["Linux", "FreeBSD"], ["dl"])], - }, - "onnxifi_dummy": { - "target": "onnxifi_dummy", - "libs": ["onnxifi_dummy"], - "requires": ["onnxifi"] - }, - "onnxifi_loader": { - "target": "onnxifi_loader", - "libs": ["onnxifi_loader"], - "requires": ["onnxifi"] - }, - "onnxifi_wrapper": { - "target": "onnxifi_wrapper" - } - } - ) components["libonnx"]["defines"].append("__STDC_FORMAT_MACROS") return components diff --git a/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.12.0.patch b/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.12.0.patch deleted file mode 100644 index 1ce9c915aa488e..00000000000000 --- a/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.12.0.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/onnx/gen_proto.py -+++ b/onnx/gen_proto.py -@@ -159,7 +159,7 @@ def convert(stem: str, package_name: str, output: str, do_onnx_ml: bool = False, - porto3_dir = os.path.dirname(proto3) - base_dir = os.path.dirname(porto3_dir) - gen_proto3_code(protoc_path, proto3, base_dir, base_dir, base_dir) -- pb3_files = glob.glob(os.path.join(porto3_dir, '*.proto3.*')) -+ pb3_files = glob.glob(os.path.join(porto3_dir, '{}.proto3.*'.format(proto_base))) - for pb3_file in pb3_files: - print(f"Removing {pb3_file}") - os.remove(pb3_file) diff --git a/recipes/onnx/config.yml b/recipes/onnx/config.yml index 669807aa7c0eb3..075fe1cfd61f08 100644 --- a/recipes/onnx/config.yml +++ b/recipes/onnx/config.yml @@ -1,4 +1,6 @@ versions: + "1.16.0": + folder: all "1.15.0": folder: all "1.14.1": @@ -7,5 +9,3 @@ versions: folder: all "1.13.1": folder: all - "1.12.0": - folder: all diff --git a/recipes/openal-soft/all/conandata.yml b/recipes/openal-soft/all/conandata.yml index 104b16635107ed..23bf0e0ad99768 100644 --- a/recipes/openal-soft/all/conandata.yml +++ b/recipes/openal-soft/all/conandata.yml @@ -1,38 +1,16 @@ sources: + "1.23.1": + url: + - "https://github.com/kcat/openal-soft/releases/download/1.23.1/openal-soft-1.23.1.tar.bz2" + - "https://openal-soft.org/openal-releases/openal-soft-1.23.1.tar.bz2" + sha256: "796f4b89134c4e57270b7f0d755f0fa3435b90da437b745160a49bd41c845b21" "1.22.2": - url: "https://openal-soft.org/openal-releases/openal-soft-1.22.2.tar.bz2" + url: + - "https://github.com/kcat/openal-soft/releases/download/1.22.2/openal-soft-1.22.2.tar.bz2" + - "https://openal-soft.org/openal-releases/openal-soft-1.22.2.tar.bz2" sha256: "ae94cc95cda76b7cc6e92e38c2531af82148e76d3d88ce996e2928a1ea7c3d20" - "1.21.1": - url: "https://openal-soft.org/openal-releases/openal-soft-1.21.1.tar.bz2" - sha256: "c8ad767e9a3230df66756a21cc8ebf218a9d47288f2514014832204e666af5d8" - "1.21.0": - url: "https://openal-soft.org/openal-releases/openal-soft-1.21.0.tar.bz2" - sha256: "2916b4fc24e23b0271ce0b3468832ad8b6d8441b1830215b28cc4fee6cc89297" - "1.20.1": - url: "https://openal-soft.org/openal-releases/openal-soft-1.20.1.tar.bz2" - sha256: "b6ceb051325732c23f5c8b6d37dbd89534517e6439a87e970882b447c3025d6d" - "1.19.1": - url: "https://openal-soft.org/openal-releases/openal-soft-1.19.1.tar.bz2" - sha256: "5c2f87ff5188b95e0dc4769719a9d89ce435b8322b4478b95dd4b427fe84b2e9" patches: "1.22.2": - patch_file: "patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch" + patch_source: "https://github.com/kcat/openal-soft/commit/650a6d49e9a511d005171940761f6dd6b440ee66" - patch_file: "patches/1.22.2-0002-fix-pulseaudio-find-package-vars.patch" - "1.21.0": - - patch_file: "patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch" - - patch_file: "patches/1.21.0-0002-fix-windows-sdk.patch" - patch_description: "Avoid explicitly searching for the WindowsSDK" - patch_type: "portability" - patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" - "1.20.1": - - patch_file: "patches/1.20.1-0001-fix-windows-sdk.patch" - patch_description: "Avoid explicitly searching for the WindowsSDK" - patch_type: "portability" - patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" - "1.19.1": - - patch_file: "patches/1.19.1-0001-aligned-alloc.patch" - - patch_file: "patches/1.19.1-0002-gcc-10-fnocommon.patch" - - patch_file: "patches/1.19.1-0003-fix-windows-sdk.patch" - patch_description: "Avoid explicitly searching for the WindowsSDK" - patch_type: "portability" - patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" diff --git a/recipes/openal-soft/all/conanfile.py b/recipes/openal-soft/all/conanfile.py index 83f92f752bca9a..885d85434ec21e 100644 --- a/recipes/openal-soft/all/conanfile.py +++ b/recipes/openal-soft/all/conanfile.py @@ -29,20 +29,16 @@ class OpenALSoftConan(ConanFile): "fPIC": True, } - @property - def _openal_cxx_backend(self): - return Version(self.version) >= "1.20" - @property def _min_cppstd(self): - return "11" if Version(self.version) < "1.21" else "14" + return 14 @property def _minimum_compilers_version(self): return { - "Visual Studio": "13" if Version(self.version) < "1.21" else "15", - "msvc": "180" if Version(self.version) < "1.21" else "191", - "gcc": "5", + "Visual Studio": "15", + "msvc": "191", + "gcc": "6", "clang": "5", } @@ -59,8 +55,6 @@ def configure(self): # OpenAL's API is pure C, thus the c++ standard does not matter # Because the backend is C++, the C++ STL matters self.settings.rm_safe("compiler.cppstd") - if not self._openal_cxx_backend: - self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") @@ -70,23 +64,22 @@ def requirements(self): self.requires("libalsa/1.2.10") def validate(self): - if self._openal_cxx_backend: - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._min_cppstd) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - compiler = self.settings.compiler + compiler = self.settings.compiler - minimum_version = self._minimum_compilers_version.get(str(compiler), False) - if minimum_version and Version(compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", - ) + minimum_version = self._minimum_compilers_version.get(str(compiler), False) + if minimum_version and Version(compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) - if compiler == "clang" and Version(compiler.version) < "9" and \ - compiler.get_safe("libcxx") in ("libstdc++", "libstdc++11"): - raise ConanInvalidConfiguration( - f"{self.ref} cannot be built with {compiler} {compiler.version} and stdlibc++(11) c++ runtime", - ) + if compiler == "clang" and Version(compiler.version) < "9" and \ + compiler.get_safe("libcxx") in ("libstdc++", "libstdc++11"): + raise ConanInvalidConfiguration( + f"{self.ref} cannot be built with {compiler} {compiler.version} and stdlibc++(11) c++ runtime", + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -155,9 +148,11 @@ def package_info(self): self.cpp_info.frameworks.append("ApplicationServices") elif self.settings.os == "Windows": self.cpp_info.system_libs.extend(["winmm", "ole32", "shell32", "user32"]) - if self._openal_cxx_backend and not self.options.shared: + if not self.options.shared: libcxx = stdcpp_library(self) if libcxx: self.cpp_info.system_libs.append(libcxx) if not self.options.shared: self.cpp_info.defines.append("AL_LIBTYPE_STATIC") + if self.settings.get_safe("compiler.libcxx") in ["libstdc++", "libstdc++11"]: + self.cpp_info.system_libs.append("atomic") diff --git a/recipes/openal-soft/all/patches/1.19.1-0001-aligned-alloc.patch b/recipes/openal-soft/all/patches/1.19.1-0001-aligned-alloc.patch deleted file mode 100644 index f734aeb89945e2..00000000000000 --- a/recipes/openal-soft/all/patches/1.19.1-0001-aligned-alloc.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -546,7 +546,7 @@ IF(HAVE_INTRIN_H) - ENDIF() - - CHECK_SYMBOL_EXISTS(sysconf unistd.h HAVE_SYSCONF) --CHECK_SYMBOL_EXISTS(aligned_alloc stdlib.h HAVE_ALIGNED_ALLOC) -+#CHECK_SYMBOL_EXISTS(aligned_alloc stdlib.h HAVE_ALIGNED_ALLOC) - CHECK_SYMBOL_EXISTS(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) - CHECK_SYMBOL_EXISTS(_aligned_malloc malloc.h HAVE__ALIGNED_MALLOC) - CHECK_SYMBOL_EXISTS(proc_pidpath libproc.h HAVE_PROC_PIDPATH) diff --git a/recipes/openal-soft/all/patches/1.19.1-0002-gcc-10-fnocommon.patch b/recipes/openal-soft/all/patches/1.19.1-0002-gcc-10-fnocommon.patch deleted file mode 100644 index 1283ee70f8fe7a..00000000000000 --- a/recipes/openal-soft/all/patches/1.19.1-0002-gcc-10-fnocommon.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/Alc/bformatdec.h 2018-10-11 18:05:31.000000000 -0400 -+++ b/Alc/bformatdec.h 2020-10-10 21:01:08.842986977 -0400 -@@ -24,9 +24,9 @@ - /* NOTE: These are scale factors as applied to Ambisonics content. Decoder - * coefficients should be divided by these values to get proper N3D scalings. - */ --const ALfloat N3D2N3DScale[MAX_AMBI_COEFFS]; --const ALfloat SN3D2N3DScale[MAX_AMBI_COEFFS]; --const ALfloat FuMa2N3DScale[MAX_AMBI_COEFFS]; -+extern const ALfloat N3D2N3DScale[MAX_AMBI_COEFFS]; -+extern const ALfloat SN3D2N3DScale[MAX_AMBI_COEFFS]; -+extern const ALfloat FuMa2N3DScale[MAX_AMBI_COEFFS]; - - - struct AmbDecConf; diff --git a/recipes/openal-soft/all/patches/1.19.1-0003-fix-windows-sdk.patch b/recipes/openal-soft/all/patches/1.19.1-0003-fix-windows-sdk.patch deleted file mode 100644 index 922c2a2f1c321a..00000000000000 --- a/recipes/openal-soft/all/patches/1.19.1-0003-fix-windows-sdk.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1092,17 +1092,24 @@ IF(HAVE_WINDOWS_H) - ENDIF() - - # Check DSound backend -- FIND_PACKAGE(DSound) -- IF(DSOUND_FOUND) -- OPTION(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) -- IF(ALSOFT_BACKEND_DSOUND) -- SET(HAVE_DSOUND 1) -- SET(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},") -- SET(ALC_OBJS ${ALC_OBJS} Alc/backends/dsound.c) -- ADD_BACKEND_LIBS(${DSOUND_LIBRARIES}) -- SET(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIRS}) -- ENDIF() -- ENDIF() -+ check_include_file(dsound.h HAVE_DSOUND_H) -+ if(DXSDK_DIR) -+ find_path(DSOUND_INCLUDE_DIR NAMES "dsound.h" -+ PATHS "${DXSDK_DIR}" PATH_SUFFIXES include -+ DOC "The DirectSound include directory") -+ endif() -+ if(HAVE_DSOUND_H OR DSOUND_INCLUDE_DIR) -+ option(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) -+ if(ALSOFT_BACKEND_DSOUND) -+ set(HAVE_DSOUND 1) -+ set(BACKENDS "${BACKENDS} DirectSound,") -+ set(ALC_OBJS ${ALC_OBJS} Alc/backends/dsound.c) -+ -+ if(NOT HAVE_DSOUND_H) -+ set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIR}) -+ endif() -+ endif() -+ endif() - - # Check for WASAPI backend - CHECK_INCLUDE_FILE(mmdeviceapi.h HAVE_MMDEVICEAPI_H) diff --git a/recipes/openal-soft/all/patches/1.20.1-0001-fix-windows-sdk.patch b/recipes/openal-soft/all/patches/1.20.1-0001-fix-windows-sdk.patch deleted file mode 100644 index 61ba2e012e0da4..00000000000000 --- a/recipes/openal-soft/all/patches/1.20.1-0001-fix-windows-sdk.patch +++ /dev/null @@ -1,76 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -854,44 +854,38 @@ OPTION(ALSOFT_REQUIRE_WINMM "Require Windows Multimedia backend" OFF) - OPTION(ALSOFT_REQUIRE_DSOUND "Require DirectSound backend" OFF) - OPTION(ALSOFT_REQUIRE_WASAPI "Require WASAPI backend" OFF) - IF(WIN32) -- SET(WINSDK_LIB_DIRS ) -- SET(WINSDK_INCLUDE_DIRS ) -- FIND_PACKAGE(WindowsSDK) -- IF(WINDOWSSDK_FOUND) -- get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS) -- get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS) -- ENDIF() -- -- SET(OLD_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}) -- SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_WIN32_WINNT=0x0502) -- - # Check MMSystem backend -- CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H) -- FIND_LIBRARY(WINMM_LIBRARY NAMES winmm -- PATHS ${WINSDK_LIB_DIRS} -- PATH_SUFFIXES lib lib/x86 lib/x64) -- IF(HAVE_MMSYSTEM_H AND WINMM_LIBRARY) -- OPTION(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) -- IF(ALSOFT_BACKEND_WINMM) -- SET(HAVE_WINMM 1) -- SET(BACKENDS "${BACKENDS} WinMM,") -- SET(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) -- SET(EXTRA_LIBS ${WINMM_LIBRARY} ${EXTRA_LIBS}) -- ENDIF() -- ENDIF() -+ option(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) -+ if(ALSOFT_BACKEND_WINMM) -+ set(HAVE_WINMM 1) -+ set(BACKENDS "${BACKENDS} WinMM,") -+ set(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) -+ # There doesn't seem to be good way to search for winmm.lib for MSVC. -+ # find_library doesn't find it without being told to look in a specific -+ # place in the WindowsSDK, but it links anyway. If there ends up being -+ # Windows targets without this, another means to detect it is needed. -+ set(EXTRA_LIBS winmm ${EXTRA_LIBS}) -+ endif() - - # Check DSound backend -- FIND_PACKAGE(DSound) -- IF(DSOUND_FOUND) -- OPTION(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) -- IF(ALSOFT_BACKEND_DSOUND) -- SET(HAVE_DSOUND 1) -- SET(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},") -- SET(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) -- ADD_BACKEND_LIBS(${DSOUND_LIBRARIES}) -- SET(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIRS}) -- ENDIF() -- ENDIF() -+ check_include_file(dsound.h HAVE_DSOUND_H) -+ if(DXSDK_DIR) -+ find_path(DSOUND_INCLUDE_DIR NAMES "dsound.h" -+ PATHS "${DXSDK_DIR}" PATH_SUFFIXES include -+ DOC "The DirectSound include directory") -+ endif() -+ if(HAVE_DSOUND_H OR DSOUND_INCLUDE_DIR) -+ option(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) -+ if(ALSOFT_BACKEND_DSOUND) -+ set(HAVE_DSOUND 1) -+ set(BACKENDS "${BACKENDS} DirectSound,") -+ set(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) -+ -+ if(NOT HAVE_DSOUND_H) -+ set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIR}) -+ endif() -+ endif() -+ endif() - - # Check for WASAPI backend - CHECK_INCLUDE_FILE(mmdeviceapi.h HAVE_MMDEVICEAPI_H) diff --git a/recipes/openal-soft/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch b/recipes/openal-soft/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch deleted file mode 100644 index 11b0c43304b4a4..00000000000000 --- a/recipes/openal-soft/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch +++ /dev/null @@ -1,16 +0,0 @@ -gcc-11 triggers an error. std::aligned_alloc needs c++17. -This patch ports openal 1.21.1 behavior back to 1.21.0. ---- common/almalloc.cpp -+++ common/almalloc.cpp -@@ -21,4 +21,4 @@ --#if defined(HAVE_STD_ALIGNED_ALLOC) -- size = (size+(alignment-1))&~(alignment-1); -- return std::aligned_alloc(alignment, size); -+//#if defined(HAVE_STD_ALIGNED_ALLOC) -+// size = (size+(alignment-1))&~(alignment-1); -+// return std::aligned_alloc(alignment, size); --#elif defined(HAVE_POSIX_MEMALIGN) -+#if defined(HAVE_POSIX_MEMALIGN) -@@ -56,1 +56,1 @@ --#if defined(HAVE_STD_ALIGNED_ALLOC) || defined(HAVE_POSIX_MEMALIGN) -+#if defined(HAVE_POSIX_MEMALIGN) diff --git a/recipes/openal-soft/all/patches/1.21.0-0002-fix-windows-sdk.patch b/recipes/openal-soft/all/patches/1.21.0-0002-fix-windows-sdk.patch deleted file mode 100644 index 3a6c7afb5a414c..00000000000000 --- a/recipes/openal-soft/all/patches/1.21.0-0002-fix-windows-sdk.patch +++ /dev/null @@ -1,74 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -880,49 +880,36 @@ option(ALSOFT_REQUIRE_WINMM "Require Windows Multimedia backend" OFF) - option(ALSOFT_REQUIRE_DSOUND "Require DirectSound backend" OFF) - option(ALSOFT_REQUIRE_WASAPI "Require WASAPI backend" OFF) - if(WIN32) -- set(WINSDK_LIB_DIRS ) -- set(WINSDK_INCLUDE_DIRS ) -- find_package(WindowsSDK) -- if(WINDOWSSDK_FOUND) -- get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS) -- get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS) -- endif() -- - # Check MMSystem backend -- check_include_files("windows.h;mmsystem.h" HAVE_MMSYSTEM_H) -- find_library(WINMM_LIBRARY NAMES winmm -- PATHS ${WINSDK_LIB_DIRS}) -- if(HAVE_MMSYSTEM_H AND WINMM_LIBRARY) -- option(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) -- if(ALSOFT_BACKEND_WINMM) -- set(HAVE_WINMM 1) -- set(BACKENDS "${BACKENDS} WinMM,") -- set(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) -- set(EXTRA_LIBS ${WINMM_LIBRARY} ${EXTRA_LIBS}) -- endif() -+ option(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) -+ if(ALSOFT_BACKEND_WINMM) -+ set(HAVE_WINMM 1) -+ set(BACKENDS "${BACKENDS} WinMM,") -+ set(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) -+ # There doesn't seem to be good way to search for winmm.lib for MSVC. -+ # find_library doesn't find it without being told to look in a specific -+ # place in the WindowsSDK, but it links anyway. If there ends up being -+ # Windows targets without this, another means to detect it is needed. -+ set(EXTRA_LIBS winmm ${EXTRA_LIBS}) - endif() - - # Check DSound backend -- find_package(DSound) -- if(DSOUND_FOUND) -+ check_include_file(dsound.h HAVE_DSOUND_H) -+ if(DXSDK_DIR) -+ find_path(DSOUND_INCLUDE_DIR NAMES "dsound.h" -+ PATHS "${DXSDK_DIR}" PATH_SUFFIXES include -+ DOC "The DirectSound include directory") -+ endif() -+ if(HAVE_DSOUND_H OR DSOUND_INCLUDE_DIR) - option(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) - if(ALSOFT_BACKEND_DSOUND) - set(HAVE_DSOUND 1) -- set(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},") -- set(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) -- add_backend_libs(${DSOUND_LIBRARIES}) -- set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIRS}) -- endif() -- endif() -+ set(BACKENDS "${BACKENDS} DirectSound,") -+ set(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) - -- # Check for WASAPI backend -- check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H) -- if(HAVE_MMDEVICEAPI_H) -- option(ALSOFT_BACKEND_WASAPI "Enable WASAPI backend" ON) -- if(ALSOFT_BACKEND_WASAPI) -- set(HAVE_WASAPI 1) -- set(BACKENDS "${BACKENDS} WASAPI,") -- set(ALC_OBJS ${ALC_OBJS} alc/backends/wasapi.cpp alc/backends/wasapi.h) -+ if(NOT HAVE_DSOUND_H) -+ set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIR}) -+ endif() - endif() - endif() - endif() diff --git a/recipes/openal-soft/config.yml b/recipes/openal-soft/config.yml index e4eea213adbce0..a3a476fc04f3aa 100644 --- a/recipes/openal-soft/config.yml +++ b/recipes/openal-soft/config.yml @@ -1,11 +1,5 @@ versions: - "1.22.2": - folder: all - "1.21.1": - folder: all - "1.21.0": + "1.23.1": folder: all - "1.20.1": - folder: all - "1.19.1": + "1.22.2": folder: all diff --git a/recipes/opencv/4.x/conandata.yml b/recipes/opencv/4.x/conandata.yml index 523e50b3b56b96..d536778d0cf881 100644 --- a/recipes/opencv/4.x/conandata.yml +++ b/recipes/opencv/4.x/conandata.yml @@ -1,4 +1,9 @@ sources: + "4.9.0": + - url: "https://github.com/opencv/opencv/archive/refs/tags/4.9.0.tar.gz" + sha256: "ddf76f9dffd322c7c3cb1f721d0887f62d747b82059342213138dc190f28bc6c" + - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.9.0.tar.gz" + sha256: "8952c45a73b75676c522dd574229f563e43c271ae1d5bbbd26f8e2b6bc1a4dae" "4.8.1": - url: "https://github.com/opencv/opencv/archive/refs/tags/4.8.1.tar.gz" sha256: "62f650467a60a38794d681ae7e66e3e8cfba38f445e0bf87867e2f2cdc8be9d5" @@ -20,6 +25,28 @@ sources: - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.1.2.tar.gz" sha256: "0f6c3d30baa39e3e7611afb481ee86dea45dafb182cac87d570c95dccd83eb8b" patches: + "4.9.0": + - patch_file: "patches/4.5.5-0001-find-openexr.patch" + patch_description: "Robust discovery & injection of OpenEXR" + patch_type: "conan" + - patch_file: "patches/4.5.5-0003-find-quirc.patch" + patch_description: "Robust discovery & injection of quirc" + patch_type: "conan" + - patch_file: "patches/4.8.1-0001-find-ade.patch" + patch_description: "Robust discovery & injection of ade" + patch_type: "conan" + - patch_file: "patches/4.5.1-0001-tracking-no-plot-deps.patch" + patch_description: "Fix requirements of tracking module" + patch_type: "conan" + - patch_file: "patches/4.1.2-0006-hdf.patch" + patch_description: "Robust discovery of hdf" + patch_type: "conan" + - patch_file: "patches/4.5.2-0001-fix-zlib-static-android.patch" + patch_description: "Fix discovery of zlib static if Android" + patch_type: "conan" + - patch_file: "patches/4.1.2-0007-android-install-layout.patch" + patch_description: "Honor install layout from conan if Android" + patch_type: "conan" "4.8.1": - patch_file: "patches/4.5.5-0001-find-openexr.patch" patch_description: "Robust discovery & injection of OpenEXR" diff --git a/recipes/opencv/4.x/conanfile.py b/recipes/opencv/4.x/conanfile.py index 0d5396ed1027ef..27d637332f3ab4 100644 --- a/recipes/opencv/4.x/conanfile.py +++ b/recipes/opencv/4.x/conanfile.py @@ -1119,7 +1119,7 @@ def requirements(self): elif self.options.get_safe("with_jpeg2000") == "openjpeg": self.requires("openjpeg/2.5.2") if self.options.get_safe("with_png"): - self.requires("libpng/1.6.43") + self.requires("libpng/[>=1.6 <2]") if self.options.get_safe("with_openexr"): self.requires("openexr/3.2.3") if self.options.get_safe("with_tiff"): @@ -1238,6 +1238,10 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "ANDROID OR NOT UNIX", "FALSE") replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "elseif(EMSCRIPTEN)", "elseif(QNXNTO)\nelseif(EMSCRIPTEN)") + ## Upstream CMakeLists vendors quirc in CMakeLists of 3rdparty/quirc. + ## Instead we rely on find-quirc.patch in order to link external quirc. + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(3rdparty/quirc)", "") + ## Fix link to several dependencies replace_in_file(self, os.path.join(self.source_folder, "modules", "imgcodecs", "CMakeLists.txt"), "JASPER_", "Jasper_") replace_in_file(self, os.path.join(self.source_folder, "modules", "imgcodecs", "CMakeLists.txt"), "${GDAL_LIBRARY}", "GDAL::GDAL") @@ -1411,10 +1415,11 @@ def generate(self): tc.variables["WITH_OPENNI"] = False tc.variables["WITH_OPENNI2"] = False tc.variables["WITH_OPENVX"] = False + tc.variables["WITH_CAROTENE"] = False tc.variables["WITH_PLAIDML"] = False tc.variables["WITH_PVAPI"] = False tc.variables["WITH_QT"] = self.options.get_safe("with_qt", False) - tc.variables["WITH_QUIRC"] = False + tc.variables["WITH_QUIRC"] = self.options.get_safe("with_quirc", False) tc.variables["WITH_V4L"] = self.options.get_safe("with_v4l", False) tc.variables["WITH_VA"] = False tc.variables["WITH_VA_INTEL"] = False @@ -1484,8 +1489,6 @@ def generate(self): if self.options.get_safe("with_protobuf"): tc.variables["PROTOBUF_UPDATE_FILES"] = True tc.variables["WITH_ADE"] = self.options.gapi - if self.options.objdetect: - tc.variables["HAVE_QUIRC"] = self.options.with_quirc # force usage of quirc requirement # Extra modules if any([self.options.get_safe(module) for module in OPENCV_EXTRA_MODULES_OPTIONS]) or self.options.with_cuda: diff --git a/recipes/opencv/config.yml b/recipes/opencv/config.yml index 443d5e91a81259..42e7008ac9ec0e 100644 --- a/recipes/opencv/config.yml +++ b/recipes/opencv/config.yml @@ -1,4 +1,6 @@ versions: + "4.9.0": + folder: "4.x" "4.8.1": folder: "4.x" "4.5.5": diff --git a/recipes/openexr/3.x/conandata.yml b/recipes/openexr/3.x/conandata.yml index 82b1ad8ce0c768..1d8f995d131a6a 100644 --- a/recipes/openexr/3.x/conandata.yml +++ b/recipes/openexr/3.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.4": + url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.2.4.tar.gz" + sha256: "81e6518f2c4656fdeaf18a018f135e96a96e7f66dbe1c1f05860dd94772176cc" "3.2.3": url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.2.3.tar.gz" sha256: "f3f6c4165694d5c09e478a791eae69847cadb1333a2948ca222aa09f145eba63" @@ -15,6 +18,11 @@ sources: url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.1.7.tar.gz" sha256: "78dbca39115a1c526e6728588753955ee75fa7f5bb1a6e238bed5b6d66f91fd7" patches: + "3.2.4": + - patch_file: "patches/3.2.1-gcc5-bug-workaround.patch" + patch_description: "Workaround for GCC 5 bug" + patch_type: "portability" + patch_source: "https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82336" "3.2.3": - patch_file: "patches/3.2.1-gcc5-bug-workaround.patch" patch_description: "Workaround for GCC 5 bug" diff --git a/recipes/openexr/config.yml b/recipes/openexr/config.yml index 36bd699167db03..7a8a2874719efb 100644 --- a/recipes/openexr/config.yml +++ b/recipes/openexr/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.4": + folder: "3.x" "3.2.3": folder: "3.x" "3.2.2": diff --git a/recipes/openfx/all/conanfile.py b/recipes/openfx/all/conanfile.py index 935c3113a9393d..2fa66bbb90d2a1 100644 --- a/recipes/openfx/all/conanfile.py +++ b/recipes/openfx/all/conanfile.py @@ -50,7 +50,7 @@ def layout(self): def requirements(self): self.requires("opengl/system") - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/openimageio/all/conandata.yml b/recipes/openimageio/all/conandata.yml index 67601ed04452cd..6c6e729f7e5f6f 100644 --- a/recipes/openimageio/all/conandata.yml +++ b/recipes/openimageio/all/conandata.yml @@ -11,6 +11,9 @@ sources: "2.5.9.0": url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.9.0.tar.gz" sha256: "b6a68e369bc475525eb843bdc0cb8adc910cc71000825f8db9b5e136166cdc78" + "2.5.10.1": + url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.10.1.tar.gz" + sha256: "8f6a547f6a5d510737ba436f867043db537def65f0fdb14ec30e5a185b619f93" patches: "2.4.7.1": - patch_file: "patches/2.4.7.1-cmake-targets.patch" @@ -31,3 +34,7 @@ patches: - patch_file: "patches/2.5.9.0-cmake-targets.patch" patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" patch_type: "conan" + "2.5.10.1": + - patch_file: "patches/2.5.10.1-cmake-targets.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" diff --git a/recipes/openimageio/all/patches/2.5.10.1-cmake-targets.patch b/recipes/openimageio/all/patches/2.5.10.1-cmake-targets.patch new file mode 100644 index 00000000000000..9aa7dc768cd9b2 --- /dev/null +++ b/recipes/openimageio/all/patches/2.5.10.1-cmake-targets.patch @@ -0,0 +1,518 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 8125716a3..dd83c588f 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -154,7 +154,7 @@ endif () + add_definitions (-DOIIO_INTERNAL=1) + + list (APPEND CMAKE_MODULE_PATH +- "${PROJECT_SOURCE_DIR}/src/cmake/modules" ++ #"${PROJECT_SOURCE_DIR}/src/cmake/modules" + "${PROJECT_SOURCE_DIR}/src/cmake") + + include (GNUInstallDirs) +@@ -233,7 +233,7 @@ if (OIIO_BUILD_TOOLS AND NOT BUILD_OIIOUTIL_ONLY) + add_subdirectory (src/iinfo) + add_subdirectory (src/maketx) + add_subdirectory (src/oiiotool) +- add_subdirectory (src/testtex) ++ #add_subdirectory (src/testtex) + add_subdirectory (src/iv) + endif () + +diff --git src/cmake/externalpackages.cmake src/cmake/externalpackages.cmake +index 3f73cd266..d03c906d1 100644 +--- src/cmake/externalpackages.cmake ++++ src/cmake/externalpackages.cmake +@@ -45,14 +45,14 @@ if (NOT DEFINED Boost_USE_STATIC_LIBS) + set (Boost_USE_STATIC_LIBS "${LINKSTATIC}") + endif () + +-if (MSVC) +- # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: +- if (NOT Boost_USE_STATIC_LIBS) +- add_definitions (-DBOOST_ALL_DYN_LINK=1) +- endif () +-endif () +- +-set (Boost_COMPONENTS thread) ++#if (MSVC) ++# # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: ++# if (NOT Boost_USE_STATIC_LIBS) ++# add_definitions (-DBOOST_ALL_DYN_LINK=1) ++# endif () ++#endif () ++ ++set (Boost_COMPONENTS filesystem system thread container) + if (NOT USE_STD_FILESYSTEM) + list (APPEND Boost_COMPONENTS filesystem) + endif () +@@ -108,9 +108,9 @@ checked_find_package (OpenEXR REQUIRED + # building against Imath/OpenEXR 3.x when there is still a system-level + # install version of 2.x. + include_directories(BEFORE ${IMATH_INCLUDES} ${OPENEXR_INCLUDES}) +-if (MSVC AND NOT LINKSTATIC) +- add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? +-endif () ++#if (MSVC AND NOT LINKSTATIC) ++# add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? ++#endif () + if (OpenEXR_VERSION VERSION_GREATER_EQUAL 3.0) + set (OIIO_USING_IMATH 3) + else () +@@ -137,11 +137,15 @@ set (OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH OFF CACHE BOOL + "Exclude find_dependency(Imath) from the exported OpenImageIOConfig.cmake") + + # JPEG -- prefer JPEG-Turbo to regular libjpeg +-checked_find_package (libjpeg-turbo +- VERSION_MIN 2.1 +- DEFINITIONS -DUSE_JPEG_TURBO=1) +-if (NOT TARGET libjpeg-turbo::jpeg) # Try to find the non-turbo version ++if (USE_JPEGTURBO) ++ checked_find_package (libjpeg-turbo REQUIRED ++ DEFINITIONS -DUSE_JPEG_TURBO=1 ++ PRINT libjpeg-turbo_INCLUDES libjpeg-turbo_LIBRARIES) ++ add_library(JPEG::JPEG ALIAS libjpeg-turbo::libjpeg-turbo) ++elseif (USE_JPEG) # Try to find the non-turbo version + checked_find_package (JPEG REQUIRED) ++else () ++ message(FATAL_ERROR "JPEG library was not found!") + endif () + + # Pugixml setup. Normally we just use the version bundled with oiio, but +@@ -157,7 +161,7 @@ else () + endif() + + # From pythonutils.cmake +-find_python() ++#find_python() + if (USE_PYTHON) + checked_find_package (pybind11 REQUIRED VERSION_MIN 2.4.2) + endif () +@@ -167,110 +171,105 @@ endif () + # Dependencies for optional formats and features. If these are not found, + # we will continue building, but the related functionality will be disabled. + +-checked_find_package (PNG) ++if (USE_LIBPNG) ++ checked_find_package (PNG REQUIRED) ++endif() + +-checked_find_package (BZip2) # Used by ffmpeg and freetype +-if (NOT BZIP2_FOUND) +- set (BZIP2_LIBRARIES "") # TODO: why does it break without this? +-endif () ++if (USE_FREETYPE) ++ checked_find_package (Freetype REQUIRED ++ DEFINITIONS -DUSE_FREETYPE=1 ) ++endif() + +-checked_find_package (Freetype +- DEFINITIONS -DUSE_FREETYPE=1 ) +- +-checked_find_package (OpenColorIO +- DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 +- # PREFER_CONFIG +- ) +-if (OpenColorIO_FOUND) +- option (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS +- "For deveoper debugging/testing ONLY! Disable OCIO 2.2 builtin configs." OFF) +- if (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS OR "$ENV{OIIO_DISABLE_BUILTIN_OCIO_CONFIGS}") +- add_compile_definitions(OIIO_DISABLE_BUILTIN_OCIO_CONFIGS) +- endif () +-else () +- set (OpenColorIO_FOUND 0) ++if (USE_OPENCOLORIO) ++ checked_find_package (OpenColorIO REQUIRED ++ DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 ++ # PREFER_CONFIG ++ ) + endif () + +-checked_find_package (OpenCV 3.0 +- DEFINITIONS -DUSE_OPENCV=1) ++if (USE_OPENCV) ++ checked_find_package (OpenCV REQUIRED 3.0 ++ DEFINITIONS -DUSE_OPENCV=1) ++endif() + + # Intel TBB +-set (TBB_USE_DEBUG_BUILD OFF) +-checked_find_package (TBB 2017 +- SETVARIABLES OIIO_TBB +- PREFER_CONFIG) ++if (USE_TBB)# Intel TBB ++ set (TBB_USE_DEBUG_BUILD OFF) ++ checked_find_package (TBB 2017 REQUIRED ++ SETVARIABLES OIIO_TBB ++ PREFER_CONFIG) ++endif() + + # DCMTK is used to read DICOM images +-checked_find_package (DCMTK VERSION_MIN 3.6.1 +- PREFER_CONFIG) ++if (USE_DCMTK) ++ checked_find_package (DCMTK REQUIRED VERSION_MIN 3.6.1) # For DICOM images ++endif() + +-checked_find_package (FFmpeg VERSION_MIN 3.0) +-checked_find_package (GIF +- VERSION_MIN 4 +- RECOMMEND_MIN 5.0 +- RECOMMEND_MIN_REASON "for stability and thread safety") ++if (USE_FFMPEG) ++ checked_find_package (ffmpeg REQUIRED VERSION_MIN 3.0) ++endif() ++if (USE_GIF) ++ checked_find_package (GIF REQUIRED ++ VERSION_MIN 4 ++ RECOMMEND_MIN 5.0 ++ RECOMMEND_MIN_REASON "for stability and thread safety") ++endif() + + # For HEIF/HEIC/AVIF formats +-checked_find_package (Libheif VERSION_MIN 1.3 +- RECOMMEND_MIN 1.16 +- RECOMMEND_MIN_REASON "for orientation support") +-if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) +- message (WARNING "Libheif 1.10 on Apple is known to be broken, disabling libheif support") +- set (Libheif_FOUND 0) +-endif () ++if (USE_LIBHEIF) ++ checked_find_package (libheif REQUIRED VERSION_MIN 1.3 ++ RECOMMEND_MIN 1.7 ++ RECOMMEND_MIN_REASON "for AVIF support") ++endif() + +-checked_find_package (LibRaw +- VERSION_MIN 0.18 +- PRINT LibRaw_r_LIBRARIES) +-if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VERSION_GREATER_EQUAL 17) +- message (STATUS "${ColorYellow}WARNING When building for C++17, LibRaw should be 0.20 or higher (found ${LibRaw_VERSION}). You may get errors, depending on the compiler.${ColorReset}") +- # Currently, we issue the above warning and let them take their chances. +- # If we wish to disable the LibRaw<0.20/C++17 combination that may fail, +- # just uncomment the following two lines. +- # set (LibRaw_FOUND 0) +- # set (LIBRAW_FOUND 0) +-endif () ++if (USE_LIBRAW) ++ checked_find_package (LibRaw REQUIRED ++ RECOMMEND_MIN 0.18 ++ RECOMMEND_MIN_REASON "for ACES support and better camera metadata" ++ PRINT LibRaw_r_LIBRARIES) ++endif() + +-checked_find_package (OpenJPEG VERSION_MIN 2.0 +- RECOMMEND_MIN 2.2 +- RECOMMEND_MIN_REASON "for multithreading support") +-# Note: Recent OpenJPEG versions have exported cmake configs, but we don't +-# find them reliable at all, so we stick to our FindOpenJPEG.cmake module. +- +-checked_find_package (OpenVDB +- VERSION_MIN 5.0 +- DEPS TBB +- DEFINITIONS -DUSE_OPENVDB=1) +-if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 10.1 AND CMAKE_CXX_STANDARD VERSION_LESS 17) +- message (WARNING "${ColorYellow}OpenVDB >= 10.1 (we found ${OpenVDB_VERSION}) can only be used when we build with C++17 or higher. Disabling OpenVDB support.${ColorReset}") +- set (OpeVDB_FOUND 0) +-endif () ++if (USE_OPENJPEG) ++ checked_find_package (OpenJPEG REQUIRED ++ VERSION_MIN 2.0 ++ RECOMMEND_MIN 2.2 ++ RECOMMEND_MIN_REASON "for multithreading support") ++ # Note: Recent OpenJPEG versions have exported cmake configs, but we don't ++ # find them reliable at all, so we stick to our FindOpenJPEG.cmake module. ++endif() + +-checked_find_package (Ptex PREFER_CONFIG) +-if (NOT Ptex_FOUND OR NOT Ptex_VERSION) +- # Fallback for inadequate Ptex exported configs. This will eventually +- # disappear when we can 100% trust Ptex's exports. +- unset (Ptex_FOUND) +- checked_find_package (Ptex) +-endif () ++if (USE_OPENVDB) ++ checked_find_package (OpenVDB REQUIRED ++ VERSION_MIN 5.0 ++ DEPS TBB ++ DEFINITIONS -DUSE_OPENVDB=1) ++endif() + +-checked_find_package (WebP) +-# Note: When WebP 1.1 (released late 2019) is our minimum, we can use their +-# exported configs and remove our FindWebP.cmake module. ++if (USE_PTEX) ++ checked_find_package (ptex REQUIRED PREFER_CONFIG) ++endif() ++ ++if (USE_LIBWEBP) ++ checked_find_package (WebP REQUIRED) ++endif() + + option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF) +-checked_find_package (R3DSDK NO_RECORD_NOTFOUND) # RED camera ++if (USE_R3DSDK) ++ checked_find_package (R3DSDK REQUIRED) # RED camera ++endif () + + set (NUKE_VERSION "7.0" CACHE STRING "Nuke version to target") +-checked_find_package (Nuke NO_RECORD_NOTFOUND) ++if (USE_NUKE) ++ checked_find_package (Nuke REQUIRED) ++endif () + + + # Qt -- used for iv + option (USE_QT "Use Qt if found" ON) +-if (USE_QT) +- checked_find_package (OpenGL) # used for iv ++if (USE_OPENGL) ++ checked_find_package (OpenGL REQUIRED) # used for iv + endif () +-if (USE_QT AND OPENGL_FOUND) ++if (USE_QT AND USE_OPENGL) + checked_find_package (Qt6 COMPONENTS Core Gui Widgets OpenGLWidgets) + if (NOT Qt6_FOUND) + checked_find_package (Qt5 COMPONENTS Core Gui Widgets OpenGL) +@@ -294,13 +293,13 @@ macro (find_or_download_robin_map) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_ROBINMAP_FORCE) +- find_package (Robinmap QUIET) ++ find_package (tsl-robin-map REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then + # download and build it. + # Download the headers from github +- if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_FOUND) OR BUILD_ROBINMAP_FORCE) ++ if ((BUILD_MISSING_ROBINMAP AND NOT tsl-robin-map_FOUND) OR BUILD_ROBINMAP_FORCE) + message (STATUS "Downloading local Tessil/robin-map") + set (ROBINMAP_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/robin-map") + set (ROBINMAP_GIT_REPOSITORY "https://github.com/Tessil/robin-map") +@@ -318,7 +317,7 @@ macro (find_or_download_robin_map) + endif () + set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}/include") + endif () +- checked_find_package (Robinmap REQUIRED) ++ checked_find_package (tsl-robin-map REQUIRED) + endmacro() + + find_or_download_robin_map () +@@ -337,7 +336,7 @@ macro (find_or_download_fmt) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_FMT_FORCE) +- find_package (fmt QUIET) ++ find_package (fmt REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then +@@ -372,7 +371,7 @@ macro (find_or_download_fmt) + set (fmt_VERSION "${FMT_VERSION_MAJOR}.${FMT_VERSION_MINOR}.${FMT_VERSION_PATCH}") + list (APPEND CFP_ALL_BUILD_DEPS_FOUND "${pkgname} ${${pkgname}_VERSION}") + else () +- get_target_property(FMT_INCLUDE_DIR fmt::fmt-header-only INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(FMT_INCLUDE_DIR fmt::fmt INTERFACE_INCLUDE_DIRECTORIES) + set (OIIO_USING_FMT_LOCAL FALSE) + checked_find_package (fmt REQUIRED + VERSION_MIN 7.0) +diff --git src/ffmpeg.imageio/CMakeLists.txt src/ffmpeg.imageio/CMakeLists.txt +index 8e47a8443..900d23101 100644 +--- src/ffmpeg.imageio/CMakeLists.txt ++++ src/ffmpeg.imageio/CMakeLists.txt +@@ -2,7 +2,7 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (FFmpeg_FOUND) ++if (USE_FFMPEG) + if (LINKSTATIC) + set (_static_suffixes .lib .a) + set (_static_libraries_found 0) +@@ -26,11 +26,9 @@ if (FFmpeg_FOUND) + endif() + + add_oiio_plugin (ffmpeginput.cpp +- INCLUDE_DIRS ${FFMPEG_INCLUDES} +- LINK_LIBRARIES ${FFMPEG_LIBRARIES} +- ${BZIP2_LIBRARIES} ++ LINK_LIBRARIES ffmpeg::avcodec ffmpeg::avformat ffmpeg::swscale + DEFINITIONS "-DUSE_FFMPEG" +- "-DOIIO_FFMPEG_VERSION=\"${FFMPEG_VERSION}\"") ++ "-DOIIO_FFMPEG_VERSION=\"${ffmpeg_VERSION}\"") + else() + message (STATUS "FFmpeg not found: ffmpeg plugin will not be built") + endif() +diff --git src/heif.imageio/CMakeLists.txt src/heif.imageio/CMakeLists.txt +index 5b6c30a85..e5bc55ef1 100644 +--- src/heif.imageio/CMakeLists.txt ++++ src/heif.imageio/CMakeLists.txt +@@ -2,32 +2,31 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Libheif_FOUND) +- if (LINKSTATIC) +- set (_static_suffixes .lib .a) +- set (_static_libraries_found 0) ++if (USE_LIBHEIF) ++ # if (LINKSTATIC) ++ # set (_static_suffixes .lib .a) ++ # set (_static_libraries_found 0) + +- foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) +- get_filename_component (_ext ${_libeheif_library} LAST_EXT) +- list (FIND _static_suffixes ${_ext} _index) +- if (${_index} GREATER -1) +- MATH (EXPR _static_libraries_found "${static_libraries_found}+1") +- endif() +- endforeach() ++ # foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) ++ # get_filename_component (_ext ${_libeheif_library} LAST_EXT) ++ # list (FIND _static_suffixes ${_ext} _index) ++ # if (${_index} GREATER -1) ++ # MATH (EXPR _static_libraries_found "${static_libraries_found}+1") ++ # endif() ++ # endforeach() + +- if (${_static_libraries_found} GREATER 0) +- message (STATUS "${ColorYellow}") +- message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") +- message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") +- message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") +- message (STATUS "dynamically-linked libheif.") +- message ("${ColorReset}") +- endif() +- endif() ++ # if (${_static_libraries_found} GREATER 0) ++ # message (STATUS "${ColorYellow}") ++ # message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") ++ # message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") ++ # message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") ++ # message (STATUS "dynamically-linked libheif.") ++ # message ("${ColorReset}") ++ # endif() ++ # endif() + + add_oiio_plugin (heifinput.cpp heifoutput.cpp +- INCLUDE_DIRS ${LIBHEIF_INCLUDES} +- LINK_LIBRARIES ${LIBHEIF_LIBRARIES} ++ LINK_LIBRARIES libheif::heif + DEFINITIONS "-DUSE_HEIF=1") + else () + message (WARNING "heif plugin will not be built") +diff --git src/include/CMakeLists.txt src/include/CMakeLists.txt +index 7bec09739..3db17086f 100644 +--- src/include/CMakeLists.txt ++++ src/include/CMakeLists.txt +@@ -64,7 +64,8 @@ install (FILES ${detail_headers} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail + COMPONENT developer) + +-if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) ++if (0) # Don't try to copy fmt libraries to target install folder ++ set(FMT_INCLUDES "${fmt_INCLUDE_DIR}") + set (fmt_headers_base_names) + foreach (header_name core.h format-inl.h format.h ostream.h printf.h + std.h base.h chrono.h) +diff --git src/jpeg2000.imageio/CMakeLists.txt src/jpeg2000.imageio/CMakeLists.txt +index 560e8d486..24348fe66 100644 +--- src/jpeg2000.imageio/CMakeLists.txt ++++ src/jpeg2000.imageio/CMakeLists.txt +@@ -2,10 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (OPENJPEG_FOUND) ++if (USE_OPENJPEG) + add_oiio_plugin (jpeg2000input.cpp jpeg2000output.cpp +- INCLUDE_DIRS ${OPENJPEG_INCLUDES} +- LINK_LIBRARIES ${OPENJPEG_LIBRARIES} ++ LINK_LIBRARIES openjp2 + DEFINITIONS "-DUSE_OPENJPEG") + else() + message (WARNING "Jpeg-2000 plugin will not be built") +diff --git src/libOpenImageIO/CMakeLists.txt src/libOpenImageIO/CMakeLists.txt +index aeb7b7f93..9a32e4cf2 100644 +--- src/libOpenImageIO/CMakeLists.txt ++++ src/libOpenImageIO/CMakeLists.txt +@@ -154,19 +154,27 @@ target_link_libraries (OpenImageIO + ${OPENIMAGEIO_IMATH_TARGETS} + PRIVATE + ${OPENIMAGEIO_OPENEXR_TARGETS} +- ${OpenCV_LIBRARIES} + ${format_plugin_libs} # Add all the target link libraries from the plugins + $ + $ + $ + $ +- $ + ${BZIP2_LIBRARIES} + ZLIB::ZLIB +- $ ++ tsl::robin_map ++ Boost::filesystem Boost::thread Boost::system Boost::container + ${CMAKE_DL_LIBS} + ) + ++if (USE_OPENCV) ++ target_link_libraries (OpenImageIO PRIVATE opencv::opencv_core ++ opencv::opencv_imgproc ++ opencv::opencv_videoio) ++endif () ++if (USE_FREETYPE) ++ target_link_libraries (OpenImageIO PRIVATE Freetype::Freetype) ++endif() ++ + if (WIN32) + target_link_libraries (OpenImageIO PRIVATE psapi) + endif() +diff --git src/libutil/CMakeLists.txt src/libutil/CMakeLists.txt +index f873b3eed..cf5d4e74c 100644 +--- src/libutil/CMakeLists.txt ++++ src/libutil/CMakeLists.txt +@@ -20,20 +20,13 @@ target_link_libraries (OpenImageIO_Util + ${GCC_ATOMIC_LIBRARIES} + ${OPENIMAGEIO_IMATH_DEPENDENCY_VISIBILITY} + ${OPENIMAGEIO_IMATH_TARGETS} ++ fmt::fmt + PRIVATE +- $ +- $ ++ Boost::filesystem Boost::thread Boost::system + $ + ${CMAKE_DL_LIBS} + ) + +-if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) +- add_dependencies(OpenImageIO_Util fmt_internal_target) +-else () +- target_link_libraries (OpenImageIO_Util +- PUBLIC fmt::fmt-header-only) +-endif () +- + if (WIN32) + add_definitions(-DWIN32_LEAN_AND_MEAN -DNOMINMAX -DNOGDI -DVC_EXTRALEAN) + target_link_libraries (OpenImageIO_Util PRIVATE psapi) +diff --git src/ptex.imageio/CMakeLists.txt src/ptex.imageio/CMakeLists.txt +index 16634fedb..82060ac29 100644 +--- src/ptex.imageio/CMakeLists.txt ++++ src/ptex.imageio/CMakeLists.txt +@@ -2,12 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Ptex_FOUND) +- set(ptex_target Ptex::Ptex_dynamic) +- if (TARGET Ptex::Ptex_static AND (NOT TARGET Ptex::Ptex_dynamic OR LINKSTATIC)) +- set(ptex_target Ptex::Ptex_static) +- endif() ++if (USE_PTEX) + add_oiio_plugin (ptexinput.cpp +- LINK_LIBRARIES ${ptex_target} ZLIB::ZLIB ++ LINK_LIBRARIES ${ptex_LIBRARIES} ZLIB::ZLIB ++ INCLUDE_DIRS ${ptex_INCLUDE_DIRS} + DEFINITIONS "-DUSE_PTEX") + endif () diff --git a/recipes/openimageio/config.yml b/recipes/openimageio/config.yml index 95116bd79b8860..d8edacc680c4ea 100644 --- a/recipes/openimageio/config.yml +++ b/recipes/openimageio/config.yml @@ -7,3 +7,5 @@ versions: folder: all "2.5.9.0": folder: all + "2.5.10.1": + folder: all diff --git a/recipes/openjdk/all/conandata.yml b/recipes/openjdk/all/conandata.yml index bb0f8bea50c9bb..41ac854b164624 100644 --- a/recipes/openjdk/all/conandata.yml +++ b/recipes/openjdk/all/conandata.yml @@ -1,4 +1,20 @@ sources: + "21.0.2": + Windows: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL/openjdk-21.0.2_windows-x64_bin.zip" + sha256: "b6c17e747ae78cdd6de4d7532b3164b277daee97c007d3eaa2b39cca99882664" + Linux_x86_64: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/12/GPL/openjdk-21.0.2_linux-x64_bin.tar.gz" + sha256: "960a708e76bffa0864e3e756e03314d56aa9dfb253b0803ae8a35eef2188f475" + Linux_armv8: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/12/GPL/openjdk-21.0.2_linux-aarch64_bin.tar.gz" + sha256: "0fcd2bdd32de146288635e05a362a24217baf669a3fa8e145ed09c6ad96a8c38" + Macos_x86_64: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/12/GPL/openjdk-21.0.2_macos-x64_bin.tar.gz" + sha256: "2830aa583a7f1e6ea2673ead18c12a2b1f85e9d5b8d69b116666014b14b81656" + Macos_armv8: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/12/GPL/openjdk-21.0.2_macos-aarch64_bin.tar.gz" + sha256: "997e0797f304a423149fd72284e9bcf7782c4a969fcb49ef05dfa7e5e6b6fbd6" "21.0.1": Windows: url: "https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1_windows-x64_bin.zip" diff --git a/recipes/openjdk/all/conanfile.py b/recipes/openjdk/all/conanfile.py index becd2ce7c641cd..33d8977b70cc47 100644 --- a/recipes/openjdk/all/conanfile.py +++ b/recipes/openjdk/all/conanfile.py @@ -16,12 +16,14 @@ class OpenJDK(ConanFile): license = "GPL-2.0-only WITH Classpath-exception-2.0", "GPL-2.0-only WITH OpenJDK-assembly-exception-1.0" topics = ("java", "jdk", "openjdk") settings = "os", "arch", "compiler", "build_type" - no_copy_source = True def package_id(self): del self.info.settings.compiler del self.info.settings.build_type + def configure(self): + self.settings.rm_safe("os.version") + def validate(self): if Version(self.version) < "19.0.2" and self.settings.arch != "x86_64": raise ConanInvalidConfiguration("Unsupported Architecture. This package currently only supports x86_64.") @@ -33,42 +35,42 @@ def build(self): if self.settings.os in ["Macos", "Linux"]: key = f"{self.settings.os}_{self.settings.arch}" get(self, **self.conan_data["sources"][self.version][str(key)], - destination=self.source_folder, strip_root=True) + destination=self.build_folder, strip_root=True) def package(self): if self.settings.os == "Macos": - source_folder = os.path.join(self.source_folder, f"jdk-{self.version}.jdk", "Contents", "Home") + build_folder = os.path.join(self.build_folder, f"jdk-{self.version}.jdk", "Contents", "Home") else: - source_folder = self.source_folder - symlinks.remove_broken_symlinks(self, source_folder) + build_folder = self.build_folder + symlinks.remove_broken_symlinks(self, build_folder) copy(self, pattern="*", - src=os.path.join(source_folder, "bin"), + src=os.path.join(build_folder, "bin"), dst=os.path.join(self.package_folder, "bin"), excludes=("msvcp140.dll", "vcruntime140.dll", "vcruntime140_1.dll")) copy(self, pattern="*", - src=os.path.join(source_folder, "include"), + src=os.path.join(build_folder, "include"), dst=os.path.join(self.package_folder, "include")) copy(self, pattern="*", - src=os.path.join(source_folder, "lib"), + src=os.path.join(build_folder, "lib"), dst=os.path.join(self.package_folder, "lib")) copy(self, pattern="*", - src=os.path.join(source_folder, "jmods"), + src=os.path.join(build_folder, "jmods"), dst=os.path.join(self.package_folder, "lib", "jmods")) copy(self, pattern="*", - src=os.path.join(source_folder, "legal"), + src=os.path.join(build_folder, "legal"), dst=os.path.join(self.package_folder, "licenses")) # conf folder is required for security settings, to avoid # java.lang.SecurityException: Can't read cryptographic policy directory: unlimited # https://github.com/conan-io/conan-center-index/pull/4491#issuecomment-774555069 copy(self, pattern="*", - src=os.path.join(source_folder, "conf"), + src=os.path.join(build_folder, "conf"), dst=os.path.join(self.package_folder, "conf")) def package_info(self): self.output.info(f"Creating JAVA_HOME environment variable with : {self.package_folder}") - self.runenv_info.append("JAVA_HOME", self.package_folder) - self.buildenv_info.append("JAVA_HOME", self.package_folder) + self.runenv_info.define_path("JAVA_HOME", self.package_folder) + self.buildenv_info.define_path("JAVA_HOME", self.package_folder) # TODO: remove `env_info` once the recipe is only compatible with Conan >= 2.0 self.env_info.JAVA_HOME = self.package_folder diff --git a/recipes/openjdk/config.yml b/recipes/openjdk/config.yml index 1e9a2a92440d26..c2d6c3ae88d916 100644 --- a/recipes/openjdk/config.yml +++ b/recipes/openjdk/config.yml @@ -1,4 +1,6 @@ versions: + "21.0.2": + folder: all "21.0.1": folder: all "19.0.2": diff --git a/recipes/openldap/all/conandata.yml b/recipes/openldap/all/conandata.yml index 9fc035f4ad1451..0b8d44649e6e88 100644 --- a/recipes/openldap/all/conandata.yml +++ b/recipes/openldap/all/conandata.yml @@ -1,8 +1,7 @@ sources: + "2.6.7": + url: "https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.6.7.tgz" + sha256: "cd775f625c944ed78a3da18a03b03b08eea73c8aabc97b41bb336e9a10954930" "2.6.1": - url: https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.6.1.tgz - sha256: 9d576ea6962d7db8a2e2808574e8c257c15aef55f403a1fb5a0faf35de70e6f3 -patches: - "2.6.1": - - base_path: source_subfolder - patch_file: patches/configure-2.6.1.patch + url: "https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.6.1.tgz" + sha256: "9d576ea6962d7db8a2e2808574e8c257c15aef55f403a1fb5a0faf35de70e6f3" diff --git a/recipes/openldap/all/conanfile.py b/recipes/openldap/all/conanfile.py index 49a19895302e6e..dd459608a66e37 100644 --- a/recipes/openldap/all/conanfile.py +++ b/recipes/openldap/all/conanfile.py @@ -1,110 +1,114 @@ import os -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.43.0" + +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 chdir, copy, get, rm, rmdir, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" class OpenldapConan(ConanFile): name = "openldap" - description = "OpenLDAP C++ library" + description = "OpenLDAP C library" + license = "OLDAP-2.8" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.openldap.org/" - license = "OLDAP-2.8" topics = ("ldap", "load-balancer", "directory-access") - exports_sources = ["patches/*"] - settings = settings = "os", "compiler", "build_type", "arch" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "with_cyrus_sasl": [True, False] + "with_cyrus_sasl": [True, False], } default_options = { "shared": False, "fPIC": True, - "with_cyrus_sasl": True - + "with_cyrus_sasl": True, } - _autotools = None - _configure_vars = None - - @property - def _source_subfolder(self): - return "source_subfolder" def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") - def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("openssl/1.1.1q") + self.requires("openssl/[>=1.1 <4]") if self.options.with_cyrus_sasl: - self.requires("cyrus-sasl/2.1.27") + self.requires("cyrus-sasl/2.1.28") def validate(self): - if self.settings.os != "Linux": - raise ConanInvalidConfiguration( - f"{self.name} is only supported on Linux") - - def _configure_autotools(self): - if self._autotools: - return self._autotools - - def yes_no(v): return "yes" if v else "no" - self._autotools = AutoToolsBuildEnvironment(self) - configure_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration(f"{self.name} is only supported on Linux") + + 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") + + def yes_no(v): + return "yes" if v else "no" + + tc = AutotoolsToolchain(self) + tc.configure_args += [ "--with-cyrus_sasl={}".format(yes_no(self.options.with_cyrus_sasl)), - "--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True))), "--without-fetch", "--with-tls=openssl", - "--enable-auditlog"] - self._configure_vars = self._autotools.vars - self._configure_vars["systemdsystemunitdir"] = os.path.join( - self.package_folder, "res") - - # Need to link to -pthread instead of -lpthread for gcc 8 shared=True - # on CI job. Otherwise, linking fails. - self._autotools.libs.remove("pthread") - self._configure_vars["LIBS"] = self._configure_vars["LIBS"].replace( - "-lpthread", "-pthread") - - self._autotools.configure( - args=configure_args, - configure_dir=self._source_subfolder, - vars=self._configure_vars) - return self._autotools + "--enable-auditlog", + "--libexecdir=${prefix}/bin", + f"systemdsystemunitdir={os.path.join(self.package_folder, 'res')}", + ] + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "WITH_SYSTEMD=no\nsystemdsystemunitdir=", "WITH_SYSTEMD=no") def build(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - autotools = self._configure_autotools() - - autotools.make(vars=self._configure_vars) + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - autotools = self._configure_autotools() - autotools.install(vars=self._configure_vars) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("COPYRIGHT", dst="licenses", src=self._source_subfolder) - for folder in ["var", "share", "etc", "lib/pkgconfig", "res"]: - tools.rmdir(os.path.join(self.package_folder, folder)) - tools.remove_files_by_mask( - os.path.join( - self.package_folder, - "lib"), - "*.la") + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "COPYRIGHT", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + rm(self, "*.la", self.package_folder, recursive=True) + for folder in ["var", "share", "etc", os.path.join("lib", "pkgconfig"), "home"]: + rmdir(self, os.path.join(self.package_folder, folder)) def package_info(self): - bin_path = os.path.join(self.package_folder, "bin") - self.env_info.PATH.append(bin_path) - self.output.info( - "Appending PATH environment variable: {}".format(bin_path)) + self.cpp_info.components["ldap"].set_property("pkg_config_name", "ldap") + self.cpp_info.components["ldap"].libs = ["ldap"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ldap"].system_libs = ["pthread", "resolv"] + self.cpp_info.components["ldap"].requires = ["lber", "openssl::ssl", "openssl::crypto"] + if self.options.with_cyrus_sasl: + self.cpp_info.components["ldap"].requires.append("cyrus-sasl::cyrus-sasl") - self.cpp_info.libs = ["ldap", "lber"] + self.cpp_info.components["lber"].set_property("pkg_config_name", "lber") + self.cpp_info.components["lber"].libs = ["lber"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["pthread"] + self.cpp_info.components["lber"].system_libs = ["pthread"] + + # TODO: to remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_path) diff --git a/recipes/openldap/all/patches/configure-2.6.1.patch b/recipes/openldap/all/patches/configure-2.6.1.patch deleted file mode 100644 index 9fb405dfefc109..00000000000000 --- a/recipes/openldap/all/patches/configure-2.6.1.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/configure b/configure -index 8521174..8ea6133 100755 ---- a/configure -+++ b/configure -@@ -22337,7 +22337,6 @@ $as_echo "$as_me: WARNING: Strong authentication not supported!" >&2;} - fi - - WITH_SYSTEMD=no --systemdsystemunitdir= - ol_link_systemd=no - if test $ol_enable_slapd == no && test $ol_enable_balancer != yes ; then - if test $ol_with_systemd != no ; then diff --git a/recipes/openldap/all/test_package/CMakeLists.txt b/recipes/openldap/all/test_package/CMakeLists.txt index fb813fde0a56b6..c77039fd606a90 100644 --- a/recipes/openldap/all/test_package/CMakeLists.txt +++ b/recipes/openldap/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) -find_package(openldap CONFIG REQUIRED) -add_executable(${PROJECT_NAME} test_package.cpp) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(openldap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} openldap::openldap) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/openldap/all/test_package/conanfile.py b/recipes/openldap/all/test_package/conanfile.py index 49a3a66ea5bad4..ef5d7042163ecc 100644 --- a/recipes/openldap/all/test_package/conanfile.py +++ b/recipes/openldap/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", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/openldap/all/test_package/test_package.cpp b/recipes/openldap/all/test_package/test_package.c similarity index 99% rename from recipes/openldap/all/test_package/test_package.cpp rename to recipes/openldap/all/test_package/test_package.c index ab1267d80b23a4..ca578bf88f1df8 100644 --- a/recipes/openldap/all/test_package/test_package.cpp +++ b/recipes/openldap/all/test_package/test_package.c @@ -29,10 +29,11 @@ * for inclusion in OpenLDAP software. */ -#include -#include #include "openldap.h" +#include +#include + static int do_uri_create(LDAPURLDesc *lud) { char *uri; diff --git a/recipes/openldap/all/test_v1_package/CMakeLists.txt b/recipes/openldap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/openldap/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/recipes/cairo/all/test_v1_package/conanfile.py b/recipes/openldap/all/test_v1_package/conanfile.py similarity index 87% rename from recipes/cairo/all/test_v1_package/conanfile.py rename to recipes/openldap/all/test_v1_package/conanfile.py index 24f9e474d6cd2d..49a3a66ea5bad4 100644 --- a/recipes/cairo/all/test_v1_package/conanfile.py +++ b/recipes/openldap/all/test_v1_package/conanfile.py @@ -12,7 +12,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self, skip_x64_x86=True): + if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") self.run(bin_path, run_environment=True) - diff --git a/recipes/openldap/config.yml b/recipes/openldap/config.yml index 36b28f1209ae76..7177bd469e00de 100644 --- a/recipes/openldap/config.yml +++ b/recipes/openldap/config.yml @@ -1,3 +1,5 @@ versions: + "2.6.7": + folder: all "2.6.1": folder: all diff --git a/recipes/openssh/all/conandata.yml b/recipes/openssh/all/conandata.yml new file mode 100644 index 00000000000000..e3ccaa5b6d5e6b --- /dev/null +++ b/recipes/openssh/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "9.6p1": + url: "https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.6p1.tar.gz" + sha256: "910211c07255a8c5ad654391b40ee59800710dd8119dd5362de09385aa7a777c" + "9.1p1": + url: "https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.1p1.tar.gz" + sha256: "19f85009c7e3e23787f0236fbb1578392ab4d4bf9f8ec5fe6bc1cd7e8bfdd288" diff --git a/recipes/openssh/all/conanfile.py b/recipes/openssh/all/conanfile.py new file mode 100644 index 00000000000000..19003f0d0b8c01 --- /dev/null +++ b/recipes/openssh/all/conanfile.py @@ -0,0 +1,132 @@ +from os.path import join + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rmdir, export_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.54.0" + + +class PackageConan(ConanFile): + name = "openssh" + description = "The OpenSSH (portable) suite of secure connectivity tools" + license = "SSH-OpenSSH" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.openssh.com/portable.html" + topics = ("security", "cryptography", "login", "keychain", "file-sharing", "ssh") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_libcrypto": [False, "libressl", "openssl"], + "with_pam": [False, "openpam"], # linux-pam and Solaris PAM are also supported + "with_selinux": [True, False], + "with_libedit": [True, False], + "with_sandbox": [False, "auto", "capsicum", "darwin", "rlimit", "seccomp_filter", "systrace", "pledge"] + } + default_options = { + "with_libcrypto": "openssl", + "with_pam": False, + "with_selinux": False, + "with_libedit": False, + "with_sandbox": "auto" + } + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + 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("zlib/[>=1.2.11 <2]") + if self.options.with_libcrypto == "openssl": + self.requires("openssl/[>=1.1 <=3.1]") + elif self.options.with_libcrypto == "libressl": + self.requires("libressl/3.9.1") + if self.options.with_pam == "openpam": + self.requires("openpam/20190224") + if self.options.with_libedit: + self.requires("editline/3.1") + + def validate(self): + if self.settings.os in ["baremetal", "Windows"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + ad = AutotoolsDeps(self) + ad.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.append("--without-zlib-version-check") + + if self.options.with_selinux: + tc.configure_args.append("--with-selinux") + + if self.options.with_pam: + tc.configure_args.append("--with-pam") + + if self.options.with_libedit: + editline = self.dependencies["editline"] + tc.configure_args.append("--with-libedit={}".format(editline.package_folder)) + + if self.options.with_libcrypto == "openssl": + openssl = self.dependencies["openssl"] + tc.configure_args.append("--with-ssl-dir={}".format(openssl.package_folder)) + # It needs libcrypto.so in build time context + if openssl.options.shared: + env = VirtualRunEnv(self) + env.generate(scope="build") + elif self.options.with_libcrypto == "libressl": + libressl = self.dependencies["libressl"] + tc.configure_args.append("--with-ssl-dir={}".format(libressl.package_folder)) + else: + tc.configure_args.append("--without-openssl") + + if self.options.with_sandbox != 'auto': + tc.configure_args.append("--with-sandbox={}".format(self.options.with_sandbox or "no")) + + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + + install_target = 'install-nokeys' if cross_building(self) else 'install' + autotools.install(target=install_target) + + copy(self, "LICENCE", src=self.source_folder, dst=join(self.package_folder, "licenses"), ignore_case=True) + copy(self, "*", src=join(self.package_folder, "libexec"), dst=join(self.package_folder, "bin"), ignore_case=True) + + rmdir(self, join(self.package_folder, "etc")) + rmdir(self, join(self.package_folder, "var")) + rmdir(self, join(self.package_folder, "share")) + rmdir(self, join(self.package_folder, "libexec")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + bindir = join(self.package_folder, "bin") + self.runenv_info.prepend_path("PATH", bindir) diff --git a/recipes/openssh/all/test_package/conanfile.py b/recipes/openssh/all/test_package/conanfile.py new file mode 100644 index 00000000000000..6198df68dc282d --- /dev/null +++ b/recipes/openssh/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + pass + + def test(self): + if can_run(self): + self.run("ssh -Q help", env="conanrun") diff --git a/recipes/openssh/config.yml b/recipes/openssh/config.yml new file mode 100644 index 00000000000000..a033c3a0343f30 --- /dev/null +++ b/recipes/openssh/config.yml @@ -0,0 +1,5 @@ +versions: + "9.6p1": + folder: all + "9.1p1": + folder: all diff --git a/recipes/openssl/1.x.x/conanfile.py b/recipes/openssl/1.x.x/conanfile.py index 073a01dcd3cdc1..55815e5161b538 100644 --- a/recipes/openssl/1.x.x/conanfile.py +++ b/recipes/openssl/1.x.x/conanfile.py @@ -539,10 +539,6 @@ def package(self): 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) - if self.settings.build_type == "Debug": - with chdir(self, os.path.join(self.package_folder, "lib")): - rename(self, "libssl.lib", "libssld.lib") - rename(self, "libcrypto.lib", "libcryptod.lib") else: autotools = Autotools(self) with chdir(self, self.source_folder): @@ -619,9 +615,8 @@ def package_info(self): 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: - libsuffix = "d" if self.settings.build_type == "Debug" else "" - self.cpp_info.components["ssl"].libs = ["libssl" + libsuffix] - self.cpp_info.components["crypto"].libs = ["libcrypto" + libsuffix] + 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"] diff --git a/recipes/openssl/3.x.x/conanfile.py b/recipes/openssl/3.x.x/conanfile.py index 975619cd1b9110..c858b3551b71d4 100644 --- a/recipes/openssl/3.x.x/conanfile.py +++ b/recipes/openssl/3.x.x/conanfile.py @@ -451,7 +451,7 @@ def _create_targets(self, cflags, cxxflags, defines, ldflags): if self._perlasm_scheme: perlasm_scheme = 'perlasm_scheme => "%s",' % self._perlasm_scheme - defines = " ".join(defines) + defines = '", "'.join(defines) defines = 'defines => add("%s"),' % defines if defines else "" targets = "my %targets" @@ -554,12 +554,6 @@ def package(self): for filename in files: if fnmatch.fnmatch(filename, "*.pdb"): os.unlink(os.path.join(self.package_folder, root, filename)) - if self._use_nmake: - if self.settings.build_type == "Debug": - with chdir(self, os.path.join(self.package_folder, "lib")): - rename(self, "libssl.lib", "libssld.lib") - rename(self, "libcrypto.lib", "libcryptod.lib") - if self.options.shared: libdir = os.path.join(self.package_folder, "lib") for file in os.listdir(libdir): @@ -649,9 +643,8 @@ def package_info(self): self.cpp_info.components["crypto"].set_property("cmake_build_modules", [self._module_file_rel_path]) if self._use_nmake: - libsuffix = "d" if self.settings.build_type == "Debug" else "" - self.cpp_info.components["ssl"].libs = ["libssl" + libsuffix] - self.cpp_info.components["crypto"].libs = ["libcrypto" + libsuffix] + 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"] diff --git a/recipes/opentelemetry-cpp/all/conandata.yml b/recipes/opentelemetry-cpp/all/conandata.yml index f30d3731760b0b..ce31f611ba274b 100644 --- a/recipes/opentelemetry-cpp/all/conandata.yml +++ b/recipes/opentelemetry-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "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" diff --git a/recipes/opentelemetry-cpp/all/conanfile.py b/recipes/opentelemetry-cpp/all/conanfile.py index f96b644388da04..60940dcfcab3b3 100644 --- a/recipes/opentelemetry-cpp/all/conanfile.py +++ b/recipes/opentelemetry-cpp/all/conanfile.py @@ -92,6 +92,8 @@ def config_options(self): 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: @@ -110,8 +112,10 @@ def requirements(self): if self.options.with_abseil: self.requires("abseil/20230125.3", transitive_headers=True) - if self.options.with_otlp_grpc: + 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 @@ -170,9 +174,11 @@ def validate(self): raise ConanInvalidConfiguration("opentelemetry-cpp >= 1.12.0 does not support Apple Clang on Conan v1") def build_requirements(self): - if self.options.with_otlp_grpc: - self.tool_requires("opentelemetry-proto/1.0.0") + 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): @@ -216,7 +222,8 @@ def generate(self): 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 - tc.cache_variables["WITH_LOGS_PREVIEW"] = self.options.with_logs_preview + 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 @@ -286,6 +293,7 @@ def _otel_libraries(self): "opentelemetry_trace", "opentelemetry_version", ] + 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) @@ -298,17 +306,17 @@ def _otel_libraries(self): libraries.append("opentelemetry_exporter_otlp_grpc") libraries.append("opentelemetry_exporter_otlp_grpc_metrics") libraries.append("opentelemetry_exporter_otlp_grpc_client") - if self.options.with_logs_preview: + if Version(self.version) >= "1.11" or self.options.with_logs_preview: libraries.append("opentelemetry_exporter_otlp_grpc_log") if self.options.with_otlp_http: libraries.append("opentelemetry_exporter_otlp_http") libraries.append("opentelemetry_exporter_otlp_http_client") libraries.append("opentelemetry_exporter_otlp_http_metric") - if self.options.with_logs_preview: + 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") @@ -316,7 +324,7 @@ def _otel_libraries(self): libraries.append("opentelemetry_exporter_jaeger_trace") libraries.append("opentelemetry_metrics") libraries.append("opentelemetry_exporter_ostream_metrics") - if self.options.with_logs_preview: + if Version(self.version) >= "1.11" or self.options.with_logs_preview: libraries.extend([ "opentelemetry_logs", "opentelemetry_exporter_ostream_logs", @@ -347,7 +355,7 @@ def package_info(self): self.cpp_info.components["opentelemetry_exporter_in_memory"].libs = [] - if self.options.with_logs_preview: + if Version(self.version) >= "1.11" or self.options.with_logs_preview: self.cpp_info.components["opentelemetry_logs"].requires.extend([ "opentelemetry_resources", "opentelemetry_common", @@ -379,6 +387,11 @@ def package_info(self): "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++", @@ -395,7 +408,7 @@ def package_info(self): "opentelemetry_exporter_otlp_grpc_client" ]) - if self.options.with_logs_preview: + 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", @@ -425,7 +438,7 @@ def package_info(self): "opentelemetry_exporter_otlp_http_client" ]) - if self.options.with_logs_preview: + 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", diff --git a/recipes/opentelemetry-cpp/config.yml b/recipes/opentelemetry-cpp/config.yml index a678af123ada5d..2d959457e4aec9 100644 --- a/recipes/opentelemetry-cpp/config.yml +++ b/recipes/opentelemetry-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.14.2": + folder: all "1.12.0": folder: all "1.9.1": diff --git a/recipes/opentelemetry-proto/all/conandata.yml b/recipes/opentelemetry-proto/all/conandata.yml index 818f6d6956d04b..2b4c67bbf05e03 100644 --- a/recipes/opentelemetry-proto/all/conandata.yml +++ b/recipes/opentelemetry-proto/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "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" diff --git a/recipes/opentelemetry-proto/config.yml b/recipes/opentelemetry-proto/config.yml index 471fe8eea644fd..595b08059c4fa3 100644 --- a/recipes/opentelemetry-proto/config.yml +++ b/recipes/opentelemetry-proto/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.0": folder: all "1.0.0": diff --git a/recipes/openvdb/all/CMakeLists.txt b/recipes/openvdb/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33fc..00000000000000 --- a/recipes/openvdb/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/openvdb/all/conandata.yml b/recipes/openvdb/all/conandata.yml index 902318df1e3aec..35817586160ea9 100644 --- a/recipes/openvdb/all/conandata.yml +++ b/recipes/openvdb/all/conandata.yml @@ -1,8 +1,10 @@ sources: - "8.0.1": - url: "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v8.0.1.tar.gz" - sha256: "a6845da7c604d2c72e4141c898930ac8a2375521e535f696c2cd92bebbe43c4f" -patches: - "8.0.1": - - patch_file: "patches/0001-Find-packages-fixes.patch" - base_path: "source_subfolder" + "11.0.0": + url: "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v11.0.0.tar.gz" + sha256: "6314ff1db057ea90050763e7b7d7ed86d8224fcd42a82cdbb9c515e001b96c74" + "10.1.0": + url: "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v10.1.0.tar.gz" + sha256: "2746236e29659a0d35ab90d832f7c7987dd2537587a1a2f9237d9c98afcd5817" + "9.1.0": + url: "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v9.1.0.tar.gz" + sha256: "914ee417b4607c75c95b53bc73a0599de4157c7d6a32e849e80f24e40fb64181" diff --git a/recipes/openvdb/all/conanfile.py b/recipes/openvdb/all/conanfile.py index 10e73dc4150e40..5f385526168c27 100644 --- a/recipes/openvdb/all/conanfile.py +++ b/recipes/openvdb/all/conanfile.py @@ -1,11 +1,16 @@ -from conan.tools.microsoft import is_msvc -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools import os +import re + +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.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, replace_in_file +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version - -required_conan_version = ">=1.45.0" +required_conan_version = ">=1.53.0" class OpenVDBConan(ConanFile): @@ -16,232 +21,281 @@ class OpenVDBConan(ConanFile): "manipulation of sparse volumetric data discretized on three-dimensional grids." ) license = "MPL-2.0" - topics = ("voxel", "voxelizer", "volume-rendering", "fx") - homepage = "https://github.com/AcademySoftwareFoundation/openvdb" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AcademySoftwareFoundation/openvdb" + topics = ("voxel", "voxelizer", "volume-rendering", "fx", "vdb") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], + "build_ax": [True, False], + "simd": [None, "SSE42", "AVX"], + "use_colored_output": [True, False], + "use_delayed_loading": [True, False], + "use_explicit_instantiation": [True, False], + "use_imath_half": [True, False], "with_blosc": [True, False], - "with_zlib": [True, False], + # Deprecated because EXR is only used when building executables, which the recipe does not support + "with_exr": ["deprecated", True, False], "with_log4cplus": [True, False], - "with_exr": [True, False], - "simd": [None, "SSE42", "AVX"], + "with_zlib": [True, False], } default_options = { "shared": False, "fPIC": True, + "build_ax": False, + "simd": None, + "use_colored_output": False, + "use_delayed_loading": False, + "use_explicit_instantiation": False, + "use_imath_half": True, "with_blosc": True, + "with_exr": "deprecated", + "with_log4cplus": False, # Disabled by default because it is not compatible with C++17 "with_zlib": True, - "with_log4cplus": False, - "with_exr": False, - "simd": None, } - - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" + options_description = { + "build_ax": "Build the OpenVDB AX library.", + "simd": ( + "Choose whether to enable SIMD compiler flags or not. " + "Although not required, it is strongly recommended to enable SIMD. AVX implies SSE42." + ), + "use_colored_output": "Always produce ANSI-colored output (GNU/Clang only).", + "use_delayed_loading": "Build the core OpenVDB library with delayed-loading.", + "use_explicit_instantiation": ( + "Use explicit instantiation for all supported classes and methods against a pre-defined " + "list of OpenVDB trees. This makes the core library larger and slower to compile, but speeds up " + "the compilation of all dependent code by bypassing the expensive template instantiation. " + "Disabled by default in ConanCenter to avoid excessive memory usage during compilation." + ), + "use_imath_half": ( + "Use the definition of half-precision floating point types from the Imath library. " + "If False, the embedded definition provided by OpenVDB is used. " + "You may set this to on to force Imath half to be used if you know it to be required." + ), + "with_blosc": "Use Blosc for improved disk compression. Recommended.", + "with_log4cplus": "Use log4cplus for improved OpenVDB Logging.", + "with_zlib": "Use ZLib for disk serialization compression. ZLib can only be disabled if Blosc is also disabled.", + } @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return 17 if Version(self.version) >= "10.0.0" else 14 @property def _compilers_min_version(self): - return { - "msvc": "191", - "Visual Studio": "15", # Should we check toolset? - "gcc": "6.3.1", - "clang": "3.8", - "apple-clang": "3.8", - "intel": "17", - } - - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + if Version(self.version) >= "10.0.0": + # https://github.com/AcademySoftwareFoundation/openvdb/blob/v10.0.1/doc/dependencies.txt#L56-L84 + return { + "msvc": "192.8", + "Visual Studio": "16", + "gcc": "9.3.1", + "clang": "5.0", + "apple-clang": "12.0", + "intel-cc": "19", + } + else: + # https://github.com/AcademySoftwareFoundation/openvdb/blob/v9.1.0/doc/dependencies.txt#L56-L84 + return { + "msvc": "191.0", + "Visual Studio": "15", + "gcc": "6.3.1", + "clang": "3.8", + "apple-clang": "10.0", + "intel-cc": "17", + } def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if is_msvc(self): + # Supported by GCC and Clang only + del self.options.use_colored_output + if Version(self.version) < "10.0.0": + del self.options.use_explicit_instantiation + del self.options.use_delayed_loading 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 package_id(self): + # with_exr is deprecated and has no effect + del self.info.options.with_exr def requirements(self): - self.requires("boost/1.79.0") - self.requires("onetbb/2020.3") - self.requires("openexr/2.5.7") # required for IlmBase::Half + # https://github.com/AcademySoftwareFoundation/openvdb/blob/v10.0.1/doc/dependencies.txt#L36-L84 + self.requires("boost/1.84.0", transitive_headers=True) + self.requires("onetbb/2021.10.0", transitive_headers=True, transitive_libs=True) + if self.options.use_imath_half: + self.requires("imath/3.1.9", transitive_headers=True, transitive_libs=True) if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") - if self.options.with_exr: - # Not necessary now. Required for IlmBase::IlmImf - self.requires("openexr/2.5.7") if self.options.with_blosc: - self.requires("c-blosc/1.21.1") + self.requires("c-blosc/1.21.5") if self.options.with_log4cplus: - self.requires("log4cplus/2.0.7") + # log4cplus 2.x is not supported + self.requires("log4cplus/1.2.2", transitive_headers=True) - def _check_compilier_version(self): + def _check_compiler_version(self): compiler = str(self.settings.compiler) - version = tools.Version(self.settings.compiler.version) minimum_version = self._compilers_min_version.get(compiler, False) - if minimum_version and version < minimum_version: - raise ConanInvalidConfiguration(f"{self.name} requires a {compiler} version greater than {minimum_version}") + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.name} requires a {compiler} version greater than {minimum_version}" + ) def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 14) + check_min_cppstd(self, self._min_cppstd) if self.settings.arch not in ("x86", "x86_64"): if self.options.simd: raise ConanInvalidConfiguration("Only intel architectures support SSE4 or AVX.") - self._check_compilier_version() + self._check_compiler_version() + if self.options.with_exr != "deprecated": + self.output.warning("with_exr option is deprecated, do not use anymore.") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if Version(self.version) >= "10.0.0": + self.tool_requires("cmake/[>=3.18 <4]") + if self.options.build_ax: + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.25") + else: + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + tc.variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared + tc.variables["OPENVDB_BUILD_AX"] = self.options.build_ax + tc.variables["OPENVDB_BUILD_BINARIES"] = False + tc.variables["OPENVDB_BUILD_CORE"] = True + tc.variables["OPENVDB_BUILD_DOCS"] = False + tc.variables["OPENVDB_BUILD_HOUDINI_ABITESTS"] = False + tc.variables["OPENVDB_BUILD_HOUDINI_PLUGIN"] = False + tc.variables["OPENVDB_BUILD_MAYA_PLUGIN"] = False + tc.variables["OPENVDB_BUILD_NANOVDB"] = False # nanovdb should be packaged separately in CCI + tc.variables["OPENVDB_BUILD_PYTHON_MODULE"] = False + tc.variables["OPENVDB_CORE_SHARED"] = self.options.shared + tc.variables["OPENVDB_CORE_STATIC"] = not self.options.shared + tc.variables["OPENVDB_CXX_STRICT"] = False + tc.variables["OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING"] = True + tc.variables["OPENVDB_ENABLE_RPATH"] = True + tc.variables["OPENVDB_ENABLE_UNINSTALL"] = False + tc.variables["OPENVDB_FUTURE_DEPRECATION"] = True + tc.variables["OPENVDB_INSTALL_CMAKE_MODULES"] = False + tc.variables["OPENVDB_SIMD"] = self.options.simd + tc.variables["OPENVDB_USE_DELAYED_LOADING"] = self.options.get_safe("use_delayed_loading", False) + tc.variables["USE_AX"] = False # used only by Python bindings and the Houdini plugin + tc.variables["USE_BLOSC"] = self.options.with_blosc + tc.variables["USE_COLORED_OUTPUT"] = self.options.get_safe("use_colored_output", False) + tc.variables["USE_EXPLICIT_INSTANTIATION"] = self.options.get_safe("use_explicit_instantiation", False) + tc.variables["USE_EXR"] = False + tc.variables["USE_HOUDINI"] = False + tc.variables["USE_IMATH_HALF"] = self.options.get_safe("use_imath_half", False) + tc.variables["USE_LOG4CPLUS"] = self.options.with_log4cplus + tc.variables["USE_MAYA"] = False + tc.variables["USE_NANOVDB"] = False + tc.variables["USE_PKGCONFIG"] = False + tc.variables["USE_PNG"] = False + tc.variables["USE_STATIC_DEPENDENCIES"] = False + tc.variables["USE_TBB"] = True # Only affects the nanovdb component + tc.variables["USE_ZLIB"] = self.options.with_zlib + tc.generate() + + tc = CMakeDeps(self) + tc.set_property("c-blosc", "cmake_file_name", "Blosc") + tc.set_property("c-blosc", "cmake_target_name", "Blosc::blosc") + tc.set_property("openexr", "cmake_file_name", "IlmBase") + tc.set_property("openexr::ilmbase_half", "cmake_target_name", "IlmBase::Half") + tc.set_property("log4cplus", "cmake_target_name", "Log4cplus::log4cplus") + tc.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) # Remove FindXXX files from OpenVDB. Let Conan do the job - tools.remove_files_by_mask(os.path.join(self._source_subfolder, "cmake"), "Find*") - with open("FindBlosc.cmake", "w") as f: - f.write( - """find_package(c-blosc) -if(c-blosc_FOUND) - add_library(blosc INTERFACE) - target_link_libraries(blosc INTERFACE c-blosc::c-blosc) - add_library(Blosc::blosc ALIAS blosc) -endif() -""" - ) - with open("FindIlmBase.cmake", "w") as f: - f.write( - """find_package(OpenEXR) -if(OpenEXR_FOUND) - add_library(Half INTERFACE) - add_library(IlmThread INTERFACE) - add_library(Iex INTERFACE) - add_library(Imath INTERFACE) - add_library(IlmImf INTERFACE) - target_link_libraries(Half INTERFACE OpenEXR::OpenEXR) - target_link_libraries(IlmThread INTERFACE OpenEXR::OpenEXR) - target_link_libraries(Iex INTERFACE OpenEXR::OpenEXR) - target_link_libraries(Imath INTERFACE OpenEXR::OpenEXR) - target_link_libraries(IlmImf INTERFACE OpenEXR::OpenEXR) - add_library(IlmBase::Half ALIAS Half) - add_library(IlmBase::IlmThread ALIAS IlmThread) - add_library(IlmBase::Iex ALIAS Iex) - add_library(IlmBase::Imath ALIAS Imath) - add_library(OpenEXR::IlmImf ALIAS IlmImf) - endif() - """ - ) + rm(self, "Find*.cmake", os.path.join(self.source_folder, "cmake"), recursive=True) + # Relax version checks in find_package(), + # since the config/module files produced by CMakeDeps do not support gt major version checks + cmakelists = self.source_path.joinpath("openvdb", "openvdb", "CMakeLists.txt") + cmakelists.write_text(re.sub(r"\$\{MINIMUM_\S+_VERSION}", "", cmakelists.read_text())) + replace_in_file(self, os.path.join(self.source_folder, "openvdb", "openvdb", "CMakeLists.txt"), + "OPENVDB_FUTURE_DEPRECATION", "FALSE") def build(self): self._patch_sources() - cmake = self._configure_cmake() - cmake.build() - - @functools.lru_cache(1) - def _configure_cmake(self): cmake = CMake(self) - # exposed options - cmake.definitions["USE_BLOSC"] = self.options.with_blosc - cmake.definitions["USE_ZLIB"] = self.options.with_zlib - cmake.definitions["USE_LOG4CPLUS"] = self.options.with_log4cplus - cmake.definitions["USE_EXR"] = self.options.with_exr - cmake.definitions["OPENVDB_SIMD"] = self.options.simd - - cmake.definitions["OPENVDB_CORE_SHARED"] = self.options.shared - cmake.definitions["OPENVDB_CORE_STATIC"] = not self.options.shared - - # All available options but not exposed yet. Set to default values - cmake.definitions["OPENVDB_BUILD_CORE"] = True - cmake.definitions["OPENVDB_BUILD_BINARIES"] = False - cmake.definitions["OPENVDB_BUILD_PYTHON_MODULE"] = False - cmake.definitions["OPENVDB_BUILD_UNITTESTS"] = False - cmake.definitions["OPENVDB_BUILD_DOCS"] = False - cmake.definitions["OPENVDB_BUILD_HOUDINI_PLUGIN"] = False - cmake.definitions["OPENVDB_BUILD_HOUDINI_ABITESTS"] = False - - cmake.definitions["OPENVDB_BUILD_AX"] = False - cmake.definitions["OPENVDB_BUILD_AX_BINARIES"] = False - cmake.definitions["OPENVDB_BUILD_AX_UNITTESTS"] = False - - cmake.definitions["OPENVDB_BUILD_MAYA_PLUGIN"] = False - cmake.definitions["OPENVDB_ENABLE_RPATH"] = False - cmake.definitions["OPENVDB_CXX_STRICT"] = False - cmake.definitions["USE_HOUDINI"] = False - cmake.definitions["USE_MAYA"] = False - cmake.definitions["USE_STATIC_DEPENDENCIES"] = False - cmake.definitions["USE_PKGCONFIG"] = False - cmake.definitions["OPENVDB_INSTALL_CMAKE_MODULES"] = False - - cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared - cmake.definitions["OPENEXR_USE_STATIC_LIBS"] = not self.options["openexr"].shared - - cmake.definitions["OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING"] = True - - cmake.configure(build_folder=self._build_subfolder) - return cmake + cmake.configure() + cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) cmake.install() + @property + def _public_defines(self): + defines = [] + if self.options.shared: + defines.append("OPENVDB_DLL") + else: + defines.append("OPENVDB_STATICLIB") + if self.settings.os == "Windows": + defines.append("_WIN32") + defines.append("NOMINMAX") + if self.options.with_log4cplus: + defines.append("OPENVDB_USE_LOG4CPLUS") + return defines + def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "OpenVDB") self.cpp_info.set_property("cmake_target_name", "OpenVDB::openvdb") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + main_component = self.cpp_info.components["openvdb-core"] lib_prefix = "lib" if is_msvc(self) and not self.options.shared else "" - self.cpp_info.components["openvdb-core"].libs = [lib_prefix + "openvdb"] - - lib_define = "OPENVDB_DLL" if self.options.shared else "OPENVDB_STATICLIB" - self.cpp_info.components["openvdb-core"].defines.append(lib_define) - - if self.settings.os == "Windows": - self.cpp_info.components["openvdb-core"].defines.append("_WIN32") - self.cpp_info.components["openvdb-core"].defines.append("NOMINMAX") - - if not self.options["openexr"].shared: - self.cpp_info.components["openvdb-core"].defines.append("OPENVDB_OPENEXR_STATICLIB") - if self.options.with_exr: - self.cpp_info.components["openvdb-core"].defines.append("OPENVDB_TOOLS_RAYTRACER_USE_EXR") - if self.options.with_log4cplus: - self.cpp_info.components["openvdb-core"].defines.append("OPENVDB_USE_LOG4CPLUS") + main_component.libs = [lib_prefix + "openvdb"] + main_component.defines = self._public_defines + if self.settings.os in ("Linux", "FreeBSD"): + main_component.system_libs = ["pthread"] - self.cpp_info.components["openvdb-core"].requires = [ + main_component.requires = [ "boost::iostreams", "boost::system", "onetbb::onetbb", - "openexr::openexr", # should be "openexr::Half", ] if self.settings.os == "Windows": - self.cpp_info.components["openvdb-core"].requires.append("boost::disable_autolinking") - + main_component.requires.append("boost::disable_autolinking") if self.options.with_zlib: - self.cpp_info.components["openvdb-core"].requires.append("zlib::zlib") + main_component.requires.append("zlib::zlib") if self.options.with_blosc: - self.cpp_info.components["openvdb-core"].requires.append("c-blosc::c-blosc") + main_component.requires.append("c-blosc::c-blosc") if self.options.with_log4cplus: - self.cpp_info.components["openvdb-core"].requires.append("log4cplus::log4cplus") - - if self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.components["openvdb-core"].system_libs = ["pthread"] + main_component.requires.append("log4cplus::log4cplus") + if self.options.use_imath_half: + main_component.requires.append("imath::imath") # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "OpenVDB" self.cpp_info.names["cmake_find_package_multi"] = "OpenVDB" - self.cpp_info.components["openvdb-core"].names["cmake_find_package"] = "openvdb" - self.cpp_info.components["openvdb-core"].names["cmake_find_package_multi"] = "openvdb" - self.cpp_info.components["openvdb-core"].set_property("cmake_target_name", "OpenVDB::openvdb") + main_component.names["cmake_find_package"] = "openvdb" + main_component.names["cmake_find_package_multi"] = "openvdb" + main_component.set_property("cmake_target_name", "OpenVDB::openvdb") diff --git a/recipes/openvdb/all/patches/0001-Find-packages-fixes.patch b/recipes/openvdb/all/patches/0001-Find-packages-fixes.patch deleted file mode 100644 index 65027361b1c533..00000000000000 --- a/recipes/openvdb/all/patches/0001-Find-packages-fixes.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ---- openvdb/openvdb/CMakeLists.txt -+++ openvdb/openvdb/CMakeLists.txt -@@ -413,8 +413,7 @@ if(WIN32) - # @note OPENVDB_OPENEXR_STATICLIB is old functionality from the makefiles - # used in PlatformConfig.h to configure EXR exports. Once this file - # is completely removed, this define can be too -- get_target_property(ILMBASE_LIB_TYPE IlmBase::Half TYPE) -- if(OPENEXR_USE_STATIC_LIBS OR (${ILMBASE_LIB_TYPE} STREQUAL STATIC_LIBRARY)) -+ if(OPENEXR_USE_STATIC_LIBS) - list(APPEND OPENVDB_CORE_PUBLIC_DEFINES -DOPENVDB_OPENEXR_STATICLIB) - endif() - list(APPEND OPENVDB_CORE_PUBLIC_DEFINES -D_WIN32 -DNOMINMAX) - diff --git a/recipes/openvdb/all/test_package/CMakeLists.txt b/recipes/openvdb/all/test_package/CMakeLists.txt index 1016f9a6ff31e1..5665948f27dfd1 100644 --- a/recipes/openvdb/all/test_package/CMakeLists.txt +++ b/recipes/openvdb/all/test_package/CMakeLists.txt @@ -1,11 +1,12 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(OpenVDB REQUIRED) +find_package(OpenVDB REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE OpenVDB::openvdb) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +if (OpenVDB_VERSION VERSION_GREATER_EQUAL "10.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/openvdb/all/test_package/conanfile.py b/recipes/openvdb/all/test_package/conanfile.py index 19e6a0c06e3d81..ef5d7042163ecc 100644 --- a/recipes/openvdb/all/test_package/conanfile.py +++ b/recipes/openvdb/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" + 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/openvdb/all/test_v1_package/CMakeLists.txt b/recipes/openvdb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/openvdb/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/recipes/xz_utils/cmake/test_v1_package/conanfile.py b/recipes/openvdb/all/test_v1_package/conanfile.py similarity index 88% rename from recipes/xz_utils/cmake/test_v1_package/conanfile.py rename to recipes/openvdb/all/test_v1_package/conanfile.py index 19e6a0c06e3d81..38f4483872d47f 100644 --- a/recipes/xz_utils/cmake/test_v1_package/conanfile.py +++ b/recipes/openvdb/all/test_v1_package/conanfile.py @@ -4,7 +4,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) diff --git a/recipes/openvdb/config.yml b/recipes/openvdb/config.yml index d603f0308422be..203a6bdcd5a753 100644 --- a/recipes/openvdb/config.yml +++ b/recipes/openvdb/config.yml @@ -1,3 +1,7 @@ versions: - "8.0.1": + "11.0.0": + folder: all + "10.1.0": + folder: all + "9.1.0": folder: all diff --git a/recipes/orc/all/conandata.yml b/recipes/orc/all/conandata.yml index 52fa72322f304a..93dd0aef42c8e6 100644 --- a/recipes/orc/all/conandata.yml +++ b/recipes/orc/all/conandata.yml @@ -1,13 +1,19 @@ sources: "2.0.0": - url: "https://dlcdn.apache.org/orc/orc-2.0.0/orc-2.0.0.tar.gz" + url: "https://archive.apache.org/dist/orc/orc-2.0.0/orc-2.0.0.tar.gz" sha256: "9107730919c29eb39efaff1b9e36166634d1d4d9477e5fee76bfd6a8fec317df" + "1.9.3": + url: "https://archive.apache.org/dist/orc/orc-1.9.3/orc-1.9.3.tar.gz" + sha256: "f737d005d0c4deb65688ac3c0223ed530b0ba6258552555b2774dcdb77359b0f" "1.9.2": - url: "https://dlcdn.apache.org/orc/orc-1.9.2/orc-1.9.2.tar.gz" + url: "https://archive.apache.org/dist/orc/orc-1.9.2/orc-1.9.2.tar.gz" sha256: "7f46f2c184ecefd6791f1a53fb062286818bd8710c3f08b94dd3cac365e240ee" + "1.8.7": + url: "https://archive.apache.org/dist/orc/orc-1.8.7/orc-1.8.7.tar.gz" + sha256: "57c9d12bf74b2752b1ce1039c15035c3b6f6531d865df962a99b3e079b3dfdb7" "1.8.6": - url: "https://dlcdn.apache.org/orc/orc-1.8.6/orc-1.8.6.tar.gz" + url: "https://archive.apache.org/dist/orc/orc-1.8.6/orc-1.8.6.tar.gz" sha256: "5675b18118df4dd7f86cc6ba859ed75b425ea1b7ddff805e1d671a17fd57d7f7" "1.7.10": - url: "https://dlcdn.apache.org/orc/orc-1.7.10/orc-1.7.10.tar.gz" + url: "https://archive.apache.org/dist/orc/orc-1.7.10/orc-1.7.10.tar.gz" sha256: "85aef9368dc9bcdffaaf10010b66dfe053ce22f30b64854f63852248164686a3" diff --git a/recipes/orc/config.yml b/recipes/orc/config.yml index 956aa2a1d25064..ad011c33e6349f 100644 --- a/recipes/orc/config.yml +++ b/recipes/orc/config.yml @@ -1,8 +1,12 @@ versions: "2.0.0": folder: all + "1.9.3": + folder: all "1.9.2": folder: all + "1.8.7": + folder: all "1.8.6": folder: all "1.7.10": diff --git a/recipes/ouster_sdk/all/conandata.yml b/recipes/ouster_sdk/all/conandata.yml new file mode 100644 index 00000000000000..72736b062686cb --- /dev/null +++ b/recipes/ouster_sdk/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + # The C++ library uses a separate versioning scheme from the overall releases + "0.10.0": + url: "https://github.com/ouster-lidar/ouster_example/archive/refs/tags/20231031.tar.gz" + sha256: "150482d28930308ef089233f3d4eb15d1330727a167aad3f9b2190078dcecfbf" +patches: + "0.10.0": + - patch_file: "patches/001-579-fix-cpp20-string-error.patch" + patch_type: "portability" + patch_description: "Fix non-const string issue with C++20" + patch_source: "https://github.com/ouster-lidar/ouster_example/pull/579" diff --git a/recipes/ouster_sdk/all/conanfile.py b/recipes/ouster_sdk/all/conanfile.py new file mode 100644 index 00000000000000..2c133d00627413 --- /dev/null +++ b/recipes/ouster_sdk/all/conanfile.py @@ -0,0 +1,223 @@ +import os + +from conan import ConanFile, conan_version +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.env import VirtualBuildEnv +from conan.tools.files import get, copy, rmdir, rm, save, replace_in_file, export_conandata_patches, apply_conandata_patches +from conan.tools.scm import Version + +required_conan_version = ">=1.60.0 <2.0 || >=2.0.6" + +class OusterSdkConan(ConanFile): + name = "ouster_sdk" + description = "Ouster SDK - tools for working with Ouster Lidars" + license = "BSD 3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ouster-lidar/ouster_example" + topics = ("ouster", "lidar", "driver", "hardware", "point cloud", "3d", "robotics", "automotive") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_osf": [True, False], + "build_pcap": [True, False], + "build_viz": [True, False], + "eigen_max_align_bytes": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_osf": True, + "build_pcap": True, + "build_viz": False, + "eigen_max_align_bytes": False, + } + options_description = { + "build_osf": "Build Ouster OSF library.", + "build_pcap": "Build pcap utils.", + "build_viz": "Build Ouster visualizer.", + "eigen_max_align_bytes": "Force maximum alignment of Eigen data to 32 bytes.", + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "5", + "apple-clang": "10", + "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 conan_version.major == 1: + # Turning off by default due to perpetually missing libtins binaries on CCI + self.options.build_pcap = False + self.options.build_osf = False + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # Used in ouster/types.h + self.requires("eigen/3.4.0", transitive_headers=True) + # Used in ouster/sensor_http.h + self.requires("jsoncpp/1.9.5", transitive_headers=True, transitive_libs=True) + self.requires("spdlog/1.13.0") + self.requires("fmt/10.2.1") + self.requires("libcurl/[>=7.78 <9]") + # Replaces vendored optional-lite + self.requires("optional-lite/3.6.0", transitive_headers=True) + + if self.options.build_pcap: + self.requires("libtins/4.5") + + if self.options.build_osf: + # Used in fb_generated/*.h + self.requires("flatbuffers/24.3.7", transitive_headers=True) + self.requires("libpng/[>=1.6 <2]") + self.requires("zlib/[>=1.2.11 <2]", transitive_libs=True) + + if self.options.build_viz: + self.requires("glad/0.1.36") + self.requires("glfw/3.4") + if self.settings.os != "Windows": + self.requires("xorg/system") + + def validate(self): + if conan_version.major < 2 and self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows builds require Conan >= 2.0") + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) + 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.build_osf and not self.options.build_pcap: + raise ConanInvalidConfiguration("build_osf=True requires build_pcap=True") + + if self.options.shared and self.settings.os == "Windows": + raise ConanInvalidConfiguration("Shared builds are not supported on Windows") + + def build_requirements(self): + if self.options.build_osf: + self.tool_requires("flatbuffers/") + + 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["BUILD_VIZ"] = self.options.build_viz + tc.variables["BUILD_PCAP"] = self.options.build_pcap + tc.variables["BUILD_OSF"] = self.options.build_osf + tc.variables["OUSTER_USE_EIGEN_MAX_ALIGN_BYTES_32"] = self.options.eigen_max_align_bytes + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.set_property("flatbuffers", "cmake_target_name", "flatbuffers::flatbuffers") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # Unvendor optional-lite + rmdir(self, os.path.join(self.source_folder, "ouster_client", "include", "optional-lite")) + replace_in_file(self, os.path.join(self.source_folder, "ouster_client", "CMakeLists.txt"), + " include/optional-lite", "") + save(self, os.path.join(self.source_folder, "ouster_client", "CMakeLists.txt"), + "find_package(optional-lite REQUIRED)\n" + "target_link_libraries(ouster_client PUBLIC nonstd::optional-lite)\n", + append=True) + + # Allow non-static ouster_osf for consistency with other components + replace_in_file(self, os.path.join(self.source_folder, "ouster_osf", "CMakeLists.txt"), + "add_library(ouster_osf STATIC", "add_library(ouster_osf") + + def build(self): + self._patch_sources() + 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, "share")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "OusterSDK") + self.cpp_info.set_property("cmake_target_name", "OusterSDK::OusterSDK") + + self.cpp_info.components["ouster_client"].set_property("cmake_target_name", "OusterSDK::ouster_client") + self.cpp_info.components["ouster_client"].libs = ["ouster_client"] + self.cpp_info.components["ouster_client"].requires = [ + "eigen::eigen", + "jsoncpp::jsoncpp", + "spdlog::spdlog", + "fmt::fmt", + "libcurl::libcurl", + "optional-lite::optional-lite", + ] + + if self.options.build_osf: + self.cpp_info.components["ouster_osf"].set_property("cmake_target_name", "OusterSDK::ouster_osf") + self.cpp_info.components["ouster_osf"].libs = ["ouster_osf"] + self.cpp_info.components["ouster_osf"].includedirs.append(os.path.join("include", "fb_generated")) + self.cpp_info.components["ouster_osf"].requires = [ + "ouster_client", + "ouster_pcap", + "flatbuffers::flatbuffers", + "libpng::libpng", + "zlib::zlib", + ] + + if self.options.build_pcap: + self.cpp_info.components["ouster_pcap"].set_property("cmake_target_name", "OusterSDK::ouster_pcap") + self.cpp_info.components["ouster_pcap"].libs = ["ouster_pcap"] + self.cpp_info.components["ouster_pcap"].requires = [ + "ouster_client", + "libtins::libtins", + ] + + if self.options.build_viz: + self.cpp_info.components["ouster_viz"].set_property("cmake_target_name", "OusterSDK::ouster_viz") + self.cpp_info.components["ouster_viz"].libs = ["ouster_viz"] + self.cpp_info.components["ouster_viz"].requires = [ + "ouster_client", + "glad::glad", + "glfw::glfw", + ] + if self.settings.os != "Windows": + self.cpp_info.components["ouster_viz"].requires.append("xorg::xorg") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "OusterSDK" + self.cpp_info.filenames["cmake_find_package_multi"] = "OusterSDK" + self.cpp_info.names["cmake_find_package"] = "OusterSDK" + self.cpp_info.names["cmake_find_package_multi"] = "OusterSDK" + diff --git a/recipes/ouster_sdk/all/patches/001-579-fix-cpp20-string-error.patch b/recipes/ouster_sdk/all/patches/001-579-fix-cpp20-string-error.patch new file mode 100644 index 00000000000000..aa80f65d67d9c7 --- /dev/null +++ b/recipes/ouster_sdk/all/patches/001-579-fix-cpp20-string-error.patch @@ -0,0 +1,25 @@ +From b2896dee6f43733c832c3a60f09f362abe2c5e79 Mon Sep 17 00:00:00 2001 +From: Kevin Greene +Date: Fri, 23 Feb 2024 10:22:02 -0800 +Subject: [PATCH] Fix non-const string issue with C++20 + +--- + ouster_client/src/curl_client.h | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/ouster_client/src/curl_client.h b/ouster_client/src/curl_client.h +index ce3fb31d..62bcabc0 100644 +--- a/ouster_client/src/curl_client.h ++++ b/ouster_client/src/curl_client.h +@@ -89,9 +89,8 @@ class CurlClient : public ouster::util::HttpClient { + // HTTP 5XX means a server error, so we should re-attempt. + // log a warning and sleep before re-attempting + ouster::sensor::logger().warn( +- std::string("Re-attempting CurlClient::execute_get after " +- "failure for url: ") + +- "[{}] with the code: [{}] - and return: {}", ++ "Re-attempting CurlClient::execute_get after failure for " ++ "url: [{}] with the code: [{}] - and return: {}", + url, http_code, buffer); + std::this_thread::sleep_for( + std::chrono::milliseconds(retry_delay_ms)); diff --git a/recipes/ouster_sdk/all/test_package/CMakeLists.txt b/recipes/ouster_sdk/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..498c697a4f0100 --- /dev/null +++ b/recipes/ouster_sdk/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + project(test_package CXX) + +find_package(OusterSDK REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE OusterSDK::OusterSDK) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/ouster_sdk/all/test_package/conanfile.py b/recipes/ouster_sdk/all/test_package/conanfile.py new file mode 100644 index 00000000000000..57c251706a8d64 --- /dev/null +++ b/recipes/ouster_sdk/all/test_package/conanfile.py @@ -0,0 +1,36 @@ +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 requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + if self.dependencies["ouster_sdk"].options.build_osf: + tc.preprocessor_definitions["WITH_OSF"] = "1" + if self.dependencies["ouster_sdk"].options.build_pcap: + tc.preprocessor_definitions["WITH_PCAP"] = "1" + if self.dependencies["ouster_sdk"].options.build_viz: + tc.preprocessor_definitions["WITH_VIZ"] = "1" + 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ouster_sdk/all/test_package/test_package.cpp b/recipes/ouster_sdk/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..3190406572ca42 --- /dev/null +++ b/recipes/ouster_sdk/all/test_package/test_package.cpp @@ -0,0 +1,38 @@ +#include "ouster/lidar_scan.h" + +#ifdef WITH_OSF +#include "ouster/osf/writer.h" +#endif +#ifdef WITH_PCAP +#include "ouster/os_pcap.h" +#endif +#ifdef WITH_VIZ +#include "ouster/point_viz.h" +#endif + +#include + +int main() { + size_t w = 100; + size_t h = 100; + using namespace ouster::sensor; + ouster::LidarScan scan(w, h, UDPProfileLidar::PROFILE_RNG19_RFL8_SIG16_NIR16_DUAL); + std::cout << "Successfully created a sensor::LidarScan object" << std::endl; + +#ifdef WITH_OSF + ouster::osf::Writer writer("tmp.osf"); + std::cout << "Successfully created a osf::Writer object" << std::endl; +#endif + +#ifdef WITH_PCAP + try { + ouster::sensor_utils::PcapReader pcap_reader("tmp.pcap"); + } catch (...) { } + std::cout << "Successfully created a sensor_utils::PcapReader object" << std::endl; +#endif + +#ifdef WITH_VIZ + ouster::viz::PointViz viz("Viz example"); + std::cout << "Successfully created a viz::PointViz object" << std::endl; +#endif +} diff --git a/recipes/ouster_sdk/config.yml b/recipes/ouster_sdk/config.yml new file mode 100644 index 00000000000000..1b582dcf6716ba --- /dev/null +++ b/recipes/ouster_sdk/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.0": + folder: all diff --git a/recipes/pcl/all/conanfile.py b/recipes/pcl/all/conanfile.py index 2b324ce7e92701..f22cfe52d2e6c2 100644 --- a/recipes/pcl/all/conanfile.py +++ b/recipes/pcl/all/conanfile.py @@ -91,6 +91,7 @@ class PclConan(ConanFile): "precompile_only_core_point_types": [True, False], # Whether to append a ''/d/rd/s postfix to executables on Windows depending on the build type "add_build_type_postfix": [True, False], + "use_sse": [True, False], } default_options = { "shared": False, @@ -151,6 +152,7 @@ class PclConan(ConanFile): # Enabled to avoid excessive memory usage during compilation in CCI "precompile_only_core_point_types": True, "add_build_type_postfix": False, + "use_sse": True, } short_paths = True @@ -333,6 +335,8 @@ def export_sources(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.use_sse def configure(self): if self.options.shared: @@ -477,6 +481,8 @@ def generate(self): for comp in disabled: tc.cache_variables[f"BUILD_{comp}"] = False + tc.cache_variables["PCL_ENABLE_SSE"] = self.options.get_safe("use_sse", False) + tc.generate() deps = CMakeDeps(self) diff --git a/recipes/perfetto/all/conandata.yml b/recipes/perfetto/all/conandata.yml index 7ea6229bf24ad5..cccc42e851f55b 100644 --- a/recipes/perfetto/all/conandata.yml +++ b/recipes/perfetto/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "44.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v44.0.tar.gz" + sha256: "db4162ee6495b1fcc13ba7aca77d67f9fd1766d184743137a04af8b1e3906b9d" "43.1": url: "https://github.com/google/perfetto/archive/refs/tags/v43.1.tar.gz" sha256: "0f23ba39520c9ec629c48dc36a3a4bb92ed9653ac6694445be22985205a3f4ce" diff --git a/recipes/perfetto/all/conanfile.py b/recipes/perfetto/all/conanfile.py index 6c9cecd7c62eff..53a602bd0b1602 100644 --- a/recipes/perfetto/all/conanfile.py +++ b/recipes/perfetto/all/conanfile.py @@ -101,7 +101,7 @@ def package(self): def package_info(self): self.cpp_info.libs = ["perfetto"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.extend(["pthread", "m"]) if self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") if is_msvc(self): diff --git a/recipes/perfetto/config.yml b/recipes/perfetto/config.yml index e704c3a7bc879a..d160e734741558 100644 --- a/recipes/perfetto/config.yml +++ b/recipes/perfetto/config.yml @@ -1,4 +1,6 @@ versions: + "44.0": + folder: all "43.1": folder: all "42.0": diff --git a/recipes/physfs/all/conandata.yml b/recipes/physfs/all/conandata.yml index 5504750a8f8970..a392b6a19517f9 100644 --- a/recipes/physfs/all/conandata.yml +++ b/recipes/physfs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.0": + url: "https://github.com/icculus/physfs/archive/refs/tags/release-3.2.0.tar.gz" + sha256: "1991500eaeb8d5325e3a8361847ff3bf8e03ec89252b7915e1f25b3f8ab5d560" "3.0.2": url: "https://icculus.org/physfs/downloads/physfs-3.0.2.tar.bz2" sha256: "304df76206d633df5360e738b138c94e82ccf086e50ba84f456d3f8432f9f863" diff --git a/recipes/physfs/all/conanfile.py b/recipes/physfs/all/conanfile.py index 995258a27fa05d..7f695f2305b04c 100644 --- a/recipes/physfs/all/conanfile.py +++ b/recipes/physfs/all/conanfile.py @@ -99,6 +99,7 @@ def package(self): 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", "PhysFS")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( diff --git a/recipes/physfs/config.yml b/recipes/physfs/config.yml index 12c582e98f9636..1531809cbbd7b3 100644 --- a/recipes/physfs/config.yml +++ b/recipes/physfs/config.yml @@ -1,3 +1,5 @@ versions: + "3.2.0": + folder: all "3.0.2": folder: all diff --git a/recipes/pixman/all/conandata.yml b/recipes/pixman/all/conandata.yml index f712201caaef3d..dc1f3f424ea145 100644 --- a/recipes/pixman/all/conandata.yml +++ b/recipes/pixman/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "0.43.4": + url: + - "https://www.cairographics.org/releases/pixman-0.43.4.tar.gz" + - "https://www.x.org/releases/individual/lib/pixman-0.43.4.tar.gz" + sha256: "a0624db90180c7ddb79fc7a9151093dc37c646d8c38d3f232f767cf64b85a226" "0.43.0": url: - "https://www.cairographics.org/releases/pixman-0.43.0.tar.gz" @@ -9,33 +14,9 @@ sources: - "https://www.cairographics.org/releases/pixman-0.42.2.tar.gz" - "https://www.x.org/releases/individual/lib/pixman-0.42.2.tar.gz" sha256: "ea1480efada2fd948bc75366f7c349e1c96d3297d09a3fe62626e38e234a625e" - "0.40.0": - url: - - "https://www.cairographics.org/releases/pixman-0.40.0.tar.gz" - - "https://www.x.org/releases/individual/lib/pixman-0.40.0.tar.gz" - sha256: "6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc" - "0.38.4": - url: - - "https://www.cairographics.org/releases/pixman-0.38.4.tar.gz" - - "https://www.x.org/releases/individual/lib/pixman-0.38.4.tar.gz" - sha256: "da66d6fd6e40aee70f7bd02e4f8f76fc3f006ec879d346bae6a723025cfbdde7" patches: "0.42.2": - patch_file: "patches/0.42.2-0001-pixman-arma64-Adjustments-to-build-with-llvm-integra.patch" patch_description: "Adjustments to build for arm64 with LLVM's assembler" patch_type: "portability" patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/71" - "0.40.0": - - patch_file: "patches/0001-incompatible-pointer-types.patch" - patch_description: "backport fix for clang build" - patch_type: "portability" - patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/48" - - patch_file: "patches/0003-meson-static-build.patch" - patch_description: "backport fix for msvc static build" - patch_type: "bugfix" - patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/commit/48d5df1f3772a08a929dcb3b2fe4d7b1853223c9.patch" - "0.38.4": - - patch_file: "patches/0002-meson-build.patch" - patch_description: "backport meson build files from 0.40.0 to fix windows build" - patch_type: "portability" - patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/tree/pixman-0.40.0" diff --git a/recipes/pixman/all/conanfile.py b/recipes/pixman/all/conanfile.py index 8d655189662cb3..c0b64456bcee2a 100644 --- a/recipes/pixman/all/conanfile.py +++ b/recipes/pixman/all/conanfile.py @@ -1,7 +1,6 @@ import os 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 ( @@ -11,7 +10,6 @@ from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain from conan.tools.microsoft import is_msvc -from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -50,12 +48,8 @@ def configure(self): def layout(self): basic_layout(self, src_folder="src") - def validate(self): - if self.settings.os == "Windows" and self.options.shared and Version(self.version) < "0.40.0": - raise ConanInvalidConfiguration(f"pixman/{self.version} can only be built as a static library on Windows") - def build_requirements(self): - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/1.4.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch b/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch deleted file mode 100644 index ee95a8b0914338..00000000000000 --- a/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c -index 4cfabe3..3832e2b 100644 ---- a/pixman/pixman-bits-image.c -+++ b/pixman/pixman-bits-image.c -@@ -1051,14 +1051,14 @@ dest_write_back_narrow (pixman_iter_t *iter) - iter->y++; - } - --static const float -+static float - dither_factor_blue_noise_64 (int x, int y) - { - float m = dither_blue_noise_64x64[((y & 0x3f) << 6) | (x & 0x3f)]; - return m * (1. / 4096.f) + (1. / 8192.f); - } - --static const float -+static float - dither_factor_bayer_8 (int x, int y) - { - uint32_t m; diff --git a/recipes/pixman/all/patches/0002-meson-build.patch b/recipes/pixman/all/patches/0002-meson-build.patch deleted file mode 100644 index 6063b377301a8c..00000000000000 --- a/recipes/pixman/all/patches/0002-meson-build.patch +++ /dev/null @@ -1,253 +0,0 @@ -diff --git a/meson.build b/meson.build -index fad22ee..519441b 100644 ---- a/meson.build -+++ b/meson.build -@@ -23,7 +23,7 @@ project( - ['c'], - version : '0.38.4', - license : 'MIT', -- meson_version : '>= 0.47.2', -+ meson_version : '>= 0.50.0', - default_options : ['buildtype=debugoptimized'], - ) - -@@ -36,6 +36,7 @@ add_project_arguments( - '-Wdeclaration-after-statement', - '-fno-strict-aliasing', - '-fvisibility=hidden', -+ '-Wundef', - ]), - language : ['c'] - ) -@@ -50,7 +51,7 @@ endforeach - - use_loongson_mmi = get_option('loongson-mmi') - have_loongson_mmi = false --loongson_mmi_flags = ['-march=loongson2f'] -+loongson_mmi_flags = ['-mloongson-mmi'] - if not use_loongson_mmi.disabled() - if host_machine.cpu_family() == 'mips64' and cc.compiles(''' - #ifndef __mips_loongson_vector_rev -@@ -84,9 +85,17 @@ endif - - use_mmx = get_option('mmx') - have_mmx = false --mmx_flags = ['-mmmx', '-Winline'] -+mmx_flags = [] -+ -+if cc.get_id() == 'msvc' -+ mmx_flags = ['/w14710', '/w14714', '/wd4244'] -+elif cc.get_id() == 'sun' -+ mmx_flags = ['-xarch=sse'] -+else -+ mmx_flags = ['-mmmx', '-Winline'] -+endif - if not use_mmx.disabled() -- if host_machine.cpu_family() == 'x86_64' -+ if host_machine.cpu_family() == 'x86_64' or cc.get_id() == 'msvc' - have_mmx = true - elif host_machine.cpu_family() == 'x86' and cc.compiles(''' - #include -@@ -127,14 +136,23 @@ if not use_mmx.disabled() - endif - - if have_mmx -- config.set10('USE_X86_MMX', true) -+ # Inline assembly do not work on X64 MSVC, so we use -+ # compatibility intrinsics there -+ if cc.get_id() != 'msvc' or host_machine.cpu_family() != 'x86_64' -+ config.set10('USE_X86_MMX', true) -+ endif - elif use_mmx.enabled() - error('MMX Support unavailable, but required') - endif - - use_sse2 = get_option('sse2') - have_sse2 = false --sse2_flags = ['-msse2', '-Winline'] -+sse2_flags = [] -+if cc.get_id() == 'sun' -+ sse2_flags = ['-xarch=sse2'] -+elif cc.get_id() != 'msvc' -+ sse2_flags = ['-msse2', '-Winline'] -+endif - if not use_sse2.disabled() - if host_machine.cpu_family() == 'x86' - if cc.compiles(''' -@@ -169,8 +187,13 @@ endif - - use_ssse3 = get_option('ssse3') - have_ssse3 = false --ssse3_flags =['-mssse3', '-Winline'] --if not use_ssse3.disabled() -+ssse3_flags = [] -+if cc.get_id() != 'msvc' -+ ssse3_flags = ['-mssse3', '-Winline'] -+endif -+ -+# x64 pre-2010 MSVC compilers crashes when building the ssse3 code -+if not use_ssse3.disabled() and not (cc.get_id() == 'msvc' and cc.version().version_compare('<16') and host_machine.cpu_family() == 'x86_64') - if host_machine.cpu_family().startswith('x86') - if cc.compiles(''' - #include -@@ -349,14 +372,21 @@ if get_option('gnuplot') - config.set('PIXMAN_GNUPLOT', 1) - endif - --dep_openmp = dependency('openmp', required : get_option('openmp')) --if dep_openmp.found() -- config.set10('USE_OPENMP', true) --elif meson.version().version_compare('<0.51.0') --# In versions of meson before 0.51 the openmp dependency can still --# inject arguments in the the auto case when it is not found, the --# detection does work correctly in that case however, so we just --# replace dep_openmp with null_dep to work around this. -+if cc.get_id() != 'msvc' -+ dep_openmp = dependency('openmp', required : get_option('openmp')) -+ if dep_openmp.found() -+ config.set10('USE_OPENMP', true) -+ elif meson.version().version_compare('<0.51.0') -+ # In versions of meson before 0.51 the openmp dependency can still -+ # inject arguments in the the auto case when it is not found, the -+ # detection does work correctly in that case however, so we just -+ # replace dep_openmp with null_dep to work around this. -+ dep_openmp = null_dep -+ endif -+else -+ # the MSVC implementation of openmp is not compliant enough for our -+ # uses here, so we disable it here. -+ # Please see: https://stackoverflow.com/questions/12560243/using-threadprivate-directive-in-visual-studio - dep_openmp = null_dep - endif - -@@ -364,17 +394,56 @@ dep_gtk = dependency('gtk+-2.0', version : '>= 2.16', required : get_option('gtk - dep_glib = dependency('glib-2.0', required : get_option('gtk')) - dep_pixman = dependency('pixman-1', required : get_option('gtk'), - version : '>= ' + meson.project_version()) --dep_png = dependency('libpng', required : get_option('libpng')) -+ -+dep_png = null_dep -+if not get_option('libpng').disabled() -+ dep_png = dependency('libpng', required : false) -+ -+ # We need to look for the right library to link to for libpng, -+ # when looking for libpng manually -+ foreach png_ver : [ '16', '15', '14', '13', '12', '10' ] -+ if not dep_png.found() -+ dep_png = cc.find_library('libpng@0@'.format(png_ver), has_headers : ['png.h'], required : false) -+ endif -+ endforeach -+ -+ if get_option('libpng').enabled() and not dep_png.found() -+ error('libpng support requested but libpng library not found') -+ endif -+endif -+ - if dep_png.found() - config.set('HAVE_LIBPNG', 1) - endif - dep_m = cc.find_library('m', required : false) - dep_threads = dependency('threads') --if dep_threads.found() -+ -+# MSVC-style compilers do not come with pthreads, so we must link -+# to it explicitly, currently pthreads-win32 is supported -+pthreads_found = false -+ -+if dep_threads.found() and cc.has_header('pthread.h') -+ if cc.get_argument_syntax() == 'msvc' -+ pthread_lib = null_dep -+ foreach pthread_type : ['VC3', 'VSE3', 'VCE3', 'VC2', 'VSE2', 'VCE2'] -+ if not pthread_lib.found() -+ pthread_lib = cc.find_library('pthread@0@'.format(pthread_type), required : false) -+ endif -+ endforeach -+ if pthread_lib.found() -+ pthreads_found = true -+ dep_threads = pthread_lib -+ endif -+ else -+ pthreads_found = true -+ endif -+endif -+ -+if pthreads_found - config.set('HAVE_PTHREADS', 1) - endif - --funcs = ['sigaction', 'alarm', 'mprotect', 'getpagesize', 'mmap'] -+funcs = ['sigaction', 'alarm', 'mprotect', 'getpagesize', 'mmap', 'getisax', 'gettimeofday'] - # mingw claimes to have posix_memalign, but it doesn't - if host_machine.system() != 'windows' - funcs += 'posix_memalign' -@@ -386,10 +455,6 @@ foreach f : funcs - endif - endforeach - --if cc.has_function('gettimeofday') -- config.set('HAVE_GETTIMEOFDAY', 1) --endif -- - # This is only used in one test, that defines _GNU_SOURCE - if cc.has_function('feenableexcept', - prefix : '#define _GNU_SOURCE\n#include ', -@@ -407,8 +472,12 @@ foreach h : ['sys/mman.h', 'fenv.h', 'unistd.h'] - endif - endforeach - -+# gcc on Windows only warns that __declspec(thread) isn't supported, -+# passing -Werror=attributes makes it fail. - if (host_machine.system() == 'windows' and -- cc.compiles('int __declspec(thread) foo;', name : 'TLS via __declspec(thread)')) -+ cc.compiles('int __declspec(thread) foo;', -+ args : cc.get_supported_arguments(['-Werror=attributes']), -+ name : 'TLS via __declspec(thread)')) - config.set('TLS', '__declspec(thread)') - elif cc.compiles('int __thread foo;', name : 'TLS via __thread') - config.set('TLS', '__thread') -@@ -445,6 +514,8 @@ if host_machine.endian() == 'big' - config.set('WORDS_BIGENDIAN', 1) - endif - -+config.set('SIZEOF_LONG', cc.sizeof('long')) -+ - # Required to make pixman-private.h - config.set('PACKAGE', 'foo') - -diff --git a/pixman/meson.build b/pixman/meson.build -index 6ce87e7..f48357f 100644 ---- a/pixman/meson.build -+++ b/pixman/meson.build -@@ -30,6 +30,11 @@ version_h = configure_file( - install_dir : join_paths(get_option('prefix'), get_option('includedir'), 'pixman-1') - ) - -+libpixman_extra_cargs = [] -+if cc.has_function_attribute('dllexport') -+ libpixman_extra_cargs = ['-DPIXMAN_API=__declspec(dllexport)'] -+endif -+ - pixman_simd_libs = [] - simds = [ - # the mmx library can be compiled with mmx on x86/x86_64, iwmmxt on -@@ -97,10 +102,18 @@ pixman_files = files( - 'pixman-utils.c', - ) - --libpixman = shared_library( -+# We cannot use 'link_with' or 'link_whole' because meson wont do the right -+# thing for static archives. -+_obs = [] -+foreach l : pixman_simd_libs -+ _obs += l.extract_all_objects() -+endforeach -+ -+libpixman = library( - 'pixman-1', - [pixman_files, config_h, version_h], -- link_with : [pixman_simd_libs], -+ objects : _obs, -+ c_args : libpixman_extra_cargs, - dependencies : [dep_m, dep_threads], - version : meson.project_version(), - install : true, diff --git a/recipes/pixman/all/patches/0003-meson-static-build.patch b/recipes/pixman/all/patches/0003-meson-static-build.patch deleted file mode 100644 index 6283ba2680054a..00000000000000 --- a/recipes/pixman/all/patches/0003-meson-static-build.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 48d5df1f3772a08a929dcb3b2fe4d7b1853223c9 Mon Sep 17 00:00:00 2001 -From: Benjamin Gilbert -Date: Thu, 5 Jan 2023 20:29:00 -0500 -Subject: [PATCH] meson: don't dllexport when built as static library - -If a static Pixman is linked with a dynamic library, Pixman shouldn't -export its own symbols into the latter's ABI. ---- - pixman/meson.build | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/pixman/meson.build b/pixman/meson.build -index 5dce870..62ec66b 100644 ---- a/pixman/meson.build -+++ b/pixman/meson.build -@@ -31,7 +31,8 @@ version_h = configure_file( - ) - - libpixman_extra_cargs = [] --if cc.has_function_attribute('dllexport') -+default_library = get_option('default_library') -+if default_library != 'static' and cc.has_function_attribute('dllexport') - libpixman_extra_cargs = ['-DPIXMAN_API=__declspec(dllexport)'] - endif - --- -GitLab - diff --git a/recipes/pixman/config.yml b/recipes/pixman/config.yml index 1daaad48895385..c3e710db89855a 100644 --- a/recipes/pixman/config.yml +++ b/recipes/pixman/config.yml @@ -1,9 +1,7 @@ versions: + "0.43.4": + folder: "all" "0.43.0": folder: "all" "0.42.2": folder: "all" - "0.40.0": - folder: "all" - "0.38.4": - folder: "all" diff --git a/recipes/poco/all/conandata.yml b/recipes/poco/all/conandata.yml index 9080050916ffa6..c6800253076624 100644 --- a/recipes/poco/all/conandata.yml +++ b/recipes/poco/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.13.3": + url: "https://github.com/pocoproject/poco/archive/poco-1.13.3-release.tar.gz" + sha256: "9f074d230daf30f550c5bde5528037bdab6aa83b2a06c81a25e89dd3bcb7e419" "1.13.2": url: "https://github.com/pocoproject/poco/archive/poco-1.13.2-release.tar.gz" sha256: "c01221870aa9bccedf1de39890279699207848fe61a0cfb6aeec7c5942c4627f" @@ -33,6 +36,13 @@ sources: url: "https://github.com/pocoproject/poco/archive/poco-1.11.3-release.tar.gz" sha256: "fb5e8e70c7dbc8f3b59ec8560140a267b4eaf06ee519dc21f312d0eb195cba37" patches: + "1.13.3": + - patch_file: patches/1.13.0.patch + patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" + patch_type: "conan" + - patch_file: patches/1.13.0-0002-mysql-include.patch + patch_description: "include mysql.h instead of mysql/mysql.h" + patch_type: "portability" "1.13.2": - patch_file: patches/1.13.0.patch patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" diff --git a/recipes/poco/all/conanfile.py b/recipes/poco/all/conanfile.py index b2d6762eae55dd..8223c242f01e09 100644 --- a/recipes/poco/all/conanfile.py +++ b/recipes/poco/all/conanfile.py @@ -157,7 +157,7 @@ def requirements(self): self.requires("pcre2/10.42") self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True) if self.options.enable_xml: - self.requires("expat/2.5.0", transitive_headers=True) + self.requires("expat/[>=2.6.2 <3]", transitive_headers=True) if self.options.enable_data_sqlite: self.requires("sqlite3/3.45.0") if self.options.enable_apacheconnector: diff --git a/recipes/poco/config.yml b/recipes/poco/config.yml index e7879c451d9190..a477d906ba0c3a 100644 --- a/recipes/poco/config.yml +++ b/recipes/poco/config.yml @@ -1,4 +1,6 @@ versions: + "1.13.3": + folder: all "1.13.2": folder: all "1.13.1": diff --git a/recipes/primesieve/all/conandata.yml b/recipes/primesieve/all/conandata.yml index f4f2c000a99cc5..c600acb0c9606b 100644 --- a/recipes/primesieve/all/conandata.yml +++ b/recipes/primesieve/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "12.1": + url: "https://github.com/kimwalisch/primesieve/archive/refs/tags/v12.1.tar.gz" + sha256: "64e7f5d3ce680262b865c7aec1381ffb13d13f75dd985b964ce33806e1bbf386" "11.2": url: "https://github.com/kimwalisch/primesieve/archive/refs/tags/v11.2.tar.gz" sha256: "86c31bae9c378340b19669eafef8c5e45849adf7b9c92af1d212a2a2bfa0a5db" diff --git a/recipes/primesieve/all/conanfile.py b/recipes/primesieve/all/conanfile.py index c8e88390ec7a51..b2629bd8f8081c 100644 --- a/recipes/primesieve/all/conanfile.py +++ b/recipes/primesieve/all/conanfile.py @@ -17,6 +17,7 @@ class PrimesieveConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/kimwalisch/primesieve" topics = ("math", "prime-numbers", "sieve-of-eratosthenes") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,7 +31,6 @@ class PrimesieveConan(ConanFile): "with_multiarch": True, "with_msvc_crt_static": False, } - package_type = "library" @property def _min_cppstd(self): @@ -50,9 +50,9 @@ def layout(self): def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) - + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "5": - raise ConanInvalidConfiguration("GCC<=5 is currently not supported. Contributions with fixes are welcome.") + raise ConanInvalidConfiguration(f"{self.ref} doesn't support GCC<=5 currently. Contributions with fixes are welcome.") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/primesieve/all/test_package/CMakeLists.txt b/recipes/primesieve/all/test_package/CMakeLists.txt index ee808a6efb8b56..457aa08f2e6d74 100644 --- a/recipes/primesieve/all/test_package/CMakeLists.txt +++ b/recipes/primesieve/all/test_package/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) # if the project uses c++ +project(test_package LANGUAGES CXX) find_package(primesieve REQUIRED CONFIG) diff --git a/recipes/primesieve/config.yml b/recipes/primesieve/config.yml index 3b46283d96d88a..c488150c0dff2f 100644 --- a/recipes/primesieve/config.yml +++ b/recipes/primesieve/config.yml @@ -1,3 +1,5 @@ versions: + "12.1": + folder: all "11.2": folder: all diff --git a/recipes/protobuf/all/test_package/CMakeLists.txt b/recipes/protobuf/all/test_package/CMakeLists.txt index a5240f3215abb5..e9b0cf64f692a9 100644 --- a/recipes/protobuf/all/test_package/CMakeLists.txt +++ b/recipes/protobuf/all/test_package/CMakeLists.txt @@ -4,7 +4,7 @@ project(test_package LANGUAGES CXX) find_package(protobuf CONFIG REQUIRED) -add_executable(${PROJECT_NAME} test_package.cpp addressbook.proto) +add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") if (protobuf_LITE) @@ -17,5 +17,3 @@ if(TARGET protobuf::libprotoc) target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotoc) endif() -protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS TARGET ${PROJECT_NAME}) -protobuf_generate(LANGUAGE cpp TARGET ${PROJECT_NAME} PROTOS addressbook.proto) diff --git a/recipes/protobuf/all/test_package/conanfile.py b/recipes/protobuf/all/test_package/conanfile.py index 81404c86104a87..f31fbd67038e16 100644 --- a/recipes/protobuf/all/test_package/conanfile.py +++ b/recipes/protobuf/all/test_package/conanfile.py @@ -13,10 +13,8 @@ def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - self.tool_requires(self.tested_reference_str) + # note `run=True` so that the runenv can find protoc + self.requires(self.tested_reference_str, run=True) def generate(self): tc = CMakeToolchain(self) @@ -32,3 +30,8 @@ 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/recipes/protobuf/all/test_package/test_package.cpp b/recipes/protobuf/all/test_package/test_package.cpp index aee0c47205eedd..3d3122ddd2587c 100644 --- a/recipes/protobuf/all/test_package/test_package.cpp +++ b/recipes/protobuf/all/test_package/test_package.cpp @@ -1,17 +1,15 @@ #include #include -#include "addressbook.pb.h" +#include +#include int main() { - std::cout << "Bincrafters\n"; + google::protobuf::Timestamp ts; + google::protobuf::util::TimeUtil::FromString("1972-01-01T10:00:20.021Z", &ts); + const auto nanoseconds = ts.nanos(); - tutorial::Person p; - p.set_id(21); - p.set_name("conan-center-index"); - p.set_email("info@conan.io"); - - std::cout << p.SerializeAsString() << "\n"; + std::cout << nanoseconds << "\n"; return EXIT_SUCCESS; } diff --git a/recipes/protobuf/all/test_v1_package/conanfile.py b/recipes/protobuf/all/test_v1_package/conanfile.py deleted file mode 100644 index f31e33d3b0ff46..00000000000000 --- a/recipes/protobuf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,27 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(self.tested_reference_str) - - def build(self): - with tools.no_op() if hasattr(self, "settings_build") else tools.run_environment(self): - cmake = CMake(self) - cmake.definitions["protobuf_LITE"] = self.options["protobuf"].lite - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - self.run("protoc --version", run_environment=True) - self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/proxy/all/conandata.yml b/recipes/proxy/all/conandata.yml new file mode 100644 index 00000000000000..91ead9304a7577 --- /dev/null +++ b/recipes/proxy/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.3.1": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.3.1.tar.gz" + sha256: "bfec45ada9cd3dc576df34bbe877c5d03a81906a00759970c0197c3fa041c5c7" + "2.3.0": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.3.0.tar.gz" + sha256: "ff6f17c5360895776d29ce2b1235de7b42912468b52729810506431e352a78d0" + "2.2.1": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.2.1.tar.gz" + sha256: "096f0b2d793dffc54d41def2bca0ced594b6b8efe35ac5ae27db35802e742b96" diff --git a/recipes/proxy/all/conanfile.py b/recipes/proxy/all/conanfile.py new file mode 100644 index 00000000000000..eb01ebfdc540f3 --- /dev/null +++ b/recipes/proxy/all/conanfile.py @@ -0,0 +1,67 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class ProxyConan(ConanFile): + name = "proxy" + description = "Proxy: Next Generation Polymorphism in C++" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/microsoft/proxy" + topics = ("runtime-polymorphism", "polymorphism", "duck-typing", "metaprogramming", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + # proxy/2.3.0 has an internal compilation error on gcc 11. + "gcc": "11" if Version(self.version) < "2.3.0" else "12", + "clang": "15", + "apple-clang": "14", + "msvc": "193", + "Visual Studio": "17", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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 package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "proxy.h", self.source_folder, os.path.join(self.package_folder, "include", "proxy")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "proxy") + self.cpp_info.set_property("cmake_target_name", "msft_proxy") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/proxy/all/test_package/CMakeLists.txt b/recipes/proxy/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..7ca64396c7e137 --- /dev/null +++ b/recipes/proxy/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(proxy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE msft_proxy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/proxy/all/test_package/conanfile.py b/recipes/proxy/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/proxy/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/proxy/all/test_package/test_package.cpp b/recipes/proxy/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..09afe4defb5830 --- /dev/null +++ b/recipes/proxy/all/test_package/test_package.cpp @@ -0,0 +1,47 @@ +// https://github.com/microsoft/proxy/blob/2.1.0/samples/resource_dictionary/main.cpp +// Copyright (c) Microsoft Corporation. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE + +#include + +#include +#include +#include +#include + + +namespace poly { + +PRO_DEF_MEMBER_DISPATCH(at, std::string(int)); +PRO_DEF_FACADE(Dictionary, at); + +} // namespace poly + +void demo_print(pro::proxy dictionary) { + std::cout << dictionary(1) << std::endl; +} + +int main() { + std::map container1{{1, "hello"}}; + std::vector container2{"hello", "world"}; + demo_print(&container1); // print: hello\n + demo_print(&container2); // print: world\n + return 0; +} diff --git a/recipes/proxy/config.yml b/recipes/proxy/config.yml new file mode 100644 index 00000000000000..a54a1870999b74 --- /dev/null +++ b/recipes/proxy/config.yml @@ -0,0 +1,7 @@ +versions: + "2.3.1": + folder: all + "2.3.0": + folder: all + "2.2.1": + folder: all diff --git a/recipes/pybind11/all/conandata.yml b/recipes/pybind11/all/conandata.yml index 62adb5a253c62e..ad2c426df1a163 100644 --- a/recipes/pybind11/all/conandata.yml +++ b/recipes/pybind11/all/conandata.yml @@ -1,25 +1,28 @@ sources: - 2.7.1: + "2.7.1": url: "https://github.com/pybind/pybind11/archive/v2.7.1.tar.gz" sha256: "616d1c42e4cf14fa27b2a4ff759d7d7b33006fdc5ad8fd603bb2c22622f27020" - 2.8.1: + "2.8.1": url: "https://github.com/pybind/pybind11/archive/v2.8.1.tar.gz" sha256: "f1bcc07caa568eb312411dde5308b1e250bd0e1bc020fae855bf9f43209940cc" - 2.9.1: + "2.9.1": url: "https://github.com/pybind/pybind11/archive/v2.9.1.tar.gz" sha256: "c6160321dc98e6e1184cc791fbeadd2907bb4a0ce0e447f2ea4ff8ab56550913" - 2.9.2: + "2.9.2": url: "https://github.com/pybind/pybind11/archive/v2.9.2.tar.gz" sha256: "6bd528c4dbe2276635dc787b6b1f2e5316cf6b49ee3e150264e455a0d68d19c1" "2.10.0": url: "https://github.com/pybind/pybind11/archive/v2.10.0.tar.gz" sha256: "eacf582fa8f696227988d08cfc46121770823839fe9e301a20fbce67e7cd70ec" - 2.10.1: + "2.10.1": url: "https://github.com/pybind/pybind11/archive/v2.10.1.tar.gz" sha256: "111014b516b625083bef701df7880f78c2243835abdb263065b6b59b960b6bad" - 2.10.4: + "2.10.4": url: "https://github.com/pybind/pybind11/archive/v2.10.4.tar.gz" sha256: "832e2f309c57da9c1e6d4542dedd34b24e4192ecb4d62f6f4866a737454c9970" - 2.11.1: + "2.11.1": url: "https://github.com/pybind/pybind11/archive/v2.11.1.tar.gz" sha256: "d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c" + "2.12.0": + url: "https://github.com/pybind/pybind11/archive/v2.12.0.tar.gz" + sha256: "bf8f242abd1abcd375d516a7067490fb71abd79519a282d22b6e4d19282185a7" diff --git a/recipes/pybind11/config.yml b/recipes/pybind11/config.yml index 0637bb6f5067ed..adf07a18a08dd9 100644 --- a/recipes/pybind11/config.yml +++ b/recipes/pybind11/config.yml @@ -15,3 +15,5 @@ versions: folder: all "2.11.1": folder: all + "2.12.0": + folder: all diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 9d4a18d87ad0ed..f45348ca816a3a 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanException, ConanInvalidConfiguration from conan.tools.android import android_abi from conan.tools.apple import is_apple_os from conan.tools.build import build_jobs, check_min_cppstd, cross_building @@ -27,6 +27,8 @@ class QtConan(ConanFile): "qtspeech", "qtnetworkauth", "qtremoteobjects", "qtwebglplugin", "qtlottie", "qtquicktimeline", "qtquick3d", "qtknx", "qtmqtt", "qtcoap", "qtopcua"] + _module_statuses = ["essential", "addon", "deprecated", "preview"] + name = "qt" description = "Qt is a cross-platform framework for graphical user interfaces." topics = ("ui", "framework") @@ -78,6 +80,7 @@ class QtConan(ConanFile): "multiconfiguration": [True, False] } options.update({module: [True, False] for module in _submodules}) + options.update({f"{status}_modules": [True, False] for status in _module_statuses}) default_options = { "shared": False, @@ -118,8 +121,10 @@ class QtConan(ConanFile): "cross_compile": None, "sysroot": None, "config": None, - "multiconfiguration": False + "multiconfiguration": False, + "essential_modules": not os.getenv('CONAN_CENTER_BUILD_SERVICE') } + default_options.update({f"{status}_modules": False for status in _module_statuses if status != "essential"}) no_copy_source = True short_paths = True @@ -222,16 +227,6 @@ def configure(self): if not self.options.with_dbus: del self.options.with_atspi - if not self.options.qtmultimedia: - self.options.rm_safe("with_libalsa") - del self.options.with_openal - del self.options.with_gstreamer - del self.options.with_pulseaudio - - if self.settings.os in ("FreeBSD", "Linux"): - if self.options.qtwebengine: - self.options.with_fontconfig = True - if self.options.multiconfiguration: del self.settings.build_type @@ -246,6 +241,8 @@ def configure(self): modulename = section[section.find('"') + 1: section.rfind('"')] status = str(config.get(section, "status")) if status not in ("obsolete", "ignore"): + if status not in self._module_statuses: + raise ConanException(f"module {modulename} has status {status} which is not in self._module_statuses {self._module_statuses}") submodules_tree[modulename] = {"status": status, "path": str(config.get(section, "path")), "depends": []} if config.has_option(section, "depends"): @@ -267,11 +264,27 @@ def _enablemodule(mod): for module in self._submodules: if self.options.get_safe(module): _enablemodule(module) + else: + if module in submodules_tree: + for status in self._module_statuses: + if getattr(self.options, f"{status}_modules") and submodules_tree[module]['status'] == status: + _enablemodule(module) + break for module in self._submodules: if module in self.options and not self.options.get_safe(module): setattr(self.options, module, False) + if not self.options.qtmultimedia: + self.options.rm_safe("with_libalsa") + del self.options.with_openal + del self.options.with_gstreamer + del self.options.with_pulseaudio + + if self.settings.os in ("FreeBSD", "Linux"): + if self.options.qtwebengine: + self.options.with_fontconfig = True + def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, "11") @@ -427,6 +440,8 @@ def package_id(self): self.info.settings.compiler.runtime_type = "Release/Debug" if self.info.settings.os == "Android": del self.info.options.android_sdk + for status in self._module_statuses: + delattr(self.info.options, f"{status}_modules") def build_requirements(self): if self._settings_build.os == "Windows" and is_msvc(self): diff --git a/recipes/qt/6.x.x/conandata.yml b/recipes/qt/6.x.x/conandata.yml index 7d80016fb1b786..4481994aa27cad 100644 --- a/recipes/qt/6.x.x/conandata.yml +++ b/recipes/qt/6.x.x/conandata.yml @@ -1,4 +1,42 @@ sources: + "6.7.0": + url: + - "https://download.qt.io/official_releases/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://download.qt.io/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + sha256: "bf5089912364f99cf9baf6c109de76a3172eec6267f148c69800575c47f90087" + "6.6.3": + url: + - "https://download.qt.io/official_releases/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://download.qt.io/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.icm.edu.pl/packages/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.sau.edu.cn/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.tuna.tsinghua.edu.cn/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + sha256: "69d0348fef415da98aa890a34651e9cfb232f1bffcee289b7b4e21386bf36104" "6.6.2": url: - "https://download.qt.io/official_releases/qt/6.6/6.6.2/single/qt-everywhere-src-6.6.2.tar.xz" @@ -85,6 +123,18 @@ sources: - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" sha256: "b90524f686224a0e5a945c1d65307e16a375348dbe275c9ac11de171fe31374a" patches: + "6.7.0": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e_6.6.0.diff" + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + "patch_type": "bugfix" + "6.6.3": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e_6.6.0.diff" + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + "patch_type": "bugfix" "6.6.2": - "base_path": "qtwebengine" "patch_description": "Workaround for too long .rps file name" diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 02d45875b2ac69..4a2fb7512fa859 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -12,7 +12,7 @@ from conan.tools.gnu import PkgConfigDeps from conan.tools.microsoft import msvc_runtime_flag, is_msvc from conan.tools.scm import Version -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanException, ConanInvalidConfiguration required_conan_version = ">=1.55.0" @@ -28,6 +28,8 @@ class QtConan(ConanFile): "qtspeech", "qthttpserver", "qtquick3dphysics", "qtgrpc", "qtquickeffectmaker"] _submodules += ["qtgraphs"] # new modules for qt 6.6.0 + _module_statuses = ["essential", "addon", "deprecated", "preview"] + name = "qt" description = "Qt is a cross-platform framework for graphical user interfaces." topics = ("framework", "ui") @@ -76,6 +78,7 @@ class QtConan(ConanFile): "disabled_features": [None, "ANY"], } options.update({module: [True, False] for module in _submodules}) + options.update({f"{status}_modules": [True, False] for status in _module_statuses}) # this significantly speeds up windows builds no_copy_source = True @@ -118,7 +121,9 @@ class QtConan(ConanFile): "sysroot": None, "multiconfiguration": False, "disabled_features": "", + "essential_modules": not os.getenv('CONAN_CENTER_BUILD_SERVICE') } + default_options.update({f"{status}_modules": False for status in _module_statuses if status != "essential"}) short_paths = True @@ -145,6 +150,8 @@ def _get_module_tree(self): continue status = str(config.get(section, "status")) if status not in ["obsolete", "ignore", "additionalLibrary"]: + if status not in self._module_statuses: + raise ConanException(f"module {modulename} has status {status} which is not in self._module_statuses {self._module_statuses}") assert modulename in self._submodules, f"module {modulename} not in self._submodules" self._submodules_tree[modulename] = {"status": status, "path": str(config.get(section, "path")), "depends": []} @@ -202,16 +209,6 @@ def configure(self): self.options.rm_safe("with_x11") self.options.rm_safe("with_egl") - if not self.options.get_safe("qtmultimedia"): - self.options.rm_safe("with_libalsa") - del self.options.with_openal - del self.options.with_gstreamer - del self.options.with_pulseaudio - - if self.settings.os in ("FreeBSD", "Linux"): - if self.options.get_safe("qtwebengine"): - self.options.with_fontconfig = True - if self.options.multiconfiguration: del self.settings.build_type @@ -223,9 +220,14 @@ def _enablemodule(mod): # enable all modules which are # - required by a module explicitely enabled by the consumer - for module in self._get_module_tree: - if getattr(self.options, module): - _enablemodule(module) + for module_name, module in self._get_module_tree.items(): + if getattr(self.options, module_name): + _enablemodule(module_name) + else: + for status in self._module_statuses: + if getattr(self.options, f"{status}_modules") and module['status'] == status: + _enablemodule(module_name) + break # disable all modules which are: # - not explicitely enabled by the consumer and @@ -234,6 +236,16 @@ def _enablemodule(mod): if getattr(self.options, module).value is None: setattr(self.options, module, False) + if not self.options.get_safe("qtmultimedia"): + self.options.rm_safe("with_libalsa") + del self.options.with_openal + del self.options.with_gstreamer + del self.options.with_pulseaudio + + if self.settings.os in ("FreeBSD", "Linux"): + if self.options.get_safe("qtwebengine"): + self.options.with_fontconfig = True + def validate(self): if os.getenv('CONAN_CENTER_BUILD_SERVICE') is not None: if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) >= "11" or \ @@ -634,6 +646,8 @@ def package_id(self): self.info.settings.compiler.runtime_type = "Release/Debug" if self.info.settings.os == "Android": del self.info.options.android_sdk + for status in self._module_statuses: + delattr(self.info.options, f"{status}_modules") def source(self): destination = self.source_folder @@ -651,9 +665,6 @@ def source(self): " if (enable_precompiled_headers) {\n if (false) {" ) - replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", "QtInternalTargets.cmake"), - "-Zc:wchar_t", - "-Zc:wchar_t -Zc:twoPhase-") for f in ["FindPostgreSQL.cmake"]: file = os.path.join(self.source_folder, "qtbase", "cmake", f) if os.path.isfile(file): @@ -1099,7 +1110,11 @@ def _create_plugin(pluginname, libname, plugintype, requires): "wtsapi32", "shcore", "comdlg32", "d3d9", "runtimeobject" ] _create_plugin("QWindowsIntegrationPlugin", "qwindows", "platforms", ["Core", "Gui"]) - _create_plugin("QWindowsVistaStylePlugin", "qwindowsvistastyle", "styles", ["Core", "Gui"]) + # https://github.com/qt/qtbase/commit/65d58e6c41e3c549c89ea4f05a8e467466e79ca3 + if Version(self.version) >= "6.7.0": + _create_plugin("QModernWindowsStylePlugin", "qmodernwindowsstyle", "styles", ["Core", "Gui"]) + else: + _create_plugin("QWindowsVistaStylePlugin", "qwindowsvistastyle", "styles", ["Core", "Gui"]) # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/windows/CMakeLists.txt#L53-L69 self.cpp_info.components["qtQWindowsIntegrationPlugin"].system_libs += [ "advapi32", "dwmapi", "gdi32", "imm32", "ole32", "oleaut32", "setupapi", "shell32", "shlwapi", diff --git a/recipes/qt/6.x.x/qtmodules6.6.3.conf b/recipes/qt/6.x.x/qtmodules6.6.3.conf new file mode 100644 index 00000000000000..9ab358b10e06c7 --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.6.3.conf @@ -0,0 +1,338 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.6.3 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.6.3 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.6.3 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.6.3 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.6.3 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.6.3 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = dev + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.6.3 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.6.3 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = dev + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase qtpositioning + recommends = qtdeclarative + path = qtlocation + url = ../qtlocation.git + branch = 6.6.3 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.6.3 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.6.3 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative + path = qtconnectivity + url = ../qtconnectivity.git + branch = 6.6.3 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.6.3 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools qtmultimedia + path = qt3d + url = ../qt3d.git + branch = 6.6.3 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.6.3 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.6.3 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.6.3 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.6.3 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.6.3 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.6.3 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.6.3 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.6.3 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.6.3 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.6.3 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = dev + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.6.3 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.6.3 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.6.3 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.6.3 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = dev + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.6.3 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.6.3 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.6.3 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.6.3 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.6.3 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.6.3 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.6.3 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.6.3 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.6.3 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.6.3 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.6.3 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.6.3 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.6.3 + status = addon +[submodule "qtgraphs"] + depends = qtbase qtdeclarative qtquick3d + path = qtgraphs + url = ../qtgraphs.git + branch = 6.6.3 + status = preview diff --git a/recipes/qt/6.x.x/qtmodules6.7.0.conf b/recipes/qt/6.x.x/qtmodules6.7.0.conf new file mode 100644 index 00000000000000..648d1540572321 --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.7.0.conf @@ -0,0 +1,338 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.7.0 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.7.0 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.7.0 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.7.0 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.7.0 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.7.0 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = dev + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.7.0 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.7.0 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = dev + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase qtpositioning + recommends = qtdeclarative + path = qtlocation + url = ../qtlocation.git + branch = 6.7.0 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.7.0 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.7.0 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative + path = qtconnectivity + url = ../qtconnectivity.git + branch = 6.7.0 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.7.0 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools qtmultimedia + path = qt3d + url = ../qt3d.git + branch = 6.7.0 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.7.0 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.7.0 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.7.0 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.7.0 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.7.0 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.7.0 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.7.0 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.7.0 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.7.0 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.7.0 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = dev + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.7.0 + status = addon +[submodule "qtspeech"] + depends = qtbase qtmultimedia + recommends = qtdeclarative + path = qtspeech + url = ../qtspeech.git + branch = 6.7.0 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.7.0 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.7.0 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = dev + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.7.0 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.7.0 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.7.0 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.7.0 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.7.0 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.7 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.7 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.7 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.7.0 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.7.0 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.7.0 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.7.0 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.7.0 + status = addon +[submodule "qtgraphs"] + depends = qtbase qtdeclarative qtquick3d + path = qtgraphs + url = ../qtgraphs.git + branch = 6.7.0 + status = preview diff --git a/recipes/qt/config.yml b/recipes/qt/config.yml index 026f022cea5e2b..238dd7a439c7d4 100644 --- a/recipes/qt/config.yml +++ b/recipes/qt/config.yml @@ -1,4 +1,8 @@ versions: + "6.7.0": + folder: 6.x.x + "6.6.3": + folder: 6.x.x "6.6.2": folder: 6.x.x "6.6.1": diff --git a/recipes/qtxlsxwriter/all/conanfile.py b/recipes/qtxlsxwriter/all/conanfile.py index a67db1337017f9..6acde10a92b2ee 100644 --- a/recipes/qtxlsxwriter/all/conanfile.py +++ b/recipes/qtxlsxwriter/all/conanfile.py @@ -19,6 +19,7 @@ class QtXlsxWriterConan(ConanFile): topics = ("excel", "xlsx") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -44,7 +45,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("qt/5.15.7") + self.requires("qt/5.15.13", transitive_headers=True, transitive_libs=True) def validate(self): if not self.dependencies["qt"].options.gui: diff --git a/recipes/quill/all/conandata.yml b/recipes/quill/all/conandata.yml index 289ea10c9c0f42..0be2d4ac0fc31d 100644 --- a/recipes/quill/all/conandata.yml +++ b/recipes/quill/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.8.0": + url: "https://github.com/odygrd/quill/archive/v3.8.0.tar.gz" + sha256: "d3e1b349c5d6904c9644e5b79ec65f21692e8094a3d75241a7fe071076eef4dd" "3.7.0": url: "https://github.com/odygrd/quill/archive/v3.7.0.tar.gz" sha256: "53afe555c32b4263c9d31ec11bd0d858983374af7a5e79eb26124f803b192515" diff --git a/recipes/quill/config.yml b/recipes/quill/config.yml index b27bda5fe6f9a8..fb0f6417a4780b 100644 --- a/recipes/quill/config.yml +++ b/recipes/quill/config.yml @@ -1,4 +1,6 @@ versions: + "3.8.0": + folder: "all" "3.7.0": folder: "all" "3.6.0": diff --git a/recipes/rabbitmq-c/all/conandata.yml b/recipes/rabbitmq-c/all/conandata.yml index 4a93aef8c8422c..eeadabf60d0ef8 100755 --- a/recipes/rabbitmq-c/all/conandata.yml +++ b/recipes/rabbitmq-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.14.0": + url: "https://github.com/alanxz/rabbitmq-c/archive/v0.14.0.tar.gz" + sha256: "839b28eae20075ac58f45925fe991d16a3138cbde015db0ee11df1acb1c493df" "0.13.0": url: "https://github.com/alanxz/rabbitmq-c/archive/v0.13.0.tar.gz" sha256: "8b224e41bba504fc52b02f918d8df7e4bf5359d493cbbff36c06078655c676e6" diff --git a/recipes/rabbitmq-c/all/conanfile.py b/recipes/rabbitmq-c/all/conanfile.py index a192092e12ead4..278092bcc50b85 100755 --- a/recipes/rabbitmq-c/all/conanfile.py +++ b/recipes/rabbitmq-c/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir from conan.tools.scm import Version +from conan.tools.env import VirtualBuildEnv import os required_conan_version = ">=1.53.0" @@ -9,10 +10,10 @@ class RabbitmqcConan(ConanFile): name = "rabbitmq-c" + description = "This is a C-language AMQP client library for use with v2.0+ of the RabbitMQ broker." license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/alanxz/rabbitmq-c" - description = "This is a C-language AMQP client library for use with v2.0+ of the RabbitMQ broker." topics = ("rabbitmq", "message queue") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -41,6 +42,10 @@ def requirements(self): if self.options.ssl: self.requires("openssl/[>=1.1 <4]") + def build_requirements(self): + if Version(self.version) >= "0.14.0": + self.tool_requires("cmake/[>=3.22 <4]") + def layout(self): cmake_layout(self, src_folder="src") @@ -68,6 +73,10 @@ def generate(self): deps = CMakeDeps(self) deps.generate() + if Version(self.version) >= "0.14.0": + venv = VirtualBuildEnv(self) + venv.generate(scope="build") + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/rabbitmq-c/config.yml b/recipes/rabbitmq-c/config.yml index 5d590dc0b2c3ba..b97f7da4c2ee81 100644 --- a/recipes/rabbitmq-c/config.yml +++ b/recipes/rabbitmq-c/config.yml @@ -1,4 +1,6 @@ versions: + "0.14.0": + folder: all "0.13.0": folder: all "0.11.0": diff --git a/recipes/rapidcsv/all/conandata.yml b/recipes/rapidcsv/all/conandata.yml index 22f73545deb36a..350384694edebd 100644 --- a/recipes/rapidcsv/all/conandata.yml +++ b/recipes/rapidcsv/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "8.82": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.82.tar.gz" + sha256: "4f1f57ca9db0f5447416acbef4e059cbd7cb03f6eb39fec1301732bbedaac927" "8.80": url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.80.tar.gz" sha256: "4c9e01cb2554cc76acac61532ef33b59e5b1f822160d2eb7efee2c128ea7f4c5" diff --git a/recipes/rapidcsv/config.yml b/recipes/rapidcsv/config.yml index 643c892898926b..a48e9cfb7dba1a 100644 --- a/recipes/rapidcsv/config.yml +++ b/recipes/rapidcsv/config.yml @@ -1,4 +1,6 @@ versions: + "8.82": + folder: "all" "8.80": folder: "all" "8.77": diff --git a/recipes/rapidfuzz/all/conandata.yml b/recipes/rapidfuzz/all/conandata.yml index 79328af1605662..2504b2040c7964 100644 --- a/recipes/rapidfuzz/all/conandata.yml +++ b/recipes/rapidfuzz/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.4": + url: "https://github.com/rapidfuzz/rapidfuzz-cpp/archive/refs/tags/v3.0.4.tar.gz" + sha256: "18d1c41575ceddd6308587da8befc98c85d3b5bc2179d418daffed6d46b8cb0a" "3.0.2": url: "https://github.com/rapidfuzz/rapidfuzz-cpp/archive/refs/tags/v3.0.2.tar.gz" sha256: "4fddce5c0368e78bd604c6b820e6be248d669754715e39b4a8a281bda4c06de1" diff --git a/recipes/rapidfuzz/config.yml b/recipes/rapidfuzz/config.yml index f32d6b33d56dcb..7af7ecd804cb2b 100644 --- a/recipes/rapidfuzz/config.yml +++ b/recipes/rapidfuzz/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.4": + folder: "all" "3.0.2": folder: "all" "3.0.0": diff --git a/recipes/reactiveplusplus/all/conandata.yml b/recipes/reactiveplusplus/all/conandata.yml index a8ee60a2f81970..45940f3c98c162 100644 --- a/recipes/reactiveplusplus/all/conandata.yml +++ b/recipes/reactiveplusplus/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.1": + url: "https://github.com/victimsnino/ReactivePlusPlus/archive/refs/tags/v2.1.1.tar.gz" + sha256: "0b962478d7c973a1f74062ce7f8d24c2fdcd2733031b1f014e65d252d59ebe6a" "2.0.0": url: "https://github.com/victimsnino/ReactivePlusPlus/archive/v2.0.0.tar.gz" sha256: "8950fe579aea23be1a6affd4ec8845c78016454aaf875dbae6a52d10eeb6df02" diff --git a/recipes/reactiveplusplus/config.yml b/recipes/reactiveplusplus/config.yml index feccf8f451435f..f409d3e717279e 100644 --- a/recipes/reactiveplusplus/config.yml +++ b/recipes/reactiveplusplus/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.1": + folder: all "2.0.0": folder: all "0.2.3": diff --git a/recipes/readosm/all/conanfile.py b/recipes/readosm/all/conanfile.py index b9c849a5528870..8a9b5054afef41 100644 --- a/recipes/readosm/all/conanfile.py +++ b/recipes/readosm/all/conanfile.py @@ -54,7 +54,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("zlib/[>=1.2.11 <2]") def build_requirements(self): diff --git a/recipes/rmm/all/conandata.yml b/recipes/rmm/all/conandata.yml index 67683994d5b6fa..31ecfbfa6c6efe 100644 --- a/recipes/rmm/all/conandata.yml +++ b/recipes/rmm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "24.04.00": + url: "https://github.com/rapidsai/rmm/archive/v24.04.00a.tar.gz" + sha256: "47a5d28a99165fc6e1f02399e0cc8b304f5bbc9aaf2071288ae92638ecdf516c" "23.10.00": url: "https://github.com/rapidsai/rmm/archive/v23.10.00.tar.gz" sha256: "4e2408073662fdfd92ca21d87f7d2afc64d2595fd5a1e3fa321d3472cfbd7f7a" diff --git a/recipes/rmm/all/conanfile.py b/recipes/rmm/all/conanfile.py index ca0e3861927c1a..91388dbe02f58c 100644 --- a/recipes/rmm/all/conanfile.py +++ b/recipes/rmm/all/conanfile.py @@ -42,8 +42,8 @@ def layout(self): def requirements(self): self.requires("thrust/1.17.2") - self.requires("spdlog/1.12.0") - self.requires("fmt/10.1.1") + self.requires("spdlog/1.13.0") + self.requires("fmt/10.2.1") def package_id(self): self.info.clear() diff --git a/recipes/rmm/config.yml b/recipes/rmm/config.yml index 20cd4f56dc99ff..396bbc9cfd4975 100644 --- a/recipes/rmm/config.yml +++ b/recipes/rmm/config.yml @@ -1,4 +1,6 @@ versions: + "24.04.00": + folder: all "23.10.00": folder: all "23.06.00": diff --git a/recipes/roaring/all/conandata.yml b/recipes/roaring/all/conandata.yml index edc3ffb72f6d66..afaf790313c5af 100644 --- a/recipes/roaring/all/conandata.yml +++ b/recipes/roaring/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "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" diff --git a/recipes/roaring/config.yml b/recipes/roaring/config.yml index cc4a150b9e9614..6437564275dee6 100644 --- a/recipes/roaring/config.yml +++ b/recipes/roaring/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.0": + folder: all "2.1.2": folder: all "2.1.1": diff --git a/recipes/rocksdb/all/conandata.yml b/recipes/rocksdb/all/conandata.yml index d4cc95fcc067be..2236d1d78b40fe 100644 --- a/recipes/rocksdb/all/conandata.yml +++ b/recipes/rocksdb/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "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/refs/tags/v6.29.5.tar.gz" sha256: "ddbf84791f0980c0bbce3902feb93a2c7006f6f53bfd798926143e31d4d756f0" @@ -8,9 +14,6 @@ sources: "6.20.3": url: "https://github.com/facebook/rocksdb/archive/refs/tags/v6.20.3.tar.gz" sha256: "c6502c7aae641b7e20fafa6c2b92273d935d2b7b2707135ebd9a67b092169dca" - "8.8.1": - url: "https://github.com/facebook/rocksdb/archive/refs/tags/v8.8.1.tar.gz" - sha256: "056c7e21ad8ae36b026ac3b94b9d6e0fcc60e1d937fc80330921e4181be5c36e" patches: "6.29.5": - patch_file: "patches/6.29.5-0001-add-include-cstdint-for-gcc-13.patch" diff --git a/recipes/rocksdb/all/conanfile.py b/recipes/rocksdb/all/conanfile.py index 09425b9f86390d..f9abafa35f177e 100644 --- a/recipes/rocksdb/all/conanfile.py +++ b/recipes/rocksdb/all/conanfile.py @@ -163,6 +163,8 @@ def generate(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): diff --git a/recipes/rocksdb/config.yml b/recipes/rocksdb/config.yml index 3691365f4f4a3e..ee10c33aa98998 100644 --- a/recipes/rocksdb/config.yml +++ b/recipes/rocksdb/config.yml @@ -1,9 +1,11 @@ versions: + "9.0.0": + folder: all + "8.8.1": + folder: all "6.29.5": folder: all "6.27.3": folder: all "6.20.3": folder: all - "8.8.1": - folder: all diff --git a/recipes/rtmidi/all/conandata.yml b/recipes/rtmidi/all/conandata.yml index 7f688e03dcce49..ad84f3a29f6e69 100644 --- a/recipes/rtmidi/all/conandata.yml +++ b/recipes/rtmidi/all/conandata.yml @@ -1,12 +1,18 @@ sources: "6.0.0": - url: "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-6.0.0.tar.gz" + url: + - "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-6.0.0.tar.gz" + - "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-6.0.0.tar.gz" sha256: "5960ccf64b42c23400720ccc880e2f205677ce9457f747ef758b598acd64db5b" "5.0.0": - url: "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-5.0.0.tar.gz" + url: + - "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-5.0.0.tar.gz" + - "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-5.0.0.tar.gz" sha256: "48db0ed58c8c0e207b5d7327a0210b5bcaeb50e26387935d02829239b0f3c2b9" "4.0.0": - url: "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz" + url: + - "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz" + - "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz" sha256: "370cfe710f43fbeba8d2b8c8bc310f314338c519c2cf2865e2d2737b251526cd" patches: "4.0.0": diff --git a/recipes/runtimeqml/all/conanfile.py b/recipes/runtimeqml/all/conanfile.py index 8ed18efdf54c96..cae0fb3d308bb1 100644 --- a/recipes/runtimeqml/all/conanfile.py +++ b/recipes/runtimeqml/all/conanfile.py @@ -41,8 +41,7 @@ def _compilers_minimum_version(self): } def export_sources(self): - copy(self, "CMakeLists.txt", self.recipe_folder, - self.export_sources_folder) + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -50,19 +49,16 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") def layout(self): - cmake_layout(self) + cmake_layout(self, src_folder="src") def requirements(self): if Version(self.version) <= "cci.20211220": - self.requires("qt/5.15.5") + self.requires("qt/5.15.13") else: - self.requires("qt/6.3.1") + self.requires("qt/6.6.2") def validate(self): if self.info.settings.compiler.cppstd: @@ -81,8 +77,7 @@ def validate(self): f"{self.ref} requires option qt:qtdeclarative=True") def source(self): - get(self, **self.conan_data["sources"][str(self.version)], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][str(self.version)], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/sail/all/conandata.yml b/recipes/sail/all/conandata.yml index 999f5e67c93311..912a033d71e011 100644 --- a/recipes/sail/all/conandata.yml +++ b/recipes/sail/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.4": + url: "https://github.com/HappySeaFox/sail/archive/v0.9.4.tar.gz" + sha256: "9a8b93c15c4a1afe07c760d2087895a18626034f55917f333aaabe9c9704438f" "0.9.1": url: "https://github.com/HappySeaFox/sail/archive/v0.9.1.tar.gz" sha256: "d02ce889b70d9e237b64806df26b044753e3edf3e87c8af42c32ec9968133a88" diff --git a/recipes/sail/config.yml b/recipes/sail/config.yml index 4f3643b98f32b2..2a8dad7a0ab375 100644 --- a/recipes/sail/config.yml +++ b/recipes/sail/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.4": + folder: all "0.9.1": folder: all "0.9.0": diff --git a/recipes/sbepp/all/conanfile.py b/recipes/sbepp/all/conanfile.py index f1cab17bf26490..85e391e2ff3271 100644 --- a/recipes/sbepp/all/conanfile.py +++ b/recipes/sbepp/all/conanfile.py @@ -37,7 +37,7 @@ def _min_cppstd(self): def _compilers_minimum_version(self): if self.options.with_sbeppc: return { - "gcc": "9", + "gcc": "8", "clang": "9", "apple-clang": "11" } diff --git a/recipes/sdbus-cpp/all/conanfile.py b/recipes/sdbus-cpp/all/conanfile.py index b466198f4d0ea4..f4bb28acf81ccd 100644 --- a/recipes/sdbus-cpp/all/conanfile.py +++ b/recipes/sdbus-cpp/all/conanfile.py @@ -76,7 +76,7 @@ def validate(self): def build_requirements(self): self.tool_requires("pkgconf/2.1.0") if self.options.with_code_gen: - self.tool_requires("expat/2.6.0") + self.tool_requires("expat/[>=2.6.2 <3]") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/sdl/all/conandata.yml b/recipes/sdl/all/conandata.yml index 5542cc7bb105c0..75e83f8bc9b12f 100644 --- a/recipes/sdl/all/conandata.yml +++ b/recipes/sdl/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.30.2": + url: "https://www.libsdl.org/release/SDL2-2.30.2.tar.gz" + sha256: "891d66ac8cae51361d3229e3336ebec1c407a8a2a063b61df14f5fdf3ab5ac31" + "2.30.1": + url: "https://www.libsdl.org/release/SDL2-2.30.1.tar.gz" + sha256: "01215ffbc8cfc4ad165ba7573750f15ddda1f971d5a66e9dcaffd37c587f473a" "2.28.5": url: "https://www.libsdl.org/release/SDL2-2.28.5.tar.gz" sha256: "332cb37d0be20cb9541739c61f79bae5a477427d79ae85e352089afdaf6666e4" diff --git a/recipes/sdl/all/conanfile.py b/recipes/sdl/all/conanfile.py index 97981518e1f52d..cd55e0ceb1b786 100644 --- a/recipes/sdl/all/conanfile.py +++ b/recipes/sdl/all/conanfile.py @@ -79,12 +79,12 @@ class SDLConan(ConanFile): "libunwind": True, } generators = "CMakeDeps", "PkgConfigDeps", "VirtualBuildEnv" - + @property def _is_clang_cl(self): return self.settings.os == "Windows" and self.settings.compiler == "clang" and \ self.settings.compiler.get_safe("runtime") - + def layout(self): cmake_layout(self, src_folder="src") @@ -192,22 +192,23 @@ def source(self): def _patch_sources(self): apply_conandata_patches(self) - cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - if self.settings.os == "Macos": - if self.options.iconv: - # If using conan-provided iconv, search for the symbol "libiconv_open" - replace_check = "check_library_exists(iconv libiconv_open" - else: - # When no tusing conan-provided icon, don't check for iconv at all - replace_check = "#check_library_exists(iconv iconv_open" - replace_in_file(self, cmakelists, "check_library_exists(iconv iconv_open", - replace_check) - - # Avoid assuming iconv is available if it is provided by the C runtime, - # and let SDL build the fallback implementation - replace_in_file(self, cmakelists, - 'check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)', - '# check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)') + if Version(self.version) < "2.30.0": + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + if self.settings.os == "Macos": + if self.options.iconv: + # If using conan-provided iconv, search for the symbol "libiconv_open" + replace_check = "check_library_exists(iconv libiconv_open" + else: + # When no tusing conan-provided icon, don't check for iconv at all + replace_check = "#check_library_exists(iconv iconv_open" + replace_in_file(self, cmakelists, "check_library_exists(iconv iconv_open", + replace_check) + + # Avoid assuming iconv is available if it is provided by the C runtime, + # and let SDL build the fallback implementation + replace_in_file(self, cmakelists, + 'check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)', + '# check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)') # Ensure to find wayland-scanner from wayland recipe in build requirements (or requirements if 1 profile) if self.options.get_safe("wayland"): @@ -237,6 +238,7 @@ def define_toolchain(self): tc.variables["HAVE_LIBC"] = True tc.variables["SDL_SHARED"] = self.options.shared tc.variables["SDL_STATIC"] = not self.options.shared + tc.variables["SDL_TEST"] = False tc.variables["SDL_OPENGL"] = self.options.opengl tc.variables["SDL_OPENGLES"] = self.options.opengles tc.variables["SDL_VULKAN"] = self.options.vulkan @@ -313,6 +315,9 @@ def define_toolchain(self): if Version(self.version) >= "2.0.22": tc.variables["SDL2_DISABLE_SDL2MAIN"] = not self.options.sdl2main + if Version(self.version) >= "2.30.0": + tc.variables["SDL_LIBICONV"] = self.options.get_safe("iconv", False) + tc.variables["SDL_SYSTEM_ICONV"] = False # Add extra information collected from the deps tc.variables["EXTRA_LDFLAGS"] = ";".join(cmake_extra_ldflags) @@ -320,6 +325,7 @@ def define_toolchain(self): cmake_extra_cflags = ["-I{}".format(path) for _, dep in self.dependencies.items() for path in dep.cpp_info.includedirs] tc.variables["EXTRA_CFLAGS"] = ";".join(cmake_extra_cflags).replace(os.sep, '/') tc.variables["EXTRA_LIBS"] = ";".join(cmake_extra_libs) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() def build(self): @@ -334,6 +340,8 @@ def package(self): copy(self, pattern="LICENSE.txt", src=os.path.join(self.source_folder), dst=os.path.join(self.package_folder, "licenses")) rm(self, "sdl2-config", os.path.join(self.package_folder, "bin")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) rmdir(self, os.path.join(self.package_folder, "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) diff --git a/recipes/sdl/config.yml b/recipes/sdl/config.yml index e05c00ea2969ea..fe208cfd7ffb21 100644 --- a/recipes/sdl/config.yml +++ b/recipes/sdl/config.yml @@ -1,4 +1,8 @@ versions: + "2.30.2": + folder: all + "2.30.1": + folder: all "2.28.5": folder: all "2.28.3": diff --git a/recipes/sdl_mixer/cmake/conandata.yml b/recipes/sdl_mixer/cmake/conandata.yml new file mode 100644 index 00000000000000..67acbdb598f693 --- /dev/null +++ b/recipes/sdl_mixer/cmake/conandata.yml @@ -0,0 +1,6 @@ +sources: + "2.8.0": + url: + - "https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.0/SDL2_mixer-2.8.0.tar.gz" + - "https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.8.0.tar.gz" + sha256: "1cfb34c87b26dbdbc7afd68c4f545c0116ab5f90bbfecc5aebe2a9cb4bb31549" diff --git a/recipes/sdl_mixer/cmake/conanfile.py b/recipes/sdl_mixer/cmake/conanfile.py new file mode 100644 index 00000000000000..4e5f82fa8bef50 --- /dev/null +++ b/recipes/sdl_mixer/cmake/conanfile.py @@ -0,0 +1,269 @@ +import os + +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 copy, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.57.0" + + +class SDLMixerConan(ConanFile): + name = "sdl_mixer" + description = "SDL_mixer is a sample multi-channel audio mixer library" + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.libsdl.org/projects/SDL_mixer/" + topics = ("sdl2", "sdl", "mixer", "audio", "multimedia", "sound", "music") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "cmd": [True, False], + "wav": [True, False], + "flac": [True, False], + "gme": [True, False], + "minimp3": [True, False], + "mpg123": [True, False], + "opus": [True, False], + "modplug": [True, False], + "fluidsynth": [True, False], + "nativemidi": [True, False], + "tinymidi": [True, False], + "vorbis": [False, "vorbisfile", "tremor", "stb"], + "wavpack": [True, False], + "xmp": [False, "libxmp", "libxmp-lite"], + } + default_options = { + "shared": False, + "fPIC": True, + "cmd": False, + "wav": True, + "flac": True, + "gme": False, + "minimp3": False, + "mpg123": True, + "opus": True, + "modplug": True, + "fluidsynth": False, + "nativemidi": True, + "tinymidi": True, + "vorbis": "stb", + "wavpack": False, + "xmp": False + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.tinymidi + if not (self.settings.os == "Windows" or is_apple_os(self)): + del self.options.nativemidi + + 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 validate(self): + if not self.options.flac and self.options.gme: + raise ConanInvalidConfiguration("gme is not yet available in CCI, contributions are welcome") + if self.options.vorbis == "tremor": + raise ConanInvalidConfiguration("tremor is not yet available in CCI, contributions are welcome") + if self.options.xmp == "libxmp": + raise ConanInvalidConfiguration("libxmp is not yet available in CCI, contributions are welcome") + if self.options.xmp == "libxmp-lite": + raise ConanInvalidConfiguration("libxmp-lite is not yet available in CCI, contributions are welcome") + if self.options.fluidsynth: + raise ConanInvalidConfiguration("fluidsynth is not yet available in CCI, contributions are welcome") + if self.options.wavpack: + raise ConanInvalidConfiguration("wavpack is not yet available in CCI, contributions are welcome") + + def requirements(self): + self.requires("sdl/2.28.5", transitive_headers=True, transitive_libs=True) + if self.options.flac: + self.requires("flac/1.4.2") + elif self.options.gme: + # TODO: not available on CCI + # self.requires("gme/x.y.z") + pass + if self.options.mpg123: + self.requires("mpg123/1.31.2") + if self.options.minimp3: + self.requires("minimp3/cci.20211201") + if self.options.vorbis == "stb": + self.requires("stb/cci.20230920") + elif self.options.vorbis == "vorbisfile": + self.requires("vorbis/1.3.7") + elif self.options.vorbis == "tremor": + # TODO: not available on CCI + # self.requires("tremor/1.2.1") + pass + if self.options.opus: + self.requires("opusfile/0.12") + if self.options.modplug: + self.requires("libmodplug/0.8.9.0") + if self.options.xmp == "libxmp": + # TODO: not available on CCI + # self.requires("libxmp/x.y.z") + pass + elif self.options.xmp == "libxmp-lite": + # TODO: not available on CCI + # self.requires("libxmp-lite/x.y.z") + pass + if self.options.fluidsynth: + # TODO: not available on CCI + # self.requires("fluidsynth/2.2") + pass + if self.options.get_safe("tinymidi"): + self.requires("tinymidi/cci.20130325") + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.6.3/CMakeLists.txt#L148-L162 + if self.options.vorbis or self.options.flac or self.options.opus: + self.requires("ogg/1.3.5") + if self.options.wavpack: + # TODO: not available on CCI + # self.requires("wavpack/x.y.z") + pass + + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + rmdir(self, os.path.join(self.source_folder, "external")) + + def generate(self): + tc = CMakeToolchain(self) + # Disable debug postfix as it's not relevant to single-configuration Conan builds + # and will be removed in v3.0 anyway. + tc.variables["SDL2MIXER_DEBUG_POSTFIX"] = "" + tc.variables["SDL2MIXER_VENDORED"] = False + tc.variables["SDL2MIXER_SAMPLES"] = False + tc.variables["SDL2MIXER_CMD"] = self.options.cmd + # WAVE + tc.variables["SDL2MIXER_WAVE"] = self.options.wav + # FLAC + tc.variables["SDL2MIXER_FLAC"] = self.options.flac + # GME + tc.variables["SDL2MIXER_GME"] = self.options.gme + # MOD + tc.variables["SDL2MIXER_MOD"] = self.options.modplug or bool(self.options.xmp) + tc.variables["SDL2MIXER_MOD_MODPLUG"] = self.options.modplug + tc.variables["SDL2MIXER_MOD_XMP"] = self.options.xmp == "libxmp" + tc.variables["SDL2MIXER_MOD_XMP_LITE"] = self.options.xmp == "libxmp-lite" + # MP3 + tc.variables["SDL2MIXER_MP3"] = self.options.mpg123 or self.options.minimp3 + tc.variables["SDL2MIXER_MP3_MPG123"] = self.options.mpg123 + tc.variables["SDL2MIXER_MP3_MINIMP3"] = self.options.minimp3 + # MIDI + tc.variables["SDL2MIXER_MIDI"] = self.options.get_safe("nativemidi", False) or self.options.get_safe("tinymidi", False) or self.options.fluidsynth + tc.variables["SDL2MIXER_MIDI_FLUIDSYNTH"] = self.options.fluidsynth + tc.variables["SDL2MIXER_MIDI_TIMIDITY"] = self.options.get_safe("tinymidi", False) + tc.variables["SDL2MIXER_MIDI_NATIVE"] = self.options.get_safe("nativemidi", False) + # OPUS + tc.variables["SDL2MIXER_OPUS"] = self.options.opus + # VORBIS + if self.options.vorbis == "stb": + tc.variables["SDL2MIXER_VORBIS"] = "STB" + elif self.options.vorbis == "vorbisfile": + tc.variables["SDL2MIXER_VORBIS"] = "VORBISFILE" + elif self.options.vorbis == "tremor": + tc.variables["SDL2MIXER_VORBIS"] = "TREMOR" + else: + tc.variables["SDL2MIXER_VORBIS"] = False + # WavPack + tc.variables["SDL2MIXER_WAVPACK"] = self.options.wavpack + + # TODO: add support for dynamic loading of dependencies + tc.variables["SDL2MIXER_DEPS_SHARED"] = False + tc.variables["SDL2MIXER_FLAC_LIBFLAC_SHARED"] = False + tc.variables["SDL2MIXER_GME_SHARED"] = False + tc.variables["SDL2MIXER_MIDI_FLUIDSYNTH_SHARED"] = False + tc.variables["SDL2MIXER_MIDI_TIMIDITY_SHARED"] = False + tc.variables["SDL2MIXER_MOD_MODPLUG_SHARED"] = False + tc.variables["SDL2MIXER_MOD_XMP_SHARED"] = False + tc.variables["SDL2MIXER_MP3_MPG123_SHARED"] = False + tc.variables["SDL2MIXER_OGG_SHARED"] = False + tc.variables["SDL2MIXER_OPUS_SHARED"] = False + tc.variables["SDL2MIXER_SNDFILE_SHARED"] = False + tc.variables["SDL2MIXER_VORBIS_TREMOR_SHARED"] = False + tc.variables["SDL2MIXER_VORBIS_VORBISFILE_SHARED"] = False + tc.variables["SDL2MIXER_WAVPACK_SHARED"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("flac", "cmake_file_name", "FLAC") + deps.set_property("flac", "cmake_target_name", "FLAC::FLAC") + deps.set_property("fluidsynth", "cmake_file_name", "FluidSynth") + deps.set_property("fluidsynth", "cmake_target_name", "FluidSynth::libfluidsynth") + deps.set_property("gme", "cmake_file_name", "gme") + deps.set_property("gme", "cmake_target_name", "gme::gme") + deps.set_property("libxmp", "cmake_file_name", "libxmp") + deps.set_property("libxmp", "cmake_target_name", "libxmp::libxmp") + deps.set_property("libxmp-lite", "cmake_file_name", "libxmp-lite") + deps.set_property("libxmp-lite", "cmake_target_name", "libxmp-lite::libxmp-lite") + deps.set_property("libmodplug", "cmake_file_name", "modplug") + deps.set_property("libmodplug", "cmake_target_name", "modplug::modplug") + deps.set_property("mpg123", "cmake_file_name", "mpg123") + deps.set_property("mpg123", "cmake_target_name", "MPG123::libmpg123") + deps.set_property("opusfile", "cmake_file_name", "OpusFile") + deps.set_property("opusfile", "cmake_target_name", "OpusFile::opusfile") + deps.set_property("tremor", "cmake_file_name", "tremor") + deps.set_property("tremor", "cmake_target_name", "tremor::tremor") + deps.set_property("vorbis", "cmake_file_name", "Vorbis") + deps.set_property("vorbis::vorbisfile", "cmake_target_name", "Vorbis::vorbisfile") + deps.set_property("wavpack", "cmake_file_name", "wavpack") + deps.set_property("wavpack", "cmake_target_name", "WavPack::WavPack") + + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", 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")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SDL2_mixer") + self.cpp_info.set_property("cmake_target_name", "SDL2_mixer::SDL2_mixer") + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.6.3/CMakeLists.txt#L164-L172 + if not self.options.shared: + self.cpp_info.set_property("cmake_target_aliases", ["SDL2_mixer::SDL2_mixer-static"]) + # The project only creates a pkg-config file for a shared lib, but add it for static as well, unofficially + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.6.3/CMakeLists.txt#L828 + self.cpp_info.set_property("pkg_config_name", "SDL2_mixer") + + if is_msvc(self) and not self.options.shared: + self.cpp_info.libs = ["SDL2_mixer-static"] + else: + self.cpp_info.libs = ["SDL2_mixer"] + self.cpp_info.includedirs.append(os.path.join("include", "SDL2")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + if self.settings.os == "Windows": + if self.options.nativemidi: + self.cpp_info.system_libs.append("winmm") + elif is_apple_os(self): + self.cpp_info.frameworks.extend(["AudioToolbox", "AudioUnit", "CoreServices", "CoreGraphics", "CoreFoundation"]) + if self.settings.os == "Macos": + self.cpp_info.frameworks.append("AppKit") + + self.cpp_info.names["cmake_find_package"] = "SDL2_mixer" + self.cpp_info.names["cmake_find_package_multi"] = "SDL2_mixer" diff --git a/recipes/sdl_mixer/cmake/test_package/CMakeLists.txt b/recipes/sdl_mixer/cmake/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..d1c846300657fc --- /dev/null +++ b/recipes/sdl_mixer/cmake/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(SDL2_mixer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_mixer::SDL2_mixer) diff --git a/recipes/sdl_mixer/cmake/test_package/conanfile.py b/recipes/sdl_mixer/cmake/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/sdl_mixer/cmake/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/recipes/sdl_mixer/cmake/test_package/test_package.c b/recipes/sdl_mixer/cmake/test_package/test_package.c new file mode 100644 index 00000000000000..c0bb50e7184734 --- /dev/null +++ b/recipes/sdl_mixer/cmake/test_package/test_package.c @@ -0,0 +1,43 @@ +#include +#include + +#include +#include + +int main(int argc, char *argv[]) +{ + int audio_rate = MIX_DEFAULT_FREQUENCY; + int audio_format = MIX_DEFAULT_FORMAT; + int audio_channels = 2; + const SDL_version * version = Mix_Linked_Version(); + printf("%s", "SDL2_mixer version: "); + printf("%d.", (int)(version->major)); + printf("%d.", (int)(version->minor)); + printf("%d\n", (int)(version->patch)); + + if (SDL_Init(SDL_INIT_AUDIO) == 0) { + int initted = Mix_Init(MIX_INIT_FLAC | MIX_INIT_MOD | MIX_INIT_MP3 | MIX_INIT_OGG | MIX_INIT_MID | MIX_INIT_OPUS); + printf("%s %s\n", "Supported MIX_INIT_MOD: " , (initted & MIX_INIT_MOD ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_MP3: " , (initted & MIX_INIT_MP3 ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_OGG: " , (initted & MIX_INIT_OGG ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_FLAC: ", (initted & MIX_INIT_FLAC ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_MID: " , (initted & MIX_INIT_MID ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_OPUS: ", (initted & MIX_INIT_OPUS ? "Yes" : "No")); + + if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, 4096) == 0) { + int num_chunk_decoders = Mix_GetNumChunkDecoders(); + int num_music_decoders = Mix_GetNumMusicDecoders(); + int i = 0; + printf("%s\n", "chunk decoders:"); + for (i = 0; i < num_chunk_decoders; ++i) + printf("\t%s\n", Mix_GetChunkDecoder(i)); + printf("%s\n", "music decoders:"); + for (i = 0; i < num_music_decoders; ++i) + printf("\t%s\n", Mix_GetMusicDecoder(i)); + Mix_CloseAudio(); + Mix_Quit(); + } + } + + return 0; +} diff --git a/recipes/sdl_mixer/cmake/test_v1_package/CMakeLists.txt b/recipes/sdl_mixer/cmake/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/sdl_mixer/cmake/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/recipes/fontconfig/all/test_v1_package/conanfile.py b/recipes/sdl_mixer/cmake/test_v1_package/conanfile.py similarity index 77% rename from recipes/fontconfig/all/test_v1_package/conanfile.py rename to recipes/sdl_mixer/cmake/test_v1_package/conanfile.py index 19e6a0c06e3d81..49a3a66ea5bad4 100644 --- a/recipes/fontconfig/all/test_v1_package/conanfile.py +++ b/recipes/sdl_mixer/cmake/test_v1_package/conanfile.py @@ -3,8 +3,8 @@ class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) diff --git a/recipes/sdl_mixer/config.yml b/recipes/sdl_mixer/config.yml index 303d89a72ec250..ddf82f5ad0c182 100644 --- a/recipes/sdl_mixer/config.yml +++ b/recipes/sdl_mixer/config.yml @@ -1,3 +1,5 @@ versions: + "2.8.0": + folder: "cmake" "2.0.4": folder: "all" diff --git a/recipes/sentry-native/all/conandata.yml b/recipes/sentry-native/all/conandata.yml index 6bde257712f1a9..f41e33dbbde149 100644 --- a/recipes/sentry-native/all/conandata.yml +++ b/recipes/sentry-native/all/conandata.yml @@ -1,23 +1,16 @@ sources: + "0.7.2": + url: "https://github.com/getsentry/sentry-native/releases/download/0.7.2/sentry-native.zip" + sha256: "afb44d5cc4e0ec5f2e8068132c68256959188f6bf015e1837e7cc687014b9c70" + "0.7.1": + url: "https://github.com/getsentry/sentry-native/releases/download/0.7.1/sentry-native.zip" + sha256: "c450a064b0dbb1883a355455db2b6469abef59c04686a53719384bbc7ff507d3" "0.7.0": url: "https://github.com/getsentry/sentry-native/releases/download/0.7.0/sentry-native.zip" sha256: "4dfccc879a81771b9da1c335947ffc9e5987ca3d16b3035efa2c66a06f727543" "0.6.6": url: "https://github.com/getsentry/sentry-native/releases/download/0.6.6/sentry-native.zip" sha256: "7a98467c0b2571380a3afc5e681cb13aa406a709529be12d74610b0015ccde0c" - "0.6.5": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.5/sentry-native.zip" - sha256: "5f74a5c5c3abc6e1e7825d3306be9e3b3fd4e0f586f3cf7e86607d6f56a71995" - "0.6.4": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.4/sentry-native.zip" - sha256: "e00278bf9a4821bb4008985a5a552a84aba6ebb06d3f9e828082fcbf06b04a38" "0.5.4": url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" - -patches: - "0.6.5": - - patch_file: "patches/0.6.5-0001-fix-for-gcc13.patch" - patch_type: "backport" - patch_description: "Extra header required for gcc13" - patch_source: "https://chromium-review.googlesource.com/c/chromium/mini_chromium/+/4847514" diff --git a/recipes/sentry-native/all/conanfile.py b/recipes/sentry-native/all/conanfile.py index f783754fae680c..2f31f5efdc35b8 100644 --- a/recipes/sentry-native/all/conanfile.py +++ b/recipes/sentry-native/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.build import check_min_cppstd 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, rm, rmdir +from conan.tools.files import copy, get, rm, rmdir from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os @@ -66,9 +66,6 @@ def _minimum_compilers_version(self): "apple-clang": "5.1", } - def export_sources(self): - export_conandata_patches(self) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -162,7 +159,6 @@ def generate(self): CMakeDeps(self).generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/sentry-native/all/patches/0.6.5-0001-fix-for-gcc13.patch b/recipes/sentry-native/all/patches/0.6.5-0001-fix-for-gcc13.patch deleted file mode 100644 index b3a766009b3a74..00000000000000 --- a/recipes/sentry-native/all/patches/0.6.5-0001-fix-for-gcc13.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/external/crashpad/third_party/mini_chromium/mini_chromium/base/logging.h 2023-08-25 09:55:27.677142704 +0800 -+++ b/external/crashpad/third_party/mini_chromium/mini_chromium/base/logging.h 2023-08-25 10:06:01.654142494 +0800 -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - - #include "base/check.h" - #include "base/check_op.h" ---- a/external/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.h 2023-08-25 10:11:28.084886020 +0800 -+++ b/external/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.h 2023-08-25 11:06:37.044297949 +0800 -@@ -6,6 +6,7 @@ - #define MINI_CHROMIUM_BASE_STRINGS_UTF_STRING_CONVERSION_UTILS_H_ - - #include -+#include - - namespace base { - diff --git a/recipes/sentry-native/config.yml b/recipes/sentry-native/config.yml index 456ef7af835a58..a18579e4a1c1e0 100644 --- a/recipes/sentry-native/config.yml +++ b/recipes/sentry-native/config.yml @@ -1,11 +1,11 @@ versions: - "0.7.0": + "0.7.2": folder: all - "0.6.6": + "0.7.1": folder: all - "0.6.5": + "0.7.0": folder: all - "0.6.4": + "0.6.6": folder: all "0.5.4": folder: all diff --git a/recipes/sfl/all/conandata.yml b/recipes/sfl/all/conandata.yml index b4d8ce3303e286..f4fc4ae3ff6a21 100644 --- a/recipes/sfl/all/conandata.yml +++ b/recipes/sfl/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.4.0": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.4.0.tar.gz" + sha256: "dcdc6c40a60116075910e3321fe12065142d78f4947826aac263ade1d84d449a" + "1.3.1": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.3.1.tar.gz" + sha256: "e541857067ae3e6c8d9933736e70ef92c1ce0a0e374872497328edd2e4e47ae9" "1.3.0": url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.3.0.tar.gz" sha256: "1d0e797c5e11bbc861f9f1ae8eb7d9378d456d6cd1c43e00cdec6d3664e745e6" diff --git a/recipes/sfl/config.yml b/recipes/sfl/config.yml index 5f304ccdf5f5a6..75a12cbe4687a7 100644 --- a/recipes/sfl/config.yml +++ b/recipes/sfl/config.yml @@ -1,4 +1,8 @@ versions: + "1.4.0": + folder: "all" + "1.3.1": + folder: "all" "1.3.0": folder: "all" "1.2.4": diff --git a/recipes/simdjson/all/conandata.yml b/recipes/simdjson/all/conandata.yml index a13784e72fcfe7..ec78f3228deaa0 100644 --- a/recipes/simdjson/all/conandata.yml +++ b/recipes/simdjson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.9.1": + url: "https://github.com/simdjson/simdjson/archive/v3.9.1.tar.gz" + sha256: "a4b6e7cd83176e0ccb107ce38521da40a8df41c2d3c90566f2a0af05b0cd05c4" "3.8.0": url: "https://github.com/simdjson/simdjson/archive/v3.8.0.tar.gz" sha256: "e28e3f46f0012d405b67de6c0a75e8d8c9a612b0548cb59687822337d73ca78b" diff --git a/recipes/simdjson/config.yml b/recipes/simdjson/config.yml index 76ac101fa502ff..433aafc3da9ca6 100644 --- a/recipes/simdjson/config.yml +++ b/recipes/simdjson/config.yml @@ -1,4 +1,6 @@ versions: + "3.9.1": + folder: all "3.8.0": folder: all "3.7.0": diff --git a/recipes/simdutf/all/conandata.yml b/recipes/simdutf/all/conandata.yml index 043f57d573076f..2a8f8d281bcc9e 100644 --- a/recipes/simdutf/all/conandata.yml +++ b/recipes/simdutf/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "5.2.3": + url: "https://github.com/simdutf/simdutf/archive/v5.2.3.tar.gz" + sha256: "dfa55d85c3ee51e9b52e55c02701b16f83dcf1921e1075b67f99b1036df5adb8" + "5.2.2": + url: "https://github.com/simdutf/simdutf/archive/v5.2.2.tar.gz" + sha256: "6cd905ac7fcf6293e34d7acaa9d5af901d85f182f82ec6ec3ee9f9273881791d" "5.0.0": url: "https://github.com/simdutf/simdutf/archive/v5.0.0.tar.gz" sha256: "088d750466bf3487117cce7f828eb94a0a3474d7e76b45d4902c99a2387212b7" diff --git a/recipes/simdutf/config.yml b/recipes/simdutf/config.yml index 1753ee45a4882b..dc1781664daf26 100644 --- a/recipes/simdutf/config.yml +++ b/recipes/simdutf/config.yml @@ -1,4 +1,8 @@ versions: + "5.2.3": + folder: all + "5.2.2": + folder: all "5.0.0": folder: all "4.0.9": diff --git a/recipes/simfil/all/conandata.yml b/recipes/simfil/all/conandata.yml index f6fc491607eb0a..4fa19c86dbd8ce 100644 --- a/recipes/simfil/all/conandata.yml +++ b/recipes/simfil/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.2": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.1.2.tar.gz" + sha256: "a903658ff37fa304dc6d8cb65e7923b6857b825ce2ac205522b84e4785d80e8d" "0.1.1": url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.1.1.tar.gz" sha256: "e82a9d92ec65b7e27776d5507c78571cecc234f2b6fcdacc7ffcece6198f7f9a" diff --git a/recipes/simfil/all/conanfile.py b/recipes/simfil/all/conanfile.py index 7f51c69a00ce9d..66a16c329cfe69 100644 --- a/recipes/simfil/all/conanfile.py +++ b/recipes/simfil/all/conanfile.py @@ -16,6 +16,7 @@ class SimfilRecipe(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Klebert-Engineering/simfil" license = "BSD-3-Clause" + package_type = "library" topics = ["query-language", "json", "data-model"] # Binary configuration diff --git a/recipes/simfil/config.yml b/recipes/simfil/config.yml index b893ff21f7c232..eb8addc0ca6d37 100644 --- a/recipes/simfil/config.yml +++ b/recipes/simfil/config.yml @@ -1,3 +1,5 @@ versions: + "0.1.2": + folder: all "0.1.1": folder: all diff --git a/recipes/snappy/all/conandata.yml b/recipes/snappy/all/conandata.yml index 1488c7a2baf50c..4e4827d4134536 100644 --- a/recipes/snappy/all/conandata.yml +++ b/recipes/snappy/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "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" @@ -12,6 +15,19 @@ sources: url: "https://github.com/google/snappy/archive/1.1.7.tar.gz" sha256: "3dfa02e873ff51a11ee02b9ca391807f0c8ea0529a4924afa645fbf97163f9d4" patches: + "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" diff --git a/recipes/snappy/all/patches/1.2.0-0003-fix-clobber-list-older-llvm.patch b/recipes/snappy/all/patches/1.2.0-0003-fix-clobber-list-older-llvm.patch new file mode 100644 index 00000000000000..05accb60abfbad --- /dev/null +++ b/recipes/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/recipes/snappy/all/patches/1.2.0-0004-rtti-by-default.patch b/recipes/snappy/all/patches/1.2.0-0004-rtti-by-default.patch new file mode 100644 index 00000000000000..7ca0e721fadea3 --- /dev/null +++ b/recipes/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/recipes/snappy/config.yml b/recipes/snappy/config.yml index 521a59e91e109c..063d5899e0fa9c 100644 --- a/recipes/snappy/config.yml +++ b/recipes/snappy/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.10": folder: all "1.1.9": diff --git a/recipes/soplex/all/conandata.yml b/recipes/soplex/all/conandata.yml index b034a63a756936..a845c6567df9a1 100644 --- a/recipes/soplex/all/conandata.yml +++ b/recipes/soplex/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "7.0.0": + url: "https://github.com/scipopt/soplex/archive/refs/tags/release-700.tar.gz" + sha256: "ab1906d3afb1793a6f129a5baef9dd8eee929ee945aade427cb9f0b17888239c" "6.0.4": url: "https://github.com/scipopt/soplex/archive/refs/tags/release-604.tar.gz" sha256: "691f5b593cb85c2586522d5de5a5a7692958d22ff1ddffb4fc395f4696590b6f" diff --git a/recipes/soplex/all/conanfile.py b/recipes/soplex/all/conanfile.py index 047f359f2bb4bd..9dc99e1409055b 100644 --- a/recipes/soplex/all/conanfile.py +++ b/recipes/soplex/all/conanfile.py @@ -73,7 +73,7 @@ def requirements(self): # see https://github.com/conan-io/conan-center-index/pull/16017#issuecomment-1495688452 self.requires("gmp/6.3.0", transitive_headers=True, transitive_libs=True) if self.options.with_boost: - self.requires("boost/1.83.0", transitive_headers=True) # also update Boost_VERSION_MACRO below! + self.requires("boost/1.84.0", transitive_headers=True) # also update Boost_VERSION_MACRO below! def validate(self): if self.settings.compiler.cppstd: @@ -90,9 +90,11 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + tc.variables["MPFR"] = False tc.variables["GMP"] = self.options.with_gmp tc.variables["BOOST"] = self.options.with_boost - tc.variables["Boost_VERSION_MACRO"] = "108300" + tc.variables["Boost_VERSION_MACRO"] = "108400" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) if self.options.with_gmp: diff --git a/recipes/soplex/all/test_package/CMakeLists.txt b/recipes/soplex/all/test_package/CMakeLists.txt index e74edd1950d7af..f7348040724786 100644 --- a/recipes/soplex/all/test_package/CMakeLists.txt +++ b/recipes/soplex/all/test_package/CMakeLists.txt @@ -9,5 +9,9 @@ if(TARGET soplex::soplex) set_target_properties(soplex PROPERTIES INTERFACE_LINK_LIBRARIES soplex::soplex) endif() +if (MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") +endif () + add_executable(${PROJECT_NAME} main.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE soplex) diff --git a/recipes/soplex/config.yml b/recipes/soplex/config.yml index 73bcf839da6182..d6a55b6bed56d8 100644 --- a/recipes/soplex/config.yml +++ b/recipes/soplex/config.yml @@ -1,4 +1,6 @@ versions: + "7.0.0": + folder: all "6.0.4": folder: all "6.0.3": diff --git a/recipes/speedb/all/conandata.yml b/recipes/speedb/all/conandata.yml new file mode 100644 index 00000000000000..63a7ae1e281205 --- /dev/null +++ b/recipes/speedb/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "2.8.0": + url: "https://github.com/speedb-io/speedb/archive/refs/tags/speedb/v2.8.0.tar.gz" + sha256: "ee7a55942a23d9589e5d3527364a2f9ae552ef7d52f6fd303dda25e4f27786ba" +patches: + "2.8.0": + - patch_file: "patches/2.8.0-0001-use-cci.patch" + patch_description: "use cci's package" + patch_type: "conan" + - patch_file: "patches/2.8.0-0002-fix-install.patch" + patch_description: "disable static lib installation on shared build" + patch_type: "conan" diff --git a/recipes/speedb/all/conanfile.py b/recipes/speedb/all/conanfile.py new file mode 100644 index 00000000000000..043f01899c023c --- /dev/null +++ b/recipes/speedb/all/conanfile.py @@ -0,0 +1,141 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file +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 +import os + + +required_conan_version = ">=1.53.0" + +class SpeedbConan(ConanFile): + name = "speedb" + description = "A RocksDB compliant high performance scalable embedded key-value store" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/speedb-io/speedb" + topics = ("rocksdb", "embedded", "key-value-store", "kvs", "storage-engine") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_snappy": [True, False], + "with_lz4": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + "with_core_tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_snappy": True, + "with_lz4": True, + "with_zlib": True, + "with_zstd": True, + "with_core_tools": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + 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): + # TODO: support jemalloc, liburing + if self.options.with_snappy: + self.requires("snappy/1.1.10") + if self.options.with_lz4: + self.requires("lz4/1.9.4") + if self.options.with_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_zstd: + self.requires("zstd/1.5.5") + if self.options.with_core_tools: + self.requires("gflags/2.2.2") + self.requires("readline/8.2") + + 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." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_JEMALLOC"] = False + tc.variables["WITH_LIBURING"] = False + 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_TESTS"] = False + tc.variables["WITH_BENCHMARK_TOOLS"] = False + tc.variables["WITH_CORE_TOOLS"] = self.options.with_core_tools + tc.variables["WITH_GFLAGS"] = self.options.with_core_tools + tc.variables["WITH_TOOLS"] = False + tc.variables["ROCKSDB_BUILD_SHARED"] = self.options.shared + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # to avoid wrong CPU detection, modify not to use "-march=native" in apple-clang + if cross_building(self) and self.settings.compiler == "apple-clang": + replace_in_file(self, + os.path.join(self.source_folder, "CMakeLists.txt"), + """elseif(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64" AND NOT HAS_ARMV8_CRC)""", + "elseif(FALSE)" + ) + + def build(self): + self._patch_sources() + 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.libs = ["speedb"] + self.cpp_info.set_property("pkg_config_name", "speedb") + self.cpp_info.set_property("cmake_file_name", "Speedb") + self.cpp_info.set_property("cmake_target_name", "Speedb::speedb") diff --git a/recipes/speedb/all/patches/2.8.0-0001-use-cci.patch b/recipes/speedb/all/patches/2.8.0-0001-use-cci.patch new file mode 100644 index 00000000000000..0c321d827ce996 --- /dev/null +++ b/recipes/speedb/all/patches/2.8.0-0001-use-cci.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a579792..62299e9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -195,7 +195,11 @@ else() + find_package(zstd REQUIRED) + add_definitions(-DZSTD) + include_directories(${ZSTD_INCLUDE_DIR}) +- list(APPEND THIRDPARTY_LIBS zstd::zstd) ++ if (TARGET zstd::libzstd_shared) ++ list(APPEND THIRDPARTY_LIBS zstd::libzstd_shared) ++ else() ++ list(APPEND THIRDPARTY_LIBS zstd::libzstd_static) ++ endif() + endif() + endif() + +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 90e76e2..96180cc 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -2,11 +2,12 @@ set(CORE_TOOLS + sst_dump.cc + ldb.cc + beezcli.cc) ++find_package(readline REQUIRED) + foreach(src ${CORE_TOOLS}) + get_filename_component(exename ${src} NAME_WE) + add_executable(${exename}${ARTIFACT_SUFFIX} + ${src}) +- target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${ROCKSDB_LIB} readline) ++ target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${ROCKSDB_LIB} readline::readline) + list(APPEND core_tool_deps ${exename}) + endforeach() + diff --git a/recipes/speedb/all/patches/2.8.0-0002-fix-install.patch b/recipes/speedb/all/patches/2.8.0-0002-fix-install.patch new file mode 100644 index 00000000000000..8306a644257505 --- /dev/null +++ b/recipes/speedb/all/patches/2.8.0-0002-fix-install.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 62299e9..43fe51d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1290,7 +1290,7 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS) + endforeach() + + install(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/modules" COMPONENT devel DESTINATION ${package_config_destination}) +- ++ if(NOT ROCKSDB_BUILD_SHARED) + install( + TARGETS ${ROCKSDB_STATIC_LIB} + EXPORT SpeedbTargets +@@ -1298,7 +1298,7 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS) + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) +- ++ endif() + if(ROCKSDB_BUILD_SHARED) + install( + TARGETS ${ROCKSDB_SHARED_LIB} diff --git a/recipes/speedb/all/test_package/CMakeLists.txt b/recipes/speedb/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..4353233f81e9a1 --- /dev/null +++ b/recipes/speedb/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Speedb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Speedb::speedb) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/speedb/all/test_package/conanfile.py b/recipes/speedb/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/speedb/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/speedb/all/test_package/test_package.cpp b/recipes/speedb/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..2d49c4d14da216 --- /dev/null +++ b/recipes/speedb/all/test_package/test_package.cpp @@ -0,0 +1,93 @@ +// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. +// This source code is licensed under both the GPLv2 (found in the +// COPYING file in the root directory) and Apache 2.0 License +// (found in the LICENSE.Apache file in the root directory). + +#include +#include + +#include "rocksdb/db.h" +#include "rocksdb/options.h" +#include "rocksdb/slice.h" + +using ROCKSDB_NAMESPACE::DB; +using ROCKSDB_NAMESPACE::Options; +using ROCKSDB_NAMESPACE::PinnableSlice; +using ROCKSDB_NAMESPACE::ReadOptions; +using ROCKSDB_NAMESPACE::Status; +using ROCKSDB_NAMESPACE::WriteBatch; +using ROCKSDB_NAMESPACE::WriteOptions; + +#if defined(OS_WIN) +std::string kDBPath = "C:\\Windows\\TEMP\\rocksdb_simple_example"; +#else +std::string kDBPath = "/tmp/rocksdb_simple_example"; +#endif + +int main() { + DB* db; + Options options; + // Optimize RocksDB. This is the easiest way to get RocksDB to perform well + options.IncreaseParallelism(); + options.OptimizeLevelStyleCompaction(); + // create the DB if it's not already present + options.create_if_missing = true; + + // open DB + Status s = DB::Open(options, kDBPath, &db); + assert(s.ok()); + + // Put key-value + s = db->Put(WriteOptions(), "key1", "value"); + assert(s.ok()); + std::string value; + // get value + s = db->Get(ReadOptions(), "key1", &value); + assert(s.ok()); + assert(value == "value"); + + // atomically apply a set of updates + { + WriteBatch batch; + batch.Delete("key1"); + batch.Put("key2", value); + s = db->Write(WriteOptions(), &batch); + } + + s = db->Get(ReadOptions(), "key1", &value); + assert(s.IsNotFound()); + + db->Get(ReadOptions(), "key2", &value); + assert(value == "value"); + + { + PinnableSlice pinnable_val; + db->Get(ReadOptions(), db->DefaultColumnFamily(), "key2", &pinnable_val); + assert(pinnable_val == "value"); + } + + { + std::string string_val; + // If it cannot pin the value, it copies the value to its internal buffer. + // The intenral buffer could be set during construction. + PinnableSlice pinnable_val(&string_val); + db->Get(ReadOptions(), db->DefaultColumnFamily(), "key2", &pinnable_val); + assert(pinnable_val == "value"); + // If the value is not pinned, the internal buffer must have the value. + assert(pinnable_val.IsPinned() || string_val == "value"); + } + + PinnableSlice pinnable_val; + s = db->Get(ReadOptions(), db->DefaultColumnFamily(), "key1", &pinnable_val); + assert(s.IsNotFound()); + // Reset PinnableSlice after each use and before each reuse + pinnable_val.Reset(); + db->Get(ReadOptions(), db->DefaultColumnFamily(), "key2", &pinnable_val); + assert(pinnable_val == "value"); + pinnable_val.Reset(); + // The Slice pointed by pinnable_val is not valid after this point + + delete db; + + return 0; +} diff --git a/recipes/speedb/config.yml b/recipes/speedb/config.yml new file mode 100644 index 00000000000000..64a500c0f05d76 --- /dev/null +++ b/recipes/speedb/config.yml @@ -0,0 +1,3 @@ +versions: + "2.8.0": + folder: all diff --git a/recipes/sqlite3/all/conandata.yml b/recipes/sqlite3/all/conandata.yml index 1f5bb786d17676..7897a31f612113 100644 --- a/recipes/sqlite3/all/conandata.yml +++ b/recipes/sqlite3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.45.3": + url: "https://sqlite.org/2024/sqlite-amalgamation-3450300.zip" + sha256: "ea170e73e447703e8359308ca2e4366a3ae0c4304a8665896f068c736781c651" "3.45.2": url: "https://sqlite.org/2024/sqlite-amalgamation-3450200.zip" sha256: "65230414820d43a6d1445d1d98cfe57e8eb9f7ac0d6a96ad6932e0647cce51db" diff --git a/recipes/sqlite3/config.yml b/recipes/sqlite3/config.yml index 97c45a94fa4438..a320cb91df08ab 100644 --- a/recipes/sqlite3/config.yml +++ b/recipes/sqlite3/config.yml @@ -1,4 +1,6 @@ versions: + "3.45.3": + folder: all "3.45.2": folder: all "3.45.1": diff --git a/recipes/sqlite3mc/all/conandata.yml b/recipes/sqlite3mc/all/conandata.yml new file mode 100644 index 00000000000000..462228eb46b296 --- /dev/null +++ b/recipes/sqlite3mc/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.8.0": + url: "https://github.com/utelle/SQLite3MultipleCiphers/archive/refs/tags/v1.8.0.tar.gz" + sha256: "13D9B939BEF7C7371D58A3874F83B18CF330EB2171205B3680ACDDB2215BE0E5" diff --git a/recipes/sqlite3mc/all/conanfile.py b/recipes/sqlite3mc/all/conanfile.py new file mode 100644 index 00000000000000..eddb5a88de8903 --- /dev/null +++ b/recipes/sqlite3mc/all/conanfile.py @@ -0,0 +1,222 @@ +import os +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMakeDeps, CMakeToolchain, CMake +from conan.tools.files import get, copy + +required_conan_version = ">=1.53.0" + + +class sqlite3mc(ConanFile): + name = "sqlite3mc" + package_type = "library" + + license = "MIT" + homepage = "https://github.com/utelle/SQLite3MultipleCiphers" + url = "https://github.com/conan-io/conan-center-index" + description = "The project SQLite3 Multiple Ciphers implements an encryption extension for SQLite with support for multiple ciphers." + topics = ("sqlite", "sqlite3", "sqlite3-encryption", "database-encryption", "sqlite3-extension") + + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "require_zlib": [True, False], + "static_runtime_link": [True, False], + "build_shell": [True, False], + "with_icu": [True, False], + "enable_debug": [True, False], + "soundex": [True, False], + "enable_column_metadata": [True, False], + "secure_delete": [True, False], + "enable_fts3": [True, False], + "enable_fts3_paranthesis": [True, False], + "enable_fts4": [True, False], + "enable_fts5": [True, False], + "enable_carray": [True, False], + "enable_csv": [True, False], + "enable_extfunc": [True, False], + "enable_geopoly": [True, False], + "enable_rtree": [True, False], + "enable_uuid": [True, False], + "use_uri": [True, False], + "user_authentication": [True, False], + "enable_preupdate_hook": [True, False], + "enable_session": [True, False], + "shell_is_utf8": [True, False], + "enable_fileio": [True, False], + "enable_regexp": [True, False], + "enable_series": [True, False], + "enable_sha3": [True, False], + "enable_explain_comments": [True, False], + "enable_dbpage_vtab": [True, False], + "enable_dbstat_vtab": [True, False], + "enable_stmtvtab": [True, False], + "enable_unknown_sql_function": [True, False], + "use_miniz": [True, False], + "enable_compress": [True, False], + "enable_sqlar": [True, False], + "enable_zipfile": [True, False], + "use_sqleet_legacy": [True, False], + "use_sqlcipher_legacy": [True, False], + "secure_memory": [True, False], + "use_random_fill_memory": [True, False], + "omit_aes_hardware_support": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "require_zlib": False, + "static_runtime_link": False, + "build_shell": False, + "with_icu": False, + "enable_debug": False, + "soundex": True, + "enable_column_metadata": True, + "secure_delete": True, + "enable_fts3": True, + "enable_fts3_paranthesis": True, + "enable_fts4": True, + "enable_fts5": True, + "enable_carray": True, + "enable_csv": True, + "enable_extfunc": True, + "enable_geopoly": True, + "enable_rtree": True, + "enable_uuid": True, + "use_uri": True, + "user_authentication": True, + "enable_preupdate_hook": False, + "enable_session": False, + "shell_is_utf8": True, + "enable_fileio": True, + "enable_regexp": True, + "enable_series": True, + "enable_sha3": True, + "enable_explain_comments": True, + "enable_dbpage_vtab": True, + "enable_dbstat_vtab": True, + "enable_stmtvtab": True, + "enable_unknown_sql_function": True, + "use_miniz": False, + "enable_compress": False, + "enable_sqlar": False, + "enable_zipfile": False, + "use_sqleet_legacy": False, + "use_sqlcipher_legacy": False, + "secure_memory": False, + "use_random_fill_memory": False, + "omit_aes_hardware_support": False + } + + def build_requirements(self): + self.tool_requires("cmake/[>=3.24 <4]") + + 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 source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.require_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_icu: + self.requires("icu/74.1") + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + + tc = CMakeToolchain(self) + tc.variables["_SQLITE3MC_REQUIRE_ZLIB"] = self.options.require_zlib + tc.variables["SQLITE3MC_STATIC_RUNTIME_LINK"] = self.options.static_runtime_link + tc.variables["SQLITE3MC_STATIC"] = not self.options.shared + tc.variables["SQLITE3MC_BUILD_SHELL"] = self.options.build_shell + tc.variables["SQLITE3MC_WITH_ICU"] = self.options.with_icu + + tc.variables["SQLITE_ENABLE_DEBUG"] = self.options.enable_debug + tc.variables["SQLITE_SOUNDEX"] = self.options.soundex + tc.variables["SQLITE_ENABLE_COLUMN_METADATA"] = self.options.enable_column_metadata + tc.variables["SQLITE_SECURE_DELETE"] = self.options.secure_delete + tc.variables["SQLITE_ENABLE_FTS3"] = self.options.enable_fts3 + tc.variables["SQLITE_ENABLE_FTS3_PARENTHESIS"] = self.options.enable_fts3_paranthesis + tc.variables["SQLITE_ENABLE_FTS4"] = self.options.enable_fts4 + tc.variables["SQLITE_ENABLE_FTS5"] = self.options.enable_fts5 + + tc.variables["SQLITE_ENABLE_CARRAY"] = self.options.enable_carray + tc.variables["SQLITE_ENABLE_CSV"] = self.options.enable_csv + tc.variables["SQLITE_ENABLE_EXTFUNC"] = self.options.enable_extfunc + tc.variables["SQLITE_ENABLE_GEOPOLY"] = self.options.enable_geopoly + tc.variables["SQLITE_ENABLE_RTREE"] = self.options.enable_rtree + tc.variables["SQLITE_ENABLE_UUID"] = self.options.enable_uuid + tc.variables["SQLITE_USE_URI"] = self.options.use_uri + tc.variables["SQLITE_USER_AUTHENTICATION"] = self.options.user_authentication + tc.variables["SQLITE_ENABLE_PREUPDATE_HOOK"] = self.options.enable_preupdate_hook + tc.variables["SQLITE_ENABLE_SESSION"] = self.options.enable_session + tc.variables["SQLITE_SHELL_IS_UTF8"] = self.options.shell_is_utf8 + + # Options for library only + tc.variables["SQLITE_ENABLE_FILEIO"] = self.options.enable_fileio + tc.variables["SQLITE_ENABLE_REGEXP"] = self.options.enable_regexp + tc.variables["SQLITE_ENABLE_SERIES"] = self.options.enable_series + tc.variables["SQLITE_ENABLE_SHA3"] = self.options.enable_sha3 + + # Options for shell only (compatibility with official SQLite shell) + tc.variables["SQLITE_ENABLE_EXPLAIN_COMMENTS"] = self.options.enable_explain_comments + tc.variables["SQLITE_ENABLE_DBPAGE_VTAB"] = self.options.enable_dbpage_vtab + tc.variables["SQLITE_ENABLE_DBSTAT_VTAB"] = self.options.enable_dbstat_vtab + tc.variables["SQLITE_ENABLE_STMTVTAB"] = self.options.enable_stmtvtab + tc.variables["SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION"] = self.options.enable_unknown_sql_function + + # Embedded Compression + tc.variables["SQLITE3MC_USE_MINIZ"] = self.options.use_miniz + + # Compression/Options that require ZLIB + tc.variables["SQLITE_ENABLE_COMPRESS"] = self.options.enable_compress + tc.variables["SQLITE_ENABLE_SQLAR"] = self.options.enable_sqlar + tc.variables["SQLITE_ENABLE_ZIPFILE"] = self.options.enable_zipfile + + # Legacy Encryption Extensions + tc.variables["SQLITE3MC_USE_SQLEET_LEGACY"] = self.options.use_sqleet_legacy + tc.variables["SQLITE3MC_USE_SQLCIPHER_LEGACY"] = self.options.use_sqlcipher_legacy + + # Additional memory security (filling freed memory allocations with zeros or random data) + tc.variables["SQLITE3MC_SECURE_MEMORY"] = self.options.secure_memory + tc.variables["SQLITE3MC_USE_RANDOM_FILL_MEMORY"] = self.options.use_random_fill_memory + + # Omit AES hardware support + tc.variables["SQLITE3MC_OMIT_AES_HARDWARE_SUPPORT"] = self.options.omit_aes_hardware_support + + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), keep_path=False) + + def package_info(self): + if self.options.shared: + self.cpp_info.libs = ["sqlite3mc"] + else: + self.cpp_info.libs = ["sqlite3mc_static"] + if self.settings.os in ("Linux", "FreeBSD", "Macos"): + self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.append("dl") + self.cpp_info.system_libs.append("m") + if self.settings.os == "Macos": + self.cpp_info.frameworks.append("Security") diff --git a/recipes/sqlite3mc/all/test_package/CMakeLists.txt b/recipes/sqlite3mc/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..79301e1094eb17 --- /dev/null +++ b/recipes/sqlite3mc/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_sqlite3mc C) + +find_package(sqlite3mc REQUIRED) + +add_executable(${PROJECT_NAME} + main.c +) + +target_link_libraries(${PROJECT_NAME} + sqlite3mc::sqlite3mc +) diff --git a/recipes/sqlite3mc/all/test_package/conanfile.py b/recipes/sqlite3mc/all/test_package/conanfile.py new file mode 100644 index 00000000000000..1b70bb597a5daf --- /dev/null +++ b/recipes/sqlite3mc/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class sqlite3mcTest(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def test(self): + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_sqlite3mc") + self.run(cmd, env="conanrun") diff --git a/recipes/sqlite3mc/all/test_package/main.c b/recipes/sqlite3mc/all/test_package/main.c new file mode 100644 index 00000000000000..efb9f3b4c701db --- /dev/null +++ b/recipes/sqlite3mc/all/test_package/main.c @@ -0,0 +1,73 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + sqlite3 *db; + const char *key = "password"; + const char *wrongKey = "wrongPassword"; + + // Create database + int rc = sqlite3_open("test.db", &db); + if (rc != SQLITE_OK) + { + fprintf(stderr, "Failed to open database: %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return 1; + } + + // Encrypt + sqlite3_key(db, key, strlen(key)); + + // Fill db with some data and close it + rc = sqlite3_exec(db, "CREATE TABLE users (name TEXT NOT NULL, ID INTEGER PRIMARY KEY UNIQUE)", NULL, NULL, NULL); + if (rc != SQLITE_OK) + { + fprintf(stderr, "SQL error: %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return 1; + } + rc = sqlite3_exec(db, "INSERT INTO users (name, ID) VALUES ('testUser', '12345')", NULL, NULL, NULL); + if (rc != SQLITE_OK) + { + fprintf(stderr, "SQL error: %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return 1; + } + rc = sqlite3_close(db); + if (rc != SQLITE_OK) + { + fprintf(stderr, "Failed to close database: %s\n", sqlite3_errmsg(db)); + return 1; + } + + // Reopen and provide wrong key + rc = sqlite3_open("test.db", &db); + if (rc != SQLITE_OK) + { + fprintf(stderr, "Failed to open database: %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return 1; + } + sqlite3_key(db, wrongKey, strlen(wrongKey)); + + // Try to access the database, should fail + rc = sqlite3_exec(db, "SELECT name FROM users WHERE ID = '12345'", NULL, NULL, NULL); + if (rc == SQLITE_OK) + { + fprintf(stderr, "Access was provided without the proper key\n"); + sqlite3_close(db); + return 1; + } + rc = sqlite3_close(db); + if (rc != SQLITE_OK) + { + fprintf(stderr, "Failed to close database: %s\n", sqlite3_errmsg(db)); + return 1; + } + + + fprintf(stdout, "Test successful\n"); + return 0; +} diff --git a/recipes/sqlite3mc/config.yml b/recipes/sqlite3mc/config.yml new file mode 100644 index 00000000000000..4d72270a880489 --- /dev/null +++ b/recipes/sqlite3mc/config.yml @@ -0,0 +1,3 @@ +versions: + "1.8.0": + folder: all diff --git a/recipes/streaming-percentiles/all/conandata.yml b/recipes/streaming-percentiles/all/conandata.yml new file mode 100644 index 00000000000000..475aaed46b221c --- /dev/null +++ b/recipes/streaming-percentiles/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "3.1.0": + url: "https://github.com/sengelha/streaming-percentiles/archive/refs/tags/v3.1.0.tar.gz" + sha256: "196d76a7d7ce1bcdb6f720b1c2d8feb1cda62ac18cc6412f8bd907e4eafbab6c" +patches: + "3.1.0": + - patch_file: "patches/3.1.0-0001-add-includes.patch" + patch_description: "include missing headers (already applied to upstream)" + patch_type: "backport" + patch_source: "https://github.com/sengelha/streaming-percentiles/commit/058037eca3e05fafa1b53071137f3c168a9fdd92" diff --git a/recipes/streaming-percentiles/all/conanfile.py b/recipes/streaming-percentiles/all/conanfile.py new file mode 100644 index 00000000000000..6b5b0813aa365e --- /dev/null +++ b/recipes/streaming-percentiles/all/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd +import os + +required_conan_version = ">=1.52.0" + +class StreamingPercentilesConan(ConanFile): + name = "streaming-percentiles" + description = "Cross-platform, multi-language implementation of multiple streaming percentile algorithms" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sengelha/streaming-percentiles" + topics = ("streaming", "percentiles", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + 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 validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.hpp", + os.path.join(self.source_folder, "cpp", "src"), + self.package_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/streaming-percentiles/all/patches/3.1.0-0001-add-includes.patch b/recipes/streaming-percentiles/all/patches/3.1.0-0001-add-includes.patch new file mode 100644 index 00000000000000..8c015b7b047b40 --- /dev/null +++ b/recipes/streaming-percentiles/all/patches/3.1.0-0001-add-includes.patch @@ -0,0 +1,62 @@ +diff --git a/cpp/src/include/stmpct/ckms_hbq.hpp b/cpp/src/include/stmpct/ckms_hbq.hpp +index 87cf860..850d527 100644 +--- a/cpp/src/include/stmpct/ckms_hbq.hpp ++++ b/cpp/src/include/stmpct/ckms_hbq.hpp +@@ -4,6 +4,7 @@ + // quantiles as defined in the paper _Effective Computation of Biased + // Quantiles over Data Streams_ + ++#include + #include "ckms_impl.hpp" + + namespace stmpct { +diff --git a/cpp/src/include/stmpct/ckms_lbq.hpp b/cpp/src/include/stmpct/ckms_lbq.hpp +index fb932af..c62d61d 100644 +--- a/cpp/src/include/stmpct/ckms_lbq.hpp ++++ b/cpp/src/include/stmpct/ckms_lbq.hpp +@@ -4,6 +4,7 @@ + // quantiles as defined in the paper _Effective Computation of Biased + // Quantiles over Data Streams_ + ++#include + #include "ckms_impl.hpp" + + namespace stmpct { +diff --git a/cpp/src/include/stmpct/ckms_tq.hpp b/cpp/src/include/stmpct/ckms_tq.hpp +index ac9dde8..5d1f093 100644 +--- a/cpp/src/include/stmpct/ckms_tq.hpp ++++ b/cpp/src/include/stmpct/ckms_tq.hpp +@@ -4,6 +4,8 @@ + // quantiles as defined in the paper _Effective Computation of Biased + // Quantiles over Data Streams_ + ++#include ++#include + #include "ckms_impl.hpp" + #include "targeted_quantile.hpp" + +diff --git a/cpp/src/include/stmpct/ckms_uq.hpp b/cpp/src/include/stmpct/ckms_uq.hpp +index d0d3837..c417ddc 100644 +--- a/cpp/src/include/stmpct/ckms_uq.hpp ++++ b/cpp/src/include/stmpct/ckms_uq.hpp +@@ -5,6 +5,7 @@ + // Quantiles over Data Streams_. Conceptually nearly equivalent to + // the GK algorithm. + ++#include + #include "ckms_impl.hpp" + + namespace stmpct { +diff --git a/cpp/src/include/stmpct/gk.hpp b/cpp/src/include/stmpct/gk.hpp +index 6b7a1c6..bf4e163 100644 +--- a/cpp/src/include/stmpct/gk.hpp ++++ b/cpp/src/include/stmpct/gk.hpp +@@ -1,6 +1,8 @@ + #pragma once + ++#include + #include ++#include + + // The Greenwald-Khanna algorithm as defined in the paper + // Space-Efficient Online Computation of Quantile Summaries diff --git a/recipes/streaming-percentiles/all/test_package/CMakeLists.txt b/recipes/streaming-percentiles/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..0259c93280ffb2 --- /dev/null +++ b/recipes/streaming-percentiles/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(streaming-percentiles REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE streaming-percentiles::streaming-percentiles) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/streaming-percentiles/all/test_package/conanfile.py b/recipes/streaming-percentiles/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/streaming-percentiles/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/streaming-percentiles/all/test_package/test_package.cpp b/recipes/streaming-percentiles/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..6bead07a3dd0f7 --- /dev/null +++ b/recipes/streaming-percentiles/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include + +#include "stmpct/gk.hpp" +int main(int argc, char* argv[]) { + double epsilon = 0.1; + stmpct::gk g(epsilon); + for (int i = 0; i < 1000; ++i) + g.insert(rand()); + double p50 = g.quantile(0.5); // Approx. median + double p95 = g.quantile(0.95); // Approx. 95th percentile + + std::cout << "median : " << p50 << " 95th percentile : " << p95 << std::endl; + + return 0; +} diff --git a/recipes/streaming-percentiles/config.yml b/recipes/streaming-percentiles/config.yml new file mode 100644 index 00000000000000..baa80af0c4b7de --- /dev/null +++ b/recipes/streaming-percentiles/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1.0": + folder: all diff --git a/recipes/toon/all/conandata.yml b/recipes/toon/all/conandata.yml new file mode 100644 index 00000000000000..2e5eef4c5773f8 --- /dev/null +++ b/recipes/toon/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "3.2": + url: "https://github.com/edrosten/TooN/archive/refs/tags/TOON_3.2.tar.gz" + sha256: "62f30dfb92a6f8873e6a42649760e2d1b54e61e1d3bc023d0bb171600b41c759" +patches: + "3.2": + - patch_file: "patches/001-bugfixes-backport.patch" + patch_description: "apply unreleased minor fixes" + patch_type: "backport" + patch_source: "https://github.com/edrosten/TooN/compare/TOON_3.2...370dcd9" diff --git a/recipes/toon/all/conanfile.py b/recipes/toon/all/conanfile.py new file mode 100644 index 00000000000000..49e7347dc80b41 --- /dev/null +++ b/recipes/toon/all/conanfile.py @@ -0,0 +1,83 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class ToonConan(ConanFile): + name = "toon" + description = "TooN - Tom's Object Oriented Numerics library" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://codedocs.xyz/edrosten/TooN/" + topics = ("numerical", "linear-algebra", "matrix", "vector", "optimization", "automatic-differentiation", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + exports_sources = ["config.hh"] + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "msvc": "191", + "Visual Studio": "15", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("openblas/0.3.26", options={"build_lapack": True}) + + def package_id(self): + self.info.clear() + + 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." + ) + + if not self.dependencies["openblas"].options.build_lapack: + raise ConanInvalidConfiguration("TooN requires LAPACK support in OpenBLAS") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*", + os.path.join(self.source_folder, "TooN"), + os.path.join(self.package_folder, "include", "TooN")) + copy(self, "config.hh", self.export_sources_folder, + os.path.join(self.package_folder, "include", "TooN", "internal")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "TooN") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/toon/all/config.hh b/recipes/toon/all/config.hh new file mode 100644 index 00000000000000..ed689361e6c580 --- /dev/null +++ b/recipes/toon/all/config.hh @@ -0,0 +1,29 @@ +/* TooN/internal/config.hh. Generated from config.hh.in by configure. */ +/* TooN/internal/config.hh.in. Generated from configure.ac by autoheader. */ + +/* define if the compiler supports basic C++14 syntax */ +#undef HAVE_CXX14 + +/* Define to 1 if you have the `lapack' library (-llapack). */ +#define HAVE_LIBLAPACK 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://github.com/edrosten/TooN" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "TooN" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "TooN version-3.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "toon" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "https://codedocs.xyz/edrosten/TooN/" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "version-3.2" + +/* Use LAPACK */ +#define TOON_USE_LAPACK diff --git a/recipes/toon/all/patches/001-bugfixes-backport.patch b/recipes/toon/all/patches/001-bugfixes-backport.patch new file mode 100644 index 00000000000000..634a27c8578c00 --- /dev/null +++ b/recipes/toon/all/patches/001-bugfixes-backport.patch @@ -0,0 +1,127 @@ +diff --git a/TooN/QR.h b/TooN/QR.h +index e2273cc..10b33c3 100644 +--- a/TooN/QR.h ++++ b/TooN/QR.h +@@ -29,6 +29,7 @@ + #ifndef TOON_INC_QR_H + #define TOON_INC_QR_H + #include ++#include + #include + + namespace TooN +diff --git a/TooN/QR_Lapack.h b/TooN/QR_Lapack.h +index 6b628d1..67f1fd0 100644 +--- a/TooN/QR_Lapack.h ++++ b/TooN/QR_Lapack.h +@@ -29,6 +29,7 @@ + + #include + #include ++#include + #include + + namespace TooN{ +diff --git a/TooN/SVD.h b/TooN/SVD.h +index a74deed..e22a437 100644 +--- a/TooN/SVD.h ++++ b/TooN/SVD.h +@@ -30,6 +30,7 @@ + + #include + #include ++#include + + namespace TooN { + +diff --git a/TooN/SymEigen.h b/TooN/SymEigen.h +index aa5b434..8c6d42f 100644 +--- a/TooN/SymEigen.h ++++ b/TooN/SymEigen.h +@@ -28,6 +28,7 @@ + #ifndef __SYMEIGEN_H + #define __SYMEIGEN_H + ++#include + #include + #include + #include +diff --git a/TooN/functions/derivatives.h b/TooN/functions/derivatives.h +index 791f71e..9749461 100644 +--- a/TooN/functions/derivatives.h ++++ b/TooN/functions/derivatives.h +@@ -27,6 +27,7 @@ + #define TOON_INCLUDE_DERIVATIVES_NUMERICAL_H + + #include ++#include + #include + #include + +diff --git a/TooN/helpers.h b/TooN/helpers.h +index 8204560..447bca3 100644 +--- a/TooN/helpers.h ++++ b/TooN/helpers.h +@@ -32,6 +32,7 @@ + + #include + #include ++#include + #include + #include + #include +diff --git a/TooN/optimization/brent.h b/TooN/optimization/brent.h +index e117a80..3e60251 100644 +--- a/TooN/optimization/brent.h ++++ b/TooN/optimization/brent.h +@@ -27,6 +27,7 @@ + #define TOON_BRENT_H + #include + #include ++#include + #include + #include + #include +diff --git a/doc/documentation.h b/doc/documentation.h +index 2df5d9e..95276b1 100644 +--- a/doc/documentation.h ++++ b/doc/documentation.h +@@ -1,15 +1,7 @@ + /* + Copyright (c) 2005 Paul Smith, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Edward Rosten + +- Permission is granted to copy, distribute and/or modify this document under +- the terms of the GNU Free Documentation License, Version 1.2 or any later +- version published by the Free Software Foundation; with no Invariant +- Sections, no Front-Cover Texts, and no Back-Cover Texts. +- +- You should have received a copy of the GNU Free Documentation License +- License along with this library; if not, write to the Free Software +- Foundation, Inc. +- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ This library is free software, see COPYING file for details + + */ + /////////////////////////////////////////////////////// +diff --git a/doc/linoperatorsdoc.h b/doc/linoperatorsdoc.h +index b7aa503..f2ec6b1 100644 +--- a/doc/linoperatorsdoc.h ++++ b/doc/linoperatorsdoc.h +@@ -1,16 +1,7 @@ + /* + Copyright (c) 2005 Paul Smith + +- Permission is granted to copy, distribute and/or modify this document under +- the terms of the GNU Free Documentation License, Version 1.2 or any later +- version published by the Free Software Foundation; with no Invariant +- Sections, no Front-Cover Texts, and no Back-Cover Texts. +- +- You should have received a copy of the GNU Free Documentation License +- License along with this library; if not, write to the Free Software +- Foundation, Inc. +- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +- ++ This library is free software, see COPYING file for details + */ + // A proxy version of the Matrix class, + // cleaned up to present a comprehensible diff --git a/recipes/toon/all/test_package/CMakeLists.txt b/recipes/toon/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..d0e7f8aeeb811b --- /dev/null +++ b/recipes/toon/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(TooN REQUIRED IMPORTED_TARGET TooN) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::TooN) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/toon/all/test_package/conanfile.py b/recipes/toon/all/test_package/conanfile.py new file mode 100644 index 00000000000000..0ded7848c2ace0 --- /dev/null +++ b/recipes/toon/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +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 = "PkgConfigDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + 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/recipes/toon/all/test_package/test_package.cpp b/recipes/toon/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..ac702cc9b641db --- /dev/null +++ b/recipes/toon/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include +#include + +using namespace TooN; + +int main() { + Matrix<3> t = Data( + 1, 0.5, 0.5, + 0.5, 2, 0.7, + 0.5, 0.7, 3); + Lapack_Cholesky<3> chol(t); + std::cout << chol.determinant() << std::endl; +} diff --git a/recipes/toon/config.yml b/recipes/toon/config.yml new file mode 100644 index 00000000000000..9b5abcde381a57 --- /dev/null +++ b/recipes/toon/config.yml @@ -0,0 +1,3 @@ +versions: + "3.2": + folder: all diff --git a/recipes/tree-gen/all/conandata.yml b/recipes/tree-gen/all/conandata.yml index 21ee5b5699adcf..71aa893da1723a 100644 --- a/recipes/tree-gen/all/conandata.yml +++ b/recipes/tree-gen/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.7": + url: "https://github.com/QuTech-Delft/tree-gen/archive/refs/tags/1.0.7.tar.gz" + sha256: "bd27c88d789efe1d187846d3b819fbaa1ba3a520d6d4181d1216c4a2e73e4e85" "1.0.6": url: "https://github.com/QuTech-Delft/tree-gen/archive/refs/tags/1.0.6.tar.gz" sha256: "a7f6617830b3817b21cddc0f4442a04c10fbb89a19cabb1bbd0e8facb040cba8" diff --git a/recipes/tree-gen/config.yml b/recipes/tree-gen/config.yml index c8c4465c974158..4028d61266d409 100644 --- a/recipes/tree-gen/config.yml +++ b/recipes/tree-gen/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.7": + folder: all "1.0.6": folder: all diff --git a/recipes/tsl-robin-map/all/conandata.yml b/recipes/tsl-robin-map/all/conandata.yml index 89211be8fec7bf..0898c1e12fe8be 100644 --- a/recipes/tsl-robin-map/all/conandata.yml +++ b/recipes/tsl-robin-map/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.2": + url: "https://github.com/Tessil/robin-map/archive/v1.2.2.tar.gz" + sha256: "c72767ecea2a90074c7efbe91620c8f955af666505e22782e82813c652710821" "1.2.1": url: "https://github.com/Tessil/robin-map/archive/v1.2.1.tar.gz" sha256: "2b54d2c1de2f73bea5c51d5dcbd64813a08caf1bfddcfdeee40ab74e9599e8e3" diff --git a/recipes/tsl-robin-map/config.yml b/recipes/tsl-robin-map/config.yml index 7a3b316dace84a..cd852f361a5d27 100644 --- a/recipes/tsl-robin-map/config.yml +++ b/recipes/tsl-robin-map/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.2": + folder: all "1.2.1": folder: all "1.0.1": diff --git a/recipes/vincentlaucsb-csv-parser/all/conandata.yml b/recipes/vincentlaucsb-csv-parser/all/conandata.yml index b2ca51139b4f8e..1e001077318d9c 100644 --- a/recipes/vincentlaucsb-csv-parser/all/conandata.yml +++ b/recipes/vincentlaucsb-csv-parser/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.0": + url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.2.0.tar.gz" + sha256: "027fd894c5e6a59f5afcedd6cc071364611df5f35fcc6fc4a8e193712b2f1e73" "2.1.3": url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.1.3.tar.gz" - sha256: 3f6ce9212e66d273de12a9671dcbf7be7da0241334dc690585dd434dce5e5acf + sha256: "3f6ce9212e66d273de12a9671dcbf7be7da0241334dc690585dd434dce5e5acf" diff --git a/recipes/vincentlaucsb-csv-parser/config.yml b/recipes/vincentlaucsb-csv-parser/config.yml index e6ceade928280b..46709ccf896d9d 100644 --- a/recipes/vincentlaucsb-csv-parser/config.yml +++ b/recipes/vincentlaucsb-csv-parser/config.yml @@ -1,3 +1,5 @@ versions: + "2.2.0": + folder: all "2.1.3": folder: all diff --git a/recipes/wasmer/all/conandata.yml b/recipes/wasmer/all/conandata.yml index 17a89f2c17e7bb..88b147bfcf235f 100644 --- a/recipes/wasmer/all/conandata.yml +++ b/recipes/wasmer/all/conandata.yml @@ -1,4 +1,31 @@ sources: + "4.2.7": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-windows-amd64.tar.gz" + sha256: "5e429450a997e9a23b4efb7ad1bfb57a8c4a77436ce2a0c7c160c26576a42562" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-windows-gnu64.tar.gz" + sha256: "82061836fe79e2d52710ebb48fdffbd82910663ac1bae5bb13e72e6e1a7f0a46" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-linux-amd64.tar.gz" + sha256: "7fb9c34c42d31cd7ffed956d0e98d620b5fde0c5fccf9af5e58b9177664e25b1" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-linux-aarch64.tar.gz" + sha256: "5915f617f966cdedd0fe18f26237ef04701c6475c34e5b1cd2ffc0f6e84ffd3a" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-darwin-amd64.tar.gz" + sha256: "29748cdf51ecd11d10cc819bc568820e6267d658d495f08f4af7b90cf3bd0a35" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-darwin-arm64.tar.gz" + sha256: "65de621cd931acee76e09505bda28d71b6d955a6b33481ae1251280f0f26ebfc" "4.2.5": Windows: "x86_64": diff --git a/recipes/wasmer/config.yml b/recipes/wasmer/config.yml index 4c7ede684889d9..7d131c7cb3eead 100644 --- a/recipes/wasmer/config.yml +++ b/recipes/wasmer/config.yml @@ -1,4 +1,6 @@ versions: + "4.2.7": + folder: "all" "4.2.5": folder: "all" "4.2.0": diff --git a/recipes/wasmtime-cpp/all/conandata.yml b/recipes/wasmtime-cpp/all/conandata.yml index 524a7021c9bc2b..35283cdf993b9f 100644 --- a/recipes/wasmtime-cpp/all/conandata.yml +++ b/recipes/wasmtime-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "18.0.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/v18.0.0.tar.gz" + sha256: "94478a9465c6f766ebd7999438a89392dcb30f9fe10f772c8669dcd0b7ffbf86" "9.0.0": url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/v9.0.0.tar.gz" sha256: "0ff8242a9dcbe43eb38c6a3e02be40ed585e6b88efd89092bf1b5318cb8fece1" diff --git a/recipes/wasmtime-cpp/all/conanfile.py b/recipes/wasmtime-cpp/all/conanfile.py index 9970e18861d775..9e61f74387ac9b 100644 --- a/recipes/wasmtime-cpp/all/conanfile.py +++ b/recipes/wasmtime-cpp/all/conanfile.py @@ -44,6 +44,7 @@ def requirements(self): "1.0.0": "1.0.1", "6.0.0": "6.0.1", "9.0.0": "12.0.2", + "18.0.0": "18.0.3", } self.requires(f"wasmtime/{version_map.get(version, version)}") diff --git a/recipes/wasmtime-cpp/config.yml b/recipes/wasmtime-cpp/config.yml index 37168a28be705e..49006a3577c705 100644 --- a/recipes/wasmtime-cpp/config.yml +++ b/recipes/wasmtime-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "18.0.0": + folder: all "9.0.0": folder: all "7.0.0": diff --git a/recipes/wasmtime/all/conandata.yml b/recipes/wasmtime/all/conandata.yml index 033b48ec7ab2e5..b2728f2a0c8c04 100644 --- a/recipes/wasmtime/all/conandata.yml +++ b/recipes/wasmtime/all/conandata.yml @@ -1,4 +1,34 @@ sources: + "19.0.2": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-windows-c-api.zip" + sha256: "9814038a400680a322f8c287ccba68fc0c5ffccede31f9ed444e945bdeec5c70" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-mingw-c-api.zip" + sha256: "0a1c37ec9eebc2322632c8275386f99cdb08c58020ad01409aecde874b8ad364" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-linux-c-api.tar.xz" + sha256: "734f82bc0fcf9e3214db37f4275536ee3b59be8935ec3ffac379b312423ee3ae" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-aarch64-linux-c-api.tar.xz" + sha256: "6952c3ffcbb0d04c1c7f07c17e945d0fe2b756965d17717fde2c51dcce7465ab" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-s390x-linux-c-api.tar.xz" + sha256: "536a9a676ffaa143c77fa4e9712e19f6035e93e0d58865d243ad5e15302ef9e8" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-macos-c-api.tar.xz" + sha256: "42948b3dc8ba7061101d83c55d1fb2ed2f537061291739e0582aa8375d6baf76" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-aarch64-macos-c-api.tar.xz" + sha256: "d5b1121219d3503dac0f8cfc04a0557eea2330107867d0b32b91bd9fe0b62322" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-aarch64-linux-c-api.tar.xz" + sha256: "6952c3ffcbb0d04c1c7f07c17e945d0fe2b756965d17717fde2c51dcce7465ab" "18.0.3": Windows: "x86_64": diff --git a/recipes/wasmtime/config.yml b/recipes/wasmtime/config.yml index e2a5b299e7fea5..689b3a8f05ac86 100644 --- a/recipes/wasmtime/config.yml +++ b/recipes/wasmtime/config.yml @@ -1,4 +1,6 @@ versions: + "19.0.2": + folder: all "18.0.3": folder: all "16.0.0": diff --git a/recipes/wayland-protocols/all/conanfile.py b/recipes/wayland-protocols/all/conanfile.py index ad20a22df526ec..9302d46b476a0c 100644 --- a/recipes/wayland-protocols/all/conanfile.py +++ b/recipes/wayland-protocols/all/conanfile.py @@ -1,4 +1,4 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.tools.env import VirtualBuildEnv from conan.tools.files import copy, get, replace_in_file, rmdir from conan.tools.layout import basic_layout @@ -7,7 +7,7 @@ from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class WaylandProtocolsConan(ConanFile): @@ -38,7 +38,8 @@ def source(self): def generate(self): tc = MesonToolchain(self) - tc.project_options["datadir"] = os.path.join(self.package_folder, "res") + # Using relative folder because of this https://github.com/conan-io/conan/pull/15706 + tc.project_options["datadir"] = "res" tc.project_options["tests"] = "false" tc.generate() virtual_build_env = VirtualBuildEnv(self) @@ -68,10 +69,10 @@ def package_info(self): 'datarootdir': '${prefix}/res', 'pkgdatadir': '${datarootdir}/wayland-protocols', } - self.cpp_info.set_property( - "pkg_config_custom_content", - "\n".join(f"{key}={value}" for key,value in pkgconfig_variables.items())) - + # TODO: Remove when Conan 1.x not supported + pkgconfig_variables = pkgconfig_variables if conan_version.major >= 2 \ + else "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items()) + self.cpp_info.set_property("pkg_config_custom_content", pkgconfig_variables) self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] self.cpp_info.bindirs = [] diff --git a/recipes/wayland/all/conanfile.py b/recipes/wayland/all/conanfile.py index 865c98752b9de2..a946c8f8c05b2e 100644 --- a/recipes/wayland/all/conanfile.py +++ b/recipes/wayland/all/conanfile.py @@ -50,15 +50,15 @@ def requirements(self): if self.options.enable_libraries: self.requires("libffi/3.4.4") if self.options.enable_dtd_validation: - self.requires("libxml2/2.12.3") - self.requires("expat/2.6.0") + self.requires("libxml2/[>=2.12.5 <3]") + self.requires("expat/[>=2.6.2 <3]") def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") def build_requirements(self): - self.tool_requires("meson/1.3.1") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.1.0") if not can_run(self): diff --git a/recipes/wildcards/all/conandata.yml b/recipes/wildcards/all/conandata.yml new file mode 100644 index 00000000000000..466e54e9a7c614 --- /dev/null +++ b/recipes/wildcards/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.4.0": + url: "https://github.com/zemasoft/wildcards/archive/refs/tags/v1.4.0.tar.gz" + sha256: "da8846215df2c1493e9796392d9e17ca2da8cfeae0f718fe1d6e0544cbcfaa0f" diff --git a/recipes/wildcards/all/conanfile.py b/recipes/wildcards/all/conanfile.py new file mode 100644 index 00000000000000..ea532ea715b2a6 --- /dev/null +++ b/recipes/wildcards/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.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "wildcards" + description = "A simple C++ header-only template library implementing matching using wildcards" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zemasoft/wildcards" + topics = ("template", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + 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["WILDCARDS_BUILD_TESTS"] = False + tc.variables["WILDCARDS_BUILD_EXAMPLES"] = False + tc.generate() + + def build(self): + # INFO: Wildcards uses CMake to generate wildcards.hpp + cmake = CMake(self) + cmake.configure() + + def package(self): + copy(self, "LICENSE_1_0.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include", "wildcards")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "wildcards")) diff --git a/recipes/wildcards/all/test_package/CMakeLists.txt b/recipes/wildcards/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..5d849260e8ce83 --- /dev/null +++ b/recipes/wildcards/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(wildcards REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE wildcards::wildcards) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/wildcards/all/test_package/conanfile.py b/recipes/wildcards/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/wildcards/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wildcards/all/test_package/test_package.cpp b/recipes/wildcards/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..076aaeb8e51e26 --- /dev/null +++ b/recipes/wildcards/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include "wildcards.hpp" + + +int main(void) { + wildcards::match("Hello, World!", "H*World?"); + + return EXIT_SUCCESS; +} diff --git a/recipes/wildcards/config.yml b/recipes/wildcards/config.yml new file mode 100644 index 00000000000000..c957e4bc2d3c7f --- /dev/null +++ b/recipes/wildcards/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.0": + folder: all diff --git a/recipes/wiringpi/all/CMakeLists.txt b/recipes/wiringpi/all/CMakeLists.txt index fdd0b1aff610c1..6d527ad7fbe953 100644 --- a/recipes/wiringpi/all/CMakeLists.txt +++ b/recipes/wiringpi/all/CMakeLists.txt @@ -20,6 +20,10 @@ if(WIRINGPI_WITH_DEV_LIB) ${WIRINGPI_SRC_DIR}/wiringPi) endif() +if(WIRINGPI_LINUX_HEADERS_DIR) + target_include_directories(${PROJECT_NAME} PUBLIC ${WIRINGPI_LINUX_HEADERS_DIR}) +endif() + install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib diff --git a/recipes/wiringpi/all/conandata.yml b/recipes/wiringpi/all/conandata.yml index 676b9c65bf9fe7..307e8283601a92 100644 --- a/recipes/wiringpi/all/conandata.yml +++ b/recipes/wiringpi/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2": + url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/3.2.tar.gz" + sha256: "45aeaf52d86631edb7a5c82a4f6d0050ef10c8b4de6c566cd8017fc52a17b68e" "2.61-1": url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/2.61-1.tar.gz" sha256: "b5dc6c6c2ba1349acf602fafd7b58aa81e3fc3216a33b983386264cca0033e12" diff --git a/recipes/wiringpi/all/conanfile.py b/recipes/wiringpi/all/conanfile.py index b1ff871a8a06d7..ec52053dc1d9c9 100644 --- a/recipes/wiringpi/all/conanfile.py +++ b/recipes/wiringpi/all/conanfile.py @@ -3,26 +3,32 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import get, copy +from conan.tools.scm import Version required_conan_version = ">=1.53.0" class WiringpiConan(ConanFile): name = "wiringpi" - license = "LGPL-3.0" description = "GPIO Interface library for the Raspberry Pi" + license = "LGPL-3.0" + url = "https://github.com/conan-io/conan-center-index" homepage = "http://wiringpi.com" topics = ("wiringpi", "gpio", "raspberrypi") - url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], - "fPIC": [True, False], - "wpi_extensions": [True, False], - "with_devlib": [True, False]} - default_options = {"shared": False, - "fPIC": True, - "wpi_extensions": False, - "with_devlib": True} - + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "wpi_extensions": [True, False], + "with_devlib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "wpi_extensions": False, + "with_devlib": True, + } + def export_sources(self): copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) @@ -32,21 +38,36 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) >= "3.2": + self.requires("linux-headers-generic/6.5.9", transitive_headers=True) + def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration(f"{self.ref} only works for Linux") - - def layout(self): - cmake_layout(self, src_folder="src") + if Version(self.version) >= 3.0: + if self.settings.compiler == "gcc" and \ + Version(self.settings.compiler.version) < 8: + raise ConanInvalidConfiguration(f"{self.ref} requires gcc >= 8") + # wiringPi.c:1755:9: error: case label does not reduce to an integer constant + if self.settings.compiler == "gcc" and \ + Version(self.settings.compiler.version).major == 11 and \ + self.settings.build_type == "Debug": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc 11 in Debug build") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - + def generate(self): tc = CMakeToolchain(self) tc.variables["WIRINGPI_SRC_DIR"] = self.source_folder.replace("\\", "/") tc.variables["WIRINGPI_WITH_WPI_EXTENSIONS"] = self.options.wpi_extensions tc.variables["WIRINGPI_WITH_DEV_LIB"] = self.options.with_devlib + if Version(self.version) >= "3.2": + tc.variables["WIRINGPI_LINUX_HEADERS_DIR"] = self.dependencies["linux-headers-generic"].cpp_info.includedirs[0] tc.generate() def build(self): diff --git a/recipes/wiringpi/config.yml b/recipes/wiringpi/config.yml index b0d56a22c2e0d4..09456181564b63 100644 --- a/recipes/wiringpi/config.yml +++ b/recipes/wiringpi/config.yml @@ -1,4 +1,6 @@ versions: + "3.2": + folder: "all" "2.61-1": folder: "all" "cci.20210727": diff --git a/recipes/wolfssl/all/conandata.yml b/recipes/wolfssl/all/conandata.yml index 0a393b28e8b4af..df40064b3c0f95 100644 --- a/recipes/wolfssl/all/conandata.yml +++ b/recipes/wolfssl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.7.0": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.7.0-stable.tar.gz" + sha256: "2de93e8af588ee856fe67a6d7fce23fc1b226b74d710b0e3946bc8061f6aa18f" "5.6.6": url: "https://github.com/wolfSSL/wolfssl/archive/v5.6.6-stable.tar.gz" sha256: "3d2ca672d41c2c2fa667885a80d6fa03c3e91f0f4f72f87aef2bc947e8c87237" diff --git a/recipes/wolfssl/all/conanfile.py b/recipes/wolfssl/all/conanfile.py index 696d7e8d4ff174..3ec9c448508a04 100644 --- a/recipes/wolfssl/all/conanfile.py +++ b/recipes/wolfssl/all/conanfile.py @@ -40,6 +40,7 @@ class WolfSSLConan(ConanFile): "sni": [True, False], "testcert": [True, False], "with_curl": [True, False], + "with_experimental": [True, False], } default_options = { "shared": False, @@ -57,6 +58,7 @@ class WolfSSLConan(ConanFile): "sni": False, "testcert": False, "with_curl": False, + "with_experimental": False, } @property @@ -68,6 +70,8 @@ def config_options(self): del self.options.fPIC if Version(self.version) < "5.2.0": del self.options.with_curl + if Version(self.version) < "5.7.0": + del self.options.with_experimental def configure(self): if self.options.shared: @@ -120,6 +124,8 @@ def generate(self): ]) if self.options.get_safe("with_curl"): tc.configure_args.append("--enable-curl") + if self.options.get_safe("with_experimental"): + tc.configure_args.append("--enable-experimental") if is_msvc(self): tc.extra_ldflags.append("-ladvapi32") if check_min_vs(self, "180", raise_invalid=False): diff --git a/recipes/wolfssl/config.yml b/recipes/wolfssl/config.yml index e099f310174afb..336a121cbb73d7 100644 --- a/recipes/wolfssl/config.yml +++ b/recipes/wolfssl/config.yml @@ -1,4 +1,6 @@ versions: + "5.7.0": + folder: all "5.6.6": folder: all "5.6.4": diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py index 6c59c78b63932f..cc9c77df8e95f4 100644 --- a/recipes/xkbcommon/all/conanfile.py +++ b/recipes/xkbcommon/all/conanfile.py @@ -66,7 +66,7 @@ def requirements(self): if self.options.with_x11: self.requires("xorg/system") if self.options.get_safe("xkbregistry"): - self.requires("libxml2/2.12.3") + self.requires("libxml2/[>=2.12.5 <3]") if self.options.get_safe("with_wayland"): self.requires("wayland/1.22.0") diff --git a/recipes/xlsxio/all/conanfile.py b/recipes/xlsxio/all/conanfile.py index 7724a07d644647..ed6652c07a3619 100644 --- a/recipes/xlsxio/all/conanfile.py +++ b/recipes/xlsxio/all/conanfile.py @@ -62,7 +62,7 @@ def requirements(self): self.requires("minizip-ng/4.0.1") else: self.requires("minizip/1.2.13") - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") def validate(self): if Version(self.version) >= "0.2.34": diff --git a/recipes/xz_utils/all/conandata.yml b/recipes/xz_utils/all/conandata.yml index 09ca27188fcd2a..3274a9b4cdc21e 100644 --- a/recipes/xz_utils/all/conandata.yml +++ b/recipes/xz_utils/all/conandata.yml @@ -1,24 +1,38 @@ sources: "5.4.5": - url: "https://tukaani.org/xz/xz-5.4.5.tar.xz" + 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" + 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" + 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" + 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" + 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" + 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" + 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": diff --git a/recipes/xz_utils/cmake/conandata.yml b/recipes/xz_utils/cmake/conandata.yml deleted file mode 100644 index 8825601a50d2d9..00000000000000 --- a/recipes/xz_utils/cmake/conandata.yml +++ /dev/null @@ -1,7 +0,0 @@ -sources: - "5.6.1": - url: "https://github.com/tukaani-project/xz/releases/download/v5.6.1/xz-5.6.1.tar.xz" - sha256: "f334777310ca3ae9ba07206d78ed286a655aa3f44eec27854f740c26b2cd2ed0" - "5.6.0": - url: "https://github.com/tukaani-project/xz/releases/download/v5.6.0/xz-5.6.0.tar.xz" - sha256: "cdafe1632f139c82937cc1ed824f7a60b7b0a0619dfbbd681dcac02b1ac28f5b" diff --git a/recipes/xz_utils/cmake/conanfile.py b/recipes/xz_utils/cmake/conanfile.py deleted file mode 100644 index 29d660487cdf78..00000000000000 --- a/recipes/xz_utils/cmake/conanfile.py +++ /dev/null @@ -1,120 +0,0 @@ -from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.errors import ConanInvalidConfiguration -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rmdir, save -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, - } - - 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 validate(self): - # This is only from 5.6.0 onwards, they are just in a different recipe so no need to check version. - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": - raise ConanInvalidConfiguration(f"{self.ref} does not work on GCC<7 due to errors with inline assembly") - - 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_TESTING"] = False - 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")) - - self._create_cmake_module_variables( - os.path.join(self.package_folder, self._module_file_rel_path), - ) - cmake = CMake(self) - cmake.install() - - rmdir(self, os.path.join(self.package_folder, "share")) - rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - rmdir(self, os.path.join(self.package_folder, "lib", "cmake", "liblzma")) - if self.settings.os == "Windows": - rename(self, os.path.join(self.package_folder, "lib", "liblzma.lib"), os.path.join(self.package_folder, "lib", "lzma.lib")) - - 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/recipes/xz_utils/cmake/test_package/CMakeLists.txt b/recipes/xz_utils/cmake/test_package/CMakeLists.txt deleted file mode 100644 index cd4e960a3ff014..00000000000000 --- a/recipes/xz_utils/cmake/test_package/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -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/recipes/xz_utils/cmake/test_package/test_package.c b/recipes/xz_utils/cmake/test_package/test_package.c deleted file mode 100644 index a1f55ac4148465..00000000000000 --- a/recipes/xz_utils/cmake/test_package/test_package.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include -#include - -int main() { - printf("LZMA version %s\n", lzma_version_string()); - return EXIT_SUCCESS; -} diff --git a/recipes/xz_utils/cmake/test_v1_package/CMakeLists.txt b/recipes/xz_utils/cmake/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68b..00000000000000 --- a/recipes/xz_utils/cmake/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/recipes/xz_utils/config.yml b/recipes/xz_utils/config.yml index 7cd5f51b3c3c5c..d950dab72f7d0c 100644 --- a/recipes/xz_utils/config.yml +++ b/recipes/xz_utils/config.yml @@ -1,8 +1,4 @@ versions: - "5.6.1": - folder: cmake - "5.6.0": - folder: cmake "5.4.5": folder: all "5.4.4": diff --git a/recipes/yyjson/all/conandata.yml b/recipes/yyjson/all/conandata.yml index ad21b483cb8407..856586629c80e6 100644 --- a/recipes/yyjson/all/conandata.yml +++ b/recipes/yyjson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.0": + url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.9.0.tar.gz" + sha256: "59902bea55585d870fd7681eabe6091fbfd1a8776d1950f859d2dbbd510c74bd" "0.8.0": url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.8.0.tar.gz" sha256: "b2e39ac4c65f9050820c6779e6f7dd3c0d3fed9c6667f91caec0badbedce00f3" diff --git a/recipes/yyjson/all/conanfile.py b/recipes/yyjson/all/conanfile.py index 3574d26b2c7d54..735dd7c15a5b0b 100644 --- a/recipes/yyjson/all/conanfile.py +++ b/recipes/yyjson/all/conanfile.py @@ -61,6 +61,7 @@ def package(self): 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", "yyjson") @@ -68,3 +69,6 @@ def package_info(self): self.cpp_info.libs = ["yyjson"] if self.settings.os == "Windows" and self.options.shared: self.cpp_info.defines.append("YYJSON_IMPORTS") + + if Version(self.version) >= "0.9.0": + self.cpp_info.set_property("pkg_config_name", "yyjson") diff --git a/recipes/yyjson/config.yml b/recipes/yyjson/config.yml index f84f2efec202bb..b8cc90950df516 100644 --- a/recipes/yyjson/config.yml +++ b/recipes/yyjson/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.0": + folder: all "0.8.0": folder: all "0.7.0": diff --git a/recipes/z3/all/conandata.yml b/recipes/z3/all/conandata.yml index f57877f85f54a2..22ef6c0cbb5928 100644 --- a/recipes/z3/all/conandata.yml +++ b/recipes/z3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.13.0": + url: "https://github.com/Z3Prover/z3/archive/z3-4.13.0.tar.gz" + sha256: "01bcc61c8362e37bb89fd2430f7e3385e86df7915019bd2ce45de9d9bd934502" "4.12.4": url: "https://github.com/Z3Prover/z3/archive/z3-4.12.4.tar.gz" sha256: "25e9b18d04ee22f1d872dfe0daaf4c39034744525214e34fedd206e25140e96e" diff --git a/recipes/z3/config.yml b/recipes/z3/config.yml index 3fad1114f7caf6..3b0214f4790b4e 100644 --- a/recipes/z3/config.yml +++ b/recipes/z3/config.yml @@ -1,4 +1,6 @@ versions: + "4.13.0": + folder: "all" "4.12.4": folder: "all" "4.12.2": diff --git a/recipes/zint/all/conanfile.py b/recipes/zint/all/conanfile.py index f9c54ff2b86cf0..c582bdfe4e8e16 100644 --- a/recipes/zint/all/conanfile.py +++ b/recipes/zint/all/conanfile.py @@ -49,7 +49,7 @@ def layout(self): def requirements(self): if self.options.with_libpng: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") self.requires("zlib/[>=1.2.11 <2]") if self.options.with_qt: self.requires("qt/5.15.10") diff --git a/recipes/zstd/all/conandata.yml b/recipes/zstd/all/conandata.yml index 0deaf672d11b8c..522d0033ac6d3f 100644 --- a/recipes/zstd/all/conandata.yml +++ b/recipes/zstd/all/conandata.yml @@ -1,4 +1,7 @@ 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" @@ -17,28 +20,13 @@ sources: "1.4.9": url: "https://github.com/facebook/zstd/releases/download/v1.4.9/zstd-1.4.9.tar.gz" sha256: "29ac74e19ea28659017361976240c4b5c5c24db3b89338731a6feb97c038d293" - "1.4.8": - url: "https://github.com/facebook/zstd/releases/download/v1.4.8/zstd-1.4.8.tar.gz" - sha256: "32478297ca1500211008d596276f5367c54198495cf677e9439f4791a4c69f24" - "1.4.7": - url: "https://github.com/facebook/zstd/releases/download/v1.4.7/zstd-1.4.7.tar.gz" - sha256: "192cbb1274a9672cbcceaf47b5c4e9e59691ca60a357f1d4a8b2dfa2c365d757" - "1.4.5": - url: "https://github.com/facebook/zstd/releases/download/v1.4.5/zstd-1.4.5.tar.gz" - sha256: "98e91c7c6bf162bf90e4e70fdbc41a8188b9fa8de5ad840c401198014406ce9e" - "1.4.4": - url: "https://github.com/facebook/zstd/releases/download/v1.4.4/zstd-1.4.4.tar.gz" - sha256: "59ef70ebb757ffe74a7b3fe9c305e2ba3350021a918d168a046c6300aeea9315" - "1.4.3": - url: "https://github.com/facebook/zstd/releases/download/v1.4.3/zstd-1.4.3.tar.gz" - sha256: "e88ec8d420ff228610b77fba4fbf22b9f8b9d3f223a40ef59c9c075fcdad5767" - "1.3.8": - url: "https://github.com/facebook/zstd/releases/download/v1.3.8/zstd-1.3.8.tar.gz" - sha256: "293fa004dfacfbe90b42660c474920ff27093e3fb6c99f7b76e6083b21d6d48e" - "1.3.5": - url: "https://github.com/facebook/zstd/archive/refs/tags/v1.3.5.tar.gz" - sha256: "d6e1559e4cdb7c4226767d4ddc990bff5f9aab77085ff0d0490c828b025e2eea" 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" @@ -76,11 +64,3 @@ patches: patch_description: "fix strange performance and scalability issues" patch_type: "bugfix" patch_source: "https://github.com/facebook/zstd/pull/3167" - "1.4.5": - - patch_file: "patches/1.4.5-cmake-install-dll.patch" - patch_description: "fix runtime installation path" - patch_type: "conan" - "1.3.5": - - patch_file: "patches/1.3.5-cmake-project.patch" - patch_description: "fix `project()` position" - patch_type: "portability" diff --git a/recipes/zstd/all/conanfile.py b/recipes/zstd/all/conanfile.py index 5920d507715237..62abbe39678842 100644 --- a/recipes/zstd/all/conanfile.py +++ b/recipes/zstd/all/conanfile.py @@ -1,7 +1,6 @@ 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 -from conan.tools.scm import Version from conan.tools.microsoft import is_msvc import glob import os @@ -56,21 +55,15 @@ def generate(self): 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 - if not is_msvc(self): tc.variables["CMAKE_C_FLAGS"] = "-Wno-maybe-uninitialized" - - if Version(self.version) < "1.4.3": - # Generate a relocatable shared lib on Macos - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() def _patch_sources(self): apply_conandata_patches(self) # Don't force PIC - if Version(self.version) >= "1.4.5": - replace_in_file(self, os.path.join(self.source_folder, "build", "cmake", "lib", "CMakeLists.txt"), - "POSITION_INDEPENDENT_CODE On", "") + 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() diff --git a/recipes/zstd/all/patches/1.3.5-cmake-project.patch b/recipes/zstd/all/patches/1.3.5-cmake-project.patch deleted file mode 100644 index c8c9479c8ede1e..00000000000000 --- a/recipes/zstd/all/patches/1.3.5-cmake-project.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/build/cmake/CMakeLists.txt -+++ b/build/cmake/CMakeLists.txt -@@ -7,8 +7,8 @@ - # in the COPYING file in the root directory of this source tree). - # ################################################################ - --PROJECT(zstd) - CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9) -+PROJECT(zstd) - SET(ZSTD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") - LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") - INCLUDE(GNUInstallDirs) diff --git a/recipes/zstd/all/patches/1.4.5-cmake-install-dll.patch b/recipes/zstd/all/patches/1.4.5-cmake-install-dll.patch deleted file mode 100644 index 9433dfdbea9cb7..00000000000000 --- a/recipes/zstd/all/patches/1.4.5-cmake-install-dll.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- build/cmake/lib/CMakeLists.txt 2020-05-22 05:04:00.000000000 +0000 -+++ build/cmake/lib/CMakeLists.txt 2020-05-22 19:14:38.249960211 +0000 -@@ -161,6 +161,7 @@ - install(TARGETS ${library_targets} - EXPORT zstdExports - INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" -+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ) diff --git a/recipes/zstd/all/patches/1.5.6-public-scope-windows-shared.patch b/recipes/zstd/all/patches/1.5.6-public-scope-windows-shared.patch new file mode 100644 index 00000000000000..9862de8aaa890b --- /dev/null +++ b/recipes/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/recipes/zstd/config.yml b/recipes/zstd/config.yml index ddb81b147ddb62..c8d10e6c34e70a 100644 --- a/recipes/zstd/config.yml +++ b/recipes/zstd/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.6": + folder: all "1.5.5": folder: all "1.5.4": @@ -11,17 +13,3 @@ versions: folder: all "1.4.9": folder: all - "1.4.8": - folder: all - "1.4.7": - folder: all - "1.4.5": - folder: all - "1.4.4": - folder: all - "1.4.3": - folder: all - "1.3.8": - folder: all - "1.3.5": - folder: all