diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 6e6068e0e1187..b3a83e3b5d8fc 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -1049,3 +1049,32 @@ authorized_users: - maxpagani - tim-goto - tannerbitz +- PodnimatelPingvinov +- tmilnthorp +- IronTony-Stark +- edisonhello +- billyzheli +- xuzhenbao +- SunYu2004 +- Thibb1 +- achim-k +- JoelLefkowitz +- schuetzle-vector +- thejohnfreeman +- dimi309 +- valgur +- jakobrieke +- witte +- liarokapisv +- kielby +- mayeut +- CedricSchmeits +- mwerminski +- Kasurus +- barynton +- Daparrag +- roalter +- jsallay +- lmife +- granger35 +- bjoernrennfanz diff --git a/.c3i/conan_v2_ready_references.yml b/.c3i/conan_v2_ready_references.yml index 9782fe9fb4f3e..edff362746de5 100644 --- a/.c3i/conan_v2_ready_references.yml +++ b/.c3i/conan_v2_ready_references.yml @@ -235,7 +235,6 @@ required_for_references: - opengl - openh264 - openjpeg -- openssl - opus - pcre - pcre2 diff --git a/.c3i/config_v1.yml b/.c3i/config_v1.yml index 52508b8fdc61e..9e68ae1f33118 100644 --- a/.c3i/config_v1.yml +++ b/.c3i/config_v1.yml @@ -198,6 +198,7 @@ pod_size: large: - "pcl" - "duckdb" + - "ceres-solver" xlarge: - "llvm" - "opengv" diff --git a/.c3i/reviewers.yml b/.c3i/reviewers.yml index f5c3403c713cf..6c7ecd5befbc8 100644 --- a/.c3i/reviewers.yml +++ b/.c3i/reviewers.yml @@ -81,3 +81,6 @@ reviewers: - user: "StellaSmith" type: "community" request_reviews: false + - user: "davidsanfal" + type: "team" + request_reviews: false diff --git a/.github/workflows/alert-community.yml b/.github/workflows/alert-community.yml index 5eeed68fcfd6c..ff856d37690c8 100644 --- a/.github/workflows/alert-community.yml +++ b/.github/workflows/alert-community.yml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/alert-community with: files: "docs/*/*" - reviewers: "@prince-chrismc @MartinDelille" + reviewers: "@prince-chrismc @MartinDelille @Croydon" - uses: ./.github/actions/alert-community with: diff --git a/README.md b/README.md index 516167a9ba258..3206926309aed 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,13 @@ Conan Center Index is the source index of recipes of the [ConanCenter](https://c This repository includes a Continuous Integration system that will build automatically the Conan packages for the recipes submitted via [Pull Request](https://github.com/conan-io/conan-center-index/pulls). +### Server Status + +The current Conan Center Index CI status can be found on https://status.conan.io/ + +Any maintenance, outage or important event related to the CI will be informed there. + + ### Add ConanCenter remote ConanCenter remote is configured by default in any Conan client installation. If, for any reason, you need to add it manually, just execute: diff --git a/docs/changelog.md b/docs/changelog.md index 6b0d31b6d712e..213c759f05295 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,25 @@ # Changelog +### 10-March-2023 - 19:55 CET + +- [feature] Add priority to pull requests +- [hotfix] Avoid extra http requests to run automatic merge faster + +### 10-March-2023 - 13:15 CET + +- [hotfix] No longer update conan_v2_ready_references.yml automatically +- [bugfix] Validate Green and clean PRs first when executing automatic merge CI job + +### 07-March-2023 - 17:05 CET + +- [hotfix] Automatic merge skips git conflicts +- [hotfix] config label for "v2 ready" depends on PR author + +### 03-March-2023 - 11:05 CET + +- [feature] Update ready_v2_references.yml file automatically +- [fix] Do not reuse the same build folder to avoid busy files + ### 21-February-2023 - 17:22 CET - [fix] Fix bug with cppstd entry in configuration files. diff --git a/docs/faqs.md b/docs/faqs.md index 9a50eda346d59..d13145432a942 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -42,7 +42,8 @@ This section gathers the most common questions from the community related to pac * [How long can I be inactive before being removed from the authorized users list?](#how-long-can-i-be-inactive-before-being-removed-from-the-authorized-users-list) * [Can we add package which are parts of bigger projects like Boost?](#can-we-add-package-which-are-parts-of-bigger-projects-like-boost) * [Can I add my project which I will submit to Boost?](#can-i-add-my-project-which-i-will-submit-to-boost) - * [Can I add options that do not affect `package_id` or the package contents](#can-i-add-options-that-do-not-affect-package_id-or-the-package-contents) + * [Can I add options that do not affect `package_id` or the package contents](#can-i-add-options-that-do-not-affect-package_id-or-the-package-contents) + * [Can I use full_package_mode for a requirement in my recipe?](#can-i-use-full_package_mode-for-a-requirement-in-my-recipe) ## What is the policy on recipe name collisions? diff --git a/docs/labels.md b/docs/labels.md index 270b6b157a75a..b5f3f5d9cf396 100644 --- a/docs/labels.md +++ b/docs/labels.md @@ -9,6 +9,7 @@ special meaning: * [Bump dependencies](#bump-dependencies) * [Bump version](#bump-version) + * [C3I Conan2 Ready](#c3i-conan2-ready) * [Infrastructure](#infrastructure) * [Stale](#stale) * [Unexpected Error](#unexpected-error) @@ -39,6 +40,16 @@ For now, only [SEMVER](https://semver.org/#semantic-versioning-200) and ` These pull-requests will be merged right away without requiring any approval (CI and CLA checks must have passed). + +Only team members can open a pull request with these changes. + ## Infrastructure Label [`infrastructure`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3Ainfrastructure) is diff --git a/docs/package_templates/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py index ee4c716b4e9d7..47f9a403b5cf1 100644 --- a/docs/package_templates/cmake_package/all/conanfile.py +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -26,6 +26,8 @@ class PackageConan(ConanFile): homepage = "https://github.com/project/package" # no "conan" and project name in topics. Use topics from the upstream listed on GH topics = ("topic1", "topic2", "topic3") + # package_type should usually be "library" (if there is shared option) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/docs/package_templates/header_only/all/conanfile.py b/docs/package_templates/header_only/all/conanfile.py index b268d9251b28e..51ea9a72fb954 100644 --- a/docs/package_templates/header_only/all/conanfile.py +++ b/docs/package_templates/header_only/all/conanfile.py @@ -21,6 +21,7 @@ class PackageConan(ConanFile): # Do not put "conan" nor the project name in topics. Use topics from the upstream listed on GH # Keep 'header-only' as topic topics = ("topic1", "topic2", "topic3", "header-only") + package_type = "header-library" # Keep these or explain why it's not required for this particular case settings = "os", "arch", "compiler", "build_type" # Do not copy sources to build folder for header only projects, unless you need to apply patches diff --git a/docs/package_templates/meson_package/all/conanfile.py b/docs/package_templates/meson_package/all/conanfile.py index 98f986361e929..ef4bad7fd4d3b 100644 --- a/docs/package_templates/meson_package/all/conanfile.py +++ b/docs/package_templates/meson_package/all/conanfile.py @@ -29,6 +29,8 @@ class PackageConan(ConanFile): homepage = "https://github.com/project/package" # no "conan" and project name in topics. Use topics from the upstream listed on GH topics = ("topic1", "topic2", "topic3") + # package_type should usually be "library" (if there is shared option) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/docs/package_templates/msbuild_package/all/conanfile.py b/docs/package_templates/msbuild_package/all/conanfile.py index 332dbfb867b37..5fd9fc9251d3e 100644 --- a/docs/package_templates/msbuild_package/all/conanfile.py +++ b/docs/package_templates/msbuild_package/all/conanfile.py @@ -19,6 +19,8 @@ class PackageConan(ConanFile): homepage = "https://github.com/project/package" # no "conan" and project name in topics. Use topics from the upstream listed on GH topics = ("topic1", "topic2", "topic3") + # package_type should usually be "library" (if there is shared option) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/docs/package_templates/prebuilt_tool_package/all/conanfile.py b/docs/package_templates/prebuilt_tool_package/all/conanfile.py index f632b6094174c..8a52bdeb5c74f 100644 --- a/docs/package_templates/prebuilt_tool_package/all/conanfile.py +++ b/docs/package_templates/prebuilt_tool_package/all/conanfile.py @@ -16,6 +16,7 @@ class PackageConan(ConanFile): homepage = "https://github.com/project/package" # no "conan" and project name in topics. Use "pre-built" for tooling packages topics = ("topic1", "topic2", "topic3", "pre-built") + package_type = "application" settings = "os", "arch", "compiler", "build_type" # even for pre-built executables # not needed but supress warning message from conan commands diff --git a/recipes/aaf/all/conanfile.py b/recipes/aaf/all/conanfile.py index 3cb365138e8e8..358a4f96210ec 100644 --- a/recipes/aaf/all/conanfile.py +++ b/recipes/aaf/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.apple import fix_apple_shared_install_name, is_apple_os 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 import os required_conan_version = ">=1.52.0" @@ -45,7 +46,7 @@ def generate(self): tc = CMakeToolchain(self) if is_apple_os(self): tc.cache_variables["PLATFORM"] = "apple-clang" - elif self.settings.compiler == "Visual Studio": + elif is_msvc(self): tc.cache_variables["PLATFORM"] = "vc" else: tc.cache_variables["PLATFORM"] = str(self.settings.os) diff --git a/recipes/accellera-uvm-systemc/all/conanfile.py b/recipes/accellera-uvm-systemc/all/conanfile.py index 98ed0d0f6aa37..15689e9fd7ded 100644 --- a/recipes/accellera-uvm-systemc/all/conanfile.py +++ b/recipes/accellera-uvm-systemc/all/conanfile.py @@ -29,9 +29,11 @@ class UvmSystemC(ConanFile): def _source_subfolder(self): return "source_subfolder" + def requirements(self): + self.requires("systemc/2.3.3") + def build_requirements(self): self.tool_requires("cmake/3.24.0") - self.tool_requires("systemc/2.3.3") def configure(self): if self.options.shared: diff --git a/recipes/aws-c-auth/all/conanfile.py b/recipes/aws-c-auth/all/conanfile.py index 98d3c8c463737..610bd376de920 100644 --- a/recipes/aws-c-auth/all/conanfile.py +++ b/recipes/aws-c-auth/all/conanfile.py @@ -1,19 +1,24 @@ from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import get, copy, rmdir from conan.tools.scm import Version -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" + class AwsCAuth(ConanFile): name = "aws-c-auth" - description = "C99 library implementation of AWS client-side authentication: standard credentials providers and signing." + description = ( + "C99 library implementation of AWS client-side authentication: " + "standard credentials providers and signing." + ) license = "Apache-2.0", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-auth" topics = ("aws", "amazon", "cloud", "authentication", "credentials", "providers", "signing") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,33 +35,24 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.8.2") + self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) self.requires("aws-c-cal/0.5.13") if Version(self.version) < "0.6.17": - self.requires("aws-c-io/0.10.20") - self.requires("aws-c-http/0.6.13") + self.requires("aws-c-io/0.10.20", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.6.13", transitive_headers=True, transitive_libs=True) else: - self.requires("aws-c-io/0.13.4") - self.requires("aws-c-http/0.6.22") + self.requires("aws-c-io/0.13.4", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.6.22", transitive_headers=True, transitive_libs=True) if Version(self.version) >= "0.6.5": - self.requires("aws-c-sdkutils/0.1.3") + self.requires("aws-c-sdkutils/0.1.3", transitive_headers=True, transitive_libs=True) def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -83,11 +79,7 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-auth") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-auth") - - self.cpp_info.components["aws-c-auth-lib"].names["cmake_find_package"] = "aws-c-auth" - self.cpp_info.components["aws-c-auth-lib"].names["cmake_find_package_multi"] = "aws-c-auth" - self.cpp_info.components["aws-c-auth-lib"].set_property("cmake_target_name", "AWS::aws-c-auth") - + # TODO: back to global scope once conan v1 support dropped self.cpp_info.components["aws-c-auth-lib"].libs = ["aws-c-auth"] self.cpp_info.components["aws-c-auth-lib"].requires = [ "aws-c-common::aws-c-common-lib", @@ -98,8 +90,11 @@ def package_info(self): if Version(self.version) >= "0.6.5": self.cpp_info.components["aws-c-auth-lib"].requires.append("aws-c-sdkutils::aws-c-sdkutils-lib") - # TODO: to remove in conan v2 once cmake_find_package_* generators removed + # TODO: to remove once conan v1 support dropped self.cpp_info.filenames["cmake_find_package"] = "aws-c-auth" self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-auth" self.cpp_info.names["cmake_find_package"] = "AWS" self.cpp_info.names["cmake_find_package_multi"] = "AWS" + self.cpp_info.components["aws-c-auth-lib"].names["cmake_find_package"] = "aws-c-auth" + self.cpp_info.components["aws-c-auth-lib"].names["cmake_find_package_multi"] = "aws-c-auth" + self.cpp_info.components["aws-c-auth-lib"].set_property("cmake_target_name", "AWS::aws-c-auth") diff --git a/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt index 606180fec87bd..c23ed5cfe6d98 100644 --- a/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt +++ b/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_v1_package) + +enable_testing() include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-c-auth REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-auth) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/b2/config.yml b/recipes/b2/config.yml index 0c5e840b204a2..8b6a9f5076283 100644 --- a/recipes/b2/config.yml +++ b/recipes/b2/config.yml @@ -43,3 +43,7 @@ versions: folder: portable "4.9.4": folder: portable + "4.9.5": + folder: portable + "4.9.6": + folder: portable diff --git a/recipes/b2/portable/conandata.yml b/recipes/b2/portable/conandata.yml index a0a9743d8c2eb..00c3852f57248 100644 --- a/recipes/b2/portable/conandata.yml +++ b/recipes/b2/portable/conandata.yml @@ -53,3 +53,9 @@ sources: "4.9.4": url: "https://github.com/bfgroup/b2/releases/download/4.9.4/b2-4.9.4.tar.bz2" sha256: "1996d8098955ad3fdecab242d784afaef0fba80dd5d2ef0b3a41592e26772312" + "4.9.5": + url: "https://github.com/bfgroup/b2/releases/download/4.9.5/b2-4.9.5.tar.bz2" + sha256: "f81bea44601613f633d3311341f3f63594608537bf38d7073b877ec1edb2760a" + "4.9.6": + url: "https://github.com/bfgroup/b2/releases/download/4.9.6/b2-4.9.6.tar.bz2" + sha256: "10c1344c751fcf5a1f9ec6f52c02626cfbf78a4806f7817949b115e107bbbc5f" diff --git a/recipes/benchmark/all/conanfile.py b/recipes/benchmark/all/conanfile.py index 41caf19f1ced1..a1b57fcf562db 100644 --- a/recipes/benchmark/all/conanfile.py +++ b/recipes/benchmark/all/conanfile.py @@ -18,6 +18,7 @@ class BenchmarkConan(ConanFile): homepage = "https://github.com/google/benchmark" topics = ("google", "microbenchmark") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -53,7 +54,7 @@ def _cmake_new_enough(self, required_version): import re from io import StringIO output = StringIO() - self.run("cmake --version", output=output) + self.run("cmake --version", output) m = re.search(r'cmake version (\d+\.\d+\.\d+)', output.getvalue()) return Version(m.group(1)) >= required_version except: @@ -61,7 +62,7 @@ def _cmake_new_enough(self, required_version): def build_requirements(self): if Version(self.version) >= "1.7.1" and not self._cmake_new_enough("3.16.3"): - self.tool_requires("cmake/3.25.2") + self.tool_requires("cmake/3.25.3") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/boost-leaf/all/conanfile.py b/recipes/boost-leaf/all/conanfile.py index b119ea7a5c58a..e655329412639 100644 --- a/recipes/boost-leaf/all/conanfile.py +++ b/recipes/boost-leaf/all/conanfile.py @@ -19,10 +19,7 @@ class BoostLEAFConan(ConanFile): "header-only", "low-latency", "no-dependencies", "single-header") settings = "os", "compiler", "arch", "build_type" no_copy_source = True - deprecated = True - - def configure(self): - raise ConanInvalidConfiguration(f"{self.ref} is deprecated in favor of Boost >=1.75.0") + deprecated = "boost" def package_id(self): self.info.clear() @@ -63,11 +60,10 @@ def lazy_lt_semver(v1, v2): f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler ({compiler}-{version}) does not support") def layout(self): - basic_layout(self) + basic_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): copy(self, "LICENSE_1_0.txt", dst=os.path.join( diff --git a/recipes/bzip2/all/conanfile.py b/recipes/bzip2/all/conanfile.py index c890147c5a874..9bba05c82a828 100644 --- a/recipes/bzip2/all/conanfile.py +++ b/recipes/bzip2/all/conanfile.py @@ -15,6 +15,7 @@ class Bzip2Conan(ConanFile): license = "bzip2-1.0.8" description = "bzip2 is a free and open-source file compression program that uses the Burrows Wheeler algorithm." topics = ("data-compressor", "file-compression") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -46,8 +47,7 @@ def layout(self): cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -72,21 +72,19 @@ def package(self): ) def _create_cmake_module_variables(self, module_file): - content = textwrap.dedent("""\ + content = textwrap.dedent(f"""\ set(BZIP2_NEED_PREFIX TRUE) set(BZIP2_FOUND TRUE) if(NOT DEFINED BZIP2_INCLUDE_DIRS AND DEFINED BZip2_INCLUDE_DIRS) - set(BZIP2_INCLUDE_DIRS ${BZip2_INCLUDE_DIRS}) + set(BZIP2_INCLUDE_DIRS ${{BZip2_INCLUDE_DIRS}}) endif() if(NOT DEFINED BZIP2_INCLUDE_DIR AND DEFINED BZip2_INCLUDE_DIR) - set(BZIP2_INCLUDE_DIR ${BZip2_INCLUDE_DIR}) + set(BZIP2_INCLUDE_DIR ${{BZip2_INCLUDE_DIR}}) endif() if(NOT DEFINED BZIP2_LIBRARIES AND DEFINED BZip2_LIBRARIES) - set(BZIP2_LIBRARIES ${BZip2_LIBRARIES}) - endif() - if(NOT DEFINED BZIP2_VERSION_STRING AND DEFINED BZip2_VERSION) - set(BZIP2_VERSION_STRING ${BZip2_VERSION}) + set(BZIP2_LIBRARIES ${{BZip2_LIBRARIES}}) endif() + set(BZIP2_VERSION_STRING "{self.version}") """) save(self, module_file, content) diff --git a/recipes/bzip2/all/test_package/CMakeLists.txt b/recipes/bzip2/all/test_package/CMakeLists.txt index 540d39e432a7e..364bed2972661 100644 --- a/recipes/bzip2/all/test_package/CMakeLists.txt +++ b/recipes/bzip2/all/test_package/CMakeLists.txt @@ -16,7 +16,7 @@ set(_custom_vars BZIP2_VERSION_STRING ) foreach(_custom_var ${_custom_vars}) - if(DEFINED _custom_var) + if(DEFINED ${_custom_var}) message(STATUS "${_custom_var}: ${${_custom_var}}") else() message(FATAL_ERROR "${_custom_var} not defined") diff --git a/recipes/catch2/2.x.x/conandata.yml b/recipes/catch2/2.x.x/conandata.yml index c945ab0313001..9e23bc009801d 100644 --- a/recipes/catch2/2.x.x/conandata.yml +++ b/recipes/catch2/2.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.13.10": + url: "https://github.com/catchorg/Catch2/archive/v2.13.10.tar.gz" + sha256: "d54a712b7b1d7708bc7a819a8e6e47b2fde9536f487b89ccbca295072a7d9943" "2.13.9": url: "https://github.com/catchorg/Catch2/archive/v2.13.9.tar.gz" sha256: "06dbc7620e3b96c2b69d57bf337028bf245a211b3cddb843835bfe258f427a52" diff --git a/recipes/catch2/2.x.x/conanfile.py b/recipes/catch2/2.x.x/conanfile.py index 85e43357d751d..15b01852024f5 100644 --- a/recipes/catch2/2.x.x/conanfile.py +++ b/recipes/catch2/2.x.x/conanfile.py @@ -16,7 +16,6 @@ class Catch2Conan(ConanFile): url = "https://github.com/conan-io/conan-center-index" license = "BSL-1.0" - package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], diff --git a/recipes/catch2/3.x.x/conandata.yml b/recipes/catch2/3.x.x/conandata.yml index 763deea60af04..27ebedcdcb791 100644 --- a/recipes/catch2/3.x.x/conandata.yml +++ b/recipes/catch2/3.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.3.2": + url: "https://github.com/catchorg/Catch2/archive/v3.3.2.tar.gz" + sha256: "8361907f4d9bff3ae7c1edb027f813659f793053c99b67837a0c0375f065bae2" "3.3.1": url: "https://github.com/catchorg/Catch2/archive/v3.3.1.tar.gz" sha256: "d90351cdc55421f640c553cfc0875a8c834428679444e8062e9187d05b18aace" diff --git a/recipes/catch2/config.yml b/recipes/catch2/config.yml index b5b40d81b175a..5cab4a772bfb6 100644 --- a/recipes/catch2/config.yml +++ b/recipes/catch2/config.yml @@ -1,4 +1,6 @@ versions: + "3.3.2": + folder: 3.x.x "3.3.1": folder: 3.x.x "3.3.0": @@ -11,6 +13,8 @@ versions: folder: 3.x.x "3.0.1": folder: 3.x.x + "2.13.10": + folder: 2.x.x "2.13.9": folder: 2.x.x "2.13.8": diff --git a/recipes/cctz/all/conanfile.py b/recipes/cctz/all/conanfile.py index ccf49ac66ee4e..f4eb7ecd52b25 100644 --- a/recipes/cctz/all/conanfile.py +++ b/recipes/cctz/all/conanfile.py @@ -1,12 +1,11 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, rmdir -from conan.tools.scm import Version +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import check_min_vs import os -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.53.0" class CCTZConan(ConanFile): @@ -14,9 +13,10 @@ class CCTZConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/google/cctz" description = "C++ library for translating between absolute and civil times" - topics = ("cctz", "time", "timezones") + topics = ("time", "timezones") license = "Apache-2.0" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -30,8 +30,7 @@ class CCTZConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -39,19 +38,16 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - - def validate(self): - if self.settings.compiler == "Visual Studio" and \ - Version(self.settings.compiler.version) < 14: - raise ConanInvalidConfiguration("CCTZ requires MSVC >= 14") + self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") + def validate(self): + check_min_vs(self, "190") + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -80,10 +76,11 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "cctz") self.cpp_info.set_property("cmake_target_name", "cctz::cctz") self.cpp_info.libs = ["cctz"] - if is_apple_os(self): + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + elif is_apple_os(self): self.cpp_info.frameworks.append("CoreFoundation") + # TODO: to remove in conan v2 if self.options.build_tools: - bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) - self.env_info.PATH.append(bindir) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/cctz/all/test_package/conanfile.py b/recipes/cctz/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/cctz/all/test_package/conanfile.py +++ b/recipes/cctz/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/cctz/all/test_v1_package/CMakeLists.txt b/recipes/cctz/all/test_v1_package/CMakeLists.txt index 46aaf8b80ff51..0d20897301b68 100644 --- a/recipes/cctz/all/test_v1_package/CMakeLists.txt +++ b/recipes/cctz/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(cctz REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE cctz::cctz) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cmake/binary/conandata.yml b/recipes/cmake/binary/conandata.yml new file mode 100644 index 0000000000000..1f12d91d4a85e --- /dev/null +++ b/recipes/cmake/binary/conandata.yml @@ -0,0 +1,103 @@ +sources: + "3.25.3": + Linux: + armv8: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-linux-aarch64.tar.gz" + sha256: "cd6e853639f858569e22e6298f009eb24b4702c51c0d5bc1cb36c688f7ce246d" + x86_64: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-linux-x86_64.tar.gz" + sha256: "d4d2ba83301b215857d3b6590cd4434a414fa151c5807693abe587bd6c03581e" + Macos: + universal: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-macos10.10-universal.tar.gz" + sha256: "ea37a83cd329224c38a1938d2cf7b2656ad971dea9cf759238652746213661f8" + Windows: + armv8: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-windows-arm64.zip" + sha256: "3498fea26257eebfbfc89ed17963f3d8d83c19362b90fb23517842de777a522a" + x86_64: + url: "https://cmake.org/files/v3.25/cmake-3.25.3-windows-x86_64.zip" + sha256: "d129425d569140b729210f3383c246dec19c4183f7d0afae1837044942da3b4b" + "3.24.4": + Linux: + armv8: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-linux-aarch64.tar.gz" + sha256: "86f823f2636bf715af89da10e04daa476755a799d451baee66247846e95d7bee" + x86_64: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-linux-x86_64.tar.gz" + sha256: "cac77d28fb8668c179ac02c283b058aeb846fe2133a57d40b503711281ed9f19" + Macos: + universal: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-macos10.10-universal.tar.gz" + sha256: "3cda3995d6ea06a9d05dfaac633006754d6df5d80cd3d08bf4c284507a550496" + Windows: + armv8: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-windows-arm64.zip" + sha256: "55e81f0c95b06a4435b708cdee7d5739e38cc29c909d3d3134c1a3117e09b965" + x86_64: + url: "https://cmake.org/files/v3.24/cmake-3.24.4-windows-x86_64.zip" + sha256: "c135c7ab78143c46e6686b1e9652bc1dd07e0cf71fd4decee777cdca77019c39" + "3.23.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.23/cmake-3.23.5-linux-aarch64.tar.gz" + sha256: "dcf25a81de6bd4e646389a0635b050ed04d0f27e4f07ae22d975391f38f3c4b8" + x86_64: + url: "https://cmake.org/files/v3.23/cmake-3.23.5-linux-x86_64.tar.gz" + sha256: "bbd7ad93d2a14ed3608021a9466ae63db76a24efd1fae7a5f7798c1de7ab9344" + Macos: + universal: + url: "https://cmake.org/files/v3.23/cmake-3.23.5-macos10.10-universal.tar.gz" + sha256: "d3b44c59e72ef9cc13f7a4642de56e69b1b33fc3a6bb003b59b7f2036ace7e03" + Windows: + x86_64: + url: "https://cmake.org/files/v3.23/cmake-3.23.5-windows-x86_64.zip" + sha256: "51c75f93ebfe295701df205e5e78808b1e707996b26b5c26c3f680ab7b543881" + "3.22.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.22/cmake-3.22.6-linux-aarch64.tar.gz" + sha256: "79be85d3e76565faacd60695cee11d030f7e7dd8691476144fa25eb93dbd0397" + x86_64: + url: "https://cmake.org/files/v3.22/cmake-3.22.6-linux-x86_64.tar.gz" + sha256: "09e1b34026c406c5bf4d1b053eadb3a8519cb360e37547ebf4b70ab766d94fbc" + Macos: + universal: + url: "https://cmake.org/files/v3.22/cmake-3.22.6-macos10.10-universal.tar.gz" + sha256: "873d296000b2fbd5cd306a3455fddc254b485cad988c67bf4ee0ba4fd7a1e057" + Windows: + x86_64: + url: "https://cmake.org/files/v3.22/cmake-3.22.6-windows-x86_64.zip" + sha256: "48bcc3e71e918b72e2682f9ca9d44dd6c416379071c1ecb530d0633374f91f15" + "3.21.7": + Linux: + armv8: + url: "https://cmake.org/files/v3.21/cmake-3.21.7-linux-aarch64.tar.gz" + sha256: "fa7e82170391c71dcc958ff57a63e9d6be9742a8b85a8b1386da9e571980474a" + x86_64: + url: "https://cmake.org/files/v3.21/cmake-3.21.7-linux-x86_64.tar.gz" + sha256: "f84e209d903a96e54f398bb8760693969b13fc50bce2f8278a9ee9dca01406b2" + Macos: + universal: + url: "https://cmake.org/files/v3.21/cmake-3.21.7-macos10.10-universal.tar.gz" + sha256: "d79775e35efca40ff1d213155c2d5e2e028d0ce376c5089c97f2fe3c6133af1d" + Windows: + x86_64: + url: "https://cmake.org/files/v3.21/cmake-3.21.7-windows-x86_64.zip" + sha256: "4c4840e2dc2bf82e8a16081ff506bba54f3a228b91ce36317129fed4035ef2e3" + "3.20.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.20/cmake-3.20.6-linux-aarch64.tar.gz" + sha256: "9ac2035174d3c62827c85fb052372d70cf35fb565e8d47b8241fbe451c29b2f2" + x86_64: + url: "https://cmake.org/files/v3.20/cmake-3.20.6-linux-x86_64.tar.gz" + sha256: "458777097903b0f35a0452266b923f0a2f5b62fe331e636e2dcc4b636b768e36" + Macos: + universal: + url: "https://cmake.org/files/v3.20/cmake-3.20.6-macos10.10-universal.tar.gz" + sha256: "e75e95c10089b54fe0a7dfb369a87214e8a0ffb46d0fcf6a9678b38140dba983" + Windows: + x86_64: + url: "https://cmake.org/files/v3.20/cmake-3.20.6-windows-x86_64.zip" + sha256: "f240a38c964712aac474644b3ba21bdc2b4e8d5e31179f67bd2e6f45fa349419" diff --git a/recipes/cmake/binary/conanfile.py b/recipes/cmake/binary/conanfile.py new file mode 100644 index 0000000000000..13c7ebecd34ef --- /dev/null +++ b/recipes/cmake/binary/conanfile.py @@ -0,0 +1,66 @@ +import os + +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + + +required_conan_version = ">=1.51.0" + +class CMakeConan(ConanFile): + name = "cmake" + package_type = "application" + description = "CMake, the cross-platform, open-source build system." + topics = ("build", "installer") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Kitware/CMake" + license = "BSD-3-Clause" + settings = "os", "arch" + + def validate(self): + if self.settings.arch not in ["x86_64", "armv8"]: + raise ConanInvalidConfiguration("CMake binaries are only provided for x86_64 and armv8 architectures") + + if self.settings.os == "Windows" and self.settings.arch == "armv8" and Version(self.version) < "3.24": + raise ConanInvalidConfiguration("CMake only supports ARM64 binaries on Windows starting from 3.24") + + def build(self): + arch = str(self.settings.arch) if self.settings.os != "Macos" else "universal" + get(self, **self.conan_data["sources"][self.version][str(self.settings.os)][arch], + destination=self.source_folder, strip_root=True) + + def package_id(self): + if self.info.settings.os == "Macos": + del self.info.settings.arch + + def package(self): + copy(self, "*", src=self.build_folder, dst=self.package_folder) + + if self.settings.os == "Macos": + docs_folder = os.path.join(self.build_folder, "CMake.app", "Contents", "doc", "cmake") + else: + docs_folder = os.path.join(self.build_folder, "doc", "cmake") + + copy(self, "Copyright.txt", src=docs_folder, dst=os.path.join(self.package_folder, "licenses"), keep_path=False) + + if self.settings.os != "Macos": + # Remove unneeded folders (also cause long paths on Windows) + # Note: on macOS we don't want to modify the bundle contents + # to preserve signature validation + rmdir(self, os.path.join(self.package_folder, "doc")) + rmdir(self, os.path.join(self.package_folder, "man")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os == "Macos": + bindir = os.path.join(self.package_folder, "CMake.app", "Contents", "bin") + self.cpp_info.bindirs = [bindir] + else: + bindir = os.path.join(self.package_folder, "bin") + + # Needed for compatibility with v1.x - Remove when 2.0 becomes the default + self.output.info(f"Appending PATH environment variable: {bindir}") + self.env_info.PATH.append(bindir) diff --git a/recipes/cmake/binary/test_package/conanfile.py b/recipes/cmake/binary/test_package/conanfile.py new file mode 100644 index 0000000000000..1c9cda0539d32 --- /dev/null +++ b/recipes/cmake/binary/test_package/conanfile.py @@ -0,0 +1,23 @@ +from six import StringIO +from conan import ConanFile +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + output = StringIO() + self.run("cmake --version", output) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + tokens = re.split('[@#]', self.tested_reference_str) + require_version = tokens[0].split("/", 1)[1] + self.output.info("Expected version: {}".format(require_version)) + assert_cmake_version = "cmake version %s" % require_version + assert(assert_cmake_version in output_str) diff --git a/recipes/cmake/binary/test_v1_package/conanfile.py b/recipes/cmake/binary/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..df9415b7cf880 --- /dev/null +++ b/recipes/cmake/binary/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +import os +from six import StringIO +from conan import ConanFile +import re + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + output = StringIO() + self.run("cmake --version", output=output, run_environment=False) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + tokens = re.split('[@#]', self.tested_reference_str) + require_version = tokens[0].split("/", 1)[1] + self.output.info("Expected version: {}".format(require_version)) + assert_cmake_version = "cmake version %s" % require_version + assert(assert_cmake_version in output_str) diff --git a/recipes/cmake/config.yml b/recipes/cmake/config.yml index a51a4d68aeed6..2ab4952814fac 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -1,15 +1,13 @@ versions: - "3.19.8": - folder: "3.x.x" "3.20.6": - folder: "3.x.x" + folder: "binary" "3.21.7": - folder: "3.x.x" + folder: "binary" "3.22.6": - folder: "3.x.x" + folder: "binary" "3.23.5": - folder: "3.x.x" - "3.24.3": - folder: "3.x.x" - "3.25.2": - folder: "3.x.x" + folder: "binary" + "3.24.4": + folder: "binary" + "3.25.3": + folder: "binary" diff --git a/recipes/coin-utils/all/conandata.yml b/recipes/coin-utils/all/conandata.yml index cf4b9462b67bc..d4916f7c0bcc0 100644 --- a/recipes/coin-utils/all/conandata.yml +++ b/recipes/coin-utils/all/conandata.yml @@ -8,5 +8,11 @@ sources: patches: "2.11.6": - patch_file: "patches/0001-no-check-pkgconfig.patch" + - patch_file: "patches/0002-cpp17-compat.patch" + patch_description: "C++17 compatibility" + patch_type: "portability" "2.11.4": - patch_file: "patches/0001-no-check-pkgconfig.patch" + - patch_file: "patches/0002-cpp17-compat.patch" + patch_description: "C++17 compatibility" + patch_type: "portability" diff --git a/recipes/coin-utils/all/patches/0002-cpp17-compat.patch b/recipes/coin-utils/all/patches/0002-cpp17-compat.patch new file mode 100644 index 0000000000000..4e3f9a995048c --- /dev/null +++ b/recipes/coin-utils/all/patches/0002-cpp17-compat.patch @@ -0,0 +1,75 @@ +--- a/CoinUtils/src/CoinOslC.h ++++ b/CoinUtils/src/CoinOslC.h +@@ -34,30 +34,30 @@ + extern "C" { + #endif + +-int c_ekkbtrn(register const EKKfactinfo *fact, ++int c_ekkbtrn(const EKKfactinfo *fact, + double *dwork1, + int *mpt, int first_nonzero); +-int c_ekkbtrn_ipivrw(register const EKKfactinfo *fact, ++int c_ekkbtrn_ipivrw(const EKKfactinfo *fact, + double *dwork1, + int *mpt, int ipivrw, int *spare); + +-int c_ekketsj(register /*const*/ EKKfactinfo *fact, ++int c_ekketsj(/*const*/ EKKfactinfo *fact, + double *dwork1, + int *mpt2, double dalpha, int orig_nincol, + int npivot, int *nuspikp, + const int ipivrw, int *spare); +-int c_ekkftrn(register const EKKfactinfo *fact, ++int c_ekkftrn(const EKKfactinfo *fact, + double *dwork1, + double *dpermu, int *mpt, int numberNonZero); + +-int c_ekkftrn_ft(register EKKfactinfo *fact, ++int c_ekkftrn_ft(EKKfactinfo *fact, + double *dwork1, int *mpt, int *nincolp); +-void c_ekkftrn2(register EKKfactinfo *fact, double *dwork1, ++void c_ekkftrn2(EKKfactinfo *fact, double *dwork1, + double *dpermu1, int *mpt1, int *nincolp, + double *dwork1_ft, int *mpt_ft, int *nincolp_ft); + +-int c_ekklfct(register EKKfactinfo *fact); +-int c_ekkslcf(register const EKKfactinfo *fact); ++int c_ekklfct(EKKfactinfo *fact); ++int c_ekkslcf(const EKKfactinfo *fact); + inline void c_ekkscpy(int n, const int *marr1, int *marr2) + { + CoinMemcpyN(marr1, n, marr2); +--- a/CoinUtils/src/CoinOslFactorization2.cpp ++++ b/CoinUtils/src/CoinOslFactorization2.cpp +@@ -21,9 +21,9 @@ + extern int ets_count; + extern int ets_check; + #endif +-#define COIN_REGISTER register ++#define COIN_REGISTER + #define COIN_REGISTER2 +-#define COIN_REGISTER3 register ++#define COIN_REGISTER3 + #ifdef COIN_USE_RESTRICT + #define COIN_RESTRICT2 __restrict + #else +--- a/CoinUtils/src/CoinOslFactorization3.cpp ++++ b/CoinUtils/src/CoinOslFactorization3.cpp +@@ -1362,7 +1362,7 @@ static void c_ekkmltf(const EKKfactinfo *fact, double *dluval, int *hcoli, + } + } + } /* c_ekkmltf */ +-int c_ekklfct(register EKKfactinfo *fact) ++int c_ekklfct(EKKfactinfo *fact) + { + const int nrow = fact->nrow; + int ninbas = fact->xcsadr[nrow + 1] - 1; +@@ -2591,7 +2591,7 @@ inline void c_ekkclcp2(const int *hcol, const double *dels, const int *mrstrt, + } + } + } /* c_ekkclcp */ +-int c_ekkslcf(register const EKKfactinfo *fact) ++int c_ekkslcf(const EKKfactinfo *fact) + { + int *hrow = fact->xeradr; + int *hcol = fact->xecadr; diff --git a/recipes/cpp-httplib/all/conandata.yml b/recipes/cpp-httplib/all/conandata.yml index 5795dfd52e66a..9f5e8af251afc 100644 --- a/recipes/cpp-httplib/all/conandata.yml +++ b/recipes/cpp-httplib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.12.1": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.1.tar.gz" + sha256: "0e56c25c63e730ebd42e2beda6e7cb1b950131d8fc00d3158b1443a8d76f41ca" "0.12.0": url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.0.tar.gz" sha256: "423900c9a124b88c406cd34aba08c9e60742e477a02bd29051cf0ecbf9ef0c65" diff --git a/recipes/cpp-httplib/config.yml b/recipes/cpp-httplib/config.yml index 784320dbc7cf5..3e73ada76f67a 100644 --- a/recipes/cpp-httplib/config.yml +++ b/recipes/cpp-httplib/config.yml @@ -1,4 +1,6 @@ versions: + "0.12.1": + folder: all "0.12.0": folder: all "0.11.4": diff --git a/recipes/cpr/all/conanfile.py b/recipes/cpr/all/conanfile.py index 8b42a60f1a395..f9ec63a80be5a 100644 --- a/recipes/cpr/all/conanfile.py +++ b/recipes/cpr/all/conanfile.py @@ -22,6 +22,7 @@ class CprConan(ConanFile): homepage = "https://docs.libcpr.org/" topics = ("requests", "web", "curl") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -40,19 +41,19 @@ class CprConan(ConanFile): @property def _min_cppstd(self): - return 11 if Version(self.version) < "1.10.0" else 17 + return "11" if Version(self.version) < "1.10.0" else "17" @property def _compilers_minimum_version(self): - if self._min_cppstd == 11: - return {} return { - "gcc": "9", - "clang": "7", - "apple-clang": "10", - "Visual Studio": "15", - "msvc": "191", - } + "17": { + "gcc": "9", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) @property def _supports_openssl(self): @@ -69,7 +70,7 @@ def _supports_winssl(self): @property def _supports_darwinssl(self): # https://github.com/libcpr/cpr/releases/tag/1.6.1 - return Version(self.version) >= "1.6.1" and is_apple_os(self.settings.os) + return Version(self.version) >= "1.6.1" and is_apple_os(self) @property def _can_auto_ssl(self): @@ -77,7 +78,7 @@ def _can_auto_ssl(self): return not self._uses_old_cmake_options and not ( # https://github.com/libcpr/cpr/issues/546 Version(self.version) in ["1.6.0", "1.6.1"] - and is_apple_os(self.settings.os) + and is_apple_os(self) ) @property @@ -122,7 +123,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libcurl/7.87.0") + self.requires("libcurl/7.87.0", transitive_headers=True, transitive_libs=True) # Check if the system supports the given ssl library def _supports_ssl_library(self, library): @@ -142,7 +143,7 @@ def _supports_ssl_library(self, library): return validators[library] def validate(self): - if self.settings.compiler.cppstd: + 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: @@ -168,12 +169,12 @@ def validate(self): else f"Invalid value of ssl option, {ssl_library}" ) - if ssl_library not in (CprConan._AUTO_SSL, CprConan._NO_SSL, "winssl") and ssl_library != self.options["libcurl"].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.options["libcurl"].with_ssl != "schannel": + 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" ) @@ -185,8 +186,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < 6") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def _get_cmake_option(self, option): CPR_1_6_CMAKE_OPTIONS_TO_OLD = { diff --git a/recipes/cryptopp/all/conanfile.py b/recipes/cryptopp/all/conanfile.py index dd7d5c2edad76..376aada489aac 100644 --- a/recipes/cryptopp/all/conanfile.py +++ b/recipes/cryptopp/all/conanfile.py @@ -177,7 +177,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "cryptopp") self.cpp_info.set_property("cmake_target_name", "cryptopp::cryptopp") legacy_cmake_target = "cryptopp-shared" if self.options.shared else "cryptopp-static" - self.cpp_info.set_property("cmake_target_name_aliases", [legacy_cmake_target]) + self.cpp_info.set_property("cmake_target_aliases", [legacy_cmake_target]) self.cpp_info.set_property("pkg_config_name", "libcryptopp") # TODO: back to global scope once cmake_find_package* generators removed diff --git a/recipes/cxxopts/all/conandata.yml b/recipes/cxxopts/all/conandata.yml index 80d718f14d1a0..ed4fef59dd9bc 100644 --- a/recipes/cxxopts/all/conandata.yml +++ b/recipes/cxxopts/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.1": + url: "https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.1.1.tar.gz" + sha256: "523175f792eb0ff04f9e653c90746c12655f10cb70f1d5e6d6d9491420298a08" "3.0.0": url: "https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.0.0.tar.gz" sha256: "36f41fa2a46b3c1466613b63f3fa73dc24d912bc90d667147f1e43215a8c6d00" @@ -8,6 +11,3 @@ sources: "2.2.0": url: "https://github.com/jarro2783/cxxopts/archive/refs/tags/v2.2.0.tar.gz" sha256: "447dbfc2361fce9742c5d1c9cfb25731c977b405f9085a738fbd608626da8a4d" - "1.4.4": - url: "https://github.com/jarro2783/cxxopts/archive/refs/tags/v1.4.4.tar.gz" - sha256: "1d0eedb39ecbc64a0f82d8b6fe40d5c8e611501702969cfbd14a07ce6ddb8501" diff --git a/recipes/cxxopts/all/conanfile.py b/recipes/cxxopts/all/conanfile.py index bd4038d2213ad..03ec452dcf0b8 100644 --- a/recipes/cxxopts/all/conanfile.py +++ b/recipes/cxxopts/all/conanfile.py @@ -3,7 +3,6 @@ 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.51.1" @@ -34,6 +33,7 @@ def _min_cppstd(self): def _minimum_compilers_version(self): return { "Visual Studio": "14", + "msvc": "190", "gcc": "4.9", "clang": "3.9", "apple-clang": "8", @@ -44,7 +44,7 @@ def layout(self): def requirements(self): if self.options.unicode: - self.requires("icu/71.1") + self.requires("icu/72.1") def package_id(self): self.info.clear() @@ -52,15 +52,21 @@ def package_id(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) - min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - if min_version and Version(self.settings.compiler.version) < min_version: + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(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], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass diff --git a/recipes/cxxopts/all/test_package/CMakeLists.txt b/recipes/cxxopts/all/test_package/CMakeLists.txt index 9ceb2f747d84e..00a1aead37e8f 100644 --- a/recipes/cxxopts/all/test_package/CMakeLists.txt +++ b/recipes/cxxopts/all/test_package/CMakeLists.txt @@ -9,6 +9,10 @@ add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE cxxopts::cxxopts) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(cxxopts_VERSION VERSION_LESS "3.1.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE CXXOPTS_OLD_EXCEPTIONS) +endif() + add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME} -f 41 --bar baria --baz) if(WITH_UNICODE) # This will fail if it was not enabled in the package https://github.com/jarro2783/cxxopts#unrecognised-arguments diff --git a/recipes/cxxopts/all/test_package/test_package.cpp b/recipes/cxxopts/all/test_package/test_package.cpp index b70cd83b77455..df1a81785c0ff 100644 --- a/recipes/cxxopts/all/test_package/test_package.cpp +++ b/recipes/cxxopts/all/test_package/test_package.cpp @@ -47,10 +47,18 @@ int main(int argc, char* argv[]) std::cout << "qux:" << result["qux"].as() << std::endl; } #endif - } catch (const cxxopts::OptionException& e) { + } + #ifdef CXXOPTS_OLD_EXCEPTIONS + catch (const cxxopts::OptionException& e) { + std::cout << "error parsing options: " << e.what() << std::endl; + return 1; + } + #else + catch (const cxxopts::exceptions::exception& e) { std::cout << "error parsing options: " << e.what() << std::endl; return 1; } + #endif return 0; } diff --git a/recipes/cxxopts/config.yml b/recipes/cxxopts/config.yml index 69689683a4346..60f4de8e82260 100644 --- a/recipes/cxxopts/config.yml +++ b/recipes/cxxopts/config.yml @@ -1,9 +1,9 @@ versions: + "3.1.1": + folder: all "3.0.0": folder: all "2.2.1": folder: all "2.2.0": folder: all - "1.4.4": - folder: all diff --git a/recipes/date/all/conandata.yml b/recipes/date/all/conandata.yml index 5d465add42677..bed2d768a8963 100644 --- a/recipes/date/all/conandata.yml +++ b/recipes/date/all/conandata.yml @@ -1,14 +1,22 @@ sources: - "2.4.1": - sha256: "98907d243397483bd7ad889bf6c66746db0d7d2a39cc9aacc041834c40b65b98" - url: "https://github.com/HowardHinnant/date/archive/v2.4.1.tar.gz" - "3.0.0": - sha256: "87bba2eaf0ebc7ec539e5e62fc317cb80671a337c1fb1b84cb9e4d42c6dbebe3" - url: "https://github.com/HowardHinnant/date/archive/v3.0.0.tar.gz" "3.0.1": + url: "https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.1.tar.gz" sha256: "7a390f200f0ccd207e8cff6757e04817c1a0aec3e327b006b7eb451c57ee3538" - url: "https://github.com/HowardHinnant/date/archive/v3.0.1.tar.gz" + "3.0.0": + url: "https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.0.tar.gz" + sha256: "87bba2eaf0ebc7ec539e5e62fc317cb80671a337c1fb1b84cb9e4d42c6dbebe3" + "2.4.1": + url: "https://github.com/HowardHinnant/date/archive/refs/tags/v2.4.1.tar.gz" + sha256: "98907d243397483bd7ad889bf6c66746db0d7d2a39cc9aacc041834c40b65b98" patches: + "3.0.1": + - patch_file: "patches/cmake-3.0.1.patch" + patch_description: "Disable string view to workaround clang 5 not having it" + patch_type: "portability" + "3.0.0": + - patch_file: "patches/cmake-3.0.0.patch" + patch_description: "Disable string view to workaround clang 5 not having it" + patch_type: "portability" "2.4.1": - patch_file: "patches/0001-fix-uwp.patch" patch_description: "Fix Universal Windows Platform (UWP) unhandled exception support. See https://github.com/microsoft/vcpkg/pull/8151#issuecomment-531175393." @@ -19,11 +27,3 @@ patches: - patch_file: "patches/string_view.patch" patch_description: "Disable string view to workaround clang 5 not having it" patch_type: "portability" - "3.0.0": - - patch_file: "patches/cmake-3.0.0.patch" - patch_description: "Disable string view to workaround clang 5 not having it" - patch_type: "portability" - "3.0.1": - - patch_file: "patches/cmake-3.0.1.patch" - patch_description: "Disable string view to workaround clang 5 not having it" - patch_type: "portability" diff --git a/recipes/date/all/conanfile.py b/recipes/date/all/conanfile.py index 0114595ddce02..0e4dca5af89da 100644 --- a/recipes/date/all/conanfile.py +++ b/recipes/date/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile +from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import get, rmdir, apply_conandata_patches, export_conandata_patches, copy -from conan.tools.build import check_min_cppstd from conan.tools.scm import Version import os @@ -14,8 +14,7 @@ class DateConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/HowardHinnant/date" description = "A date and time library based on the C++11/14/17 header" - topics = ("date", "datetime", "timezone", - "calendar", "time", "iana-database") + topics = ("datetime", "timezone", "calendar", "time", "iana-database") license = "MIT" settings = "os", "arch", "compiler", "build_type" @@ -44,29 +43,29 @@ def config_options(self): self.options.use_system_tz_db = True def configure(self): - if self.options.shared: - del self.options.fPIC + if self.options.shared or self.options.header_only: + self.options.rm_safe("fPIC") if self.options.header_only: del self.options.shared + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): if not self.options.header_only and not self.options.use_system_tz_db: - self.requires("libcurl/7.78.0") - - def validate(self): - if self.settings.compiler.cppstd: - check_min_cppstd(self, 11) + self.requires("libcurl/7.88.1") def package_id(self): if self.info.options.header_only: 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 layout(self): - cmake_layout(self, src_folder="src") - def generate(self): tc = CMakeToolchain(self) tc.variables["ENABLE_DATE_TESTING"] = False @@ -82,7 +81,6 @@ def generate(self): deps = CMakeDeps(self) deps.generate() - def build(self): apply_conandata_patches(self) if not self.options.header_only: diff --git a/recipes/date/all/test_package/CMakeLists.txt b/recipes/date/all/test_package/CMakeLists.txt index 50d2a69300bc2..276e986aaf0a2 100644 --- a/recipes/date/all/test_package/CMakeLists.txt +++ b/recipes/date/all/test_package/CMakeLists.txt @@ -1,11 +1,11 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -find_package(date REQUIRED) +find_package(date REQUIRED CONFIG) -add_executable(${PROJECT_NAME} src/test_package.cpp) -target_link_libraries(${PROJECT_NAME} date::date) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE date::date) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) if(DATE_HEADER_ONLY) - target_compile_definitions(${PROJECT_NAME} PRIVATE DATE_HEADER_ONLY) + target_compile_definitions(${PROJECT_NAME} PRIVATE DATE_HEADER_ONLY) endif() diff --git a/recipes/date/all/test_package/conanfile.py b/recipes/date/all/test_package/conanfile.py index c42e6bff2267a..d75ac2f1b24f1 100644 --- a/recipes/date/all/test_package/conanfile.py +++ b/recipes/date/all/test_package/conanfile.py @@ -1,18 +1,17 @@ -import os - from conan import ConanFile +from conan.tools.build import can_run from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.build import cross_building +import os -class FooTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - # VirtualBuildEnv and VirtualRunEnv can be avoided if "tools.env.virtualenv:auto_use" is defined - # (it will be defined in Conan 2.0) +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "VirtualRunEnv" - apply_env = False test_type = "explicit" + def layout(self): + cmake_layout(self) + def requirements(self): self.requires(self.tested_reference_str) @@ -26,10 +25,7 @@ def build(self): cmake.configure() cmake.build() - def layout(self): - cmake_layout(self) - def test(self): - if not cross_building(self): - cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(cmd, env="conanrun") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/date/all/test_package/src/test_package.cpp b/recipes/date/all/test_package/test_package.cpp similarity index 100% rename from recipes/date/all/test_package/src/test_package.cpp rename to recipes/date/all/test_package/test_package.cpp diff --git a/recipes/date/all/test_v1_package/conanfile.py b/recipes/date/all/test_v1_package/conanfile.py index d8cd3583b838d..09dc5f4a353ed 100644 --- a/recipes/date/all/test_v1_package/conanfile.py +++ b/recipes/date/all/test_v1_package/conanfile.py @@ -3,8 +3,8 @@ class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) @@ -13,6 +13,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): + 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/date/config.yml b/recipes/date/config.yml index 8da6f34991031..f4831f05aaf9e 100644 --- a/recipes/date/config.yml +++ b/recipes/date/config.yml @@ -1,8 +1,7 @@ ---- versions: - "2.4.1": + "3.0.1": folder: all "3.0.0": folder: all - "3.0.1": + "2.4.1": folder: all diff --git a/recipes/daw_header_libraries/all/conanfile.py b/recipes/daw_header_libraries/all/conanfile.py index 81865adfe60e7..b6840ea09fa55 100644 --- a/recipes/daw_header_libraries/all/conanfile.py +++ b/recipes/daw_header_libraries/all/conanfile.py @@ -1,14 +1,15 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, copy from conan.tools.build import check_min_cppstd -from conan.tools.scm import Version +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.50.0" + class DawHeaderLibrariesConan(ConanFile): name = "daw_header_libraries" description = "Various header libraries mostly future std lib, replacements for(e.g. visit), or some misc" @@ -16,11 +17,16 @@ class DawHeaderLibrariesConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/beached/header_libraries" topics = ("algorithms", "helpers", "data-structures") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _compiler_required_cpp17(self): + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): return { "Visual Studio": "16", "msvc": "192", @@ -37,17 +43,16 @@ def package_id(self): def validate(self): if self.settings.get_safe("compiler.cppstd"): - check_min_cppstd(self, "17") + check_min_cppstd(self, self._min_cppstd) - minimum_version = self._compiler_required_cpp17.get(str(self.settings.compiler), False) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: - raise ConanInvalidConfiguration(f"{self.ref} requires C++17, which your compiler does not support.") - else: - self.output.warn(f"{self.ref} requires C++17. Your compiler is unknown. Assuming it supports C++17.") + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass @@ -62,7 +67,6 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "daw-header-libraries") self.cpp_info.set_property("cmake_target_name", "daw::daw-header-libraries") - self.cpp_info.components["daw"].set_property("cmake_target_name", "daw::daw-header-libraries") # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "daw-header-libraries" @@ -71,3 +75,4 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "daw" self.cpp_info.components["daw"].names["cmake_find_package"] = "daw-header-libraries" self.cpp_info.components["daw"].names["cmake_find_package_multi"] = "daw-header-libraries" + self.cpp_info.components["daw"].set_property("cmake_target_name", "daw::daw-header-libraries") diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py index eac8625ebd775..00b0dc44a35ef 100644 --- a/recipes/dbus/1.x.x/conanfile.py +++ b/recipes/dbus/1.x.x/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import is_apple_os +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os from conan.tools.cmake import CMake, cmake_layout, CMakeDeps, CMakeToolchain from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, rm, rmdir, save @@ -21,6 +21,7 @@ class DbusConan(ConanFile): homepage = "https://www.freedesktop.org/wiki/Software/dbus" description = "D-Bus is a simple system for interprocess communication and coordination." topics = "bus", "interprocess", "message" + package_type = "shared-library" settings = "os", "arch", "compiler", "build_type" short_paths = True options = { @@ -65,15 +66,10 @@ def layout(self): else: cmake_layout(self, src_folder="src") - def build_requirements(self): - if self._meson_available: - self.tool_requires("meson/1.0.0") - self.tool_requires("pkgconf/1.9.3") - def requirements(self): self.requires("expat/2.5.0") if self.options.with_glib: - self.requires("glib/2.75.2") + self.requires("glib/2.76.0") if self.options.get_safe("with_systemd"): self.requires("libsystemd/252.4") if self.options.with_selinux: @@ -83,17 +79,25 @@ def requirements(self): def validate(self): if Version(self.version) >= "1.14.0": - if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < 7: + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 7: raise ConanInvalidConfiguration(f"{self.ref} requires at least gcc 7.") - if not self._meson_available and self.info.settings.os == "Windows": + if not self._meson_available and self.settings.os == "Windows": raise ConanInvalidConfiguration(f"{self.ref} does not support Windows. Contributions welcome.") + def build_requirements(self): + if self._meson_available: + self.tool_requires("meson/1.0.0") + if self._meson_available or self.options.get_safe("with_systemd"): + if not self.conf.get("tools.gnu:pkg_config",check_type=str): + self.tool_requires("pkgconf/1.9.3") + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + env = VirtualBuildEnv(self) + env.generate() if self._meson_available: tc = MesonToolchain(self) tc.project_options["asserts"] = not is_apple_os(self) @@ -111,8 +115,8 @@ def generate(self): tc.project_options["x11_autolaunch"] = "enabled" if self.options.get_safe("with_x11", False) else "disabled" tc.project_options["xml_docs"] = "disabled" tc.generate() - env = VirtualBuildEnv(self) - env.generate(scope="build") + deps = PkgConfigDeps(self) + deps.generate() else: tc = CMakeToolchain(self) tc.variables["DBUS_BUILD_TESTS"] = False @@ -135,8 +139,9 @@ def generate(self): tc.generate() cmake_deps = CMakeDeps(self) cmake_deps.generate() - pkg_config_deps = PkgConfigDeps(self) - pkg_config_deps.generate() + if self.options.get_safe("with_systemd"): + deps = PkgConfigDeps(self) + deps.generate() def build(self): apply_conandata_patches(self) @@ -170,6 +175,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, "lib", "systemd")) + fix_apple_shared_install_name(self) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self._create_cmake_module_alias_targets( diff --git a/recipes/dbus/1.x.x/test_package/conanfile.py b/recipes/dbus/1.x.x/test_package/conanfile.py index 3cb242daa016f..da65c0176861b 100644 --- a/recipes/dbus/1.x.x/test_package/conanfile.py +++ b/recipes/dbus/1.x.x/test_package/conanfile.py @@ -13,7 +13,7 @@ def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str) + self.requires(self.tested_reference_str, run=True) def build(self): cmake = CMake(self) diff --git a/recipes/dcmtk/all/conandata.yml b/recipes/dcmtk/all/conandata.yml index 3d3f43928861f..7e3e0a0cc6e01 100644 --- a/recipes/dcmtk/all/conandata.yml +++ b/recipes/dcmtk/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.6.7": + url: "https://dicom.offis.de/download/dcmtk/dcmtk367/dcmtk-3.6.7.tar.gz" + sha256: "7c58298e3e8d60232ee6fc8408cfadd14463cc11a3c4ca4c59af5988c7e9710a" "3.6.6": url: "https://dicom.offis.de/download/dcmtk/dcmtk366/dcmtk-3.6.6.tar.gz" sha256: "6859c62b290ee55677093cccfd6029c04186d91cf99c7642ae43627387f3458e" @@ -6,9 +9,18 @@ sources: url: "https://dicom.offis.de/download/dcmtk/dcmtk365/dcmtk-3.6.5.tar.gz" sha256: "a05178665f21896dbb0974106dba1ad144975414abd760b4cf8f5cc979f9beb9" patches: + "3.6.7": + - patch_file: "patches/cmake-patching-3-6-7.patch" + base_path: "source_subfolder" + patch_type: conan + patch_description: "Don't ignore dependencies that can't be found; patch some variable names" "3.6.6": - patch_file: "patches/0002-cmake-use-conan-packages.patch" base_path: "source_subfolder" + patch_type: conan + patch_description: "Don't ignore dependencies that can't be found; patch some variable names" "3.6.5": - patch_file: "patches/0001-cmake-use-conan-packages.patch" base_path: "source_subfolder" + patch_type: conan + patch_description: "Don't ignore dependencies that can't be found; patch some variable names" diff --git a/recipes/dcmtk/all/conanfile.py b/recipes/dcmtk/all/conanfile.py index 9b544546330a2..286fb28a07048 100644 --- a/recipes/dcmtk/all/conanfile.py +++ b/recipes/dcmtk/all/conanfile.py @@ -3,7 +3,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, save -from conan.tools.microsoft import msvc_runtime_flag +from conan.tools.microsoft import is_msvc, msvc_runtime_flag from conan.tools.scm import Version import functools import os @@ -18,7 +18,7 @@ class DCMTKConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://dicom.offis.de/dcmtk" license = "BSD-3-Clause" - topics = ("dcmtk", "dicom", "image") + topics = ("dicom", "image") settings = "os", "arch", "compiler", "build_type" options = { @@ -68,42 +68,38 @@ def _source_subfolder(self): def _build_subfolder(self): return "build_subfolder" - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - def export_sources(self): self.copy("CMakeLists.txt") export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC - del self.options.with_tcpwrappers + self.options.rm_safe("fPIC") + self.options.rm_safe("with_tcpwrappers") def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def requirements(self): if self.options.charset_conversion == "libiconv": - self.requires("libiconv/1.16") + self.requires("libiconv/1.17") elif self.options.charset_conversion == "icu": - self.requires("icu/71.1") + self.requires("icu/72.1") if self.options.with_libxml2: - self.requires("libxml2/2.9.13") + self.requires("libxml2/2.10.3") if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/1.2.13") if self.options.with_openssl: if self.settings.os == "Windows": # FIXME: CMake configuration fails to detect Openssl 1.1 on Windows. self.requires("openssl/1.0.2u") else: - self.requires("openssl/1.1.1n") + self.requires("openssl/1.1.1t") if self.options.with_libpng: - self.requires("libpng/1.6.37") + self.requires("libpng/1.6.39") if self.options.with_libtiff: - self.requires("libtiff/4.3.0") + self.requires("libtiff/4.4.0") if self.options.get_safe("with_tcpwrappers"): self.requires("tcp-wrappers/7.6") @@ -162,7 +158,10 @@ def _configure_cmake(self): cmake.definitions["DCMTK_ENABLE_PRIVATE_TAGS"] = self.options.builtin_private_tags if self.options.external_dictionary is not None: - cmake.definitions["DCMTK_ENABLE_EXTERNAL_DICTIONARY"] = self.options.external_dictionary + if Version(self.version) < "3.6.7": + cmake.definitions["DCMTK_ENABLE_EXTERNAL_DICTIONARY"] = self.options.external_dictionary + else: + cmake.definitions["DCMTK_DEFAULT_DICT"] = self.options.external_dictionary if self.options.builtin_dictionary is not None: cmake.definitions["DCMTK_ENABLE_BUILTIN_DICTIONARY"] = self.options.builtin_dictionary cmake.definitions["DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS"] = self.options.wide_io @@ -171,7 +170,7 @@ def _configure_cmake(self): if self.settings.os == "Windows": cmake.definitions["DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS"] = False - if self._is_msvc: + if is_msvc(self): cmake.definitions["DCMTK_ICONV_FLAGS_ANALYZED"] = True cmake.definitions["DCMTK_COMPILE_WIN32_MULTITHREADED_DLL"] = "MD" in msvc_runtime_flag(self) @@ -191,6 +190,7 @@ def package(self): 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")) rmdir(self, os.path.join(self.package_folder, "etc")) rmdir(self, os.path.join(self.package_folder, "share")) diff --git a/recipes/dcmtk/all/patches/cmake-patching-3-6-7.patch b/recipes/dcmtk/all/patches/cmake-patching-3-6-7.patch new file mode 100644 index 0000000000000..b10d0378042ba --- /dev/null +++ b/recipes/dcmtk/all/patches/cmake-patching-3-6-7.patch @@ -0,0 +1,216 @@ +--- CMake/3rdparty.cmake ++++ CMake/3rdparty.cmake +@@ -21,7 +21,7 @@ mark_as_advanced(DCMTK_USE_FIND_PACKAGE) + if(DCMTK_USE_FIND_PACKAGE) + # Find TIFF + if(DCMTK_WITH_TIFF) +- find_package(TIFF QUIET) ++ find_package(TIFF REQUIRED) + # turn off library if it could not be found + if(NOT TIFF_FOUND) + message(STATUS "Warning: TIFF support will be disabled because libtiff was not found.") +@@ -30,21 +30,21 @@ if(DCMTK_USE_FIND_PACKAGE) + else() + set(WITH_LIBTIFF 1) + # libtiff can be compiled with libjpeg support; if available, add libjpeg to library and include path +- find_package(JPEG QUIET) ++ find_package(JPEG REQUIRED) + if(NOT JPEG_FOUND) + message(STATUS "Info: DCMTK TIFF support will be enabled (but without JPEG)") +- include_directories(${TIFF_INCLUDE_DIR}) ++ include_directories(${TIFF_INCLUDE_DIRS}) + else() + message(STATUS "Info: DCMTK TIFF support will be enabled") +- include_directories(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR}) ++ include_directories(${TIFF_INCLUDE_DIRS} ${JPEG_INCLUDE_DIRS}) + endif() +- set(LIBTIFF_LIBS ${TIFF_LIBRARY} ${TIFF_EXTRA_LIBS_STATIC} ${JPEG_LIBRARY}) ++ set(LIBTIFF_LIBS ${TIFF_LIBRARIES} ${JPEG_LIBRARIES}) + endif() + endif() + + # Find PNG + if(DCMTK_WITH_PNG) +- find_package(PNG QUIET) ++ find_package(PNG REQUIRED) + if(NOT PNG_FOUND) + set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE) + message(STATUS "Warning: PNG support will be disabled because libpng was not found.") +@@ -53,13 +53,13 @@ if(DCMTK_USE_FIND_PACKAGE) + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + include_directories(${PNG_INCLUDE_DIR}) +- set(LIBPNG_LIBS ${PNG_LIBRARY}) ++ set(LIBPNG_LIBS ${PNG_LIBRARIES}) + endif() + endif() + + # Find OpenSSL + if(DCMTK_WITH_OPENSSL) +- find_package(OpenSSL QUIET) ++ find_package(OpenSSL REQUIRED) + if(NOT OPENSSL_FOUND) + message(STATUS "Warning: OPENSSL support will be disabled because openssl was not found.") + set(WITH_OPENSSL "") +@@ -90,7 +90,7 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find libXML2 + if(DCMTK_WITH_XML) +- find_package(LibXml2 QUIET) ++ find_package(LibXml2 REQUIRED) + if(NOT LIBXML2_FOUND) + message(STATUS "Warning: XML support will be disabled because libxml2 was not found.") + set(WITH_LIBXML "") +@@ -105,7 +105,7 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find zlib + if(DCMTK_WITH_ZLIB) +- find_package(ZLIB QUIET) ++ find_package(ZLIB REQUIRED) + if(NOT ZLIB_FOUND) + message(STATUS "Warning: ZLIB support will be disabled because zlib was not found.") + set(WITH_ZLIB "") +@@ -120,7 +120,7 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find libsndfile + if(DCMTK_WITH_SNDFILE) +- find_package(SNDFILE QUIET) ++ find_package(SNDFILE REQUIRED) + if(NOT SNDFILE_LIBS) + message(STATUS "Warning: SNDFILE support will be disabled because libsndfile was not found.") + set(WITH_SNDFILE "") +@@ -135,9 +135,9 @@ if(DCMTK_USE_FIND_PACKAGE) + + # Find libiconv + if(DCMTK_WITH_ICONV) +- find_package(Iconv QUIET) +- find_package(LIBCHARSET QUIET) +- if(ICONV_FOUND) ++ find_package(Iconv REQUIRED) ++ find_package(LIBCHARSET REQUIRED) ++ if(Iconv_FOUND) + if(NOT Iconv_IS_BUILT_IN) + set(LIBICONV_FOUND ${ICONV_FOUND}) + else() +@@ -158,7 +158,7 @@ if(DCMTK_USE_FIND_PACKAGE) + set(WITH_LIBICONV 1) + set(LIBICONV_INCDIR ${LIBICONV_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${ICONV_INCLUDE_DIR} ${LIBCHARSET_INCLUDE_DIRS}) + set(LIBICONV_LIBDIR ${LIBICONV_LIBDIR}) +- set(LIBICONV_LIBS ${LIBICONV_LIBRARIES} ${Iconv_LIBRARIES} ${ICONV_LIBRARIES} ${LIBCHARSET_LIBRARY}) ++ set(LIBICONV_LIBS Iconv::Iconv) + include_directories(${LIBICONV_INCDIR}) + endif() + endif() +@@ -241,13 +241,15 @@ else() + # libxml support: configure compiler + if(DCMTK_WITH_XML) + if(WITH_LIBXMLINC) +- set(LIBXML_INCDIR "${WITH_LIBXMLINC}/include") +- set(LIBXML_LIBDIR "${WITH_LIBXMLINC}/lib") +- set(LIBXML_LIBS debug "${LIBXML_LIBDIR}/libxml2_d.lib" optimized "${LIBXML_LIBDIR}/libxml2_o.lib" debug "${LIBXML_LIBDIR}/iconv_d.lib" optimized "${LIBXML_LIBDIR}/iconv_o.lib") ++ set(LIBXML_INCDIR ${CONAN_INCLUDE_DIRS_LIBXML2} ${CONAN_INCLUDE_DIRS_ICONV}) ++ link_directories(${WITH_LIBXMLINC}/lib) ++ set(LIBXML_LIBS ${CONAN_LIBS_LIBXML2}) + message(STATUS "Info: DCMTK XML support will be enabled") + set(WITH_LIBXML 1) ++ if(NOT WITH_LIBXML_SHARED) + # this hides some warnings that are emitted when linking against libxmlXXX.lib instead of linking the DLL directly + add_definitions("-DLIBXML_STATIC") ++ endif() + else() # turn off library if library path not set + message(STATUS "Warning: XML support will be disabled because libxml2 directory is not specified. Correct path and re-enable DCMTK_WITH_XML.") + set(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE) +@@ -259,8 +261,8 @@ else() + if(DCMTK_WITH_PNG) + if(WITH_LIBPNGINC) + set(LIBPNG_INCDIR "${WITH_LIBPNGINC}/include") +- set(LIBPNG_LIBDIR "${WITH_LIBPNGINC}/lib") +- set(LIBPNG_LIBS debug "${LIBPNG_LIBDIR}/libpng_d.lib" optimized "${LIBPNG_LIBDIR}/libpng_o.lib") ++ link_directories(${WITH_LIBPNGINC}/lib) ++ set(LIBPNG_LIBS CONAN_PKG::libpng) + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + else() # turn off library if library path not set +@@ -274,8 +276,8 @@ else() + if(DCMTK_WITH_TIFF) + if(WITH_LIBTIFFINC) + set(LIBTIFF_INCDIR "${WITH_LIBTIFFINC}/include") +- set(LIBTIFF_LIBDIR "${WITH_LIBTIFFINC}/lib") +- set(LIBTIFF_LIBS debug "${LIBTIFF_LIBDIR}/libtiff_d.lib" optimized "${LIBTIFF_LIBDIR}/libtiff_o.lib") ++ link_directories(${WITH_LIBTIFFINC}/lib) ++ set(LIBTIFF_LIBS CONAN_PKG::libtiff) + message(STATUS "Info: DCMTK TIFF support will be enabled") + set(WITH_LIBTIFF 1) + else() # turn off library if library path not set +@@ -291,9 +293,9 @@ else() + include(CheckCXXSourceCompiles) + set(OPENSSL_BINDIR "${WITH_OPENSSLINC}/bin") + set(OPENSSL_INCDIR "${WITH_OPENSSLINC}/include") +- set(OPENSSL_LIBDIR "${WITH_OPENSSLINC}/lib") ++ link_directories(${WITH_OPENSSLINC}/lib) + # starting with OpenSSL 1.1.0, the Windows crypt32 library is needed for a static link of OpenSSL. +- set(OPENSSL_LIBS "crypt32" debug "${OPENSSL_LIBDIR}/dcmtkssl_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkssl_o.lib" debug "${OPENSSL_LIBDIR}/dcmtkcrypto_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkcrypto_o.lib") ++ set(OPENSSL_LIBS ${CONAN_LIBS_OPENSSL}) + set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") + list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}") + CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK) +@@ -317,8 +319,8 @@ else() + if(DCMTK_WITH_ZLIB) + if(WITH_ZLIBINC) + set(ZLIB_INCDIR "${WITH_ZLIBINC}/include") +- set(ZLIB_LIBDIR "${WITH_ZLIBINC}/lib") +- set(ZLIB_LIBS debug "${ZLIB_LIBDIR}/zlib_d.lib" optimized "${ZLIB_LIBDIR}/zlib_o.lib") ++ link_directories(${WITH_ZLIBINC}/lib) ++ set(ZLIB_LIBS CONAN_PKG::zlib) + message(STATUS "Info: DCMTK ZLIB support will be enabled") + set(WITH_ZLIB 1) + else() # turn off library if library path not set +@@ -332,8 +334,8 @@ else() + if(DCMTK_WITH_SNDFILE) + if(WITH_SNDFILEINC) + set(SNDFILE_INCDIR "${WITH_SNDFILEINC}/include") +- set(SNDFILE_LIBDIR "${WITH_SNDFILEINC}/lib") +- set(SNDFILE_LIBS debug "${SNDFILE_LIBDIR}/libsndfile_d.lib" optimized "${SNDFILE_LIBDIR}/libsndfile_o.lib") ++ link_directories(${WITH_SNDFILEINC}/lib) ++ set(SNDFILE_LIBS CONAN_PKG::libsndfile) + message(STATUS "Info: DCMTK SNDFILE support will be enabled") + set(WITH_SNDFILE 1) + else() # turn off library if library path not set +@@ -347,8 +349,8 @@ else() + if(DCMTK_WITH_ICONV) + if(WITH_LIBICONVINC) + set(LIBICONV_INCDIR "${WITH_LIBICONVINC}/include") +- set(LIBICONV_LIBDIR "${WITH_LIBICONVINC}/lib") +- set(LIBICONV_LIBS debug "${LIBICONV_LIBDIR}/libiconv_d.lib" optimized "${LIBICONV_LIBDIR}/libiconv_o.lib") ++ link_directories(${WITH_LIBICONVINC}/lib) ++ set(LIBICONV_LIBS CONAN_PKG::libiconv) + message(STATUS "Info: DCMTK ICONV support will be enabled") + set(WITH_LIBICONV 1) + else() # turn off library if library path not set +@@ -371,7 +373,7 @@ else() + else() + set(OPENJPEG_INCDIR "${WITH_OPENJPEGINC1}") + set(OPENJPEG_LIBDIR "${WITH_OPENJPEGINC}/lib") +- set(OPENJPEG_LIBS debug "${OPENJPEG_LIBDIR}/openjp2_d.lib" optimized "${OPENJPEG_LIBDIR}/openjp2_o.lib") ++ set(OPENJPEG_LIBS CONAN_PKG::openjpeg) + message(STATUS "Info: DCMTK OpenJPEG support will be enabled") + set(WITH_OPENJPEG 1) + endif() +@@ -395,7 +397,7 @@ if(NOT DEFINED DCMTK_WITH_STDLIBC_ICONV) + endif() + + if(DCMTK_WITH_ICU) +- find_package(ICU COMPONENTS uc data QUIET) ++ find_package(ICU COMPONENTS uc data REQUIRED) + if(NOT ICU_FOUND) + message(STATUS "Warning: ICU support will be disabled because the ICU were not found.") + set(DCMTK_WITH_ICU OFF CACHE BOOL "" FORCE) +@@ -411,7 +413,7 @@ endif() + + # Find doxygen + if(DCMTK_WITH_DOXYGEN) +- find_package(Doxygen QUIET) # will set variable DOXYGEN_EXECUTABLE ++ find_package(Doxygen REQUIRED) # will set variable DOXYGEN_EXECUTABLE + if(NOT DOXYGEN_FOUND) + message(STATUS "Warning: DOXYGEN support will be disabled because doxygen was not found.") + set(DCMTK_WITH_DOXYGEN OFF CACHE BOOL "" FORCE) diff --git a/recipes/dcmtk/config.yml b/recipes/dcmtk/config.yml index ebad15c840829..81e7bce3c7d99 100644 --- a/recipes/dcmtk/config.yml +++ b/recipes/dcmtk/config.yml @@ -1,4 +1,6 @@ versions: + "3.6.7": + folder: "all" "3.6.6": folder: "all" "3.6.5": diff --git a/recipes/doctest/2.x.x/conandata.yml b/recipes/doctest/2.x.x/conandata.yml index e3e67654dc467..a4d97597a8a18 100644 --- a/recipes/doctest/2.x.x/conandata.yml +++ b/recipes/doctest/2.x.x/conandata.yml @@ -35,3 +35,6 @@ sources: "2.4.9": url: "https://github.com/doctest/doctest/archive/v2.4.9.tar.gz" sha256: "19b2df757f2f3703a5e63cee553d85596875f06d91a3333acd80a969ef210856" + "2.4.10": + url: "https://github.com/doctest/doctest/archive/v2.4.10.tar.gz" + sha256: "d23213c415152d7aa4de99bb7c817fa29c0c03bd1a89972748579a7217fdbb8f" diff --git a/recipes/doctest/config.yml b/recipes/doctest/config.yml index 61380be849cb7..a84e18b5ef7bd 100644 --- a/recipes/doctest/config.yml +++ b/recipes/doctest/config.yml @@ -23,3 +23,5 @@ versions: folder: 2.x.x "2.4.9": folder: 2.x.x + "2.4.10": + folder: 2.x.x diff --git a/recipes/drflac/all/conanfile.py b/recipes/drflac/all/conanfile.py index ae9f5ee425002..99eec44380473 100644 --- a/recipes/drflac/all/conanfile.py +++ b/recipes/drflac/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.53.0" class DrflacConan(ConanFile): @@ -14,26 +14,27 @@ class DrflacConan(ConanFile): topics = ("audio", "flac", "sound") license = ("Unlicense", "MIT-0") url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { - "shared": [True, False], + "shared": [True, False], "fPIC": [True, False], "buffer_size": ["ANY"], "no_crc": [True, False], "no_ogg": [True, False], "no_simd": [True, False], "no_stdio": [True, False], - "no_wchar": [True, False] + "no_wchar": [True, False], } default_options = { - "shared": False, + "shared": False, "fPIC": True, "buffer_size": 0, # zero means the default buffer size is used "no_crc": False, "no_ogg": False, "no_simd": False, "no_stdio": False, - "no_wchar": False + "no_wchar": False, } exports_sources = ["CMakeLists.txt", "dr_flac.c"] @@ -45,15 +46,15 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): - cmake_layout(self) + cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -68,7 +69,7 @@ def generate(self): def build(self): cmake = CMake(self) - cmake.configure() + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): @@ -91,4 +92,4 @@ def package_info(self): if self.options.no_stdio: self.cpp_info.defines.append("DR_FLAC_NO_STDIO") if self.options.get_safe("no_wchar", False): - self.cpp_info.defines.append("DR_FLAC_NO_WCHAR") + self.cpp_info.defines.append("DR_FLAC_NO_WCHAR") diff --git a/recipes/drflac/all/test_package/CMakeLists.txt b/recipes/drflac/all/test_package/CMakeLists.txt index f1c86abcb3be6..1db07f8a402a7 100644 --- a/recipes/drflac/all/test_package/CMakeLists.txt +++ b/recipes/drflac/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES C) find_package(drflac CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} drflac::drflac) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) +target_link_libraries(${PROJECT_NAME} PRIVATE drflac::drflac) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/drflac/all/test_package/conanfile.py b/recipes/drflac/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/drflac/all/test_package/conanfile.py +++ b/recipes/drflac/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/drflac/all/test_v1_package/CMakeLists.txt b/recipes/drflac/all/test_v1_package/CMakeLists.txt index d9f4971c6bf0a..0d20897301b68 100644 --- a/recipes/drflac/all/test_v1_package/CMakeLists.txt +++ b/recipes/drflac/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(drflac CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} drflac::drflac) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/drmp3/all/conanfile.py b/recipes/drmp3/all/conanfile.py index e21eeff31877c..5ff9719fea314 100644 --- a/recipes/drmp3/all/conanfile.py +++ b/recipes/drmp3/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.files import copy, get import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.53.0" class Drmp3Conan(ConanFile): @@ -13,38 +13,37 @@ class Drmp3Conan(ConanFile): topics = ("audio", "mp3", "sound") license = ("Unlicense", "MIT-0") url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { - "shared": [True, False], + "shared": [True, False], "fPIC": [True, False], "no_simd": [True, False], - "no_stdio": [True, False] + "no_stdio": [True, False], } default_options = { - "shared": False, + "shared": False, "fPIC": True, "no_simd": False, - "no_stdio": False + "no_stdio": False, } exports_sources = ["CMakeLists.txt", "dr_mp3.c"] - _cmake = None - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): - cmake_layout(self) + cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -55,7 +54,7 @@ def generate(self): def build(self): cmake = CMake(self) - cmake.configure() + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): diff --git a/recipes/drmp3/all/test_package/CMakeLists.txt b/recipes/drmp3/all/test_package/CMakeLists.txt index b5b2e6102e202..d5c1b7eb10c20 100644 --- a/recipes/drmp3/all/test_package/CMakeLists.txt +++ b/recipes/drmp3/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES C) find_package(drmp3 CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} drmp3::drmp3) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) +target_link_libraries(${PROJECT_NAME} PRIVATE drmp3::drmp3) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/drmp3/all/test_package/conanfile.py b/recipes/drmp3/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/drmp3/all/test_package/conanfile.py +++ b/recipes/drmp3/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/drmp3/all/test_v1_package/CMakeLists.txt b/recipes/drmp3/all/test_v1_package/CMakeLists.txt index bfd7908ef1c6f..0d20897301b68 100644 --- a/recipes/drmp3/all/test_v1_package/CMakeLists.txt +++ b/recipes/drmp3/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(drmp3 CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} drmp3::drmp3) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/drwav/all/conanfile.py b/recipes/drwav/all/conanfile.py index 634d49129395e..893c882ec028c 100644 --- a/recipes/drwav/all/conanfile.py +++ b/recipes/drwav/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.files import copy, get import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.53.0" class DrwavConan(ConanFile): @@ -13,20 +13,21 @@ class DrwavConan(ConanFile): topics = ("audio", "wav", "wave", "sound") license = ("Unlicense", "MIT-0") url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { - "shared": [True, False], + "shared": [True, False], "fPIC": [True, False], "no_conversion_api": [True, False], "no_stdio": [True, False], - "no_wchar": [True, False] + "no_wchar": [True, False], } default_options = { - "shared": False, + "shared": False, "fPIC": True, "no_conversion_api": False, "no_stdio": False, - "no_wchar": False + "no_wchar": False, } exports_sources = ["CMakeLists.txt", "dr_wav.c"] @@ -36,15 +37,15 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): - cmake_layout(self) + cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -56,7 +57,7 @@ def generate(self): def build(self): cmake = CMake(self) - cmake.configure() + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): @@ -73,4 +74,4 @@ def package_info(self): if self.options.no_stdio: self.cpp_info.defines.append("DR_WAV_NO_STDIO") if self.options.no_wchar: - self.cpp_info.defines.append("DR_WAV_NO_WCHAR") + self.cpp_info.defines.append("DR_WAV_NO_WCHAR") diff --git a/recipes/drwav/all/test_package/CMakeLists.txt b/recipes/drwav/all/test_package/CMakeLists.txt index 8eb51f5f1843e..6e57f5fb28026 100644 --- a/recipes/drwav/all/test_package/CMakeLists.txt +++ b/recipes/drwav/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES C) find_package(drwav CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} drwav::drwav) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) +target_link_libraries(${PROJECT_NAME} PRIVATE drwav::drwav) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/drwav/all/test_package/conanfile.py b/recipes/drwav/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/drwav/all/test_package/conanfile.py +++ b/recipes/drwav/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/drwav/all/test_v1_package/CMakeLists.txt b/recipes/drwav/all/test_v1_package/CMakeLists.txt index b7b4d6635b758..0d20897301b68 100644 --- a/recipes/drwav/all/test_v1_package/CMakeLists.txt +++ b/recipes/drwav/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(drwav CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} drwav::drwav) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/duckdb/all/conandata.yml b/recipes/duckdb/all/conandata.yml index 3126108b09688..034e9d6c571e6 100644 --- a/recipes/duckdb/all/conandata.yml +++ b/recipes/duckdb/all/conandata.yml @@ -1,15 +1,24 @@ sources: + "0.7.1": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.7.1.tar.gz" + sha256: "67f840f861e5ffbe137d65a8543642d016f900b89dd035492d562ad11acf0e1e" "0.6.1": - url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.6.0.tar.gz" - sha256: "700b09114f8b99892a9d19ba21ca962ae65d1ea8085622418a2fa50ff915b244" + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.6.1.tar.gz" + sha256: "ea9bba89ae3e461f3fc9f83911b2f3b6c386c23463bcf7b1ed6bb4cc13e822a4" "0.6.0": url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.6.0.tar.gz" sha256: "700b09114f8b99892a9d19ba21ca962ae65d1ea8085622418a2fa50ff915b244" "0.5.1": url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.5.1.tar.gz" sha256: "3dab7ba0d0f8d024d3c73fd3d4fb8834203c31d7b0ddb1e8539ee266e11b0e9b" - patches: + "0.7.1": + - patch_file: "patches/0.7.0-0001-fix-cmake.patch" + patch_description: "install static of shared library, add installation for odbc extention" + patch_type: "portability" + - patch_file: "patches/0.6.0-0002-include-stdlib.patch" + patch_description: "include stdlib for abort function" + patch_type: "portability" "0.6.1": - patch_file: "patches/0.6.0-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 994004c113240..e4e20e16d2314 100644 --- a/recipes/duckdb/all/conanfile.py +++ b/recipes/duckdb/all/conanfile.py @@ -16,6 +16,7 @@ class DuckdbConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/cwida/duckdb" topics = ("sql", "database", "olap", "embedded-database") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -58,7 +59,7 @@ class DuckdbConan(ConanFile): short_paths = True @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 11 def export_sources(self): @@ -76,15 +77,15 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - # FIXME: duckdb vendors a bunch of deps by modify the source code to have their own namespace + # FIXME: duckdb vendors a bunch of deps by modify the source code to have their own namespace if self.options.with_odbc: self.requires("odbc/2.3.11") if self.options.with_httpfs: self.requires("openssl/3.0.7") def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, self._minimum_cpp_standard) + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -191,9 +192,7 @@ def package_info(self): self.cpp_info.libs.append("sqlsmith_extension") if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") - self.cpp_info.system_libs.append("dl") - self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.extend(["pthread", "dl", "m"]) if self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/duckdb/all/patches/0.7.0-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.7.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..0ba6b7e472f9a --- /dev/null +++ b/recipes/duckdb/all/patches/0.7.0-0001-fix-cmake.patch @@ -0,0 +1,61 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 99cd46c..3f3d039 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -182,9 +182,18 @@ if(BUILD_PYTHON + endif() + endif() + +-install( +- TARGETS duckdb duckdb_static +- EXPORT "${DUCKDB_EXPORT_SET}" +- LIBRARY DESTINATION "${INSTALL_LIB_DIR}" +- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" +- RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++if(BUILD_SHARED_LIBS) ++ install( ++ 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 8f13cfe..6755894 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -53,6 +53,14 @@ add_library( + 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 WIN32 AND NOT CLANG_TIDY) + add_subdirectory(test) + endif() +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index e785d4f..922746f 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -17,7 +17,7 @@ add_library(sqlite3_api_wrapper_static STATIC ${SQLITE_API_WRAPPER_FILES}) + target_link_libraries(sqlite3_api_wrapper_static duckdb_static duckdb_utf8proc) + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32) ++if(BUILD_SHARED_LIBS AND NOT WIN32) + 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) diff --git a/recipes/duckdb/config.yml b/recipes/duckdb/config.yml index 49d19e4d3a5cb..c1b25ce335aee 100644 --- a/recipes/duckdb/config.yml +++ b/recipes/duckdb/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.1": + folder: "all" "0.6.1": folder: "all" "0.6.0": diff --git a/recipes/elfio/all/conanfile.py b/recipes/elfio/all/conanfile.py index 8efd907fc132d..eef05956d7282 100644 --- a/recipes/elfio/all/conanfile.py +++ b/recipes/elfio/all/conanfile.py @@ -1,10 +1,12 @@ from conan import ConanFile -from conan.tools.layout import basic_layout -from conan.tools.files import get, copy 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.50.0" + class ElfioConan(ConanFile): name = "elfio" @@ -13,41 +15,39 @@ class ElfioConan(ConanFile): description = "A header-only C++ library that provides a simple interface for reading and generating files in ELF binary format." topics = ("elfio", "elf") license = "MIT" - settings = "compiler" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def configure(self): - if self.settings.compiler.cppstd: + 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"): if Version(self.version) < "3.11": check_min_cppstd(self, 11) else: check_min_cppstd(self, 14) - def layout(self): - basic_layout(self, src_folder="src") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def package_id(self): - self.info.clear() + def build(self): + pass def package(self): - copy( - self, - pattern="COPYING", - src=self.source_folder, - dst=os.path.join(self.package_folder, "licenses"), - ) - copy( - self, - pattern="LICENSE*", - src=self.source_folder, - dst=os.path.join(self.package_folder, "licenses"), - ) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) copy( self, pattern=os.path.join("elfio", "*.hpp"), 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/elfio/all/test_package/CMakeLists.txt b/recipes/elfio/all/test_package/CMakeLists.txt index 8980e10b063e6..6fa586f7cb943 100755 --- a/recipes/elfio/all/test_package/CMakeLists.txt +++ b/recipes/elfio/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) find_package(elfio REQUIRED CONFIG) -add_executable(example example.cpp) -target_link_libraries(example PRIVATE elfio::elfio) -target_compile_features(example PRIVATE cxx_std_14) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE elfio::elfio) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/elfio/all/test_package/conanfile.py b/recipes/elfio/all/test_package/conanfile.py index 8a039654ce69f..98ab55852ad56 100755 --- a/recipes/elfio/all/test_package/conanfile.py +++ b/recipes/elfio/all/test_package/conanfile.py @@ -1,19 +1,20 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake +from conan.tools.cmake import CMake, cmake_layout import os -class ElfioTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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() @@ -21,5 +22,5 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "example") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/elfio/all/test_package/example.cpp b/recipes/elfio/all/test_package/test_package.cpp similarity index 100% rename from recipes/elfio/all/test_package/example.cpp rename to recipes/elfio/all/test_package/test_package.cpp diff --git a/recipes/elfio/all/test_v1_package/CMakeLists.txt b/recipes/elfio/all/test_v1_package/CMakeLists.txt index 8980e10b063e6..0d20897301b68 100755 --- a/recipes/elfio/all/test_v1_package/CMakeLists.txt +++ b/recipes/elfio/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +project(test_package) -find_package(elfio REQUIRED CONFIG) +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) -add_executable(example example.cpp) -target_link_libraries(example PRIVATE elfio::elfio) -target_compile_features(example PRIVATE cxx_std_14) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/elfio/all/test_v1_package/conanfile.py b/recipes/elfio/all/test_v1_package/conanfile.py index 2653a9aa71c86..38f4483872d47 100755 --- a/recipes/elfio/all/test_v1_package/conanfile.py +++ b/recipes/elfio/all/test_v1_package/conanfile.py @@ -1,15 +1,10 @@ -from conan import ConanFile -from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake +from conans import ConanFile, CMake, tools import os -class ElfioTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" - - def layout(self): - cmake_layout(self) +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) @@ -17,6 +12,6 @@ def build(self): cmake.build() def test(self): - if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "example") - self.run(bin_path, env="conanrun") + 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/elfio/all/test_v1_package/example.cpp b/recipes/elfio/all/test_v1_package/example.cpp deleted file mode 100755 index 08728f016b554..0000000000000 --- a/recipes/elfio/all/test_v1_package/example.cpp +++ /dev/null @@ -1,14 +0,0 @@ - -#include -#include - -using namespace ELFIO; - -int main() { - // just check we can create an reader, that means the recipe works - elfio reader; - if ( !reader.load( "/does/not/exist" ) ) { - return EXIT_SUCCESS; - } - return EXIT_FAILURE; -} diff --git a/recipes/expat/all/conanfile.py b/recipes/expat/all/conanfile.py index 04caae4cbe008..36b0654037e28 100644 --- a/recipes/expat/all/conanfile.py +++ b/recipes/expat/all/conanfile.py @@ -14,6 +14,7 @@ class ExpatConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/libexpat/libexpat" topics = ("xml", "parsing") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -43,7 +44,7 @@ def layout(self): cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/expat/all/test_package_module/CMakeLists.txt b/recipes/expat/all/test_package_module/CMakeLists.txt index cc3b096a67958..9d264c42f3e45 100644 --- a/recipes/expat/all/test_package_module/CMakeLists.txt +++ b/recipes/expat/all/test_package_module/CMakeLists.txt @@ -14,7 +14,7 @@ set(_custom_vars EXPAT_FOUND ) foreach(_custom_var ${_custom_vars}) - if(DEFINED _custom_var) + if(DEFINED ${_custom_var}) message(STATUS "${_custom_var}: ${${_custom_var}}") else() message(FATAL_ERROR "${_custom_var} not defined") diff --git a/recipes/fast_float/all/conandata.yml b/recipes/fast_float/all/conandata.yml index 8be05c2c192fd..56e43dbb80754 100644 --- a/recipes/fast_float/all/conandata.yml +++ b/recipes/fast_float/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.10.1": + url: "https://github.com/fastfloat/fast_float/archive/v3.10.1.tar.gz" + sha256: "d162c21c1dc538dbc6b3bb6d1317a7808f2eccef78638445630533f5bed902ee" "3.10.0": url: "https://github.com/fastfloat/fast_float/archive/v3.10.0.tar.gz" sha256: "9167ad938f29464ca2312fe32565646a61328249e16f84b2a23969c627cc93f5" diff --git a/recipes/fast_float/all/conanfile.py b/recipes/fast_float/all/conanfile.py index 6b67f83a814ef..dd07baab915bd 100644 --- a/recipes/fast_float/all/conanfile.py +++ b/recipes/fast_float/all/conanfile.py @@ -14,6 +14,7 @@ class FastFloatConan(ConanFile): topics = ("fast_float", "conversion", "from_chars", "header-only") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/fastfloat/fast_float" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/fast_float/config.yml b/recipes/fast_float/config.yml index 5399bb76a4fda..2fbf9eae61d5a 100644 --- a/recipes/fast_float/config.yml +++ b/recipes/fast_float/config.yml @@ -1,4 +1,6 @@ versions: + "3.10.1": + folder: all "3.10.0": folder: all "3.9.0": diff --git a/recipes/ffmpeg/all/conanfile.py b/recipes/ffmpeg/all/conanfile.py index f0a1d0fdee146..f1ddd0714c380 100644 --- a/recipes/ffmpeg/all/conanfile.py +++ b/recipes/ffmpeg/all/conanfile.py @@ -536,10 +536,10 @@ def opt_append_disable_if_set(args, what, v): ]) if not self.options.with_programs: args.append("--disable-programs") - # since ffmpeg"s build system ignores toolchain variables + # since ffmpeg's build system ignores toolchain variables if tools.get_env("AR"): args.append("--ar={}".format(tools.get_env("AR"))) - if tools.get_env("AS"): + if tools.get_env("AS") and self.options.with_asm: args.append("--as={}".format(tools.get_env("AS"))) if tools.get_env("CC"): args.append("--cc={}".format(tools.get_env("CC"))) diff --git a/recipes/fftw/all/conandata.yml b/recipes/fftw/all/conandata.yml index bd47f81790fc2..9e37904841157 100644 --- a/recipes/fftw/all/conandata.yml +++ b/recipes/fftw/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "3.3.10": + url: + - "https://www.fftw.org/fftw-3.3.10.tar.gz" + - "https://fftw.org/fftw-3.3.10.tar.gz" + sha256: "56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467" "3.3.9": url: - "https://www.fftw.org/fftw-3.3.9.tar.gz" diff --git a/recipes/fftw/config.yml b/recipes/fftw/config.yml index 3d0beaa65b4c9..246a8feb14244 100644 --- a/recipes/fftw/config.yml +++ b/recipes/fftw/config.yml @@ -1,4 +1,6 @@ versions: + "3.3.10": + folder: all "3.3.9": folder: all "3.3.8": diff --git a/recipes/freetype/all/conanfile.py b/recipes/freetype/all/conanfile.py index d7628440e1cc7..1cf113a1d3cc6 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -19,7 +19,7 @@ class FreetypeConan(ConanFile): homepage = "https://www.freetype.org" license = "FTL" topics = ("freetype", "fonts") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -37,7 +37,7 @@ class FreetypeConan(ConanFile): "with_zlib": True, "with_bzip2": True, "with_brotli": True, - "subpixel": False + "subpixel": False, } @property @@ -203,17 +203,15 @@ def package(self): ) def _create_cmake_module_variables(self, module_file): - content = textwrap.dedent("""\ + content = textwrap.dedent(f"""\ set(FREETYPE_FOUND TRUE) if(DEFINED Freetype_INCLUDE_DIRS) - set(FREETYPE_INCLUDE_DIRS ${Freetype_INCLUDE_DIRS}) + set(FREETYPE_INCLUDE_DIRS ${{Freetype_INCLUDE_DIRS}}) endif() if(DEFINED Freetype_LIBRARIES) - set(FREETYPE_LIBRARIES ${Freetype_LIBRARIES}) - endif() - if(DEFINED Freetype_VERSION) - set(FREETYPE_VERSION_STRING ${Freetype_VERSION}) + set(FREETYPE_LIBRARIES ${{Freetype_LIBRARIES}}) endif() + set(FREETYPE_VERSION_STRING "{self.version}") """) save(self, module_file, content) diff --git a/recipes/freetype/all/test_package_module/CMakeLists.txt b/recipes/freetype/all/test_package_module/CMakeLists.txt index 3a9f9ffa7c630..2c27f3b8d69b0 100644 --- a/recipes/freetype/all/test_package_module/CMakeLists.txt +++ b/recipes/freetype/all/test_package_module/CMakeLists.txt @@ -15,7 +15,7 @@ set(_custom_vars FREETYPE_VERSION_STRING ) foreach(_custom_var ${_custom_vars}) - if(DEFINED _custom_var) + if(DEFINED ${_custom_var}) message(STATUS "${_custom_var}: ${${_custom_var}}") else() message(FATAL_ERROR "${_custom_var} not defined") diff --git a/recipes/ftxui/all/CMakeLists.txt b/recipes/ftxui/all/CMakeLists.txt deleted file mode 100644 index 26553983b8de0..0000000000000 --- a/recipes/ftxui/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory(source_subfolder) diff --git a/recipes/ftxui/all/conandata.yml b/recipes/ftxui/all/conandata.yml index 84aba68ff064c..2a9fda1f01655 100644 --- a/recipes/ftxui/all/conandata.yml +++ b/recipes/ftxui/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.0.0": + url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v4.0.0.tar.gz" + sha256: "7276e4117429ebf8e34ea371c3ea4e66eb99e0f234cb4c5c85fca17174a53dfa" "3.0.0": url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v3.0.0.tar.gz" sha256: "a8f2539ab95caafb21b0c534e8dfb0aeea4e658688797bb9e5539729d9258cc1" @@ -6,11 +9,19 @@ sources: url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v2.0.0.tar.gz" sha256: "d891695ef22176f0c09f8261a37af9ad5b262dd670a81e6b83661a23abc2c54f" patches: + "4.0.0": + - patch_file: "patches/4.0.0-0002-install-dll.patch" + patch_description: "add runtime destionation for windows shared build" + patch_type: "conan" "3.0.0": - - patch_file: "patches/0002-install-dll.patch" - base_path: "source_subfolder" + - patch_file: "patches/2.0.0-0002-install-dll.patch" + patch_description: "add runtime destionation for windows shared build" + patch_type: "conan" "2.0.0": - - patch_file: "patches/0001-lib-prefix.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-install-dll.patch" - base_path: "source_subfolder" + - patch_file: "patches/2.0.0-0001-lib-prefix.patch" + patch_description: "correct the order of cmake min and project" + patch_type: "bugfix" + patch_source: "https://github.com/ArthurSonzogni/FTXUI/pull/340" + - patch_file: "patches/2.0.0-0002-install-dll.patch" + patch_description: "add runtime destionation for windows shared build" + patch_type: "conan" diff --git a/recipes/ftxui/all/conanfile.py b/recipes/ftxui/all/conanfile.py index ab985f7b93858..d458731d30305 100644 --- a/recipes/ftxui/all/conanfile.py +++ b/recipes/ftxui/all/conanfile.py @@ -1,22 +1,21 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc_static_runtime, 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.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -import functools - -from conan.tools.microsoft import is_msvc, msvc_runtime_flag -import conan.tools.files -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration - -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class FTXUIConan(ConanFile): name = "ftxui" description = "C++ Functional Terminal User Interface." license = "MIT" - topics = ("ncurses", "terminal", "screen", "tui") - homepage = "https://github.com/ArthurSonzogni/FTXUI" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://github.com/ArthurSonzogni/FTXUI" + topics = ("ncurses", "terminal", "screen", "tui") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,16 +25,23 @@ class FTXUIConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake" @property - def _source_subfolder(self): - return "source_subfolder" + 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): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -43,42 +49,48 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): - compiler = self.settings.compiler - version = tools.Version(self.settings.compiler.version) - if compiler == 'gcc' and version < '8': - raise ConanInvalidConfiguration("gcc 8 required") - if compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") - if is_msvc(self) and self.options.shared and "MT" in msvc_runtime_flag(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if is_msvc(self) and self.options.shared and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("shared with static runtime not supported") 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) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["FTXUI_BUILD_DOCS"] = False - cmake.definitions["FTXUI_BUILD_EXAMPLES"] = False - cmake.configure() - return cmake + def generate(self): + # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are automatically parsed when self.options.shared or self.options.fPIC exist + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["FTXUI_BUILD_DOCS"] = False + tc.variables["FTXUI_BUILD_EXAMPLES"] = False + tc.generate() - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - conan.tools.files.patch(self, **patch) + tc = CMakeDeps(self) + tc.generate() - cmake = self._configure_cmake() + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "ftxui") @@ -86,9 +98,13 @@ def package_info(self): self.cpp_info.components["ftxui-dom"].set_property("cmake_target_name", "ftxui::dom") self.cpp_info.components["ftxui-dom"].libs = ["ftxui-dom"] self.cpp_info.components["ftxui-dom"].requires = ["ftxui-screen"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ftxui-dom"].system_libs.append("m") self.cpp_info.components["ftxui-screen"].set_property("cmake_target_name", "ftxui::screen") self.cpp_info.components["ftxui-screen"].libs = ["ftxui-screen"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ftxui-screen"].system_libs.append("m") self.cpp_info.components["ftxui-component"].set_property("cmake_target_name", "ftxui::component") self.cpp_info.components["ftxui-component"].libs = ["ftxui-component"] diff --git a/recipes/ftxui/all/patches/0001-lib-prefix.patch b/recipes/ftxui/all/patches/2.0.0-0001-lib-prefix.patch similarity index 100% rename from recipes/ftxui/all/patches/0001-lib-prefix.patch rename to recipes/ftxui/all/patches/2.0.0-0001-lib-prefix.patch diff --git a/recipes/ftxui/all/patches/0002-install-dll.patch b/recipes/ftxui/all/patches/2.0.0-0002-install-dll.patch similarity index 100% rename from recipes/ftxui/all/patches/0002-install-dll.patch rename to recipes/ftxui/all/patches/2.0.0-0002-install-dll.patch diff --git a/recipes/ftxui/all/patches/4.0.0-0002-install-dll.patch b/recipes/ftxui/all/patches/4.0.0-0002-install-dll.patch new file mode 100644 index 0000000000000..41ba040d126b6 --- /dev/null +++ b/recipes/ftxui/all/patches/4.0.0-0002-install-dll.patch @@ -0,0 +1,12 @@ +diff --git a/cmake/ftxui_install.cmake b/cmake/ftxui_install.cmake +index 19e68d0..19d22c0 100644 +--- a/cmake/ftxui_install.cmake ++++ b/cmake/ftxui_install.cmake +@@ -5,6 +5,7 @@ endif() + include(GNUInstallDirs) + install(TARGETS screen dom component + EXPORT ftxui-export ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) diff --git a/recipes/ftxui/all/test_package/CMakeLists.txt b/recipes/ftxui/all/test_package/CMakeLists.txt index f4c3b1f828f16..44e0ebf683f7a 100644 --- a/recipes/ftxui/all/test_package/CMakeLists.txt +++ b/recipes/ftxui/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(ftxui REQUIRED CONFIG) + add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ftxui::dom ftxui::screen) +target_link_libraries(${PROJECT_NAME} PRIVATE ftxui::dom ftxui::screen) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/ftxui/all/test_package/conanfile.py b/recipes/ftxui/all/test_package/conanfile.py index e788460ad0765..a9fbb7f543162 100644 --- a/recipes/ftxui/all/test_package/conanfile.py +++ b/recipes/ftxui/all/test_package/conanfile.py @@ -1,11 +1,18 @@ -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 = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +20,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ftxui/all/test_v1_package/CMakeLists.txt b/recipes/ftxui/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/ftxui/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/ftxui/all/test_v1_package/conanfile.py b/recipes/ftxui/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/ftxui/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/ftxui/config.yml b/recipes/ftxui/config.yml index 70df618778342..4763abe690b6e 100644 --- a/recipes/ftxui/config.yml +++ b/recipes/ftxui/config.yml @@ -1,4 +1,6 @@ versions: + "4.0.0": + folder: all "3.0.0": folder: all "2.0.0": diff --git a/recipes/fxdiv/all/conanfile.py b/recipes/fxdiv/all/conanfile.py index 30d0773e14a46..8b36feb1d6229 100644 --- a/recipes/fxdiv/all/conanfile.py +++ b/recipes/fxdiv/all/conanfile.py @@ -11,21 +11,21 @@ class FxdivConan(ConanFile): description = "C99/C++ header-only library for division via fixed-point " \ "multiplication by inverse." license = "MIT" - topics = ("fxdiv", "integer-division") + topics = ("integer-division",) homepage = "https://github.com/Maratyszcza/FXdiv" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def package_id(self): - self.info.clear() - def layout(self): basic_layout(self, src_folder="src") + def package_id(self): + self.info.clear() + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass @@ -36,6 +36,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/fxdiv/all/test_package/conanfile.py b/recipes/fxdiv/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/fxdiv/all/test_package/conanfile.py +++ b/recipes/fxdiv/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/fxdiv/all/test_v1_package/CMakeLists.txt b/recipes/fxdiv/all/test_v1_package/CMakeLists.txt index b7f38eca2a76d..0d20897301b68 100644 --- a/recipes/fxdiv/all/test_v1_package/CMakeLists.txt +++ b/recipes/fxdiv/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES C) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(fxdiv REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE fxdiv::fxdiv) -target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gamma/all/CMakeLists.txt b/recipes/gamma/all/CMakeLists.txt index d7ab29edac81b..c614cd0c1e028 100644 --- a/recipes/gamma/all/CMakeLists.txt +++ b/recipes/gamma/all/CMakeLists.txt @@ -26,9 +26,13 @@ target_include_directories(Gamma PUBLIC ${GAMMA_SRC_DIR}) target_compile_features(Gamma PUBLIC cxx_std_14) set_target_properties(Gamma PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) -find_library(LIBM NAMES m) -if(LIBM) - target_link_libraries(Gamma PRIVATE ${LIBM}) +find_package(Threads REQUIRED) +target_link_libraries(Gamma PRIVATE Threads::Threads) + +include(CheckFunctionExists) +check_function_exists(pow HAVE_MATH_SYSTEM) +if(NOT HAVE_MATH_SYSTEM) + target_link_libraries(Gamma PRIVATE m) endif() if(GAMMA_AUDIO_IO) diff --git a/recipes/gamma/all/conanfile.py b/recipes/gamma/all/conanfile.py index 451083af4f13c..b5f3681984e45 100644 --- a/recipes/gamma/all/conanfile.py +++ b/recipes/gamma/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.files import copy, get import os -required_conan_version = ">=1.51.1" +required_conan_version = ">=1.53.0" class Gammaconan(ConanFile): @@ -19,6 +19,7 @@ class Gammaconan(ConanFile): homepage = "https://github.com/LancePutnam/Gamma" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -41,31 +42,27 @@ 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, src_folder="src") def requirements(self): if self.options.soundfile: - self.requires("libsndfile/1.0.31") + self.requires("libsndfile/1.2.0") def validate(self): - if self.info.settings.compiler.get_safe("cppstd"): + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 14) - if self.info.options.audio_io: + if self.options.audio_io: # TODO: add audio_io support once portaudio added to CCI raise ConanInvalidConfiguration( "gamma:audio_io=True requires portaudio, not available in conan-center yet" ) def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -89,4 +86,4 @@ def package(self): def package_info(self): self.cpp_info.libs = ["Gamma"] if not self.options.shared and self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/gamma/all/test_v1_package/CMakeLists.txt b/recipes/gamma/all/test_v1_package/CMakeLists.txt index c32216450f32e..0d20897301b68 100644 --- a/recipes/gamma/all/test_v1_package/CMakeLists.txt +++ b/recipes/gamma/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(gamma REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE gamma::gamma) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gdcm/all/conandata.yml b/recipes/gdcm/all/conandata.yml index 00f65ba461aeb..330dc8dd2483c 100644 --- a/recipes/gdcm/all/conandata.yml +++ b/recipes/gdcm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.21": + url: "https://sourceforge.net/projects/gdcm/files/gdcm%203.x/GDCM%203.0.21/gdcm-3.0.21.tar.bz2" + sha256: "f29dbdd3b6b4c30c9803e6466b88b139d67f5585768565fe29f0be65ad737744" "3.0.20": url: "https://sourceforge.net/projects/gdcm/files/gdcm%203.x/GDCM%203.0.20/gdcm-3.0.20.tar.bz2" sha256: "d299731e229fe7595001f17e6b81e6f9a27daac3df7295543753525242cea0b2" @@ -6,6 +9,28 @@ sources: url: "https://sourceforge.net/projects/gdcm/files/gdcm%203.x/GDCM%203.0.9/gdcm-3.0.9.tar.bz2" sha256: "1d518b0e4709cecfb7330c9bd9b3a73cfd01ffe70d1c178f36a4c847283c4672" patches: + "3.0.21": + - patch_file: "patches/0001-charls-linking.patch" + patch_description: "fix symbol export for gdcmcharls" + patch_type: "portability" + - patch_file: "patches/0002-3.0.20-openjpeg.patch" + patch_description: "fix variable names for openjpeg" + patch_type: "conan" + - patch_file: "patches/0004-3.0.20-find-expat.patch" + patch_description: "enforce usage of FindEXPAT.cmake" + patch_type: "conan" + - patch_file: "patches/0005-3.0.20-openssl.patch" + patch_description: "skip check_cxx_source_compiles usage for openssl" + patch_type: "conan" + - patch_file: "patches/0006-json.patch" + patch_description: "skip check_cxx_source_compiles usage for json-c" + patch_type: "conan" + - patch_file: "patches/0007-3.0.20-find-json.patch" + patch_description: "fix find_package for json-c" + patch_type: "conan" + - patch_file: "patches/0008-3.0.20-find-libuuid.patch" + patch_description: "fix find_package for libuuid" + patch_type: "conan" "3.0.20": - patch_file: "patches/0001-charls-linking.patch" patch_description: "fix symbol export for gdcmcharls" diff --git a/recipes/gdcm/all/conanfile.py b/recipes/gdcm/all/conanfile.py index 3c096776bcba9..1393adcadc769 100644 --- a/recipes/gdcm/all/conanfile.py +++ b/recipes/gdcm/all/conanfile.py @@ -64,7 +64,7 @@ def requirements(self): if self.options.with_json: self.requires("json-c/0.16") if self.options.with_openssl: - self.requires("openssl/1.1.1s") + self.requires("openssl/1.1.1t") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/gdcm/config.yml b/recipes/gdcm/config.yml index f1b37cf5e936f..868e7933ac4a6 100644 --- a/recipes/gdcm/config.yml +++ b/recipes/gdcm/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.21": + folder: "all" "3.0.20": folder: "all" "3.0.9": diff --git a/recipes/geos/all/conanfile.py b/recipes/geos/all/conanfile.py index 356d3348ea008..7238296e0a1c1 100644 --- a/recipes/geos/all/conanfile.py +++ b/recipes/geos/all/conanfile.py @@ -12,10 +12,10 @@ class GeosConan(ConanFile): name = "geos" description = "C++11 library for performing operations on two-dimensional vector geometries" license = "LGPL-2.1" - topics = ("geos", "osgeo", "geometry", "topology", "geospatial") + topics = ("osgeo", "geometry", "topology", "geospatial") homepage = "https://trac.osgeo.org/geos" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -122,6 +122,4 @@ def package_info(self): self.cpp_info.components["geos_c"].requires = ["geos_cpp"] if self.options.utils: - 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) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/glad/all/CMakeLists.txt b/recipes/glad/all/CMakeLists.txt deleted file mode 100644 index 354ee565338ae..0000000000000 --- a/recipes/glad/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include("${CMAKE_BINARY_DIR}/../conanbuildinfo.cmake") -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/glad/all/conandata.yml b/recipes/glad/all/conandata.yml index e0ca7c0f4e158..1dba3ce94b4ce 100644 --- a/recipes/glad/all/conandata.yml +++ b/recipes/glad/all/conandata.yml @@ -14,13 +14,9 @@ sources: patches: "0.1.36": - patch_file: "patches/0003-CMake-handle-all-specs.patch" - base_path: "source_subfolder" "0.1.35": - patch_file: "patches/0003-CMake-handle-all-specs.patch" - base_path: "source_subfolder" "0.1.34": - patch_file: "patches/0002-CMake-handle-all-specs.patch" - base_path: "source_subfolder" "0.1.33": - patch_file: "patches/0001-CMake-handle-all-specs.patch" - base_path: "source_subfolder" diff --git a/recipes/glad/all/conanfile.py b/recipes/glad/all/conanfile.py index 5d47319c5575a..6e5e16777a859 100644 --- a/recipes/glad/all/conanfile.py +++ b/recipes/glad/all/conanfile.py @@ -1,17 +1,17 @@ import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +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, rmdir +from conan.errors import ConanInvalidConfiguration class GladConan(ConanFile): name = "glad" description = "Multi-Language GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs." - topics = ("conan", "glad", "opengl") + topics = ("opengl",) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Dav1dde/glad" license = "MIT" - exports_sources = ["CMakeLists.txt", "patches/*.patch"] - generators = "cmake" settings = "os", "compiler", "build_type", "arch" options = { @@ -19,7 +19,7 @@ class GladConan(ConanFile): "fPIC": [True, False], "no_loader": [True, False], "spec": ["gl", "egl", "glx", "wgl"], # Name of the spec - "extensions": "ANY", # Path to extensions file or comma separated list of extensions, if missing all extensions are included + "extensions": ["ANY"], # Path to extensions file or comma separated list of extensions, if missing all extensions are included # if specification is gl "gl_profile": ["compatibility", "core"], "gl_version": ["None", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "2.0", @@ -41,7 +41,7 @@ class GladConan(ConanFile): "fPIC": True, "no_loader": False, "spec": "gl", - "extensions": "''", + "extensions": "", "gl_profile": "compatibility", "gl_version": "3.3", "gles1_version": "None", @@ -52,15 +52,8 @@ class GladConan(ConanFile): "wgl_version": "None" } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -68,9 +61,10 @@ 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") if self.options.spec != "gl": del self.options.gl_profile @@ -88,38 +82,35 @@ def configure(self): if self.options.spec != "wgl": del self.options.wgl_version + def validate(self): if self.options.spec == "wgl" and self.settings.os != "Windows": - raise ConanInvalidConfiguration("{0} specification is not compatible with {1}".format(self.options.spec, - self.settings.os)) + raise ConanInvalidConfiguration(f"{self.ref}:{self.options.spec} specification is not compatible with {self.settings.os}") + + def layout(self): + cmake_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if "gl_profile" in self.options: + tc.variables["GLAD_PROFILE"] = self.options.gl_profile + tc.variables["GLAD_API"] = self._get_api() + tc.variables["GLAD_EXTENSIONS"] = self.options.extensions + tc.variables["GLAD_SPEC"] = self.options.spec + tc.variables["GLAD_NO_LOADER"] = self.options.no_loader + tc.variables["GLAD_GENERATOR"] = "c" if self.settings.build_type == "Release" else "c-debug" + tc.variables["GLAD_EXPORT"] = True + tc.variables["GLAD_INSTALL"] = True + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - if "gl_profile" in self.options: - self._cmake.definitions["GLAD_PROFILE"] = self.options.gl_profile - self._cmake.definitions["GLAD_API"] = self._get_api() - self._cmake.definitions["GLAD_EXTENSIONS"] = self.options.extensions - self._cmake.definitions["GLAD_SPEC"] = self.options.spec - self._cmake.definitions["GLAD_NO_LOADER"] = self.options.no_loader - self._cmake.definitions["GLAD_GENERATOR"] = "c" if self.settings.build_type == "Release" else "c-debug" - self._cmake.definitions["GLAD_EXPORT"] = True - self._cmake.definitions["GLAD_INSTALL"] = True - - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def _get_api(self): if self.options.spec == "gl": spec_api = { @@ -135,20 +126,19 @@ def _get_api(self): elif self.options.spec == "wgl": spec_api = {"wgl": self.options.wgl_version} - api_concat = ",".join("{0}={1}".format(api_name, api_version) + api_concat = ",".join(f"{api_name}={api_version}".format() for api_name, api_version in spec_api.items() if api_version != "None") return api_concat def package(self): - cmake = self._configure_cmake() - cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + CMake(self).install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.options.shared: self.cpp_info.defines = ["GLAD_GLAPI_EXPORT"] if self.settings.os == "Linux": diff --git a/recipes/glad/all/test_package/CMakeLists.txt b/recipes/glad/all/test_package/CMakeLists.txt index 9c415f835d0f1..672dd8a2797af 100644 --- a/recipes/glad/all/test_package/CMakeLists.txt +++ b/recipes/glad/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package LANGUAGES C) find_package(glad REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} glad::glad) +target_link_libraries(${PROJECT_NAME} PRIVATE glad::glad) diff --git a/recipes/glad/all/test_package/conanfile.py b/recipes/glad/all/test_package/conanfile.py index b6a26067f365d..6c4fa6db1be46 100644 --- a/recipes/glad/all/test_package/conanfile.py +++ b/recipes/glad/all/test_package/conanfile.py @@ -1,17 +1,26 @@ import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" def build(self): cmake = CMake(self) cmake.configure() cmake.build() + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/glad/all/test_v1_package/CMakeLists.txt b/recipes/glad/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..393ceb7e700f6 --- /dev/null +++ b/recipes/glad/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/glad/all/test_v1_package/conanfile.py b/recipes/glad/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..90eb89e3f2f46 --- /dev/null +++ b/recipes/glad/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/glib/all/conandata.yml b/recipes/glib/all/conandata.yml index f4326e0c010b2..207b9fa9209a2 100644 --- a/recipes/glib/all/conandata.yml +++ b/recipes/glib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.76.0": + url: "https://download.gnome.org/sources/glib/2.76/glib-2.76.0.tar.xz" + sha256: "525bb703b807142e1aee5ccf222c344e8064b21c0c45677ef594e587874c6797" "2.75.3": url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.3.tar.xz" sha256: "7c517d0aff456c35a039bce8a8df7a08ce95a8285b09d1849f8865f633f7f871" diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py index 54e3429735b13..700346dc42a08 100644 --- a/recipes/glib/all/conanfile.py +++ b/recipes/glib/all/conanfile.py @@ -1,5 +1,4 @@ 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.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir @@ -17,17 +16,20 @@ class GLibConan(ConanFile): name = "glib" - description = ("Low-level core library that forms the basis for projects such as GTK+ and GNOME. " - "It provides data structure handling for C, portability wrappers, and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system.") + description = ( + "Low-level core library that forms the basis for projects such as GTK+ and GNOME. " + "It provides data structure handling for C, portability wrappers, and interfaces " + "for such runtime functionality as an event loop, threads, dynamic loading, and an object system." + ) topics = "gio", "gmodule", "gnome", "gobject", "gtk" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.gnome.org/GNOME/glib" license = "LGPL-2.1-or-later" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "with_pcre": [True, False], "with_elf": [True, False], "with_selinux": [True, False], "with_mount": [True, False], @@ -35,7 +37,6 @@ class GLibConan(ConanFile): default_options = { "shared": True, "fPIC": True, - "with_pcre": True, "with_elf": True, "with_mount": True, "with_selinux": True, @@ -66,11 +67,10 @@ def layout(self): def requirements(self): self.requires("zlib/1.2.13") self.requires("libffi/3.4.3") - if self.options.with_pcre: - if Version(self.version) >= "2.73.2": - self.requires("pcre2/10.40") - else: - self.requires("pcre/8.45") + if Version(self.version) >= "2.73.2": + self.requires("pcre2/10.42") + else: + self.requires("pcre/8.45") if self.options.get_safe("with_elf"): self.requires("libelf/0.8.13") if self.options.get_safe("with_mount"): @@ -84,18 +84,13 @@ def requirements(self): if is_apple_os(self): self.requires("libiconv/1.17") - def validate(self): - if not self.info.options.with_pcre: - raise ConanInvalidConfiguration("option glib:with_pcre must be True for glib >= 2.69.0") - def build_requirements(self): - self.tool_requires("meson/0.64.1") - if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("meson/1.0.0") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/1.9.3") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): virtual_build_env = VirtualBuildEnv(self) @@ -239,11 +234,10 @@ def package_info(self): if is_apple_os(self): self.cpp_info.components["glib-2.0"].requires.append("libiconv::libiconv") - if self.options.with_pcre: - if Version(self.version) >= "2.73.2": - self.cpp_info.components["glib-2.0"].requires.append("pcre2::pcre2") - else: - self.cpp_info.components["glib-2.0"].requires.append("pcre::pcre") + if Version(self.version) >= "2.73.2": + self.cpp_info.components["glib-2.0"].requires.append("pcre2::pcre2") + else: + self.cpp_info.components["glib-2.0"].requires.append("pcre::pcre") if self.settings.os == "Linux": self.cpp_info.components["gio-2.0"].system_libs.append("resolv") @@ -260,9 +254,7 @@ def package_info(self): self.cpp_info.components["gresource"].requires.append("libelf::libelf") # this is actually an executable self.env_info.GLIB_COMPILE_SCHEMAS = os.path.join(self.package_folder, "bin", "glib-compile-schemas") - bin_path = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH env var with: {bin_path}") - self.env_info.PATH.append(bin_path) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) pkgconfig_variables = { 'datadir': '${prefix}/res', @@ -294,10 +286,10 @@ def package_info(self): "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items())) def fix_msvc_libname(conanfile, remove_lib_prefix=True): - """remove lib prefix & change extension to .lib""" + """remove lib prefix & change extension to .lib in case of cl like compiler""" from conan.tools.files import rename import glob - if not is_msvc(conanfile): + if not conanfile.settings.get_safe("compiler.runtime"): return libdirs = getattr(conanfile.cpp.package, "libdirs") for libdir in libdirs: diff --git a/recipes/glib/all/test_package/conanfile.py b/recipes/glib/all/test_package/conanfile.py index 22973c4baccc5..37f9bd528f982 100644 --- a/recipes/glib/all/test_package/conanfile.py +++ b/recipes/glib/all/test_package/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.tools.build import can_run from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain -from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.gnu import PkgConfig, PkgConfigDeps import os @@ -29,11 +29,6 @@ def generate(self): deps = CMakeDeps(self) deps.generate() else: - # todo Remove the following workaround after https://github.com/conan-io/conan/issues/11962 is fixed. - env = Environment() - env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) - envvars = env.vars(self) - envvars.save_script("pkg_config") virtual_build_env = VirtualBuildEnv(self) virtual_build_env.generate() pkg_config_deps = PkgConfigDeps(self) diff --git a/recipes/glib/config.yml b/recipes/glib/config.yml index 4c2eeb2e952bd..4d989d5c8ae0b 100644 --- a/recipes/glib/config.yml +++ b/recipes/glib/config.yml @@ -1,4 +1,6 @@ versions: + "2.76.0": + folder: all "2.75.3": folder: all "2.75.2": diff --git a/recipes/glibmm/all/conanfile.py b/recipes/glibmm/all/conanfile.py index ea2efe10f2484..df88638f61d35 100644 --- a/recipes/glibmm/all/conanfile.py +++ b/recipes/glibmm/all/conanfile.py @@ -2,7 +2,7 @@ import glob import shutil -from conan import ConanFile +from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import check_min_cppstd @@ -32,10 +32,17 @@ class GlibmmConan(ConanFile): license = "LGPL-2.1" url = "https://github.com/conan-io/conan-center-index" description = "glibmm is a C++ API for parts of glib that are useful for C++." - topics = ["glibmm", "giomm"] - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + topics = ("giomm",) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } short_paths = True @property @@ -61,22 +68,19 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") if self.options.shared: - self.options["glib"].shared = True + wildcard = "" if Version(conan_version) < "2.0.0" else "/*" + self.options[f"glib{wildcard}"].shared = True def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.75.2") + self.requires("glib/2.76.0") if self._abi_version == "2.68": self.requires("libsigcpp/3.0.7") else: self.requires("libsigcpp/2.10.8") - def package_id(self): - if not self.dependencies["glib"].options.shared: - self.info.requires["glib"].full_package_mode() - def validate(self): if self.settings.compiler.get_safe("cppstd"): if self._abi_version == "2.68": diff --git a/recipes/glibmm/all/test_package/conanfile.py b/recipes/glibmm/all/test_package/conanfile.py index 05bb1c8f03b5d..825105b610efd 100644 --- a/recipes/glibmm/all/test_package/conanfile.py +++ b/recipes/glibmm/all/test_package/conanfile.py @@ -1,7 +1,6 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake -from conan.tools.layout import cmake_layout +from conan.tools.cmake import CMake, cmake_layout import os diff --git a/recipes/gmp/all/conanfile.py b/recipes/gmp/all/conanfile.py index 44f661282ff5d..eae86d9dc3505 100644 --- a/recipes/gmp/all/conanfile.py +++ b/recipes/gmp/all/conanfile.py @@ -5,12 +5,12 @@ from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, 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 -from conan.tools.scm import Version +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path import os import stat -required_conan_version = ">=1.56.0" +required_conan_version = ">=1.57.0" + class GmpConan(ConanFile): name = "gmp" @@ -23,6 +23,7 @@ class GmpConan(ConanFile): license = ("LGPL-3.0", "GPL-2.0") homepage = "https://gmplib.org" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -82,12 +83,11 @@ def build_requirements(self): 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("yasm/1.3.0") # Needed for determining 32-bit word size + self.tool_requires("yasm/1.3.0") # Needed for determining 32-bit word size self.tool_requires("automake/1.16.5") # Needed for lib-wrapper def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): env = VirtualBuildEnv(self) @@ -109,8 +109,7 @@ def generate(self): "lt_cv_sys_global_symbol_pipe=cat", # added to get further in shared MSVC build, but it gets stuck later ]) tc.extra_cxxflags.append("-EHsc") - if (self.settings.compiler == "msvc" and Version(self.settings.compiler.version) >= "180") or \ - (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) >= "12"): + if check_min_vs(self, "180", raise_invalid=False): tc.extra_cflags.append("-FS") tc.extra_cxxflags.append("-FS") env = tc.environment() # Environment must be captured *after* setting extra_cflags, etc. to pick up changes diff --git a/recipes/googleapis/all/conanfile.py b/recipes/googleapis/all/conanfile.py index 47aa18c5eedae..f710156ef42d5 100644 --- a/recipes/googleapis/all/conanfile.py +++ b/recipes/googleapis/all/conanfile.py @@ -46,14 +46,14 @@ def source(self): def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") self.options["protobuf"].shared = True def validate(self): @@ -64,7 +64,7 @@ def validate(self): if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration("Source code generated from protos is missing some export macro") - if self.options.shared and not self.options["protobuf"].shared: + if self.options.shared and not self.dependencies["protobuf"].options.shared: raise ConanInvalidConfiguration("If built as shared, protobuf must be shared as well. Please, use `protobuf:shared=True`") @property diff --git a/recipes/grpc-proto/all/conanfile.py b/recipes/grpc-proto/all/conanfile.py index 8a95bb545c3ac..6883b4d923806 100644 --- a/recipes/grpc-proto/all/conanfile.py +++ b/recipes/grpc-proto/all/conanfile.py @@ -37,11 +37,11 @@ def source(self): def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + self.options.rm_safe("fPIC") def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") self.options["protobuf"].shared = True self.options["googleapis"].shared = True @@ -49,7 +49,7 @@ def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, 11) - if self.options.shared and (not self.options["protobuf"].shared or not self.options["googleapis"].shared): + if self.options.shared and (not self.dependencies["protobuf"].options.shared or not self.dependencies["googleapis"].options.shared): raise ConanInvalidConfiguration("If built as shared, protobuf and googleapis must be shared as well. Please, use `protobuf:shared=True` and `googleapis:shared=True`") def generate(self): diff --git a/recipes/h3/all/conanfile.py b/recipes/h3/all/conanfile.py index cc4023e57daf9..50c5d475b2fea 100644 --- a/recipes/h3/all/conanfile.py +++ b/recipes/h3/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version import os @@ -11,10 +11,11 @@ class H3Conan(ConanFile): name = "h3" description = "Hexagonal hierarchical geospatial indexing system." license = "Apache-2.0" - topics = ("h3", "hierarchical", "geospatial", "indexing") + topics = ("hierarchical", "geospatial", "indexing") homepage = "https://github.com/uber/h3" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,8 +31,7 @@ class H3Conan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -51,7 +51,7 @@ def _cmake_new_enough(self, required_version): import re from io import StringIO output = StringIO() - self.run("cmake --version", output=output) + self.run("cmake --version", output) m = re.search(r'cmake version (\d+\.\d+\.\d+)', output.getvalue()) return Version(m.group(1)) >= required_version except: @@ -59,11 +59,10 @@ def _cmake_new_enough(self, required_version): def build_requirements(self): if Version(self.version) >= "4.1.0" and not self._cmake_new_enough("3.20"): - self.tool_requires("cmake/3.25.1") + self.tool_requires("cmake/3.25.2") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -95,11 +94,9 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "h3") self.cpp_info.set_property("cmake_target_name", "h3::h3") self.cpp_info.libs = ["h3"] - self.cpp_info.defines.append("H3_PREFIX={}".format(self.options.h3_prefix)) + self.cpp_info.defines.append(f"H3_PREFIX={self.options.h3_prefix}") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") if self.options.build_filters: - 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) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/h3/all/test_package/conanfile.py b/recipes/h3/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/h3/all/test_package/conanfile.py +++ b/recipes/h3/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/im95able-rea/all/conandata.yml b/recipes/im95able-rea/all/conandata.yml new file mode 100644 index 0000000000000..a13404bd2b981 --- /dev/null +++ b/recipes/im95able-rea/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "cci.20190225": + url: "https://github.com/im95able/Rea/archive/064d99897c9dcc547dc38853dcd917ba04a34ef4.tar.gz" + sha256: "efcf822116ea22422d2ea5249250cd5d13db54ab65b1a84a3f16c5d7413aed7e" +patches: + "cci.20190225": + - patch_file: "patches/0001-include-limits.patch" + patch_description: "include limits" + patch_type: "portability" diff --git a/recipes/im95able-rea/all/conanfile.py b/recipes/im95able-rea/all/conanfile.py new file mode 100644 index 0000000000000..74423119b2602 --- /dev/null +++ b/recipes/im95able-rea/all/conanfile.py @@ -0,0 +1,81 @@ +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, export_conandata_patches, get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class Im95ableReaConan(ConanFile): + name = "im95able-rea" + description = ( + "Lightweight library of data structures implemented in C++11, " + "designed for constant time insertion, erasure, lookup, and fastest possible iteration." + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/im95able/Rea/" + topics = ("slot_map", "slot_list", "header-only") + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + 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.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 build(self): + apply_conandata_patches(self) + + 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, "Rea"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "rea") + self.cpp_info.set_property("cmake_target_name", "rea::rea") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "rea" + self.cpp_info.filenames["cmake_find_package_multi"] = "rea" + self.cpp_info.names["cmake_find_package"] = "rea" + self.cpp_info.names["cmake_find_package_multi"] = "rea" diff --git a/recipes/im95able-rea/all/patches/0001-include-limits.patch b/recipes/im95able-rea/all/patches/0001-include-limits.patch new file mode 100644 index 0000000000000..6b3cced25f67f --- /dev/null +++ b/recipes/im95able-rea/all/patches/0001-include-limits.patch @@ -0,0 +1,12 @@ +diff --git a/Rea/rea.h b/Rea/rea.h +index 2cc0a25..8cf57cc 100644 +--- a/Rea/rea.h ++++ b/Rea/rea.h +@@ -30,6 +30,7 @@ SOFTWARE. + #include + #include + #include ++#include + + + namespace rea { diff --git a/recipes/im95able-rea/all/test_package/CMakeLists.txt b/recipes/im95able-rea/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b670ff5e6af64 --- /dev/null +++ b/recipes/im95able-rea/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(rea REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rea::rea) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/im95able-rea/all/test_package/conanfile.py b/recipes/im95able-rea/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/im95able-rea/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/im95able-rea/all/test_package/test_package.cpp b/recipes/im95able-rea/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9f43b119dca2d --- /dev/null +++ b/recipes/im95able-rea/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "rea.h" + +int main() { + auto sl = rea::slot_list{}; + + return 0; +} diff --git a/recipes/im95able-rea/all/test_v1_package/CMakeLists.txt b/recipes/im95able-rea/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/im95able-rea/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/im95able-rea/all/test_v1_package/conanfile.py b/recipes/im95able-rea/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/im95able-rea/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/im95able-rea/config.yml b/recipes/im95able-rea/config.yml new file mode 100644 index 0000000000000..5ed6e21978a2a --- /dev/null +++ b/recipes/im95able-rea/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20190225": + folder: all diff --git a/recipes/imath/all/conandata.yml b/recipes/imath/all/conandata.yml index c74e535dae312..bebaaa4063645 100644 --- a/recipes/imath/all/conandata.yml +++ b/recipes/imath/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "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" diff --git a/recipes/imath/config.yml b/recipes/imath/config.yml index 566850eaffa71..a8c8ad2b073d1 100644 --- a/recipes/imath/config.yml +++ b/recipes/imath/config.yml @@ -1,4 +1,6 @@ versions: + "3.1.7": + folder: all "3.1.6": folder: all "3.1.5": diff --git a/recipes/imgui/all/conandata.yml b/recipes/imgui/all/conandata.yml index 0837cb476b318..1eb68f99063db 100644 --- a/recipes/imgui/all/conandata.yml +++ b/recipes/imgui/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.89.4": + url: "https://github.com/ocornut/imgui/archive/v1.89.4.tar.gz" + sha256: "69f1e83adcab3fdd27b522f5075f407361b0d3875e3522b13d33bc2ae2c7d48c" "1.89.3": url: "https://github.com/ocornut/imgui/archive/v1.89.3.tar.gz" sha256: "3b665fadd5580b7ef494d5d8bb1c12b2ec53ee723034caf43332956381f5d631" diff --git a/recipes/imgui/config.yml b/recipes/imgui/config.yml index 7e2289b1b3d91..ce92302f4a251 100644 --- a/recipes/imgui/config.yml +++ b/recipes/imgui/config.yml @@ -1,4 +1,6 @@ versions: + "1.89.4": + folder: all "1.89.3": folder: all "1.89.2": diff --git a/recipes/indicators/all/conandata.yml b/recipes/indicators/all/conandata.yml index 792bebf8a5f19..2d3d2eb9e7a85 100644 --- a/recipes/indicators/all/conandata.yml +++ b/recipes/indicators/all/conandata.yml @@ -1,10 +1,13 @@ sources: - "1.9": - url: "https://github.com/p-ranav/indicators/archive/v1.9.tar.gz" - sha256: "842e11fa542ac392a2a2ddee48620a06c3005ec38ca25cf352471e46e18f389d" - "2.0": - url: "https://github.com/p-ranav/indicators/archive/v2.0.tar.gz" - sha256: "ef296fa614edcd798db0ac6c3c0f2990682cae8b83724a4db34eed17521c75f7" + "2.3": + url: "https://github.com/p-ranav/indicators/archive/v2.3.tar.gz" + sha256: "70da7a693ff7a6a283850ab6d62acf628eea17d386488af8918576d0760aef7b" "2.2": url: "https://github.com/p-ranav/indicators/archive/v2.2.tar.gz" sha256: "b768f1b7ca64a413503f72d5460cc617c1458c17fb7a8c0ee503d753e1f20d03" + "2.0": + url: "https://github.com/p-ranav/indicators/archive/v2.0.tar.gz" + sha256: "ef296fa614edcd798db0ac6c3c0f2990682cae8b83724a4db34eed17521c75f7" + "1.9": + url: "https://github.com/p-ranav/indicators/archive/v1.9.tar.gz" + sha256: "842e11fa542ac392a2a2ddee48620a06c3005ec38ca25cf352471e46e18f389d" diff --git a/recipes/indicators/all/conanfile.py b/recipes/indicators/all/conanfile.py index b036d160966a5..e0917bf5ba07b 100644 --- a/recipes/indicators/all/conanfile.py +++ b/recipes/indicators/all/conanfile.py @@ -11,12 +11,12 @@ class IndicatorsConan(ConanFile): name = "indicators" - homepage = "https://github.com/p-ranav/indicators" - url = "https://github.com/conan-io/conan-center-index" description = "Activity Indicators for Modern C++" license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/p-ranav/indicators" + topics = ("activity", "indicator", "loading", "spinner", "animation", "progress", "header-only") settings = "os", "arch", "compiler", "build_type" - topics = ("indicators", "activity", "indicator", "loading", "spinner", "animation", "progress") no_copy_source = True def layout(self): @@ -47,5 +47,8 @@ def package(self): copy(self, pattern="*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): - if self.settings.os == "Linux": + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("pthread") diff --git a/recipes/indicators/all/test_package/CMakeLists.txt b/recipes/indicators/all/test_package/CMakeLists.txt index 454c47bb2cbab..886f8f419992a 100644 --- a/recipes/indicators/all/test_package/CMakeLists.txt +++ b/recipes/indicators/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(indicators REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE indicators::indicators) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/indicators/all/test_package/conanfile.py b/recipes/indicators/all/test_package/conanfile.py index bd7165a553cf4..b9d7f11e89dcd 100644 --- a/recipes/indicators/all/test_package/conanfile.py +++ b/recipes/indicators/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -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 layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +20,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/indicators/all/test_package/test_package.cpp b/recipes/indicators/all/test_package/test_package.cpp index 0ee39928f35da..71cfd4f7b82c4 100644 --- a/recipes/indicators/all/test_package/test_package.cpp +++ b/recipes/indicators/all/test_package/test_package.cpp @@ -50,274 +50,6 @@ int main() { thread.join(); } - { - // - // PROGRESS BAR 2 - // - indicators::ProgressBar p; - p.set_option(option::BarWidth{0}); - p.set_option(option::PrefixText{"Reading package list... "}); - p.set_option(option::Start{""}); - p.set_option(option::Fill{""}); - p.set_option(option::Lead{""}); - p.set_option(option::Remainder{""}); - p.set_option(option::End{""}); - p.set_option(option::ForegroundColor{indicators::Color::white}); - p.set_option(option::ShowPercentage{false}); - p.set_option( - option::FontStyles{std::vector{indicators::FontStyle::bold}}); - auto job = [&p]() { - while (true) { - p.set_option( - option::PrefixText{"Reading package list... " + std::to_string(p.current()) + "% "}); - if (p.current() + 2 >= 100) - p.set_option(option::PrefixText{"Reading package list... Done"}); - p.tick(); - if (p.is_completed()) { - break; - } - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - } - }; - std::thread thread(job); - thread.join(); - } - - { - // - // PROGRESS BAR 3 - // - indicators::ProgressBar p; - p.set_option(option::BarWidth{50}); - p.set_option(option::Start{"["}); - p.set_option(option::Fill{"="}); - p.set_option(option::Lead{">"}); - p.set_option(option::Remainder{" "}); - p.set_option(option::End{"]"}); - p.set_option(option::PostfixText{"Getting started"}); - p.set_option(option::ForegroundColor{indicators::Color::green}); - p.set_option( - option::FontStyles{std::vector{indicators::FontStyle::bold}}); - auto job = [&p]() { - while (true) { - auto ticks = p.current(); - if (ticks > 20 && ticks < 50) - p.set_option(option::PostfixText{"Delaying the inevitable"}); - else if (ticks > 50 && ticks < 80) - p.set_option(option::PostfixText{"Crying quietly"}); - else if (ticks > 80 && ticks < 98) - p.set_option(option::PostfixText{"Almost there"}); - else if (ticks >= 98) - p.set_option(option::PostfixText{"Done"}); - p.tick(); - if (p.is_completed()) - break; - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - } - }; - std::thread thread(job); - thread.join(); - } - - { - // - // PROGRESS BAR 4 - // - std::vector lead_spinner{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}; - indicators::ProgressBar p4; - p4.set_option(option::BarWidth{40}); - p4.set_option(option::Start{""}); - p4.set_option(option::Fill{"⠸"}); - p4.set_option(option::Lead{""}); - p4.set_option(option::Remainder{" "}); - p4.set_option(option::End{""}); - p4.set_option(option::ForegroundColor{indicators::Color::cyan}); - p4.set_option(option::PostfixText{"Restoring system state"}); - p4.set_option(option::ShowPercentage{false}); - p4.set_option( - option::FontStyles{std::vector{indicators::FontStyle::bold}}); - std::atomic index4{0}; - auto job4 = [&p4, &index4, &lead_spinner]() { - while (true) { - p4.set_option(option::PrefixText{"{ " + std::to_string(p4.current()) + "% } "}); - p4.set_option(option::Lead{lead_spinner[index4 % lead_spinner.size()]}); - index4 += 1; - if (p4.current() + 2 >= 100) { - std::cout << std::endl; - p4.set_option(option::ForegroundColor{indicators::Color::red}); - p4.set_option(option::PrefixText{"{ ERROR }"}); - p4.set_option(option::BarWidth{0}); - p4.set_option(option::Start{}); - p4.set_option(option::Fill{}); - p4.set_option(option::Lead{}); - p4.set_option(option::Remainder{}); - p4.set_option(option::ShowPercentage{true}); - p4.set_option(option::PostfixText{"Failed to restore system"}); - p4.mark_as_completed(); - break; - } - p4.tick(); - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - } - }; - std::thread thread4(job4); - thread4.join(); - - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - - { - // - // GOING BACKWARDS - // - indicators::ProgressBar p{ - option::BarWidth{50}, - option::ProgressType{ProgressType::decremental}, - option::Start{"["}, - option::Fill{"■"}, - option::Lead{"■"}, - option::Remainder{"-"}, - option::End{"]"}, - option::ForegroundColor{indicators::Color::white}, - option::PostfixText{"Reverting system restore"}, - option::FontStyles{std::vector{indicators::FontStyle::bold}}}; - auto job = [&p]() { - while (true) { - p.tick(); - if (p.is_completed()) { - p.set_option(option::PostfixText{"Revert complete!"}); - break; - } - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - } - }; - std::thread thread(job); - thread.join(); - } - } - - { - // - // PROGRESS BAR 5 - // - indicators::ProgressSpinner p{ - option::PrefixText{""}, option::PostfixText{"Checking credentials"}, - option::ForegroundColor{indicators::Color::yellow}, - option::SpinnerStates{std::vector{"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"}}, - option::FontStyles{std::vector{indicators::FontStyle::bold}}}; - - auto job = [&p]() { - while (true) { - if (p.is_completed()) { - p.set_option(option::ForegroundColor{indicators::Color::green}); - p.set_option(option::PrefixText{"✔"}); - p.set_option(option::ShowSpinner{false}); - p.set_option(option::ShowPercentage{false}); - p.set_option(option::PostfixText{"Authenticated!"}); - p.mark_as_completed(); - break; - } else - p.tick(); - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - } - }; - std::thread thread(job); - thread.join(); - } - - std::cout << " Compiling mission\n"; - { - // - // PROGRESS BAR 6 - // - indicators::ProgressSpinner p{ - option::PrefixText{" - "}, - option::PostfixText{"Searching for the Moon"}, - option::ForegroundColor{indicators::Color::white}, - option::ShowPercentage{false}, - option::SpinnerStates{std::vector{"▖", "▘", "▝", "▗"}}, - option::FontStyles{std::vector{indicators::FontStyle::bold}}}; - auto job = [&p]() { - while (true) { - auto current = p.current(); - if (current == 24) { - p.set_option(option::PrefixText{" - ✔"}); - p.set_option(option::ShowSpinner{false}); - } else if (current == 25) { - std::cout << std::endl; - p.set_option(option::ShowSpinner{true}); - p.set_option(option::PrefixText{" - "}); - p.set_option(option::PostfixText{"Contacting Kerbal headquarters"}); - } else if (current == 49) { - p.set_option(option::PrefixText{" - ✔"}); - p.set_option(option::ShowSpinner{false}); - } else if (current == 50) { - std::cout << std::endl; - p.set_option(option::ShowSpinner{true}); - p.set_option(option::PrefixText{" - "}); - p.set_option(option::PostfixText{"Designing spaceship"}); - } else if (current == 74) { - p.set_option(option::PrefixText{" - ✔"}); - p.set_option(option::ShowSpinner{false}); - } else if (current == 75) { - std::cout << std::endl; - p.set_option(option::ShowSpinner{true}); - p.set_option(option::PrefixText{" - "}); - p.set_option(option::PostfixText{"Launching rocket"}); - } else if (current == 95) { - p.set_option(option::PrefixText{" - ✔"}); - p.set_option(option::ShowSpinner{false}); - } else if (current == 99) { - std::cout << std::endl; - // - // NESTED PROGRESS BAR - // - indicators::ProgressBar p2{ - option::BarWidth{30}, - option::PrefixText{" - "}, - option::Start{"🌎"}, - option::Fill{"·"}, - option::Lead{"🚀"}, - option::Remainder{" "}, - option::End{"🌑"}, - option::PostfixText{"Achieved low-Earth orbit"}, - option::ForegroundColor{indicators::Color::white}, - option::FontStyles{std::vector{indicators::FontStyle::bold}}}; - std::vector ship_trail{"⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"}; - std::atomic ship_trail_index{0}; - auto job2 = [&p2, &ship_trail_index, &ship_trail]() { - while (true) { - auto ticks = p2.current(); - if (ticks > 20 && ticks < 50) - p2.set_option(option::PostfixText{"Switching to trans-lunar trajectory"}); - else if (ticks > 50 && ticks < 80) - p2.set_option(option::PostfixText{"Transferred to Lunar lander"}); - else if (ticks > 80 && ticks < 98) - p2.set_option(option::PostfixText{"Almost there"}); - else if (ticks >= 98) - p2.set_option(option::PostfixText{"Landed on the Moon"}); - p2.tick(); - ship_trail_index += 1; - if (p2.is_completed()) - break; - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - } - }; - std::thread thread2(job2); - thread2.join(); - p.set_option(indicators::option::PostfixText{"Mission successful!"}); - p.mark_as_completed(); - break; - } - p.tick(); - if (p.is_completed()) - break; - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - } - }; - std::thread thread(job); - thread.join(); - } - // Show cursor show_console_cursor(true); diff --git a/recipes/indicators/all/test_v1_package/CMakeLists.txt b/recipes/indicators/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/indicators/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/indicators/all/test_v1_package/conanfile.py b/recipes/indicators/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/indicators/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/indicators/config.yml b/recipes/indicators/config.yml index 3e719d24708ab..e7a199ca0be29 100644 --- a/recipes/indicators/config.yml +++ b/recipes/indicators/config.yml @@ -1,7 +1,9 @@ versions: - "1.9": + "2.3": + folder: "all" + "2.2": folder: "all" "2.0": folder: "all" - "2.2": + "1.9": folder: "all" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 9893cd476a58f..86a1c7f3eefd5 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -17,6 +17,7 @@ class JasperConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" topics = ("toolkit", "coding", "jpeg", "images") description = "JasPer Image Processing/Coding Tool Kit" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -49,13 +50,12 @@ def requirements(self): if self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.4") + self.requires("libjpeg-turbo/2.1.5") elif self.options.with_libjpeg == "mozjpeg": self.requires("mozjpeg/4.1.1") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -106,17 +106,15 @@ def package(self): # FIXME: Missing CMake alias variables. See https://github.com/conan-io/conan/issues/7691 def _create_cmake_module_variables(self, module_file): - content = textwrap.dedent("""\ + content = textwrap.dedent(f"""\ set(JASPER_FOUND TRUE) if(DEFINED Jasper_INCLUDE_DIR) - set(JASPER_INCLUDE_DIR ${Jasper_INCLUDE_DIR}) + set(JASPER_INCLUDE_DIR ${{Jasper_INCLUDE_DIR}}) endif() if(DEFINED Jasper_LIBRARIES) - set(JASPER_LIBRARIES ${Jasper_LIBRARIES}) - endif() - if(DEFINED Jasper_VERSION) - set(JASPER_VERSION_STRING ${Jasper_VERSION}) + set(JASPER_LIBRARIES ${{Jasper_LIBRARIES}}) endif() + set(JASPER_VERSION_STRING "{self.version}") """) save(self, module_file, content) diff --git a/recipes/jasper/all/test_package/CMakeLists.txt b/recipes/jasper/all/test_package/CMakeLists.txt index 54cd6e29fc23c..7722c78a71d35 100644 --- a/recipes/jasper/all/test_package/CMakeLists.txt +++ b/recipes/jasper/all/test_package/CMakeLists.txt @@ -10,7 +10,7 @@ set(_custom_vars JASPER_VERSION_STRING ) foreach(_custom_var ${_custom_vars}) -if(DEFINED _custom_var) +if(DEFINED ${_custom_var}) message(STATUS "${_custom_var}: ${${_custom_var}}") else() message(FATAL_ERROR "${_custom_var} not defined") diff --git a/recipes/jfalcou-eve/all/conandata.yml b/recipes/jfalcou-eve/all/conandata.yml index 05a5aeff2b5fd..1564d67865638 100644 --- a/recipes/jfalcou-eve/all/conandata.yml +++ b/recipes/jfalcou-eve/all/conandata.yml @@ -1,13 +1,16 @@ sources: - "v2021.10.0": - url: "https://github.com/jfalcou/eve/archive/refs/tags/v2021.10.0.tar.gz" - sha256: "580c40a8244039a700b93ea49fb0affc1c8d3c100eb6dc66368e101753f51e5c" - "v2022.03.0": - url: "https://github.com/jfalcou/eve/archive/refs/tags/v2022.03.0.tar.gz" - sha256: "8bf9faea516806e7dd468e778dcedc81c51f0b2c6a70b9c75987ce12bb759911" - "v2022.09.0": - url: "https://github.com/jfalcou/eve/archive/refs/tags/v2022.09.0.tar.gz" - sha256: "53a4e1944a1080c67380a6d7f4fb42998f1c1db35e2370e02d7853c3ac1e0a33" + "v2023.02.15": + url: "https://github.com/jfalcou/eve/archive/refs/tags/v2023.02.15.tar.gz" + sha256: "7a5fb59c0e6ef3bef3e8b36d62e138d31e7f2a9f1bdfe95a8e96512b207f84c5" "v2022.09.1": url: "https://github.com/jfalcou/eve/archive/refs/tags/v2022.09.1.tar.gz" sha256: "d8d3ae55f0ca2690f8a22883eaaa8251275b76702da0267e8e1725b22c51e978" + "v2022.09.0": + url: "https://github.com/jfalcou/eve/archive/refs/tags/v2022.09.0.tar.gz" + sha256: "53a4e1944a1080c67380a6d7f4fb42998f1c1db35e2370e02d7853c3ac1e0a33" + "v2022.03.0": + url: "https://github.com/jfalcou/eve/archive/refs/tags/v2022.03.0.tar.gz" + sha256: "8bf9faea516806e7dd468e778dcedc81c51f0b2c6a70b9c75987ce12bb759911" + "v2021.10.0": + url: "https://github.com/jfalcou/eve/archive/refs/tags/v2021.10.0.tar.gz" + sha256: "580c40a8244039a700b93ea49fb0affc1c8d3c100eb6dc66368e101753f51e5c" diff --git a/recipes/jfalcou-eve/all/conanfile.py b/recipes/jfalcou-eve/all/conanfile.py index 6761b154e37b6..a417efad5c140 100644 --- a/recipes/jfalcou-eve/all/conanfile.py +++ b/recipes/jfalcou-eve/all/conanfile.py @@ -1,7 +1,6 @@ from conan import ConanFile -from conan.tools import files from conan.tools.build import check_min_cppstd -from conan.tools.files import copy +from conan.tools.files import copy, get from conan.tools.scm import Version from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc @@ -17,25 +16,26 @@ class JfalcouEveConan(ConanFile): description = ("Expressive Velocity Engine - reimplementation of the old " "Boost.SIMD on C++20" ) - homepage = "https://jfalcou.github.io/eve/" - topics = ("cpp", "simd") license = ("MIT", "BSL-1.0") url = "https://github.com/conan-io/conan-center-index" + homepage = "https://jfalcou.github.io/eve/" + topics = ("cpp", "simd", "header-only") 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", - "Visual Studio": "16.9", - "msvc": "1928", - "clang": "13", - "apple-clang": "14"} + return { + "gcc": "11", + "Visual Studio": "16.9", + "msvc": "1928", + "clang": "13", + "apple-clang": "14", + } def configure(self): version = Version(self.version.strip("v")) @@ -47,11 +47,13 @@ def configure(self): def layout(self): basic_layout(self, src_folder="src") + def package_id(self): + self.info.clear() + def validate(self): - # FIXME: Need to use self.info.settings for header-only if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, self._min_cppstd) - if is_msvc(self): + if is_msvc(self) and Version(self.version) != "v2023.02.15": raise ConanInvalidConfiguration("EVE does not support MSVC yet (https://github.com/jfalcou/eve/issues/1022).") def lazy_lt_semver(v1, v2): @@ -66,18 +68,20 @@ def lazy_lt_semver(v1, v2): elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") - def package_id(self): - self.info.clear() - def source(self): - files.get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): copy(self, pattern="*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) copy(self, "LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "eve" - self.cpp_info.names["cmake_find_package_multi"] = "eve" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "eve") self.cpp_info.set_property("cmake_target_name", "eve::eve") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "eve" + self.cpp_info.names["cmake_find_package_multi"] = "eve" diff --git a/recipes/jfalcou-eve/all/test_package/CMakeLists.txt b/recipes/jfalcou-eve/all/test_package/CMakeLists.txt index 07df5491f5a34..27bf0e618e9af 100644 --- a/recipes/jfalcou-eve/all/test_package/CMakeLists.txt +++ b/recipes/jfalcou-eve/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.12) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(eve REQUIRED CONFIG) diff --git a/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt b/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt index 7e31b52213165..999a4a03ed9c9 100644 --- a/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt +++ b/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package) include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") conan_basic_setup(TARGETS) -find_package(eve REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE eve::eve) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/jfalcou-eve/config.yml b/recipes/jfalcou-eve/config.yml index 5db2eb32f0264..7bff48f980652 100644 --- a/recipes/jfalcou-eve/config.yml +++ b/recipes/jfalcou-eve/config.yml @@ -1,9 +1,11 @@ versions: - "v2021.10.0": + "v2023.02.15": folder: all - "v2022.03.0": + "v2022.09.1": folder: all "v2022.09.0": folder: all - "v2022.09.1": + "v2022.03.0": + folder: all + "v2021.10.0": folder: all diff --git a/recipes/joltphysics/all/conanfile.py b/recipes/joltphysics/all/conanfile.py index 875b57e559f57..dc05fc97bdff2 100644 --- a/recipes/joltphysics/all/conanfile.py +++ b/recipes/joltphysics/all/conanfile.py @@ -20,6 +20,7 @@ class JoltPhysicsConan(ConanFile): homepage = "https://github.com/jrouwe/JoltPhysics" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -87,7 +88,7 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.info.settings.compiler.get_safe("cppstd"): + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) def loose_lt_semver(v1, v2): @@ -96,18 +97,17 @@ def loose_lt_semver(v1, v2): min_length = min(len(lv1), len(lv2)) return lv1[:min_length] < lv2[:min_length] - minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) - if minimum_version and loose_lt_semver(str(self.info.settings.compiler.version), minimum_version): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", ) - if is_msvc(self) and self.info.options.shared: + if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} shared not supported with Visual Studio") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/lerc/all/conanfile.py b/recipes/lerc/all/conanfile.py index 367095e05fd6b..c64435c5746f7 100644 --- a/recipes/lerc/all/conanfile.py +++ b/recipes/lerc/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class LercConan(ConanFile): @@ -14,7 +14,8 @@ class LercConan(ConanFile): license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Esri/lerc" - topics = ("lerc", "lerclib", "compression", "decompression", "image", "raster") + topics = ("lerclib", "compression", "decompression", "image", "raster") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -40,20 +41,18 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, self._min_cppstd) - def layout(self): cmake_layout(self, src_folder="src") + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() def build(self): diff --git a/recipes/lerc/all/test_package/conanfile.py b/recipes/lerc/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/lerc/all/test_package/conanfile.py +++ b/recipes/lerc/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index b5ea492609f90..3ac86ca42e82b 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -16,6 +16,7 @@ class LibarchiveConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://libarchive.org" license = "BSD-2-Clause" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -75,6 +76,9 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): if self.options.with_zlib: self.requires("zlib/1.2.13") @@ -91,7 +95,7 @@ def requirements(self): if self.options.with_nettle: self.requires("nettle/3.8.1") if self.options.with_openssl: - self.requires("openssl/3.0.7") + self.requires("openssl/3.0.8") if self.options.with_libb2: self.requires("libb2/20190723") if self.options.with_lz4: @@ -101,23 +105,19 @@ def requirements(self): if self.options.with_lzma: self.requires("xz_utils/5.4.0") if self.options.with_zstd: - self.requires("zstd/1.5.2") + self.requires("zstd/1.5.4") if self.options.get_safe("with_mbedtls"): self.requires("mbedtls/3.2.1") def validate(self): - if self.info.settings.os != "Windows" and self.info.options.with_cng: + if self.settings.os != "Windows" and self.options.with_cng: # TODO: add cng when available in CCI raise ConanInvalidConfiguration("cng recipe not yet available in CCI.") - if self.info.options.with_expat and self.info.options.with_libxml2: + if self.options.with_expat and self.options.with_libxml2: raise ConanInvalidConfiguration("libxml2 and expat options are exclusive. They cannot be used together as XML engine") - def layout(self): - cmake_layout(self, src_folder="src") - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): cmake_deps = CMakeDeps(self) diff --git a/recipes/libcbor/all/conandata.yml b/recipes/libcbor/all/conandata.yml index a14b76e6d87db..e1d0e5f6211c5 100644 --- a/recipes/libcbor/all/conandata.yml +++ b/recipes/libcbor/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.10.2": + url: "https://github.com/PJK/libcbor/archive/v0.10.2.tar.gz" + sha256: "e75f712215d7b7e5c89ef322a09b701f7159f028b8b48978865725f00f79875b" "0.10.1": url: "https://github.com/PJK/libcbor/archive/v0.10.1.tar.gz" sha256: "e8fa0a726b18861c24428561c80b3c95aca95f468df4e2f3e3ac618be12d3047" diff --git a/recipes/libcbor/config.yml b/recipes/libcbor/config.yml index ec48c82691067..7eceffdad45cc 100644 --- a/recipes/libcbor/config.yml +++ b/recipes/libcbor/config.yml @@ -1,4 +1,6 @@ versions: + "0.10.2": + folder: "all" "0.10.1": folder: "all" "0.10.0": diff --git a/recipes/libcds/all/conanfile.py b/recipes/libcds/all/conanfile.py index 678232b29deac..4e60a137e0fd6 100644 --- a/recipes/libcds/all/conanfile.py +++ b/recipes/libcds/all/conanfile.py @@ -2,20 +2,21 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, collect_libs, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class LibcdsConan(ConanFile): name = "libcds" description = "C++11 library of Concurrent Data Structures." license = "BSL-1.0" - topics = ("libcds", "concurrent", "lock-free", "containers", "hazard-pointer", "rcu") + topics = ("concurrent", "lock-free", "containers", "hazard-pointer", "rcu") homepage = "https://github.com/khizmax/libcds" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -27,8 +28,7 @@ class LibcdsConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -36,23 +36,22 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.79.0") + self.requires("boost/1.81.0") def validate(self): - if self.info.settings.compiler.cppstd: + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - if self.info.settings.os == "Macos" and self.info.settings.arch == "armv8": + if self.settings.os == "Macos" and self.settings.arch == "armv8": raise ConanInvalidConfiguration("Macos M1 not supported (yet)") - def layout(self): - cmake_layout(self, src_folder="src") - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -82,13 +81,13 @@ def package(self): def package_info(self): cmake_target = "cds" if self.options.shared else "cds-s" self.cpp_info.set_property("cmake_file_name", "LibCDS") - self.cpp_info.set_property("cmake_target_name", "LibCDS::{}".format(cmake_target)) + self.cpp_info.set_property("cmake_target_name", f"LibCDS::{cmake_target}") # TODO: back to global scope in conan v2 once cmake_find_package* generators removed self.cpp_info.components["_libcds"].libs = collect_libs(self) if self.settings.os == "Windows" and not self.options.shared: self.cpp_info.components["_libcds"].defines = ["CDS_BUILD_STATIC_LIB"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["_libcds"].system_libs = ["pthread"] + self.cpp_info.components["_libcds"].system_libs = ["m", "pthread"] if self.settings.compiler in ["gcc", "clang", "apple-clang"] and self.settings.arch == "x86_64": self.cpp_info.components["_libcds"].cxxflags = ["-mcx16"] self.cpp_info.components["_libcds"].requires = ["boost::boost"] @@ -98,4 +97,4 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "LibCDS" self.cpp_info.components["_libcds"].names["cmake_find_package"] = cmake_target self.cpp_info.components["_libcds"].names["cmake_find_package_multi"] = cmake_target - self.cpp_info.components["_libcds"].set_property("cmake_target_name", "LibCDS::{}".format(cmake_target)) + self.cpp_info.components["_libcds"].set_property("cmake_target_name", f"LibCDS::{cmake_target}") diff --git a/recipes/libcds/all/test_package/conanfile.py b/recipes/libcds/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/libcds/all/test_package/conanfile.py +++ b/recipes/libcds/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/libcds/all/test_v1_package/CMakeLists.txt b/recipes/libcds/all/test_v1_package/CMakeLists.txt index fb01e094e9d0d..0d20897301b68 100644 --- a/recipes/libcds/all/test_v1_package/CMakeLists.txt +++ b/recipes/libcds/all/test_v1_package/CMakeLists.txt @@ -1,15 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(LibCDS REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -if(TARGET LibCDS::cds-s) - target_link_libraries(${PROJECT_NAME} PRIVATE LibCDS::cds-s) -else() - target_link_libraries(${PROJECT_NAME} PRIVATE LibCDS::cds) -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libconfuse/all/conanfile.py b/recipes/libconfuse/all/conanfile.py index 6b372d54a5173..05cfd416ce7a5 100644 --- a/recipes/libconfuse/all/conanfile.py +++ b/recipes/libconfuse/all/conanfile.py @@ -1,14 +1,13 @@ from conan import ConanFile from conan.tools.apple import fix_apple_shared_install_name -from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.env import VirtualBuildEnv from conan.tools.files import 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 -from conan.tools.scm import Version +from conan.tools.microsoft import check_min_vs, is_msvc import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.57.0" class LibConfuseConan(ConanFile): @@ -18,6 +17,7 @@ class LibConfuseConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/martinh/libconfuse" license = "ISC" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -52,25 +52,21 @@ def build_requirements(self): self.tool_requires("msys2/cci.latest") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): env = VirtualBuildEnv(self) env.generate() tc = AutotoolsToolchain(self) - if (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \ - (self.settings.compiler == "msvc" and Version(self.settings.compiler.version) >= "180"): + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): tc.extra_cflags.append("-FS") - tc.generate() - + env = tc.environment() if is_msvc(self): - env = Environment() env.define("CC", "cl -nologo") env.define("CXX", "cl -nologo") env.define("LD", "link -nologo") - env.vars(self).save_script("conanbuild_libconfuse_msvc") + tc.generate(env) def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"), @@ -89,8 +85,7 @@ def build(self): def package(self): copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) autotools = Autotools(self) - # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed - autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + autotools.install() 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, "share")) diff --git a/recipes/libconfuse/all/test_package/conanfile.py b/recipes/libconfuse/all/test_package/conanfile.py index f7963cc87b0ba..bead96008a67b 100644 --- a/recipes/libconfuse/all/test_package/conanfile.py +++ b/recipes/libconfuse/all/test_package/conanfile.py @@ -26,7 +26,7 @@ def test(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") config_path = os.path.join(self.source_folder, "hello.conf") output = StringIO() - self.run(f"{bin_path} {config_path}", env="conanrun", output=output) + self.run(f"{bin_path} {config_path}", output, env="conanrun") text = output.getvalue() print(text) assert "Neighbour" in text diff --git a/recipes/libcurl/all/conandata.yml b/recipes/libcurl/all/conandata.yml index 5fb0b0c8d8687..9f4597c02119c 100644 --- a/recipes/libcurl/all/conandata.yml +++ b/recipes/libcurl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "7.88.1": + url: "https://curl.se/download/curl-7.88.1.tar.gz" + sha256: "cdb38b72e36bc5d33d5b8810f8018ece1baa29a8f215b4495e495ded82bbf3c7" "7.87.0": url: "https://curl.se/download/curl-7.87.0.tar.gz" sha256: "8a063d664d1c23d35526b87a2bf15514962ffdd8ef7fd40519191b3c23e39548" @@ -32,8 +35,3 @@ sources: "7.76.0": url: "https://curl.se/download/curl-7.76.0.tar.gz" sha256: "3b4378156ba09e224008e81dcce854b7ce4d182b1f9cfb97fe5ed9e9c18c6bd3" -patches: - "7.79.0": - - patch_file: "patches/004-no-checksrc.patch" - patch_description: "don't run checksrc" - patch_type: "conan" diff --git a/recipes/libcurl/all/conanfile.py b/recipes/libcurl/all/conanfile.py index 4647e37a78150..08a7ef07e962d 100644 --- a/recipes/libcurl/all/conanfile.py +++ b/recipes/libcurl/all/conanfile.py @@ -178,7 +178,7 @@ def layout(self): def requirements(self): if self.options.with_ssl == "openssl": - self.requires("openssl/1.1.1s") + self.requires("openssl/1.1.1t") elif self.options.with_ssl == "wolfssl": self.requires("wolfssl/5.5.1") if self.options.with_nghttp2: diff --git a/recipes/libcurl/config.yml b/recipes/libcurl/config.yml index 5bb005da00271..db593afdf0814 100644 --- a/recipes/libcurl/config.yml +++ b/recipes/libcurl/config.yml @@ -1,4 +1,6 @@ versions: + "7.88.1": + folder: all "7.87.0": folder: all "7.86.0": diff --git a/recipes/libev/all/conanfile.py b/recipes/libev/all/conanfile.py index 7e2f35fce7815..87c991f808229 100644 --- a/recipes/libev/all/conanfile.py +++ b/recipes/libev/all/conanfile.py @@ -6,10 +6,10 @@ from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.cmake import CMake, CMakeToolchain from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class LibevConan(ConanFile): @@ -20,6 +20,7 @@ class LibevConan(ConanFile): homepage = "http://software.schmorp.de/pkg/libev.html" license = ["BSD-2-Clause", "GPL-2.0-or-later"] + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -52,9 +53,9 @@ def layout(self): basic_layout(self, src_folder="src") def validate(self): - if self.info.settings.os == "Windows" and self.info.options.shared: + if self.settings.os == "Windows" and not is_msvc(self) and self.options.shared: # libtool: error: can't build i686-pc-mingw32 shared library unless -no-undefined is specified - raise ConanInvalidConfiguration(f"{self.ref} can't be built as shared on Windows") + raise ConanInvalidConfiguration(f"{self.ref} can't be built as shared on Windows without Visual Studio") def build_requirements(self): if self._settings_build.os == "Windows" and not is_msvc(self): @@ -63,15 +64,14 @@ def build_requirements(self): self.tool_requires("msys2/cci.latest") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): if is_msvc(self): tc = CMakeToolchain(self) tc.variables["EV_SRC_DIR"] = self.source_folder.replace("\\", "/") tc.generate() - else: + else: env = VirtualBuildEnv(self) env.generate() tc = AutotoolsToolchain(self) @@ -84,7 +84,7 @@ def build(self): cmake = CMake(self) cmake.configure(build_script_folder=base_folder) cmake.build() - else: + else: autotools = Autotools(self) autotools.configure() autotools.make() @@ -94,12 +94,12 @@ def package(self): if is_msvc(self): cmake = CMake(self) cmake.install() - else: + else: autotools = Autotools(self) - autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) - rmdir(self, os.path.join(self.package_folder, "share")) - rm(self, "*.la", os.path.join(self.package_folder, "lib")) - fix_apple_shared_install_name(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["ev"] diff --git a/recipes/libevent/all/conanfile.py b/recipes/libevent/all/conanfile.py index 8ae1637de9bc1..de9d89f8d8faa 100644 --- a/recipes/libevent/all/conanfile.py +++ b/recipes/libevent/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.microsoft import is_msvc, is_msvc_static_runtime import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibeventConan(ConanFile): @@ -38,29 +38,19 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_openssl: - self.requires("openssl/1.1.1s") + self.requires("openssl/1.1.1t") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/libevent/all/test_v1_package/CMakeLists.txt b/recipes/libevent/all/test_v1_package/CMakeLists.txt index a8d5eec5dd24d..0d20897301b68 100644 --- a/recipes/libevent/all/test_v1_package/CMakeLists.txt +++ b/recipes/libevent/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(Libevent REQUIRED core CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE libevent::core) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libfuse/2.x.x/conanfile.py b/recipes/libfuse/2.x.x/conanfile.py index 9859979728600..4cc77383a646b 100644 --- a/recipes/libfuse/2.x.x/conanfile.py +++ b/recipes/libfuse/2.x.x/conanfile.py @@ -15,6 +15,7 @@ class LibfuseConan(ConanFile): license = "LGPL-2.1" description = "The reference implementation of the Linux FUSE interface" topics = ("fuse", "libfuse", "filesystem", "linux") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -35,12 +36,11 @@ def layout(self): basic_layout(self, src_folder="src") def validate(self): - if self.info.settings.os not in ("Linux", "FreeBSD"): + if self.settings.os not in ("Linux", "FreeBSD"): raise ConanInvalidConfiguration("libfuse supports only Linux and FreeBSD") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = AutotoolsToolchain(self) diff --git a/recipes/libfuse/all/conanfile.py b/recipes/libfuse/all/conanfile.py index d9c14cd333993..0f2c7852403e0 100644 --- a/recipes/libfuse/all/conanfile.py +++ b/recipes/libfuse/all/conanfile.py @@ -16,6 +16,7 @@ class LibfuseConan(ConanFile): license = "LGPL-2.1" description = "The reference implementation of the Linux FUSE interface" topics = ("fuse", "libfuse", "filesystem", "linux") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,15 +37,14 @@ def layout(self): basic_layout(self, src_folder="src") def validate(self): - if self.info.settings.os not in ("Linux", "FreeBSD"): + if self.settings.os not in ("Linux", "FreeBSD"): raise ConanInvalidConfiguration("libfuse supports only Linux and FreeBSD") def build_requirements(self): - self.tool_requires("meson/0.64.0") + self.tool_requires("meson/1.0.0") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): env = VirtualBuildEnv(self) diff --git a/recipes/libgcrypt/all/conanfile.py b/recipes/libgcrypt/all/conanfile.py index 7ebc509dad85e..b8053c63a930a 100644 --- a/recipes/libgcrypt/all/conanfile.py +++ b/recipes/libgcrypt/all/conanfile.py @@ -17,6 +17,7 @@ class LibgcryptConan(ConanFile): description = "Libgcrypt is a general purpose cryptographic library originally based on code from GnuPG" topics = ("gcrypt", "gnupg", "gpg", "crypto", "cryptography") license = "LGPL-2.1-or-later" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -37,16 +38,15 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libcap/2.65") + self.requires("libcap/2.66") self.requires("libgpg-error/1.36") def validate(self): - if self.info.settings.os != "Linux": + if self.settings.os != "Linux": raise ConanInvalidConfiguration("This recipe only support Linux. You can contribute Windows and/or Macos support.") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): if not cross_building(self): diff --git a/recipes/libmount/all/conanfile.py b/recipes/libmount/all/conanfile.py index 301b7a46d28de..8152bd466af26 100644 --- a/recipes/libmount/all/conanfile.py +++ b/recipes/libmount/all/conanfile.py @@ -19,6 +19,7 @@ class LibmountConan(ConanFile): homepage = "https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git" license = "GPL-2.0-or-later" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -39,12 +40,11 @@ def layout(self): basic_layout(self, src_folder="src") def validate(self): - if self.info.settings.os != "Linux": + if self.settings.os != "Linux": raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = AutotoolsToolchain(self) diff --git a/recipes/libnop/all/conanfile.py b/recipes/libnop/all/conanfile.py index 88ce3b75bc45e..75343526d3c90 100644 --- a/recipes/libnop/all/conanfile.py +++ b/recipes/libnop/all/conanfile.py @@ -15,11 +15,12 @@ class LibnopConan(ConanFile): "deserializing C++ data types without external code " \ "generators or runtime support libraries." license = "Apache-2.0" - topics = ("libnop", "header-only", "serializer") + topics = ("header-only", "serializer") homepage = "https://github.com/google/libnop" url = "https://github.com/conan-io/conan-center-index" - no_copy_source = True + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _min_cppstd(self): @@ -29,9 +30,13 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return { "Visual Studio": "15", + "msvc": "191", "gcc": "5", } + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -44,12 +49,8 @@ def validate(self): f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", ) - def layout(self): - basic_layout(self, src_folder="src") - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass @@ -59,7 +60,5 @@ def package(self): copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): - self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/libnop/all/test_package/conanfile.py b/recipes/libnop/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/libnop/all/test_package/conanfile.py +++ b/recipes/libnop/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/libnop/all/test_v1_package/CMakeLists.txt b/recipes/libnop/all/test_v1_package/CMakeLists.txt index a9fc5bd47b8bf..0d20897301b68 100644 --- a/recipes/libnop/all/test_v1_package/CMakeLists.txt +++ b/recipes/libnop/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(libnop REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE libnop::libnop) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libnuma/all/conanfile.py b/recipes/libnuma/all/conanfile.py index 3234c3cbc8e68..949eef6d498c5 100644 --- a/recipes/libnuma/all/conanfile.py +++ b/recipes/libnuma/all/conanfile.py @@ -12,10 +12,11 @@ class LibnumaConan(ConanFile): name = "libnuma" description = "NUMA support for Linux." license = "LGPL-2.1-or-later" - topics = ("numa") + topics = ("numa",) homepage = "https://github.com/numactl/numactl" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -39,12 +40,11 @@ def layout(self): basic_layout(self, src_folder="src") def validate(self): - if self.info.settings.os != "Linux": + if self.settings.os != "Linux": raise ConanInvalidConfiguration("libnuma is only supported on Linux") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = AutotoolsToolchain(self) diff --git a/recipes/libpciaccess/all/conanfile.py b/recipes/libpciaccess/all/conanfile.py index 8991eccca99f0..fffe763dbedc4 100644 --- a/recipes/libpciaccess/all/conanfile.py +++ b/recipes/libpciaccess/all/conanfile.py @@ -7,7 +7,7 @@ import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class LibPciAccessConan(ConanFile): @@ -18,6 +18,7 @@ class LibPciAccessConan(ConanFile): homepage = "https://gitlab.freedesktop.org/xorg/lib/libpciaccess" license = "MIT", "X11" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -34,15 +35,12 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): def is_supported(settings): @@ -53,22 +51,19 @@ def is_supported(settings): raise ConanInvalidConfiguration("Unsupported architecture.") def build_requirements(self): - self.tool_requires("libtool/2.4.6") - self.tool_requires("pkgconf/1.7.4") + self.tool_requires("libtool/2.4.7") self.tool_requires("xorg-macros/1.19.3") - - def layout(self): - basic_layout(self, src_folder="src") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") 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"][self.version], strip_root=True) def generate(self): + ms = VirtualBuildEnv(self) + ms.generate() tc = AutotoolsToolchain(self) tc.generate() - ms = VirtualBuildEnv(self) - ms.generate(scope="build") def build(self): autotools = Autotools(self) diff --git a/recipes/libpciaccess/all/test_package/conanfile.py b/recipes/libpciaccess/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/libpciaccess/all/test_package/conanfile.py +++ b/recipes/libpciaccess/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/libpciaccess/all/test_v1_package/CMakeLists.txt b/recipes/libpciaccess/all/test_v1_package/CMakeLists.txt index e01755e70e68b..0d20897301b68 100644 --- a/recipes/libpciaccess/all/test_v1_package/CMakeLists.txt +++ b/recipes/libpciaccess/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(libpciaccess REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE libpciaccess::libpciaccess) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libpq/all/conandata.yml b/recipes/libpq/all/conandata.yml index 6fdf2d404b3db..3f978881fafe5 100644 --- a/recipes/libpq/all/conandata.yml +++ b/recipes/libpq/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "14.7": + url: "https://ftp.postgresql.org/pub/source/v14.7/postgresql-14.7.tar.bz2" + sha256: "cef60f0098fa8101c1546f4254e45b722af5431337945b37af207007630db331" "14.5": url: "https://ftp.postgresql.org/pub/source/v14.5/postgresql-14.5.tar.bz2" sha256: "d4f72cb5fb857c9a9f75ec8cf091a1771272802f2178f0b2e65b7b6ff64f4a30" @@ -21,6 +24,10 @@ sources: url: "https://ftp.postgresql.org/pub/source/v9.6.24/postgresql-9.6.24.tar.gz" sha256: "52947ecc119846eace5164399d173576c0d4a47ec116ae58a46a8fd0c576c7c3" patches: + "14.7": + - patch_file: "patches/14.7/002-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" "14.5": - patch_file: "patches/14.5/002-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." diff --git a/recipes/libpq/all/conanfile.py b/recipes/libpq/all/conanfile.py index 68b3ec7fee8cf..b4e66be74d363 100644 --- a/recipes/libpq/all/conanfile.py +++ b/recipes/libpq/all/conanfile.py @@ -65,7 +65,7 @@ def layout(self): def requirements(self): if self.options.with_openssl: - self.requires("openssl/1.1.1s") + self.requires("openssl/1.1.1t") def build_requirements(self): if is_msvc(self): @@ -122,7 +122,7 @@ def _patch_sources(self): system_libs = [] for dep in host_deps: system_libs.extend(dep.cpp_info.aggregated_components().system_libs) - + linked_system_libs = ", ".join(["'{}.lib'".format(lib) for lib in system_libs]) replace_in_file(self,os.path.join(self.source_folder, "src", "tools", "msvc", "Project.pm"), "libraries => [],", diff --git a/recipes/libpq/all/patches/14.7/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/14.7/002-mingw-build-static-libraries.patch new file mode 100644 index 0000000000000..ce58850706373 --- /dev/null +++ b/recipes/libpq/all/patches/14.7/002-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -358,7 +358,10 @@ else + # Win32 case + + # See notes in src/backend/parser/Makefile about the following two rules +-$(stlib): $(shlib) ++$(stlib): $(OBJS) | $(SHLIB_PREREQS) ++ rm -f $@ ++ $(LINK.static) $@ $^ ++ $(RANLIB) $@ + touch $@ + + # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit +@@ -371,12 +374,12 @@ $(stlib): $(shlib) + # Else we just use --export-all-symbols. + ifeq (,$(SHLIB_EXPORTS)) + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=lib$(NAME).dll.a + else + DLL_DEFFILE = lib$(NAME)dll.def + + $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=lib$(NAME).dll.a + + UC_NAME = $(shell echo $(NAME) | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') + +@@ -452,6 +455,9 @@ endif # not aix + ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' + endif ++ifneq (,$(findstring $(PORTNAME),win32)) ++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).dll.a' ++endif + else # no soname + $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' + endif diff --git a/recipes/libpq/config.yml b/recipes/libpq/config.yml index a2b649a937afd..01599254d7d82 100644 --- a/recipes/libpq/config.yml +++ b/recipes/libpq/config.yml @@ -1,4 +1,6 @@ versions: + "14.7": + folder: all "14.5": folder: all "14.2": diff --git a/recipes/libqrencode/all/conanfile.py b/recipes/libqrencode/all/conanfile.py index 04ae81a7d1841..85ea6578aaa01 100644 --- a/recipes/libqrencode/all/conanfile.py +++ b/recipes/libqrencode/all/conanfile.py @@ -1,10 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.54.0" class LibqrencodeConan(ConanFile): @@ -15,6 +15,7 @@ class LibqrencodeConan(ConanFile): license = "LGPL-2.1-or-later" topics = ("qr-code", "encoding") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,8 +27,7 @@ class LibqrencodeConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -35,29 +35,20 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) tc.variables["WITH_TOOLS"] = False tc.variables["WITH_TESTS"] = False - # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() def _patch_sources(self): diff --git a/recipes/libqrencode/all/test_package/conanfile.py b/recipes/libqrencode/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/libqrencode/all/test_package/conanfile.py +++ b/recipes/libqrencode/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/libqrencode/all/test_v1_package/CMakeLists.txt b/recipes/libqrencode/all/test_v1_package/CMakeLists.txt index d3795115e353f..0d20897301b68 100644 --- a/recipes/libqrencode/all/test_v1_package/CMakeLists.txt +++ b/recipes/libqrencode/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(libqrencode REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE libqrencode::libqrencode) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/librttopo/all/conanfile.py b/recipes/librttopo/all/conanfile.py index 542adb14927a1..ceb7c7bc70c18 100644 --- a/recipes/librttopo/all/conanfile.py +++ b/recipes/librttopo/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.50.2 <1.51.0 || >=1.51.2" +required_conan_version = ">=1.53.0" class LibrttopoConan(ConanFile): @@ -14,10 +14,11 @@ class LibrttopoConan(ConanFile): "standard (ISO 13249 aka SQL/MM) topologies." ) license = "GPL-2.0-or-later" - topics = ("librttopo", "topology", "geospatial", "gis") + topics = ("topology", "geospatial", "gis") homepage = "https://git.osgeo.org/gitea/rttopo/librttopo" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,25 +37,18 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass - - def requirements(self): - self.requires("geos/3.11.0") + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") + def requirements(self): + self.requires("geos/3.11.1", transitive_headers=True, transitive_libs=True) + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/librttopo/all/test_package/conanfile.py b/recipes/librttopo/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/librttopo/all/test_package/conanfile.py +++ b/recipes/librttopo/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/librttopo/all/test_v1_package/CMakeLists.txt b/recipes/librttopo/all/test_v1_package/CMakeLists.txt index 9f3cc8b4782d6..0d20897301b68 100644 --- a/recipes/librttopo/all/test_v1_package/CMakeLists.txt +++ b/recipes/librttopo/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(librttopo REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE librttopo::librttopo) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsamplerate/all/conanfile.py b/recipes/libsamplerate/all/conanfile.py index 274ee4cb75d27..3417ad7c0f9a0 100644 --- a/recipes/libsamplerate/all/conanfile.py +++ b/recipes/libsamplerate/all/conanfile.py @@ -16,10 +16,11 @@ class LibsamplerateConan(ConanFile): "performing sample rate conversion of audio data." ) license = "BSD-2-Clause" - topics = ("libsamplerate", "audio", "resample-audio-files") + topics = ("audio", "resample-audio-files") homepage = "https://github.com/libsndfile/libsamplerate" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -48,7 +49,7 @@ def _cmake_new_enough(self, required_version): import re from io import StringIO output = StringIO() - self.run("cmake --version", output=output) + self.run("cmake --version", output) m = re.search(r"cmake version (\d+\.\d+\.\d+)", output.getvalue()) return Version(m.group(1)) >= required_version except: @@ -58,7 +59,7 @@ def build_requirements(self): if is_apple_os(self) and self.options.shared and Version(self.version) >= "0.2.2": # see https://github.com/libsndfile/libsamplerate/blob/0.2.2/src/CMakeLists.txt#L110-L119 if not self._cmake_new_enough("3.17"): - self.tool_requires("cmake/3.25.1") + self.tool_requires("cmake/3.25.2") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libsgp4/all/conanfile.py b/recipes/libsgp4/all/conanfile.py index f2f49822e5c2a..740a3e58743e5 100644 --- a/recipes/libsgp4/all/conanfile.py +++ b/recipes/libsgp4/all/conanfile.py @@ -1,20 +1,21 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class Libsgp4Conan(ConanFile): name = "libsgp4" description = "C++11 library for SGP4 Simplified perturbations model." license = "Apache-2.0" - topics = ("libsgp4", "sgp4", "orbit", "satellite", "perturbation") + topics = ("sgp4", "orbit", "satellite", "perturbation") homepage = "https://github.com/dnwrnr/sgp4" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,8 +27,7 @@ class Libsgp4Conan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -35,18 +35,17 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - - def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, 11) + self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -66,3 +65,5 @@ def package(self): def package_info(self): self.cpp_info.libs = ["sgp4s" if self.options.shared else "sgp4"] self.cpp_info.includedirs.append(os.path.join("include", "SGP4")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libsgp4/all/test_package/conanfile.py b/recipes/libsgp4/all/test_package/conanfile.py index c861d41a6d58c..9c4155c807a23 100644 --- a/recipes/libsgp4/all/test_package/conanfile.py +++ b/recipes/libsgp4/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/libsgp4/all/test_v1_package/CMakeLists.txt b/recipes/libsgp4/all/test_v1_package/CMakeLists.txt index a84c36978ba7f..0d20897301b68 100644 --- a/recipes/libsgp4/all/test_v1_package/CMakeLists.txt +++ b/recipes/libsgp4/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(libsgp4 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE libsgp4::libsgp4) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsmacker/all/conanfile.py b/recipes/libsmacker/all/conanfile.py index 9e27911242b4d..a26d4116c39b3 100644 --- a/recipes/libsmacker/all/conanfile.py +++ b/recipes/libsmacker/all/conanfile.py @@ -1,14 +1,13 @@ from conan import ConanFile from conan.tools.apple import fix_apple_shared_install_name -from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc, unix_path -from conan.tools.scm import Version +from conan.tools.microsoft import check_min_vs, is_msvc import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.57.0" class LibsmackerConan(ConanFile): @@ -19,6 +18,7 @@ class LibsmackerConan(ConanFile): license = "LGPL-2.1-or-later" description = "A C library for decoding .smk Smacker Video files" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -57,25 +57,21 @@ def build_requirements(self): self.tool_requires("msys2/cci.latest") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): env = VirtualBuildEnv(self) env.generate() tc = AutotoolsToolchain(self) - if (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \ - (self.settings.compiler == "msvc" and Version(self.settings.compiler.version) >= "180"): + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): tc.extra_cflags.append("-FS") - tc.generate() - + env = tc.environment() if is_msvc(self): - env = Environment() env.define("CC", "cl -nologo") env.define("CXX", "cl -nologo") env.define("LD", "link -nologo") - env.vars(self).save_script("conanbuild_libsmacker_msvc") + tc.generate(env) def build(self): apply_conandata_patches(self) @@ -87,8 +83,7 @@ def build(self): def package(self): copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) autotools = Autotools(self) - # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed - autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + autotools.install() rm(self, "*.la", os.path.join(self.package_folder, "lib")) fix_apple_shared_install_name(self) if is_msvc(self) and self.options.shared: diff --git a/recipes/libsndfile/all/conanfile.py b/recipes/libsndfile/all/conanfile.py index b9ca5213b1f9d..ef6e2406db761 100644 --- a/recipes/libsndfile/all/conanfile.py +++ b/recipes/libsndfile/all/conanfile.py @@ -1,11 +1,11 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class LibsndfileConan(ConanFile): @@ -17,8 +17,8 @@ class LibsndfileConan(ConanFile): "Libsndfile is a library of C routines for reading and writing files " "containing sampled audio data." ) - topics = ("audio") - + topics = ("audio",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -40,8 +40,7 @@ class LibsndfileConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -54,6 +53,9 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): if self.options.get_safe("with_alsa"): self.requires("libalsa/1.2.7.2") @@ -63,12 +65,9 @@ def requirements(self): self.requires("flac/1.4.2") self.requires("opus/1.3.1") if self.options.get_safe("with_mpeg", False): - self.requires("mpg123/1.29.3") + self.requires("mpg123/1.31.2") self.requires("libmp3lame/3.100") - def layout(self): - cmake_layout(self, src_folder="src") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -97,8 +96,6 @@ def generate(self): tc.variables["ENABLE_MPEG"] = self.options.with_mpeg # Fix iOS/tvOS/watchOS tc.variables["CMAKE_MACOSX_BUNDLE"] = False - # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) deps.generate() @@ -140,12 +137,9 @@ def package_info(self): elif self.settings.os == "Windows": self.cpp_info.components["sndfile"].system_libs.append("winmm") - if self.options.programs: - 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) - # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "SndFile" self.cpp_info.names["cmake_find_package_multi"] = "SndFile" self.cpp_info.components["sndfile"].set_property("cmake_target_name", "SndFile::sndfile") + if self.options.programs: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libsndfile/all/test_package/conanfile.py b/recipes/libsndfile/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/libsndfile/all/test_package/conanfile.py +++ b/recipes/libsndfile/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/libspatialindex/all/conanfile.py b/recipes/libspatialindex/all/conanfile.py index a24aef3d7e07c..f0e08820bfdc4 100644 --- a/recipes/libspatialindex/all/conanfile.py +++ b/recipes/libspatialindex/all/conanfile.py @@ -16,7 +16,7 @@ class LibspatialindexConan(ConanFile): homepage = "https://github.com/libspatialindex/libspatialindex" url = "https://github.com/conan-io/conan-center-index" - package_type = "explicit" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/recipes/libsystemd/all/conanfile.py b/recipes/libsystemd/all/conanfile.py index 6ea4caf383334..fd17db6680de2 100644 --- a/recipes/libsystemd/all/conanfile.py +++ b/recipes/libsystemd/all/conanfile.py @@ -3,13 +3,14 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import apply_conandata_patches, copy, get, \ - replace_in_file +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file +from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain from conan.tools.scm import Version -required_conan_version = ">=1.50.2" +required_conan_version = ">=1.53.0" class LibsystemdConan(ConanFile): @@ -18,8 +19,9 @@ class LibsystemdConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.freedesktop.org/wiki/Software/systemd/" description = "System and Service Manager API library" - topics = ("systemd", "libsystemd", "service", "manager") - settings = "os", "compiler", "build_type", "arch" + topics = ("systemd", "service", "manager") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -36,45 +38,41 @@ class LibsystemdConan(ConanFile): "with_xz": True, "with_zstd": True, } - generators = "PkgConfigDeps", "VirtualBuildEnv" - exports_sources = "patches/**" + + def export_sources(self): + export_conandata_patches(self) def configure(self): if self.options.shared: del self.options.fPIC - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass - - def validate(self): - if self.info.settings.os != "Linux": - raise ConanInvalidConfiguration("Only Linux supported") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") - def build_requirements(self): - self.tool_requires("meson/0.63.1") - self.tool_requires("m4/1.4.19") - self.tool_requires("gperf/3.1") - self.tool_requires("pkgconf/1.7.4") + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("libcap/2.65") + self.requires("libcap/2.66") self.requires("libmount/2.36.2") if self.options.with_selinux: self.requires("libselinux/3.3") if self.options.with_lz4: - self.requires("lz4/1.9.3") + self.requires("lz4/1.9.4") if self.options.with_xz: - self.requires("xz_utils/5.2.5") + self.requires("xz_utils/5.4.0") if self.options.with_zstd: - self.requires("zstd/1.5.2") + self.requires("zstd/1.5.4") - def layout(self): - basic_layout(self, src_folder="source") + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("Only Linux supported") + + def build_requirements(self): + self.tool_requires("meson/1.0.0") + self.tool_requires("m4/1.4.19") + self.tool_requires("gperf/3.1") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -90,6 +88,9 @@ def _so_version(self): return "" def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MesonToolchain(self) tc.project_options["selinux"] = ("true" if self.options.with_selinux else "false") @@ -145,11 +146,14 @@ def generate(self): # is also required to provide a path to the header files directly to # the compiler. for dependency in self.dependencies.values(): - for includedir in dependency.cpp_info.includedirs: - tc.c_args.append("-I{}".format(includedir)) + for includedir in dependency.cpp_info.aggregated_components().includedirs: + tc.c_args.append(f"-I{includedir}") tc.generate() + deps = PkgConfigDeps(self) + deps.generate() + def _patch_sources(self): apply_conandata_patches(self) @@ -164,7 +168,7 @@ def build(self): meson.configure() target = ("systemd:shared_library" if self.options.shared else "systemd:static_library") - meson.build(target="version.h {}".format(target)) + meson.build(target=f"version.h {target}") def package(self): copy(self, "LICENSE.LGPL2.1", self.source_folder, @@ -184,23 +188,10 @@ def package(self): os.path.join(self.package_folder, "lib")) def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libsystemd") + self.cpp_info.set_property("component_version", str(Version(self.version).major)) self.cpp_info.libs = ["systemd"] - # FIXME: this `.version` should only happen for the `pkg_config` - # generator (see https://github.com/conan-io/conan/issues/8202) - # systemd uses only major version in its .pc file - self.cpp_info.version = str(Version(self.version).major) - self.cpp_info.set_property("component_version", - str(Version(self.version).major)) self.cpp_info.system_libs = ["rt", "pthread", "dl"] - # FIXME: remove this block and set required_conan_version to >=1.51.1 - # (see https://github.com/conan-io/conan/pull/11790) - self.cpp_info.requires = ["libcap::libcap", "libmount::libmount"] - if self.options.with_selinux: - self.cpp_info.requires.append("libselinux::libselinux") - if self.options.with_lz4: - self.cpp_info.requires.append("lz4::lz4") - if self.options.with_xz: - self.cpp_info.requires.append("xz_utils::xz_utils") - if self.options.with_zstd: - self.cpp_info.requires.append("zstd::zstd") + # TODO: to remove in conan v2 + self.cpp_info.version = str(Version(self.version).major) diff --git a/recipes/libsystemd/all/test_package/CMakeLists.txt b/recipes/libsystemd/all/test_package/CMakeLists.txt index 16f08025b6a67..63d72a88f1cb3 100644 --- a/recipes/libsystemd/all/test_package/CMakeLists.txt +++ b/recipes/libsystemd/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.15) -project(PackageTest LANGUAGES C) +cmake_minimum_required(VERSION 3.6) +project(test_package LANGUAGES C) find_package(PkgConfig REQUIRED) pkg_check_modules(SYSTEMD REQUIRED IMPORTED_TARGET libsystemd) -add_executable(example example.c) -target_link_libraries(example PRIVATE PkgConfig::SYSTEMD) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::SYSTEMD) diff --git a/recipes/libsystemd/all/test_package/conanfile.py b/recipes/libsystemd/all/test_package/conanfile.py index 0aeda735af009..4fc0d2de603bc 100644 --- a/recipes/libsystemd/all/test_package/conanfile.py +++ b/recipes/libsystemd/all/test_package/conanfile.py @@ -3,30 +3,22 @@ from conan import ConanFile from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout -from conan.tools.env import Environment -required_conan_version = ">=1.38.0" - -class LibsystemdTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "PkgConfigDeps", "VirtualBuildEnv" test_type = "explicit" + def layout(self): + cmake_layout(self) + def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("pkgconf/1.7.4") - - def layout(self): - cmake_layout(self) - - def generate(self): - env = Environment() - env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) - envvars = env.vars(self) - envvars.save_script("pkg_config") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") def build(self): cmake = CMake(self) @@ -35,5 +27,5 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "example") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/libsystemd/all/test_package/example.c b/recipes/libsystemd/all/test_package/test_package.c similarity index 100% rename from recipes/libsystemd/all/test_package/example.c rename to recipes/libsystemd/all/test_package/test_package.c diff --git a/recipes/libsystemd/all/test_v1_package/CMakeLists.txt b/recipes/libsystemd/all/test_v1_package/CMakeLists.txt index 4729ae06ab8cf..0d20897301b68 100644 --- a/recipes/libsystemd/all/test_v1_package/CMakeLists.txt +++ b/recipes/libsystemd/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.15) -project(PackageTest LANGUAGES C) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(PkgConfig REQUIRED) -pkg_check_modules(SYSTEMD REQUIRED IMPORTED_TARGET libsystemd) - -add_executable(example ../test_package/example.c) -target_link_libraries(example PRIVATE PkgConfig::SYSTEMD) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsystemd/all/test_v1_package/conanfile.py b/recipes/libsystemd/all/test_v1_package/conanfile.py index 1db9d3daee488..e6b0fdb8110e8 100644 --- a/recipes/libsystemd/all/test_v1_package/conanfile.py +++ b/recipes/libsystemd/all/test_v1_package/conanfile.py @@ -1,16 +1,13 @@ +from conans import ConanFile, CMake, tools import os -from conan import ConanFile -from conan.tools.build import can_run -from conans import CMake - -class LibsystemdTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" generators = "cmake", "pkg_config" def build_requirements(self): - self.tool_requires("pkgconf/1.7.4") + self.build_requires("pkgconf/1.9.3") def build(self): cmake = CMake(self) @@ -18,6 +15,6 @@ def build(self): cmake.build() def test(self): - if can_run(self): - bin_path = os.path.join("bin", "example") + 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/libtar/all/conanfile.py b/recipes/libtar/all/conanfile.py index 60120c5cb3ca8..ee12aac6802cc 100644 --- a/recipes/libtar/all/conanfile.py +++ b/recipes/libtar/all/conanfile.py @@ -1,5 +1,6 @@ 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 VirtualRunEnv from conan.tools.files import copy, get, replace_in_file, rm, rmdir @@ -7,16 +8,17 @@ from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class LibTarConan(ConanFile): name = "libtar" description = "libtar is a library for manipulating tar files from within C programs." - topics = ("tar") + topics = ("tar",) license = "BSD-3-Clause" homepage = "https://repo.or.cz/libtar.git" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -47,17 +49,19 @@ def requirements(self): self.requires("zlib/1.2.13") def validate(self): - if self.info.settings.os == "Windows": + if self.settings.os == "Windows": raise ConanInvalidConfiguration("libtar does not support Windows") def build_requirements(self): self.tool_requires("libtool/2.4.7") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") tc = AutotoolsToolchain(self) tc.configure_args.extend([ "--with-zlib" if self.options.with_zlib else "--without-zlib", @@ -65,9 +69,6 @@ def generate(self): tc.generate() deps = AutotoolsDeps(self) deps.generate() - if not cross_building(self): - env = VirtualRunEnv(self) - env.generate(scope="build") def _patch_sources(self): if self.options.with_zlib: @@ -75,15 +76,13 @@ def _patch_sources(self): self, os.path.join(self.source_folder, "configure.ac"), "AC_CHECK_LIB([z], [gzread])", - "AC_CHECK_LIB([{}], [gzread])".format(self.dependencies["zlib"].cpp_info.libs[0]), + "AC_CHECK_LIB([{}], [gzread])".format(self.dependencies["zlib"].cpp_info.aggregated_components().libs[0]), ) def build(self): self._patch_sources() autotools = Autotools(self) autotools.autoreconf() - # TODO: use fix_apple_shared_install_name(self) instead, once https://github.com/conan-io/conan/issues/12107 fixed - replace_in_file(self, os.path.join(self.source_folder, "configure"), "-install_name \\$rpath/", "-install_name @rpath/") autotools.configure() autotools.make() @@ -93,11 +92,10 @@ def package(self): autotools.install() rm(self, "*.la", os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["tar"] # TODO: to remove in conan v2 - bin_path = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bin_path}") - self.deps_env_info.PATH.append(bin_path) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libtar/all/test_package/conanfile.py b/recipes/libtar/all/test_package/conanfile.py index cdb17258fdda1..3ca1fe65b7b4d 100644 --- a/recipes/libtar/all/test_package/conanfile.py +++ b/recipes/libtar/all/test_package/conanfile.py @@ -16,7 +16,7 @@ def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str) + self.requires(self.tested_reference_str, run=True) def build(self): cmake = CMake(self) @@ -46,4 +46,4 @@ def test(self): if extracted_text != "secret text\n": raise ConanException(f"File not loaded correctly. Got \"{repr(extracted_text)}\"") - self.run("libtar -t test.tar", run_environment=True) + self.run("libtar -t test.tar", env="conanrun") diff --git a/recipes/libtiff/all/conanfile.py b/recipes/libtiff/all/conanfile.py index a288f9366d76a..511c05c6ee477 100644 --- a/recipes/libtiff/all/conanfile.py +++ b/recipes/libtiff/all/conanfile.py @@ -17,6 +17,7 @@ class LibtiffConan(ConanFile): homepage = "http://www.simplesystems.org/libtiff" topics = ("tiff", "image", "bigtiff", "tagged-image-file-format") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -82,29 +83,28 @@ def requirements(self): if self.options.zlib: self.requires("zlib/1.2.13") if self.options.get_safe("libdeflate"): - self.requires("libdeflate/1.15") + self.requires("libdeflate/1.17") if self.options.lzma: - self.requires("xz_utils/5.2.5") + self.requires("xz_utils/5.4.0") if self.options.jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.4") + self.requires("libjpeg-turbo/2.1.5") elif self.options.jpeg == "mozjpeg": self.requires("mozjpeg/4.1.1") if self.options.jbig: self.requires("jbig/20160605") if self.options.get_safe("zstd"): - self.requires("zstd/1.5.2") + self.requires("zstd/1.5.4") if self.options.get_safe("webp"): - self.requires("libwebp/1.2.4") + self.requires("libwebp/1.3.0") def validate(self): if self.options.get_safe("libdeflate") and not self.options.zlib: raise ConanInvalidConfiguration("libtiff:libdeflate=True requires libtiff:zlib=True") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/libuuid/all/conanfile.py b/recipes/libuuid/all/conanfile.py index 83191c7fd1923..6de5bf2a00bf5 100644 --- a/recipes/libuuid/all/conanfile.py +++ b/recipes/libuuid/all/conanfile.py @@ -17,6 +17,7 @@ class LibuuidConan(ConanFile): homepage = "https://sourceforge.net/projects/libuuid/" license = "BSD-3-Clause" topics = "id", "identifier", "unique", "uuid" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -31,7 +32,7 @@ def export_sources(self): export_conandata_patches(self) def config_options(self): - if self.settings.os == 'Windows': + if self.settings.os == "Windows": del self.options.fPIC def configure(self): @@ -44,23 +45,22 @@ def layout(self): basic_layout(self, src_folder="src") def validate(self): - if self.info.settings.os == "Windows": + if self.settings.os == "Windows": raise ConanInvalidConfiguration(f"{self.ref} is not supported on Windows") def build_requirements(self): self.tool_requires("libtool/2.4.7") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + env = VirtualBuildEnv(self) + env.generate() tc = AutotoolsToolchain(self) if "x86" in self.settings.arch: tc.extra_cflags.append("-mstackrealign") tc.generate() - env = VirtualBuildEnv(self) - env.generate() def build(self): apply_conandata_patches(self) diff --git a/recipes/libxls/all/conanfile.py b/recipes/libxls/all/conanfile.py index 007beb8962389..32c04966aac0e 100644 --- a/recipes/libxls/all/conanfile.py +++ b/recipes/libxls/all/conanfile.py @@ -1,14 +1,17 @@ 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, rm, rmdir, save from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps from conan.tools.layout import basic_layout -from conan.tools.files import export_conandata_patches, apply_conandata_patches, rmdir, copy, save, get, rm -from conan.tools.apple import is_apple_os -from conan.tools.build import cross_building +from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" + class LibxlsConan(ConanFile): name = "libxls" @@ -17,6 +20,7 @@ class LibxlsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/libxls/libxls/" topics = ("excel", "xls") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,6 +33,10 @@ class LibxlsConan(ConanFile): "with_cli": False, } + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + def export_sources(self): export_conandata_patches(self) @@ -43,34 +51,41 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") def layout(self): - basic_layout(self, src_folder='src') + basic_layout(self, src_folder="src") def requirements(self): if not is_apple_os(self): self.requires("libiconv/1.17") def validate(self): - if self.settings.os == "Windows": - raise ConanInvalidConfiguration(f"{self.ref} doesn't support Windows (yet). Contributions are always welcomed") + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio (yet). Contributions are always welcomed") def build_requirements(self): - if self.settings.os == "Windows": - 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, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def generate(self): - toolchain = AutotoolsToolchain(self) + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) if cross_building(self): - toolchain.configure_args.append("ac_cv_func_malloc_0_nonnull=yes") - toolchain.configure_args.append("ac_cv_func_realloc_0_nonnull=yes") - toolchain.generate() + tc.configure_args.append("ac_cv_func_malloc_0_nonnull=yes") + tc.configure_args.append("ac_cv_func_realloc_0_nonnull=yes") + tc.generate() deps = AutotoolsDeps(self) deps.generate() def _patch_sources(self): + apply_conandata_patches(self) config_h_content = """ #define HAVE_ICONV 1 #define ICONV_CONST @@ -79,7 +94,6 @@ def _patch_sources(self): if self.settings.os == "Macos": config_h_content += "#define HAVE_XLOCALE_H 1\n" save(self, os.path.join(self.source_folder, "include", "config.h"), config_h_content) - apply_conandata_patches(self) def build(self): self._patch_sources() @@ -94,20 +108,10 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libxls") self.cpp_info.libs = ["xlsreader"] - if is_apple_os(self): self.cpp_info.system_libs.append("iconv") - - self.cpp_info.set_property("cmake_file_name", "libxls") - self.cpp_info.set_property("cmake_target_name", "libxls::libxls") - self.cpp_info.set_property("pkg_config_name", "libxls") - - if not is_apple_os(self): - self.cpp_info.requires.append("libiconv::libiconv") - - # TODO: Remove in Conan 2.0 - self.cpp_info.names["cmake_find_package"] = "libxls" - self.cpp_info.names["cmake_find_package_multi"] = "libxls" diff --git a/recipes/libxml2/all/conanfile.py b/recipes/libxml2/all/conanfile.py index 22f3f4151fbd6..04bda9f32e243 100644 --- a/recipes/libxml2/all/conanfile.py +++ b/recipes/libxml2/all/conanfile.py @@ -1,17 +1,18 @@ from conan import ConanFile -from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv -from conan.tools.scm import Version +from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import cross_building, build_jobs +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import copy, get, rename, rm, rmdir, replace_in_file, save, chdir, mkdir from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path, VCVars +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path, NMakeDeps, NMakeToolchain +from conan.tools.scm import Version import os import itertools import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.55.0" class Libxml2Conan(ConanFile): @@ -95,7 +96,7 @@ def requirements(self): if self.options.zlib: self.requires("zlib/1.2.13") if self.options.lzma: - self.requires("xz_utils/5.2.5") + self.requires("xz_utils/5.4.0") if self.options.iconv: self.requires("libiconv/1.17", transitive_headers=True, transitive_libs=True) if self.options.icu: @@ -104,26 +105,22 @@ def requirements(self): def build_requirements(self): if not (is_msvc(self) or self._is_mingw_windows): if self.options.zlib or self.options.lzma or self.options.icu: - self.tool_requires("pkgconf/1.9.3") + if not self.conf.get("tools.gnu:pkg_config", 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", check_type=str): self.tool_requires("msys2/cci.latest") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): if is_msvc(self): - tc = VCVars(self) + tc = NMakeToolchain(self) tc.generate() - env = Environment() - # TODO: no conan v2 build helper for NMake yet (see https://github.com/conan-io/conan/issues/12188) - # So populate CL with AutotoolsToolchain cflags - c_flags = AutotoolsToolchain(self).cflags - if c_flags: - env.define("CL", c_flags) - env.vars(self).save_script("conanbuildenv_nmake") + deps = NMakeDeps(self) + deps.generate() elif self._is_mingw_windows: pass # nothing to do for mingw? it calls mingw-make directly else: @@ -277,10 +274,6 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "win32", makefile), "install-libs : all", "install-libs :") - # relocatable shared lib on macOS - replace_in_file(self, os.path.join(self.source_folder, "configure"), - "-install_name \\$rpath/", - "-install_name @rpath/") def build(self): self._patch_sources() @@ -333,6 +326,7 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) for header in ["win32config.h", "wsockcompat.h"]: copy(self, pattern=header, src=os.path.join(self.source_folder, "include"), @@ -344,33 +338,31 @@ def package(self): def _create_cmake_module_variables(self, module_file): # FIXME: also define LIBXML2_XMLLINT_EXECUTABLE variable - content = textwrap.dedent("""\ + content = textwrap.dedent(f"""\ set(LibXml2_FOUND TRUE) set(LIBXML2_FOUND TRUE) if(DEFINED LibXml2_INCLUDE_DIRS) - set(LIBXML2_INCLUDE_DIR ${LibXml2_INCLUDE_DIRS}) - set(LIBXML2_INCLUDE_DIRS ${LibXml2_INCLUDE_DIRS}) + set(LIBXML2_INCLUDE_DIR ${{LibXml2_INCLUDE_DIRS}}) + set(LIBXML2_INCLUDE_DIRS ${{LibXml2_INCLUDE_DIRS}}) elseif(DEFINED libxml2_INCLUDE_DIRS) - set(LIBXML2_LIBRARIES ${libxml2_INCLUDE_DIRS}) - set(LIBXML2_LIBRARY ${libxml2_INCLUDE_DIRS}) + set(LIBXML2_LIBRARIES ${{libxml2_INCLUDE_DIRS}}) + set(LIBXML2_LIBRARY ${{libxml2_INCLUDE_DIRS}}) endif() if(DEFINED LibXml2_LIBRARIES) - set(LIBXML2_LIBRARIES ${LibXml2_LIBRARIES}) - set(LIBXML2_LIBRARY ${LibXml2_LIBRARIES}) + set(LIBXML2_LIBRARIES ${{LibXml2_LIBRARIES}}) + set(LIBXML2_LIBRARY ${{LibXml2_LIBRARIES}}) elseif(DEFINED libxml2_LIBRARIES) - set(LIBXML2_LIBRARIES ${libxml2_LIBRARIES}) - set(LIBXML2_LIBRARY ${libxml2_LIBRARIES}) + set(LIBXML2_LIBRARIES ${{libxml2_LIBRARIES}}) + set(LIBXML2_LIBRARY ${{libxml2_LIBRARIES}}) endif() if(DEFINED LibXml2_DEFINITIONS) - set(LIBXML2_DEFINITIONS ${LibXml2_DEFINITIONS}) + set(LIBXML2_DEFINITIONS ${{LibXml2_DEFINITIONS}}) elseif(DEFINED libxml2_DEFINITIONS) - set(LIBXML2_DEFINITIONS ${libxml2_DEFINITIONS}) - endif() - if(DEFINED LibXml2_VERSION) - set(LIBXML2_VERSION_STRING ${LibXml2_VERSION}) - elseif(DEFINED libxml2_VERSION) - set(LIBXML2_VERSION_STRING ${libxml2_VERSION}) + set(LIBXML2_DEFINITIONS ${{libxml2_DEFINITIONS}}) + else() + set(LIBXML2_DEFINITIONS "") endif() + set(LIBXML2_VERSION_STRING "{self.version}") """) save(self, module_file, content) diff --git a/recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt b/recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt index 90d37ee9afb23..de255480513cc 100644 --- a/recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt +++ b/recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt @@ -18,7 +18,7 @@ set(_custom_vars LIBXML2_VERSION_STRING ) foreach(_custom_var ${_custom_vars}) - if(DEFINED _custom_var) + if(DEFINED ${_custom_var}) message(STATUS "${_custom_var}: ${${_custom_var}}") else() message(FATAL_ERROR "${_custom_var} not defined") diff --git a/recipes/linux-syscall-support/all/conanfile.py b/recipes/linux-syscall-support/all/conanfile.py index cf1a5361651ae..4f6891e057476 100644 --- a/recipes/linux-syscall-support/all/conanfile.py +++ b/recipes/linux-syscall-support/all/conanfile.py @@ -1,15 +1,21 @@ import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.50.0" class LinuxSyscallSupportConan(ConanFile): name = "linux-syscall-support" description = "Linux Syscall Support provides a header file that can be included into your application whenever you need to make direct system calls." + license = "BSD-3-Clause" + topics = ("linux", "syscall", "chromium") homepage = "https://chromium.googlesource.com/linux-syscall-support" url = "https://github.com/conan-io/conan-center-index" - topics = ("conan", "linux", "syscall", "chromium") - license = "BSD-3-Clause" + + package_type = "header-library" settings = "os" no_copy_source = True @@ -17,11 +23,14 @@ def configure(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration("{} supported only on Linux".format(self.name)) + def layout(self): + basic_layout(self, src_folder="src") + def source(self): - tools.get(**self.conan_data["sources"][self.version]) + get(self, **self.conan_data["sources"][self.version]) def package_id(self): - self.info.header_only() + self.info.clear() def _extract_license(self): with open(os.path.join(self.source_folder, "linux_syscall_support.h")) as f: @@ -29,9 +38,12 @@ def _extract_license(self): license_content = [] for i in range(0, 29): license_content.append(content_lines[i][3:-1]) - tools.save("LICENSE", "\n".join(license_content)) + return "\n".join(license_content) def package(self): - self.copy(pattern="linux_syscall_support.h", dst="include") - self._extract_license() - self.copy(pattern="LICENSE", dst="licenses", keep_path=False) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + copy(self, "linux_syscall_support.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/linux-syscall-support/all/test_package/CMakeLists.txt b/recipes/linux-syscall-support/all/test_package/CMakeLists.txt index 4e6705f7300ba..d0ccff7dbe735 100644 --- a/recipes/linux-syscall-support/all/test_package/CMakeLists.txt +++ b/recipes/linux-syscall-support/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(linux-syscall-support REQUIRED CONFIG) -add_executable(example example.c) -target_link_libraries(example ${CONAN_LIBS}) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE linux-syscall-support::linux-syscall-support) diff --git a/recipes/linux-syscall-support/all/test_package/conanfile.py b/recipes/linux-syscall-support/all/test_package/conanfile.py index 7b99c9826a2c7..e845ae751a301 100644 --- a/recipes/linux-syscall-support/all/test_package/conanfile.py +++ b/recipes/linux-syscall-support/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 BlazeTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" +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) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "example") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/linux-syscall-support/all/test_package/example.c b/recipes/linux-syscall-support/all/test_package/test_package.c similarity index 100% rename from recipes/linux-syscall-support/all/test_package/example.c rename to recipes/linux-syscall-support/all/test_package/test_package.c diff --git a/recipes/linux-syscall-support/all/test_v1_package/CMakeLists.txt b/recipes/linux-syscall-support/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..961b416af6b07 --- /dev/null +++ b/recipes/linux-syscall-support/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/linux-syscall-support/all/test_v1_package/conanfile.py b/recipes/linux-syscall-support/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/linux-syscall-support/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/lodepng/all/conanfile.py b/recipes/lodepng/all/conanfile.py index 46fefaf886180..cf5e7257fe6f8 100644 --- a/recipes/lodepng/all/conanfile.py +++ b/recipes/lodepng/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.microsoft import is_msvc, is_msvc_static_runtime import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class LodepngConan(ConanFile): @@ -16,6 +16,7 @@ class LodepngConan(ConanFile): homepage = "https://github.com/lvandeve/lodepng" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -34,18 +35,17 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("lodepng shared doesn't support Visual Studio with static runtime") - def layout(self): - cmake_layout(self, src_folder="src") - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -64,3 +64,5 @@ def package(self): def package_info(self): self.cpp_info.libs = ["lodepng"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/lodepng/all/test_package/conanfile.py b/recipes/lodepng/all/test_package/conanfile.py index ad9ad50d2e692..f6238eccc60b7 100644 --- a/recipes/lodepng/all/test_package/conanfile.py +++ b/recipes/lodepng/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,20 +7,21 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") bees = os.path.join(self.source_folder, "bees.png") self.run(f"{bin_path} {bees}", env="conanrun") diff --git a/recipes/lodepng/all/test_v1_package/CMakeLists.txt b/recipes/lodepng/all/test_v1_package/CMakeLists.txt index 54224af3ae67e..0d20897301b68 100644 --- a/recipes/lodepng/all/test_v1_package/CMakeLists.txt +++ b/recipes/lodepng/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(lodepng REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE lodepng::lodepng) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/matchit/all/conanfile.py b/recipes/matchit/all/conanfile.py index 95876b752dd5b..55b20c25e3456 100644 --- a/recipes/matchit/all/conanfile.py +++ b/recipes/matchit/all/conanfile.py @@ -18,39 +18,45 @@ class MatchitConan(ConanFile): " library for C++17 with macro-free APIs.") topics = ("lightweight", "cpp17", "header-only", "pattern-matching") no_copy_source = True - settings = "arch", "build_type", "compiler", "os" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" - _compiler_required_cpp17 = { - "Visual Studio": "16", - "gcc": "8", - "clang": "7", - "apple-clang": "12.0", - } + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } + + 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, "17") + check_min_cppstd(self, self._min_cppstd) - minimum_version = self._compiler_required_cpp17.get( - str(self.settings.compiler), False) - if minimum_version: - if Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - "{} requires C++17, which your compiler does not support.".format(self.name)) - else: - self.output.warn( - "{0} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + 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, - destination=self.source_folder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass - def layout(self): - basic_layout(self, src_folder="src") - def package(self): copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) @@ -58,13 +64,8 @@ def package(self): src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) - def package_id(self): - self.info.clear() - def package_info(self): - # TODO: Remove after Conan 2.0 - self.cpp_info.names["cmake_find_package"] = "matchit" - self.cpp_info.names["cmake_find_package_multi"] = "matchit" - - self.cpp_info.set_property("cmake_target_name", "matchit::matchit") self.cpp_info.set_property("cmake_file_name", "matchit") + self.cpp_info.set_property("cmake_target_name", "matchit::matchit") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/matchit/all/test_package/CMakeLists.txt b/recipes/matchit/all/test_package/CMakeLists.txt index fd89193f305ec..8898d12cfc675 100644 --- a/recipes/matchit/all/test_package/CMakeLists.txt +++ b/recipes/matchit/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) find_package(matchit REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE matchit::matchit) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/matchit/all/test_package/conanfile.py b/recipes/matchit/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/matchit/all/test_package/conanfile.py +++ b/recipes/matchit/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/matchit/all/test_v1_package/CMakeLists.txt b/recipes/matchit/all/test_v1_package/CMakeLists.txt index 0645f6d856074..0d20897301b68 100644 --- a/recipes/matchit/all/test_v1_package/CMakeLists.txt +++ b/recipes/matchit/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(matchit REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE matchit::matchit) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/matchit/all/test_v1_package/conanfile.py b/recipes/matchit/all/test_v1_package/conanfile.py index c492184eec19c..0f735b51a2642 100644 --- a/recipes/matchit/all/test_v1_package/conanfile.py +++ b/recipes/matchit/all/test_v1_package/conanfile.py @@ -1,9 +1,7 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building +from conans import ConanFile, CMake, tools import os -# legacy validation with Conan 1.x class TestPackageV1Conan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" @@ -14,6 +12,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(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/mbedtls/all/conanfile.py b/recipes/mbedtls/all/conanfile.py index 78c7bf30e76ae..84a6a1f32ace2 100644 --- a/recipes/mbedtls/all/conanfile.py +++ b/recipes/mbedtls/all/conanfile.py @@ -19,6 +19,7 @@ class MBedTLSConan(ConanFile): homepage = "https://tls.mbed.org" license = "Apache-2.0" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -54,18 +55,17 @@ def requirements(self): self.requires("zlib/1.2.13") def validate(self): - if self.info.settings.os == "Windows" and self.info.options.shared: + if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} does not support shared build on Windows") - if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": + 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 raise ConanInvalidConfiguration( - f"{self.ref} does not support {self.info.settings.compiler}-{self.info.settings.compiler.version}" + f"{self.ref} does not support {self.settings.compiler}-{self.settings.compiler.version}" ) def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root = True) + get(self, **self.conan_data["sources"][self.version], strip_root = True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/mcap/all/conandata.yml b/recipes/mcap/all/conandata.yml index 902534f8f869d..4d475c04d971c 100644 --- a/recipes/mcap/all/conandata.yml +++ b/recipes/mcap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + 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: url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.9.0/main.tar.gz" sha256: "e17702fcc0259bf72eab0d84d3fa6e02c051256357ab7ba4421462f2c02b434f" diff --git a/recipes/mcap/all/conanfile.py b/recipes/mcap/all/conanfile.py index 328d64781c0d0..0ea0db2622ab8 100644 --- a/recipes/mcap/all/conanfile.py +++ b/recipes/mcap/all/conanfile.py @@ -48,7 +48,7 @@ def layout(self): def requirements(self): self.requires("lz4/1.9.4") - self.requires("zstd/1.5.2") + self.requires("zstd/1.5.4") if Version(self.version) < "0.1.1": self.requires("fmt/9.1.0") diff --git a/recipes/mcap/config.yml b/recipes/mcap/config.yml index 72a0eda7e1def..8d906d6516e97 100644 --- a/recipes/mcap/config.yml +++ b/recipes/mcap/config.yml @@ -1,4 +1,6 @@ versions: + 1.0.0: + folder: all 0.9.0: folder: all 0.5.0: diff --git a/recipes/md4c/all/conanfile.py b/recipes/md4c/all/conanfile.py index 4b5bb25a31a26..ad333104761a5 100644 --- a/recipes/md4c/all/conanfile.py +++ b/recipes/md4c/all/conanfile.py @@ -5,7 +5,7 @@ import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.54.0" class Md4cConan(ConanFile): @@ -15,6 +15,7 @@ class Md4cConan(ConanFile): topics = ("markdown-parser", "markdown") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mity/md4c" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,29 +37,19 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.info.settings.os != "Windows" and self.info.options.encoding == "utf-16": + if self.settings.os != "Windows" and self.options.encoding == "utf-16": raise ConanInvalidConfiguration(f"{self.ref} doesn't support utf-16 options on non-Windows platforms") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -68,8 +59,6 @@ def generate(self): tc.preprocessor_definitions["MD4C_USE_UTF16"] = "1" elif self.options.encoding == "ascii": tc.preprocessor_definitions["MD4C_USE_ASCII"] = "1" - # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() def _patch_sources(self): @@ -120,6 +109,4 @@ def package_info(self): self.cpp_info.components["_md4c"].names["cmake_find_package_multi"] = "md4c" self.cpp_info.components["md4c_html"].names["cmake_find_package"] = "md4c-html" self.cpp_info.components["md4c_html"].names["cmake_find_package_multi"] = "md4c-html" - bin_path = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bin_path}") - self.env_info.PATH.append(bin_path) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/md4c/all/test_package/CMakeLists.txt b/recipes/md4c/all/test_package/CMakeLists.txt index dd82268d730c4..afe8788f52c1d 100644 --- a/recipes/md4c/all/test_package/CMakeLists.txt +++ b/recipes/md4c/all/test_package/CMakeLists.txt @@ -1,6 +1,5 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package C) +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) find_package(md4c CONFIG REQUIRED) diff --git a/recipes/md4c/all/test_v1_package/CMakeLists.txt b/recipes/md4c/all/test_v1_package/CMakeLists.txt index a7e30d5cc2c2d..0d20897301b68 100644 --- a/recipes/md4c/all/test_v1_package/CMakeLists.txt +++ b/recipes/md4c/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package C) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(md4c CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE md4c::md4c) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/md4qt/all/conandata.yml b/recipes/md4qt/all/conandata.yml index 3d8d45af50a23..9daa43e69fd56 100644 --- a/recipes/md4qt/all/conandata.yml +++ b/recipes/md4qt/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.5": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.5.tar.gz" + sha256: "363cc13d35c66d8d89df25eef9ac49ec2d259781752208231bad32db4df5dd52" "2.0.4": url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.4.tar.gz" sha256: "2980a0d0b5d3539a5a1402942a1345e97c8ab36acfc8e00d932df157d2e6edc2" diff --git a/recipes/md4qt/config.yml b/recipes/md4qt/config.yml index e588fe3f46fb3..157d24312304b 100644 --- a/recipes/md4qt/config.yml +++ b/recipes/md4qt/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.5": + folder: all "2.0.4": folder: all "2.0.3": diff --git a/recipes/mdspan/all/conandata.yml b/recipes/mdspan/all/conandata.yml index e435ba267f905..0fafdc34b37c9 100644 --- a/recipes/mdspan/all/conandata.yml +++ b/recipes/mdspan/all/conandata.yml @@ -1,4 +1,7 @@ sources: - "0.1.0": - url: https://github.com/kokkos/mdspan/archive/refs/tags/mdspan-0.1.0.tar.gz - sha256: 24c1e4be4870436c6c5e80d38870721b0b6252185b8288d00d8f3491dfba754b + "0.5.0": + url: "https://github.com/kokkos/mdspan/archive/refs/tags/mdspan-0.5.0.tar.gz" + sha256: "ffa73e5e0dcd78e5279cd3b51a4d983a1fbef696e630fd1287ce32d93d6642d1" + "0.4.0": + url: https://github.com/kokkos/mdspan/archive/refs/tags/mdspan-0.4.0.tar.gz + sha256: 7b89db3c7a9c206c8447499456fdea9c9c1b3a34f58fd0b4c4dd87176b3fe20b diff --git a/recipes/mdspan/all/conanfile.py b/recipes/mdspan/all/conanfile.py index 2e8201c6f1d4d..521e78d3b8c7d 100644 --- a/recipes/mdspan/all/conanfile.py +++ b/recipes/mdspan/all/conanfile.py @@ -1,24 +1,24 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +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 +from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.33.0" - +required_conan_version = ">=1.52.0" class MDSpanConan(ConanFile): name = "mdspan" - homepage = "https://github.com/kokkos/mdspan" description = "Production-quality reference implementation of mdspan" - topics = ("multi-dimensional", "array", "span") license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" - settings = "compiler" + homepage = "https://github.com/kokkos/mdspan" + topics = ("multi-dimensional", "array", "span", "header-only") + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _minimum_cpp_standard(self): return 14 @@ -26,41 +26,63 @@ def _minimum_cpp_standard(self): @property def _minimum_compilers_version(self): return { - "Visual Studio": "15", + "Visual Studio": "15" if Version(self.version) < "0.2.0" else "16", + "msvc": "191" if Version(self.version) < "0.2.0" else "192", "gcc": "5", "clang": "3.4", "apple-clang": "5.1" } - def configure(self): + 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"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._minimum_cpp_standard) min_version = self._minimum_compilers_version.get( str(self.settings.compiler)) if not min_version: - self.output.warn("{} recipe lacks information about the {} " - "compiler support.".format( - self.name, self.settings.compiler)) + self.output.warn(f"{self.ref} recipe lacks information about the {self.settings.compiler} " + "compiler support.") else: - if tools.Version(self.settings.compiler.version) < min_version: + if Version(self.settings.compiler.version) < min_version: raise ConanInvalidConfiguration( - "{} requires C++{} support. " - "The current compiler {} {} does not support it.".format( - self.name, self._minimum_cpp_standard, - self.settings.compiler, - self.settings.compiler.version)) + f"{self.ref} requires C++{self._minimum_cpp_standard} support. " + "The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it.") + + if str(self.settings.compiler) == "Visual Studio" and "16.6" <= Version(self.settings.compiler.version) < "17.0": + raise ConanInvalidConfiguration( + "Unsupported Visual Studio version due to upstream bug. The supported Visual Studio versions are (< 16.6 or 17.0 <=)." + "See upstream issue https://github.com/kokkos/mdspan/issues/26 for details.") + # TODO: check msvcc version more precisely + if self.settings.compiler == "msvc" and Version(self.settings.compiler.version) == "192": + raise ConanInvalidConfiguration( + "Unsupported MSVC version due to upstream bug. The supported MSVC versions are (< 192 or 193 <=)." + "See upstream issue https://github.com/kokkos/mdspan/issues/26 for details.") 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 package(self): - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("*LICENSE", dst="licenses", keep_path=False) - - def package_id(self): - self.info.header_only() + copy(self, pattern="*LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*", + 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", "mdspan") + self.cpp_info.set_property("cmake_target_name", "std::mdspan") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "mdspan" self.cpp_info.filenames["cmake_find_package_multi"] = "mdspan" self.cpp_info.names["cmake_find_package"] = "std" diff --git a/recipes/mdspan/all/test_package/CMakeLists.txt b/recipes/mdspan/all/test_package/CMakeLists.txt index 0de9b0f00dc25..bcf4df86e865c 100644 --- a/recipes/mdspan/all/test_package/CMakeLists.txt +++ b/recipes/mdspan/all/test_package/CMakeLists.txt @@ -1,11 +1,18 @@ -cmake_minimum_required(VERSION 3.5) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) find_package(mdspan REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE std::mdspan) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14) + +if(mdspan_VERSION VERSION_GREATER_EQUAL "0.2.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE "MDSPAN_ENABLE_SUBMDSPAN") +endif() + +if(MSVC) + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) +else() + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14) +endif() diff --git a/recipes/mdspan/all/test_package/conanfile.py b/recipes/mdspan/all/test_package/conanfile.py index 2afebb9c93770..b9d7f11e89dcd 100644 --- a/recipes/mdspan/all/test_package/conanfile.py +++ b/recipes/mdspan/all/test_package/conanfile.py @@ -1,16 +1,25 @@ -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 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 not tools.cross_building(self.settings): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mdspan/all/test_package/test_package.cpp b/recipes/mdspan/all/test_package/test_package.cpp index 5fde94d7a2dec..21dfdf2403d14 100644 --- a/recipes/mdspan/all/test_package/test_package.cpp +++ b/recipes/mdspan/all/test_package/test_package.cpp @@ -1,14 +1,23 @@ #include -#include #include +#include namespace stdex = std::experimental; int main() { double buffer[2 * 3 * 4] = {}; +#ifdef MDSPAN_ENABLE_SUBMDSPAN + auto s1 = stdex::mdspan>(buffer, 2, 3, 4); +#else auto s1 = stdex::mdspan(buffer); +#endif s1(1, 1, 1) = 42; + +#ifdef MDSPAN_ENABLE_SUBMDSPAN + auto sub1 = stdex::submdspan(s1, 1, 1, stdex::full_extent); +#else auto sub1 = stdex::subspan(s1, 1, 1, stdex::all); +#endif std::cout << std::boolalpha << (sub1[1] == 42) << std::endl; } diff --git a/recipes/mdspan/all/test_v1_package/CMakeLists.txt b/recipes/mdspan/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/mdspan/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mdspan/all/test_v1_package/conanfile.py b/recipes/mdspan/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/mdspan/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mdspan/config.yml b/recipes/mdspan/config.yml index 6c11a439d0bc2..d13fcfd021b7b 100644 --- a/recipes/mdspan/config.yml +++ b/recipes/mdspan/config.yml @@ -1,3 +1,5 @@ versions: - "0.1.0": + "0.5.0": + folder: all + "0.4.0": folder: all diff --git a/recipes/mgs/all/conandata.yml b/recipes/mgs/all/conandata.yml index 2d9059f1e4cb3..803396c03189b 100644 --- a/recipes/mgs/all/conandata.yml +++ b/recipes/mgs/all/conandata.yml @@ -1,16 +1,16 @@ sources: - 0.2.1: + "0.2.1": url: "https://github.com/theodelrieu/mgs/releases/download/v0.2.1/mgs.zip" sha256: "da4a74d1cdaeb6c32c2097bcbebe21ba912ad84176a89014ac8232885d76bcc7" - 0.2.0: + "0.2.0": url: "https://github.com/theodelrieu/mgs/releases/download/v0.2.0/mgs.zip" sha256: "aa057a4096da9451bef1950a3e784350df590f09f6bad0c0ca59ed1874df4a36" - 0.1.5: + "0.1.5": url: "https://github.com/theodelrieu/mgs/releases/download/v0.1.5/mgs.zip" sha256: "ca00e5d26be18beac9874270c17bddbc4f96cad6d92aab685c9eb4be0e6d7fc7" - 0.1.4: + "0.1.4": url: "https://github.com/theodelrieu/mgs/releases/download/v0.1.4/mgs.zip" sha256: "e247976860a0c8d237caaf62a918627f59d4f8a5b5bb811ab01e7cbecf31d4ce" - 0.1.2: + "0.1.2": url: "https://github.com/theodelrieu/mgs/releases/download/v0.1.2/mgs.zip" sha256: "aba95870eafad95147c969c167a0e7c09b2c749ccafadbdd477de815e3e5bfd3" diff --git a/recipes/mgs/all/conanfile.py b/recipes/mgs/all/conanfile.py index a3d503d5b0627..a1fe1d56d19c7 100644 --- a/recipes/mgs/all/conanfile.py +++ b/recipes/mgs/all/conanfile.py @@ -6,7 +6,8 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" + class MgsConan(ConanFile): name = "mgs" @@ -15,6 +16,7 @@ class MgsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://theodelrieu.github.io/mgs-docs" topics = ("codec", "base64", "base32", "base16", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -39,20 +41,19 @@ def package_id(self): self.info.clear() def validate(self): - if self.settings.compiler.cppstd: + 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: - if Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not fully support.") - else: - self.output.warn(f"{self.ref} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") + 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 fully support." + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) def package_info(self): diff --git a/recipes/mgs/all/test_v1_package/conanfile.py b/recipes/mgs/all/test_v1_package/conanfile.py index 5a05af3c2dfd2..0f735b51a2642 100644 --- a/recipes/mgs/all/test_v1_package/conanfile.py +++ b/recipes/mgs/all/test_v1_package/conanfile.py @@ -1,5 +1,4 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building +from conans import ConanFile, CMake, tools import os @@ -13,6 +12,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(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/miniaudio/all/conanfile.py b/recipes/miniaudio/all/conanfile.py index 599f3c0195bdc..f595f804f6c12 100644 --- a/recipes/miniaudio/all/conanfile.py +++ b/recipes/miniaudio/all/conanfile.py @@ -47,11 +47,11 @@ def layout(self): cmake_layout(self, src_folder="src") def package_id(self): - if self.options.header_only: + if self.info.options.header_only: self.info.clear() def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): if self.options.header_only: @@ -113,4 +113,3 @@ def package_info(self): self.cpp_info.libs = ["miniaudio"] if self.options.shared: self.cpp_info.defines.append("MA_DLL") - diff --git a/recipes/miniaudio/all/test_package/CMakeLists.txt b/recipes/miniaudio/all/test_package/CMakeLists.txt index b334a63d0191a..a7a69182169b3 100644 --- a/recipes/miniaudio/all/test_package/CMakeLists.txt +++ b/recipes/miniaudio/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -find_package(miniaudio REQUIRED) +find_package(miniaudio REQUIRED CONFIG) -add_executable(${PROJECT_NAME} example.c) -target_link_libraries(${PROJECT_NAME} miniaudio::miniaudio) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE miniaudio::miniaudio) diff --git a/recipes/miniaudio/all/test_package/example.c b/recipes/miniaudio/all/test_package/test_package.c similarity index 100% rename from recipes/miniaudio/all/test_package/example.c rename to recipes/miniaudio/all/test_package/test_package.c diff --git a/recipes/miniaudio/all/test_v1_package/conanfile.py b/recipes/miniaudio/all/test_v1_package/conanfile.py index 5a05af3c2dfd2..0f735b51a2642 100644 --- a/recipes/miniaudio/all/test_v1_package/conanfile.py +++ b/recipes/miniaudio/all/test_v1_package/conanfile.py @@ -1,5 +1,4 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building +from conans import ConanFile, CMake, tools import os @@ -13,6 +12,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(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/mppp/all/conandata.yml b/recipes/mppp/all/conandata.yml index 9e4f3e0e2fcbe..60d10df366776 100644 --- a/recipes/mppp/all/conandata.yml +++ b/recipes/mppp/all/conandata.yml @@ -5,7 +5,6 @@ sources: "0.26": url: "https://github.com/bluescarni/mppp/archive/v0.26.tar.gz" sha256: "4dbfa68802d9a1365eda884f085418afc147d01b7a928e8333e4dcc1c3b3ce9e" - patches: "0.27": - patch_file: "patches/0.27-0001-disable-warning-error.patch" diff --git a/recipes/mppp/all/conanfile.py b/recipes/mppp/all/conanfile.py index f6d828ae44a49..4677b62f734c2 100644 --- a/recipes/mppp/all/conanfile.py +++ b/recipes/mppp/all/conanfile.py @@ -1,9 +1,9 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc_static_runtime -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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc_static_runtime from conan.tools.scm import Version import os @@ -17,6 +17,7 @@ class MpppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/bluescarni/mppp/" topics = ("multiprecision", "gmp", "math-bignum", "computer-algebra") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -40,7 +41,7 @@ class MpppConan(ConanFile): } @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 11 def export_sources(self): @@ -61,27 +62,27 @@ def layout(self): def requirements(self): self.requires("gmp/6.2.1") - if self.options.with_mpfr == True: + if self.options.with_mpfr: self.requires("mpfr/4.1.0") - if self.options.with_mpc == True: + if self.options.with_mpc: self.requires("mpc/1.2.0") - if self.options.with_boost == True: + if self.options.with_boost: self.requires("boost/1.81.0") if self.options.get_safe("with_fmt"): self.requires("fmt/9.1.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._min_cppstd) if self.options.with_arb: raise ConanInvalidConfiguration(f"{self.ref}:with_arb=True is not supported because `fredrik-johansson/arb` is not packaged in CCI. (yet)") if self.options.with_quadmath: - raise ConanInvalidConfiguration(f"{self.ref}:with_quadmath=True is not supported because `libquadmath` is not available from CCI. (yet)") - if self.options.with_boost and self.options["boost"].without_serialization: - raise ConanInvalidConfiguration(f"{self.name}:with_boost=True requires boost::without_serialization=False") + raise ConanInvalidConfiguration(f"{self.ref}:with_quadmath=True is not supported because `libquadmath` is not available from CCI. (yet)") + if self.options.with_boost and self.dependencies["boost"].options.without_serialization: + raise ConanInvalidConfiguration(f"{self.ref}:with_boost=True requires boost:without_serialization=False") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -120,7 +121,7 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - if self.options.get_safe("with_fmt"): + if self.options.get_safe("with_fmt"): self.cpp_info.defines.append("MPPP_WITH_FMT") # TODO: to remove in conan v2 once cmake_find_package* generators removed diff --git a/recipes/msgpack-c/all/conandata.yml b/recipes/msgpack-c/all/conandata.yml index 58a4d3651c031..dc158b2bf02e6 100644 --- a/recipes/msgpack-c/all/conandata.yml +++ b/recipes/msgpack-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.0.0": + url: "https://github.com/msgpack/msgpack-c/releases/download/c-6.0.0/msgpack-c-6.0.0.tar.gz" + sha256: "3654f5e2c652dc52e0a993e270bb57d5702b262703f03771c152bba51602aeba" "5.0.0": url: "https://github.com/msgpack/msgpack-c/releases/download/c-5.0.0/msgpack-c-5.0.0.tar.gz" sha256: "eb6d77f32dbaaae9174d96cacfe02af30bf1ea329c45018074cd95ac6e6fa6e5" diff --git a/recipes/msgpack-c/all/conanfile.py b/recipes/msgpack-c/all/conanfile.py index cb504cee9941b..eac066163d085 100644 --- a/recipes/msgpack-c/all/conanfile.py +++ b/recipes/msgpack-c/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.files import get, copy, rmdir, save from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version import os import textwrap @@ -13,6 +14,7 @@ class MsgpackCConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/msgpack/msgpack-c" topics = ("msgpack", "message-pack", "serialization") + package_type = "library" settings = "os", "arch", "build_type", "compiler" options = { "fPIC": [True, False], @@ -45,7 +47,7 @@ def generate(self): tc.variables["MSGPACK_ENABLE_STATIC"] = not self.options.shared tc.variables["MSGPACK_32BIT"] = self.settings.arch == "x86" tc.variables["MSGPACK_BUILD_EXAMPLES"] = False - tc.variables["MSGPACK_BUILD_TESTS"] = False + tc.cache_variables["MSGPACK_BUILD_TESTS"] = False tc.generate() def build(self): @@ -82,9 +84,13 @@ def _module_file_rel_path(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "msgpack") - self.cpp_info.set_property("cmake_target_name", "msgpackc") self.cpp_info.set_property("pkg_config_name", "msgpack") - self.cpp_info.libs = ["msgpackc"] + if Version(self.version) < "6.0.0": + self.cpp_info.libs = ["msgpackc"] + self.cpp_info.set_property("cmake_target_name", "msgpackc") + else: + self.cpp_info.libs = ["msgpack-c"] + self.cpp_info.set_property("cmake_target_name", "msgpack-c") # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.names["cmake_find_package"] = "msgpack" diff --git a/recipes/msgpack-c/all/test_package/CMakeLists.txt b/recipes/msgpack-c/all/test_package/CMakeLists.txt index c764bd8b7906e..8fda341f88c80 100644 --- a/recipes/msgpack-c/all/test_package/CMakeLists.txt +++ b/recipes/msgpack-c/all/test_package/CMakeLists.txt @@ -4,4 +4,8 @@ project(test_package LANGUAGES C) find_package(msgpack REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE msgpackc) +if(TARGET msgpackc) + target_link_libraries(${PROJECT_NAME} PRIVATE msgpackc) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE msgpack-c) +endif() diff --git a/recipes/msgpack-c/config.yml b/recipes/msgpack-c/config.yml index 81665de5ada8e..c43afaf0f726a 100644 --- a/recipes/msgpack-c/config.yml +++ b/recipes/msgpack-c/config.yml @@ -1,4 +1,6 @@ versions: + "6.0.0": + folder: all "5.0.0": folder: all "4.0.0": diff --git a/recipes/msgpack-cxx/all/conandata.yml b/recipes/msgpack-cxx/all/conandata.yml index aea8a30431a27..64a5e6f43e3e6 100644 --- a/recipes/msgpack-cxx/all/conandata.yml +++ b/recipes/msgpack-cxx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.0.0": + url: "https://github.com/msgpack/msgpack-c/archive/cpp-6.0.0.tar.gz" + sha256: "d02f7ffd28b1d38ab9f5f758c4744fadfae92150461fb8154c98ac49226cff90" "5.0.0": url: "https://github.com/msgpack/msgpack-c/archive/cpp-5.0.0.tar.gz" sha256: "bd6b8e255f0a62cf8f50f1d292f979ac8ea9a4aa121938679d6f419d6df70ea3" diff --git a/recipes/msgpack-cxx/all/conanfile.py b/recipes/msgpack-cxx/all/conanfile.py index 34a261745f555..2bcaa82b381e6 100644 --- a/recipes/msgpack-cxx/all/conanfile.py +++ b/recipes/msgpack-cxx/all/conanfile.py @@ -14,6 +14,7 @@ class MsgpackCXXConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/msgpack/msgpack-c" topics = ("msgpack", "message-pack", "serialization", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "use_boost": [True, False], diff --git a/recipes/msgpack-cxx/config.yml b/recipes/msgpack-cxx/config.yml index f59df5a4653d5..1c632d41b23dd 100644 --- a/recipes/msgpack-cxx/config.yml +++ b/recipes/msgpack-cxx/config.yml @@ -1,4 +1,6 @@ versions: + "6.0.0": + folder: all "5.0.0": folder: all "4.1.3": diff --git a/recipes/nas/all/conanfile.py b/recipes/nas/all/conanfile.py index 17ddc0ee3412e..b9d4166d81b95 100644 --- a/recipes/nas/all/conanfile.py +++ b/recipes/nas/all/conanfile.py @@ -2,6 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.layout import basic_layout +from conan.tools.env import VirtualBuildEnv from conan.tools.files import chdir, get, download, export_conandata_patches, apply_conandata_patches, rm, copy from conan.tools.gnu import AutotoolsToolchain, Autotools, AutotoolsDeps import os @@ -42,6 +43,9 @@ def export_sources(self): def validate(self): if self.settings.os not in ("FreeBSD", "Linux"): raise ConanInvalidConfiguration("Recipe supports Linux only") + if self.settings.compiler == "clang": + # See https://github.com/conan-io/conan-center-index/pull/16267#issuecomment-1469824504 + raise ConanInvalidConfiguration("Recipe cannot be built with clang") def requirements(self): self.requires("xorg/system") @@ -70,9 +74,12 @@ def generate(self): deps = AutotoolsDeps(self) deps.generate() + buildenv = VirtualBuildEnv(self) + buildenv.generate() + @property def _imake_irulesrc(self): - return self._user_info_build["xorg-cf-files"].CONFIG_PATH + return self.conf.get("user.xorg-cf-files:config-path") @property def _imake_defines(self): @@ -86,7 +93,7 @@ def build(self): apply_conandata_patches(self) with chdir(self, self.source_folder): - self.run("imake -DUseInstalled -I{} {}".format(self._imake_irulesrc, self._imake_defines), run_environment=True) + self.run("imake -DUseInstalled -I{} {}".format(self._imake_irulesrc, self._imake_defines), env="conanbuild") autotools = Autotools(self) # j1 avoids some errors while trying to run this target autotools.make(target="World", args=["-j1"] + self._imake_make_args) diff --git a/recipes/nss/all/conandata.yml b/recipes/nss/all/conandata.yml index 352d7c2ccf087..1d61f4b23cee2 100644 --- a/recipes/nss/all/conandata.yml +++ b/recipes/nss/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.89": + url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_89_RTM/src/nss-3.89.tar.gz" + sha256: "55c37a3f4da010d0574fb8b39264cb1e7b4ce9e6c2954c1c7ecf9f41ee00bed5" "3.88.1": url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_88_1_RTM/src/nss-3.88.1.tar.gz" sha256: "27d243edf87d1cf1bb9c861f03d387e0e9230ce5017f4308c941f558b54b3496" diff --git a/recipes/nss/config.yml b/recipes/nss/config.yml index e4002665eafef..4e88bb8ad9d3b 100644 --- a/recipes/nss/config.yml +++ b/recipes/nss/config.yml @@ -1,4 +1,6 @@ versions: + "3.89": + folder: all "3.88.1": folder: all "3.87": diff --git a/recipes/onetbb/all/conandata.yml b/recipes/onetbb/all/conandata.yml index 8b78e00c51454..b17843de14de0 100644 --- a/recipes/onetbb/all/conandata.yml +++ b/recipes/onetbb/all/conandata.yml @@ -11,11 +11,11 @@ sources: patches: "2021.6.0": - patch_description: "cherry-pick upstream patch: avoid android compile errors for current NDKs on releases <= 2021.6.0" - patch_type: "backport" + patch_type: "portability" patch_source: "https://github.com/oneapi-src/oneTBB/pull/716.diff" patch_file: "patches/fix-overeager-stripping-of-compile-flag.diff" "2021.3.0": - patch_description: "cherry-pick upstream patch: avoid android compile errors for current NDKs on releases <= 2021.6.0" - patch_type: "backport" + patch_type: "portability" patch_source: "https://github.com/oneapi-src/oneTBB/pull/716.diff" patch_file: "patches/fix-overeager-stripping-of-compile-flag.diff" diff --git a/recipes/onetbb/all/conanfile.py b/recipes/onetbb/all/conanfile.py index 240acbbc36f0d..6cd71594e81e6 100644 --- a/recipes/onetbb/all/conanfile.py +++ b/recipes/onetbb/all/conanfile.py @@ -1,13 +1,12 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, load, rmdir from conan.tools.scm import Version import os import re -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class OneTBBConan(ConanFile): @@ -37,6 +36,9 @@ class OneTBBConan(ConanFile): "interprocedural_optimization": True, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -44,14 +46,14 @@ def config_options(self): del self.options.interprocedural_optimization if Version(self.version) < "2021.2.0": del self.options.shared - del self.options.fPIC - - def export_sources(self): - export_conandata_patches(self) + self.options.rm_safe("fPIC") def configure(self): if self.options.get_safe("shared", True): - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def package_id(self): if Version(self.version) < "2021.6.0": @@ -59,14 +61,8 @@ def package_id(self): del self.info.options.tbbproxy def validate(self): - if (is_apple_os(self) - and self.settings.compiler == "apple-clang" - and Version(self.settings.compiler.version) < "11.0"): - raise ConanInvalidConfiguration( - "{} {} couldn't be built by apple-clang < 11.0".format( - self.name, - self.version, - )) + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "11.0": + raise ConanInvalidConfiguration(f"{self.ref} couldn't be built by apple-clang < 11.0") if not self.options.get_safe("shared", True): if Version(self.version) >= "2021.6.0": raise ConanInvalidConfiguration( @@ -74,20 +70,12 @@ def validate(self): "to avoid unforeseen issues like https://github.com/oneapi-src/oneTBB/issues/920. " "Please consider fixing at least the aforementioned issue in upstream." ) - self.output.warn( - "oneTBB strongly discourages usage of static linkage") - if (self.options.tbbproxy - and not (self.options.tbbmalloc - and self.options.get_safe("shared", True))): - raise ConanInvalidConfiguration( - "tbbproxy needs tbbmalloc and shared options") - - def layout(self): - cmake_layout(self, src_folder="src") + self.output.warning("oneTBB strongly discourages usage of static linkage") + if self.options.tbbproxy and not (self.options.tbbmalloc and self.options.get_safe("shared", True)): + raise ConanInvalidConfiguration("tbbproxy needs tbbmalloc and shared options") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): toolchain = CMakeToolchain(self) @@ -138,7 +126,7 @@ def lib_name(name): version_info, flags=re.MULTILINE | re.DOTALL, ) - tbb.libs.append(lib_name("tbb{}".format(binary_version))) + tbb.libs.append(lib_name(f"tbb{binary_version}")) if self.settings.os in ["Linux", "FreeBSD"]: tbb.system_libs = ["m", "dl", "rt", "pthread"] diff --git a/recipes/onetbb/all/test_package/conanfile.py b/recipes/onetbb/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/onetbb/all/test_package/conanfile.py +++ b/recipes/onetbb/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/onetbb/all/test_v1_package/CMakeLists.txt b/recipes/onetbb/all/test_v1_package/CMakeLists.txt index 4daf7ea625bc3..0d20897301b68 100644 --- a/recipes/onetbb/all/test_v1_package/CMakeLists.txt +++ b/recipes/onetbb/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(TBB REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE TBB::tbb) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/openal-soft/all/conanfile.py b/recipes/openal-soft/all/conanfile.py index d82132329ef5b..5401a9836e21a 100644 --- a/recipes/openal-soft/all/conanfile.py +++ b/recipes/openal-soft/all/conanfile.py @@ -18,7 +18,7 @@ class OpenALSoftConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://openal-soft.org/" license = "LGPL-2.0-or-later" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -118,17 +118,15 @@ def package(self): ) def _create_cmake_module_variables(self, module_file): - content = textwrap.dedent("""\ + content = textwrap.dedent(f"""\ set(OPENAL_FOUND TRUE) if(DEFINED OpenAL_INCLUDE_DIR) - set(OPENAL_INCLUDE_DIR ${OpenAL_INCLUDE_DIR}) + set(OPENAL_INCLUDE_DIR ${{OpenAL_INCLUDE_DIR}}) endif() if(DEFINED OpenAL_LIBRARIES) - set(OPENAL_LIBRARY ${OpenAL_LIBRARIES}) - endif() - if(DEFINED OpenAL_VERSION) - set(OPENAL_VERSION_STRING ${OpenAL_VERSION}) + set(OPENAL_LIBRARY ${{OpenAL_LIBRARIES}}) endif() + set(OPENAL_VERSION_STRING {self.version}) """) save(self, module_file, content) diff --git a/recipes/openal-soft/all/test_package/CMakeLists.txt b/recipes/openal-soft/all/test_package/CMakeLists.txt index f25fa5a765b27..6822e9962142c 100644 --- a/recipes/openal-soft/all/test_package/CMakeLists.txt +++ b/recipes/openal-soft/all/test_package/CMakeLists.txt @@ -5,3 +5,18 @@ find_package(OpenAL REQUIRED) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE OpenAL::OpenAL) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindOpenAL.html are properly defined +set(_custom_vars + OPENAL_FOUND + OPENAL_INCLUDE_DIR + OPENAL_LIBRARY + OPENAL_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/openssl/1.x.x/conanfile.py b/recipes/openssl/1.x.x/conanfile.py index 4a1bb6ee9b0f6..d7807c3f39ee0 100644 --- a/recipes/openssl/1.x.x/conanfile.py +++ b/recipes/openssl/1.x.x/conanfile.py @@ -649,6 +649,10 @@ def _create_targets(self): if self.options.get_safe("fPIC", True): shared_cflag='shared_cflag => "-fPIC",' + if self.settings.os in ["iOS", "tvOS", "watchOS"] and self.conf.get("tools.apple:enable_bitcode", check_type=bool): + cflags.append("-fembed-bitcode") + cxxflags.append("-fembed-bitcode") + config = config_template.format(targets=targets, target=self._target, ancestor=ancestor, diff --git a/recipes/openssl/1.x.x/test_package/CMakeLists.txt b/recipes/openssl/1.x.x/test_package/CMakeLists.txt index 7109d02c5dd32..7fb310b9cb6d9 100644 --- a/recipes/openssl/1.x.x/test_package/CMakeLists.txt +++ b/recipes/openssl/1.x.x/test_package/CMakeLists.txt @@ -19,7 +19,7 @@ set(_custom_vars OPENSSL_VERSION ) foreach(_custom_var ${_custom_vars}) - if(DEFINED _custom_var) + if(DEFINED ${_custom_var}) message(STATUS "${_custom_var}: ${${_custom_var}}") else() message(FATAL_ERROR "${_custom_var} not defined") diff --git a/recipes/openssl/3.x.x/conanfile.py b/recipes/openssl/3.x.x/conanfile.py index beaea42777422..8b4713da3b746 100644 --- a/recipes/openssl/3.x.x/conanfile.py +++ b/recipes/openssl/3.x.x/conanfile.py @@ -506,6 +506,10 @@ def _create_targets(self): if self.options.get_safe("fPIC", True): shared_cflag = 'shared_cflag => "-fPIC",' + if self.settings.os in ["iOS", "tvOS", "watchOS"] and self.conf.get("tools.apple:enable_bitcode", check_type=bool): + cflags.append("-fembed-bitcode") + cxxflags.append("-fembed-bitcode") + config = config_template.format( targets=targets, target=self._target, diff --git a/recipes/opentdf-client/all/conandata.yml b/recipes/opentdf-client/all/conandata.yml index b3ede12a6440c..67f195933f101 100644 --- a/recipes/opentdf-client/all/conandata.yml +++ b/recipes/opentdf-client/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.10": + url: "https://github.com/opentdf/client-cpp/archive/1.3.10.tar.gz" + sha256: "539bd5e64bceb86f63b3f7db75de470d5ea1d52ae6436a6a2d6789f7d0710dd4" "1.3.6": url: "https://github.com/opentdf/client-cpp/archive/1.3.6.tar.gz" sha256: "e0d4cf1d0b1824d903a2b0ec1da528acb42623e32f3ca36aa28b2e950c3cc7a0" diff --git a/recipes/opentdf-client/config.yml b/recipes/opentdf-client/config.yml index b9d93dc47c8d4..add71b9ee05f0 100644 --- a/recipes/opentdf-client/config.yml +++ b/recipes/opentdf-client/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.10": + folder: all "1.3.6": folder: all "1.3.4": diff --git a/recipes/out_ptr/all/conanfile.py b/recipes/out_ptr/all/conanfile.py index 1e8b0f7b0dcbf..ec1798a3de6ab 100644 --- a/recipes/out_ptr/all/conanfile.py +++ b/recipes/out_ptr/all/conanfile.py @@ -13,20 +13,27 @@ class OutPtrConan(ConanFile): homepage = "https://github.com/soasis/out_ptr" description = "a C++11 implementation of std::out_ptr (p1132), as a standalone library" topics = ("utility", "backport") + package_type = "header-library" settings = "os", "arch", "build_type", "compiler" no_copy_source = True - def package_id(self): - self.info.clear() - 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], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass def package(self): copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/out_ptr/all/test_package/conanfile.py b/recipes/out_ptr/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/out_ptr/all/test_package/conanfile.py +++ b/recipes/out_ptr/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/out_ptr/all/test_v1_package/CMakeLists.txt b/recipes/out_ptr/all/test_v1_package/CMakeLists.txt index cd9bb19ae3754..0d20897301b68 100644 --- a/recipes/out_ptr/all/test_v1_package/CMakeLists.txt +++ b/recipes/out_ptr/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(out_ptr CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE out_ptr::out_ptr) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/out_ptr/all/test_v1_package/conanfile.py b/recipes/out_ptr/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/out_ptr/all/test_v1_package/conanfile.py +++ b/recipes/out_ptr/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os diff --git a/recipes/pdfgen/all/CMakeLists.txt b/recipes/pdfgen/all/CMakeLists.txt new file mode 100644 index 0000000000000..7f6aaaf0116da --- /dev/null +++ b/recipes/pdfgen/all/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.8) +project(pdfgen LANGUAGES C) + +add_library(pdfgen ${PDFGEN_SRC_DIR}/pdfgen.c) +set_target_properties(pdfgen PROPERTIES + PUBLIC_HEADER ${PDFGEN_SRC_DIR}/pdfgen.h + WINDOWS_EXPORT_ALL_SYMBOLS ON + C_EXTENSIONS OFF + C_STANDARD 99 +) + +include(GNUInstallDirs) + +install( + TARGETS pdfgen + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/pdfgen/all/conandata.yml b/recipes/pdfgen/all/conandata.yml new file mode 100644 index 0000000000000..cdaa13edf4bdb --- /dev/null +++ b/recipes/pdfgen/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/AndreRenaud/PDFGen/archive/refs/tags/0.1.0.tar.gz" + sha256: "606f6dfab90e80ccb21bab558351c783e3791dc85217ada766c1aa352917aea8" diff --git a/recipes/pdfgen/all/conanfile.py b/recipes/pdfgen/all/conanfile.py new file mode 100644 index 0000000000000..d690844af85f7 --- /dev/null +++ b/recipes/pdfgen/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class PdfgenConan(ConanFile): + name = "pdfgen" + description = "Simple C PDF Writer/Generation library" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AndreRenaud/PDFGen" + topics = ("pdf", "generation") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + exports_sources = ["CMakeLists.txt"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PDFGEN_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["pdfgen"] diff --git a/recipes/pdfgen/all/test_package/CMakeLists.txt b/recipes/pdfgen/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5e3c8b32c96da --- /dev/null +++ b/recipes/pdfgen/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(pdfgen REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE pdfgen::pdfgen) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/pdfgen/all/test_package/conanfile.py b/recipes/pdfgen/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/pdfgen/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pdfgen/all/test_package/test_package.c b/recipes/pdfgen/all/test_package/test_package.c new file mode 100644 index 0000000000000..097335494c13b --- /dev/null +++ b/recipes/pdfgen/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include "pdfgen.h" + +int main() { + struct pdf_info info = { + .creator = "My software", + .producer = "My software", + .title = "My document", + .author = "My name", + .subject = "My subject", + .date = "Today" + }; + struct pdf_doc *pdf = pdf_create(PDF_A4_WIDTH, PDF_A4_HEIGHT, &info); + + pdf_destroy(pdf); + + return 0; +} diff --git a/recipes/pdfgen/all/test_v1_package/CMakeLists.txt b/recipes/pdfgen/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/pdfgen/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/pdfgen/all/test_v1_package/conanfile.py b/recipes/pdfgen/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/pdfgen/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pdfgen/config.yml b/recipes/pdfgen/config.yml new file mode 100644 index 0000000000000..6c11a439d0bc2 --- /dev/null +++ b/recipes/pdfgen/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: all diff --git a/recipes/picobench/all/conandata.yml b/recipes/picobench/all/conandata.yml index 8377ab1b2c676..0bbacb7273fdf 100644 --- a/recipes/picobench/all/conandata.yml +++ b/recipes/picobench/all/conandata.yml @@ -1,8 +1,16 @@ sources: + "2.02": + url: "https://github.com/iboB/picobench/archive/refs/tags/v2.02.tar.gz" + sha256: "22a896535d0e2fd8793cdc6c14bef42275f8de8d24ce2cfc55442ed1e0973c83" "2.01": url: "https://github.com/iboB/picobench/archive/refs/tags/v2.01.tar.gz" sha256: "164cb3b2d72a9b31e7559f6829ae38b6b955840571531117e0d6f53d669d3a2b" - patches: + "2.02": + - patch_file: "patches/2.02-0001-add-install.patch" + patch_description: "add installer" + patch_type: "conan" "2.01": - patch_file: "patches/2.01-0001-add-install.patch" + patch_description: "add installer" + patch_type: "conan" diff --git a/recipes/picobench/all/conanfile.py b/recipes/picobench/all/conanfile.py index f71d6aab09dbb..62918f33d6e78 100644 --- a/recipes/picobench/all/conanfile.py +++ b/recipes/picobench/all/conanfile.py @@ -25,27 +25,28 @@ class PicobenchConan(ConanFile): def export_sources(self): export_conandata_patches(self) - def generate(self): - tc = CMakeToolchain(self) - tc.variables["PICOBENCH_BUILD_TOOLS"] = self.options.with_cli - tc.generate() - def layout(self): cmake_layout(self, src_folder="src") - def validate(self): - if self.settings.compiler.cppstd: - check_min_cppstd(self, 11) - def package_id(self): - if self.options.with_cli: + if self.info.options.with_cli: del self.info.settings.compiler else: self.info.clear() + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PICOBENCH_BUILD_TOOLS"] = self.options.with_cli + tc.variables["PICOBENCH_BUILD_TESTS"] = False + tc.variables["PICOBENCH_BUILD_EXAMPLES"] = False + tc.generate() def build(self): apply_conandata_patches(self) @@ -65,7 +66,7 @@ def package_info(self): binpath = os.path.join(self.package_folder, "bin") self.output.info("Appending PATH env var: {}".format(binpath)) self.env_info.PATH.append(binpath) + else: + self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/picobench/all/patches/2.02-0001-add-install.patch b/recipes/picobench/all/patches/2.02-0001-add-install.patch new file mode 100644 index 0000000000000..e3daaea325e76 --- /dev/null +++ b/recipes/picobench/all/patches/2.02-0001-add-install.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 68bd3f9..32ef1ea 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,6 +28,11 @@ add_library(picobench INTERFACE) + add_library(picobench::picobench ALIAS picobench) + target_include_directories(picobench INTERFACE include) + ++include(GNUInstallDirs) ++ ++install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/picobench ++ DESTINATION include/) ++ + if(PICOBENCH_BUILD_TOOLS) + add_subdirectory(tools) + endif() +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index cb7f584..cfefe5c 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -10,3 +10,7 @@ add_executable(picobench-cli picobench.cpp) + target_link_libraries(picobench-cli picobench) + set_target_properties(picobench-cli PROPERTIES OUTPUT_NAME picobench) + set_target_properties(picobench-cli PROPERTIES FOLDER tools) ++ ++install(TARGETS picobench-cli ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) diff --git a/recipes/picobench/all/test_package/conanfile.py b/recipes/picobench/all/test_package/conanfile.py index 48499fa0989d9..b9d7f11e89dcd 100644 --- a/recipes/picobench/all/test_package/conanfile.py +++ b/recipes/picobench/all/test_package/conanfile.py @@ -3,8 +3,6 @@ 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" diff --git a/recipes/picobench/all/test_v1_package/CMakeLists.txt b/recipes/picobench/all/test_v1_package/CMakeLists.txt index 426dbc1aa18df..be00a8c7f57c7 100644 --- a/recipes/picobench/all/test_v1_package/CMakeLists.txt +++ b/recipes/picobench/all/test_v1_package/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) diff --git a/recipes/picobench/config.yml b/recipes/picobench/config.yml index bc09c963d7fda..d9b367577730d 100644 --- a/recipes/picobench/config.yml +++ b/recipes/picobench/config.yml @@ -1,3 +1,5 @@ versions: + "2.02": + folder: all "2.01": folder: all diff --git a/recipes/protobuf/all/conandata.yml b/recipes/protobuf/all/conandata.yml index d37db5fc4d5ca..502de4a7d6777 100644 --- a/recipes/protobuf/all/conandata.yml +++ b/recipes/protobuf/all/conandata.yml @@ -21,13 +21,46 @@ sources: url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.17.1.tar.gz" sha256: "036d66d6eec216160dd898cfb162e9d82c1904627642667cc32b104d407bb411" patches: + "3.21.9": + - patch_file: "patches/protobuf-3.21.9-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" + "3.21.4": + - patch_file: "patches/protobuf-3.21.4-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" + "3.20.0": + - patch_file: "patches/protobuf-3.20.0-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" "3.19.6": - patch_file: "patches/upstream-pr-9437-msvc-runtime.patch" patch_description: "Properly handle CMAKE_MSVC_RUNTIME_LIBRARY when using CMake >= 3.15" patch_type: "portability" patch_source: "https://github.com/protocolbuffers/protobuf/pull/9437" + - patch_file: "patches/protobuf-3.19.6-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" "3.19.4": - patch_file: "patches/upstream-pr-9437-msvc-runtime.patch" patch_description: "Properly handle CMAKE_MSVC_RUNTIME_LIBRARY when using CMake >= 3.15" patch_type: "portability" patch_source: "https://github.com/protocolbuffers/protobuf/pull/9437" + - patch_file: "patches/protobuf-3.19.4-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" + "3.18.1": + - patch_file: "patches/protobuf-3.18.1-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" + "3.17.1": + - patch_file: "patches/protobuf-3.17.1-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" diff --git a/recipes/protobuf/all/patches/protobuf-3.17.1-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.17.1-upstream-macos-macros.patch new file mode 100644 index 0000000000000..d8f8f14a25361 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.17.1-upstream-macos-macros.patch @@ -0,0 +1,46 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index 61f0859..d673519 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -616,6 +616,22 @@ + #undef timezone + #endif // _MSC_VER + ++#ifdef __APPLE__ ++// Inconvenient macro names from usr/include/math.h in some macOS SDKs. ++#pragma push_macro("DOMAIN") ++#undef DOMAIN ++// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. ++#pragma push_macro("TRUE") ++#undef TRUE ++#pragma push_macro("FALSE") ++#undef FALSE ++// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. ++#pragma push_macro("UID_MAX") ++#undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX ++#endif // __APPLE__ ++ + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) + // Don't let Objective-C Macros interfere with proto identifiers with the same + // name. +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index 82fe794..dfbbf5b 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -112,6 +112,14 @@ + #pragma pop_macro("timezone") + #endif + ++#ifdef __APPLE__ ++#pragma pop_macro("DOMAIN") ++#pragma pop_macro("TRUE") ++#pragma pop_macro("FALSE") ++#pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") ++#endif // __APPLE__ ++ + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) + #pragma pop_macro("DEBUG") + #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.18.1-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.18.1-upstream-macos-macros.patch new file mode 100644 index 0000000000000..4825966e01d9d --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.18.1-upstream-macos-macros.patch @@ -0,0 +1,46 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index 01384c8..8f8a44d 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -736,6 +736,22 @@ + #undef timezone + #endif // _MSC_VER + ++#ifdef __APPLE__ ++// Inconvenient macro names from usr/include/math.h in some macOS SDKs. ++#pragma push_macro("DOMAIN") ++#undef DOMAIN ++// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. ++#pragma push_macro("TRUE") ++#undef TRUE ++#pragma push_macro("FALSE") ++#undef FALSE ++// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. ++#pragma push_macro("UID_MAX") ++#undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX ++#endif // __APPLE__ ++ + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) + // Don't let Objective-C Macros interfere with proto identifiers with the same + // name. +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index 5fef6e4..9efd5d6 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -128,6 +128,14 @@ + #pragma pop_macro("timezone") + #endif + ++#ifdef __APPLE__ ++#pragma pop_macro("DOMAIN") ++#pragma pop_macro("TRUE") ++#pragma pop_macro("FALSE") ++#pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") ++#endif // __APPLE__ ++ + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) + #pragma pop_macro("DEBUG") + #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.19.4-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.19.4-upstream-macos-macros.patch new file mode 100644 index 0000000000000..b0f3ddc092047 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.19.4-upstream-macos-macros.patch @@ -0,0 +1,46 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index 37632cf..561fd0f 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -763,6 +763,22 @@ + #undef timezone + #endif // _MSC_VER + ++#ifdef __APPLE__ ++// Inconvenient macro names from usr/include/math.h in some macOS SDKs. ++#pragma push_macro("DOMAIN") ++#undef DOMAIN ++// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. ++#pragma push_macro("TRUE") ++#undef TRUE ++#pragma push_macro("FALSE") ++#undef FALSE ++// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. ++#pragma push_macro("UID_MAX") ++#undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX ++#endif // __APPLE__ ++ + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) + // Don't let Objective-C Macros interfere with proto identifiers with the same + // name. +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index 579eb41..7a179f9 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -129,6 +129,14 @@ + #pragma pop_macro("timezone") + #endif + ++#ifdef __APPLE__ ++#pragma pop_macro("DOMAIN") ++#pragma pop_macro("TRUE") ++#pragma pop_macro("FALSE") ++#pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") ++#endif // __APPLE__ ++ + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) + #pragma pop_macro("DEBUG") + #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.19.6-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.19.6-upstream-macos-macros.patch new file mode 100644 index 0000000000000..5aadd2a257043 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.19.6-upstream-macos-macros.patch @@ -0,0 +1,46 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index 30af1cf..4ddf5dc 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -763,6 +763,22 @@ + #undef timezone + #endif // _MSC_VER + ++#ifdef __APPLE__ ++// Inconvenient macro names from usr/include/math.h in some macOS SDKs. ++#pragma push_macro("DOMAIN") ++#undef DOMAIN ++// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. ++#pragma push_macro("TRUE") ++#undef TRUE ++#pragma push_macro("FALSE") ++#undef FALSE ++// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. ++#pragma push_macro("UID_MAX") ++#undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX ++#endif // __APPLE__ ++ + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) + // Don't let Objective-C Macros interfere with proto identifiers with the same + // name. +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index 579eb41..7a179f9 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -129,6 +129,14 @@ + #pragma pop_macro("timezone") + #endif + ++#ifdef __APPLE__ ++#pragma pop_macro("DOMAIN") ++#pragma pop_macro("TRUE") ++#pragma pop_macro("FALSE") ++#pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") ++#endif // __APPLE__ ++ + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) + #pragma pop_macro("DEBUG") + #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.20.0-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.20.0-upstream-macos-macros.patch new file mode 100644 index 0000000000000..df772b5958879 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.20.0-upstream-macos-macros.patch @@ -0,0 +1,29 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index bdb2eec..e8d7dbc 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -816,6 +816,11 @@ + #undef TRUE + #pragma push_macro("FALSE") + #undef FALSE ++// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. ++#pragma push_macro("UID_MAX") ++#undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX + #endif // __APPLE__ + + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index 58136a4..eb0fdc8 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -134,6 +134,8 @@ + #pragma pop_macro("DOMAIN") + #pragma pop_macro("TRUE") + #pragma pop_macro("FALSE") ++#pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") + #endif // __APPLE__ + + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.21.4-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.21.4-upstream-macos-macros.patch new file mode 100644 index 0000000000000..6cf85b0ac3941 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.21.4-upstream-macos-macros.patch @@ -0,0 +1,25 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index b7af780..d50ac87 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -870,6 +870,8 @@ + // Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. + #pragma push_macro("UID_MAX") + #undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX + #endif // __APPLE__ + + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index e880fa5..f8968d9 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -144,6 +144,7 @@ + #pragma pop_macro("TRUE") + #pragma pop_macro("FALSE") + #pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") + #endif // __APPLE__ + + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.21.9-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.21.9-upstream-macos-macros.patch new file mode 100644 index 0000000000000..3a152f62bca69 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.21.9-upstream-macos-macros.patch @@ -0,0 +1,25 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index f00daf7..d956db2 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -870,6 +870,8 @@ + // Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. + #pragma push_macro("UID_MAX") + #undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX + #endif // __APPLE__ + + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index e880fa5..f8968d9 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -144,6 +144,7 @@ + #pragma pop_macro("TRUE") + #pragma pop_macro("FALSE") + #pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") + #endif // __APPLE__ + + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/test_package/addressbook.proto b/recipes/protobuf/all/test_package/addressbook.proto index b4b33b4c65892..be5732b3317e5 100644 --- a/recipes/protobuf/all/test_package/addressbook.proto +++ b/recipes/protobuf/all/test_package/addressbook.proto @@ -49,3 +49,16 @@ message AddressBook { repeated Person people = 1; } // [END messages] + +// Artibrary message with a GID type, to cause +// the .pb.h file to define `GID_MAX`, which +// may conflict with a macro defined by system +// headers on macOS. +message FooBar { + enum GID { + FOO = 0; + } + enum UID { + BAR = 0; + } +} diff --git a/recipes/pthreads4w/all/conanfile.py b/recipes/pthreads4w/all/conanfile.py index 31dbe2fcc6986..2b65df1658831 100644 --- a/recipes/pthreads4w/all/conanfile.py +++ b/recipes/pthreads4w/all/conanfile.py @@ -1,12 +1,16 @@ -from conans import AutoToolsBuildEnvironment, VisualStudioBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import chdir, collect_libs, copy, get, mkdir, replace_in_file +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, NMakeToolchain +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" - +required_conan_version = ">=1.57.0" class Pthreads4WConan(ConanFile): name = "pthreads4w" + package_type = "library" url = "https://github.com/conan-io/conan-center-index" homepage = "https://sourceforge.net/projects/pthreads4w/" description = "POSIX Threads for Windows" @@ -22,54 +26,55 @@ class Pthreads4WConan(ConanFile): "exception_scheme": "default", } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def build_requirements(self): - if self.settings.compiler != "Visual Studio": + if not is_msvc(self): self.build_requires("autoconf/2.71") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_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 validate(self): if self.settings.os != "Windows": raise ConanInvalidConfiguration("pthreads4w can only target os=Windows") + + def layout(self): + basic_layout(self, src_folder="src") 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], + destination=self.source_folder, strip_root=True) - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.configure() - return self._autotools + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + tc.generate() def build(self): - with tools.chdir(self._source_subfolder): - if self.settings.compiler == "Visual Studio": - tools.replace_in_file("Makefile", + with chdir(self, self.source_folder): + if is_msvc(self): + makefile = os.path.join(self.source_folder, "Makefile") + replace_in_file(self, makefile, " copy pthreadV*.lib $(LIBDEST)", " if exist pthreadV*.lib copy pthreadV*.lib $(LIBDEST)") - tools.replace_in_file("Makefile", + replace_in_file(self, makefile, " copy libpthreadV*.lib $(LIBDEST)", " if exist libpthreadV*.lib copy libpthreadV*.lib $(LIBDEST)") - tools.replace_in_file("Makefile", "XCFLAGS=\"/MD\"", "") - tools.replace_in_file("Makefile", "XCFLAGS=\"/MDd\"", "") - tools.replace_in_file("Makefile", "XCFLAGS=\"/MT\"", "") - tools.replace_in_file("Makefile", "XCFLAGS=\"/MTd\"", "") + replace_in_file(self, makefile, "XCFLAGS=\"/MD\"", "") + replace_in_file(self, makefile, "XCFLAGS=\"/MDd\"", "") + replace_in_file(self, makefile, "XCFLAGS=\"/MT\"", "") + replace_in_file(self, makefile, "XCFLAGS=\"/MTd\"", "") target = { "CPP": "VCE", "SEH": "SSE", @@ -78,14 +83,13 @@ def build(self): target += "-static" if self.settings.build_type == "Debug": target += "-debug" - with tools.vcvars(self): - with tools.environment_append(VisualStudioBuildEnvironment(self).vars): - self.run("nmake {}".format(target)) - else: - self.run("{}".format(tools.get_env("AUTOHEADER")), win_bash=tools.os_info.is_windows) - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) - autotools = self._configure_autotools() + self.run(f"nmake {target}") + else: + autotools = Autotools(self) + self.run("autoheader") + autotools.autoreconf() + autotools.configure() make_target = "GCE" if self.options.exception_scheme == "CPP" else "GC" if not self.options.shared: @@ -95,26 +99,24 @@ def build(self): autotools.make(target=make_target, args=["-j1"]) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - with tools.chdir(self._source_subfolder): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - with tools.environment_append(VisualStudioBuildEnvironment(self).vars): - self.run("nmake install DESTROOT={}".format(self.package_folder)) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + with chdir(self, self.source_folder): + if is_msvc(self): + self.run("nmake install DESTROOT={}".format(self.package_folder), env="conanbuild") else: - autotools = self._configure_autotools() - tools.mkdir(os.path.join(self.package_folder, "include")) - tools.mkdir(os.path.join(self.package_folder, "lib")) - autotools.make(target="install-headers") + autotools = Autotools(self) + mkdir(self, os.path.join(self.package_folder, "include")) + mkdir(self, os.path.join(self.package_folder, "lib")) + autotools.install(target="install-headers") if self.options.shared: - tools.mkdir(os.path.join(self.package_folder, "bin")) - autotools.make(target="install-dlls") - autotools.make(target="install-implib-default") + mkdir(self, os.path.join(self.package_folder, "bin")) + autotools.install(target="install-dlls") + autotools.install(target="install-implib-default") else: - autotools.make(target="install-lib-default") + autotools.install(target="install-lib-default") def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) self.cpp_info.defines.append(self._exception_scheme_definition) if not self.options.shared: self.cpp_info.defines.append("__PTW32_STATIC_LIB") diff --git a/recipes/pthreads4w/all/test_package/CMakeLists.txt b/recipes/pthreads4w/all/test_package/CMakeLists.txt index 7b9b613cbb24a..c870341fd9666 100644 --- a/recipes/pthreads4w/all/test_package/CMakeLists.txt +++ b/recipes/pthreads4w/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(pthreads4w REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) + +target_link_libraries(${PROJECT_NAME} PRIVATE pthreads4w::pthreads4w) diff --git a/recipes/pthreads4w/all/test_package/conanfile.py b/recipes/pthreads4w/all/test_package/conanfile.py index d4128b0450777..a9fbb7f543162 100644 --- a/recipes/pthreads4w/all/test_package/conanfile.py +++ b/recipes/pthreads4w/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -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) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +20,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pthreads4w/all/test_v1_package/CMakeLists.txt b/recipes/pthreads4w/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..993b1d536d435 --- /dev/null +++ b/recipes/pthreads4w/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/pthreads4w/all/test_v1_package/conanfile.py b/recipes/pthreads4w/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/pthreads4w/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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/pulseaudio/all/conanfile.py b/recipes/pulseaudio/all/conanfile.py index 0d15b07fe2fd8..0ebc75eb02cc2 100644 --- a/recipes/pulseaudio/all/conanfile.py +++ b/recipes/pulseaudio/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.env import VirtualBuildEnv +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import copy, get, rm, rmdir from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps from conan.tools.layout import basic_layout @@ -52,26 +53,29 @@ def configure(self): if not self.options.with_dbus: del self.options.with_fftw + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): self.requires("libiconv/1.17") - self.requires("libsndfile/1.0.31") - self.requires("libcap/2.65") + self.requires("libsndfile/1.2.0") + self.requires("libcap/2.66") self.requires("libtool/2.4.7") if self.options.with_alsa: self.requires("libalsa/1.2.7.2") if self.options.with_glib: - self.requires("glib/2.73.3") + self.requires("glib/2.76.0") if self.options.get_safe("with_fftw"): self.requires("fftw/3.3.9") if self.options.with_x11: self.requires("xorg/system") if self.options.with_openssl: - self.requires("openssl/1.1.1q") + self.requires("openssl/1.1.1t") if self.options.with_dbus: - self.requires("dbus/1.12.20") + self.requires("dbus/1.15.2") def validate(self): - if self.info.settings.os != "Linux": + if self.settings.os != "Linux": raise ConanInvalidConfiguration("pulseaudio supports only linux currently") if self.options.get_safe("with_fftw"): @@ -85,16 +89,19 @@ def validate(self): def build_requirements(self): self.tool_requires("gettext/0.21") self.tool_requires("libtool/2.4.7") - self.tool_requires("pkgconf/1.7.4") - - def layout(self): - basic_layout(self, src_folder="src") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + 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([ @@ -102,11 +109,11 @@ def generate(self): f"--enable-static={yes_no(not self.options.shared)}", f"--enable-glib2={yes_no(self.options.with_glib)}", f"--with-fftw={yes_no(self.options.get_safe('with_fftw'))}", - f"--with-udev-rules-dir={os.path.join(self.package_folder, 'bin', 'udev', 'rules.d')}", + "--with-udev-rules-dir=${prefix}/bin/udev/rules.d", f"--with-systemduserunitdir={os.path.join(self.build_folder, 'ignore')}", ]) for lib in ["alsa", "x11", "openssl", "dbus"]: - tc.configure_args.append(f"--enable-{lib}={yes_no(getattr(self.options, 'with_' + lib))}") + tc.configure_args.append(f"--enable-{lib}={yes_no(getattr(self.options, f'with_{lib}'))}") # TODO: to remove when automatically handled by AutotoolsToolchain tc.configure_args.append("--libexecdir=${prefix}/bin") tc.generate() @@ -114,8 +121,6 @@ def generate(self): deps.generate() pkg = PkgConfigDeps(self) pkg.generate() - env = VirtualBuildEnv(self) - env.generate() def build(self): autotools = Autotools(self) diff --git a/recipes/qhull/all/conanfile.py b/recipes/qhull/all/conanfile.py index a8c732da75f89..79132e14aac7c 100644 --- a/recipes/qhull/all/conanfile.py +++ b/recipes/qhull/all/conanfile.py @@ -1,10 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class QhullConan(ConanFile): @@ -14,10 +14,11 @@ class QhullConan(ConanFile): "furthest-site Delaunay triangulation, and furthest-site " \ "Voronoi diagram." license = "Qhull" - topics = ("qhull", "geometry", "convex", "triangulation", "intersection") + topics = ("geometry", "convex", "triangulation", "intersection") homepage = "http://www.qhull.org" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -31,8 +32,7 @@ class QhullConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -40,25 +40,18 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass - - def package_id(self): - del self.info.options.reentrant + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") + def package_id(self): + del self.info.options.reentrant + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -92,10 +85,6 @@ def package_info(self): if is_msvc(self) and self.options.shared: self.cpp_info.components["libqhull"].defines.extend(["qh_dllimport"]) - 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) - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.names["cmake_find_package"] = "Qhull" self.cpp_info.names["cmake_find_package_multi"] = "Qhull" @@ -105,6 +94,7 @@ def package_info(self): self.cpp_info.components["libqhull"].names["pkg_config"] = self._qhull_pkgconfig_name self.cpp_info.components["libqhull"].set_property("cmake_target_name", f"Qhull::{self._qhull_cmake_name}") self.cpp_info.components["libqhull"].set_property("pkg_config_name", self._qhull_pkgconfig_name) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) @property def _qhull_cmake_name(self): diff --git a/recipes/qhull/all/test_package/conanfile.py b/recipes/qhull/all/test_package/conanfile.py index c3880701eccbb..66e70cb957d6a 100644 --- a/recipes/qhull/all/test_package/conanfile.py +++ b/recipes/qhull/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def generate(self): tc = CMakeToolchain(self) tc.variables["QHULL_REENTRANT"] = self.dependencies["qhull"].options.reentrant @@ -25,6 +26,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/qhull/all/test_v1_package/CMakeLists.txt b/recipes/qhull/all/test_v1_package/CMakeLists.txt index c52c2903741af..0d20897301b68 100644 --- a/recipes/qhull/all/test_v1_package/CMakeLists.txt +++ b/recipes/qhull/all/test_v1_package/CMakeLists.txt @@ -1,23 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(Qhull REQUIRED CONFIG) - -if(QHULL_REENTRANT) - add_executable(${PROJECT_NAME} ../test_package/test_package_r.c) - if(TARGET Qhull::qhull_r) - target_link_libraries(${PROJECT_NAME} PRIVATE Qhull::qhull_r) - else() - target_link_libraries(${PROJECT_NAME} PRIVATE Qhull::qhullstatic_r) - endif() -else() - add_executable(${PROJECT_NAME} ../test_package/test_package.c) - if(TARGET Qhull::libqhull) - target_link_libraries(${PROJECT_NAME} PRIVATE Qhull::libqhull) - else() - target_link_libraries(${PROJECT_NAME} PRIVATE Qhull::qhullstatic) - endif() -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/quill/all/conanfile.py b/recipes/quill/all/conanfile.py index 4151f27f06788..4a93b65f7b144 100644 --- a/recipes/quill/all/conanfile.py +++ b/recipes/quill/all/conanfile.py @@ -22,11 +22,13 @@ class QuillConan(ConanFile): "fPIC": [True, False], "with_bounded_queue": [True, False], "with_no_exceptions": [True, False], + "with_x86_arch": [True, False], } default_options = { "fPIC": True, "with_bounded_queue": False, "with_no_exceptions": False, + "with_x86_arch": False, } @property @@ -89,6 +91,8 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def is_quilll_x86_arch(self): + if not self.options.with_x86_arch: + return False if Version(self.version) < "2.7.0": return False if self.settings.arch not in ("x86", "x86_64"): diff --git a/recipes/re2/all/conanfile.py b/recipes/re2/all/conanfile.py index a4b44532b5660..c8ad0901b061a 100644 --- a/recipes/re2/all/conanfile.py +++ b/recipes/re2/all/conanfile.py @@ -4,17 +4,18 @@ from conan.tools.files import copy, get, rmdir import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class Re2Conan(ConanFile): name = "re2" description = "Fast, safe, thread-friendly regular expression library" - topics = ("regex") + topics = ("regex",) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/google/re2" license = "BSD-3-Clause" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -37,18 +38,15 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.info.settings.compiler.get_safe("cppstd"): + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) tc.variables["RE2_BUILD_TESTING"] = False - # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() def build(self): diff --git a/recipes/readerwriterqueue/all/conanfile.py b/recipes/readerwriterqueue/all/conanfile.py index bcc34e3602e6d..d7fbd5249cb32 100644 --- a/recipes/readerwriterqueue/all/conanfile.py +++ b/recipes/readerwriterqueue/all/conanfile.py @@ -1,6 +1,11 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.scm import Version +from conan.tools.layout import basic_layout import os +required_conan_version = ">=1.50.0" + class ReaderWriterQueue(ConanFile): name = "readerwriterqueue" @@ -11,27 +16,28 @@ class ReaderWriterQueue(ConanFile): license = "BSD-2-Clause" no_copy_source = True settings = "os" - - @property - def _source_subfolder(self): - return "sources_subfolder" + + def layout(self): + basic_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("readerwriterqueue-{}".format(self.version), - self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def package(self): - self.copy("atomicops.h", src=self._source_subfolder, dst=os.path.join("include", "readerwriterqueue")) - self.copy("readerwriterqueue.h", src=self._source_subfolder, dst=os.path.join("include", "readerwriterqueue")) - if tools.Version(self.version) >= "1.0.5": - self.copy("readerwritercircularbuffer.h", src=self._source_subfolder, dst=os.path.join("include", "readerwriterqueue")) + def build(self): + pass - self.copy("LICENSE.md", src=self._source_subfolder, dst="licenses") + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "atomicops.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "readerwriterqueue")) + copy(self, "readerwriterqueue.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "readerwriterqueue")) + if Version(self.version) >= "1.0.5": + copy(self, "readerwritercircularbuffer.h", src=self.source_folder, dst=os.path.join("include", "readerwriterqueue")) def package_id(self): - self.info.header_only() + self.info.clear() def package_info(self): - if self.settings.os == "Linux": + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/readerwriterqueue/all/test_package/CMakeLists.txt b/recipes/readerwriterqueue/all/test_package/CMakeLists.txt index 454c47bb2cbab..eceb6e660004e 100644 --- a/recipes/readerwriterqueue/all/test_package/CMakeLists.txt +++ b/recipes/readerwriterqueue/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(readerwriterqueue REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE readerwriterqueue::readerwriterqueue) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/readerwriterqueue/all/test_package/conanfile.py b/recipes/readerwriterqueue/all/test_package/conanfile.py index ee6b872776556..a348a04e88cb6 100644 --- a/recipes/readerwriterqueue/all/test_package/conanfile.py +++ b/recipes/readerwriterqueue/all/test_package/conanfile.py @@ -1,9 +1,17 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -class ConcurrentqueueTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,5 +19,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/readerwriterqueue/all/test_v1_package/CMakeLists.txt b/recipes/readerwriterqueue/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/readerwriterqueue/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/readerwriterqueue/all/test_v1_package/conanfile.py b/recipes/readerwriterqueue/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b340bdd7fabce --- /dev/null +++ b/recipes/readerwriterqueue/all/test_v1_package/conanfile.py @@ -0,0 +1,15 @@ +from conans import ConanFile, CMake, tools +import os + +class ConcurrentqueueTestConan(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(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/roaring/all/conandata.yml b/recipes/roaring/all/conandata.yml index 38a9717102897..6aec90ca698c1 100644 --- a/recipes/roaring/all/conandata.yml +++ b/recipes/roaring/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.9": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.9.tar.gz" + sha256: "3083bcbc37e43403111c482ddf317a710972256c23bc83abc8925803a02bdf60" "0.9.8": url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.8.tar.gz" sha256: "d83ea18ded541a49f792951a6e71cd20136171ca0a4c15c77ec5cd5b83ca8e63" diff --git a/recipes/roaring/config.yml b/recipes/roaring/config.yml index 1770fb643352e..9412b8fba3a31 100644 --- a/recipes/roaring/config.yml +++ b/recipes/roaring/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.9": + folder: all "0.9.8": folder: all "0.9.6": diff --git a/recipes/rttr/all/conanfile.py b/recipes/rttr/all/conanfile.py index 05c885a8c43e2..bf4bdedfe2e83 100644 --- a/recipes/rttr/all/conanfile.py +++ b/recipes/rttr/all/conanfile.py @@ -1,20 +1,21 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, collect_libs, copy, get, replace_in_file, rm, rmdir +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rm, rmdir import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class RTTRConan(ConanFile): name = "rttr" description = "Run Time Type Reflection library" - topics = ("reflection", "rttr", ) + topics = ("reflection",) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/rttrorg/rttr" license = "MIT" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -28,8 +29,7 @@ class RTTRConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -37,18 +37,17 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - - def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, 11) + self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/rttr/all/test_package/conanfile.py b/recipes/rttr/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/rttr/all/test_package/conanfile.py +++ b/recipes/rttr/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/rttr/all/test_v1_package/CMakeLists.txt b/recipes/rttr/all/test_v1_package/CMakeLists.txt index 4531fed838b7e..0d20897301b68 100644 --- a/recipes/rttr/all/test_v1_package/CMakeLists.txt +++ b/recipes/rttr/all/test_v1_package/CMakeLists.txt @@ -1,15 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(rttr REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -if(TARGET RTTR::Core) - target_link_libraries(${PROJECT_NAME} PRIVATE RTTR::Core) -else() - target_link_libraries(${PROJECT_NAME} PRIVATE RTTR::Core_Lib) -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/semimap/all/conandata.yml b/recipes/semimap/all/conandata.yml new file mode 100644 index 0000000000000..6af7c8e19bc89 --- /dev/null +++ b/recipes/semimap/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20181023": + url: "https://github.com/hogliux/semimap/archive/de556c74721a5017f5a03faf2fbd1c6e5a768a32.tar.gz" + sha256: "af4689afb3809664507e2ae77332650b658175d5382cbe63957707547d7ee76e" diff --git a/recipes/semimap/all/conanfile.py b/recipes/semimap/all/conanfile.py new file mode 100644 index 0000000000000..bd330607698a4 --- /dev/null +++ b/recipes/semimap/all/conanfile.py @@ -0,0 +1,64 @@ +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 SemimapConan(ConanFile): + name = "semimap" + description = "A semi compile-/run-time associative map container with compile-time lookup and run-time storage" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hogliux/semimap" + topics = ("containers", "constexpr", "hashmap", "header-only") + 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": "16", + "msvc": "192", + "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, pattern="LICENSE.md", 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=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/semimap/all/test_package/CMakeLists.txt b/recipes/semimap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..07f01c03a2b1b --- /dev/null +++ b/recipes/semimap/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(semimap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE semimap::semimap) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/semimap/all/test_package/conanfile.py b/recipes/semimap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/semimap/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/semimap/all/test_package/test_package.cpp b/recipes/semimap/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..00f62373a05d4 --- /dev/null +++ b/recipes/semimap/all/test_package/test_package.cpp @@ -0,0 +1,43 @@ +#include +#include + +#include "semimap.h" + +#define ID(x) \ + []() constexpr { return x; } + +int main() { + + // Test compile-time only load/store + { + struct Tag { + }; + using map = semi::static_map; + + auto& food = map::get(ID("food")); + assert(food.empty()); + + food = "pizza"; + assert(map::get(ID("food")) == "pizza"); + + auto& drink = map::get(ID("drink")); + assert(drink.empty()); + + drink = "beer"; + assert(map::get(ID("food")) == "pizza"); + assert(map::get(ID("drink")) == "beer"); + + map::get(ID("food")) = "spaghetti"; + assert(map::get(ID("food")) == "spaghetti"); + assert(map::get(ID("drink")) == "beer"); + + map::get(ID("drink")) = "soda"; + assert(map::get(ID("food")) == "spaghetti"); + assert(map::get(ID("drink")) == "soda"); + + assert(map::get(ID("starter"), "soup") == "soup"); + assert(map::get(ID("starter"), "salad") == "soup"); + } + + return 0; +} diff --git a/recipes/semimap/all/test_v1_package/CMakeLists.txt b/recipes/semimap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/semimap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/semimap/all/test_v1_package/conanfile.py b/recipes/semimap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/semimap/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/semimap/config.yml b/recipes/semimap/config.yml new file mode 100644 index 0000000000000..b3eb9a995d928 --- /dev/null +++ b/recipes/semimap/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20181023": + folder: all diff --git a/recipes/serd/all/conanfile.py b/recipes/serd/all/conanfile.py index dc19503eb153b..038ad977840b2 100644 --- a/recipes/serd/all/conanfile.py +++ b/recipes/serd/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class SerdConan(ConanFile): @@ -18,6 +18,7 @@ class SerdConan(ConanFile): topics = "linked-data", "semantic-web", "rdf", "turtle", "trig", "ntriples", "nquads" license = "ISC" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -34,40 +35,28 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass - - def build_requirements(self): - self.tool_requires("meson/0.63.1") - self.tool_requires("pkgconf/1.7.4") + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): basic_layout(self, src_folder="src") + def build_requirements(self): + self.tool_requires("meson/1.0.0") + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + env = VirtualBuildEnv(self) + env.generate() tc = MesonToolchain(self) tc.project_options["docs"] = "disabled" tc.project_options["tests"] = "disabled" tc.project_options["tools"] = "disabled" - # TODO: fixed in conan 1.51.0? - tc.project_options["bindir"] = "bin" - tc.project_options["libdir"] = "lib" tc.generate() - env = VirtualBuildEnv(self) - env.generate(scope="build") - def build(self): meson = Meson(self) meson.configure() @@ -95,10 +84,10 @@ def package_info(self): self.cpp_info.system_libs.append("m") def fix_msvc_libname(conanfile, remove_lib_prefix=True): - """remove lib prefix & change extension to .lib""" + """remove lib prefix & change extension to .lib in case of cl like compiler""" from conan.tools.files import rename import glob - if not is_msvc(conanfile): + if not conanfile.settings.get_safe("compiler.runtime"): return libdirs = getattr(conanfile.cpp.package, "libdirs") for libdir in libdirs: diff --git a/recipes/serd/all/test_package/conanfile.py b/recipes/serd/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/serd/all/test_package/conanfile.py +++ b/recipes/serd/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/serd/all/test_v1_package/CMakeLists.txt b/recipes/serd/all/test_v1_package/CMakeLists.txt index b65b8d3f7b2d9..0d20897301b68 100644 --- a/recipes/serd/all/test_v1_package/CMakeLists.txt +++ b/recipes/serd/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(serd REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE serd::serd) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/sigslot/all/conandata.yml b/recipes/sigslot/all/conandata.yml index dbc7b100ed289..eddec82a6c447 100644 --- a/recipes/sigslot/all/conandata.yml +++ b/recipes/sigslot/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.2": + url: "https://github.com/palacaze/sigslot/archive/v1.2.2.tar.gz" + sha256: "d2dd0f91c13dbec1026aa5f393e511db863a8c32146c68c10888a9c193458437" "1.2.1": url: "https://github.com/palacaze/sigslot/archive/v1.2.1.tar.gz" sha256: "180b45e41676a730220e3a9af6ee71b761f23b8f6ade73c8f2aa20b677504934" diff --git a/recipes/sigslot/config.yml b/recipes/sigslot/config.yml index 9f174d514c33f..e7ad2033c3161 100644 --- a/recipes/sigslot/config.yml +++ b/recipes/sigslot/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.2": + folder: all "1.2.1": folder: all "1.2.0": diff --git a/recipes/simdutf/all/conandata.yml b/recipes/simdutf/all/conandata.yml index 9db35b4146b1a..ccc7fafd76088 100644 --- a/recipes/simdutf/all/conandata.yml +++ b/recipes/simdutf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.2": + url: "https://github.com/simdutf/simdutf/archive/v3.2.2.tar.gz" + sha256: "5a5c84c05bf30d681126d1dcbde903615f2c927e201e0c6d489f74a91b7f506f" "3.2.0": url: "https://github.com/simdutf/simdutf/archive/v3.2.0.tar.gz" sha256: "0d9f63e2f308b6b54f399ebbe3a02776b902a2670c88c28de2d75ea2197dc4e9" @@ -27,6 +30,10 @@ sources: url: "https://github.com/simdutf/simdutf/archive/v1.0.1.tar.gz" sha256: "e7832ba58fb95fe00de76dbbb2f17d844a7ad02a6f5e3e9e5ce9520e820049a0" patches: + "3.2.2": + - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + patch_type: "conan" "3.2.0": - patch_file: "patches/2.0.3-0001-fix-cmake.patch" patch_description: "remove static build, enable rpath on macOS" diff --git a/recipes/simdutf/config.yml b/recipes/simdutf/config.yml index 2bfb3edf51407..c0a677b2e1801 100644 --- a/recipes/simdutf/config.yml +++ b/recipes/simdutf/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.2": + folder: all "3.2.0": folder: all "3.1.0": diff --git a/recipes/snappy/all/conandata.yml b/recipes/snappy/all/conandata.yml index 6c12aed54a1a4..1488c7a2baf50 100644 --- a/recipes/snappy/all/conandata.yml +++ b/recipes/snappy/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.10": + url: "https://github.com/google/snappy/archive/1.1.10.tar.gz" + sha256: "49d831bffcc5f3d01482340fe5af59852ca2fe76c3e05df0e67203ebbe0f1d90" "1.1.9": url: "https://github.com/google/snappy/archive/1.1.9.tar.gz" sha256: "75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7" @@ -9,8 +12,29 @@ sources: url: "https://github.com/google/snappy/archive/1.1.7.tar.gz" sha256: "3dfa02e873ff51a11ee02b9ca391807f0c8ea0529a4924afa645fbf97163f9d4" patches: + "1.1.10": + - patch_file: "patches/1.1.10-0001-fix-inlining-failure.patch" + patch_description: "disable inlining for compilation error" + patch_type: "portability" + - patch_file: "patches/1.1.9-0002-no-Werror.patch" + patch_description: "disable 'warning as error' options" + patch_type: "portability" + - patch_file: "patches/1.1.10-0003-fix-clobber-list-older-llvm.patch" + patch_description: "disable inline asm on apple-clang" + patch_type: "portability" + - patch_file: "patches/1.1.9-0004-rtti-by-default.patch" + patch_description: "remove 'disable rtti'" + patch_type: "conan" "1.1.9": - patch_file: "patches/1.1.9-0001-fix-inlining-failure.patch" + patch_description: "disable inlining for compilation error" + patch_type: "portability" - patch_file: "patches/1.1.9-0002-no-Werror.patch" + patch_description: "disable 'warning as error' options" + patch_type: "portability" - patch_file: "patches/1.1.9-0003-fix-clobber-list-older-llvm.patch" + patch_description: "disable inline asm on apple-clang" + patch_type: "portability" - patch_file: "patches/1.1.9-0004-rtti-by-default.patch" + patch_description: "remove 'disable rtti'" + patch_type: "conan" diff --git a/recipes/snappy/all/conanfile.py b/recipes/snappy/all/conanfile.py index ecf8494270b89..0ce00288cff64 100644 --- a/recipes/snappy/all/conanfile.py +++ b/recipes/snappy/all/conanfile.py @@ -53,6 +53,8 @@ def generate(self): tc.variables["SNAPPY_BUILD_TESTS"] = False if Version(self.version) >= "1.1.8": tc.variables["SNAPPY_FUZZING_BUILD"] = False + # Don't use these avx options. These are useless. + # https://github.com/conan-io/conan-center-index/pull/16495 tc.variables["SNAPPY_REQUIRE_AVX"] = False tc.variables["SNAPPY_REQUIRE_AVX2"] = False tc.variables["SNAPPY_INSTALL"] = True diff --git a/recipes/snappy/all/patches/1.1.10-0001-fix-inlining-failure.patch b/recipes/snappy/all/patches/1.1.10-0001-fix-inlining-failure.patch new file mode 100644 index 0000000000000..66b0f05521962 --- /dev/null +++ b/recipes/snappy/all/patches/1.1.10-0001-fix-inlining-failure.patch @@ -0,0 +1,13 @@ +diff --git a/snappy-stubs-internal.h b/snappy-stubs-internal.h +index 1548ed7..3b4a9f3 100644 +--- a/snappy-stubs-internal.h ++++ b/snappy-stubs-internal.h +@@ -100,7 +100,7 @@ + + // Inlining hints. + #if HAVE_ATTRIBUTE_ALWAYS_INLINE +-#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) ++#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE + #else + #define SNAPPY_ATTRIBUTE_ALWAYS_INLINE + #endif // HAVE_ATTRIBUTE_ALWAYS_INLINE diff --git a/recipes/snappy/all/patches/1.1.10-0003-fix-clobber-list-older-llvm.patch b/recipes/snappy/all/patches/1.1.10-0003-fix-clobber-list-older-llvm.patch new file mode 100644 index 0000000000000..969ce3805dadf --- /dev/null +++ b/recipes/snappy/all/patches/1.1.10-0003-fix-clobber-list-older-llvm.patch @@ -0,0 +1,13 @@ +diff --git a/snappy.cc b/snappy.cc +index d414718..e4efb59 100644 +--- a/snappy.cc ++++ b/snappy.cc +@@ -1132,7 +1132,7 @@ inline size_t AdvanceToNextTagX86Optimized(const uint8_t** ip_p, size_t* tag) { + size_t literal_len = *tag >> 2; + size_t tag_type = *tag; + bool is_literal; +-#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) ++#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) && ( (!defined(__clang__) && !defined(__APPLE__)) || (!defined(__APPLE__) && defined(__clang__) && (__clang_major__ >= 9)) || (defined(__APPLE__) && defined(__clang__) && (__clang_major__ > 11)) ) + // TODO clang misses the fact that the (c & 3) already correctly + // sets the zero flag. + asm("and $3, %k[tag_type]\n\t" diff --git a/recipes/snappy/config.yml b/recipes/snappy/config.yml index da7c72c3a201a..521a59e91e109 100644 --- a/recipes/snappy/config.yml +++ b/recipes/snappy/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.10": + folder: all "1.1.9": folder: all "1.1.8": diff --git a/recipes/sqlite3/all/conandata.yml b/recipes/sqlite3/all/conandata.yml index b155ef964565f..abd5698e4def4 100644 --- a/recipes/sqlite3/all/conandata.yml +++ b/recipes/sqlite3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.41.1": + url: "https://sqlite.org/2023/sqlite-amalgamation-3410100.zip" + sha256: "df0d54bf246521360c8148f64e7e5ad07a4665b4f902339e844f4c493d535ff5" "3.40.1": url: "https://sqlite.org/2022/sqlite-amalgamation-3400100.zip" sha256: "49112cc7328392aa4e3e5dae0b2f6736d0153430143d21f69327788ff4efe734" diff --git a/recipes/sqlite3/config.yml b/recipes/sqlite3/config.yml index db730ea2013ea..120cf3d9db93f 100644 --- a/recipes/sqlite3/config.yml +++ b/recipes/sqlite3/config.yml @@ -1,4 +1,6 @@ versions: + "3.41.1": + folder: all "3.40.1": folder: all "3.40.0": diff --git a/recipes/tensorpipe/all/conanfile.py b/recipes/tensorpipe/all/conanfile.py index 6b75a2b9a55d1..0979c77b009b6 100644 --- a/recipes/tensorpipe/all/conanfile.py +++ b/recipes/tensorpipe/all/conanfile.py @@ -17,10 +17,11 @@ class TensorpipeConan(ConanFile): "using the fastest transport for the tensors contained " \ "therein (e.g., CUDA device-to-device copy)." license = "BSD-3-Clause" - topics = ("tensorpipe", "tensor", "cuda") + topics = ("tensor", "cuda") homepage = "https://github.com/pytorch/tensorpipe" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -58,19 +59,18 @@ def layout(self): def requirements(self): self.requires("libnop/cci.20200728") - self.requires("libuv/1.44.1") + self.requires("libuv/1.44.2") def validate(self): - if self.info.settings.compiler.get_safe("cppstd"): + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 14) - if self.info.settings.os == "Windows": + if self.settings.os == "Windows": raise ConanInvalidConfiguration(f"{self.ref} doesn't support Windows") - if self.info.options.cuda: + if self.options.cuda: raise ConanInvalidConfiguration("cuda recipe not yet available in CCI") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/tensorpipe/all/test_v1_package/CMakeLists.txt b/recipes/tensorpipe/all/test_v1_package/CMakeLists.txt index a071eb41c6bdd..0d20897301b68 100644 --- a/recipes/tensorpipe/all/test_v1_package/CMakeLists.txt +++ b/recipes/tensorpipe/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(Tensorpipe REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tensorpipe) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/termcap/all/conanfile.py b/recipes/termcap/all/conanfile.py index 5a7977cbd588b..0acd77cf30764 100644 --- a/recipes/termcap/all/conanfile.py +++ b/recipes/termcap/all/conanfile.py @@ -14,7 +14,7 @@ class TermcapConan(ConanFile): description = "Enables programs to use display terminals in a terminal-independent manner" license = "GPL-2.0-or-later" topics = ("terminal", "display", "text", "writing") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -43,8 +43,7 @@ def layout(self): cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def _extract_sources(self): makefile_text = open(os.path.join(self.source_folder, "Makefile.in")).read() diff --git a/recipes/tl-expected/all/conandata.yml b/recipes/tl-expected/all/conandata.yml index 6ae0878704717..1dbeea5c36d21 100644 --- a/recipes/tl-expected/all/conandata.yml +++ b/recipes/tl-expected/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/TartanLlama/expected/archive/refs/tags/v1.1.0.tar.gz" + sha256: "1db357f46dd2b24447156aaf970c4c40a793ef12a8a9c2ad9e096d9801368df6" "20190710": url: "https://github.com/TartanLlama/expected/archive/6fe2af5191214cce620899f7f06585c047b9f1fc.zip" sha256: "25b009593fcb27aafd3e836e0e726da351b4be7a20703b9bb709a5efd61c26d0" diff --git a/recipes/tl-expected/config.yml b/recipes/tl-expected/config.yml index 73c5695847183..513187394acf8 100644 --- a/recipes/tl-expected/config.yml +++ b/recipes/tl-expected/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.0": + folder: all "20190710": folder: all "1.0.0": diff --git a/recipes/tlx/all/conanfile.py b/recipes/tlx/all/conanfile.py index c87b26dca7424..419a2fc27c4ef 100644 --- a/recipes/tlx/all/conanfile.py +++ b/recipes/tlx/all/conanfile.py @@ -1,11 +1,11 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, collect_libs, copy, get, replace_in_file, rmdir, save +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir, save import os import textwrap -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class TlxConan(ConanFile): @@ -13,10 +13,11 @@ class TlxConan(ConanFile): description = "tlx is a collection of C++ helpers and extensions " \ "universally needed, but not found in the STL." license = "BSL-1.0" - topics = ("tlx", "data-structure", "algorithm") + topics = ("data-structure", "algorithm") homepage = "https://github.com/tlx/tlx" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,8 +30,7 @@ class TlxConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -38,18 +38,17 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - - def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, 11) + self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -111,7 +110,7 @@ def package_info(self): self.cpp_info.set_property("pkg_config_name", "tlx") self.cpp_info.libs = collect_libs(self) if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.extend(["m", "pthread"]) # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] diff --git a/recipes/tlx/all/test_package/conanfile.py b/recipes/tlx/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/tlx/all/test_package/conanfile.py +++ b/recipes/tlx/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/tlx/all/test_v1_package/CMakeLists.txt b/recipes/tlx/all/test_v1_package/CMakeLists.txt index b9c999f87aab7..0d20897301b68 100644 --- a/recipes/tlx/all/test_v1_package/CMakeLists.txt +++ b/recipes/tlx/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(tlx REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tlx) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/unqlite/all/conanfile.py b/recipes/unqlite/all/conanfile.py index 5d9c43417f4e1..b9783b0fc81d0 100644 --- a/recipes/unqlite/all/conanfile.py +++ b/recipes/unqlite/all/conanfile.py @@ -3,17 +3,17 @@ from conan.tools.files import copy, get import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.53.0" class UnqliteConan(ConanFile): name = "unqlite" description = "An Embedded NoSQL, Transactional Database Engine." license = "BSD-2-Clause" - topics = ("unqlite", "nosql", "database", "transactional", "storage") + topics = ("nosql", "database", "transactional", "storage") homepage = "https://unqlite.org" url = "https://github.com/conan-io/conan-center-index" - + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -27,21 +27,14 @@ def config_options(self): del self.options.fPIC def configure(self): - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/unqlite/all/test_package/conanfile.py b/recipes/unqlite/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/unqlite/all/test_package/conanfile.py +++ b/recipes/unqlite/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + 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 not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/unqlite/all/test_v1_package/CMakeLists.txt b/recipes/unqlite/all/test_v1_package/CMakeLists.txt index 1b71e991cf942..0d20897301b68 100644 --- a/recipes/unqlite/all/test_v1_package/CMakeLists.txt +++ b/recipes/unqlite/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(unqlite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE unqlite::unqlite) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/unqlite/all/test_v1_package/conanfile.py b/recipes/unqlite/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/unqlite/all/test_v1_package/conanfile.py +++ b/recipes/unqlite/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os diff --git a/recipes/uriparser/all/conanfile.py b/recipes/uriparser/all/conanfile.py index 79bc7cd3ce078..9e901d6027dc5 100644 --- a/recipes/uriparser/all/conanfile.py +++ b/recipes/uriparser/all/conanfile.py @@ -4,17 +4,17 @@ from conan.tools.microsoft import is_msvc, msvc_runtime_flag import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.54.0" class UriparserConan(ConanFile): name = "uriparser" description = "Strictly RFC 3986 compliant URI parsing and handling library written in C89" - topics = ("uriparser", "uri", "parser") + topics = ("uri", "parser") url = "https://github.com/conan-io/conan-center-index" homepage = "https://uriparser.github.io/" - license = "BSD-3-Clause" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -38,25 +38,15 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -67,8 +57,6 @@ def generate(self): tc.variables["URIPARSER_BUILD_WCHAR"] = self.options.with_wchar if is_msvc(self): tc.variables["URIPARSER_MSVC_RUNTIME"] = f"/{msvc_runtime_flag(self)}" - # Honor BUILD_SHARED_LIBS (see https://github.com/conan-io/conan/issues/11840) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() def build(self): diff --git a/recipes/uriparser/all/test_v1_package/CMakeLists.txt b/recipes/uriparser/all/test_v1_package/CMakeLists.txt index e330dcdb828b1..0d20897301b68 100644 --- a/recipes/uriparser/all/test_v1_package/CMakeLists.txt +++ b/recipes/uriparser/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(uriparser REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE uriparser::uriparser) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/vaapi/all/conanfile.py b/recipes/vaapi/all/conanfile.py index 756d5ef4595be..957b4cfa16911 100644 --- a/recipes/vaapi/all/conanfile.py +++ b/recipes/vaapi/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration, ConanException +from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import PkgConfig from conan.tools.system import package_manager -from conans import tools required_conan_version = ">=1.47" @@ -21,27 +21,9 @@ def validate(self): raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") def package_id(self): - self.info.header_only() - - def _fill_cppinfo_from_pkgconfig(self, name): - pkg_config = tools.PkgConfig(name) - if not pkg_config.provides: - raise ConanException("VAAPI development files aren't available, give up") - libs = [lib[2:] for lib in pkg_config.libs_only_l] - lib_dirs = [lib[2:] for lib in pkg_config.libs_only_L] - ldflags = [flag for flag in pkg_config.libs_only_other] - include_dirs = [include[2:] for include in pkg_config.cflags_only_I] - cflags = [flag for flag in pkg_config.cflags_only_other if not flag.startswith("-D")] - defines = [flag[2:] for flag in pkg_config.cflags_only_other if flag.startswith("-D")] - - self.cpp_info.system_libs.extend(libs) - self.cpp_info.libdirs.extend(lib_dirs) - self.cpp_info.sharedlinkflags.extend(ldflags) - self.cpp_info.exelinkflags.extend(ldflags) - self.cpp_info.defines.extend(defines) - self.cpp_info.includedirs.extend(include_dirs) - self.cpp_info.cflags.extend(cflags) - self.cpp_info.cxxflags.extend(cflags) + del self.info.settings.compiler + del self.info.settings.arch + del self.info.settings.build_type def system_requirements(self): dnf = package_manager.Dnf(self) @@ -63,8 +45,9 @@ def system_requirements(self): pkg.install(["libva"], update=True, check=True) def package_info(self): - self.cpp_info.includedirs = [] - self.cpp_info.libdirs = [] if self.settings.os in ["Linux", "FreeBSD"]: for name in ['libva', 'libva-x11', 'libva-drm']: - self._fill_cppinfo_from_pkgconfig(name) + pkg_config = PkgConfig(self, name) + self.cpp_info.components[name].includedirs = [] + self.cpp_info.components[name].libdirs = [] + pkg_config.fill_cpp_info(self.cpp_info.components[name]) diff --git a/recipes/vaapi/all/test_package/CMakeLists.txt b/recipes/vaapi/all/test_package/CMakeLists.txt index 950b4165b7aa4..1cc7d1fad52a6 100644 --- a/recipes/vaapi/all/test_package/CMakeLists.txt +++ b/recipes/vaapi/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(xorg REQUIRED CONFIG) +find_package(vaapi REQUIRED CONFIG) -set(SOURCES test_package.c) - -add_executable(${PROJECT_NAME} ${SOURCES}) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE vaapi::vaapi xorg::xorg) diff --git a/recipes/vaapi/all/test_package/conanfile.py b/recipes/vaapi/all/test_package/conanfile.py index 1b482d65b9b4e..e81d71833c5a3 100644 --- a/recipes/vaapi/all/test_package/conanfile.py +++ b/recipes/vaapi/all/test_package/conanfile.py @@ -1,18 +1,27 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" requires = ("xorg/system",) + 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 not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if not cross_building(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/vaapi/all/test_v1_package/CMakeLists.txt b/recipes/vaapi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f5bce0e6460d --- /dev/null +++ b/recipes/vaapi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +set(SOURCES ../test_package/test_package.c) + +add_executable(${PROJECT_NAME} ${SOURCES}) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/vaapi/all/test_v1_package/conanfile.py b/recipes/vaapi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1b482d65b9b4e --- /dev/null +++ b/recipes/vaapi/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + requires = ("xorg/system",) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/vdpau/all/conanfile.py b/recipes/vdpau/all/conanfile.py index 037314ecd8e20..f2d2ef6b865d4 100644 --- a/recipes/vdpau/all/conanfile.py +++ b/recipes/vdpau/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration, ConanException +from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import PkgConfig from conan.tools.system import package_manager -from conans import tools required_conan_version = ">=1.47" @@ -10,7 +10,7 @@ class SysConfigVDPAUConan(ConanFile): name = "vdpau" version = "system" description = "VDPAU is the Video Decode and Presentation API for UNIX. It provides an interface to video decode acceleration and presentation hardware present in modern GPUs." - topics = ("conan", "vdpau", "hwaccel", "video") + topics = ("vdpau", "hwaccel", "video") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.freedesktop.org/wiki/Software/VDPAU/" license = "MIT" @@ -21,27 +21,9 @@ def validate(self): raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") def package_id(self): - self.info.header_only() - - def _fill_cppinfo_from_pkgconfig(self, name): - pkg_config = tools.PkgConfig(name) - if not pkg_config.provides: - raise ConanException("VDPAU development files aren't available, give up") - libs = [lib[2:] for lib in pkg_config.libs_only_l] - lib_dirs = [lib[2:] for lib in pkg_config.libs_only_L] - ldflags = [flag for flag in pkg_config.libs_only_other] - include_dirs = [include[2:] for include in pkg_config.cflags_only_I] - cflags = [flag for flag in pkg_config.cflags_only_other if not flag.startswith("-D")] - defines = [flag[2:] for flag in pkg_config.cflags_only_other if flag.startswith("-D")] - - self.cpp_info.system_libs.extend(libs) - self.cpp_info.libdirs.extend(lib_dirs) - self.cpp_info.sharedlinkflags.extend(ldflags) - self.cpp_info.exelinkflags.extend(ldflags) - self.cpp_info.defines.extend(defines) - self.cpp_info.includedirs.extend(include_dirs) - self.cpp_info.cflags.extend(cflags) - self.cpp_info.cxxflags.extend(cflags) + del self.info.settings.compiler + del self.info.settings.arch + del self.info.settings.build_type def system_requirements(self): dnf = package_manager.Dnf(self) @@ -66,4 +48,5 @@ def package_info(self): self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] if self.settings.os in ["Linux", "FreeBSD"]: - self._fill_cppinfo_from_pkgconfig('vdpau') + pkg_config = PkgConfig(self, "vdpau") + pkg_config.fill_cpp_info(self.cpp_info) diff --git a/recipes/vdpau/all/test_package/CMakeLists.txt b/recipes/vdpau/all/test_package/CMakeLists.txt index 950b4165b7aa4..0fe5a1d45c245 100644 --- a/recipes/vdpau/all/test_package/CMakeLists.txt +++ b/recipes/vdpau/all/test_package/CMakeLists.txt @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(PkgConfig) -set(SOURCES test_package.c) +pkg_check_modules(VDPAU REQUIRED IMPORTED_TARGET vdpau) +find_package(xorg REQUIRED CONFIG) -add_executable(${PROJECT_NAME} ${SOURCES}) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_executable(test_package test_package.c) +target_link_libraries(test_package PRIVATE PkgConfig::VDPAU xorg::xorg) diff --git a/recipes/vdpau/all/test_package/conanfile.py b/recipes/vdpau/all/test_package/conanfile.py index 1b482d65b9b4e..e81d71833c5a3 100644 --- a/recipes/vdpau/all/test_package/conanfile.py +++ b/recipes/vdpau/all/test_package/conanfile.py @@ -1,18 +1,27 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" requires = ("xorg/system",) + 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 not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if not cross_building(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/vdpau/all/test_v1_package/CMakeLists.txt b/recipes/vdpau/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9dfdf0083dcd8 --- /dev/null +++ b/recipes/vdpau/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/vdpau/all/test_v1_package/conanfile.py b/recipes/vdpau/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1b482d65b9b4e --- /dev/null +++ b/recipes/vdpau/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + requires = ("xorg/system",) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/vulkan-headers/all/conandata.yml b/recipes/vulkan-headers/all/conandata.yml index 58fb14241e22f..4ea27ccb82b74 100644 --- a/recipes/vulkan-headers/all/conandata.yml +++ b/recipes/vulkan-headers/all/conandata.yml @@ -23,18 +23,12 @@ sources: "1.3.221": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.3.221.tar.gz" sha256: "75057d8231bb7a3f6ac091f1b08f50604f07a7e9b4424fd12c035f01787ebf0c" - "1.3.219": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.3.219.tar.gz" - sha256: "3e5d1b727a5e3a5546e6b0709d520d3f522f0a83808277a313357140645be90c" "1.3.216.0": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.216.0.tar.gz" sha256: "2c98d1d819fde588fb0f71acebea177f805b3efa26e8260a707a94b1e633be6b" "1.3.211.0": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.211.0.tar.gz" sha256: "c464bcdc24b7541ac4378a270617a23d4d92699679a73f95dc4b9e1da924810a" - "1.3.211": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.3.211.tar.gz" - sha256: "67ab69142f69389dfdf5f1c7922e62aa4a03ba286b9229dd7f7f3e827232463c" "1.3.204.1": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.204.1.tar.gz" sha256: "9c4d33f71467c915749fbf48c0c3a8ee7833f15babf398e3463cd88791fb592e" @@ -59,18 +53,12 @@ sources: "1.2.189": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.2.189.tar.gz" sha256: "0939d6cb950746f6f9cab59399c0a99628ed186426a972996599f90d34d8a99a" - "1.2.184": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.184.tar.gz" - sha256: "de1889ff550c1a78e752fbdf71117ac319fb674b0abe080a4e6e9053da2aea85" "1.2.182": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.2.182.tar.gz" sha256: "38d1c953de7bb2d839556226851feeb690f0d23bc22ac46c823dcb66c97bfdc8" "1.2.176.0": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.2.176.0.tar.gz" sha256: "211d8552c5cf8b0607323d69c251d9c4639f89550f8de3d51d3995b5cdd737fb" - "1.2.176": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.2.176.tar.gz" - sha256: "d77b033e74448341b42d1b6f2b380570e870b0443875f26c9e8a636f01ee6fe7" "1.2.172": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.172.tar.gz" sha256: "c69619ac2001ac62378a99c56ced14a53801fdc204efb2b1f787c83b47829319" @@ -89,63 +77,6 @@ sources: "1.2.154.0": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.2.154.0.tar.gz" sha256: "a0528ade4dd3bd826b960ba4ccabc62e92ecedc3c70331b291e0a7671b3520f9" - "1.2.151": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.151.tar.gz" - sha256: "9a3bb3077c9bb71347d6b9942fa5b728053b67dbd5c1eb9d75a774bccefa18d8" - "1.2.150": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.150.tar.gz" - sha256: "dc6477b06ed04f4df72cb46915131c1a844980c6f4993954672893b69c2ffb57" - "1.2.149": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.149.tar.gz" - sha256: "332e35104a911447915ccf03f2d61d7e061d3cf5a09419a032b3b09246dcca85" - "1.2.148.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.2.148.0.tar.gz" - sha256: "0803784b701c461ff5cce30bb8c598db5780032cf780c954d676e142bc3c373f" - "1.2.141.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.2.141.0.tar.gz" - sha256: "579d112433c89ac8a4a93741bfa6eee8dca4a1d8145363a28d6d9967babc2b07" "1.2.140": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.140.tar.gz" sha256: "c708a05b0ef673ae783f8968c5396dc207b9f8c7cde2ddb4a9a281e04661185a" - "1.2.135.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.2.135.0.tar.gz" - sha256: "befc69991e1e268db75921c577be32a3f315d01d78b39b74ef87ba6908787b63" - "1.2.131.1": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.2.131.1.tar.gz" - sha256: "bd6873060c6988b62b938d7cb7e3152f006f44fbfaa9ce4b7f555b20ec77c53d" - "1.1.130.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.130.0.tar.gz" - sha256: "9afceeae5020b771246853ad5b098bd4bfeebc859759f26bbe0b87c9272c94d4" - "1.1.126.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.126.0.tar.gz" - sha256: "34a9a6d3e3bf0745e901f75a08f57d4ff388c7e1c59a8dad0dc8437c54236a13" - "1.1.121.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.121.0.tar.gz" - sha256: "4643e193a18ea06ff403da3672c86cc7792a77a4b6a1e70852090732792694ab" - "1.1.114.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.114.0.tar.gz" - sha256: "701cc5391c5c757b48f0b8bc6944586c3d479cff7e1803acac9f59c11e9cebf2" - "1.1.108.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.108.0.tar.gz" - sha256: "944e88911e47e5d34bc4360e3e5833a0d550e3e7483dfa27a5f4d38525a1b943" - "1.1.106.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.106.0.tar.gz" - sha256: "61eba1be3c4eed6bef9745ec8d8767869eacb6daff6d5b98951052910b73de8f" - "1.1.101.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.101.0.tar.gz" - sha256: "59e17335932574e736472b0677390f84150d6bd461e648b13e17d870c42c1c3b" - "1.1.97.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.97.0.tar.gz" - sha256: "a09c83df5647e53ef511a1f2563dec02fae8f13880808914175dc26b06159f16" - "1.1.92.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.92.0.tar.gz" - sha256: "89164ad4e2a4767357732fd92248b6ec36a5ab16d988b64f2aa75cdbc28f6f19" - "1.1.85.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.85.0.tar.gz" - sha256: "d3c6435d101bb9271019c9d0dd159e210a805958dda3bb13344fce9316c6d098" - "1.1.82.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.82.0.tar.gz" - sha256: "df73da07d547cfbe88a797802401ea8225e4844e13d4fde52a7cb6e00e5179e5" - "1.1.77.0": - url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.77.0.tar.gz" - sha256: "b2f532bfd1d8e7594f131a4aa79358bfe4fd0aa59d3292dbafd484223d56ef16" diff --git a/recipes/vulkan-headers/all/conanfile.py b/recipes/vulkan-headers/all/conanfile.py index 2926437171c3e..a17cf251c00d3 100644 --- a/recipes/vulkan-headers/all/conanfile.py +++ b/recipes/vulkan-headers/all/conanfile.py @@ -13,6 +13,7 @@ class VulkanHeadersConan(ConanFile): topics = ("vulkan-headers", "vulkan") homepage = "https://github.com/KhronosGroup/Vulkan-Headers" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -23,8 +24,7 @@ def package_id(self): self.info.clear() def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass diff --git a/recipes/vulkan-headers/all/test_v1_package/CMakeLists.txt b/recipes/vulkan-headers/all/test_v1_package/CMakeLists.txt index bc3d3088a8a02..0d20897301b68 100644 --- a/recipes/vulkan-headers/all/test_v1_package/CMakeLists.txt +++ b/recipes/vulkan-headers/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(VulkanHeaders REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} Vulkan::Headers) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/vulkan-headers/config.yml b/recipes/vulkan-headers/config.yml index 4938af0ce545d..8317a43f24372 100644 --- a/recipes/vulkan-headers/config.yml +++ b/recipes/vulkan-headers/config.yml @@ -15,14 +15,10 @@ versions: folder: all "1.3.221": folder: all - "1.3.219": - folder: all "1.3.216.0": folder: all "1.3.211.0": folder: all - "1.3.211": - folder: all "1.3.204.1": folder: all "1.3.204.0": @@ -39,14 +35,10 @@ versions: folder: all "1.2.189": folder: all - "1.2.184": - folder: all "1.2.182": folder: all "1.2.176.0": folder: all - "1.2.176": - folder: all "1.2.172": folder: all "1.2.170.0": @@ -59,43 +51,5 @@ versions: folder: all "1.2.154.0": folder: all - "1.2.151": - folder: all - "1.2.150": - folder: all - "1.2.149": - folder: all - "1.2.148.0": - folder: all - "1.2.141.0": - folder: all "1.2.140": folder: all - "1.2.135.0": - folder: all - "1.2.131.1": - folder: all - "1.1.130.0": - folder: all - "1.1.126.0": - folder: all - "1.1.121.0": - folder: all - "1.1.114.0": - folder: all - "1.1.108.0": - folder: all - "1.1.106.0": - folder: all - "1.1.101.0": - folder: all - "1.1.97.0": - folder: all - "1.1.92.0": - folder: all - "1.1.85.0": - folder: all - "1.1.82.0": - folder: all - "1.1.77.0": - folder: all diff --git a/recipes/websocketpp/all/conanfile.py b/recipes/websocketpp/all/conanfile.py index 561f5099440d0..b624ce15c7838 100644 --- a/recipes/websocketpp/all/conanfile.py +++ b/recipes/websocketpp/all/conanfile.py @@ -34,7 +34,7 @@ def layout(self): def requirements(self): if self.options.with_openssl: - self.requires("openssl/1.1.1s", transitive_headers=True, transitive_libs=True) + self.requires("openssl/1.1.1t", transitive_headers=True, transitive_libs=True) if self.options.with_zlib: self.requires("zlib/1.2.13", transitive_headers=True, transitive_libs=True) diff --git a/recipes/wslay/all/conanfile.py b/recipes/wslay/all/conanfile.py index 0891ca89ea5c3..0adf9718dbe26 100644 --- a/recipes/wslay/all/conanfile.py +++ b/recipes/wslay/all/conanfile.py @@ -1,10 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, rmdir, save +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save import os import textwrap -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class WslayConan(ConanFile): @@ -15,6 +15,7 @@ class WslayConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" license = "MIT" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,8 +27,7 @@ class WslayConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -35,22 +35,15 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/wslay/all/test_v1_package/CMakeLists.txt b/recipes/wslay/all/test_v1_package/CMakeLists.txt index b27e89de2a1f8..0d20897301b68 100644 --- a/recipes/wslay/all/test_v1_package/CMakeLists.txt +++ b/recipes/wslay/all/test_v1_package/CMakeLists.txt @@ -1,14 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(wslay REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -if(TARGET wslay_shared) - target_link_libraries(${PROJECT_NAME} PRIVATE wslay_shared) -else() - target_link_libraries(${PROJECT_NAME} PRIVATE wslay) -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xapian-core/all/conandata.yml b/recipes/xapian-core/all/conandata.yml index 3982cd0a47586..4514bc0f40509 100644 --- a/recipes/xapian-core/all/conandata.yml +++ b/recipes/xapian-core/all/conandata.yml @@ -5,20 +5,9 @@ sources: "1.4.18": url: "https://oligarchy.co.uk/xapian/1.4.18/xapian-core-1.4.18.tar.xz" sha256: "196ddbb4ad10450100f0991a599e4ed944cbad92e4a6fe813be6dce160244b77" - "1.4.16": - url: "https://oligarchy.co.uk/xapian/1.4.16/xapian-core-1.4.16.tar.xz" - sha256: "4937f2f49ff27e39a42150e928c8b45877b0bf456510f0785f50159a5cb6bf70" patches: "1.4.19": - patch_file: "patches/0001-add-msvc-cl-sh.patch" - base_path: "" "1.4.18": - patch_file: "patches/0001-add-msvc-cl-sh.patch" - base_path: "" - patch_file: "patches/0002-add-cerrno.patch" - base_path: "source_subfolder" - "1.4.16": - - patch_file: "patches/0001-add-msvc-cl-sh.patch" - base_path: "" - - patch_file: "patches/0003-missing-limits-include.patch" - base_path: "source_subfolder" diff --git a/recipes/xapian-core/all/conanfile.py b/recipes/xapian-core/all/conanfile.py index 257fe6219505e..f2cc68f3f1bd4 100644 --- a/recipes/xapian-core/all/conanfile.py +++ b/recipes/xapian-core/all/conanfile.py @@ -1,14 +1,16 @@ from conan import ConanFile -from conan.tools.files import rename, apply_conandata_patches, replace_in_file, rmdir, save, rm, get -from conan.tools.microsoft import is_msvc -from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration -from conans import AutoToolsBuildEnvironment, tools -from contextlib import contextmanager -import functools +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, rename, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path, unix_path_package_info_legacy +import os import textwrap -required_conan_version = ">=1.51.0" +required_conan_version = ">=1.57.0" class XapianCoreConan(ConanFile): @@ -22,6 +24,7 @@ class XapianCoreConan(ConanFile): homepage = "https://xapian.org/" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -32,17 +35,12 @@ class XapianCoreConan(ConanFile): "fPIC": 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": @@ -50,7 +48,10 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): self.requires("zlib/1.2.13") @@ -59,91 +60,103 @@ def requirements(self): def validate(self): if self.options.shared and self.settings.os == "Windows": - raise ConanInvalidConfiguration("shared builds are unavailable due to libtool's inability to create shared libraries") + raise ConanInvalidConfiguration( + "shared builds are unavailable due to libtool's inability to create shared libraries" + ) 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_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], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - @contextmanager - def _build_context(self): - if is_msvc(self): - with tools.vcvars(self.settings): - msvc_cl_sh = f"{self.build_folder}/msvc_cl.sh".replace("\\", "/") - env = { - "AR": "lib", - "CC": msvc_cl_sh, - "CXX": msvc_cl_sh, - "LD": msvc_cl_sh, - "NM": "dumpbin -symbols", - "OBJDUMP": ":", - "RANLIB": ":", - "STRIP": ":", - } - with tools.environment_append(env): - yield - else: - yield + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") - @property - def _datarootdir(self): - return f"{self.package_folder}/bin/share" - - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.libs = [] - autotools.link_flags.extend(["-L{}".format(l.replace("\\", "/")) for l in autotools.library_paths]) - autotools.library_paths = [] + tc = AutotoolsToolchain(self) if is_msvc(self): - autotools.cxx_flags.append("-EHsc") - if (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \ - (self.settings.compiler == "msvc" and Version(self.settings.compiler.version) >= "180"): - autotools.flags.append("-FS") - conf_args = [ - "--datarootdir={}".format(self._datarootdir.replace("\\", "/")), + tc.extra_cxxflags.append("-EHsc") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.configure_args.extend([ + "--datarootdir=${prefix}/res", "--disable-documentation", - ] - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return autotools + ]) + env = tc.environment() + if is_msvc(self): + msvc_cl_sh = unix_path(self, os.path.join(self.source_folder, "msvc_cl.sh")) + env.define("AR", "lib") + env.define("CC", msvc_cl_sh) + env.define("CXX", msvc_cl_sh) + env.define("LD", msvc_cl_sh) + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) - def _patch_sources(self): - apply_conandata_patches(self) - # Relocatable shared lib on macOS - replace_in_file(self, f"{self._source_subfolder}/configure", - "-install_name \\$rpath/", - "-install_name @rpath/") + if is_msvc(self): + # Custom AutotoolsDeps for cl like compilers + # workaround for https://github.com/conan-io/conan/issues/12784 + includedirs = [] + defines = [] + libs = [] + libdirs = [] + linkflags = [] + cxxflags = [] + cflags = [] + for dependency in self.dependencies.values(): + deps_cpp_info = dependency.cpp_info.aggregated_components() + includedirs.extend(deps_cpp_info.includedirs) + defines.extend(deps_cpp_info.defines) + libs.extend(deps_cpp_info.libs + deps_cpp_info.system_libs) + libdirs.extend(deps_cpp_info.libdirs) + linkflags.extend(deps_cpp_info.sharedlinkflags + deps_cpp_info.exelinkflags) + cxxflags.extend(deps_cpp_info.cxxflags) + cflags.extend(deps_cpp_info.cflags) + + env = Environment() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in includedirs] + [f"-D{d}" for d in defines]) + env.append("LIBS", [f"-l{lib}" for lib in libs]) + env.append("LDFLAGS", [f"-L{unix_path(self, p)}" for p in libdirs] + linkflags) + env.append("CXXFLAGS", cxxflags) + env.append("CFLAGS", cflags) + env.vars(self).save_script("conanautotoolsdeps_cl_workaround") + else: + deps = AutotoolsDeps(self) + deps.generate() def build(self): - self._patch_sources() - 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() if is_msvc(self) and not self.options.shared: rename(self, f"{self.package_folder}/lib/libxapian.lib", f"{self.package_folder}/lib/xapian.lib") rm(self, "xapian-config", f"{self.package_folder}/bin") - rm(self, "libxapian.la", f"{self.package_folder}/lib") + rm(self, "*.la", f"{self.package_folder}/lib") rmdir(self, f"{self.package_folder}/lib/cmake") rmdir(self, f"{self.package_folder}/lib/pkgconfig") rmdir(self, f"{self._datarootdir}/doc") rmdir(self, f"{self._datarootdir}/man") + fix_apple_shared_install_name(self) + self._create_cmake_module_variables( f"{self.package_folder}/{self._module_file_rel_path}" ) @@ -168,12 +181,16 @@ def _create_cmake_module_variables(self, module_file): def _module_file_rel_path(self): return f"lib/cmake/conan-official-{self.name}-variables.cmake" + @property + def _datarootdir(self): + return os.path.join(self.package_folder, "res") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "xapian") self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) self.cpp_info.set_property("pkg_config_name", "xapian-core") - self.cpp_info.libs = ["xapian"] + self.cpp_info.resdirs = ["res"] if not self.options.shared: if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.system_libs = ["rt", "m"] @@ -182,16 +199,13 @@ def package_info(self): elif self.settings.os == "SunOS": self.cpp_info.system_libs = ["socket", "nsl"] - binpath = f"{self.package_folder}/bin" - self.output.info(f"Appending PATH environment variable: {binpath}") - self.env_info.PATH.append(binpath) - - xapian_aclocal = tools.unix_path(f"{self._datarootdir}/aclocal") - self.output.info(f"Appending AUTOMAKE_CONAN_INCLUDES environment variable: {xapian_aclocal}") - self.env_info.AUTOMAKE_CONAN_INCLUDES.append(tools.unix_path(xapian_aclocal)) + xapian_aclocal_dir = os.path.join(self._datarootdir, "aclocal") + self.buildenv_info.prepend_path("AUTOMAKE_CONAN_INCLUDES", xapian_aclocal_dir) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "xapian" self.cpp_info.names["cmake_find_package_multi"] = "xapian" self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.AUTOMAKE_CONAN_INCLUDES.append(unix_path_package_info_legacy(self, xapian_aclocal_dir)) diff --git a/recipes/xapian-core/all/patches/0003-missing-limits-include.patch b/recipes/xapian-core/all/patches/0003-missing-limits-include.patch deleted file mode 100644 index abcad94268aa8..0000000000000 --- a/recipes/xapian-core/all/patches/0003-missing-limits-include.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/api/omdocument.cc -+++ b/api/omdocument.cc -@@ -38,6 +38,7 @@ - #include - - #include -+#include - #include - - using namespace std; diff --git a/recipes/xapian-core/all/test_package/CMakeLists.txt b/recipes/xapian-core/all/test_package/CMakeLists.txt index 6d65c1295e47c..6d27b4aff7006 100644 --- a/recipes/xapian-core/all/test_package/CMakeLists.txt +++ b/recipes/xapian-core/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(xapian REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_include_directories(${PROJECT_NAME} PRIVATE ${XAPIAN_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} ${XAPIAN_LIBRARIES}) +target_link_libraries(${PROJECT_NAME} PRIVATE ${XAPIAN_LIBRARIES}) diff --git a/recipes/xapian-core/all/test_package/conanfile.py b/recipes/xapian-core/all/test_package/conanfile.py index 38f4483872d47..98ab55852ad56 100644 --- a/recipes/xapian-core/all/test_package/conanfile.py +++ b/recipes/xapian-core/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/xapian-core/all/test_v1_package/CMakeLists.txt b/recipes/xapian-core/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/xapian-core/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xapian-core/all/test_v1_package/conanfile.py b/recipes/xapian-core/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xapian-core/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/xapian-core/config.yml b/recipes/xapian-core/config.yml index 6e1ece0ca59fb..bc4d571521f81 100644 --- a/recipes/xapian-core/config.yml +++ b/recipes/xapian-core/config.yml @@ -3,5 +3,3 @@ versions: folder: "all" "1.4.18": folder: "all" - "1.4.16": - folder: "all" diff --git a/recipes/xorg-cf-files/all/conanfile.py b/recipes/xorg-cf-files/all/conanfile.py index 01f8b70e11cc2..aa2cb1d905e4c 100644 --- a/recipes/xorg-cf-files/all/conanfile.py +++ b/recipes/xorg-cf-files/all/conanfile.py @@ -13,7 +13,7 @@ class XorgCfFilesConan(ConanFile): name = "xorg-cf-files" - package_type = "build-scripts" + # package_type = "build-scripts" # see https://github.com/conan-io/conan/issues/13431 description = "Imake configuration files & templates" topics = ("imake", "xorg", "template", "configuration", "obsolete") license = "MIT" diff --git a/recipes/xtrans/all/conanfile.py b/recipes/xtrans/all/conanfile.py index a420c87bd7d01..e9697205799d1 100644 --- a/recipes/xtrans/all/conanfile.py +++ b/recipes/xtrans/all/conanfile.py @@ -12,7 +12,7 @@ class XtransConan(ConanFile): license = "MIT" homepage = "https://www.x.org/wiki/" description = "X Network Transport layer shared code" - settings = "os", "compiler", "build_type" # no arch here, because the xtrans system package is arch independant + settings = "os", "arch", "compiler", "build_type" topics = ("x11", "xorg") def validate(self): @@ -20,7 +20,9 @@ def validate(self): raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") def package_id(self): - self.info.header_only() + del self.info.settings.compiler + del self.info.settings.arch + del self.info.settings.build_type def system_requirements(self): apt = package_manager.Apt(self) diff --git a/recipes/xz_utils/all/conanfile.py b/recipes/xz_utils/all/conanfile.py index fe3bbefd8b9d0..388fe0cf2e851 100644 --- a/recipes/xz_utils/all/conanfile.py +++ b/recipes/xz_utils/all/conanfile.py @@ -23,7 +23,7 @@ class XZUtilsConan(ConanFile): 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], @@ -74,8 +74,7 @@ def build_requirements(self): self.tool_requires("msys2/cci.latest") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): if is_msvc(self): diff --git a/recipes/xz_utils/all/test_package/CMakeLists.txt b/recipes/xz_utils/all/test_package/CMakeLists.txt index 72a4496088dd7..cd4e960a3ff01 100644 --- a/recipes/xz_utils/all/test_package/CMakeLists.txt +++ b/recipes/xz_utils/all/test_package/CMakeLists.txt @@ -18,7 +18,7 @@ set(_custom_vars LIBLZMA_VERSION_STRING ) foreach(_custom_var ${_custom_vars}) - if(DEFINED _custom_var) + if(DEFINED ${_custom_var}) message(STATUS "${_custom_var}: ${${_custom_var}}") else() message(FATAL_ERROR "${_custom_var} not defined") diff --git a/recipes/zfp/all/conanfile.py b/recipes/zfp/all/conanfile.py index 603564c0343e6..451da2a028864 100644 --- a/recipes/zfp/all/conanfile.py +++ b/recipes/zfp/all/conanfile.py @@ -54,9 +54,9 @@ def layout(self): def validate(self): if self.options.with_cuda: - self.output.warn("Conan package for CUDA is not available, this package will be used from system.") + self.output.warning("Conan package for CUDA is not available, this package will be used from system.") if self.options.with_openmp: - self.output.warn("Conan package for OpenMP is not available, this package will be used from system.") + self.output.warning("Conan package for OpenMP is not available, this package will be used from system.") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True)