diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 9a246979eef6f..1bab3d41b7d93 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -1175,3 +1175,27 @@ authorized_users: - Ohjurot - nbukuli - ffabiomar +- 3d4m-volodymyr +- keyboardspecialist +- LvdStokker +- k-wasniowski +- ChrisThrasher +- ViktarHasiul231862 +- Becheler +- jalapenopuzzle +- HalfSweet +- CJCombrink +- nayyden +- wAuner +- m00z +- trns1997 +- GenuineAster +- Nachicle +- TrimbleAg +- ylatuya +- jabbas +- whaliendev +- AleksandraVolosevich-tomtom +- owenkellogg +- AndreaFinazzi +- klausholstjacobsen diff --git a/.c3i/conan_v2_ready_references.yml b/.c3i/conan_v2_ready_references.yml index 59799be1c4abb..c3af193898e16 100644 --- a/.c3i/conan_v2_ready_references.yml +++ b/.c3i/conan_v2_ready_references.yml @@ -35,19 +35,26 @@ required_for_references: - argtable2 - argtable3 - arsenalgear +- artery-font-format - asio - asmjit - astc-codec - async_simple +- asyncly - asyncplusplus - audiofile - autoconf +- autoconf-archive - automake - avir +- aws-c-auth - aws-c-cal - aws-c-common - aws-c-compression +- aws-c-event-stream +- aws-c-http - aws-c-io +- aws-c-mqtt - aws-c-sdkutils - aws-checksums - b2 @@ -79,6 +86,7 @@ required_for_references: - boost-ext-ut - boost-leaf - box2d +- breakpad - brigand - brotli - brynet @@ -110,10 +118,13 @@ required_for_references: - celero - cereal - ceres-solver +- certify - cfgfile - cfitsio +- cgal - cgif - cgns +- chaiscript - charls - chef-fun - chipmunk2d @@ -126,6 +137,7 @@ required_for_references: - clara - clhep - cli11 +- clickhouse-cpp - clipper - clove-unit - cmake @@ -140,6 +152,8 @@ required_for_references: - commata - concurrencpp - concurrentqueue +- console_bridge +- continuable - cpp-httplib - cpp-jwt - cpp-lazy @@ -148,10 +162,13 @@ required_for_references: - cpp-sort - cppbenchmark - cppcheck +- cppcmd - cppcodec +- cppcommon - cppdap - cppfront - cppitertools +- cpprestsdk - cpptoml - cppunit - cpputest @@ -161,20 +178,28 @@ required_for_references: - cqrlib - crc32c - create-dmg +- croncpp - crunch - cryptopp - cs_libguarded - csm - cspice - csvmonkey +- ctml - ctre +- cub - cubicinterpolation - cuda-api-wrappers +- cuda-kat +- cunit +- cute_headers +- cvplot - cwalk - cxxopts - cyclonedds - cyrus-sasl - dacap-clip +- darknet - dataframe - date - dav1d @@ -183,6 +208,7 @@ required_for_references: - daw_utf_range - dbcppp - dbus +- debug_assert - decimal_for_cpp - dirent - discount @@ -191,19 +217,23 @@ required_for_references: - doctest - double-conversion - doxygen +- dr_libs - draco - dragonbox - drflac - drmp3 +- drogon - drwav - duckdb - eabase - earcut +- eastl - easy_profiler - ecos - editline - edlib - effcee +- effolkronium-random - egl - eigen - elfio @@ -211,6 +241,7 @@ required_for_references: - emio - enet - entityx +- entt - enum-flags - erikzenker-hsm - erkir @@ -227,18 +258,23 @@ required_for_references: - fast-cdr - fast-dds - fast_float +- fastgltf +- fernandovelcic-hexdump +- fff - ffmpeg - fft - fftw - flac - flann - flatbuffers +- flatbush - flex - fmt - fmtlog - fontconfig - foonathan-lexy - foonathan-memory +- foxglove-schemas-protobuf - fp16 - freeglut - freetype @@ -269,6 +305,7 @@ required_for_references: - glib - glm - glog +- glpk - glslang - glu - gmp @@ -276,7 +313,10 @@ required_for_references: - gnutls - googleapis - gperf +- gperftools - graphene +- graphthewy +- greatest - grpc - grpc-proto - gsl @@ -285,19 +325,24 @@ required_for_references: - gstreamer - gtest - gtk +- gtk-doc-stub - gurkenlaeufer - h3 - h5pp +- happly - harfbuzz - hdf5 - hdrhistogram-c - hidapi - highfive +- highs - highway - hipony-enumerate +- hippomocks - hiredis - homog2d - http_parser +- icecream-cpp - icu - id3v2lib - iir1 @@ -307,27 +352,40 @@ required_for_references: - imgui - incbin - indicators +- indirect_value +- influxdb-cpp +- inih - inja - intel-neon2sse +- inversify-cpp - itlib - jasper - jbig +- jinja2cpp - joltphysics - jom +- jpcre2 - json-c - json-schema-validator - jsoncons - jsoncpp +- jsonnet - jwt-cpp +- jxrlib +- kainjow-mustache - kangaru +- keychain +- khrplatform - kmod - ktx - kuba-zip - lcms - ldns +- lefticus-tools - lemon - leptonica - lerc +- lest - lexbor - libalsa - libarchive @@ -341,11 +399,14 @@ required_for_references: - libcbor - libcds - libconfuse +- libcoro - libcuckoo - libcurl - libde265 - libdeflate - libdisasm +- libdivide +- libdrawille - libdwarf - libelf - libepoxy @@ -357,11 +418,14 @@ required_for_references: - libfreenect - libfuse - libgcrypt +- libgeotiff - libgettext - libgpg-error - libgphoto2 +- libharu - libiberty - libiconv +- libinterpolate - libjpeg - libjpeg-turbo - libkml @@ -381,6 +445,7 @@ required_for_references: - libnabo - libnfs - libnghttp2 +- libnl - libnop - libnova - libnuma @@ -392,11 +457,13 @@ required_for_references: - libpqxx - libpsl - libqrencode +- libraw - librdkafka - librealsense - libressl - librttopo - libsamplerate +- libsecret - libselinux - libserial - libsgp4 @@ -406,6 +473,7 @@ required_for_references: - libspatialindex - libspng - libsrtp +- libssh2 - libsvtav1 - libsystemd - libtar @@ -436,73 +504,103 @@ required_for_references: - libzip - libzippp - lief +- linux-headers-generic - linux-syscall-support - llhttp - lodepng +- logr +- loguru - lua - luau - lunasvg +- luple - lz4 - lzma_sdk - lzo - m4 - magic_enum +- mailio - make - mariadb-connector-c - matchit +- mathter +- mattiasgustavsson-libs +- maven - mawk - mbedtls +- mbits-args +- mbits-mstch +- mbits-semver +- mbits-utfconv - md4c - md4qt - mdnsresponder - mdspan - meson +- metis - mgs +- microservice-essentials - mikelankamp-fpm - mimalloc +- mingw-builds - miniaudio +- minimp3 - minisat +- miniz - minizip - minizip-ng - mongo-c-driver +- mongo-cxx-driver - mozilla-build - mozjpeg - mp-units - mpg123 +- mppp - ms-gsl +- msdf-atlas-gen - msgpack-c - msgpack-cxx - msys2 - naive-tsearch - namedtype - nameof +- nanodbc - nanoflann - nanomsg - nanorange +- nanort - nas - nasm - netcdf - nettle +- nextsilicon-cpp-subprocess - ninja - nlohmann_json - nng - nodejs - norm - nsync +- nudb +- numcpp - nuraft +- nv-codec-headers - octomap - odbc - ogdf - ogg +- ois - onetbb - onnx - onnxruntime - openal - openal-soft - openapi-generator +- openblas - opencl-clhpp-headers - opencl-headers - opencl-icd-loader +- opencolorio +- opencore-amr - openexr - opengl - opengv @@ -512,12 +610,15 @@ required_for_references: - openmesh - openssl - opensubdiv +- opentelemetry-cpp - opentelemetry-proto - optional-lite - opus - opusfile +- orcania - osqp - out_ptr +- p-ranav-glob - paho-mqtt-c - paho-mqtt-cpp - patchelf @@ -532,13 +633,19 @@ required_for_references: - picojson - pixman - pkgconf +- platform.hashing - plutovg - poco - popt +- portable-file-dialogs +- pprint +- pranav-csv2 +- pretty-name - proj - prometheus-cpp - proposal - protobuf +- protobuf-c - psimd - pthreadpool - pthreads4w @@ -549,13 +656,16 @@ required_for_references: - qhull - qpdf - quantlib +- quaternions - quill - quirc +- r8brain-free-src - rabbitmq-c - ragel - rang - range-v3 - rapidcheck +- rapidcsv - rapidfuzz - rapidjson - rapidxml @@ -566,37 +676,52 @@ required_for_references: - readline - readosm - rectpack2d +- redis-plus-plus - replxx - restbed - restinio - ring-span-lite +- rmm - roaring - robin-hood-hashing +- rtm - rttr - ruy - s2n - samurai - sbepp +- sbp - scnlib +- scons - screen_capture_lite - sdbus-cpp - sdl - sdl_image +- sdl_ttf - seadex-essentials - semimap - sentry-breakpad +- sentry-crashpad +- sentry-native - serd +- serdepp - sfml - shield - sigslot +- simde - simdjson - simdutf +- simple-websocket-server +- sjson-cpp - skyr-url - sml - snappy +- snowhouse - soci +- sonic-cpp - sophus - soplex +- source_location - soxr - span-lite - spdlog @@ -606,38 +731,52 @@ required_for_references: - sqlite3 - sqlite_orm - sqlitecpp +- sqlpp11 +- ssht - status-code - stb +- stlab - strawberryperl - string-view-lite +- stringtoolbox - strong_type +- svgwrite - symengine +- szip - tabulate - taocpp-json - taocpp-pegtl - taskflow - tcb-span - tcl +- tclap - tensorflow-lite - tensorpipe - termcap - termcolor +- thelink2012-any - threadpool - thrift - thrust - timsort - tinycthread - tinycthreadpool +- tinydir - tinyexif +- tinygltf - tinymidi - tinyxml - tinyxml2 - tl-expected - tl-function-ref +- tllist - tlx - toml11 - trantor +- troldal-zippy +- tsl-hopscotch-map - turtle +- type_safe - tz - uni-algo - unicorn @@ -645,8 +784,10 @@ required_for_references: - unordered_dense - unqlite - uriparser +- usockets - utf8proc - utfcpp +- util-linux-libuuid - uvw - vaapi - variant-lite @@ -655,8 +796,10 @@ required_for_references: - vincentlaucsb-csv-parser - vir-simd - visit_struct +- vo-amrwbenc - volk - vorbis +- vsg - vtu11 - vulkan-headers - vulkan-loader @@ -666,10 +809,13 @@ required_for_references: - wasmtime - wasmtime-cpp - watcher +- wavelet_buffer - wayland - wayland-protocols - websocketpp - wg21-linear_algebra +- wglext +- whisper-cpp - wil - winflexbison - wiringpi @@ -697,6 +843,7 @@ required_for_references: - xtl - xtrans - xxhash +- xxsds-sdsl-lite - xz_utils - yajl - yaml-cpp @@ -710,6 +857,9 @@ required_for_references: - zlib - zlib-ng - zmarok-semver +- zookeeper-client-c - zpp_bits - zstd +- zug - zulu-openjdk +- zxing-cpp diff --git a/.c3i/config_v1.yml b/.c3i/config_v1.yml index 669ef87bfc51d..13bfa2f1250ee 100644 --- a/.c3i/config_v1.yml +++ b/.c3i/config_v1.yml @@ -3,7 +3,7 @@ id: 'conan-io/conan-center-index' conan: - version: 1.59.0 + version: 1.60.1 artifactory: url: "https://c3i.jfrog.io/c3i" @@ -42,6 +42,13 @@ tasks: - name: "continuous-integration/jenkins/pr-merge" - name: "c3i/conan-v2/pr-merge" required_for_references: "conan_v2_ready_references.yml" + build_single_reference: + package_id_cache_type: "none" + timeout_minutes: 600 + large_timeout_minutes: 800 + large_timeout_references: + - boost + - qt cci: conan_v2_run_export: false write_comments: true @@ -69,7 +76,7 @@ configurations: compiler.version: [ "5", "7", "9", "10" ] build_type: [ "Release", "Debug" ] - id: linux-gcc - epochs: [20211221, 20220120] + epochs: [20211221, 20220120, 20230606] hrname: "Linux, GCC" content: - os: ["Linux"] @@ -80,7 +87,7 @@ configurations: compiler.version: ["5", "7", "9", "10", "11"] build_type: ["Release", "Debug"] - id: linux-clang - epochs: [20211221, 20220120] + epochs: [20211221, 20220120, 20230606] hrname: "Linux, Clang" content: - os: ["Linux"] @@ -102,7 +109,7 @@ configurations: compiler.libcxx: [ "libc++" ] build_type: [ "Release", "Debug" ] - id: macos-clang - epochs: [20220120] + epochs: [20220120, 20230606] hrname: "macOS, Clang" content: - os: [ "Macos" ] @@ -127,7 +134,7 @@ configurations: compiler.libcxx: [ "libc++" ] build_type: [ "Release", "Debug" ] - id: macos-m1-clang - epochs: [20220120] + epochs: [20220120, 20230606] hrname: "macOS, Clang (M1/arm64)" build_profile: os: "Macos" @@ -141,7 +148,7 @@ configurations: compiler.libcxx: [ "libc++" ] build_type: [ "Release", "Debug" ] - id: windows-visual_studio - epochs: [0, 20211221, 20220120] + epochs: [0, 20211221, 20220120, 20230606] hrname: "Windows, Visual Studio" content: - os: [ "Windows" ] @@ -185,9 +192,9 @@ pod_size: # - name/version notation takes preference over the name only one # - Both notations can be combined for the same reference name large: - - "pcl" - "duckdb" - "ceres-solver" xlarge: - "llvm" - "opengv" + - "pcl" diff --git a/.c3i/config_v2.yml b/.c3i/config_v2.yml index 8fd47e6c8b9e8..8af5c49162c6a 100644 --- a/.c3i/config_v2.yml +++ b/.c3i/config_v2.yml @@ -3,7 +3,7 @@ id: 'conan-io/conan-center-index' conan: - version: 2.0.4 + version: 2.0.6 artifactory: url: "https://c3i.jfrog.io/c3i" @@ -11,16 +11,11 @@ artifactory: pull-request_repo_prefix: "c3i_PR-v2" pull-request_permission: "c3i-pr" logs_repo: "misc-v2" - # cache_repo: "cache" github: reviewers: "reviewers.yml" authorized_users: "authorized_users.yml" -#slack: -# credential_success_url: SLACK_SUCCESS_WEBHOOK_URL -# ceredential_errors_url: SLACK_FAILURE_WEBHOOK_URL - # Things related to Jenkins jobs: tasks: automatic_merge: @@ -29,6 +24,13 @@ tasks: access_request: request_issue_url: https://github.com/conan-io/conan-center-index/issues/4 max_inactivity_days: 0 + build_single_reference: + package_id_cache_type: "none" + timeout_minutes: 600 + large_timeout_minutes: 800 + large_timeout_references: + - boost + - qt cci: conan_v2_run_export: false detailed_status_checks: false @@ -50,7 +52,7 @@ tasks: configurations: - id: linux-gcc - epochs: [0, 20211221, 20220120, 20220628] + epochs: [0, 20211221, 20220120, 20220628, 20230606] hrname: "Linux, GCC" build_profile: os: "Linux" @@ -63,7 +65,7 @@ configurations: compiler.version: ["11"] build_type: ["Release"] - id: macos-clang - epochs: [0, 20211221, 20220120, 20220628] + epochs: [0, 20211221, 20220120, 20220628, 20230606] hrname: "macOS, Clang" build_profile: os: "Macos" @@ -76,7 +78,7 @@ configurations: compiler.libcxx: [ "libc++" ] build_type: [ "Release"] - id: macos-m1-clang - epochs: [0, 20211221, 20220120, 20220628] + epochs: [0, 20211221, 20220120, 20220628, 20230606] hrname: "macOS M1, Clang" build_profile: os: "Macos" @@ -104,6 +106,21 @@ configurations: - "Release": compiler.runtime: ["dynamic"] compiler.runtime_type: [ "Release" ] + - id: windows-msvc + epochs: [20230606] + hrname: "Windows, MSVC" + build_profile: + os: "Windows" + content: + - os: [ "Windows" ] + arch: [ "x86_64" ] + compiler: + - "msvc": + compiler.version: [ "192", "193" ] + build_type: + - "Release": + compiler.runtime: ["dynamic"] + compiler.runtime_type: [ "Release" ] cppstd: apple-clang: @@ -112,6 +129,7 @@ cppstd: "11": ["17", "gnu17", "20", "gnu20"] msvc: "192": ["14", "17", "20"] + "193": ["14", "17", "20"] jenkins: url: "http://mb-jenkins-my-bloody-jenkins:8080" @@ -134,3 +152,12 @@ node_labels: default: "linux_gcc_${compiler.version}_ubuntu16.04" "clang": default: "linux_clang_${compiler.version}_ubuntu16.04" + + +pod_size: + # Map with references that need special memory resources to compile. + # - Can be only by name or by name/version. + # - name/version notation takes preference over the name only one + # - Both notations can be combined for the same reference name + xlarge: + - "pcl" diff --git a/.github/workflows/alert-community.yml b/.github/workflows/alert-community.yml index 7dcd6dc6c89c7..2df6d8d62a6c1 100644 --- a/.github/workflows/alert-community.yml +++ b/.github/workflows/alert-community.yml @@ -381,6 +381,11 @@ jobs: files: "recipes/snappy/*/*" reviewers: "@Hopobcn" + - uses: ./.github/actions/alert-community + with: + files: "recipes/snowhouse/*/*" + reviewers: "@MartinDelille" + - uses: ./.github/actions/alert-community with: files: "recipes/uncrustify/*/*" diff --git a/docs/adding_packages/conanfile_attributes.md b/docs/adding_packages/conanfile_attributes.md index 66bd21cf8d8b9..0044d960505ba 100644 --- a/docs/adding_packages/conanfile_attributes.md +++ b/docs/adding_packages/conanfile_attributes.md @@ -53,7 +53,8 @@ The mandatory license attribute of each recipe **should** be a [SPDX license](ht Where the SPDX guidelines do not apply, packages should do the following: -* When no license is provided or it's under the ["public domain"](https://fairuse.stanford.edu/overview/public-domain/welcome/) - these are not a license by itself. Thus, we have [equivalent licenses](https://en.wikipedia.org/wiki/Public-domain-equivalent_license) that should be used instead. If a project falls under these criteria it should be identified as the [Unlicense](https://spdx.org/licenses/Unlicense) license. +* Packages without a license or closed source cannot be accepted in ConanCenter, even if the code is publicly available in Github or other platforms. +* When some package is under the ["public domain"](https://fairuse.stanford.edu/overview/public-domain/welcome/) - these are not a license by itself. The author original intent and files should be respected, and the relevant files defining the "public domain" status should be the ones packaged in the "licenses" folder, for example the source repository README. The ``license`` field should be as close as the original one as possible, like ``license = "Public-domain"``. * When a custom (e.g. project specific) license is given, the value should be set to `LicenseRef-` as a prefix, followed by the name of the file which contains the custom license. See [this example](https://github.com/conan-io/conan-center-index/blob/e604534bbe0ef56bdb1f8513b83404eff02aebc8/recipes/fft/all/conanfile.py#L8). For more details, [read this conversation](https://github.com/conan-io/conan-center-index/pull/4928/files#r596216206). diff --git a/docs/v2_migration.md b/docs/v2_migration.md index 629cef881ac0e..9139fefbde135 100644 --- a/docs/v2_migration.md +++ b/docs/v2_migration.md @@ -124,18 +124,11 @@ don't listen to `cpp_info`'s ``.names``, ``.filenames`` or ``.build_modules`` at There is a new way of setting the `cpp_info` information with these generators using the ``set_property(property_name, value)`` method. -All the information in the recipes, already set with the current model, should be -translated to the new model. These two models **will live together in recipes** to make -recipes compatible **with both new and current generators** for some time. +Both of these two models **will live together in recipes** to make +recipes compatible for both 1.x and 2.0 users. Deprecated feilds are not to be removed at this time. -We will cover some cases of porting all the information set with the current model to the -new one. To read more about the properties available for each generator and how the -properties model work, please check the [Conan documentation](https://docs.conan.io/1/migrating_to_2.0/properties.html). - -> **Note**: Please, remember that the **new** ``set_property`` and the **current** attributes -> model are *completely independent since Conan 1.43*. Setting ``set_property`` in recipes will -> not affect current CMake 1.X generators (``cmake``, ``cmake_multi``, ``cmake_find_package`` and -> ``cmake_find_package_multi``) at all. +To understand the impact of these and the relation between different generates, refer to the +[migrating properties](https://docs.conan.io/1/migrating_to_2.0/properties.html) documentation. ### Translating .names information to cmake_target_name, cmake_module_target_name and cmake_file_name @@ -147,62 +140,8 @@ As for `filenames`, refer to [this section](https://docs.conan.io/1/migrating_to ### Translating .build_modules to cmake_build_modules -The declared `.build_modules` come from the original package that declares useful CMake functions, variables -etc. We need to use the property `cmake_build_modules` to declare a list of cmake files instead of using `cpp_info.build_modules`: - -```python -class PyBind11Conan(ConanFile): - name = "pybind11" - ... - - def package_info(self): - ... - for generator in ["cmake_find_package", "cmake_find_package_multi"]: - self.cpp_info.components["main"].build_modules[generator].append(os.path.join("lib", "cmake", "pybind11", "pybind11Common.cmake")) - ... - -``` - -To translate this information to the new model we declare the `cmake_build_modules` property in the `root cpp_info` object: - -```python -class PyBind11Conan(ConanFile): - name = "pybind11" - ... - - def package_info(self): - ... - self.cpp_info.set_property("cmake_build_modules", [os.path.join("lib", "cmake", "pybind11", "pybind11Common.cmake")]) - ... - -``` +The variation of `build_modules` is covered by the [Conan documentation](https://docs.conan.io/1/migrating_to_2.0/properties.html#translating-build-modules-to-cmake-build-modules). ### PkgConfigDeps -The current [pkg_config](https://docs.conan.io/1/reference/generators/pkg_config.html) -generator suports the new ``set_property`` model for most of the properties. Then, the current -model can be translated to the new one without having to leave the old attributes in the -recipes. Let's see an example: - -```python -class AprConan(ConanFile): - name = "apr" - ... - def package_info(self): - self.cpp_info.names["pkg_config"] = "apr-1" - ... -``` - -In this case, you can remove the ``.names`` attribute and just leave: - -```python -class AprConan(ConanFile): - name = "apr" - ... - def package_info(self): - self.cpp_info.set_property("pkg_config_name", "apr-1") - ... -``` - -For more information about properties supported by ``PkgConfigDeps`` generator, please check the [Conan -documentation](https://docs.conan.io/1/reference/conanfile/tools/gnu/pkgconfigdeps.html#properties). +For migrating, `names` used with `pkg_config`, see [Conan documentation](https://docs.conan.io/1/migrating_to_2.0/properties.html#migration-from-names-to-pkg-config-name) diff --git a/recipes/aaf/all/conanfile.py b/recipes/aaf/all/conanfile.py index 358a4f96210ec..080c644424a04 100644 --- a/recipes/aaf/all/conanfile.py +++ b/recipes/aaf/all/conanfile.py @@ -18,6 +18,7 @@ class AafConan(ConanFile): ) topics = ("multimedia", "crossplatform") license = "AAFSDKPSL-2.0" + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { @@ -84,9 +85,12 @@ def package(self): def package_info(self): if self.settings.os == "Windows": suffix = "D" if self.settings.build_type == "Debug" else "" - self.cpp_info.libs = [f"AAF{suffix}", f"AAFIID{suffix}", "AAFCOAPI"] + self.cpp_info.libs = [f"AAF{suffix}", f"AAFIID{suffix}"] + # The static library loads a DLL at runtime, on Windows it needs to be able + # to find it in PATH, see https://aaf.sourceforge.net/AAFProjectFAQ.html + self.runenv_info.prepend_path("PATH", os.path.join(self.package_folder, "bin")) else: - self.cpp_info.libs = ["aaflib", "aafiid", "com-api"] + self.cpp_info.libs = ["aaflib", "aafiid"] if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs = ["dl"] elif is_apple_os(self): diff --git a/recipes/access_private/all/conanfile.py b/recipes/access_private/all/conanfile.py index da35dc6ea7e6e..f7bfa16e97f6c 100644 --- a/recipes/access_private/all/conanfile.py +++ b/recipes/access_private/all/conanfile.py @@ -11,12 +11,17 @@ class AccessPrivateConan(ConanFile): name = "access_private" description = "Access private members and statics of a C++ class" license = "MIT" - topics = ("access", "private", "header-only") - homepage = "https://github.com/martong/access_private" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martong/access_private" + topics = ("access", "private", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -24,12 +29,8 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - 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 diff --git a/recipes/access_private/all/test_v1_package/CMakeLists.txt b/recipes/access_private/all/test_v1_package/CMakeLists.txt index 01b3a8050e773..91630d79f4abb 100644 --- a/recipes/access_private/all/test_v1_package/CMakeLists.txt +++ b/recipes/access_private/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.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(access_private REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE access_private::access_private) -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/ade/all/conanfile.py b/recipes/ade/all/conanfile.py index 56f8248013585..2e4dc8aa99a3a 100644 --- a/recipes/ade/all/conanfile.py +++ b/recipes/ade/all/conanfile.py @@ -16,6 +16,7 @@ class AdeConan(ConanFile): description = "Graph construction, manipulation, and processing framework" topics = ("graphs", "opencv") + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], diff --git a/recipes/ade/all/test_v1_package/CMakeLists.txt b/recipes/ade/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/ade/all/test_v1_package/CMakeLists.txt +++ b/recipes/ade/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/alac/all/conanfile.py b/recipes/alac/all/conanfile.py index 03e8814c8b1fd..852e6b7782c8e 100644 --- a/recipes/alac/all/conanfile.py +++ b/recipes/alac/all/conanfile.py @@ -1,10 +1,9 @@ from conan import ConanFile, conan_version from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import copy, get -from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class AlacConan(ConanFile): @@ -12,10 +11,11 @@ class AlacConan(ConanFile): description = "The Apple Lossless Audio Codec (ALAC) is a lossless audio " \ "codec developed by Apple and deployed on all of its platforms and devices." license = "Apache-2.0" - topics = ("alac", "audio-codec") - homepage = "https://macosforge.github.io/alac" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://macosforge.github.io/alac" + topics = ("audio-codec") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -28,7 +28,8 @@ class AlacConan(ConanFile): "utility": True, } - exports_sources = "CMakeLists.txt" + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -36,17 +37,13 @@ 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 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,5 +64,8 @@ def package(self): def package_info(self): self.cpp_info.libs = ["alac"] - if Version(conan_version).major < 2 and self.options.utility: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + if conan_version.major < 2 and self.options.utility: self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/alac/all/test_v1_package/CMakeLists.txt b/recipes/alac/all/test_v1_package/CMakeLists.txt index 6e042a1c74181..91630d79f4abb 100644 --- a/recipes/alac/all/test_v1_package/CMakeLists.txt +++ b/recipes/alac/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(alac REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE alac::alac) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/alpaca/all/conanfile.py b/recipes/alpaca/all/conanfile.py index a7227d4427d29..02d46c1a923f7 100644 --- a/recipes/alpaca/all/conanfile.py +++ b/recipes/alpaca/all/conanfile.py @@ -7,17 +7,21 @@ from conan.tools.scm import Version import os - required_conan_version = ">=1.52.0" class AlpacaConan(ConanFile): name = "alpaca" - description = "Serialization library written in C++17 - Pack C++ structs into a compact byte-array without any macros or boilerplate code" + description = ( + "Serialization library written in C++17 - " + "Pack C++ structs into a compact byte-array without any macros or boilerplate code" + ) license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/p-ranav/alpaca" topics = ("reflection", "checksum", "serialization", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -51,7 +55,7 @@ def validate(self): ) 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) diff --git a/recipes/alpaca/all/test_package/test_package.cpp b/recipes/alpaca/all/test_package/test_package.cpp index 0134e1d6e0d2d..c1126e0786194 100644 --- a/recipes/alpaca/all/test_package/test_package.cpp +++ b/recipes/alpaca/all/test_package/test_package.cpp @@ -1,11 +1,11 @@ #include struct Config { - std::string device; - std::pair resolution; - std::array K_matrix; - std::vector distortion_coeffients; - std::map> parameters; + std::string device; + std::pair resolution; + std::array K_matrix; + std::vector distortion_coeffients; + std::map> parameters; }; int main() { @@ -32,4 +32,3 @@ int main() { } return 0; } - diff --git a/recipes/alpaca/all/test_v1_package/CMakeLists.txt b/recipes/alpaca/all/test_v1_package/CMakeLists.txt index 0aeb3e1d92584..91630d79f4abb 100644 --- a/recipes/alpaca/all/test_v1_package/CMakeLists.txt +++ b/recipes/alpaca/all/test_v1_package/CMakeLists.txt @@ -1,6 +1,5 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES C) # if the project is pure C -project(test_package LANGUAGES CXX) # if the project uses c++ +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) diff --git a/recipes/android-ndk/all/conanfile.py b/recipes/android-ndk/all/conanfile.py index af3c867fd7625..ecf241f5b5a1a 100644 --- a/recipes/android-ndk/all/conanfile.py +++ b/recipes/android-ndk/all/conanfile.py @@ -2,7 +2,6 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.files import get, download, unzip, load, copy, rm from conan.tools.layout import basic_layout -from conan.tools.scm import Version import os import re import shutil @@ -12,16 +11,18 @@ class AndroidNDKConan(ConanFile): name = "android-ndk" - description = "The Android NDK is a toolset that lets you implement parts of your app in native code, using languages such as C and C++" + description = ( + "The Android NDK is a toolset that lets you implement parts of your app " + "in native code, using languages such as C and C++" + ) + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://developer.android.com/ndk/" topics = ("android", "ndk", "toolchain", "compiler") - license = "Apache-2.0" - - settings = "os", "arch", "build_type", "compiler" + package_type = "application" + settings = "os", "arch", "compiler", "build_type" short_paths = True - exports_sources = "cmake-wrapper.cmd", "cmake-wrapper" def _is_universal2(self, info=False): settings = self.info.settings if info else self.settings @@ -41,6 +42,10 @@ def _settings_os_supported(self): def _settings_arch_supported(self): return self.conan_data["sources"][self.version].get(str(self.settings.os), {}).get(str(self._arch)) is not None + def export_sources(self): + copy(self, "cmake-wrapper.cmd", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "cmake-wrapper", src=self.recipe_folder, dst=self.export_sources_folder) + def layout(self): basic_layout(self, src_folder="src") @@ -226,7 +231,7 @@ def _cmake_system_processor(self): cmake_system_processor = "armv5te" return cmake_system_processor - def _define_tool_var(self, name, value, bare = False): + def _define_tool_var(self, name, value, bare=False): ndk_bin = os.path.join(self._ndk_root, "bin") path = os.path.join(ndk_bin, self._tool_name(value, bare)) if not os.path.isfile(path): @@ -325,7 +330,7 @@ def package_info(self): self.buildenv_info.define("ANDROID_STL", libcxx_str if libcxx_str.startswith("c++_") else "c++_shared") # TODO: conan v1 stuff to remove later - if Version(conan_version).major < 2: + if conan_version.major < 2: self.env_info.PATH.extend([os.path.join(self.package_folder, "bin"), os.path.join(self._ndk_root, "bin")]) self.env_info.ANDROID_NDK_ROOT = os.path.join(self.package_folder, "bin") self.env_info.ANDROID_NDK_HOME = os.path.join(self.package_folder, "bin") diff --git a/recipes/android-ndk/all/test_v1_package/CMakeLists.txt b/recipes/android-ndk/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/android-ndk/all/test_v1_package/CMakeLists.txt +++ b/recipes/android-ndk/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/android-ndk/all/test_v1_package/conanfile.py b/recipes/android-ndk/all/test_v1_package/conanfile.py index e7a2d6060ddc7..d61cc4e4da75e 100644 --- a/recipes/android-ndk/all/test_v1_package/conanfile.py +++ b/recipes/android-ndk/all/test_v1_package/conanfile.py @@ -7,7 +7,7 @@ class TestPackgeConan(ConanFile): settings = "os", "arch", "compiler", "build_type" test_type = "explicit" - generators = "cmake" + generators = "cmake", "cmake_find_package_multi" def build_requirements(self): self.build_requires(self.tested_reference_str) diff --git a/recipes/angelscript/all/conanfile.py b/recipes/angelscript/all/conanfile.py index 174e1d9732354..88cdd729c8bf1 100644 --- a/recipes/angelscript/all/conanfile.py +++ b/recipes/angelscript/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class AngelScriptConan(ConanFile): @@ -19,6 +19,7 @@ class AngelScriptConan(ConanFile): ) topics = ("angelcode", "embedded", "scripting", "language", "compiler", "interpreter") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [False, True], @@ -42,10 +43,7 @@ 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") diff --git a/recipes/angelscript/all/test_v1_package/CMakeLists.txt b/recipes/angelscript/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/angelscript/all/test_v1_package/CMakeLists.txt +++ b/recipes/angelscript/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/antlr4-cppruntime/all/conanfile.py b/recipes/antlr4-cppruntime/all/conanfile.py index 99a6339b6c746..3aaea8c41d7d7 100644 --- a/recipes/antlr4-cppruntime/all/conanfile.py +++ b/recipes/antlr4-cppruntime/all/conanfile.py @@ -14,12 +14,14 @@ class Antlr4CppRuntimeConan(ConanFile): name = "antlr4-cppruntime" - homepage = "https://github.com/antlr/antlr4/tree/master/runtime/Cpp" description = "C++ runtime support for ANTLR (ANother Tool for Language Recognition)" - topics = ("antlr", "parser", "runtime") - url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" - settings = "os", "compiler", "build_type", "arch" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/antlr/antlr4/tree/master/runtime/Cpp" + topics = ("antlr", "parser", "runtime") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], diff --git a/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt b/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt +++ b/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/any-lite/all/conanfile.py b/recipes/any-lite/all/conanfile.py index 19f65824ca091..ed35a82c05d84 100644 --- a/recipes/any-lite/all/conanfile.py +++ b/recipes/any-lite/all/conanfile.py @@ -8,24 +8,27 @@ class AnyLiteConan(ConanFile): name = "any-lite" + description = ( + "any lite - A C++17-like any, a type-safe container for single values of " + "any type for C++98, C++11 and later in a single-file header-only library" + ) + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/martinmoene/any-lite" - description = ("any lite - A C++17-like any, a type-safe container for single values of \ - any type for C++98, C++11 and later in a single-file header-only library") - topics = ("cpp11", "cpp14", "cpp17", "any", "any-implementations") - license = "BSL-1.0" + topics = ("cpp11", "cpp14", "cpp17", "any", "any-implementations", "header-only") + + 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 diff --git a/recipes/any-lite/all/test_v1_package/CMakeLists.txt b/recipes/any-lite/all/test_v1_package/CMakeLists.txt index 3d223cfc63eee..91630d79f4abb 100644 --- a/recipes/any-lite/all/test_v1_package/CMakeLists.txt +++ b/recipes/any-lite/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(any-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::any-lite) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/anyrpc/all/conanfile.py b/recipes/anyrpc/all/conanfile.py index e5887586c576e..068094058cb31 100644 --- a/recipes/anyrpc/all/conanfile.py +++ b/recipes/anyrpc/all/conanfile.py @@ -15,6 +15,8 @@ class AnyRPCConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/sgieseking/anyrpc" topics = ("rpc",) + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -66,7 +68,10 @@ def validate(self): check_min_cppstd(self, self._min_cppstd) if self.options.with_log4cplus and self.options.with_wchar: - raise ConanInvalidConfiguration(f"{self.ref} can not be built with both log4cplus and wchar, see https://github.com/sgieseking/anyrpc/issues/25") + raise ConanInvalidConfiguration( + f"{self.ref} can not be built with both log4cplus and wchar, see" + " https://github.com/sgieseking/anyrpc/issues/25" + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -105,6 +110,6 @@ def package(self): def package_info(self): self.cpp_info.libs = ["anyrpc"] if not self.options.shared and self.settings.os == "Windows": - self.cpp_info.system_libs.append("ws2_32") + self.cpp_info.system_libs.append("ws2_32") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/anyrpc/all/test_v1_package/CMakeLists.txt b/recipes/anyrpc/all/test_v1_package/CMakeLists.txt index 8272097b5b3da..91630d79f4abb 100644 --- a/recipes/anyrpc/all/test_v1_package/CMakeLists.txt +++ b/recipes/anyrpc/all/test_v1_package/CMakeLists.txt @@ -1,6 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) + include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/arcus/all/conanfile.py b/recipes/arcus/all/conanfile.py index d2e0d9c10f99c..8f6e301a39313 100644 --- a/recipes/arcus/all/conanfile.py +++ b/recipes/arcus/all/conanfile.py @@ -15,15 +15,15 @@ class ArcusConan(ConanFile): "creating a socket in a thread and using this socket to send " \ "and receive messages based on the Protocol Buffers library." license = "LGPL-3.0-or-later" - topics = ("protobuf", "socket", "cura") - homepage = "https://github.com/Ultimaker/libArcus" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Ultimaker/libArcus" + topics = ("protobuf", "socket", "cura") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - } default_options = { "shared": False, diff --git a/recipes/arcus/all/test_v1_package/CMakeLists.txt b/recipes/arcus/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/arcus/all/test_v1_package/CMakeLists.txt +++ b/recipes/arcus/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/argh/all/conanfile.py b/recipes/argh/all/conanfile.py index f6f6a44814ca4..855db0a2a7110 100644 --- a/recipes/argh/all/conanfile.py +++ b/recipes/argh/all/conanfile.py @@ -10,14 +10,19 @@ class ArgparseConan(ConanFile): name = "argh" + description = "Frustration-free command line processing" + license = "BSD-3" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/adishavit/argh" - topics = ("argh", "argument", "parsing") - license = "BSD-3" - description = "Frustration-free command line processing" + topics = ("argument", "parsing", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -25,12 +30,8 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - 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 diff --git a/recipes/argh/all/test_v1_package/CMakeLists.txt b/recipes/argh/all/test_v1_package/CMakeLists.txt index 65e0578c4c0f6..91630d79f4abb 100644 --- a/recipes/argh/all/test_v1_package/CMakeLists.txt +++ b/recipes/argh/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.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(argh REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE argh) -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/argparse/all/conanfile.py b/recipes/argparse/all/conanfile.py index e7e9de237fe52..11300088df46e 100644 --- a/recipes/argparse/all/conanfile.py +++ b/recipes/argparse/all/conanfile.py @@ -11,12 +11,15 @@ class ArgparseConan(ConanFile): name = "argparse" + description = "Argument Parser for Modern C++" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/p-ranav/argparse" - topics = ("argparse", "argument", "parsing") - license = "MIT" - description = "Argument Parser for Modern C++" + topics = ("argument", "parsing", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _min_cppstd(self): @@ -39,6 +42,9 @@ 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) + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -54,12 +60,8 @@ def validate(self): if Version(self.version) > "2.1" and self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libstdc++": raise ConanInvalidConfiguration("This recipe does not permit >2.1 with clang and stdlibc++. There may be an infrastructure issue in CCI.") - 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): apply_conandata_patches(self) diff --git a/recipes/argparse/all/test_package/CMakeLists.txt b/recipes/argparse/all/test_package/CMakeLists.txt index e8794b9790e15..cc806a824f8c4 100644 --- a/recipes/argparse/all/test_package/CMakeLists.txt +++ b/recipes/argparse/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(argparse REQUIRED CONFIG) diff --git a/recipes/argparse/all/test_v1_package/CMakeLists.txt b/recipes/argparse/all/test_v1_package/CMakeLists.txt index 59cfa3b376305..91630d79f4abb 100644 --- a/recipes/argparse/all/test_v1_package/CMakeLists.txt +++ b/recipes/argparse/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(argparse REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE argparse::argparse) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/argtable2/all/conanfile.py b/recipes/argtable2/all/conanfile.py index 4e3ccd375b1a6..8c8e33cf028bd 100644 --- a/recipes/argtable2/all/conanfile.py +++ b/recipes/argtable2/all/conanfile.py @@ -13,10 +13,12 @@ class Argtable2Conan(ConanFile): name = "argtable2" description = "Argtable is an ANSI C library for parsing GNU style command line options with a minimum of fuss." - topics = ("argument", "parsing", "getopt") license = "LGPL-2.0+" - homepage = "http://argtable.sourceforge.net/" url = "https://github.com/conan-io/conan-center-index" + homepage = "http://argtable.sourceforge.net/" + topics = ("argument", "parsing", "getopt") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/recipes/argtable2/all/test_v1_package/CMakeLists.txt b/recipes/argtable2/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/argtable2/all/test_v1_package/CMakeLists.txt +++ b/recipes/argtable2/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/argtable3/all/conanfile.py b/recipes/argtable3/all/conanfile.py index 2b2ed84a2b4f5..86aef097f8805 100644 --- a/recipes/argtable3/all/conanfile.py +++ b/recipes/argtable3/all/conanfile.py @@ -7,13 +7,16 @@ required_conan_version = ">=1.53.0" + class Argtable3Conan(ConanFile): name = "argtable3" description = "A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options." license = "BSD-3-clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.argtable.org/" - topics = ("conan", "argtable3", "command", "line", "argument", "parse", "parsing", "getopt") + topics = ("command", "line", "argument", "parse", "parsing", "getopt") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/recipes/argtable3/all/test_package/CMakeLists.txt b/recipes/argtable3/all/test_package/CMakeLists.txt index 79004b3e726d4..7d615d10f2ea9 100644 --- a/recipes/argtable3/all/test_package/CMakeLists.txt +++ b/recipes/argtable3/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) find_package(Argtable3 REQUIRED CONFIG) diff --git a/recipes/argtable3/all/test_package/conanfile.py b/recipes/argtable3/all/test_package/conanfile.py index 0ab6dbb34f3d6..83621776fedfc 100644 --- a/recipes/argtable3/all/test_package/conanfile.py +++ b/recipes/argtable3/all/test_package/conanfile.py @@ -21,5 +21,5 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(f"{bin_path} --help", run_environment=True) + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(f"{bin_path} --help", env="conanrun") diff --git a/recipes/argtable3/all/test_v1_package/CMakeLists.txt b/recipes/argtable3/all/test_v1_package/CMakeLists.txt index be00a8c7f57c7..91630d79f4abb 100644 --- a/recipes/argtable3/all/test_v1_package/CMakeLists.txt +++ b/recipes/argtable3/all/test_v1_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/armadillo/all/conandata.yml b/recipes/armadillo/all/conandata.yml index 91baae076a36f..0d2a3540e26f2 100644 --- a/recipes/armadillo/all/conandata.yml +++ b/recipes/armadillo/all/conandata.yml @@ -8,6 +8,9 @@ sources: "11.4.3": url: "https://sourceforge.net/projects/arma/files/armadillo-11.4.3.tar.xz" sha256: "87603263664988af41da2ca4f36205e36ea47a9281fa6cfd463115f3797a1da2" + "12.2.0": + url: "https://sourceforge.net/projects/arma/files/armadillo-12.2.0.tar.xz" + sha256: "b0dce042297e865add3351dad77f78c2c7638d6632f58357b015e50edcbd2186" patches: "10.7.0": @@ -22,3 +25,7 @@ patches: - patch_file: "patches/0002-Guard-dependency-discovery-11.4.x.patch" patch_description: "Add find_package statements to inject conan dependencies" patch_type: "conan" + "12.2.0": + - patch_file: "patches/0003-Guard-dependency-discovery-12.2.x.patch" + patch_description: "Add find_package statements to inject conan dependencies" + patch_type: "conan" diff --git a/recipes/armadillo/all/conanfile.py b/recipes/armadillo/all/conanfile.py index 4c814b3794dad..5638fc2428e26 100644 --- a/recipes/armadillo/all/conanfile.py +++ b/recipes/armadillo/all/conanfile.py @@ -2,6 +2,8 @@ from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import copy, get, rmdir, apply_conandata_patches, export_conandata_patches from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.build import cross_building from conan.errors import ConanInvalidConfiguration import os @@ -26,6 +28,7 @@ class ArmadilloConan(ConanFile): "hdf5", ) settings = "os", "compiler", "build_type", "arch" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -98,6 +101,16 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if self.options.use_blas == "openblas": + # Note that if you're relying on this to build LAPACK, you _must_ have + # a fortran compiler installed. If you don't, OpenBLAS will build successfully but + # without LAPACK support, which isn't obvious. + # This can be achieved by setting the FC environment variable or the conf tools.build:compiler_executables={"fortran": "/path/to/fortran"} + # in your conan profile. + self.options["openblas"].build_lapack = ( + self.options.use_lapack == "openblas" + ) + def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, 11) @@ -110,6 +123,11 @@ def validate(self): "framework_accelerate can only be used on Macos" ) + if self.options.use_hdf5 and Version(self.version) > "12" and cross_building(self): + raise ConanInvalidConfiguration( + "Armadillo does not support cross building with hdf5. Set use_hdf5=False and try again." + ) + for value, options in self._co_dependencies.items(): options_without_value = [ x for x in options if getattr(self.options, x) != value @@ -163,19 +181,15 @@ def requirements(self): # TODO: "arpack/1.0" # Pending https://github.com/conan-io/conan-center-index/issues/6755 # TODO: "flexiblas/3.0.4" # Pending https://github.com/conan-io/conan-center-index/issues/6827 - if self.options.use_hdf5: + # The armadillo library no longer takes any responsibility for linking hdf5 as of v12.x. This means + # it will have to be linked manually by consumers if desired. + # See https://gitlab.com/conradsnicta/armadillo-code/-/issues/227 for more information. + if self.options.use_hdf5 and Version(self.version) < "12": # Use the conan dependency if the system lib isn't being used self.requires("hdf5/1.14.0") if self.options.use_blas == "openblas": self.requires("openblas/0.3.20") - # Note that if you're relying on this to build LAPACK, you _must_ have - # a fortran compiler installed. If you don't, OpenBLAS will build successfully but - # without LAPACK support, which isn't obvious. - # This can be achieved by setting the FC environment variable in your conan profile - self.options["openblas"].build_lapack = ( - self.options.use_lapack == "openblas" - ) if ( self.options.use_blas == "intel_mkl" and self.options.use_lapack == "intel_mkl" diff --git a/recipes/armadillo/all/patches/0001-Guard-dependency-discovery-10.7.x.patch b/recipes/armadillo/all/patches/0001-Guard-dependency-discovery-10.7.x.patch index 89386d2e8686f..5736e2db0a819 100644 --- a/recipes/armadillo/all/patches/0001-Guard-dependency-discovery-10.7.x.patch +++ b/recipes/armadillo/all/patches/0001-Guard-dependency-discovery-10.7.x.patch @@ -1,15 +1,3 @@ -From 48a5162899ebeb0ba3ca3141b587a53d2eda4223 Mon Sep 17 00:00:00 2001 -From: Samuel Dowling -Date: Thu, 30 Sep 2021 23:51:35 +0930 -Subject: [PATCH] Guard dependency discovery - -* Add guards to prevent usage of custom cmake find package scripts. -* Remove ability to inject hdf5 include directory into compiled binary ---- - CMakeLists.txt | 72 ++++++++++++++++++++----- - include/armadillo_bits/config.hpp.cmake | 2 +- - 2 files changed, 60 insertions(+), 14 deletions(-) - diff --git a/CMakeLists.txt b/CMakeLists.txt index 7857f8c..5f87f7e 100644 --- a/CMakeLists.txt diff --git a/recipes/armadillo/all/patches/0002-Guard-dependency-discovery-11.4.x.patch b/recipes/armadillo/all/patches/0002-Guard-dependency-discovery-11.4.x.patch index 33fb53382e9ee..26001d6f2f096 100644 --- a/recipes/armadillo/all/patches/0002-Guard-dependency-discovery-11.4.x.patch +++ b/recipes/armadillo/all/patches/0002-Guard-dependency-discovery-11.4.x.patch @@ -1,15 +1,3 @@ -From aa49b619333a25d892d119836ca97dd1d833475d Mon Sep 17 00:00:00 2001 -From: Samuel Dowling -Date: Thu, 5 Jan 2023 00:02:06 +1030 -Subject: [PATCH 1/1] Guard dependency discovery - -* Add guards to prevent usage of custom cmake find package scripts. -* Remove ability to inject hdf5 include directory into compiled binary ---- - CMakeLists.txt | 78 ++++++++++++++++++++----- - include/armadillo_bits/config.hpp.cmake | 2 +- - 2 files changed, 64 insertions(+), 16 deletions(-) - diff --git a/CMakeLists.txt b/CMakeLists.txt index da1ff3a..7bdd808 100644 --- a/CMakeLists.txt diff --git a/recipes/armadillo/all/patches/0003-Guard-dependency-discovery-12.2.x.patch b/recipes/armadillo/all/patches/0003-Guard-dependency-discovery-12.2.x.patch new file mode 100644 index 0000000000000..7c8079d507a32 --- /dev/null +++ b/recipes/armadillo/all/patches/0003-Guard-dependency-discovery-12.2.x.patch @@ -0,0 +1,121 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7d21cf2..2669b17 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -270,7 +270,11 @@ if(APPLE) + set(ARMA_USE_ACCELERATE true) + + if(ALLOW_OPENBLAS_MACOS) +- include(ARMA_FindOpenBLAS) ++ if(USE_OPENBLAS) ++ find_package(OpenBLAS) ++ else() ++ set(OpenBLAS_FOUND NO) ++ endif() + message(STATUS "OpenBLAS_FOUND = ${OpenBLAS_FOUND}") + message(STATUS "") + message(STATUS "*** If use of OpenBLAS is causing problems,") +@@ -285,8 +289,16 @@ if(APPLE) + endif() + + if(ALLOW_BLAS_LAPACK_MACOS) +- include(ARMA_FindBLAS) +- include(ARMA_FindLAPACK) ++ if(USE_SYSTEM_BLAS) ++ include(ARMA_FindBLAS) ++ else() ++ set(BLAS_FOUND NO) ++ endif() ++ if(USE_SYSTEM_LAPACK) ++ include(ARMA_FindLAPACK) ++ else() ++ set(LAPACK_FOUND NO) ++ endif() + message(STATUS " BLAS_FOUND = ${BLAS_FOUND}" ) + message(STATUS "LAPACK_FOUND = ${LAPACK_FOUND}") + message(STATUS "") +@@ -325,19 +337,45 @@ if(APPLE) + + else() + +- if(ALLOW_FLEXIBLAS_LINUX AND (${CMAKE_SYSTEM_NAME} MATCHES "Linux")) +- include(ARMA_FindFlexiBLAS) ++ if(USE_MKL) ++ find_package(MKL) + else() +- set(FlexiBLAS_FOUND false) ++ set(MKL_FOUND NO) ++ endif() ++ ++ if(USE_OPENBLAS) ++ find_package(OpenBLAS) ++ else() ++ set(OpenBLAS_FOUND NO) ++ endif() ++ ++ if(USE_SYSTEM_ATLAS) ++ include(ARMA_FindATLAS) ++ else() ++ set(ATLAS_FOUND NO) ++ endif() ++ ++ if(USE_SYSTEM_BLAS) ++ include(ARMA_FindBLAS) ++ else() ++ set(BLAS_FOUND NO) ++ endif() ++ ++ if(USE_SYSTEM_LAPACK) ++ include(ARMA_FindLAPACK) ++ else() ++ set(LAPACK_FOUND NO) + endif() + +- include(ARMA_FindMKL) +- include(ARMA_FindOpenBLAS) +- include(ARMA_FindATLAS) # TODO: remove support for ATLAS in next major version +- include(ARMA_FindBLAS) +- include(ARMA_FindLAPACK) +- +- message(STATUS "FlexiBLAS_FOUND = ${FlexiBLAS_FOUND}" ) ++ if(ALLOW_FLEXIBLAS_LINUX AND (${CMAKE_SYSTEM_NAME} MATCHES "Linux")) ++ if(USE_SYSTEM_FLEXIBLAS) ++ include(ARMA_FindFlexiBLAS) ++ else() ++ set(FlexiBLAS_FOUND NO) ++ endif() ++ endif() ++ ++ message(STATUS "FlexiBLAS_FOUND = ${FlexiBLAS_FOUND}" ) + message(STATUS " MKL_FOUND = ${MKL_FOUND}" ) + message(STATUS " OpenBLAS_FOUND = ${OpenBLAS_FOUND}" ) + message(STATUS " ATLAS_FOUND = ${ATLAS_FOUND}" ) +@@ -449,7 +487,11 @@ else() + endif() + + +-include(ARMA_FindARPACK) ++if(USE_SYSTEM_ARPACK) ++ include(ARMA_FindARPACK) ++else() ++ set(ARPACK_FOUND NO) ++endif() + message(STATUS "ARPACK_FOUND = ${ARPACK_FOUND}") + + if(ARPACK_FOUND) +@@ -457,7 +499,11 @@ if(ARPACK_FOUND) + set(ARMA_LIBS ${ARMA_LIBS} ${ARPACK_LIBRARY}) + endif() + +-include(ARMA_FindSuperLU5) ++if(USE_SYSTEM_SUPERLU) ++ include(ARMA_FindSuperLU5) ++else() ++ set(SuperLU_FOUND NO) ++endif() + message(STATUS "SuperLU_FOUND = ${SuperLU_FOUND}") + + if(SuperLU_FOUND) +-- +2.41.0 + diff --git a/recipes/armadillo/all/test_package/CMakeLists.txt b/recipes/armadillo/all/test_package/CMakeLists.txt index 2ede063cb4884..da38c2d4cf348 100644 --- a/recipes/armadillo/all/test_package/CMakeLists.txt +++ b/recipes/armadillo/all/test_package/CMakeLists.txt @@ -2,7 +2,11 @@ cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) find_package(armadillo CONFIG REQUIRED) +if (LINK_HDF5) + find_package(HDF5) + set(HDF5_TARGETS HDF5::HDF5) +endif() add_executable(example src/example.cpp) -target_link_libraries(example armadillo::armadillo) +target_link_libraries(example armadillo::armadillo ${HDF5_TARGETS}) set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/armadillo/all/test_package/conanfile.py b/recipes/armadillo/all/test_package/conanfile.py index 4a901f505fcdd..2c5aab901d0bf 100644 --- a/recipes/armadillo/all/test_package/conanfile.py +++ b/recipes/armadillo/all/test_package/conanfile.py @@ -1,20 +1,32 @@ import os from conan import ConanFile -from conan.tools.cmake import CMake, cmake_layout +from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain from conan.tools.build import cross_building +from conan.tools.scm import Version 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) - generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" apply_env = False test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) + tested_version = self.tested_reference_str.split('/')[1].split('@')[0] + # using armadillo > 12.x requires the consumer to explicitly depend on hdf5 + if Version(tested_version) > "12": + self.requires("hdf5/1.14.0") + + def generate(self): + tc = CMakeToolchain(self) + # using armadillo > 12.x requires explicit consumer linkage against hdf5 + explicit_link_condition = Version(self.dependencies["armadillo"].ref.version) > "12" + tc.variables["LINK_HDF5"] = explicit_link_condition + tc.generate() def build(self): cmake = CMake(self) diff --git a/recipes/armadillo/config.yml b/recipes/armadillo/config.yml index 8af743e5561bd..3d54bf4d2f283 100644 --- a/recipes/armadillo/config.yml +++ b/recipes/armadillo/config.yml @@ -5,3 +5,5 @@ versions: folder: all "11.4.3": folder: all + "12.2.0": + folder: all diff --git a/recipes/arrow/all/conanfile.py b/recipes/arrow/all/conanfile.py index ee4cdd21e5b52..50780c591a6e7 100644 --- a/recipes/arrow/all/conanfile.py +++ b/recipes/arrow/all/conanfile.py @@ -575,7 +575,7 @@ def package_info(self): del self.options.plasma if self.options.acero: - self.cpp_info.components["libacero"].libs = [f"acero{suffix}"] + self.cpp_info.components["libacero"].libs = [f"arrow_acero{suffix}"] self.cpp_info.components["libacero"].names["cmake_find_package"] = "acero" self.cpp_info.components["libacero"].names["cmake_find_package_multi"] = "acero" self.cpp_info.components["libacero"].names["pkg_config"] = "acero" diff --git a/recipes/artery-font-format/all/conanfile.py b/recipes/artery-font-format/all/conanfile.py index a477d0ff0e98a..0b2ff0a648da1 100644 --- a/recipes/artery-font-format/all/conanfile.py +++ b/recipes/artery-font-format/all/conanfile.py @@ -1,6 +1,8 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.files import get, copy +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class ArteryFontFormatConan(ConanFile): @@ -10,18 +12,30 @@ class ArteryFontFormatConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "Artery Atlas Font format library" topics = ("artery", "font", "atlas") - + package_type = "header-library" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + # header only: no build step + pass def package(self): - self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") - self.copy("*.h", src=self._source_subfolder, dst="include") - self.copy("*.hpp", src=self._source_subfolder, dst="include") + copy(self, pattern="LICENSE.txt", 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, + ) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) diff --git a/recipes/artery-font-format/all/test_package/CMakeLists.txt b/recipes/artery-font-format/all/test_package/CMakeLists.txt index 454c47bb2cbab..240a8cec38d93 100644 --- a/recipes/artery-font-format/all/test_package/CMakeLists.txt +++ b/recipes/artery-font-format/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(artery-font-format 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} artery-font-format::artery-font-format) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/artery-font-format/all/test_package/conanfile.py b/recipes/artery-font-format/all/test_package/conanfile.py index c53028872776c..26110ca175735 100644 --- a/recipes/artery-font-format/all/test_package/conanfile.py +++ b/recipes/artery-font-format/all/test_package/conanfile.py @@ -1,10 +1,20 @@ -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 +# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): - settings = "os", "compiler", "arch", "build_type" - 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,7 +22,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") arfont = os.path.join(self.source_folder, "example.arfont") - self.run("{} {}".format(bin_path, arfont), run_environment=True) + self.run(f"{bin_path} {arfont}", env="conanrun") diff --git a/recipes/asio-grpc/all/conanfile.py b/recipes/asio-grpc/all/conanfile.py index 3bb6966103744..41ebfbae5f918 100644 --- a/recipes/asio-grpc/all/conanfile.py +++ b/recipes/asio-grpc/all/conanfile.py @@ -11,13 +11,14 @@ class AsioGrpcConan(ConanFile): name = "asio-grpc" - description = ("Asynchronous gRPC with Asio/unified executors") - homepage = "https://github.com/Tradias/asio-grpc" - url = "https://github.com/conan-io/conan-center-index" + description = "Asynchronous gRPC with Asio/unified executors" license = "Apache-2.0" - topics = ("cpp", "asynchronous", "grpc", "asio", "asynchronous-programming", "cpp17", "coroutine", "cpp20", "executors") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Tradias/asio-grpc" + topics = ("cpp", "asynchronous", "grpc", "asio", "asynchronous-programming", "cpp17", "coroutine", "cpp20", "executors", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True options = { "backend": ["boost", "asio", "unifex"], "local_allocator": ["auto", "memory_resource", "boost_container", "recycling_allocator"], @@ -26,6 +27,7 @@ class AsioGrpcConan(ConanFile): "backend": "boost", "local_allocator": "auto", } + no_copy_source = True @property def _min_cppstd(self): @@ -40,16 +42,6 @@ def _compilers_minimum_version(self): "apple-clang": "11", } - 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: - if Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.name} requires C++{self._min_cppstd}, which your compiler does not support.") - else: - self.output.warn(f"{self.name} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") - def configure(self): self._local_allocator_option = self.options.local_allocator if self._local_allocator_option == "auto": @@ -78,6 +70,21 @@ def package_id(self): 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) + 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.name} requires C++{self._min_cppstd}, which your compiler does not support." + ) + else: + self.output.warning( + f"{self.name} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports" + f" C++{self._min_cppstd}." + ) + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -98,8 +105,11 @@ def package(self): rm(self, "asio-grpc*", os.path.join(self.package_folder, "lib", "cmake", "asio-grpc")) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + build_modules = [os.path.join("lib", "cmake", "asio-grpc", "AsioGrpcProtobufGenerator.cmake")] - + self.cpp_info.requires = ["grpc::grpc++_unsecure"] if self.options.backend == "boost": self.cpp_info.defines = ["AGRPC_BOOST_ASIO"] diff --git a/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt b/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt index e68b2def0d618..91630d79f4abb 100644 --- a/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt +++ b/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt @@ -1,34 +1,8 @@ -cmake_minimum_required(VERSION 3.14) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(asio-grpc REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE asio-grpc::asio-grpc) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) - -# See https://github.com/chriskohlhoff/asio/issues/955 -target_compile_definitions(${PROJECT_NAME} - PRIVATE BOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC) - -if(${asio-grpc_VERSION} VERSION_GREATER_EQUAL 2) - target_compile_definitions(${PROJECT_NAME} PRIVATE ASIO_GRPC_V2) -endif() - -if(CMAKE_CROSSCOMPILING) - # Assuming protoc plugins needed by `asio_grpc_protobuf_generate` are not - # available when cross compiling - target_compile_definitions(${PROJECT_NAME} PRIVATE CROSSCOMPILING) -else() - asio_grpc_protobuf_generate( - GENERATE_GRPC - TARGET - ${PROJECT_NAME} - OUT_DIR - "${CMAKE_CURRENT_BINARY_DIR}/generated" - PROTOS - "${CMAKE_CURRENT_LIST_DIR}/../test_package/test.proto") -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/asio/all/conanfile.py b/recipes/asio/all/conanfile.py index b96eb6fa96e4a..301282db06249 100644 --- a/recipes/asio/all/conanfile.py +++ b/recipes/asio/all/conanfile.py @@ -8,23 +8,24 @@ class Asio(ConanFile): name = "asio" - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://think-async.com/Asio" description = "Asio is a cross-platform C++ library for network and low-level I/O" - topics = ("asio", "network", "io", "low-level") license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://think-async.com/Asio" + topics = ("network", "io", "low-level", "header-only") + + 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 diff --git a/recipes/asio/all/test_v1_package/CMakeLists.txt b/recipes/asio/all/test_v1_package/CMakeLists.txt index 0308114c0432b..91630d79f4abb 100644 --- a/recipes/asio/all/test_v1_package/CMakeLists.txt +++ b/recipes/asio/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.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(asio REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE asio::asio) -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/astc-codec/all/conanfile.py b/recipes/astc-codec/all/conanfile.py index a02aae0b4d930..2fab4a9810372 100644 --- a/recipes/astc-codec/all/conanfile.py +++ b/recipes/astc-codec/all/conanfile.py @@ -9,11 +9,13 @@ class AstcCodecConan(ConanFile): name = "astc-codec" - description = " A software ASTC decoder implementation which supports the ASTC LDR profile" + description = "A software ASTC decoder implementation which supports the ASTC LDR profile" homepage = "https://github.com/google/astc-codec" url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" topics = ("astc", "codec") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/recipes/astc-codec/all/test_v1_package/CMakeLists.txt b/recipes/astc-codec/all/test_v1_package/CMakeLists.txt index 0d20897301b68..91630d79f4abb 100644 --- a/recipes/astc-codec/all/test_v1_package/CMakeLists.txt +++ b/recipes/astc-codec/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/async_simple/all/conanfile.py b/recipes/async_simple/all/conanfile.py index cd5c0701011d2..52e7c0ae4b223 100644 --- a/recipes/async_simple/all/conanfile.py +++ b/recipes/async_simple/all/conanfile.py @@ -7,7 +7,6 @@ from conan.tools.layout import basic_layout import os - required_conan_version = ">=1.52.0" @@ -17,7 +16,9 @@ class AsyncSimpleConan(ConanFile): license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/alibaba/async_simple" - topics = ("modules", "asynchronous", "coroutines", "cpp20") + topics = ("modules", "asynchronous", "coroutines", "cpp20", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -61,7 +62,7 @@ def build_requirements(self): pass 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): apply_conandata_patches(self) diff --git a/recipes/async_simple/all/test_package/CMakeLists.txt b/recipes/async_simple/all/test_package/CMakeLists.txt index 0c557f6f0a457..8b854aa258e40 100644 --- a/recipes/async_simple/all/test_package/CMakeLists.txt +++ b/recipes/async_simple/all/test_package/CMakeLists.txt @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.15) +project(test_package CXX) -project(test_package CXX) # if the project uses c++ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) + find_package(async_simple REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -# don't link to ${CONAN_LIBS} or CONAN_PKG::package target_link_libraries(${PROJECT_NAME} PRIVATE async_simple::async_simple_header_only) diff --git a/recipes/async_simple/all/test_v1_package/CMakeLists.txt b/recipes/async_simple/all/test_v1_package/CMakeLists.txt index d25dca4fa93e5..91630d79f4abb 100644 --- a/recipes/async_simple/all/test_v1_package/CMakeLists.txt +++ b/recipes/async_simple/all/test_v1_package/CMakeLists.txt @@ -1,15 +1,8 @@ cmake_minimum_required(VERSION 3.15) - -project(test_package CXX) # if the project uses c++ -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(async_simple REQUIRED CONFIG) - -# Re-use the same source file from test_package folder -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -# don't link to ${CONAN_LIBS} or CONAN_PKG::package -target_link_libraries(${PROJECT_NAME} PRIVATE async_simple::async_simple_header_only) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/asyncly/all/conandata.yml b/recipes/asyncly/all/conandata.yml new file mode 100644 index 0000000000000..e12604057e984 --- /dev/null +++ b/recipes/asyncly/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230420": + url: "https://github.com/goto-opensource/asyncly/archive/e50ce7cf227a86ee0558a89a55f43e34f63e9316.zip" + sha256: "b5d9fcf6baddba48ad5ed5ed6e6ff50ad2ac6340e29c344fe621046e09072357" diff --git a/recipes/asyncly/all/conanfile.py b/recipes/asyncly/all/conanfile.py new file mode 100644 index 0000000000000..1f48e267d577a --- /dev/null +++ b/recipes/asyncly/all/conanfile.py @@ -0,0 +1,113 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.files import get, copy, rm, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + +class PackageConan(ConanFile): + name = "asyncly" + description = "High level concurrency primitives for C++" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/goto-opensource/asyncly" + topics = ("c++", "asynchronous", "communication") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "13", + "apple-clang": "13", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.81.0", transitive_headers=True) + self.requires("function2/4.2.2", transitive_headers=True) + self.requires("prometheus-cpp/1.1.0", transitive_headers=True) + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_TESTING"] = False + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.libs = ["asyncly"] + self.cpp_info.requires = ["boost::headers", "function2::function2", "prometheus-cpp::prometheus-cpp-core"] + + self.cpp_info.set_property("cmake_file_name", "asyncly") + self.cpp_info.set_property("cmake_target_name", "asyncly::asyncly") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "asyncly" + self.cpp_info.filenames["cmake_find_package_multi"] = "asyncly" + self.cpp_info.names["cmake_find_package"] = "asyncly" + self.cpp_info.names["cmake_find_package_multi"] = "asyncly" diff --git a/recipes/asyncly/all/test_package/CMakeLists.txt b/recipes/asyncly/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e1381e7ef86e9 --- /dev/null +++ b/recipes/asyncly/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(asyncly REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE asyncly::asyncly) +target_compile_definitions(${PROJECT_NAME} PRIVATE WIN32_LEAN_AND_MEAN) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/asyncly/all/test_package/conanfile.py b/recipes/asyncly/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/asyncly/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/asyncly/all/test_package/test_package.cpp b/recipes/asyncly/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b5674382d1ec9 --- /dev/null +++ b/recipes/asyncly/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include "asyncly/executor/AsioExecutorController.h" +#include "asyncly/executor/MetricsWrapper.h" +#include "asyncly/executor/ThreadPoolExecutorController.h" + +static void task() +{ +} + +int main() +{ + auto threadPool = asyncly::ThreadPoolExecutorController::create(2); + + threadPool->get_executor()->post([]() { task(); }); + + return 0; +} diff --git a/recipes/asyncly/config.yml b/recipes/asyncly/config.yml new file mode 100644 index 0000000000000..7c6ba2bb8da04 --- /dev/null +++ b/recipes/asyncly/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230420": + folder: all diff --git a/recipes/at-spi2-core/config.yml b/recipes/at-spi2-core/config.yml index f3e69dd713878..2aade72117ca2 100644 --- a/recipes/at-spi2-core/config.yml +++ b/recipes/at-spi2-core/config.yml @@ -21,3 +21,5 @@ versions: folder: new "2.48.0": folder: new + "2.48.3": + folder: new diff --git a/recipes/at-spi2-core/new/conandata.yml b/recipes/at-spi2-core/new/conandata.yml index 1d17c17af2c31..c1bee698611c8 100644 --- a/recipes/at-spi2-core/new/conandata.yml +++ b/recipes/at-spi2-core/new/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.48.3": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.48/at-spi2-core-2.48.3.tar.xz" + sha256: "37316df43ca9989ce539d54cf429a768c28bb38a0b34950beadd0421827edf55" "2.48.0": url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.48/at-spi2-core-2.48.0.tar.xz" sha256: "905a5b6f1790b68ee803bffa9f5fab4ceb591fb4fae0b2f8c612c54f1d4e8a30" @@ -15,6 +18,8 @@ sources: sha256: "ba95f346e93108fbb3462c62437081d582154db279b4052dedc52a706828b192" url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.45/at-spi2-core-2.45.1.tar.xz" patches: + "2.48.3": + - patch_file: "patches/93.patch" "2.48.0": - patch_file: "patches/93.patch" "2.47.1": diff --git a/recipes/autoconf/all/conanfile.py b/recipes/autoconf/all/conanfile.py index 09afbd7d337d1..e8f1925de206c 100644 --- a/recipes/autoconf/all/conanfile.py +++ b/recipes/autoconf/all/conanfile.py @@ -11,7 +11,6 @@ class AutoconfConan(ConanFile): name = "autoconf" - package_type = "application" description = ( "Autoconf is an extensible package of M4 macros that produce shell " "scripts to automatically configure software source code packages" @@ -19,7 +18,9 @@ class AutoconfConan(ConanFile): license = ("GPL-2.0-or-later", "GPL-3.0-or-later") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.gnu.org/software/autoconf/" - topics = ("autoconf", "configure", "build") + topics = ("configure", "build") + + package_type = "application" settings = "os", "arch", "compiler", "build_type" @property @@ -33,12 +34,12 @@ def export_sources(self): def layout(self): basic_layout(self, src_folder="src") - def package_id(self): - self.info.clear() - def requirements(self): self.requires("m4/1.4.19") # Needed at runtime by downstream clients as well + def package_id(self): + self.info.clear() + def build_requirements(self): self.tool_requires("m4/1.4.19") if self._settings_build.os == "Windows": @@ -47,8 +48,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): env = VirtualBuildEnv(self) @@ -100,6 +100,7 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "res", "man")) def package_info(self): + self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] self.cpp_info.resdirs = ["res"] diff --git a/recipes/autoconf/all/test_package/test_package_cpp.cpp b/recipes/autoconf/all/test_package/test_package_cpp.cpp index e31a5ee3cfefa..01bf15d96515c 100644 --- a/recipes/autoconf/all/test_package/test_package_cpp.cpp +++ b/recipes/autoconf/all/test_package/test_package_cpp.cpp @@ -3,14 +3,14 @@ #include extern "C" { - int hello_from_c(void); +int hello_from_c(void); } void hello_from_cxx() { std::cout << "Hello world (" PACKAGE_NAME ") from c++!\n"; } -int main(int argc, char** argv) { +int main() { hello_from_cxx(); hello_from_c(); return 0; diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index c5504ce85bf9a..1d44aec491a20 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -12,12 +12,16 @@ class AutomakeConan(ConanFile): name = "automake" - package_type = "application" + description = ( + "Automake is a tool for automatically generating Makefile.in files" + " compliant with the GNU Coding Standards." + ) + license = ("GPL-2.0-or-later", "GPL-3.0-or-later") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.gnu.org/software/automake/" - description = "Automake is a tool for automatically generating Makefile.in files compliant with the GNU Coding Standards." topics = ("autotools", "configure", "build") - license = ("GPL-2.0-or-later", "GPL-3.0-or-later") + + package_type = "application" settings = "os", "arch", "compiler", "build_type" @property @@ -91,7 +95,7 @@ def _datarootdir(self): def package(self): autotools = Autotools(self) autotools.install() - copy(self, "COPYING*", 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")) rmdir(self, os.path.join(self._datarootdir, "info")) rmdir(self, os.path.join(self._datarootdir, "man")) @@ -114,6 +118,7 @@ def _automake_libdir(self): def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] + self.cpp_info.frameworkdirs = [] self.cpp_info.resdirs = ["res"] # For consumers with new integrations (Conan 1 and 2 compatible): diff --git a/recipes/automake/all/test_package/conanfile.py b/recipes/automake/all/test_package/conanfile.py index a8b0427416846..26fd488e0e853 100644 --- a/recipes/automake/all/test_package/conanfile.py +++ b/recipes/automake/all/test_package/conanfile.py @@ -84,7 +84,7 @@ def build(self): # Build test project autotools = Autotools(self) - autotools.autoreconf(args=['--debug']) + autotools.autoreconf(args=["--debug"]) autotools.configure() autotools.make() diff --git a/recipes/automake/all/test_package/src/test_package.cpp b/recipes/automake/all/test_package/src/test_package.cpp index cd8c2f27c3587..ec5b5ab958cbb 100644 --- a/recipes/automake/all/test_package/src/test_package.cpp +++ b/recipes/automake/all/test_package/src/test_package.cpp @@ -3,7 +3,7 @@ #include #include -int main(int argc, char** argv) { +int main() { std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; return EXIT_SUCCESS; } diff --git a/recipes/automake/all/test_package/test_package.cpp b/recipes/automake/all/test_package/test_package.cpp index cd8c2f27c3587..ec5b5ab958cbb 100644 --- a/recipes/automake/all/test_package/test_package.cpp +++ b/recipes/automake/all/test_package/test_package.cpp @@ -3,7 +3,7 @@ #include #include -int main(int argc, char** argv) { +int main() { std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; return EXIT_SUCCESS; } diff --git a/recipes/avir/all/conanfile.py b/recipes/avir/all/conanfile.py index 61093399842d4..d6b7ebc73045e 100644 --- a/recipes/avir/all/conanfile.py +++ b/recipes/avir/all/conanfile.py @@ -8,23 +8,24 @@ class AVIRConan(ConanFile): name = "avir" + description = "High-quality pro image resizing / scaling C++ library, image resize" license = "MIT" url = "https://github.com/conan-io/conan-center-index" - description = "High-quality pro image resizing / scaling C++ library, image resize" - topics = ("image-processing", "image-resizer", "lanczos", ) homepage = "https://github.com/avaneev/avir" + topics = ("image-processing", "image-resizer", "lanczos", "header-only") + + 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 diff --git a/recipes/avir/all/test_package/CMakeLists.txt b/recipes/avir/all/test_package/CMakeLists.txt index 51fd0e87ec014..b82b306c393cb 100644 --- a/recipes/avir/all/test_package/CMakeLists.txt +++ b/recipes/avir/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(avir CONFIG REQUIRED) diff --git a/recipes/avir/all/test_v1_package/CMakeLists.txt b/recipes/avir/all/test_v1_package/CMakeLists.txt index b53aff65d290e..91630d79f4abb 100644 --- a/recipes/avir/all/test_v1_package/CMakeLists.txt +++ b/recipes/avir/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(avir CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE avir::avir) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/aws-c-auth/all/conanfile.py b/recipes/aws-c-auth/all/conanfile.py index 610bd376de920..93acb4732d6f3 100644 --- a/recipes/aws-c-auth/all/conanfile.py +++ b/recipes/aws-c-auth/all/conanfile.py @@ -1,9 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir +from conan.tools.files import get, copy, rmdir, save from conan.tools.scm import Version import os +import textwrap required_conan_version = ">=1.53.0" @@ -14,7 +15,7 @@ class AwsCAuth(ConanFile): "C99 library implementation of AWS client-side authentication: " "standard credentials providers and signing." ) - license = "Apache-2.0", + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-auth" topics = ("aws", "amazon", "cloud", "authentication", "credentials", "providers", "signing") @@ -46,13 +47,13 @@ def requirements(self): self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) self.requires("aws-c-cal/0.5.13") if Version(self.version) < "0.6.17": - self.requires("aws-c-io/0.10.20", transitive_headers=True, transitive_libs=True) - self.requires("aws-c-http/0.6.13", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-io/0.10.20", transitive_headers=True) + self.requires("aws-c-http/0.6.13", transitive_headers=True) else: - self.requires("aws-c-io/0.13.4", transitive_headers=True, transitive_libs=True) - self.requires("aws-c-http/0.6.22", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-io/0.13.4", transitive_headers=True) + self.requires("aws-c-http/0.6.22", transitive_headers=True) if Version(self.version) >= "0.6.5": - self.requires("aws-c-sdkutils/0.1.3", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-sdkutils/0.1.3", transitive_headers=True) def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -76,25 +77,34 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-auth")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-auth": "aws-c-auth::aws-c-auth"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-auth") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-auth") - # TODO: back to global scope once conan v1 support dropped - self.cpp_info.components["aws-c-auth-lib"].libs = ["aws-c-auth"] - self.cpp_info.components["aws-c-auth-lib"].requires = [ - "aws-c-common::aws-c-common-lib", - "aws-c-cal::aws-c-cal-lib", - "aws-c-io::aws-c-io-lib", - "aws-c-http::aws-c-http-lib", - ] - if Version(self.version) >= "0.6.5": - self.cpp_info.components["aws-c-auth-lib"].requires.append("aws-c-sdkutils::aws-c-sdkutils-lib") - - # TODO: to remove once conan v1 support dropped - self.cpp_info.filenames["cmake_find_package"] = "aws-c-auth" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-auth" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-auth-lib"].names["cmake_find_package"] = "aws-c-auth" - self.cpp_info.components["aws-c-auth-lib"].names["cmake_find_package_multi"] = "aws-c-auth" - self.cpp_info.components["aws-c-auth-lib"].set_property("cmake_target_name", "AWS::aws-c-auth") + self.cpp_info.libs = ["aws-c-auth"] + if self.options.shared: + self.cpp_info.defines.append("AWS_AUTH_USE_IMPORT_EXPORT") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/aws-c-event-stream/all/conanfile.py b/recipes/aws-c-event-stream/all/conanfile.py index 25bb2fd989f0a..2d51b3c4c313f 100644 --- a/recipes/aws-c-event-stream/all/conanfile.py +++ b/recipes/aws-c-event-stream/all/conanfile.py @@ -1,18 +1,21 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir -from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, save +from conan.tools.scm import Version import os +import textwrap + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.52.0" class AwsCEventStream(ConanFile): name = "aws-c-event-stream" description = "C99 implementation of the vnd.amazon.eventstream content-type" - license = "Apache-2.0", + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-event-stream" topics = ("aws", "eventstream", "content", ) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -32,25 +35,16 @@ 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", transitive_headers=True, transitive_libs=True) self.requires("aws-checksums/0.1.13") - self.requires("aws-c-common/0.8.2") if Version(self.version) >= "0.2": if Version(self.version) < "0.2.11": self.requires("aws-c-io/0.10.20") @@ -58,8 +52,7 @@ def requirements(self): self.requires("aws-c-io/0.13.4") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -80,21 +73,36 @@ def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() - rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-event-stream")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-event-stream": "aws-c-event-stream::aws-c-event-stream"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-event-stream") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-event-stream") - self.cpp_info.components["aws-c-event-stream-lib"].names["cmake_find_package"] = "aws-c-event-stream" - self.cpp_info.components["aws-c-event-stream-lib"].names["cmake_find_package_multi"] = "aws-c-event-stream" - self.cpp_info.components["aws-c-event-stream-lib"].libs = ["aws-c-event-stream"] - self.cpp_info.components["aws-c-event-stream-lib"].requires = ["aws-c-common::aws-c-common-lib", "aws-checksums::aws-checksums"] - if Version(self.version) >= "0.2": - self.cpp_info.components["aws-c-event-stream-lib"].requires.append("aws-c-io::aws-c-io-lib") + self.cpp_info.libs = ["aws-c-event-stream"] + if self.options.shared: + self.cpp_info.defines.append("AWS_EVENT_STREAM_USE_IMPORT_EXPORT") - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "aws-c-event-stream" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-event-stream" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt index 674dc4a319004..0d20897301b68 100644 --- a/recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt +++ b/recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package C) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-c-event-stream REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-event-stream) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/aws-c-mqtt/all/conanfile.py b/recipes/aws-c-mqtt/all/conanfile.py index 4edb02ac94d9f..bb0adaf793c0c 100644 --- a/recipes/aws-c-mqtt/all/conanfile.py +++ b/recipes/aws-c-mqtt/all/conanfile.py @@ -1,20 +1,22 @@ from conan import ConanFile -from conan.tools.files import get, copy, rmdir -from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rmdir, save +from conan.tools.scm import Version import os +import textwrap -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class AwsCMQTT(ConanFile): name = "aws-c-mqtt" description = "C99 implementation of the MQTT 3.1.1 specification." - license = "Apache-2.0", + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-mqtt" topics = ("aws", "amazon", "cloud", "mqtt") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -31,34 +33,25 @@ 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.7.12": - self.requires("aws-c-io/0.10.20") + self.requires("aws-c-io/0.10.20", transitive_headers=True) self.requires("aws-c-http/0.6.13") else: - self.requires("aws-c-io/0.13.4") + self.requires("aws-c-io/0.13.4", transitive_headers=True) self.requires("aws-c-http/0.6.22") - 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) @@ -79,22 +72,34 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-mqtt")) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"AWS::aws-c-mqtt": "aws-c-mqtt::aws-c-mqtt"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-mqtt") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-mqtt") + self.cpp_info.libs = ["aws-c-mqtt"] + if self.options.shared: + self.cpp_info.defines.append("AWS_MQTT_USE_IMPORT_EXPORT") - self.cpp_info.filenames["cmake_find_package"] = "aws-c-mqtt" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-mqtt" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" - self.cpp_info.components["aws-c-mqtt-lib"].names["cmake_find_package"] = "aws-c-mqtt" - self.cpp_info.components["aws-c-mqtt-lib"].names["cmake_find_package_multi"] = "aws-c-mqtt" - self.cpp_info.components["aws-c-mqtt-lib"].set_property("cmake_target_name", "AWS::aws-c-mqtt") - - self.cpp_info.components["aws-c-mqtt-lib"].libs = ["aws-c-mqtt"] - self.cpp_info.components["aws-c-mqtt-lib"].requires = [ - "aws-c-common::aws-c-common-lib", - "aws-c-cal::aws-c-cal-lib", - "aws-c-io::aws-c-io-lib", - "aws-c-http::aws-c-http-lib" - ] + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt index 610e2350e6503..0d20897301b68 100644 --- a/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt +++ b/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(aws-c-mqtt REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-mqtt) +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 e04f8d0be32ae..d807a6752466f 100644 --- a/recipes/b2/config.yml +++ b/recipes/b2/config.yml @@ -49,3 +49,5 @@ versions: folder: portable "4.10.0": folder: portable + "4.10.1": + folder: portable diff --git a/recipes/b2/portable/conandata.yml b/recipes/b2/portable/conandata.yml index 3c65d8cd4d51b..cc640fa9b092f 100644 --- a/recipes/b2/portable/conandata.yml +++ b/recipes/b2/portable/conandata.yml @@ -62,3 +62,6 @@ sources: "4.10.0": url: "https://github.com/bfgroup/b2/releases/download/4.10.0/b2-4.10.0.tar.bz2" sha256: "aee0185473141d4acb56e39c78758b1016e66393ea5ca86ef29403bd9258f2e2" + "4.10.1": + url: "https://github.com/bfgroup/b2/releases/download/4.10.1/b2-4.10.1.tar.bz2" + sha256: "d0818276955c3351eac26e4aa1e61046cfded88773232d76f2833c93bb917633" diff --git a/recipes/benchmark/all/conandata.yml b/recipes/benchmark/all/conandata.yml index b417e78a3f997..91541bdc04e27 100644 --- a/recipes/benchmark/all/conandata.yml +++ b/recipes/benchmark/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.8.2": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.2.tar.gz" + sha256: "2aab2980d0376137f969d92848fbb68216abb07633034534fc8c65cc4e7a0e93" + "1.8.1": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.1.tar.gz" + sha256: "e9ff65cecfed4f60c893a1e8a1ba94221fad3b27075f2f80f47eb424b0f8c9bd" "1.8.0": url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.0.tar.gz" sha256: "ea2e94c24ddf6594d15c711c06ccd4486434d9cf3eca954e2af8a20c88f9f172" diff --git a/recipes/benchmark/config.yml b/recipes/benchmark/config.yml index c75e2eaab25cc..b76259067bc58 100644 --- a/recipes/benchmark/config.yml +++ b/recipes/benchmark/config.yml @@ -1,4 +1,8 @@ versions: + "1.8.2": + folder: all + "1.8.1": + folder: all "1.8.0": folder: all "1.7.1": diff --git a/recipes/binutils/all/conandata.yml b/recipes/binutils/all/conandata.yml index a4c3a01e317b2..24c6d4be96798 100644 --- a/recipes/binutils/all/conandata.yml +++ b/recipes/binutils/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.40": + url: "https://ftp.gnu.org/gnu/binutils/binutils-2.40.tar.gz" + sha256: "d7f82c4047decf43a6f769ac32456a92ddb6932409a585c633cdd4e9df23d956" "2.38": # 2022-02-09 url: "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" sha256: "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" @@ -6,6 +9,10 @@ sources: url: "https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.gz" sha256: "c44968b97cd86499efbc4b4ab7d98471f673e5414c554ef54afa930062dbbfcb" patches: + "2.40": + - patch_file: "patches/2.40-0001-no-texinfo.patch" + patch_type: conan + patch_description: "disable texinfo" "2.38": - patch_file: "patches/2.38-0001-no-texinfo.patch" patch_type: conan diff --git a/recipes/binutils/all/conanfile.py b/recipes/binutils/all/conanfile.py index 142067bea696e..c5bddfc4331b0 100644 --- a/recipes/binutils/all/conanfile.py +++ b/recipes/binutils/all/conanfile.py @@ -205,7 +205,10 @@ def package_info(self): # Add recipe path to enable running the self test in the test package. # Don't use this property in production code. It's unsupported. self.user_info.recipe_path = os.path.realpath(__file__) - + self.cpp_info.resdirs = ["etc"] + self.buildenv_info.define("GPROFNG_SYSCONFDIR", os.path.join(self.package_folder, "etc")) + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["dl", "rt"] class _ArchOs: def __init__(self, arch: str, os: str, extra: typing.Optional[typing.Dict[str, str]] = None): diff --git a/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch b/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch new file mode 100644 index 0000000000000..fbd00f17e49e4 --- /dev/null +++ b/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch @@ -0,0 +1,50 @@ +--- gas/Makefile.in ++++ gas/Makefile.in +@@ -1794,7 +1794,7 @@ + check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU + check: check-recursive +-all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h ++all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) config.h + installdirs: installdirs-recursive + installdirs-am: + for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \ +@@ -1870,7 +1870,7 @@ + + info-am: $(INFO_DEPS) info-local + +-install-data-am: install-info-am install-man ++install-data-am: install-man + + install-dvi: install-dvi-recursive + +--- bfd/Makefile.in ++++ bfd/Makefile.in +@@ -266,7 +266,7 @@ + am__v_texidevnull_0 = > /dev/null + am__v_texidevnull_1 = + am__dirstamp = $(am__leading_dot)dirstamp +-INFO_DEPS = doc/bfd.info ++INFO_DEPS = + am__TEXINFO_TEX_DIR = $(srcdir) + DVIS = doc/bfd.dvi + PDFS = doc/bfd.pdf +@@ -2053,7 +2053,7 @@ + check-am: all-am + check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +-all-am: Makefile $(INFO_DEPS) $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) \ ++all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) \ + config.h + installdirs: installdirs-recursive + installdirs-am: +@@ -2122,8 +2122,7 @@ + + info-am: $(INFO_DEPS) + +-install-data-am: install-bfdincludeHEADERS install-bfdlibLTLIBRARIES \ +- install-info-am ++install-data-am: install-bfdincludeHEADERS install-bfdlibLTLIBRARIES + + install-dvi: install-dvi-recursive + diff --git a/recipes/binutils/all/test_package/conanfile.py b/recipes/binutils/all/test_package/conanfile.py index 9f4ceaa413255..79dfa71fb4157 100644 --- a/recipes/binutils/all/test_package/conanfile.py +++ b/recipes/binutils/all/test_package/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.tools.layout import basic_layout class TestPackageConan(ConanFile): @@ -21,6 +22,9 @@ def _has_as(self): def _has_ld(self): return self._settings_build.os not in ("Macos",) + def layout(self): + basic_layout(self) + def test(self): binaries = ["ar", "nm", "objcopy", "objdump", "ranlib", "readelf", "strip"] if self._has_as: diff --git a/recipes/binutils/config.yml b/recipes/binutils/config.yml index f7cce7c207880..8d19abd9678f7 100644 --- a/recipes/binutils/config.yml +++ b/recipes/binutils/config.yml @@ -1,4 +1,6 @@ versions: + "2.40": + folder: all "2.38": folder: all "2.37": diff --git a/recipes/bison/all/conanfile.py b/recipes/bison/all/conanfile.py index 9a5645894b97c..98dd943f37017 100644 --- a/recipes/bison/all/conanfile.py +++ b/recipes/bison/all/conanfile.py @@ -29,10 +29,6 @@ class BisonConan(ConanFile): def _settings_build(self): return getattr(self, "settings_build", self.settings) - @property - def _user_info_build(self): - return getattr(self, "user_info_build", self.deps_user_info) - def export_sources(self): export_conandata_patches(self) @@ -96,8 +92,9 @@ def generate(self): tc.extra_cflags.append("-FS") env = tc.environment() if is_msvc(self): - compile_wrapper = unix_path(self, self._user_info_build["automake"].compile) - ar_wrapper = unix_path(self, self._user_info_build["automake"].ar_lib) + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) env.define("CC", f"{compile_wrapper} cl -nologo") env.define("CXX", f"{compile_wrapper} cl -nologo") env.define("LD", "link -nologo") diff --git a/recipes/boost-leaf/all/conandata.yml b/recipes/boost-leaf/all/conandata.yml index 42c2ccab24961..7ea0efeaa464d 100644 --- a/recipes/boost-leaf/all/conandata.yml +++ b/recipes/boost-leaf/all/conandata.yml @@ -2,3 +2,6 @@ sources: "1.81.0": url: "https://github.com/boostorg/leaf/archive/refs/tags/1.81.0.tar.gz" sha256: "6a2bfa8727891e844f1f95c9c68af192f4c5f53b1707acce54290932118b48c0" + "1.82.0": + url: "https://github.com/boostorg/leaf/archive/refs/tags/boost-1.82.0.tar.gz" + sha256: "0917b22b60a2980bf5e33a393a8545dc6a4a7006c8ca8b78280d1cdb965d75f3" diff --git a/recipes/boost-leaf/config.yml b/recipes/boost-leaf/config.yml index 80eea4560f825..e86af291ae99f 100644 --- a/recipes/boost-leaf/config.yml +++ b/recipes/boost-leaf/config.yml @@ -1,3 +1,5 @@ versions: "1.81.0": folder: "all" + "1.82.0": + folder: "all" diff --git a/recipes/breakpad/all/conandata.yml b/recipes/breakpad/all/conandata.yml index 0037ecfc65960..da051fdc78d51 100644 --- a/recipes/breakpad/all/conandata.yml +++ b/recipes/breakpad/all/conandata.yml @@ -6,3 +6,4 @@ patches: "cci.20210521": - patch_file: "patches/0001-Use_conans_lss.patch" - patch_file: "patches/0002-Remove-hardcoded-fpic.patch" + - patch_file: "patches/0003-Fix-gcc11-compilation.patch" diff --git a/recipes/breakpad/all/conanfile.py b/recipes/breakpad/all/conanfile.py index f4cdf5d9940e4..e9de3c6e8371e 100644 --- a/recipes/breakpad/all/conanfile.py +++ b/recipes/breakpad/all/conanfile.py @@ -31,7 +31,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("linux-syscall-support/cci.20200813") + self.requires("linux-syscall-support/cci.20200813", transitive_headers=True) def validate(self): if self.settings.os != "Linux": diff --git a/recipes/breakpad/all/patches/0003-Fix-gcc11-compilation.patch b/recipes/breakpad/all/patches/0003-Fix-gcc11-compilation.patch new file mode 100644 index 0000000000000..4ce40736676ee --- /dev/null +++ b/recipes/breakpad/all/patches/0003-Fix-gcc11-compilation.patch @@ -0,0 +1,11 @@ +--- a/src/client/linux/handler/exception_handler.cc ++++ b/src/client/linux/handler/exception_handler.cc +@@ -138,7 +138,7 @@ + // SIGSTKSZ may be too small to prevent the signal handlers from overrunning + // the alternative stack. Ensure that the size of the alternative stack is + // large enough. +- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); ++ static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); + + // Only set an alternative stack if there isn't already one, or if the current + // one is too small. diff --git a/recipes/c-blosc2/all/conandata.yml b/recipes/c-blosc2/all/conandata.yml index 4e49e406144c5..09b337eb1d3e7 100644 --- a/recipes/c-blosc2/all/conandata.yml +++ b/recipes/c-blosc2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.10.0": + url: "https://github.com/Blosc/c-blosc2/archive/v2.10.0.tar.gz" + sha256: "cb7f7c0c62af78982140ecff21a2f3ca9ce6a0a1c02e314fcdce1a98da0fe231" "2.8.0": url: "https://github.com/Blosc/c-blosc2/archive/v2.8.0.tar.gz" sha256: "be608cdf68deb02e0d3ee62e183942a0fe5d5d3185375b9b6566e2ae35a9bdbd" @@ -21,6 +24,10 @@ sources: url: "https://github.com/Blosc/c-blosc2/archive/refs/tags/v2.2.0.tar.gz" sha256: "66f9977de26d6bc9ea1c0e623d873c3225e4fff709aa09b3335fd09d41d57c0e" patches: + "2.10.0": + - patch_file: "patches/2.10.0-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "2.8.0": - patch_file: "patches/2.8.0-0001-fix-cmake.patch" patch_description: "use cci package" diff --git a/recipes/c-blosc2/all/conanfile.py b/recipes/c-blosc2/all/conanfile.py index 95efd9dcbcb1d..3d06cc9c0ee52 100644 --- a/recipes/c-blosc2/all/conanfile.py +++ b/recipes/c-blosc2/all/conanfile.py @@ -67,11 +67,11 @@ def requirements(self): if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_zlib in ["zlib-ng", "zlib-ng-compat"]: - self.requires("zlib-ng/2.0.6") + self.requires("zlib-ng/2.1.2") elif self.options.with_zlib == "zlib": self.requires("zlib/1.2.13") if self.options.with_zstd: - self.requires("zstd/1.5.4") + self.requires("zstd/1.5.5") def build_requirements(self): if Version(self.version) >= "2.4.1": @@ -143,4 +143,4 @@ def package_info(self): prefix = "lib" if is_msvc(self) and not self.options.shared else "" self.cpp_info.libs = [f"{prefix}blosc2"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["rt", "m", "pthread"] + self.cpp_info.system_libs = ["rt", "m", "pthread", "dl"] diff --git a/recipes/c-blosc2/all/patches/2.10.0-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.10.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..4ccea534729cb --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.10.0-0001-fix-cmake.patch @@ -0,0 +1,106 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 85d1e03..00e6cad 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -152,26 +152,26 @@ if(BUILD_LITE) + endif() + + if(PREFER_EXTERNAL_LZ4) +- find_package(LZ4) ++ find_package(lz4) + else() + message(STATUS "Using LZ4 internal sources.") + endif() + + if(NOT DEACTIVATE_ZLIB) + if(PREFER_EXTERNAL_ZLIB) +- find_package(ZLIB_NG) +- if(ZLIB_NG_FOUND) ++ find_package(zlib_ng) ++ if(zlib_ng_FOUND) + set(HAVE_ZLIB_NG TRUE) + else() + find_package(ZLIB) + endif() + +- if(NOT (ZLIB_NG_FOUND OR ZLIB_FOUND)) ++ if(NOT (zlib_ng_FOUND OR ZLIB_FOUND)) + message(STATUS "No ZLIB found. Using ZLIB-NG internal sources.") + endif() + endif() + +- if(NOT (ZLIB_NG_FOUND OR ZLIB_FOUND)) ++ if(0) + message(STATUS "Using ZLIB-NG internal sources for ZLIB support.") + set(HAVE_ZLIB_NG TRUE) + add_definitions(-DZLIB_COMPAT) +@@ -192,8 +192,8 @@ endif() + + if(NOT DEACTIVATE_ZSTD) + if(PREFER_EXTERNAL_ZSTD) +- find_package(ZSTD) +- if(NOT ZSTD_FOUND) ++ find_package(zstd) ++ if(NOT zstd_FOUND) + message(STATUS "No ZSTD library found. Using internal sources.") + endif() + else() +diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt +index a6d566d..ba65bae 100644 +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -18,8 +18,8 @@ set(CMAKE_C_VISIBILITY_PRESET hidden) + + # includes + set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) +-if(LZ4_FOUND) +- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_INCLUDE_DIR}) ++if(lz4_FOUND) ++ set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${lz4_INCLUDE_DIR}) + else() + set(LZ4_LOCAL_DIR ${INTERNAL_LIBS}/lz4-1.9.4) + set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_LOCAL_DIR}) +@@ -37,8 +37,8 @@ if(NOT DEACTIVATE_ZLIB) + endif() + + if(NOT DEACTIVATE_ZSTD) +- if(ZSTD_FOUND) +- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_INCLUDE_DIR}) ++ if(zstd_FOUND) ++ set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${zstd_INCLUDE_DIR}) + else() + set(ZSTD_LOCAL_DIR ${INTERNAL_LIBS}/zstd-1.5.5) + set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_LOCAL_DIR} +@@ -100,8 +100,8 @@ else() + set(LIBS ${LIBS} ${CMAKE_DL_LIBS}) + endif() + +-if(LZ4_FOUND) +- set(LIBS ${LIBS} ${LZ4_LIBRARY}) ++if(lz4_FOUND) ++ set(LIBS ${LIBS} ${lz4_LIBRARIES}) + else() + file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) + set(SOURCES ${SOURCES} ${LZ4_FILES}) +@@ -109,8 +109,8 @@ else() + endif() + + if(NOT DEACTIVATE_ZLIB) +- if(ZLIB_NG_FOUND) +- set(LIBS ${LIBS} ${ZLIB_NG_LIBRARY}) ++ if(zlib_ng_FOUND) ++ set(LIBS ${LIBS} ${zlib_ng_LIBRARIES}) + elseif(ZLIB_FOUND) + set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) + else() +@@ -122,8 +122,8 @@ if(NOT DEACTIVATE_ZLIB) + endif() + + if(NOT DEACTIVATE_ZSTD) +- if(ZSTD_FOUND) +- set(LIBS ${LIBS} ${ZSTD_LIBRARY}) ++ if(zstd_FOUND) ++ set(LIBS ${LIBS} ${zstd_LIBRARIES}) + else() + # Enable assembly code only when not using MSVC *and* x86 is there + if((NOT MSVC) AND COMPILER_SUPPORT_SSE2) # if SSE2 is here, this is an x86 platform diff --git a/recipes/c-blosc2/config.yml b/recipes/c-blosc2/config.yml index 4c05452a0a1c9..94edc65e4565a 100644 --- a/recipes/c-blosc2/config.yml +++ b/recipes/c-blosc2/config.yml @@ -1,4 +1,6 @@ versions: + "2.10.0": + folder: all "2.8.0": folder: all "2.6.1": diff --git a/recipes/cairo/all/conanfile.py b/recipes/cairo/all/conanfile.py index 1ee19505ae145..e1166eb30e7ea 100644 --- a/recipes/cairo/all/conanfile.py +++ b/recipes/cairo/all/conanfile.py @@ -26,10 +26,11 @@ class CairoConan(ConanFile): name = "cairo" description = "Cairo is a 2D graphics library with support for multiple output devices" - topics = ("cairo", "graphics") + topics = ("graphics") url = "https://github.com/conan-io/conan-center-index" homepage = "https://cairographics.org/" license = ("LGPL-2.1-only", "MPL-1.1") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -85,12 +86,12 @@ def requirements(self): if self.options.get_safe("with_freetype", True): self.requires("freetype/2.13.0") if self.options.get_safe("with_fontconfig", False): - self.requires("fontconfig/2.13.93") + self.requires("fontconfig/2.14.2") if self.settings.os == "Linux": if self.options.with_xlib or self.options.with_xlib_xrender or self.options.with_xcb: self.requires("xorg/system") if self.options.get_safe("with_glib", True): - self.requires("glib/2.76.1") + self.requires("glib/2.76.2") self.requires("zlib/1.2.13") self.requires("pixman/0.40.0") self.requires("libpng/1.6.39") diff --git a/recipes/cairo/meson/conanfile.py b/recipes/cairo/meson/conanfile.py index 6ff2bab330a2c..22c79e1b6951e 100644 --- a/recipes/cairo/meson/conanfile.py +++ b/recipes/cairo/meson/conanfile.py @@ -105,7 +105,7 @@ def requirements(self): if self.options.with_fontconfig: self.requires("fontconfig/2.14.2") if self.options.with_png: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_glib: self.requires("glib/2.76.3") if self.settings.os == "Linux": diff --git a/recipes/capstone/all/conandata.yml b/recipes/capstone/all/conandata.yml index 7e93927333e67..d7a89de82f179 100644 --- a/recipes/capstone/all/conandata.yml +++ b/recipes/capstone/all/conandata.yml @@ -1,4 +1,12 @@ sources: + "5.0": + url: "https://github.com/capstone-engine/capstone/archive/refs/tags/5.0.tar.gz" + sha256: "df24344407baa7415eeb006f742afc9b92cd33abf2c4c120a6e97cfb376882dc" "4.0.2": url: "https://github.com/capstone-engine/capstone/archive/refs/tags/4.0.2.tar.gz" sha256: "7c81d798022f81e7507f1a60d6817f63aa76e489aa4e7055255f21a22f5e526a" +patches: + "5.0": + - patch_file: "patches/5.0-0001-disable-warning-flags.patch" + patch_description: "disable warning flags for older compilers" + patch_type: "portability" diff --git a/recipes/capstone/all/conanfile.py b/recipes/capstone/all/conanfile.py index 148a51bb1323b..416470d00874e 100644 --- a/recipes/capstone/all/conanfile.py +++ b/recipes/capstone/all/conanfile.py @@ -1,7 +1,8 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get +from conan.tools.files import copy, get, rmdir, export_conandata_patches, apply_conandata_patches 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" @@ -9,20 +10,20 @@ class CapstoneConan(ConanFile): name = "capstone" - license = "BSD-3-Clause" - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://www.capstone-engine.org" description = ( "Capstone disassembly/disassembler framework: Core (Arm, Arm64, BPF, " "EVM, M68K, M680X, MOS65xx, Mips, PPC, RISCV, Sparc, SystemZ, " "TMS320C64x, Web Assembly, X86, X86_64, XCore) + bindings." ) + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.capstone-engine.org" topics = ( "reverse-engineering", "disassembler", "security", "framework", "arm", "arm64", "x86", "sparc", "powerpc", "mips", "x86-64", "ethereum", "systemz", "webassembly", "m68k", "m0s65xx", "m680x", "tms320c64x", "bpf", "riscv", ) - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -39,6 +40,9 @@ class CapstoneConan(ConanFile): options.update({a: [True, False] for a in _archs}) default_options.update({a: True for a in _archs}) + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -53,23 +57,27 @@ 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["CAPSTONE_BUILD_STATIC"] = not self.options.shared - tc.variables["CAPSTONE_BUILD_SHARED"] = self.options.shared + if Version(self.version) < "5.0": + tc.variables["CAPSTONE_BUILD_STATIC"] = not self.options.shared + tc.variables["CAPSTONE_BUILD_SHARED"] = self.options.shared tc.variables["CAPSTONE_BUILD_TESTS"] = False tc.variables["CAPSTONE_BUILD_CSTOOL"] = False tc.variables["CAPSTONE_ARCHITECUTRE_DEFAULT"] = False - tc.variables["CAPSTONE_USE_SYS_DYN_MEM"] = self.options.use_default_alloc + if Version(self.version) < "5.0": + tc.variables["CAPSTONE_USE_SYS_DYN_MEM"] = self.options.use_default_alloc + else: + tc.variables["CAPSTONE_USE_DEFAULT_ALLOC"] = self.options.use_default_alloc for a in self._archs: tc.variables[f"CAPSTONE_{a.upper()}_SUPPORT"] = self.options.get_safe(a) tc.variables["CAPSTONE_BUILD_STATIC_RUNTIME"] = is_msvc_static_runtime(self) tc.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -78,9 +86,11 @@ def package(self): copy(self, "LICENSE*.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - suffix = "_dll" if is_msvc(self) and self.options.shared else "" + suffix = "_dll" if is_msvc(self) and self.options.shared and Version(self.version) < "5.0" else "" self.cpp_info.libs = [f"capstone{suffix}"] if self.options.shared: self.cpp_info.defines.append("CAPSTONE_SHARED") diff --git a/recipes/capstone/all/patches/5.0-0001-disable-warning-flags.patch b/recipes/capstone/all/patches/5.0-0001-disable-warning-flags.patch new file mode 100644 index 0000000000000..95cad95e403d9 --- /dev/null +++ b/recipes/capstone/all/patches/5.0-0001-disable-warning-flags.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7a986a0..3da94ff 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,13 +25,6 @@ project(capstone + VERSION 5.0 + ) + +-if (MSVC) +- add_compile_options(/W1 /w14189) +-else() +- add_compile_options(-Wmissing-braces -Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context) +-endif() +- +- + # to configure the options specify them in in the command line or change them in the cmake UI. + # Don't edit the makefile! + option(BUILD_SHARED_LIBS "Build shared library" OFF) diff --git a/recipes/capstone/config.yml b/recipes/capstone/config.yml index 6ce0808b6e1f0..62f80ddacb005 100644 --- a/recipes/capstone/config.yml +++ b/recipes/capstone/config.yml @@ -1,3 +1,5 @@ versions: + "5.0": + folder: "all" "4.0.2": folder: "all" diff --git a/recipes/catch2/3.x.x/conandata.yml b/recipes/catch2/3.x.x/conandata.yml index 27ebedcdcb791..49bcf956ad89a 100644 --- a/recipes/catch2/3.x.x/conandata.yml +++ b/recipes/catch2/3.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.4.0": + url: "https://github.com/catchorg/Catch2/archive/v3.4.0.tar.gz" + sha256: "122928b814b75717316c71af69bd2b43387643ba076a6ec16e7882bfb2dfacbb" "3.3.2": url: "https://github.com/catchorg/Catch2/archive/v3.3.2.tar.gz" sha256: "8361907f4d9bff3ae7c1edb027f813659f793053c99b67837a0c0375f065bae2" diff --git a/recipes/catch2/config.yml b/recipes/catch2/config.yml index 5cab4a772bfb6..846bd38ba4e58 100644 --- a/recipes/catch2/config.yml +++ b/recipes/catch2/config.yml @@ -1,4 +1,6 @@ versions: + "3.4.0": + folder: 3.x.x "3.3.2": folder: 3.x.x "3.3.1": diff --git a/recipes/ccache/all/conandata.yml b/recipes/ccache/all/conandata.yml index 4e411c4409cdf..d9b62b8f7eec8 100644 --- a/recipes/ccache/all/conandata.yml +++ b/recipes/ccache/all/conandata.yml @@ -13,11 +13,23 @@ patches: - patch_file: "patches/4.8-cmake-msvc-runtime.patch" patch_description: "fixup MSVC runtime" patch_type: "conan" + - patch_file: "patches/4.7.4-use-intrinsics-if-msbuild.patch" + patch_description: "fix build issue when using Visual Studio generator" + patch_type: "backport" + patch_source: "https://github.com/ccache/ccache/commit/350787245e7e894c8a472b176545f59a10e9dadb" "4.8": - patch_file: "patches/4.8-cmake-msvc-runtime.patch" patch_description: "fixup MSVC runtime" patch_type: "conan" + - patch_file: "patches/4.7.4-use-intrinsics-if-msbuild.patch" + patch_description: "fix build issue when using Visual Studio generator" + patch_type: "backport" + patch_source: "https://github.com/ccache/ccache/commit/350787245e7e894c8a472b176545f59a10e9dadb" "4.7.4": - patch_file: "patches/4.7.4-cmake-msvc-runtime.patch" patch_description: "fixup MSVC runtime" patch_type: "conan" + - patch_file: "patches/4.7.4-use-intrinsics-if-msbuild.patch" + patch_description: "fix build issue when using Visual Studio generator" + patch_type: "backport" + patch_source: "https://github.com/ccache/ccache/commit/350787245e7e894c8a472b176545f59a10e9dadb" diff --git a/recipes/ccache/all/patches/4.7.4-use-intrinsics-if-msbuild.patch b/recipes/ccache/all/patches/4.7.4-use-intrinsics-if-msbuild.patch new file mode 100644 index 0000000000000..f55e169ebc167 --- /dev/null +++ b/recipes/ccache/all/patches/4.7.4-use-intrinsics-if-msbuild.patch @@ -0,0 +1,34 @@ +From 350787245e7e894c8a472b176545f59a10e9dadb Mon Sep 17 00:00:00 2001 +From: Rafael Kitover +Date: Mon, 22 May 2023 22:13:19 +0000 +Subject: [PATCH] fix: Disable masm on msbuild for blake3 with VS + +Because of some bug with either msbuild or the cmake generator, the C +compiler flags are passed to the masm assembler making it fail. + +Use the C intrinsic versions for blake3 when msbuild is in use. + +Fix #1278 + +Signed-off-by: Rafael Kitover +--- + src/third_party/blake3/CMakeLists.txt | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/third_party/blake3/CMakeLists.txt b/src/third_party/blake3/CMakeLists.txt +index a30342d5d3..1e30eb3cfe 100644 +--- a/src/third_party/blake3/CMakeLists.txt ++++ b/src/third_party/blake3/CMakeLists.txt +@@ -27,7 +27,11 @@ function(add_source_if_enabled feature msvc_flags others_flags intrinsic) + + # First check if it's possible to use the assembler variant for the feature. + string(TOUPPER "have_asm_${feature}" have_feature) +- if(NOT DEFINED "${have_feature}" AND CMAKE_SIZEOF_VOID_P EQUAL 8) ++ if(NOT DEFINED "${have_feature}" AND CMAKE_SIZEOF_VOID_P EQUAL 8 ++# Force intrinsic version for msbuild because of a bug in the cmake generator ++# or msbuild itself with masm flags. ++ AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") ++ + if(NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Performing Test ${have_feature}") + endif() diff --git a/recipes/certify/all/conanfile.py b/recipes/certify/all/conanfile.py index 86be0e74f0cf1..c1cb170b0ac8c 100644 --- a/recipes/certify/all/conanfile.py +++ b/recipes/certify/all/conanfile.py @@ -1,23 +1,29 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class CertifyConan(ConanFile): name = "certify" description = "Platform-specific TLS keystore abstraction for use with Boost.ASIO and OpenSSL" - topics = ("boost", "asio", "tls", "ssl", "https") + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/djarek/certify" - license = "BSL-1.0" + topics = ("boost", "asio", "tls", "ssl", "https", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -28,17 +34,19 @@ def _compilers_minimum_version(self): "apple-clang": "11", } - @property - def _min_cppstd(self): - return "17" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.79.0") - self.requires("openssl/1.1.1q") + self.requires("boost/1.82.0") + self.requires("openssl/[>=1.1 <4]") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._min_cppstd) + check_min_cppstd(self, self._min_cppstd) def lazy_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] @@ -48,29 +56,38 @@ def lazy_lt_semver(v1, v2): minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if not minimum_version: - self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + self.output.warning( + f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17." + ) elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) - - def package_id(self): - self.info.header_only() + raise ConanInvalidConfiguration( + f"{self.name} requires C++17, which your compiler does not support." + ) 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="LICENSE_1_0.txt", dst="licenses", - src=self._source_subfolder) - self.copy(pattern="*", dst="include", - src=os.path.join(self._source_subfolder, "include")) + copy( + self, + pattern="LICENSE_1_0.txt", + 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.set_property("cmake_file_name", "certify") self.cpp_info.set_property("cmake_target_name", "certify::core") - self.cpp_info.components["_certify"].requires = ["boost::boost", "openssl::openssl"] + self.cpp_info.components["_certify"].requires = ["boost::boost", "openssl::openssl"] self.cpp_info.components["_certify"].names["cmake_find_package"] = "core" self.cpp_info.components["_certify"].names["cmake_find_package_multi"] = "core" + self.cpp_info.names["cmake_find_package"] = "certify" self.cpp_info.names["cmake_find_package_multi"] = "certify" diff --git a/recipes/certify/all/test_package/CMakeLists.txt b/recipes/certify/all/test_package/CMakeLists.txt index 37373018e655a..2d5f2ce7457e3 100644 --- a/recipes/certify/all/test_package/CMakeLists.txt +++ b/recipes/certify/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(certify REQUIRED CONFIG) diff --git a/recipes/certify/all/test_package/conanfile.py b/recipes/certify/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/certify/all/test_package/conanfile.py +++ b/recipes/certify/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/certify/all/test_package/test_package.cpp b/recipes/certify/all/test_package/test_package.cpp index 28f4c97339bb8..6e95446160938 100644 --- a/recipes/certify/all/test_package/test_package.cpp +++ b/recipes/certify/all/test_package/test_package.cpp @@ -6,15 +6,15 @@ #include int main() { - boost::asio::io_context ioc{1}; - boost::asio::ssl::context context{boost::asio::ssl::context_base::method::tls_client}; - boost::asio::ssl::stream stream(ioc, context); - constexpr auto hostname = "example.com"; + boost::asio::io_context ioc{1}; + boost::asio::ssl::context context{boost::asio::ssl::context_base::method::tls_client}; + boost::asio::ssl::stream stream(ioc, context); + constexpr auto hostname = "example.com"; - BOOST_TEST(boost::certify::sni_hostname(stream).empty()); - boost::certify::sni_hostname(stream, hostname); - BOOST_TEST(boost::certify::sni_hostname(stream) == hostname); - std::cout << boost::report_errors(); + BOOST_TEST(boost::certify::sni_hostname(stream).empty()); + boost::certify::sni_hostname(stream, hostname); + BOOST_TEST(boost::certify::sni_hostname(stream) == hostname); + std::cout << boost::report_errors(); - return 0; + return 0; } diff --git a/recipes/cgal/all/conandata.yml b/recipes/cgal/all/conandata.yml index a9e86a3361343..243b9320511a5 100644 --- a/recipes/cgal/all/conandata.yml +++ b/recipes/cgal/all/conandata.yml @@ -1,13 +1,4 @@ sources: - "5.0.4": - sha256: e82096c03ccb31200f02a5b9bd0a5e9ea07840351987dca55aae99a8d5823f59 - url: https://github.com/CGAL/cgal/releases/download/v5.0.4/CGAL-5.0.4.tar.xz - "5.1.5": - sha256: b1bb8a6053aa12baa5981aef20a542cd3e617a86826963fb8fb6852b1a0da97c - url: https://github.com/CGAL/cgal/releases/download/v5.1.5/CGAL-5.1.5.tar.xz - "5.2.4": - sha256: 7f792c59d067e41a073bcee5d615f4276f9ccd2b5e7d359093cc36149fda14c3 - url: https://github.com/CGAL/cgal/releases/download/v5.2.4/CGAL-5.2.4.tar.xz "5.3.2": sha256: af917dbc550388ebcb206f774e610fbdb914d95a4b2932fa952279129103852b url: https://github.com/CGAL/cgal/releases/download/v5.3.2/CGAL-5.3.2.tar.xz @@ -17,3 +8,27 @@ sources: "5.5.1": sha256: 091630def028facdcaf00eb5b68ad79eddac1b855cca6e87eef18a031566edfc url: https://github.com/CGAL/cgal/releases/download/v5.5.1/CGAL-5.5.1.tar.xz + "5.5.2": + sha256: b2b05d5616ecc69facdc24417cce0b04fb4321491d107db45103add520e3d8c3 + url: https://github.com/CGAL/cgal/releases/download/v5.5.2/CGAL-5.5.2.tar.xz +patches: + "5.3.2": + - patch_file: "patches/0001-fix-for-conan.patch" + patch_type: bugfix + patch_source: https://github.com/CGAL/cgal/pull/7502 + patch_description: Fix Eigen3 support in CGAL + "5.5": + - patch_file: "patches/0001-fix-for-conan.patch" + patch_type: bugfix + patch_source: https://github.com/CGAL/cgal/pull/7502 + patch_description: Fix Eigen3 support in CGAL + "5.5.1": + - patch_file: "patches/0001-fix-for-conan.patch" + patch_type: bugfix + patch_source: https://github.com/CGAL/cgal/pull/7502 + patch_description: Fix Eigen3 support in CGAL + "5.5.2": + - patch_file: "patches/0001-fix-for-conan.patch" + patch_type: bugfix + patch_source: https://github.com/CGAL/cgal/pull/7502 + patch_description: Fix Eigen3 support in CGAL diff --git a/recipes/cgal/all/conanfile.py b/recipes/cgal/all/conanfile.py index 47cc7c6fa95ce..3a63d4857c167 100644 --- a/recipes/cgal/all/conanfile.py +++ b/recipes/cgal/all/conanfile.py @@ -1,8 +1,11 @@ import os +import textwrap from conan import ConanFile -from conan.tools import files -from conan.tools import scm -from conans import CMake +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, replace_in_file, rmdir, rm, copy, save, export_conandata_patches, patch +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration required_conan_version = ">=1.50.0" @@ -14,63 +17,167 @@ class CgalConan(ConanFile): description = "C++ library that provides easy access to efficient and reliable algorithms"\ " in computational geometry." topics = ("cgal", "geometry", "algorithms") + package_type = "header-library" settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - exports_sources = "CMakeLists.txt" + generators = "CMakeDeps" short_paths = True - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "14" @property - def _build_subfolder(self): - return "build_subfolder" + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1", + } - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["CGAL_HEADER_ONLY"] = "TRUE" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def export_sources(self): + export_conandata_patches(self) - def _patch_sources(self): - if scm.Version(self.version) < "5.3": - files.replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), - "CMAKE_SOURCE_DIR", "CMAKE_CURRENT_SOURCE_DIR") - else: - files.replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), - "if(NOT PROJECT_NAME)", "if(TRUE)") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.75.0") - self.requires("eigen/3.3.9") + self.requires("boost/1.82.0") + self.requires("eigen/3.4.0") self.requires("mpfr/4.1.0") 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._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "if(NOT PROJECT_NAME)", "if(1)", strict=False) + for it in self.conan_data.get("patches", {}).get(self.version, []): + patch(self, **it, strip=2) + def source(self): - files.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) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - files.rmdir(self, os.path.join(self.package_folder, "share")) - files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - files.rmdir(self, os.path.join(self.package_folder, "bin")) + copy(self, "LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "bin")) + rm(self, "*Config*.cmake", os.path.join(self.package_folder, "lib", "cmake", "CGAL")) + rm(self, "Find*.cmake", os.path.join(self.package_folder, "lib", "cmake", "CGAL")) + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._cmake_module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + ''' + CGAL requires C++14, and specific compilers flags to enable the possibility to set FPU rounding modes. + This CMake module, from the upsream CGAL pull-request https://github.com/CGAL/cgal/pull/7512, takes + care of all the known compilers CGAL has ever supported. + ''' + content = textwrap.dedent('''\ +function(CGAL_setup_CGAL_flags target) + # CGAL now requires C++14. `decltype(auto)` is used as a marker of + # C++14. + target_compile_features(${target} INTERFACE cxx_decltype_auto) + + if(MSVC) + target_compile_options(${target} INTERFACE + "-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS") + if(CMAKE_VERSION VERSION_LESS 3.11) + target_compile_options(${target} INTERFACE + /fp:strict + /fp:except- + /wd4503 # Suppress warnings C4503 about "decorated name length exceeded" + /bigobj # Use /bigobj by default + ) + else() + # The MSVC generator supports `$` since CMake 3.11. + target_compile_options(${target} INTERFACE + $<$:/fp:strict> + $<$:/fp:except-> + $<$:/wd4503> # Suppress warnings C4503 about "decorated name length exceeded" + $<$:/bigobj> # Use /bigobj by default + ) + endif() + elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3) + message(STATUS "Apple Clang version ${CMAKE_CXX_COMPILER_VERSION} compiler detected") + message(STATUS "Boost MP is turned off for all Apple Clang versions below 11.0.3!") + target_compile_options(${target} INTERFACE "-DCGAL_DO_NOT_USE_BOOST_MP") + endif() + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + message( STATUS "Using Intel Compiler. Adding -fp-model strict" ) + if(WIN32) + target_compile_options(${target} INTERFACE "/fp:strict") + else() + target_compile_options(${target} INTERFACE "-fp-model" "strict") + endif() + elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro") + message( STATUS "Using SunPro compiler, using STLPort 4." ) + target_compile_options(${target} INTERFACE + "-features=extensions;-library=stlport4;-D_GNU_SOURCE") + target_link_libraries(${target} INTERFACE "-library=stlport4") + elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + if ( RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE ) + target_compile_options(${target} INTERFACE "-Wall") + endif() + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3) + message( STATUS "Using gcc version 4 or later. Adding -frounding-math" ) + if(CMAKE_VERSION VERSION_LESS 3.3) + target_compile_options(${target} INTERFACE "-frounding-math") + else() + target_compile_options(${target} INTERFACE "$<$:-frounding-math>") + endif() + endif() + if ( "${GCC_VERSION}" MATCHES "^4.2" ) + message( STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing" ) + target_compile_options(${target} INTERFACE "-fno-strict-aliasing" ) + endif() + if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "alpha" ) + message( STATUS "Using gcc on alpha. Adding -mieee -mfp-rounding-mode=d" ) + target_compile_options(${target} INTERFACE "-mieee" "-mfp-rounding-mode=d" ) + endif() + endif() +endfunction() + +CGAL_setup_CGAL_flags(CGAL::CGAL) +''') + save(self, module_file, content) + + @property + def _cmake_module_file_rel_path(self): + return os.path.join("lib", "cmake", "CGAL", f"conan-official-{self.name}-variables.cmake") + + @property + def _module_subfolder(self): + return os.path.join("lib", "cmake", "CGAL") def package_info(self): - self.cpp_info.names["cmake_find_package"] = "CGAL" - self.cpp_info.names["cmake_find_package_multi"] = "CGAL" if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - self.cpp_info.defines.append("CGAL_HEADER_ONLY=1") + self.cpp_info.builddirs.append(self._module_subfolder) + self.cpp_info.set_property("cmake_find_package", "CGAL") + self.cpp_info.set_property("cmake_target_name", "CGAL::CGAL") + self.cpp_info.set_property("cmake_build_modules", [self._cmake_module_file_rel_path]) diff --git a/recipes/cgal/all/patches/0001-fix-for-conan.patch b/recipes/cgal/all/patches/0001-fix-for-conan.patch new file mode 100644 index 0000000000000..9f5f7328fbcd1 --- /dev/null +++ b/recipes/cgal/all/patches/0001-fix-for-conan.patch @@ -0,0 +1,22 @@ +diff --git a/Installation/cmake/modules/CGAL_Eigen3_support.cmake b/Installation/cmake/modules/CGAL_Eigen3_support.cmake +index cc0df0fad10..bfcf56c7c2f 100644 +--- a/Installation/cmake/modules/CGAL_Eigen3_support.cmake ++++ b/Installation/cmake/modules/CGAL_Eigen3_support.cmake +@@ -1,9 +1,14 @@ +-if(EIGEN3_FOUND AND NOT TARGET CGAL::Eigen3_support) ++if((EIGEN3_FOUND OR Eigen3_FOUND) AND NOT TARGET CGAL::Eigen3_support) + if(NOT TARGET Threads::Threads) + find_package(Threads REQUIRED) + endif() + add_library(CGAL::Eigen3_support INTERFACE IMPORTED) + set_target_properties(CGAL::Eigen3_support PROPERTIES +- INTERFACE_COMPILE_DEFINITIONS "CGAL_EIGEN3_ENABLED" +- INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}") ++ INTERFACE_COMPILE_DEFINITIONS "CGAL_EIGEN3_ENABLED") ++ if(TARGET Eigen3::Eigen) ++ target_link_libraries(CGAL::Eigen3_support INTERFACE Eigen3::Eigen) ++ else() ++ set_target_properties(CGAL::Eigen3_support PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}") ++ endif() + endif() diff --git a/recipes/cgal/all/test_package/CMakeLists.txt b/recipes/cgal/all/test_package/CMakeLists.txt index c5080a4f875bc..f704ccdcb3f0e 100644 --- a/recipes/cgal/all/test_package/CMakeLists.txt +++ b/recipes/cgal/all/test_package/CMakeLists.txt @@ -1,9 +1,10 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.10) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(CGAL REQUIRED) +find_package(Eigen3 REQUIRED) +include(CGAL_Eigen3_support) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} PRIVATE CGAL::CGAL) +target_link_libraries(${PROJECT_NAME} PRIVATE CGAL::Eigen3_support) diff --git a/recipes/cgal/all/test_package/conanfile.py b/recipes/cgal/all/test_package/conanfile.py index 2b959f9f04238..539dd819448cb 100644 --- a/recipes/cgal/all/test_package/conanfile.py +++ b/recipes/cgal/all/test_package/conanfile.py @@ -1,20 +1,26 @@ import os from conan import ConanFile -from conan.tools import build -from conans import CMake - +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain" + + def requirements(self): + self.requires("eigen/3.4.0") + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) cmake.configure() cmake.build() + def layout(self): + cmake_layout(self) + def test(self): - if not build.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/cgal/config.yml b/recipes/cgal/config.yml index 72209e170658c..48232844708f0 100644 --- a/recipes/cgal/config.yml +++ b/recipes/cgal/config.yml @@ -1,13 +1,9 @@ versions: - "5.0.4": - folder: all - "5.1.5": - folder: all - "5.2.4": - folder: all "5.3.2": folder: all "5.5": folder: all "5.5.1": folder: all + "5.5.2": + folder: all diff --git a/recipes/chaiscript/all/CMakeLists.txt b/recipes/chaiscript/all/CMakeLists.txt deleted file mode 100644 index a7a84f24be646..0000000000000 --- a/recipes/chaiscript/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -if (WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif(WIN32 AND BUILD_SHARED_LIBS) - -add_subdirectory("source_subfolder") diff --git a/recipes/chaiscript/all/conanfile.py b/recipes/chaiscript/all/conanfile.py index 00f73ebe996c7..84875e933945e 100644 --- a/recipes/chaiscript/all/conanfile.py +++ b/recipes/chaiscript/all/conanfile.py @@ -1,16 +1,24 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import get, copy, rmdir, collect_libs +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os +required_conan_version = ">=1.53.0" + + class ChaiScriptConan(ConanFile): name = "chaiscript" homepage = "https://github.com/ChaiScript/ChaiScript" description = "Embedded Scripting Language Designed for C++." - topics = ("conan", "embedded-scripting-language", "language") + topics = ("embedded-scripting-language", "language") url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" exports_sources = ["CMakeLists.txt"] - generators = "cmake" settings = "os", "compiler", "build_type", "arch" options = {"fPIC": [True, False], "dyn_load": [True, False], "use_std_make_shared": [True, False], "multithread_support": [True, False], @@ -21,60 +29,80 @@ class ChaiScriptConan(ConanFile): "header_only": True} @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property - def _build_subfolder(self): - return "build_subfolder" - - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "ChaiScript-" + self.version - os.rename(extracted_dir, self._source_subfolder) + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "15.0", + "msvc": "191", + } def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_TESTING"] = False - cmake.definitions["BUILD_SAMPLES"] = False - cmake.definitions["BUILD_MODULES"] = True - cmake.definitions["USE_STD_MAKE_SHARED"] = self.options.use_std_make_shared - cmake.definitions["DYNLOAD_ENABLED"] = self.options.dyn_load - cmake.definitions["MULTITHREAD_SUPPORT_ENABLED"] = self.options.multithread_support - cmake.configure(build_folder=self._build_subfolder) - return cmake + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_SAMPLES"] = False + tc.variables["BUILD_MODULES"] = True + tc.variables["USE_STD_MAKE_SHARED"] = self.options.use_std_make_shared + tc.variables["DYNLOAD_ENABLED"] = self.options.dyn_load + tc.variables["MULTITHREAD_SUPPORT_ENABLED"] = self.options.multithread_support + tc.generate() def build(self): if not self.options.header_only: - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) if self.options.header_only: - self.copy(pattern="*.hpp", dst="include", - src=os.path.join(self._source_subfolder, 'include')) + copy(self, pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) else: - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(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")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_id(self): - if self.options.header_only: - self.info.header_only() + if self.info.options.header_only: + self.info.clear() def package_info(self): if not self.options.header_only: - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.options.use_std_make_shared: self.cpp_info.defines.append("CHAISCRIPT_USE_STD_MAKE_SHARED") - if self.settings.os == "Linux": - self.cpp_info.system_libs = ["dl"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("dl") if self.options.multithread_support: self.cpp_info.system_libs.append("pthread") diff --git a/recipes/chaiscript/all/test_package/CMakeLists.txt b/recipes/chaiscript/all/test_package/CMakeLists.txt index 8ff036c8cd891..e3d7046fa8301 100644 --- a/recipes/chaiscript/all/test_package/CMakeLists.txt +++ b/recipes/chaiscript/all/test_package/CMakeLists.txt @@ -1,13 +1,11 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(chaiscript REQUIRED CONFIG) -# TEST_PACKAGE ################################################################# - -add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) -target_link_libraries(${CMAKE_PROJECT_NAME} CONAN_PKG::chaiscript) -set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 14) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} chaiscript::chaiscript) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + target_compile_options(${PROJECT_NAME} PRIVATE /bigobj) +endif() diff --git a/recipes/chaiscript/all/test_package/conanfile.py b/recipes/chaiscript/all/test_package/conanfile.py index 4d0099777a2a9..963c088e08a5c 100644 --- a/recipes/chaiscript/all/test_package/conanfile.py +++ b/recipes/chaiscript/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.build import can_run import os -from conans import ConanFile, CMake class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake_find_package_multi", "cmake" + 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,4 +21,6 @@ def build(self): cmake.build() def test(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/charls/all/conanfile.py b/recipes/charls/all/conanfile.py index 97d9f69aa36d4..90461d15285bf 100644 --- a/recipes/charls/all/conanfile.py +++ b/recipes/charls/all/conanfile.py @@ -63,7 +63,10 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["CHARLS_INSTALL"] = True + tc.cache_variables["CHARLS_BUILD_FUZZ_TEST"] = False + tc.cache_variables["CHARLS_BUILD_SAMPLES"] = False + tc.cache_variables["CHARLS_BUILD_TESTS"] = False + tc.cache_variables["CHARLS_INSTALL"] = True tc.generate() def build(self): diff --git a/recipes/cimg/all/conandata.yml b/recipes/cimg/all/conandata.yml index eea92963062f7..c4ba41f9e21b5 100644 --- a/recipes/cimg/all/conandata.yml +++ b/recipes/cimg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.5": + url: "https://cimg.eu/files/CImg_3.2.5.zip" + sha256: "3ab9f25cd7e5f7256dde67b4ea78ead05834bee0db9160c89668a388ba141cd9" "3.2.0": url: "https://cimg.eu/files/CImg_3.2.0.zip" sha256: "7a923357c3127d8839696c7b0f4eb4c23982c090d3f49fb133f2c8556ca74a88" diff --git a/recipes/cimg/all/conanfile.py b/recipes/cimg/all/conanfile.py index 4c4d65c0ab3d8..cbed93e0b8d51 100644 --- a/recipes/cimg/all/conanfile.py +++ b/recipes/cimg/all/conanfile.py @@ -11,11 +11,11 @@ class CImgConan(ConanFile): name = "cimg" description = "The CImg Library is a small and open-source C++ toolkit for image processing" - homepage = "http://cimg.eu" - topics = ("physics", "simulation", "robotics", "kinematics", "engine") license = "CeCILL V2" url = "https://github.com/conan-io/conan-center-index" - + homepage = "http://cimg.eu" + topics = ("physics", "simulation", "robotics", "kinematics", "engine") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "enable_fftw": [True, False], @@ -64,17 +64,26 @@ def layout(self): def requirements(self): if self.options.enable_fftw: - self.requires("fftw/3.3.9") + self.requires("fftw/3.3.10") if self.options.enable_jpeg: self.requires("libjpeg/9e") if self.options.enable_openexr: - self.requires("openexr/2.5.7") + if self.options.enable_opencv: + self.requires("openexr/3.1.7") + else: + self.requires("openexr/3.1.7") if self.options.enable_png: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.enable_tiff: - self.requires("libtiff/4.4.0") + if self.options.enable_opencv: + self.requires("libtiff/4.5.1") + else: + self.requires("libtiff/4.5.1") if self.options.enable_ffmpeg: - self.requires("ffmpeg/5.0") + if self.options.enable_opencv: + self.requires("ffmpeg/4.4") + else: + self.requires("ffmpeg/5.1") if self.options.enable_opencv: self.requires("opencv/4.5.5") if self.options.enable_magick: @@ -93,8 +102,7 @@ def validate(self): raise ConanInvalidConfiguration("xshm not available in CCI 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 build(self): pass diff --git a/recipes/cimg/config.yml b/recipes/cimg/config.yml index 570cd2f89fed4..b39649938fc2e 100644 --- a/recipes/cimg/config.yml +++ b/recipes/cimg/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.5": + folder: all "3.2.0": folder: all "3.0.2": diff --git a/recipes/cjson/all/conandata.yml b/recipes/cjson/all/conandata.yml index 397bb216165bb..3c51bd5b253a1 100644 --- a/recipes/cjson/all/conandata.yml +++ b/recipes/cjson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.7.16": + url: "https://github.com/DaveGamble/cJSON/archive/v1.7.16.tar.gz" + sha256: "451131a92c55efc5457276807fc0c4c2c2707c9ee96ef90c47d68852d5384c6c" "1.7.15": url: "https://github.com/DaveGamble/cJSON/archive/v1.7.15.tar.gz" sha256: "5308fd4bd90cef7aa060558514de6a1a4a0819974a26e6ed13973c5f624c24b2" diff --git a/recipes/cjson/config.yml b/recipes/cjson/config.yml index 894ac0453b1d4..7d96cfac89098 100644 --- a/recipes/cjson/config.yml +++ b/recipes/cjson/config.yml @@ -1,4 +1,6 @@ versions: + "1.7.16": + folder: all "1.7.15": folder: all "1.7.14": diff --git a/recipes/clickhouse-cpp/all/conandata.yml b/recipes/clickhouse-cpp/all/conandata.yml new file mode 100644 index 0000000000000..67cb91f1f1a6c --- /dev/null +++ b/recipes/clickhouse-cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.4.0": + url: "https://github.com/ClickHouse/clickhouse-cpp/archive/refs/tags/v2.4.0.tar.gz" + sha256: "336a1d0b4c4d6bd67bd272afab3bdac51695f8b0e93dd6c85d4d774d6c7df8ad" diff --git a/recipes/clickhouse-cpp/all/conanfile.py b/recipes/clickhouse-cpp/all/conanfile.py new file mode 100644 index 0000000000000..442d24123399e --- /dev/null +++ b/recipes/clickhouse-cpp/all/conanfile.py @@ -0,0 +1,127 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain,CMakeDeps, cmake_layout +from conan.tools.files import copy, get +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class ClickHouseCppConan(ConanFile): + name = "clickhouse-cpp" + homepage = "https://github.com/ClickHouse/clickhouse-cpp" + url = "https://github.com/conan-io/conan-center-index" + description = "ClickHouse C++ API" + license = "Apache-2.0" + topics = ("database", "db", "clickhouse") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_benchmark": [True, False], + "with_openssl": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "enable_benchmark": False, + "with_openssl": False + } + + def requirements(self): + + self.requires("lz4/1.9.4") + + self.requires("abseil/20230125.3", transitive_headers=True) + + self.requires("cityhash/cci.20130801") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + def build_requirements(self): + if self.options.enable_benchmark: + self.requires("benchmark/1.8.0") + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "6", + } + + @property + def _requires_compiler_rt(self): + return self.settings.compiler == "clang" and (( self.settings.compiler.libcxx in ["libstdc++", "libstdc++11"] and not self.options.shared) or self.settings.compiler.libcxx == "libc++" ) + + 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++17, which your compiler does not support.") + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("f{self.ref} does not support shared library on Windows.") + # look at https://github.com/ClickHouse/clickhouse-cpp/pull/226 + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_BENCHMARK"] = self.options.enable_benchmark + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["WITH_OPENSSL"] = self.options.with_openssl + tc.cache_variables["WITH_SYSTEM_ABSEIL"] = True + tc.cache_variables["WITH_SYSTEM_LZ4"] = True + tc.cache_variables["WITH_SYSTEM_CITYHASH"] = True + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs.append("clickhouse-cpp-lib") + self.cpp_info.set_property("cmake_target_name", "clickhouse-cpp-lib::clickhouse-cpp-lib") + + if self._requires_compiler_rt: + ldflags = ["--rtlib=compiler-rt"] + self.cpp_info.exelinkflags = ldflags + self.cpp_info.sharedlinkflags = ldflags + self.cpp_info.system_libs.append("gcc_s") + + self.cpp_info.filenames["cmake_find_package"] = "clickhouse-cpp" + self.cpp_info.filenames["cmake_find_package_multi"] = "clickhouse-cpp" + self.cpp_info.names["cmake_find_package"] = "clickhouse-cpp-lib" + self.cpp_info.names["cmake_find_package_multi"] = "clickhouse-cpp-lib" + + if self.settings.os == 'Windows': + self.cpp_info.system_libs = ['ws2_32', 'wsock32'] diff --git a/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt b/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b042c5663ae08 --- /dev/null +++ b/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(clickhouse-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE clickhouse-cpp-lib::clickhouse-cpp-lib ) + +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/clickhouse-cpp/all/test_package/conanfile.py b/recipes/clickhouse-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6d529581ba2f5 --- /dev/null +++ b/recipes/clickhouse-cpp/all/test_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/clickhouse-cpp/all/test_package/test_package.cpp b/recipes/clickhouse-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..475e89847d23f --- /dev/null +++ b/recipes/clickhouse-cpp/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include +#include +#include +#include + +#include +#include +using namespace clickhouse; + +int main() +{ + const auto localHostEndpoint = ClientOptions() + .SetHost( "localhost") + .SetPort(9000) + .SetUser("default") + .SetPassword("") + .SetDefaultDatabase("default"); + + try { + Client client(localHostEndpoint); + } + catch (const std::exception &ex) + { + std::cout << "not connected but works" << std::endl; + } + + return 0; +} diff --git a/recipes/clickhouse-cpp/all/test_v1_package/CMakeLists.txt b/recipes/clickhouse-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/clickhouse-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/clickhouse-cpp/all/test_v1_package/conanfile.py b/recipes/clickhouse-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/clickhouse-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/clickhouse-cpp/config.yml b/recipes/clickhouse-cpp/config.yml new file mode 100644 index 0000000000000..e1d4aed9fe78f --- /dev/null +++ b/recipes/clickhouse-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "2.4.0": + folder: all diff --git a/recipes/cmake/3.x.x/conandata.yml b/recipes/cmake/3.x.x/conandata.yml index 54adb8af58aa6..da33ab402ca26 100644 --- a/recipes/cmake/3.x.x/conandata.yml +++ b/recipes/cmake/3.x.x/conandata.yml @@ -20,3 +20,6 @@ sources: "3.25.2": url: "https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2.tar.gz" sha256: "c026f22cb931dd532f648f087d587f07a1843c6e66a3dfca4fb0ea21944ed33c" + "3.26.4": + url: "https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4.tar.gz" + sha256: "313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208" diff --git a/recipes/coin-utils/all/conandata.yml b/recipes/coin-utils/all/conandata.yml index d4916f7c0bcc0..a58d95ee0972a 100644 --- a/recipes/coin-utils/all/conandata.yml +++ b/recipes/coin-utils/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.11.9": + url: "https://github.com/coin-or/CoinUtils/archive/releases/2.11.9.tar.gz" + sha256: "15d572ace4cd3b7c8ce117081b65a2bd5b5a4ebaba54fadc99c7a244160f88b8" "2.11.6": url: "https://github.com/coin-or/CoinUtils/archive/releases/2.11.6.tar.gz" sha256: "6ea31d5214f7eb27fa3ffb2bdad7ec96499dd2aaaeb4a7d0abd90ef852fc79ca" @@ -6,6 +9,11 @@ sources: url: "https://github.com/coin-or/CoinUtils/archive/releases/2.11.4.tar.gz" sha256: "d4effff4452e73356eed9f889efd9c44fe9cd68bd37b608a5ebb2c58bd45ef81" patches: + "2.11.9": + - patch_file: "patches/0001-no-check-pkgconfig.patch" + - patch_file: "patches/0003-cpp17-compat.patch" + patch_description: "C++17 compatibility" + patch_type: "portability" "2.11.6": - patch_file: "patches/0001-no-check-pkgconfig.patch" - patch_file: "patches/0002-cpp17-compat.patch" diff --git a/recipes/coin-utils/all/patches/0003-cpp17-compat.patch b/recipes/coin-utils/all/patches/0003-cpp17-compat.patch new file mode 100644 index 0000000000000..355ff4f097705 --- /dev/null +++ b/recipes/coin-utils/all/patches/0003-cpp17-compat.patch @@ -0,0 +1,55 @@ +--- 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 diff --git a/recipes/coin-utils/config.yml b/recipes/coin-utils/config.yml index a116e38afc5df..07a06aecfba33 100644 --- a/recipes/coin-utils/config.yml +++ b/recipes/coin-utils/config.yml @@ -1,4 +1,6 @@ versions: + "2.11.9": + folder: "all" "2.11.6": folder: "all" "2.11.4": diff --git a/recipes/commata/all/conandata.yml b/recipes/commata/all/conandata.yml index 8d18339e36157..f3b0e9f61cd27 100644 --- a/recipes/commata/all/conandata.yml +++ b/recipes/commata/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.5": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.5.tar.gz" + sha256: "d1be1f366267af6c466c29f846f5968f57626a8a6635a2ea9a3de3f6fb88e53b" "0.2.4-bug1": url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.4-bug1.tar.gz" sha256: "fcde251d9b41f1601e1f8b2181613b4bf33c4318678700e2b3b54bf24bc9e1e3" diff --git a/recipes/commata/config.yml b/recipes/commata/config.yml index 48953f2722cf9..5000ff084e200 100644 --- a/recipes/commata/config.yml +++ b/recipes/commata/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.5": + folder: all "0.2.4-bug1": folder: all "0.2.4": diff --git a/recipes/concurrentqueue/all/conandata.yml b/recipes/concurrentqueue/all/conandata.yml index 4a3b84f1e1032..01e2ad199f983 100644 --- a/recipes/concurrentqueue/all/conandata.yml +++ b/recipes/concurrentqueue/all/conandata.yml @@ -1,10 +1,13 @@ sources: + "1.0.4": + url: "https://github.com/cameron314/concurrentqueue/archive/refs/tags/v1.0.4.tar.gz" + sha256: "87fbc9884d60d0d4bf3462c18f4c0ee0a9311d0519341cac7cbd361c885e5281" "1.0.3": - url: https://github.com/cameron314/concurrentqueue/archive/v1.0.3.zip - sha256: 5e9e229a1791e8299dcd4bd73ac1be1953424a903818feb7afd929eb16094ef5 + url: "https://github.com/cameron314/concurrentqueue/archive/refs/tags/v1.0.3.tar.gz" + sha256: "eb37336bf9ae59aca7b954db3350d9b30d1cab24b96c7676f36040aa76e915e8" "1.0.2": - url: https://github.com/cameron314/concurrentqueue/archive/v1.0.2.zip - sha256: 6dc85de0e38a014471fe3c653e3e21dc38a5f069cfc031a90fa59f0a45f7584f + url: "https://github.com/cameron314/concurrentqueue/archive/refs/tags/v1.0.2.tar.gz" + sha256: "c3aeb97c97169f743a53ca33812ea2ab61dd06dfd28319ca3f0a0771372fc7fc" "1.0.1": - url: https://github.com/cameron314/concurrentqueue/archive/v1.0.1.zip - sha256: b31dca11745ef331756109af838e3689462fbbc2c52dda9f7e1c416778f1f35b + url: "https://github.com/cameron314/concurrentqueue/archive/refs/tags/v1.0.1.tar.gz" + sha256: "7e715c793001e01851448320e8a416b80342b2e75db46d4c978e990a506060e6" diff --git a/recipes/concurrentqueue/all/conanfile.py b/recipes/concurrentqueue/all/conanfile.py index 866dbaf480b38..fe58e688dd504 100644 --- a/recipes/concurrentqueue/all/conanfile.py +++ b/recipes/concurrentqueue/all/conanfile.py @@ -9,27 +9,31 @@ class ConcurrentqueueConan(ConanFile): name = "concurrentqueue" + description = "A fast multi-producer, multi-consumer lock-free concurrent queue for C++11" + license = ["BSD-2-Clause", "BSL-1.0"] url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/cameron314/concurrentqueue" - description = "A fast multi-producer, multi-consumer lock-free concurrent queue for C++11" topics = ("cpp11", "cpp14", "cpp17", "queue", "lock-free") - license = ["BSD-2-Clause", "BSL-1.0"] + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) - - def layout(self): - basic_layout(self, src_folder="src") + 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 build(self): pass @@ -44,8 +48,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "concurrentqueue::concurrentqueue") self.cpp_info.includedirs.append(os.path.join("include", "moodycamel")) self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/concurrentqueue/all/test_package/conanfile.py b/recipes/concurrentqueue/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/concurrentqueue/all/test_package/conanfile.py +++ b/recipes/concurrentqueue/all/test_package/conanfile.py @@ -7,6 +7,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/concurrentqueue/config.yml b/recipes/concurrentqueue/config.yml index df27cd90727cc..ba8a25151dfc3 100644 --- a/recipes/concurrentqueue/config.yml +++ b/recipes/concurrentqueue/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.4": + folder: all "1.0.3": folder: all "1.0.2": diff --git a/recipes/console_bridge/all/conandata.yml b/recipes/console_bridge/all/conandata.yml new file mode 100644 index 0000000000000..b08e5584e75a4 --- /dev/null +++ b/recipes/console_bridge/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.2": + url: "https://github.com/ros/console_bridge/archive/refs/tags/1.0.2.tar.gz" + sha256: "303a619c01a9e14a3c82eb9762b8a428ef5311a6d46353872ab9a904358be4a4" diff --git a/recipes/console_bridge/all/conanfile.py b/recipes/console_bridge/all/conanfile.py new file mode 100644 index 0000000000000..489534f60bd16 --- /dev/null +++ b/recipes/console_bridge/all/conanfile.py @@ -0,0 +1,79 @@ +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rm, rmdir + +required_conan_version = ">=1.53.0" + + +class PackageConan(ConanFile): + name = "console_bridge" + description = "A ROS-independent library for logging that seamlessly pipes into rosconsole/rosout for ROS-dependent packages" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ros/console_bridge" + topics = ("logging", "ros", "robotics") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 14 + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + pass + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + CMakeDeps(self).generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rm(self, "*.pdb", os.path.join(self.package_folder)) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "console_bridge")) + rmdir(self, os.path.join(self.package_folder, "CMake")) + + def package_info(self): + self.cpp_info.libs = ["console_bridge"] + + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/console_bridge/all/test_package/CMakeLists.txt b/recipes/console_bridge/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c15ea1a1502bc --- /dev/null +++ b/recipes/console_bridge/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(console_bridge REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE console_bridge::console_bridge) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/console_bridge/all/test_package/conanfile.py b/recipes/console_bridge/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/console_bridge/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/console_bridge/all/test_package/test_package.cpp b/recipes/console_bridge/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1c02a2b52e784 --- /dev/null +++ b/recipes/console_bridge/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main() { + console_bridge::setLogLevel(console_bridge::CONSOLE_BRIDGE_LOG_DEBUG); + CONSOLE_BRIDGE_logInform("CONSOLE_BRIDGE_logInform() ran successfully"); + return EXIT_SUCCESS; +} diff --git a/recipes/console_bridge/config.yml b/recipes/console_bridge/config.yml new file mode 100644 index 0000000000000..8457ca9a4a8cd --- /dev/null +++ b/recipes/console_bridge/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.2": + folder: all diff --git a/recipes/continuable/all/conanfile.py b/recipes/continuable/all/conanfile.py index 7a8754a12145a..40af36527241e 100644 --- a/recipes/continuable/all/conanfile.py +++ b/recipes/continuable/all/conanfile.py @@ -1,35 +1,33 @@ import os -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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version - -required_conan_version = ">=1.28.0" +required_conan_version = ">=1.52.0" class ContinuableConan(ConanFile): name = "continuable" - description = "C++14 asynchronous allocation aware futures (supporting then, exception handling, coroutines and connections)" - topics = "asynchronous", "future", "coroutines", "header-only" + description = ( + "C++14 asynchronous allocation aware futures " + "(supporting then, exception handling, coroutines and connections)" + ) + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Naios/continuable" - license = "MIT" - settings = "os", "compiler" - no_copy_source = True - requires = ( - "function2/4.1.0", - ) + topics = ("asynchronous", "future", "coroutines", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" options = { - # Exceptions are disabled and `std::error_condition` is used as error_type. See tutorial-chaining-continuables-fail for details. "no_exceptions": [True, False], - # Exceptions are disabled and the type defined by `CONTINUABLE_WITH_CUSTOM_ERROR_TYPE` is used as error_type. - # See tutorial-chaining-continuables-fail for details. "custom_error_type": [True, False], - # Allows unhandled exceptions in asynchronous call hierarchies. See tutorial-chaining-continuables-fail for details. "unhandled_exceptions": [True, False], - # Allows to customize the final callback which can be used to implement custom unhandled asynchronous exception handlers. "custom_final_callback": [True, False], - # Don"t decorate the used type erasure, which is done to keep type names minimal for better error messages in debug builds. "immediate_types": [True, False], } default_options = { @@ -37,44 +35,84 @@ class ContinuableConan(ConanFile): "custom_error_type": False, "unhandled_exceptions": False, "custom_final_callback": False, - "immediate_types": False + "immediate_types": False, + } + options_description = { + "no_exceptions": ( + "Exceptions are disabled and `std::error_condition` is used as error_type. " + "See tutorial-chaining-continuables-fail for details." + ), + "custom_error_type": ( + "Exceptions are disabled and the type defined by `CONTINUABLE_WITH_CUSTOM_ERROR_TYPE` " + "is used as error_type. See tutorial-chaining-continuables-fail for details." + ), + "unhandled_exceptions": ( + "Allows unhandled exceptions in asynchronous call hierarchies. " + "See tutorial-chaining-continuables-fail for details." + ), + "custom_final_callback": ( + "Allows to customize the final callback which can be used to implement custom unhandled" + " asynchronous exception handlers." + ), + "immediate_types": ( + "Don't decorate the used type erasure, " + "which is done to keep type names minimal for better error messages in debug builds." + ), } + no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 14 - def validate(self): - minimal_cpp_standard = "14" - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, minimal_cpp_standard) - minimal_version = { + @property + def _compilers_minimum_version(self): + return { "gcc": "5", "clang": "3.4", "apple-clang": "10", - "Visual Studio": "14" + "Visual Studio": "14", } - compiler = str(self.settings.compiler) - if compiler not in minimal_version: - self.output.warn( - "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) - self.output.warn( - "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) - return - version = tools.Version(self.settings.compiler.version) - if version < minimal_version[compiler]: - raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("function2/4.1.0") + + 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): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "continuable-" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst=os.path.join("include", "continuable"), src=os.path.join(self._source_subfolder, "include", "continuable")) + copy( + self, + pattern="LICENSE.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + copy( + self, + pattern="*", + dst=os.path.join(self.package_folder, "include", "continuable"), + src=os.path.join(self.source_folder, "include", "continuable"), + ) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os == "Linux": self.cpp_info.system_libs.append("pthread") if self.options.no_exceptions: @@ -87,6 +125,3 @@ def package_info(self): self.cpp_info.defines.append("CONTINUABLE_WITH_CUSTOM_FINAL_CALLBACK") if self.options.immediate_types: self.cpp_info.defines.append("CONTINUABLE_WITH_IMMEDIATE_TYPES") - - def package_id(self): - self.info.header_only() diff --git a/recipes/continuable/all/test_package/CMakeLists.txt b/recipes/continuable/all/test_package/CMakeLists.txt index 7dd0ea22e1254..f98eae0c75bf8 100644 --- a/recipes/continuable/all/test_package/CMakeLists.txt +++ b/recipes/continuable/all/test_package/CMakeLists.txt @@ -1,14 +1,11 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(continuable REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -set_target_properties( - ${PROJECT_NAME} PROPERTIES - +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON ) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE continuable::continuable) diff --git a/recipes/continuable/all/test_package/conanfile.py b/recipes/continuable/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/continuable/all/test_package/conanfile.py +++ b/recipes/continuable/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/continuable/all/test_package/test_package.cpp b/recipes/continuable/all/test_package/test_package.cpp index b26567acd4b10..92cb7db2c14ee 100644 --- a/recipes/continuable/all/test_package/test_package.cpp +++ b/recipes/continuable/all/test_package/test_package.cpp @@ -2,7 +2,7 @@ #include "continuable/continuable.hpp" -int main(int, char**) { +int main() { cti::make_ready_continuable("..."); return 0; diff --git a/recipes/cpp-httplib/all/conandata.yml b/recipes/cpp-httplib/all/conandata.yml index 4c38028d6d647..dff9808ae31f2 100644 --- a/recipes/cpp-httplib/all/conandata.yml +++ b/recipes/cpp-httplib/all/conandata.yml @@ -1,49 +1,13 @@ sources: - "0.12.5": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.5.tar.gz" - sha256: "b488f3fa9c6bf35608c3d9a5b69be52e016bbf2fbfe67e5ee684eadb2655493e" - "0.12.4": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.4.tar.gz" - sha256: "1aecc75c64fe979f4c6f8b0308ef11f282c721522072fa02717ff07cc9627d10" - "0.12.3": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.3.tar.gz" - sha256: "175ced3c9cdaf221e9edf210297568d8f7d402a41d6db01254ac9e0b25487c54" - "0.12.2": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.2.tar.gz" - sha256: "a7897d052de8fae75817e7a261ae37b89dc4cb8ac74b74458a1f2d2e707cfd03" - "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" + "0.13.1": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.13.1.tar.gz" + sha256: "9b837d290b61e3f0c4239da0b23bbf14c382922e2bf2a9bac21c1e3feabe1ff9" + "0.12.6": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.6.tar.gz" + sha256: "24bc594a9efcc08a5a6f3928e848d046d411a88b07bcd6f7f3851227a1f0133e" "0.11.4": url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.4.tar.gz" sha256: "28f76b875a332fb80972c3212980c963f0a7d2e11a8fe94a8ed0d847b9a2256f" - "0.11.3": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.3.tar.gz" - sha256: "799b2daa0441d207f6cd1179ae3a34869722084a434da6614978be1682c1e12d" - "0.11.2": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.2.tar.gz" - sha256: "e620d030215733c4831fdc7813d5eb37a6fd599f8192a730662662e1748a741b" - "0.11.1": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.1.tar.gz" - sha256: "1ce2f0393ba779ec34885c5cd937141b4b5b730e2bc2efc34eb8554289c24d61" - "0.11.0": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.0.tar.gz" - sha256: "9f533b0aa67066bd8f049e080eef75ad710a2f3ba3d80edbb13957389a5eeca7" "0.10.9": url: "https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.10.9.tar.gz" sha256: "95ac0740ef760829a079c01a44164fd74af3fdc0748a40fc6beefd0276fd2345" - "0.9.10": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.9.10.tar.gz" - sha256: "49dfa101ced75f8536ec7c865f872ab8fca157c8b49e29be5ef2d2aa11f716e8" - "0.8.9": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.8.9.tar.gz" - sha256: "3c5e0d6784d04b0b3d10f60fa2a26ef2a968fb80f434c4d117c2811f9e3a5ed7" - "0.7.18": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.7.18.tar.gz" - sha256: "ed90e670a39fcacfb670f51b619e670dafe419bca74f8a50fb3c31bb46be8b23" - "0.6.6": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.6.6.tar.gz" - sha256: "35bcc6a3f9612feb92b2153c5e56389ccc1ab46c7ba8781b873a5c2e249eb610" diff --git a/recipes/cpp-httplib/all/conanfile.py b/recipes/cpp-httplib/all/conanfile.py index fafe791af7015..ce51d51a2071d 100644 --- a/recipes/cpp-httplib/all/conanfile.py +++ b/recipes/cpp-httplib/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.files import copy, get from conan.tools.layout import basic_layout diff --git a/recipes/cpp-httplib/all/test_package/test_package.cpp b/recipes/cpp-httplib/all/test_package/test_package.cpp index 3e9fe638f7b17..197dc1388d9c9 100644 --- a/recipes/cpp-httplib/all/test_package/test_package.cpp +++ b/recipes/cpp-httplib/all/test_package/test_package.cpp @@ -1,20 +1,6 @@ #include int main() { - httplib::Server svr; - - svr.Get("/hi", [](const httplib::Request& req, httplib::Response& res) { - res.set_content("Hello World!", "text/plain"); - }); - - svr.Get(R"(/numbers/(\d+))", [&](const httplib::Request& req, httplib::Response& res) { - auto numbers = req.matches[1]; - res.set_content(numbers, "text/plain"); - }); - - svr.Get("/stop", [&](const httplib::Request& req, httplib::Response& res) { - svr.stop(); - }); - + httplib::Request request; return 0; } diff --git a/recipes/cpp-httplib/config.yml b/recipes/cpp-httplib/config.yml index 589f0df2ffe4a..7af780ed5d22d 100644 --- a/recipes/cpp-httplib/config.yml +++ b/recipes/cpp-httplib/config.yml @@ -1,33 +1,9 @@ versions: - "0.12.5": + "0.13.1": folder: all - "0.12.4": - folder: all - "0.12.3": - folder: all - "0.12.2": - folder: all - "0.12.1": - folder: all - "0.12.0": + "0.12.6": folder: all "0.11.4": folder: all - "0.11.3": - folder: all - "0.11.2": - folder: all - "0.11.1": - folder: all - "0.11.0": - folder: all "0.10.9": folder: all - "0.9.10": - folder: all - "0.8.9": - folder: all - "0.7.18": - folder: all - "0.6.6": - folder: all diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index f9dabdc5e5fa6..35bee8612638b 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.11.1": + url: "https://github.com/danmar/cppcheck/archive/2.11.1.tar.gz" + sha256: "fef6ef868d562d49136f158e1d0f7a38237e7e1c0a91d9189bdd465f1fe54316" "2.10.3": url: "https://github.com/danmar/cppcheck/archive/2.10.3.tar.gz" sha256: "8aae5e116daeaaf5d19f3efa61b91c06f161cb97412a1d1af6e1e20686e48967" @@ -15,6 +18,10 @@ sources: url: "https://github.com/danmar/cppcheck/archive/2.8.2.tar.gz" sha256: "30ba99ab54089c44b83f02e2453da046a7edff5237950d4A0eb1eba4afcb4f45" patches: + "2.11.1": + - patch_file: "patches/0003-pcre-debuglib-name.patch" + patch_description: "Consider the Debug suffix for Windows" + patch_type: "portability" "2.10.3": - patch_file: "patches/0001-cli-remove-dmake-cmake-2.10.patch" patch_description: "Remove dmake tool from target ALL" diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 734ffc6f84fd2..fa5b72926399e 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.scm import Version import os required_conan_version = ">=1.52.0" @@ -36,6 +37,8 @@ def generate(self): tc.variables["HAVE_RULES"] = self.options.get_safe("have_rules", False) tc.variables["USE_MATCHCOMPILER"] = "Auto" tc.variables["ENABLE_OSS_FUZZ"] = False + if Version(self.version) >= "2.11.0": + tc.variables["DISABLE_DMAKE"] = True tc.variables["FILESDIR"] = "bin" tc.generate() diff --git a/recipes/cppcheck/config.yml b/recipes/cppcheck/config.yml index 77ce70296b493..6325a54f72873 100644 --- a/recipes/cppcheck/config.yml +++ b/recipes/cppcheck/config.yml @@ -1,4 +1,6 @@ versions: + "2.11.1": + folder: all "2.10.3": folder: all "2.10": diff --git a/recipes/cppcmd/all/conanfile.py b/recipes/cppcmd/all/conanfile.py index f83b9294d4efa..8e60072bb9375 100644 --- a/recipes/cppcmd/all/conanfile.py +++ b/recipes/cppcmd/all/conanfile.py @@ -1,7 +1,13 @@ +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.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -from glob import glob + + +required_conan_version = ">=1.52.0" class CppCmdConan(ConanFile): @@ -11,57 +17,57 @@ class CppCmdConan(ConanFile): homepage = "https://github.com/remysalim/cppcmd" url = "https://github.com/conan-io/conan-center-index" license = "MIT" + package_type = "header-library" settings = "os", "compiler", "arch", "build_type" - generators = "cmake" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 17 @property - def _minimum_compilers_version(self): + def _compilers_minimum_version(self): return { "Visual Studio": "15.7", + "msvc": "192", "gcc": "8", "clang": "7", "apple-clang": "10.2", } - def configure(self): - if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) - min_version = self._minimum_compilers_version.get( - str(self.settings.compiler)) - if not min_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler)) - else: - if tools.Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration("{} requires C++17 support. The current compiler {} {} does not support it.".format( - self.name, self.settings.compiler, self.settings.compiler.version)) + 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) + 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 package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob("cppcmd-*")[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + # header_only - no build def package(self): - self.copy(pattern="LICENSE", dst="licenses", - src=self._source_subfolder) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) - cmake.definitions["BUILD_TESTS"] = "OFF" - cmake.configure(source_folder=self._source_subfolder, - build_folder=self._build_subfolder) cmake.install() - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cppcmd/all/test_package/CMakeLists.txt b/recipes/cppcmd/all/test_package/CMakeLists.txt index 1ecd7e0a81c7b..9c5302dc6f47d 100644 --- a/recipes/cppcmd/all/test_package/CMakeLists.txt +++ b/recipes/cppcmd/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.5) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(cppcmd REQUIRED CONFIG) add_executable(${PROJECT_NAME} main.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} cppcmd::cppcmd) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cppcmd/all/test_package/conanfile.py b/recipes/cppcmd/all/test_package/conanfile.py index bd7165a553cf4..3a91c9439218e 100644 --- a/recipes/cppcmd/all/test_package/conanfile.py +++ b/recipes/cppcmd/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def 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", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cppcmd/all/test_package/main.cpp b/recipes/cppcmd/all/test_package/main.cpp index 186e15bf7de57..94c409d3743fc 100644 --- a/recipes/cppcmd/all/test_package/main.cpp +++ b/recipes/cppcmd/all/test_package/main.cpp @@ -1,5 +1,7 @@ #include +#include +#include #include using namespace cppcmd; diff --git a/recipes/cppcommon/all/CMakeLists.txt b/recipes/cppcommon/all/CMakeLists.txt deleted file mode 100644 index 6ba47d078b389..0000000000000 --- a/recipes/cppcommon/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -if(WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/cppcommon/all/conandata.yml b/recipes/cppcommon/all/conandata.yml index c69e434893cba..c2897878ad2bc 100644 --- a/recipes/cppcommon/all/conandata.yml +++ b/recipes/cppcommon/all/conandata.yml @@ -1,43 +1,76 @@ sources: + "1.0.3.0": + url: "https://github.com/chronoxor/CppCommon/archive/1.0.3.0.tar.gz" + sha256: "af530d3550a050d4ed73a680b016e043ea6f4f56e11163226f2a6e24d9eae4ca" + "1.0.2.0": + url: "https://github.com/chronoxor/CppCommon/archive/1.0.2.0.tar.gz" + sha256: "1a748159ab5d0eb74a6c7b110606718caa779cdf17b3e91bf0dbd0e297823dec" + "1.0.1.0": + url: "https://github.com/chronoxor/CppCommon/archive/1.0.1.0.tar.gz" + sha256: "974ac65c72bb57bc6cbe825990e595fd40ead8c1e66e00c1206b19f749697878" "1.0.0.0": url: "https://github.com/chronoxor/CppCommon/archive/1.0.0.0.tar.gz" sha256: "d6124dd4cd430e5f10c2942ff02a95636369875b652e66a499b01f1fb3ecfd6d" "cci.20201104": url: "https://github.com/chronoxor/CppCommon/archive/cacfa9554d367467808663d9d5a695933ae566bb.tar.gz" sha256: "d2e717798e1668c831ee977763eaff7413ef48e6e0914a6322c9918016092048" - "1.0.1.0": - url: "https://github.com/chronoxor/CppCommon/archive/1.0.1.0.tar.gz" - sha256: "974ac65c72bb57bc6cbe825990e595fd40ead8c1e66e00c1206b19f749697878" - "1.0.2.0": - url: "https://github.com/chronoxor/CppCommon/archive/1.0.2.0.tar.gz" - sha256: "1a748159ab5d0eb74a6c7b110606718caa779cdf17b3e91bf0dbd0e297823dec" - "1.0.3.0": - url: "https://github.com/chronoxor/CppCommon/archive/1.0.3.0.tar.gz" - sha256: "af530d3550a050d4ed73a680b016e043ea6f4f56e11163226f2a6e24d9eae4ca" - patches: + "1.0.3.0": + - patch_file: "patches/0001-update-cmakelists-1-0-3-0.patch" + patch_description: "use cci packages" + patch_type: "conan" + - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" + patch_description: "define _WIN32_WINNT" + patch_type: "portability" + - patch_file: "patches/0004-include-cstdint-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" + "1.0.2.0": + - patch_file: "patches/0001-update-cmakelists-1-0-1-0.patch" + patch_description: "use cci packages" + patch_type: "conan" + - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" + patch_description: "define _WIN32_WINNT" + patch_type: "portability" + - patch_file: "patches/0004-include-cstdint-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" + "1.0.1.0": + - patch_file: "patches/0001-update-cmakelists-1-0-1-0.patch" + patch_description: "use cci packages" + patch_type: "conan" + - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" + patch_description: "define _WIN32_WINNT" + patch_type: "portability" + - patch_file: "patches/0004-include-cstdint-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" + - patch_file: "patches/0005-include-mutex-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" "1.0.0.0": - patch_file: "patches/0001-update-cmakelists-1-0-0-0.patch" - base_path: "source_subfolder" + patch_description: "use cci packages" + patch_type: "conan" - patch_file: "patches/0002-fix-cross-platform-issues.patch" - base_path: "source_subfolder" + patch_description: "fix platform problems" + patch_type: "portability" + - patch_file: "patches/0004-include-cstdint-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" + - patch_file: "patches/0005-include-mutex-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" "cci.20201104": - patch_file: "patches/0001-update-cmakelists-1-0-0-0.patch" - base_path: "source_subfolder" + patch_description: "use cci packages" + patch_type: "conan" - patch_file: "patches/0003-define-win32-winnt-cci-20201104.patch" - base_path: "source_subfolder" - "1.0.1.0": - - patch_file: "patches/0001-update-cmakelists-1-0-1-0.patch" - base_path: "source_subfolder" - - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" - base_path: "source_subfolder" - "1.0.2.0": - - patch_file: "patches/0001-update-cmakelists-1-0-1-0.patch" - base_path: "source_subfolder" - - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" - base_path: "source_subfolder" - "1.0.3.0": - - patch_file: "patches/0001-update-cmakelists-1-0-3-0.patch" - base_path: "source_subfolder" - - patch_file: "patches/0003-define-win32-winnt-1-0-1-0.patch" - base_path: "source_subfolder" + patch_description: "define _WIN32_WINNT" + patch_type: "portability" + - patch_file: "patches/0004-include-cstdint-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" + - patch_file: "patches/0005-include-mutex-1-0-0.patch" + patch_description: "include cstdint" + patch_type: "portability" diff --git a/recipes/cppcommon/all/conanfile.py b/recipes/cppcommon/all/conanfile.py index aa3040d536ba0..c289f88e777b0 100644 --- a/recipes/cppcommon/all/conanfile.py +++ b/recipes/cppcommon/all/conanfile.py @@ -1,33 +1,38 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +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 glob +required_conan_version = ">=1.53.0" class CppCommon(ConanFile): name = "cppcommon" - license = "MIT" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/chronoxor/CppCommon" description = "C++ Common Library contains reusable components and patterns" \ " for error and exceptions handling, filesystem manipulations, math," \ " string format and encoding, shared memory, threading, time management" \ " and others." - topics = ("conan", "utils", "library") - settings = "os", "compiler", "build_type", "arch" - options = {"fPIC": [True, False], "shared": [True, False]} - default_options = {"fPIC": True, "shared": False} - exports_sources = ["patches/**", "CMakeLists.txt"] - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/chronoxor/CppCommon" + topics = ("utils", "filesystem", "uuid", "synchronization", "queue") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "shared": [True, False], + } + default_options = { + "fPIC": True, + "shared": False, + } @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -36,64 +41,74 @@ def _compilers_minimum_version(self): "clang": 6, "gcc": 7, "Visual Studio": 16, + "msvc": 192, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - if self.settings.compiler == "Visual Studio" and self.settings.arch == "x86": - raise ConanInvalidConfiguration("Visual Studio x86 builds are not supported.") - if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "17") - - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("cppcommon requires C++17, which your compiler does not support.") - else: - self.output.warn("cppcommon requires C++17. Your compiler is unknown. Assuming it supports C++17.") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/8.0.0") + if Version(self.version) < "1.0.3" or self.version == "cci.20201104": + self.requires("fmt/8.1.1") + else: + self.requires("fmt/10.0.0") if self.settings.os == "Linux": self.requires("libuuid/1.0.3") + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if is_msvc(self) and self.settings.arch == "x86": + raise ConanInvalidConfiguration("Visual Studio x86 builds are not supported.") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.20 <4]") + def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob("CppCommon-*")[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["CPPCOMMON_MODULE"] = "OFF" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CPPCOMMON_MODULE"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + dpes = CMakeDeps(self) + dpes.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 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() - self.copy(pattern="*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy(pattern="*.inl", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy(pattern="*.h", dst=os.path.join("include", "plugins"), src=os.path.join(self._source_subfolder, "plugins")) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*.inl", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include", "plugins"), src=os.path.join(self.source_folder, "plugins")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) - self.cpp_info.includedirs.append(os.path.join("include", "plugins")) - if self.settings.os == "Linux": + self.cpp_info.libs = ["cppcommon", "plugin-function", "plugin-interface"] + self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include", "plugins")) + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread", "rt", "dl", "m"] if self.settings.os == "Windows": self.cpp_info.system_libs = ["userenv", "rpcrt4"] diff --git a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-0-0.patch b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-0-0.patch index 4429b5fee77ed..db56e91ef6951 100644 --- a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-0-0.patch +++ b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-0-0.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index dcd57785b..2dde9577f 100644 +index dcd5778..160fc09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -18,13 +18,13 @@ if(DOXYGEN_FOUND) +@@ -18,30 +18,30 @@ if(DOXYGEN_FOUND) endif() # CMake module path @@ -20,8 +20,9 @@ index dcd57785b..2dde9577f 100644 +# include(SystemInformation) # External packages ++find_package(fmt REQUIRED) find_package(Threads REQUIRED) -@@ -32,16 +32,15 @@ if(UNIX AND NOT APPLE AND NOT MSYS) + if(UNIX AND NOT APPLE AND NOT MSYS) find_package(LibBFD) find_package(LibDL) find_package(LibRT) @@ -40,12 +41,12 @@ index dcd57785b..2dde9577f 100644 # Link libraries list(APPEND LINKLIBS Threads::Threads) -@@ -49,17 +48,18 @@ if(UNIX AND NOT APPLE AND NOT MSYS) +@@ -49,17 +49,18 @@ if(UNIX AND NOT APPLE AND NOT MSYS) list(APPEND LINKLIBS ${LIBBFD_LIBRARIES}) list(APPEND LINKLIBS ${LIBDL_LIBRARIES}) list(APPEND LINKLIBS ${LIBRT_LIBRARIES}) - list(APPEND LINKLIBS ${LIBUUID_LIBRARIES}) -+ list(APPEND LINKLIBS CONAN_PKG::libuuid) ++ list(APPEND LINKLIBS libuuid::libuuid) endif() if(WIN32 OR MSYS) list(APPEND LINKLIBS ${DBGHELP_LIBRARIES}) @@ -62,7 +63,7 @@ index dcd57785b..2dde9577f 100644 include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/plugins") # Library -@@ -68,8 +68,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl") +@@ -68,8 +69,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl") file(GLOB_RECURSE LIB_SOURCE_FILES "source/*.cpp") add_library(cppcommon ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) set_target_properties(cppcommon PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") @@ -70,11 +71,11 @@ index dcd57785b..2dde9577f 100644 -target_link_libraries(cppcommon ${LINKLIBS} fmt) +target_include_directories(cppcommon PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") +target_compile_features(cppcommon PUBLIC cxx_std_17) -+target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) ++target_link_libraries(cppcommon PUBLIC ${LINKLIBS} fmt::fmt) list(APPEND INSTALL_TARGETS cppcommon) list(APPEND LINKLIBS cppcommon) -@@ -91,7 +92,7 @@ if(NOT CPPCOMMON_MODULE) +@@ -91,7 +93,7 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS_PDB ${PLUGIN_TARGET}) endforeach() @@ -83,7 +84,7 @@ index dcd57785b..2dde9577f 100644 file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") file(GLOB EXAMPLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/examples" "examples/*.cpp") -@@ -105,8 +106,8 @@ if(NOT CPPCOMMON_MODULE) +@@ -105,8 +107,8 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) endforeach() @@ -94,7 +95,7 @@ index dcd57785b..2dde9577f 100644 file(GLOB BENCHMARK_HEADER_FILES "performance/*.h") file(GLOB BENCHMARK_INLINE_FILES "performance/*.inl") file(GLOB BENCHMARK_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/performance" "performance/*.cpp") -@@ -120,8 +121,8 @@ if(NOT CPPCOMMON_MODULE) +@@ -120,8 +122,8 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) endforeach() @@ -105,7 +106,7 @@ index dcd57785b..2dde9577f 100644 file(GLOB TESTS_HEADER_FILES "tests/*.h") file(GLOB TESTS_INLINE_FILES "tests/*.inl") file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") -@@ -136,15 +137,15 @@ if(NOT CPPCOMMON_MODULE) +@@ -136,15 +138,15 @@ if(NOT CPPCOMMON_MODULE) # CTest enable_testing() add_test(cppcommon-tests cppcommon-tests --durations yes --order lex) diff --git a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-1-0.patch b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-1-0.patch index c7b2d0bf5679b..650b9b1d05898 100644 --- a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-1-0.patch +++ b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-1-0.patch @@ -1,17 +1,14 @@ -From 85122652b618951f1b8fe91d8804d92a74d971be Mon Sep 17 00:00:00 2001 -From: Alejandro Colomar -Date: Mon, 7 Jun 2021 10:27:46 +0200 -Subject: [PATCH] update cmakelists - ---- - CMakeLists.txt | 42 +++++++++++++++++++----------------------- - 1 file changed, 19 insertions(+), 23 deletions(-) - diff --git a/CMakeLists.txt b/CMakeLists.txt -index aa5447a8..10a0065b 100644 +index aa5447a..19b3564 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -17,49 +17,36 @@ if(DOXYGEN_FOUND) +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.6) ++cmake_minimum_required(VERSION 3.8) + + # Global properties + set_property(GLOBAL PROPERTY USE_FOLDERS ON) +@@ -17,49 +17,37 @@ if(DOXYGEN_FOUND) endif() endif() @@ -26,6 +23,7 @@ index aa5447a8..10a0065b 100644 - # External packages find_package(Threads REQUIRED) ++find_package(fmt REQUIRED) if(UNIX AND NOT APPLE AND NOT MSYS) find_package(LibBFD) find_package(LibDL) @@ -49,7 +47,7 @@ index aa5447a8..10a0065b 100644 list(APPEND LINKLIBS ${LIBDL_LIBRARIES}) list(APPEND LINKLIBS ${LIBRT_LIBRARIES}) - list(APPEND LINKLIBS ${LIBUUID_LIBRARIES}) -+ list(APPEND LINKLIBS CONAN_PKG::libuuid) ++ list(APPEND LINKLIBS libuuid::libuuid) endif() if(WIN32 OR MSYS) list(APPEND LINKLIBS ${DBGHELP_LIBRARIES}) @@ -65,7 +63,7 @@ index aa5447a8..10a0065b 100644 include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/plugins") # Library -@@ -68,8 +55,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") +@@ -68,8 +56,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") file(GLOB_RECURSE LIB_SOURCE_FILES "include/*.cpp" "source/*.cpp") add_library(cppcommon ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) set_target_properties(cppcommon PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") @@ -73,11 +71,11 @@ index aa5447a8..10a0065b 100644 -target_link_libraries(cppcommon ${LINKLIBS} fmt) +target_include_directories(cppcommon PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") +target_compile_features(cppcommon PUBLIC cxx_std_17) -+target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) ++target_link_libraries(cppcommon PUBLIC ${LINKLIBS} fmt::fmt) list(APPEND INSTALL_TARGETS cppcommon) list(APPEND LINKLIBS cppcommon) -@@ -92,6 +80,7 @@ if(NOT CPPCOMMON_MODULE) +@@ -92,6 +81,7 @@ if(NOT CPPCOMMON_MODULE) endforeach() # Examples @@ -85,7 +83,7 @@ index aa5447a8..10a0065b 100644 file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") file(GLOB EXAMPLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/examples" "examples/*.cpp") -@@ -105,8 +94,10 @@ if(NOT CPPCOMMON_MODULE) +@@ -105,8 +95,10 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) endforeach() @@ -96,7 +94,7 @@ index aa5447a8..10a0065b 100644 file(GLOB BENCHMARK_HEADER_FILES "performance/*.h") file(GLOB BENCHMARK_INLINE_FILES "performance/*.inl") file(GLOB BENCHMARK_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/performance" "performance/*.cpp") -@@ -120,8 +111,10 @@ if(NOT CPPCOMMON_MODULE) +@@ -120,8 +112,10 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) endforeach() @@ -107,7 +105,7 @@ index aa5447a8..10a0065b 100644 file(GLOB TESTS_HEADER_FILES "tests/*.h") file(GLOB TESTS_INLINE_FILES "tests/*.inl") file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") -@@ -132,19 +125,22 @@ if(NOT CPPCOMMON_MODULE) +@@ -132,19 +126,22 @@ if(NOT CPPCOMMON_MODULE) target_link_libraries(cppcommon-tests ${LINKLIBS}) list(APPEND INSTALL_TARGETS cppcommon-tests) list(APPEND INSTALL_TARGETS_PDB cppcommon-tests) @@ -134,6 +132,3 @@ index aa5447a8..10a0065b 100644 foreach(INSTALL_TARGET_PDB ${INSTALL_TARGETS_PDB}) install(FILES $ DESTINATION "${PROJECT_SOURCE_DIR}/bin") endforeach() --- -2.31.1.498.g6c1eba8ee3d - diff --git a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-3-0.patch b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-3-0.patch index 83cb81ebe9a49..6a01d828cbe86 100644 --- a/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-3-0.patch +++ b/recipes/cppcommon/all/patches/0001-update-cmakelists-1-0-3-0.patch @@ -1,14 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index aa5447a8..10a0065b 100644 +index 7ce5f63..be39a51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 3.20) -+cmake_minimum_required(VERSION 3.18.2) - - # Global properties - set_property(GLOBAL PROPERTY USE_FOLDERS ON) -@@ -17,49 +17,36 @@ if(DOXYGEN_FOUND) +@@ -17,49 +17,37 @@ if(DOXYGEN_FOUND) endif() endif() @@ -23,6 +17,7 @@ index aa5447a8..10a0065b 100644 - # External packages find_package(Threads REQUIRED) ++find_package(fmt REQUIRED) if(UNIX AND NOT APPLE AND NOT MSYS) find_package(LibBFD) find_package(LibDL) @@ -46,7 +41,7 @@ index aa5447a8..10a0065b 100644 list(APPEND LINKLIBS ${LIBDL_LIBRARIES}) list(APPEND LINKLIBS ${LIBRT_LIBRARIES}) - list(APPEND LINKLIBS ${LIBUUID_LIBRARIES}) -+ list(APPEND LINKLIBS CONAN_PKG::libuuid) ++ list(APPEND LINKLIBS libuuid::libuuid) endif() if(WIN32 OR MSYS) list(APPEND LINKLIBS ${DBGHELP_LIBRARIES}) @@ -62,7 +57,7 @@ index aa5447a8..10a0065b 100644 include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/plugins") # Library -@@ -68,8 +55,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") +@@ -68,8 +56,9 @@ file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") file(GLOB_RECURSE LIB_SOURCE_FILES "include/*.cpp" "source/*.cpp") add_library(cppcommon ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) set_target_properties(cppcommon PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") @@ -70,11 +65,11 @@ index aa5447a8..10a0065b 100644 -target_link_libraries(cppcommon ${LINKLIBS} fmt) +target_include_directories(cppcommon PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") +target_compile_features(cppcommon PUBLIC cxx_std_17) -+target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) ++target_link_libraries(cppcommon PUBLIC ${LINKLIBS} fmt::fmt) list(APPEND INSTALL_TARGETS cppcommon) list(APPEND LINKLIBS cppcommon) -@@ -92,6 +80,7 @@ if(NOT CPPCOMMON_MODULE) +@@ -92,6 +81,7 @@ if(NOT CPPCOMMON_MODULE) endforeach() # Examples @@ -82,7 +77,7 @@ index aa5447a8..10a0065b 100644 file(GLOB EXAMPLE_HEADER_FILES "examples/*.h") file(GLOB EXAMPLE_INLINE_FILES "examples/*.inl") file(GLOB EXAMPLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/examples" "examples/*.cpp") -@@ -105,8 +94,10 @@ if(NOT CPPCOMMON_MODULE) +@@ -105,8 +95,10 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) endforeach() @@ -93,7 +88,7 @@ index aa5447a8..10a0065b 100644 file(GLOB BENCHMARK_HEADER_FILES "performance/*.h") file(GLOB BENCHMARK_INLINE_FILES "performance/*.inl") file(GLOB BENCHMARK_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/performance" "performance/*.cpp") -@@ -120,8 +111,10 @@ if(NOT CPPCOMMON_MODULE) +@@ -120,8 +112,10 @@ if(NOT CPPCOMMON_MODULE) list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) endforeach() @@ -104,7 +99,7 @@ index aa5447a8..10a0065b 100644 file(GLOB TESTS_HEADER_FILES "tests/*.h") file(GLOB TESTS_INLINE_FILES "tests/*.inl") file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") -@@ -132,19 +125,22 @@ if(NOT CPPCOMMON_MODULE) +@@ -132,19 +126,22 @@ if(NOT CPPCOMMON_MODULE) target_link_libraries(cppcommon-tests ${LINKLIBS}) list(APPEND INSTALL_TARGETS cppcommon-tests) list(APPEND INSTALL_TARGETS_PDB cppcommon-tests) diff --git a/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-1-0.patch b/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-1-0.patch index 3b9099c8f0c45..b85cb3d5f9ed0 100644 --- a/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-1-0.patch +++ b/recipes/cppcommon/all/patches/0003-define-win32-winnt-1-0-1-0.patch @@ -17,7 +17,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 10a0065b..2ed1668c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -61,6 +61,10 @@ target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) +@@ -62,6 +62,10 @@ target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) list(APPEND INSTALL_TARGETS cppcommon) list(APPEND LINKLIBS cppcommon) diff --git a/recipes/cppcommon/all/patches/0003-define-win32-winnt-cci-20201104.patch b/recipes/cppcommon/all/patches/0003-define-win32-winnt-cci-20201104.patch index 83c8b1f1eb2c9..61af4f0ef8364 100644 --- a/recipes/cppcommon/all/patches/0003-define-win32-winnt-cci-20201104.patch +++ b/recipes/cppcommon/all/patches/0003-define-win32-winnt-cci-20201104.patch @@ -4,11 +4,13 @@ https://github.com/chronoxor/CppCMakeScripts/blob/1.0.0.0/SetPlatformFeatures.cm Even if it sets _WIN32_WINNT to _WIN32_WINNT_WIN10, here a less strict definiton is chosen (_WIN32_WINNT_VISTA). +--- + diff --git a/CMakeLists.txt b/CMakeLists.txt -index ad3d53aa8..d4dcbf8b5 100644 +index 160fc09..5eeddd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -74,6 +74,10 @@ target_link_libraries(cppcommon PUBLIC ${LINKLIBS} CONAN_PKG::fmt) +@@ -75,6 +75,10 @@ target_link_libraries(cppcommon PUBLIC ${LINKLIBS} fmt::fmt) list(APPEND INSTALL_TARGETS cppcommon) list(APPEND LINKLIBS cppcommon) @@ -18,4 +20,4 @@ index ad3d53aa8..d4dcbf8b5 100644 + # Additional module components: benchmarks, examples, plugins, tests, tools and install if(NOT CPPCOMMON_MODULE) - + diff --git a/recipes/cppcommon/all/patches/0004-include-cstdint-1-0-0.patch b/recipes/cppcommon/all/patches/0004-include-cstdint-1-0-0.patch new file mode 100644 index 0000000000000..ac9007806f716 --- /dev/null +++ b/recipes/cppcommon/all/patches/0004-include-cstdint-1-0-0.patch @@ -0,0 +1,49 @@ +diff --git a/include/common/reader.h b/include/common/reader.h +index b3bba38..39f1f87 100644 +--- a/include/common/reader.h ++++ b/include/common/reader.h +@@ -11,6 +11,7 @@ + + #include + #include ++#include + + namespace CppCommon { + +diff --git a/include/string/string_utils.inl b/include/string/string_utils.inl +index 1315e63..1a225c8 100644 +--- a/include/string/string_utils.inl ++++ b/include/string/string_utils.inl +@@ -6,6 +6,8 @@ + \copyright MIT License + */ + ++#include ++ + namespace CppCommon { + + inline bool StringUtils::IsBlank(char ch) +diff --git a/include/system/uuid.h b/include/system/uuid.h +index bc3c2ea..cf768ea 100644 +--- a/include/system/uuid.h ++++ b/include/system/uuid.h +@@ -13,6 +13,7 @@ + + #include + #include ++#include + + namespace CppCommon { + +diff --git a/source/string/encoding.cpp b/source/string/encoding.cpp +index 5a0e633..65dc7e6 100644 +--- a/source/string/encoding.cpp ++++ b/source/string/encoding.cpp +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + namespace CppCommon { + diff --git a/recipes/cppcommon/all/patches/0005-include-mutex-1-0-0.patch b/recipes/cppcommon/all/patches/0005-include-mutex-1-0-0.patch new file mode 100644 index 0000000000000..bca5eaf100bb2 --- /dev/null +++ b/recipes/cppcommon/all/patches/0005-include-mutex-1-0-0.patch @@ -0,0 +1,12 @@ +diff --git a/source/cache/filecache.cpp b/source/cache/filecache.cpp +index 0c22f50..2bfb3a1 100644 +--- a/source/cache/filecache.cpp ++++ b/source/cache/filecache.cpp +@@ -7,6 +7,7 @@ + */ + + #include "cache/filecache.h" ++#include + + namespace CppCommon { + diff --git a/recipes/cppcommon/all/test_package/CMakeLists.txt b/recipes/cppcommon/all/test_package/CMakeLists.txt index ba1e21ea8636c..0c4ae375149ae 100644 --- a/recipes/cppcommon/all/test_package/CMakeLists.txt +++ b/recipes/cppcommon/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(cppcommon REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -conan_target_link_libraries(${PROJECT_NAME}) - +target_link_libraries(${PROJECT_NAME} PRIVATE cppcommon::cppcommon) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) diff --git a/recipes/cppcommon/all/test_package/conanfile.py b/recipes/cppcommon/all/test_package/conanfile.py index 4903f1a7e8fa0..ef5d7042163ec 100644 --- a/recipes/cppcommon/all/test_package/conanfile.py +++ b/recipes/cppcommon/all/test_package/conanfile.py @@ -1,9 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cppcommon/config.yml b/recipes/cppcommon/config.yml index 17d2cd502269e..ee34523110204 100644 --- a/recipes/cppcommon/config.yml +++ b/recipes/cppcommon/config.yml @@ -1,11 +1,11 @@ versions: - "1.0.0.0": + "1.0.3.0": folder: all - "cci.20201104": + "1.0.2.0": folder: all "1.0.1.0": folder: all - "1.0.2.0": + "1.0.0.0": folder: all - "1.0.3.0": + "cci.20201104": folder: all diff --git a/recipes/cpprestsdk/all/conanfile.py b/recipes/cpprestsdk/all/conanfile.py index 467c812235f66..9f8dbc8d6fec8 100644 --- a/recipes/cpprestsdk/all/conanfile.py +++ b/recipes/cpprestsdk/all/conanfile.py @@ -1,6 +1,9 @@ from conan import ConanFile -from conan.tools import files from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import ( + apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, + replace_in_file, rmdir +) import os required_conan_version = ">=1.53.0" @@ -12,9 +15,9 @@ class CppRestSDKConan(ConanFile): "C++ API design" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Microsoft/cpprestsdk" - topics = ("cpprestsdk", "rest", "client", "http", "https") + topics = ("rest", "client", "http", "https") license = "MIT" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,7 +39,7 @@ class CppRestSDKConan(ConanFile): } def export_sources(self): - files.export_conandata_patches(self) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -50,23 +53,19 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): - self.requires("boost/1.80.0") - self.requires("openssl/1.1.1s") + self.requires("boost/1.81.0") + self.requires("openssl/[>=1.1 <4]") if self.options.with_compression: self.requires("zlib/1.2.13") if self.options.with_websockets: self.requires("websocketpp/0.8.2") - def package_id(self): - self.info.requires["boost"].minor_mode() - - def layout(self): - cmake_layout(self, src_folder="src") - def source(self): - files.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) @@ -90,22 +89,22 @@ def generate(self): def _patch_clang_libcxx(self): if self.settings.compiler == 'clang' and str(self.settings.compiler.libcxx) in ['libstdc++', 'libstdc++11']: - files.replace_in_file(self, os.path.join(self.source_folder, 'Release', 'CMakeLists.txt'), + replace_in_file(self, os.path.join(self.source_folder, 'Release', 'CMakeLists.txt'), 'libc++', 'libstdc++') def build(self): - files.apply_conandata_patches(self) + apply_conandata_patches(self) self._patch_clang_libcxx() cmake = CMake(self) cmake.configure() cmake.build() def package(self): - files.copy(self, "license.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "license.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() - files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - files.rmdir(self, os.path.join(self.package_folder, "lib", "cpprestsdk")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cpprestsdk")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "cpprestsdk") @@ -120,7 +119,7 @@ def package_info(self): self.cpp_info.components["cpprestsdk_openssl_internal"].requires = ["openssl::openssl"] # cpprest self.cpp_info.components["cpprest"].set_property("cmake_target_name", "cpprestsdk::cpprest") - self.cpp_info.components["cpprest"].libs = files.collect_libs(self) + self.cpp_info.components["cpprest"].libs = collect_libs(self) self.cpp_info.components["cpprest"].requires = ["cpprestsdk_boost_internal", "cpprestsdk_openssl_internal"] if self.settings.os == "Linux": self.cpp_info.components["cpprest"].system_libs.append("pthread") diff --git a/recipes/cpprestsdk/all/test_package/CMakeLists.txt b/recipes/cpprestsdk/all/test_package/CMakeLists.txt index b305f36beee8f..c83f3ebd18fed 100644 --- a/recipes/cpprestsdk/all/test_package/CMakeLists.txt +++ b/recipes/cpprestsdk/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(cpprestsdk REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} cpprestsdk::cpprest) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE cpprestsdk::cpprest) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cpputest/all/test_package/CMakeLists.txt b/recipes/cpputest/all/test_package/CMakeLists.txt index be713b804677f..d28cda840f45c 100644 --- a/recipes/cpputest/all/test_package/CMakeLists.txt +++ b/recipes/cpputest/all/test_package/CMakeLists.txt @@ -5,8 +5,5 @@ find_package(CppUTest REQUIRED CONFIG) add_executable(test_package test_package.cpp) target_link_libraries(test_package PRIVATE CppUTest) +target_compile_definitions(test_package PRIVATE $<$:WITH_EXTENSIONS>) -if(WITH_EXTENSIONS) - add_executable(test_package_with_extensions test_package_with_extensions.cpp) - target_link_libraries(test_package_with_extensions PRIVATE CppUTestExt) -endif() diff --git a/recipes/cpputest/all/test_package/conanfile.py b/recipes/cpputest/all/test_package/conanfile.py index f422d1c08f29f..c743b7456a139 100644 --- a/recipes/cpputest/all/test_package/conanfile.py +++ b/recipes/cpputest/all/test_package/conanfile.py @@ -17,7 +17,7 @@ def requirements(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["WITH_EXTENSIONS"] = self.dependencies["cpputest"].options.with_extensions + tc.cache_variables["WITH_EXTENSIONS"] = self.dependencies["cpputest"].options.with_extensions tc.generate() def build(self): @@ -29,6 +29,3 @@ 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") - if self.options["cpputest"].with_extensions: - bin_extensions_path = os.path.join(self.cpp.build.bindirs[0], "test_package_with_extensions") - self.run(bin_extensions_path, env="conanrun") diff --git a/recipes/cpputest/all/test_package/test_package.cpp b/recipes/cpputest/all/test_package/test_package.cpp index 2675c3b7d443a..4ba22fc9a1637 100644 --- a/recipes/cpputest/all/test_package/test_package.cpp +++ b/recipes/cpputest/all/test_package/test_package.cpp @@ -1,6 +1,9 @@ #include #include #include +#if defined(WITH_EXTENSIONS) +#include // Only found if extensions enabled +#endif TEST_GROUP(FirstTestGroup) { diff --git a/recipes/cpputest/all/test_package/test_package_with_extensions.cpp b/recipes/cpputest/all/test_package/test_package_with_extensions.cpp deleted file mode 100644 index df94dae2d50a1..0000000000000 --- a/recipes/cpputest/all/test_package/test_package_with_extensions.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include -#include -#include // Only found if extensions enabled - -TEST_GROUP(FirstTestGroup) -{ -}; - -TEST(FirstTestGroup, FirstTest) -{ - CHECK_TRUE(true); -} - -int main(int argc, const char** argv) -{ - CommandLineTestRunner runner(argc, argv, TestRegistry::getCurrentRegistry()); - return runner.runAllTestsMain(); -} diff --git a/recipes/cpputest/all/test_v1_package/conanfile.py b/recipes/cpputest/all/test_v1_package/conanfile.py index cce86300f1595..32e223569cdb0 100644 --- a/recipes/cpputest/all/test_v1_package/conanfile.py +++ b/recipes/cpputest/all/test_v1_package/conanfile.py @@ -16,6 +16,3 @@ 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 self.options["cpputest"].with_extensions: - bin_extensions_path = os.path.join("bin", "test_package_with_extensions") - self.run(bin_extensions_path, run_environment=True) diff --git a/recipes/cppzmq/all/conandata.yml b/recipes/cppzmq/all/conandata.yml index 263917af47c65..4bfaa1bc9f316 100644 --- a/recipes/cppzmq/all/conandata.yml +++ b/recipes/cppzmq/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.10.0": + url: "https://github.com/zeromq/cppzmq/archive/refs/tags/v4.10.0.tar.gz" + sha256: "c81c81bba8a7644c84932225f018b5088743a22999c6d82a2b5f5cd1e6942b74" "4.9.0": url: "https://github.com/zeromq/cppzmq/archive/v4.9.0.tar.gz" sha256: "3fdf5b100206953f674c94d40599bdb3ea255244dcc42fab0d75855ee3645581" diff --git a/recipes/cppzmq/config.yml b/recipes/cppzmq/config.yml index a52b8593d6634..e5b938c02e62a 100644 --- a/recipes/cppzmq/config.yml +++ b/recipes/cppzmq/config.yml @@ -1,4 +1,6 @@ versions: + "4.10.0": + folder: all "4.9.0": folder: all "4.8.1": diff --git a/recipes/cpr/all/conandata.yml b/recipes/cpr/all/conandata.yml index 4be23150be0d1..21c7cc656ba73 100644 --- a/recipes/cpr/all/conandata.yml +++ b/recipes/cpr/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.10.4": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.10.3.tar.gz" + sha256: "7b9d3504ffdaf7ce3189f1b91d135888776b6a1b26ea1bf2c3c4986b8a5af06f" "1.10.1": url: "https://github.com/libcpr/cpr/archive/refs/tags/1.10.1.tar.gz" sha256: "dc22ab9d34e6013e024e2c4a64e665b126573c0f125f0e02e6a7291cb7e04c4b" @@ -27,6 +30,10 @@ sources: url: "https://github.com/libcpr/cpr/archive/1.4.0.tar.gz" sha256: "13baffba95445e02291684e31906b04df41d8c6a3020a1a55253047c6756a004" patches: + "1.10.4": + - patch_file: "patches/008-1.10.0-remove-warning-flags.patch" + patch_description: "disable warning flags and warning as error" + patch_type: "portability" "1.10.1": - patch_file: "patches/008-1.10.0-remove-warning-flags.patch" patch_description: "disable warning flags and warning as error" diff --git a/recipes/cpr/all/conanfile.py b/recipes/cpr/all/conanfile.py index f9ec63a80be5a..811d7ddeeebd7 100644 --- a/recipes/cpr/all/conanfile.py +++ b/recipes/cpr/all/conanfile.py @@ -123,7 +123,12 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libcurl/7.87.0", transitive_headers=True, transitive_libs=True) + self.requires("libcurl/8.0.1", transitive_headers=True, transitive_libs=True) + # FIXME: This is a very dirty hack. + # with_ssl == _AUTO_SSL, cpr needs the openssl header to compile. But Conan recipe does not know which SSL library to use. + # because cpr's CMakeLists.txt automatically detects SSL libraries with CPR_ENABLE_SSL == ON. + if self.settings.os in ["Linux", "FreeBSD"] and self.options.with_ssl in ["openssl", CprConan._AUTO_SSL]: + self.requires("openssl/[>=1.1 <4]") # Check if the system supports the given ssl library def _supports_ssl_library(self, library): diff --git a/recipes/cpr/config.yml b/recipes/cpr/config.yml index 51dcfd080e779..66e2467c8e531 100644 --- a/recipes/cpr/config.yml +++ b/recipes/cpr/config.yml @@ -1,4 +1,6 @@ versions: + "1.10.4": + folder: all "1.10.1": folder: all "1.10.0": diff --git a/recipes/create-dmg/all/conanfile.py b/recipes/create-dmg/all/conanfile.py index 52e6fe840c8e2..5730582863e8c 100644 --- a/recipes/create-dmg/all/conanfile.py +++ b/recipes/create-dmg/all/conanfile.py @@ -39,7 +39,7 @@ def build(self): def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) copy(self, pattern="create-dmg", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder) - copy(self, pattern="*", dst=os.path.join(self.package_folder, "res", "create-dmg", "support"), src=os.path.join(self.source_folder, "support")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "res"), src=os.path.join(self.source_folder, "support")) rmdir(self, os.path.join(self.package_folder, "share")) diff --git a/recipes/croncpp/all/CMakeLists.txt b/recipes/croncpp/all/CMakeLists.txt deleted file mode 100644 index 46247ce0c956e..0000000000000 --- a/recipes/croncpp/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(conan_wrapper CXX) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(CMAKE_CXX_STANDARD 11) - -add_subdirectory(source_subfolder) diff --git a/recipes/croncpp/all/conanfile.py b/recipes/croncpp/all/conanfile.py index cecf595a5a249..ffab100ea6a29 100644 --- a/recipes/croncpp/all/conanfile.py +++ b/recipes/croncpp/all/conanfile.py @@ -1,45 +1,57 @@ import os -import functools -from conans import ConanFile, CMake, tools -required_conan_version = ">=1.33.0" +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 copy, get, rmdir + +required_conan_version = ">=1.52.0" + class CroncppConan(ConanFile): name = "croncpp" description = "A C++11/14/17 header-only cross-platform library for handling CRON expressions" - topics = ("cron", "header-only") license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mariusbancila/croncpp/" + topics = ("cron", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - generators = "cmake", + no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 - def export_sources(self): - self.copy("CMakeLists.txt") + def layout(self): + cmake_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): cmake = CMake(self) cmake.configure() - return cmake + cmake.build() def package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - 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.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/croncpp/all/test_package/CMakeLists.txt b/recipes/croncpp/all/test_package/CMakeLists.txt index 1bb4c146bf257..0377a66e57597 100644 --- a/recipes/croncpp/all/test_package/CMakeLists.txt +++ b/recipes/croncpp/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(croncpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/croncpp/all/test_package/conanfile.py b/recipes/croncpp/all/test_package/conanfile.py index 6cae150e6701a..fae501d0afb9e 100644 --- a/recipes/croncpp/all/test_package/conanfile.py +++ b/recipes/croncpp/all/test_package/conanfile.py @@ -1,9 +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 CroncppConan(ConanFile): + +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ctml/all/conanfile.py b/recipes/ctml/all/conanfile.py index b5c3dd7c38f7d..bb07e06f8fb0b 100644 --- a/recipes/ctml/all/conanfile.py +++ b/recipes/ctml/all/conanfile.py @@ -1,7 +1,12 @@ import os -from conans import ConanFile, tools -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class CtmlLibrariesConan(ConanFile): name = "ctml" @@ -9,33 +14,41 @@ class CtmlLibrariesConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/tinfoilboy/CTML" - topics = ("generator", "html", ) - settings = "os", "arch", "compiler", "build_type", - generators = "cmake", + topics = ("generator", "html", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - self.copy("ctml.hpp", "include", os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "ctml.hpp", + 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", "CTML") self.cpp_info.set_property("cmake_target_name", "CTML::CTML") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "CTML" self.cpp_info.filenames["cmake_find_package_multi"] = "CTML" self.cpp_info.names["cmake_find_package"] = "CTML" diff --git a/recipes/ctml/all/test_package/CMakeLists.txt b/recipes/ctml/all/test_package/CMakeLists.txt index 1df60de830867..d4e16fb2704c6 100644 --- a/recipes/ctml/all/test_package/CMakeLists.txt +++ b/recipes/ctml/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(CTML CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/ctml/all/test_package/conanfile.py b/recipes/ctml/all/test_package/conanfile.py index 270a1ae971491..fae501d0afb9e 100644 --- a/recipes/ctml/all/test_package/conanfile.py +++ b/recipes/ctml/all/test_package/conanfile.py @@ -1,9 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class TestWrapperConan(ConanFile): + +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cub/all/conandata.yml b/recipes/cub/all/conandata.yml new file mode 100644 index 0000000000000..b266ef302799f --- /dev/null +++ b/recipes/cub/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.17.2": + url: "https://github.com/NVIDIA/cub/archive/refs/tags/1.17.2.tar.gz" + sha256: "1013a595794548c359f22c07e1f8c620b97e3a577f7e8496d9407f74566a3e2a" diff --git a/recipes/cub/all/conanfile.py b/recipes/cub/all/conanfile.py new file mode 100644 index 0000000000000..2cde129243380 --- /dev/null +++ b/recipes/cub/all/conanfile.py @@ -0,0 +1,85 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class CubConan(ConanFile): + name = "cub" + description = "Cooperative primitives for CUDA C++" + license = "BSD 3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/project/cub" + topics = ("algorithms", "cuda", "gpu", "nvidia", "nvidia-hpc-sdk") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "14.1", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1", + } + + 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.TXT", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + copy( + self, + pattern="*.cuh", + dst=os.path.join(self.package_folder, "include", "cub"), + src=os.path.join(self.source_folder, "cub"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # Follows the naming conventions of the official CMake config file: + # https://github.com/NVIDIA/cub/blob/main/cub/cmake/cub-config.cmake + + self.cpp_info.set_property("cmake_file_name", "cub") + self.cpp_info.set_property("cmake_target_name", "CUB::CUB") + self.cpp_info.set_property("pkg_config_name", "cub") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "cub" + self.cpp_info.filenames["cmake_find_package_multi"] = "cub" + self.cpp_info.names["cmake_find_package"] = "CUB" + self.cpp_info.names["cmake_find_package_multi"] = "CUB" diff --git a/recipes/cub/all/test_package/CMakeLists.txt b/recipes/cub/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..da40597464dd4 --- /dev/null +++ b/recipes/cub/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cub REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE CUB::CUB) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cub/all/test_package/conanfile.py b/recipes/cub/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/cub/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cub/all/test_package/test_package.cpp b/recipes/cub/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..60b6a6e4b6475 --- /dev/null +++ b/recipes/cub/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include +#include + +int main() { + std::cout << "CUB version: " << + CUB_MAJOR_VERSION << "." << CUB_MINOR_VERSION << "." << CUB_SUBMINOR_VERSION << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/cub/config.yml b/recipes/cub/config.yml new file mode 100644 index 0000000000000..bcae7d8610bb8 --- /dev/null +++ b/recipes/cub/config.yml @@ -0,0 +1,3 @@ +versions: + "1.17.2": + folder: all diff --git a/recipes/cunit/all/conandata.yml b/recipes/cunit/all/conandata.yml index dc0e653a838f3..ab63da567e039 100644 --- a/recipes/cunit/all/conandata.yml +++ b/recipes/cunit/all/conandata.yml @@ -5,6 +5,11 @@ sources: patches: "2.1-3": - patch_file: "patches/0001-configure-in-msvc-shortcuts.patch" - base_path: "source_subfolder" + patch_description: "configure snprintf for msvc" + patch_type: "conan" - patch_file: "patches/0002-snprintf-msvc.patch" - base_path: "source_subfolder" + patch_description: "only set snprintf for older VS compiler" + patch_type: "conan" + - patch_file: "patches/0003-fix-copy-docs.patch" + patch_description: "use correct docs dir for install docs" + patch_type: "conan" diff --git a/recipes/cunit/all/conanfile.py b/recipes/cunit/all/conanfile.py index a7c3f16aa1cdc..ee93d94bc50b0 100644 --- a/recipes/cunit/all/conanfile.py +++ b/recipes/cunit/all/conanfile.py @@ -1,9 +1,16 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from contextlib import contextmanager +from pathlib import Path + +from conan import ConanFile +from conan.tools.microsoft import is_msvc, unix_path, check_min_vs +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, chdir, rename, rm +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.env import VirtualBuildEnv +from conan.errors import ConanInvalidConfiguration import glob import os +from conan.tools.layout import basic_layout -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.57.0" class CunitConan(ConanFile): @@ -13,7 +20,7 @@ class CunitConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "http://cunit.sourceforge.net/" license = "BSD-3-Clause" - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -30,116 +37,112 @@ class CunitConan(ConanFile): "enable_console": True, "with_curses": False, } - exports_sources = "patches/**" - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_curses == "ncurses": - self.requires("ncurses/6.2") + self.requires("ncurses/6.4") + + def validate(self): + if self.options.shared and not self.options.with_curses: + # For shared builds we always need to depend on ncurses, since otherwise we get undefined + # symbols, like: + # /usr/bin/ld: package/9333ccd2ec7e28099e1c04b315e2384b012b7a19/lib/libcunit.so: undefined reference to `echo' + # /usr/bin/ld: package/9333ccd2ec7e28099e1c04b315e2384b012b7a19/lib/libcunit.so: undefined reference to `wattr_on' + # /usr/bin/ld: package/9333ccd2ec7e28099e1c04b315e2384b012b7a19/lib/libcunit.so: undefined reference to `acs_map' + # /usr/bin/ld: package/9333ccd2ec7e28099e1c04b315e2384b012b7a19/lib/libcunit.so: undefined reference to `cbreak' + raise ConanInvalidConfiguration("cunit package is built with shared, which requires " + "cunit:with_curses=ncurses option") @property def _settings_build(self): return getattr(self, "settings_build", self.settings) def build_requirements(self): - self.build_requires("libtool/2.4.6") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - with tools.chdir(self._source_subfolder): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + with chdir(self, self.source_folder): for f in glob.glob("*.c"): os.chmod(f, 0o644) - @property - def _user_info_build(self): - return getattr(self, "user_info_build", self.deps_user_info) - - @contextmanager - def _build_context(self): - env = {} - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - env.update({ - "AR": "{} lib".format(tools.unix_path(self._user_info_build["automake"].ar_lib)), - "CC": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - "CXX": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - "NM": "dumpbin -symbols", - "OBJDUMP": ":", - "RANLIB": ":", - "STRIP": ":", - }) - with tools.environment_append(env): - yield - else: - with tools.environment_append(env): - yield - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.libs = [] - host, build = None, None - if self.settings.compiler == "Visual Studio": - self._autotools.flags.append("-FS") - # MSVC canonical names aren't understood - host, build = False, False - conf_args = [ - "--datarootdir={}".format(os.path.join(self.package_folder, "bin", "share").replace("\\", "/")), - "--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug", - "--enable-automated" if self.options.enable_automated else "--disable-automated", - "--enable-basic" if self.options.enable_basic else "--disable-basic", - "--enable-console" if self.options.enable_console else "--disable-console", - "--enable-curses" if self.options.with_curses != False else "--disable-curses", - ] - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - self._autotools.configure(args=conf_args, host=host, build=build) - return self._autotools + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.configure_args.append("--datarootdir=${prefix}/bin/share") + tc.configure_args.append("--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug") + tc.configure_args.append("--enable-automated" if self.options.enable_automated else "--disable-automated") + tc.configure_args.append("--enable-basic" if self.options.enable_basic else "--disable-basic") + tc.configure_args.append("--enable-console" if self.options.enable_console else "--disable-console") + tc.configure_args.append("--disable-curses" if not self.options.with_curses else + "--enable-curses") + + env = tc.environment() + + if is_msvc(self): + automake_info = self.dependencies.build["automake"].conf_info + env.append("CC", f'{unix_path(self, automake_info.get("user.automake:compile-wrapper", check_type=str))} cl -nologo') + env.append("CXX", f'{unix_path(self, automake_info.get("user.automake:compile-wrapper", check_type=str))} cl -nologo') + env.append("AR", f'{unix_path(self, automake_info.get("user.automake:lib-wrapper", check_type=str))} lib') + env.define("LD", "link -nologo") + env.append("NM", "dumpbin -symbols") + env.append("OBJDUMP", ":") + env.append("RANLIB", ":") + env.append("STRIP", ":") + tc.generate(env) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with self._build_context(): - with tools.chdir(self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) - autotools = self._configure_autotools() - autotools.make() + apply_conandata_patches(self) + + # Clean up makefiles from source folder + os.unlink(Path(self.source_folder) / "config.status") + os.unlink(Path(self.source_folder) / "config.log") + os.unlink(Path(self.source_folder) / "Makefile") + + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - with tools.chdir(self._source_subfolder): - autotools = self._configure_autotools() - autotools.install() - - if self.settings.compiler == "Visual Studio" and self.options.shared: - tools.rename(os.path.join(self.package_folder, "lib", "cunit.dll.lib"), - os.path.join(self.package_folder, "lib", "cunit.lib")) - - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "bin", "share", "man")) - tools.rmdir(os.path.join(self.package_folder, "doc")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + + autotools = Autotools(self) + autotools.install() + + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "cunit.dll.lib"), + os.path.join(self.package_folder, "lib", "cunit.lib")) + + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "bin", "share", "man")) + rmdir(self, os.path.join(self.package_folder, "doc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.names["cmake_find_package"] = "CUnit" diff --git a/recipes/cunit/all/patches/0001-configure-in-msvc-shortcuts.patch b/recipes/cunit/all/patches/0001-configure-in-msvc-shortcuts.patch index f934c96f0e8b0..60ee6889637dd 100644 --- a/recipes/cunit/all/patches/0001-configure-in-msvc-shortcuts.patch +++ b/recipes/cunit/all/patches/0001-configure-in-msvc-shortcuts.patch @@ -1,22 +1,39 @@ --- configure.in +++ configure.in -@@ -26,7 +26,7 @@ - +@@ -2,6 +2,7 @@ + + AC_INIT(CUnit, 2.1-3) + AM_INIT_AUTOMAKE(CUnit, 2.1-3) ++LT_INIT + + dnl Package version information + PACKAGE=CUnit +@@ -26,7 +27,7 @@ + TOPDIR=`pwd` - + -CFLAGS="$CFLAGS -DRELEASE=@RELEASE@ -Wall -W -pedantic -Wshadow -ansi -I${PWD}/CUnit/Headers -std=c99" +CFLAGS="$CFLAGS -DRELEASE=@RELEASE@ -pedantic -ansi -I${PWD}/CUnit/Headers -std=c99" LDFLAGS="$LDFLAGS -L${PWD}/CUnit/Sources" - + AC_ARG_ENABLE(debug, -@@ -186,13 +186,13 @@ +@@ -158,7 +159,7 @@ + AC_PROG_CC + AC_PROG_INSTALL + AC_PROG_MAKE_SET +-AC_PROG_LIBTOOL ++#AC_PROG_LIBTOOL + + dnl Check for libraries + AC_CHECK_LIB(c, main) +@@ -186,13 +187,13 @@ AC_CHECK_FUNC(calloc, [], [echo calloc not found; exit 1]) AC_CHECK_FUNC(realloc, [], [echo realloc not found; exit 1]) - + -AC_CHECK_FUNC(strcpy, [], [echo strcpy not found; exit 1]) +dnl AC_CHECK_FUNC(strcpy, [], [echo strcpy not found; exit 1]) AC_CHECK_FUNC(strerror, [], [echo strerror not found; exit 1]) - + AC_CHECK_FUNC(fopen, [], [echo fopen not found; exit 1]) AC_CHECK_FUNC(fclose, [], [echo fclose not found; exit 1]) -AC_CHECK_FUNC(fprintf, [], [echo fprintf not found; exit 1]) @@ -24,7 +41,7 @@ +dnl AC_CHECK_FUNC(fprintf, [], [echo fprintf not found; exit 1]) +dnl AC_CHECK_FUNC(snprintf, [], [echo snprintf not found; exit 1]) AC_CHECK_FUNC(setvbuf, [], [echo setvbuf not found; exit 1]) - + AC_CHECK_FUNC(time, [], [echo time not found; exit 1]) --- CUnit/Sources/Makefile.am +++ CUnit/Sources/Makefile.am diff --git a/recipes/cunit/all/patches/0003-fix-copy-docs.patch b/recipes/cunit/all/patches/0003-fix-copy-docs.patch new file mode 100644 index 0000000000000..6dc9a36c9301d --- /dev/null +++ b/recipes/cunit/all/patches/0003-fix-copy-docs.patch @@ -0,0 +1,9 @@ +--- doc/headers/Makefile.am ++++ doc/headers/Makefile.am +@@ -23,5 +23,6 @@ + + copy_headers: + cp -f $(top_srcdir)/CUnit/Headers/*.h . ++ cp -f $(top_builddir)/CUnit/Headers/*.h . + cp -f $(top_srcdir)/CUnit/Sources/Win/Win.h . + diff --git a/recipes/cunit/all/test_package/CMakeLists.txt b/recipes/cunit/all/test_package/CMakeLists.txt index 34af13462f44f..b32c10a586ed8 100644 --- a/recipes/cunit/all/test_package/CMakeLists.txt +++ b/recipes/cunit/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(cunit CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} cunit::cunit) diff --git a/recipes/cunit/all/test_package/conanfile.py b/recipes/cunit/all/test_package/conanfile.py index d4128b0450777..7c46f27b018cf 100644 --- a/recipes/cunit/all/test_package/conanfile.py +++ b/recipes/cunit/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cute_headers/all/conanfile.py b/recipes/cute_headers/all/conanfile.py index 2aeb5719c6df9..5845ff0bcc925 100644 --- a/recipes/cute_headers/all/conanfile.py +++ b/recipes/cute_headers/all/conanfile.py @@ -1,39 +1,46 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import get, copy, load, save +from conan.tools.layout import basic_layout import os -import glob + + +required_conan_version = ">=1.52.0" class CuteHeadersConan(ConanFile): name = "cute_headers" description = "Various single-file cross-platform C/C++ headers implementing self-contained libraries." - topics = ("conan", "various", "pure-c") + topics = ("various", "pure-c") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/RandyGaul/cute_headers" license = "Unlicense" + package_type = "header-library" no_copy_source = True def _extract_license(self): - file = os.path.join(self.package_folder, "include/cute_math2d.h") - file_content = tools.load(file) + file = os.path.join(self.package_folder, "include", "cute_math2d.h") + file_content = load(self, file) return file_content[file_content.rfind('/*'):] - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob(self.name + "-*/")[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy( + copy( + self, pattern="*.h", - dst="include", - src=self._source_subfolder, + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, excludes=("examples_cute_*", "test_cute_*") ) - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) def package_id(self): - self.info.header_only() + self.info.clear() + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cute_headers/all/test_package/CMakeLists.txt b/recipes/cute_headers/all/test_package/CMakeLists.txt index b9be759ce7016..766b80640f9c1 100644 --- a/recipes/cute_headers/all/test_package/CMakeLists.txt +++ b/recipes/cute_headers/all/test_package/CMakeLists.txt @@ -1,11 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(cute_headers REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries( - ${PROJECT_NAME} - ${CONAN_LIBS} -) +target_link_libraries(${PROJECT_NAME} PRIVATE cute_headers::cute_headers) diff --git a/recipes/cute_headers/all/test_package/conanfile.py b/recipes/cute_headers/all/test_package/conanfile.py index b63178709d69f..9be22ab3d97f8 100644 --- a/recipes/cute_headers/all/test_package/conanfile.py +++ b/recipes/cute_headers/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + 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,5 +21,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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cvplot/all/conanfile.py b/recipes/cvplot/all/conanfile.py index 49ceaeafa285e..4984563ed0526 100644 --- a/recipes/cvplot/all/conanfile.py +++ b/recipes/cvplot/all/conanfile.py @@ -1,35 +1,59 @@ -from conans import ConanFile, tools import os -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class CvPlotConan(ConanFile): name = "cvplot" - description = "fast modular opencv plotting library" + description = "Fast modular OpenCV plotting library" license = "MIT" - topics = ("plot", "opencv", "diagram", "plotting") - homepage = "https://github.com/Profactor/cv-plot" url = "https://github.com/conan-io/conan-center-index" - requires = "opencv/4.5.3" + homepage = "https://github.com/Profactor/cv-plot" + topics = ("plot", "opencv", "diagram", "plotting", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("opencv/4.5.5") + + def package_id(self): + self.info.clear() 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="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "CvPlot", "inc")) - - 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, "CvPlot", "inc"), + ) + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "CvPlot") + self.cpp_info.set_property("cmake_target_name", "CvPlot::CvPlot") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.defines.append("CVPLOT_HEADER_ONLY") - self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.names["cmake_find_package"] = "CvPlot" self.cpp_info.names["cmake_find_package_multi"] = "CvPlot" diff --git a/recipes/cvplot/all/test_package/CMakeLists.txt b/recipes/cvplot/all/test_package/CMakeLists.txt index b75c35da97dea..209693284dcea 100644 --- a/recipes/cvplot/all/test_package/CMakeLists.txt +++ b/recipes/cvplot/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(CvPlot CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/cvplot/all/test_package/conanfile.py b/recipes/cvplot/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/cvplot/all/test_package/conanfile.py +++ b/recipes/cvplot/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cvplot/all/test_package/test_package.cpp b/recipes/cvplot/all/test_package/test_package.cpp index 0592129b4a676..da5278d1f8f60 100644 --- a/recipes/cvplot/all/test_package/test_package.cpp +++ b/recipes/cvplot/all/test_package/test_package.cpp @@ -3,7 +3,7 @@ using namespace CvPlot; int main() { - Axes axes = plot(std::vector{ 3, 3, 4, 6, 4, 3 }, "-o"); - cv::Mat mat = axes.render(400, 600); + Axes axes = plot(std::vector{3, 3, 4, 6, 4, 3}, "-o"); + cv::Mat mat = axes.render(400, 600); return 0; } diff --git a/recipes/cyclonedds/all/conandata.yml b/recipes/cyclonedds/all/conandata.yml index d4037567cc2c5..d51b6cdca669c 100644 --- a/recipes/cyclonedds/all/conandata.yml +++ b/recipes/cyclonedds/all/conandata.yml @@ -1,8 +1,15 @@ sources: + "0.10.3": + url: "https://github.com/eclipse-cyclonedds/cyclonedds/archive/refs/tags/0.10.3.tar.gz" + sha256: "bc79696209febfe66d97e7af6b11e92f9db663caf608a922b6c201b1d6a5eb62" "0.10.2": url: "https://github.com/eclipse-cyclonedds/cyclonedds/archive/refs/tags/0.10.2.tar.gz" sha256: "bc84e137e0c8a055b8cd97fbeafec94e36de1b0c2e88800896a82384fd867ae5" patches: + "0.10.3": + - patch_file: "patches/0.10.2-0001-fix-find-iceoryx.patch" + patch_description: "Fix cmake find for iceoryx package" + patch_type: "conan" "0.10.2": - patch_file: "patches/0.10.2-0001-fix-find-iceoryx.patch" patch_description: "Fix cmake find for iceoryx package" diff --git a/recipes/cyclonedds/all/conanfile.py b/recipes/cyclonedds/all/conanfile.py index 2219a574b8d39..d4aabff510cc1 100644 --- a/recipes/cyclonedds/all/conanfile.py +++ b/recipes/cyclonedds/all/conanfile.py @@ -26,6 +26,7 @@ class CycloneDDSConan(ConanFile): "with_ssl": [True, False], "with_shm" : [True, False], "enable_security" : [True, False], + "enable_discovery" : [True, False], } default_options = { "shared": False, @@ -33,6 +34,7 @@ class CycloneDDSConan(ConanFile): "with_ssl": False, "with_shm": False, "enable_security": False, + "enable_discovery": True, } short_paths = True @@ -105,6 +107,8 @@ def generate(self): tc.variables["ENABLE_SSL"] = self.options.with_ssl tc.variables["ENABLE_SHM"] = self.options.with_shm tc.variables["ENABLE_SECURITY"] = self.options.enable_security + tc.variables["ENABLE_TYPE_DISCOVERY"] = self.options.enable_discovery + tc.variables["ENABLE_TOPIC_DISCOVERY"] = self.options.enable_discovery tc.generate() cd = CMakeDeps(self) @@ -131,7 +135,7 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "CycloneDDS") - self.cpp_info.set_property("cmake_target_name", "CycloneDDS::ddsc") + self.cpp_info.set_property("cmake_target_name", "CycloneDDS::CycloneDDS") self.cpp_info.set_property("pkg_config_name", "CycloneDDS") # TODO: back to global scope in conan v2 self.cpp_info.components["CycloneDDS"].libs = ["ddsc"] diff --git a/recipes/cyclonedds/config.yml b/recipes/cyclonedds/config.yml index 6c8041d964ef5..6fdde61015259 100644 --- a/recipes/cyclonedds/config.yml +++ b/recipes/cyclonedds/config.yml @@ -1,3 +1,5 @@ versions: + "0.10.3": + folder: all "0.10.2": folder: all diff --git a/recipes/darknet/all/conandata.yml b/recipes/darknet/all/conandata.yml index f7382d7a3ec4c..f0ab72430d98e 100644 --- a/recipes/darknet/all/conandata.yml +++ b/recipes/darknet/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: cci.20180914: - patch_file: "patches/include_conan_flags.patch" - base_path: "source_subfolder" diff --git a/recipes/darknet/all/conanfile.py b/recipes/darknet/all/conanfile.py index 5e49bf67b81ff..11a96d6b05dda 100644 --- a/recipes/darknet/all/conanfile.py +++ b/recipes/darknet/all/conanfile.py @@ -1,32 +1,39 @@ import os -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import stdcpp_library +from conan.tools.files import ( + apply_conandata_patches, + chdir, + copy, + export_conandata_patches, + get, + replace_in_file, +) +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout class DarknetConan(ConanFile): name = "darknet" + description = "Darknet is a neural network frameworks written in C" license = "YOLO" url = "https://github.com/conan-io/conan-center-index" homepage = "http://pjreddie.com/darknet/" - description = "Darknet is a neural network frameworks written in C" - topics = ("darknet", "neural network", "deep learning") + topics = ("neural network", "deep learning") settings = "os", "compiler", "build_type", "arch" options = { "shared": [True, False], "fPIC": [True, False], - "with_opencv": [True, False] + "with_opencv": [True, False], } default_options = { "shared": False, "fPIC": True, "with_opencv": False, } - exports_sources = ['patches/*'] - generators = "pkg_config" - - @property - def _source_subfolder(self): - return "source_subfolder" @property def _lib_to_compile(self): @@ -43,56 +50,87 @@ def _shared_lib_extension(self): return ".so" def _patch_sources(self): - for patch in self.conan_data["patches"].get(self.version, []): - tools.patch(**patch) - tools.replace_in_file( - os.path.join(self._source_subfolder, "Makefile"), + apply_conandata_patches(self) + replace_in_file( + self, + os.path.join(self.source_folder, "Makefile"), "SLIB=libdarknet.so", - "SLIB=libdarknet" + self._shared_lib_extension + f"SLIB=libdarknet{self._shared_lib_extension}", ) - tools.replace_in_file( - os.path.join(self._source_subfolder, "Makefile"), + replace_in_file( + self, + os.path.join(self.source_folder, "Makefile"), "all: obj backup results $(SLIB) $(ALIB) $(EXEC)", - "all: obj backup results " + self._lib_to_compile + f"all: obj backup results {self._lib_to_compile}", ) + def export_sources(self): + export_conandata_patches(self) + def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") - def validate(self): - if self.settings.os == "Windows": - raise ConanInvalidConfiguration("This library is not compatible with Windows") + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_opencv: + # Requires OpenCV 2.x self.requires("opencv/2.4.13.7") + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("This library is not compatible with Windows") + def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, - strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.fpic = self.options.get_safe("fPIC", True) + tc.make_args = ["OPENCV={}".format("1" if self.options.with_opencv else "0")] + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() def build(self): - self._patch_sources() - with tools.chdir(self._source_subfolder): - with tools.environment_append({"PKG_CONFIG_PATH": self.build_folder}): - args = ["OPENCV={}".format("1" if self.options.with_opencv else "0")] - env_build = AutoToolsBuildEnvironment(self) - env_build.fpic = self.options.get_safe("fPIC", True) - env_build.make(args=args) + with chdir(self, self.source_folder): + self._patch_sources() + autotools = Autotools(self) + autotools.make() def package(self): - self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("*.so", dst="lib", keep_path=False) - self.copy("*.dylib", dst="lib", keep_path=False) - self.copy("*.a", dst="lib", keep_path=False) + copy( + self, + "LICENSE*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + copy( + self, + "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + for pattern in ["*.so", "*.dylib", "*.a"]: + copy( + self, + pattern, + src=self.source_folder, + dst=os.path.join(self.package_folder, "lib"), + keep_path=False, + ) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["darknet"] - if self.settings.os == "Linux": + if self.options.with_opencv: + # For https://github.com/pjreddie/darknet/blob/61c9d02ec461e30d55762ec7669d6a1d3c356fb2/include/darknet.h#L757 + self.cpp_info.defines.append("OPENCV=1") + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m", "pthread"] - if tools.stdcpp_library(self): - self.cpp_info.system_libs.append(tools.stdcpp_library(self)) + if stdcpp_library(self): + self.cpp_info.system_libs.append(stdcpp_library(self)) diff --git a/recipes/darknet/all/test_package/CMakeLists.txt b/recipes/darknet/all/test_package/CMakeLists.txt index e651ebaf233a3..7e2c525014053 100644 --- a/recipes/darknet/all/test_package/CMakeLists.txt +++ b/recipes/darknet/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(darknet CONFIG REQUIRED) add_executable(${PROJECT_NAME} example.cpp) diff --git a/recipes/darknet/all/test_package/conanfile.py b/recipes/darknet/all/test_package/conanfile.py index ffafc9bf4fa15..ef5d7042163ec 100644 --- a/recipes/darknet/all/test_package/conanfile.py +++ b/recipes/darknet/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class DarknetTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" - +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/daw_json_link/all/conandata.yml b/recipes/daw_json_link/all/conandata.yml index 77fb43160a9b9..c72c7afca8769 100644 --- a/recipes/daw_json_link/all/conandata.yml +++ b/recipes/daw_json_link/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.19.0": + url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.19.0.tar.gz" + sha256: "85c2f6a84878925eb692c53b321b9b237481969c8caa3a9324b78540096a3559" "3.17.2": url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.17.2.tar.gz" sha256: "6f74d386c842d83f32798f4e4cf812da9872cf4fe3565393443fc3be1a06a8ae" @@ -23,24 +26,3 @@ sources: "3.11.1": url: "https://github.com/beached/daw_json_link/archive/v3.11.1.tar.gz" sha256: "d2b5cb221892c6b1ecd30fd2e45d168d6b378e97d134e75349703104c5882309" - "3.10.0": - url: "https://github.com/beached/daw_json_link/archive/v3.10.0.tar.gz" - sha256: "8a2e635e695d57eb147815f516c56d48360b103fbefc06f720607e8cf93c2937" - "3.8.1": - url: "https://github.com/beached/daw_json_link/archive/v3.8.1.tar.gz" - sha256: "b0f20310d1e295babaca62b83488b22f438cc4aacf8a7a47dcc92ad7386baaec" - "3.5.0": - url: "https://github.com/beached/daw_json_link/archive/v3.5.0.tar.gz" - sha256: "d1643725711b4564fb166f1f4bac0acb386fbbdb761f822c99a4ef585d8bdd71" - "3.4.1": - url: "https://github.com/beached/daw_json_link/archive/v3.4.1.tar.gz" - sha256: "3f57ccc936a9999b5c8c5684b2b3b8b989f50ef6e1ea8dce7bc311d1c77195ac" - "3.3.0": - url: "https://github.com/beached/daw_json_link/archive/v3.3.0.tar.gz" - sha256: "fd806245fc8b944e613b29da5ef0570c0e6881b6049a7bf65eb0285c58848f40" - "3.1.1": - url: "https://github.com/beached/daw_json_link/archive/v3.1.1.tar.gz" - sha256: "7d340886898b2ea3c595f0f871c81e4c7382fe53d22d80edc5629768e49fa634" - "2.15.3": - url: "https://github.com/beached/daw_json_link/archive/v2.15.3.tar.gz" - sha256: "ec0457a5682a76c5aec709f2d6959ef7bafa0b54c5e7740f911d97991188ee84" diff --git a/recipes/daw_json_link/config.yml b/recipes/daw_json_link/config.yml index 754af98c981f6..b1d3c03d35507 100644 --- a/recipes/daw_json_link/config.yml +++ b/recipes/daw_json_link/config.yml @@ -1,4 +1,6 @@ versions: + "3.19.0": + folder: "all" "3.17.2": folder: "all" "3.17.1": @@ -15,17 +17,3 @@ versions: folder: "all" "3.11.1": folder: "all" - "3.10.0": - folder: "all" - "3.8.1": - folder: "all" - "3.5.0": - folder: "all" - "3.4.1": - folder: "all" - "3.3.0": - folder: "all" - "3.1.1": - folder: "all" - "2.15.3": - folder: "all" diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py index 008d492888632..f94e50abbf84d 100644 --- a/recipes/dbus/1.x.x/conanfile.py +++ b/recipes/dbus/1.x.x/conanfile.py @@ -25,8 +25,8 @@ class DbusConan(ConanFile): settings = "os", "arch", "compiler", "build_type" short_paths = True options = { - "system_socket": ["ANY"], - "system_pid_file": ["ANY"], + "system_socket": [None, "ANY"], + "system_pid_file": [None, "ANY"], "with_x11": [True, False], "with_glib": [True, False], "with_systemd": [True, False], @@ -34,8 +34,8 @@ class DbusConan(ConanFile): "session_socket_dir": ["ANY"], } default_options = { - "system_socket": "", - "system_pid_file": "", + "system_socket": None, + "system_pid_file": None, "with_x11": False, "with_glib": False, "with_systemd": False, @@ -69,7 +69,7 @@ def layout(self): def requirements(self): self.requires("expat/2.5.0") if self.options.with_glib: - self.requires("glib/2.76.0") + self.requires("glib/2.76.2") if self.options.get_safe("with_systemd"): self.requires("libsystemd/252.4") if self.options.with_selinux: @@ -87,7 +87,7 @@ def validate(self): def build_requirements(self): if self._meson_available: - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.1.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") @@ -104,7 +104,9 @@ def generate(self): tc.project_options["checks"] = False tc.project_options["doxygen_docs"] = "disabled" tc.project_options["modular_tests"] = "disabled" - tc.project_options["session_socket_dir"] = str(self.options.session_socket_dir) + tc.project_options["system_socket"] = str(self.options.get_safe("system_socket", "")) + tc.project_options["system_pid_file"] = str(self.options.get_safe("system_pid_file", "")) + tc.project_options["session_socket_dir"] = str(self.options.get_safe("session_socket_dir", "")) tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux", False) else "disabled" tc.project_options["systemd"] = "enabled" if self.options.get_safe("with_systemd", False) else "disabled" if self.options.get_safe("with_systemd", False): @@ -127,13 +129,14 @@ def generate(self): tc.variables["DBUS_WITH_GLIB"] = bool(self.options.get_safe("with_glib", False)) tc.variables["DBUS_DISABLE_ASSERT"] = is_apple_os(self) tc.variables["DBUS_DISABLE_CHECKS"] = False + tc.variables["DBUS_SYSTEM_BUS_DEFAULT_ADDRESS"] = str(self.options.get_safe("system_socket", "")) # Conan does not provide an EXPAT_LIBRARIES CMake variable for the Expat library. # Define EXPAT_LIBRARIES to be the expat::expat target provided by Conan to fix linking. tc.variables["EXPAT_LIBRARIES"] = "expat::expat" # https://github.com/freedesktop/dbus/commit/e827309976cab94c806fda20013915f1db2d4f5a - tc.variables["DBUS_SESSION_SOCKET_DIR"] = str(self.options.session_socket_dir) + tc.variables["DBUS_SESSION_SOCKET_DIR"] = str(self.options.get_safe("session_socket_dir", "")) tc.cache_variables["CMAKE_FIND_PACKAGE_PREFER_CONFIG"] = False tc.generate() diff --git a/recipes/debug_assert/all/conanfile.py b/recipes/debug_assert/all/conanfile.py index 7c5ec7a1005be..6ffe03cd97e25 100644 --- a/recipes/debug_assert/all/conanfile.py +++ b/recipes/debug_assert/all/conanfile.py @@ -1,35 +1,50 @@ -from conans import ConanFile, tools import os -class DebugAssert(ConanFile): - name = 'debug_assert' - description = 'Simple, flexible and modular assertion macro' - url = 'https://github.com/conan-io/conan-center-index' - homepage = 'http://foonathan.net/blog/2016/09/16/assertions.html' - license = 'Zlib' - topics = 'conan', 'assert', 'debugging', 'utilities' +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" - settings = 'compiler' +class DebugAssert(ConanFile): + name = "debug_assert" + description = "Simple, flexible and modular assertion macro" + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://foonathan.net/blog/2016/09/16/assertions.html" + topics = ("assert", "debugging", "utilities", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - _source_subfolder = 'source_subfolder' @property - def _repo_folder(self): - return os.path.join(self.source_folder, self._source_subfolder) + def _min_cppstd(self): + return 11 - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() - def configure(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, '11') + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) - def package(self): - self.copy("*LICENSE", dst="licenses", keep_path=False) - self.copy("debug_assert.hpp", src=self._repo_folder, dst='include/') + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def package_id(self): - self.info.header_only() + def package(self): + copy(self, "*LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, keep_path=False) + copy(self, "debug_assert.hpp", + 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/debug_assert/all/test_package/CMakeLists.txt b/recipes/debug_assert/all/test_package/CMakeLists.txt index 33ae887aa6aea..57219dd9b2fc5 100644 --- a/recipes/debug_assert/all/test_package/CMakeLists.txt +++ b/recipes/debug_assert/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(debug_assert REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE debug_assert::debug_assert) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/debug_assert/all/test_package/conanfile.py b/recipes/debug_assert/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/debug_assert/all/test_package/conanfile.py +++ b/recipes/debug_assert/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/dice-template-library/all/CMakeLists.txt b/recipes/dice-template-library/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/dice-template-library/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/dice-template-library/all/conandata.yml b/recipes/dice-template-library/all/conandata.yml index a56456e70c621..def2d951ef94e 100644 --- a/recipes/dice-template-library/all/conandata.yml +++ b/recipes/dice-template-library/all/conandata.yml @@ -1,10 +1,13 @@ sources: - "0.1.0": - url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.1.0.tar.gz" - sha256: "1d682283c4a54c4495fc65caa6f9a7674739156ce851227980430052120b2c29" - "0.2.0": - url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.2.0.tar.gz" - sha256: "0f981aeb5604eb305a190d3aef6625032bbb2a34a0bcd17f17ae0cef19fac384" + "1.0.0": + url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.0.0.tar.gz" + sha256: "485505ad3f9fb033083e2952bd8b4e68f6b4f123746b20f4ec3af46f4ce66cfe" "0.3.0": url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.3.0.tar.gz" sha256: "2c02278f86c7b5fe1c684f5126f30529952a03784fa7c883cc4fd44965b3c33e" + "0.2.0": + url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.2.0.tar.gz" + sha256: "0f981aeb5604eb305a190d3aef6625032bbb2a34a0bcd17f17ae0cef19fac384" + "0.1.0": + url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v0.1.0.tar.gz" + sha256: "1d682283c4a54c4495fc65caa6f9a7674739156ce851227980430052120b2c29" diff --git a/recipes/dice-template-library/all/conanfile.py b/recipes/dice-template-library/all/conanfile.py index d7cce02ca9aa4..9b90b9971293f 100644 --- a/recipes/dice-template-library/all/conanfile.py +++ b/recipes/dice-template-library/all/conanfile.py @@ -1,23 +1,32 @@ import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class DiceTemplateLibrary(ConanFile): name = "dice-template-library" - description = "This template library is a collection of handy template-oriented code that we, the Data Science Group at UPB, found pretty handy." - homepage = "https://dice-research.org/" - url = "https://github.com/conan-io/conan-center-index" + description = ("This template library is a collection of handy template-oriented code that we, " + "the Data Science Group at UPB, found pretty handy.") license = "MIT" - topics = ("template", "template-library", "compile-time", "switch", "integral-tuple") - settings = "build_type", "compiler", "os", "arch" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dice-group/dice-template-library/" + topics = ("template", "template-library", "compile-time", "switch", "integral-tuple", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property def _min_cppstd(self): - return "20" + return 20 @property def _compilers_minimum_version(self): @@ -26,44 +35,46 @@ def _compilers_minimum_version(self): "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"): - tools.check_min_cppstd(self, self._min_cppstd) if self.settings.compiler == "apple-clang": raise ConanInvalidConfiguration("apple-clang is not supported because a full concept implementation is needed") - if self.settings.compiler == "Visual Studio": + if is_msvc(self): raise ConanInvalidConfiguration("MSVC is not supported because a full concept implementation is needed") - def lazy_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._compilers_minimum_version.get( - str(self.settings.compiler), False) - if not minimum_version: - self.output.warn("{} {} requires C++20. Your compiler is unknown. Assuming it supports C++20.".format(self.name, self.version)) - elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("{} {} requires C++20, which your compiler does not support.".format(self.name, self.version)) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - @property - def _source_subfolder(self): - return "source_subfolder" + 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): - 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="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - - def package_id(self): - self.info.header_only() + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "COPYING", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", + 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_target_name", self.name) - self.cpp_info.set_property("cmake_target_aliases", ["{0}::{0}".format(self.name)]) + self.cpp_info.set_property("cmake_target_aliases", [f"{self.name}::{self.name}"]) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = self.name self.cpp_info.names["cmake_find_package_multi"] = self.name diff --git a/recipes/dice-template-library/all/test_package/CMakeLists.txt b/recipes/dice-template-library/all/test_package/CMakeLists.txt index 6fcf6dde0f94e..554ae3cf16e97 100644 --- a/recipes/dice-template-library/all/test_package/CMakeLists.txt +++ b/recipes/dice-template-library/all/test_package/CMakeLists.txt @@ -1,12 +1,12 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED True) +find_package(dice-template-library REQUIRED CONFIG) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(dice-template-library REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE dice-template-library::dice-template-library) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) + +if(dice-template-library_VERSION VERSION_GREATER_EQUAL "1.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE DICE_TEMPLATE_LIBRARY_1_0_0_LATER) +endif() diff --git a/recipes/dice-template-library/all/test_package/conanfile.py b/recipes/dice-template-library/all/test_package/conanfile.py index 9d8f35201d56c..fae501d0afb9e 100644 --- a/recipes/dice-template-library/all/test_package/conanfile.py +++ b/recipes/dice-template-library/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package", "cmake_find_package_multi", + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/dice-template-library/all/test_package/test_package.cpp b/recipes/dice-template-library/all/test_package/test_package.cpp index 49e49454d63d0..0b8175abb07cc 100644 --- a/recipes/dice-template-library/all/test_package/test_package.cpp +++ b/recipes/dice-template-library/all/test_package/test_package.cpp @@ -1,11 +1,41 @@ -#include - #include #include -template struct Wrapper { static constexpr int i = N; }; +#include + +#ifdef DICE_TEMPLATE_LIBRARY_1_0_0_LATER +template +struct int_array : std::array { +private: + template + int_array(int value, std::index_sequence) : std::array{((void) IDs, value)...} {} + +public: + int_array() = default; + int_array(int value) : int_array(value, std::make_index_sequence{}) {} +}; + +template +std::ostream &operator<<(std::ostream &os, int_array const &arr) { + if (N == 0) { return os << "0: []"; } + os << N << ": ["; + for (std::size_t i = 0; i < N - 1; ++i) { os << arr[i] << ", "; } + return os << arr[N - 1] << ']'; +} + +int main() { + dice::template_library::integral_template_tuple<5UL, 8, int_array> itt; + std::cout << " " << itt.template get<5>() << '\n'; +} + +#else + +template struct Wrapper { + static constexpr int i = N; +}; int main() { dice::template_library::integral_template_tuple tup; std::cout << std::boolalpha << "tup.get<3>().i == 3: " << (tup.get<3>().i == 3) << std::endl; } +#endif diff --git a/recipes/dice-template-library/all/test_v1_package/CMakeLists.txt b/recipes/dice-template-library/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/dice-template-library/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/dice-template-library/all/test_v1_package/conanfile.py b/recipes/dice-template-library/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..fd66d89b7cd91 --- /dev/null +++ b/recipes/dice-template-library/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi", "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/dice-template-library/config.yml b/recipes/dice-template-library/config.yml index b657866f6cca6..930d790eeb4ba 100644 --- a/recipes/dice-template-library/config.yml +++ b/recipes/dice-template-library/config.yml @@ -1,7 +1,9 @@ versions: - "0.1.0": + "1.0.0": + folder: all + "0.3.0": folder: all "0.2.0": folder: all - "0.3.0": + "0.1.0": folder: all diff --git a/recipes/dr_libs/all/conandata.yml b/recipes/dr_libs/all/conandata.yml new file mode 100644 index 0000000000000..3781cb3dd93e8 --- /dev/null +++ b/recipes/dr_libs/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230529": + url: "https://github.com/mackron/dr_libs/archive/dbbd08d81fd2b084c5ae931531871d0c5fd83b87.tar.gz" + sha256: "9e8d488092c9a0a6b08d9aafc631b1c8d75e707bc10a56a5f4bb1709213702c1" diff --git a/recipes/dr_libs/all/conanfile.py b/recipes/dr_libs/all/conanfile.py new file mode 100644 index 0000000000000..a0572bd8f2cdd --- /dev/null +++ b/recipes/dr_libs/all/conanfile.py @@ -0,0 +1,71 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.52.0" + + +class DrLibsConan(ConanFile): + name = "dr_libs" + description = "Public domain, single file audio decoding libraries for C and C++." + license = ("Unlicense", "MIT-0") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mackron/dr_libs" + topics = ("audio", "encoding", "header-only") + no_copy_source = True + settings = "os", "arch", "compiler", "build_type" + package_type = "header-library" + + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "4.7", + "clang": "3.4", + "apple-clang": "6", + } + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 180) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get( + str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, 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=self.source_folder, + excludes=("old/*", "wip/*", "tests/*") + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/dr_libs/all/test_package/CMakeLists.txt b/recipes/dr_libs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ebee798816d9d --- /dev/null +++ b/recipes/dr_libs/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_DrLibs LANGUAGES CXX) +find_package(dr_libs REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE dr_libs::dr_libs) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/dr_libs/all/test_package/conanfile.py b/recipes/dr_libs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..70d86ba6525a6 --- /dev/null +++ b/recipes/dr_libs/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestDrLibsConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_DrLibs") + self.run(bin_path, env="conanrun") diff --git a/recipes/dr_libs/all/test_package/test_package.cpp b/recipes/dr_libs/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..eca29117d03db --- /dev/null +++ b/recipes/dr_libs/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#define DR_WAV_IMPLEMENTATION +#include "dr_wav.h" +#include +#include +#include + +#define BUFFER_SIZE 255 + +int main() { + srand(time(NULL)); + + // Create fake PCM data + std::vector buffer(BUFFER_SIZE); + for (size_t i = 0; i < BUFFER_SIZE; i++) + buffer[i] = rand() % std::numeric_limits::max(); + + // Convert it to 32-bit floating point + std::vector asFloat(buffer.size()); + drwav_s16_to_f32(asFloat.data(), buffer.data(), buffer.size()); + + // If we get here with no issues, then it's a success + std::cout << "Test success!" << std::endl; + return DRWAV_SUCCESS; +} diff --git a/recipes/dr_libs/config.yml b/recipes/dr_libs/config.yml new file mode 100644 index 0000000000000..612a58a0b962e --- /dev/null +++ b/recipes/dr_libs/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230529": + folder: all diff --git a/recipes/drogon/all/conandata.yml b/recipes/drogon/all/conandata.yml index 3d2e4a7aaaaea..3ee3725bb502d 100644 --- a/recipes/drogon/all/conandata.yml +++ b/recipes/drogon/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.4": + url: "https://github.com/drogonframework/drogon/archive/v1.8.4.tar.gz" + sha256: "6f2f59ead0f0c37b0aac4bc889cbaedf3c2540f3020e892596c72f0a4d887a18" "1.8.3": url: "https://github.com/drogonframework/drogon/archive/v1.8.3.tar.gz" sha256: "db6d92a0c40ec52d5704fb4128860b9eecdc284653e8d85113b4219b96dc7129" @@ -12,6 +15,19 @@ sources: url: "https://github.com/drogonframework/drogon/archive/refs/tags/v1.7.5.tar.gz" sha256: "e2af7c55dcabafef16f26f5b3242692f5a2b54c19b7b626840bf9132d24766f6" patches: + "1.8.4": + - patch_file: "patches/1.8.4-0001-remove-shared-libs.patch" + patch_description: "remove shared libs option" + patch_type: "conan" + - patch_file: "patches/1.8.4-0002-find-package-jsoncpp.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" + - patch_file: "patches/1.8.4-0003-find-package-sqlite.patch" + patch_description: "Fix sqlite cmake target name" + patch_type: "conan" + - patch_file: "patches/1.8.4-0004-find-package-yaml-cpp.patch" + patch_description: "Fix yaml-cpp cmake target name" + patch_type: "conan" "1.8.3": - patch_file: "patches/1.8.0-0001-disable-unused-data.patch" patch_description: "Consume Trantor package from Conan instead of using the\ @@ -23,7 +39,6 @@ patches: - patch_file: "patches/1.8.3-0003-find-package-sqlite.patch" patch_description: "Fix sqlite cmake target name" patch_type: "conan" - "1.8.2": - patch_file: "patches/1.8.0-0001-disable-unused-data.patch" patch_description: "Consume Trantor package from Conan instead of using the\ @@ -35,7 +50,6 @@ patches: - patch_file: "patches/1.8.2-0003-find-package-sqlite.patch" patch_description: "Fix sqlite cmake target name" patch_type: "conan" - "1.8.0": - patch_file: "patches/1.8.0-0001-disable-unused-data.patch" patch_description: "Consume Trantor package from Conan instead of using the subproject" @@ -46,7 +60,9 @@ patches: - patch_file: "patches/1.8.0-0003-find-package-sqlite.patch" patch_description: "Fix sqlite cmake target name" patch_type: "conan" - + - patch_file: "patches/1.8.0-0004-remove-msvc-check.patch" + patch_description: "remove msvc check for C++17 support" + patch_type: "portability" "1.7.5": - patch_file: "patches/1.7.5-0001-disable_trantor.patch" patch_description: "Consume Trantor package from Conan instead of using the subproject" @@ -60,3 +76,6 @@ patches: - patch_file: "patches/1.7.5-0004-find-package-jsoncpp.patch" patch_description: "Fix jsoncpp cmake target name" patch_type: "conan" + - patch_file: "patches/1.7.5-0005-remove-msvc-check.patch" + patch_description: "remove msvc check for C++17 support" + patch_type: "portability" diff --git a/recipes/drogon/all/conanfile.py b/recipes/drogon/all/conanfile.py index 05e8a3e45cfa1..80dc0d0264500 100644 --- a/recipes/drogon/all/conanfile.py +++ b/recipes/drogon/all/conanfile.py @@ -1,13 +1,16 @@ +import os + from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd from conan.tools.cmake import cmake_layout, CMakeToolchain, CMakeDeps, CMake from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches, rmdir -from conan.tools.build import check_min_cppstd from conan.tools.scm import Version -from conan.errors import ConanInvalidConfiguration -import os +from conan.tools.microsoft import is_msvc required_conan_version = ">=1.53.0" + class DrogonConan(ConanFile): name = "drogon" description = "A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows" @@ -24,6 +27,7 @@ class DrogonConan(ConanFile): "with_orm": [True, False], "with_profile": [True, False], "with_brotli": [True, False], + "with_yaml_cpp": [True, False], "with_postgres": [True, False], "with_postgres_batch": [True, False], "with_mysql": [True, False], @@ -38,12 +42,14 @@ class DrogonConan(ConanFile): "with_orm": True, "with_profile": False, "with_brotli": False, + "with_yaml_cpp": False, "with_postgres": False, "with_postgres_batch": False, "with_mysql": False, "with_sqlite": False, "with_redis": False, } + package_type = "library" def export_sources(self): export_conandata_patches(self) @@ -71,27 +77,26 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): - if Version(self.version) < "1.8.2": - return { + return { + "14": { "Visual Studio": "15", "msvc": "191", "gcc": "6", "clang": "5", "apple-clang": "10", - } - else: - return { + }, + "17": { "Visual Studio": "16", "msvc": "192", "gcc": "8", "clang": "7", "apple-clang": "12", } + }.get(str(self._min_cppstd), {}) def validate(self): - if self.info.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.info.settings.compiler), False) if minimum_version: if Version(self.info.settings.compiler.version) < minimum_version: @@ -99,30 +104,35 @@ def validate(self): else: self.output.warn(f"{self.ref} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") + if self.settings.compiler.get_safe("cppstd") == "14" and not self.options.with_boost: + raise ConanInvalidConfiguration(f"{self.ref} requires boost on C++14") + def requirements(self): - self.requires("trantor/1.5.8") - self.requires("jsoncpp/1.9.5") - self.requires("openssl/1.1.1s") + self.requires("trantor/1.5.11", transitive_headers=True, transitive_libs=True) + self.requires("jsoncpp/1.9.5", transitive_headers=True, transitive_libs=True) + self.requires("openssl/[>=1.1 <4]") self.requires("zlib/1.2.13") if self.settings.os == "Linux": self.requires("libuuid/1.0.3") if self.options.with_profile: self.requires("coz/cci.20210322") if self.options.with_boost: - self.requires("boost/1.81.0") + self.requires("boost/1.82.0", transitive_headers=True) if self.options.with_brotli: self.requires("brotli/1.0.9") if self.options.get_safe("with_postgres"): - self.requires("libpq/14.5") + self.requires("libpq/14.7") if self.options.get_safe("with_mysql"): - self.requires("libmysqlclient/8.0.30") + self.requires("libmysqlclient/8.0.31") if self.options.get_safe("with_sqlite"): - self.requires("sqlite3/3.40.0") + self.requires("sqlite3/3.42.0") if self.options.get_safe("with_redis"): self.requires("hiredis/1.1.0") + if self.options.with_yaml_cpp: + self.requires("yaml-cpp/0.7.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 layout(self): cmake_layout(self, src_folder="src") @@ -136,11 +146,16 @@ def generate(self): tc.variables["BUILD_DROGON_SHARED"] = self.options.shared tc.variables["BUILD_DOC"] = False tc.variables["BUILD_BROTLI"] = self.options.with_brotli + tc.variables["BUILD_YAML_CONFIG"] = self.options.with_yaml_cpp tc.variables["BUILD_POSTGRESQL"] = self.options.get_safe("with_postgres", False) tc.variables["BUILD_POSTGRESQL_BATCH"] = self.options.get_safe("with_postgres_batch", False) tc.variables["BUILD_MYSQL"] = self.options.get_safe("with_mysql", False) tc.variables["BUILD_SQLITE"] = self.options.get_safe("with_sqlite", False) tc.variables["BUILD_REDIS"] = self.options.get_safe("with_redis", False) + if is_msvc(self): + tc.variables["CMAKE_CXX_FLAGS"] = "/Zc:__cplusplus /EHsc" + if Version(self.version) >= "1.8.4": + tc.variables["USE_SUBMODULE"] = False tc.generate() tc = CMakeDeps(self) tc.generate() diff --git a/recipes/drogon/all/patches/1.7.5-0005-remove-msvc-check.patch b/recipes/drogon/all/patches/1.7.5-0005-remove-msvc-check.patch new file mode 100644 index 0000000000000..61bc8404888cc --- /dev/null +++ b/recipes/drogon/all/patches/1.7.5-0005-remove-msvc-check.patch @@ -0,0 +1,92 @@ +diff --git a/lib/inc/drogon/utils/any.h b/lib/inc/drogon/utils/any.h +index 63abd2e..8ac74d8 100644 +--- a/lib/inc/drogon/utils/any.h ++++ b/lib/inc/drogon/utils/any.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -21,7 +21,7 @@ + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::any; + using std::any_cast; + #else +diff --git a/lib/inc/drogon/utils/optional.h b/lib/inc/drogon/utils/optional.h +index 2dde172..297a819 100644 +--- a/lib/inc/drogon/utils/optional.h ++++ b/lib/inc/drogon/utils/optional.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -21,9 +21,9 @@ + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::optional; + #else + using boost::optional; + #endif +-} // namespace drogon +\ No newline at end of file ++} // namespace drogon +diff --git a/lib/inc/drogon/utils/string_view.h b/lib/inc/drogon/utils/string_view.h +index a2362b7..074d05f 100644 +--- a/lib/inc/drogon/utils/string_view.h ++++ b/lib/inc/drogon/utils/string_view.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -25,7 +25,7 @@ + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::string_view; + #else + using boost::string_view; +@@ -40,10 +40,10 @@ inline LogStream &operator<<(LogStream &ls, const drogon::string_view &v) + } + } // namespace trantor + +-#if __cplusplus < 201703L && !(defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus < 201703L + namespace drogon + { +-#ifndef _MSC_VER ++#if 1 + template + struct StringViewHasher; + +@@ -319,7 +319,7 @@ struct hash + size_t operator()(const drogon::string_view &__str) const noexcept + { + // MSVC is having problems with non-aligned strings +-#ifndef _MSC_VER ++#if 1 + return drogon::StringViewHasher()(__str); + #else + return drogon::ShortStringViewHasher(__str); diff --git a/recipes/drogon/all/patches/1.8.0-0004-remove-msvc-check.patch b/recipes/drogon/all/patches/1.8.0-0004-remove-msvc-check.patch new file mode 100644 index 0000000000000..5b0923c887cc6 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.0-0004-remove-msvc-check.patch @@ -0,0 +1,117 @@ +diff --git a/lib/inc/drogon/utils/any.h b/lib/inc/drogon/utils/any.h +index 63abd2e..8ac74d8 100644 +--- a/lib/inc/drogon/utils/any.h ++++ b/lib/inc/drogon/utils/any.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -21,7 +21,7 @@ + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::any; + using std::any_cast; + #else +diff --git a/lib/inc/drogon/utils/apply.h b/lib/inc/drogon/utils/apply.h +index a9049af..97d55b7 100644 +--- a/lib/inc/drogon/utils/apply.h ++++ b/lib/inc/drogon/utils/apply.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -29,7 +29,7 @@ constexpr decltype(auto) apply_impl(F &&f, Tuple &&t, std::index_sequence) + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::apply; + #else + template +@@ -42,4 +42,4 @@ constexpr decltype(auto) apply(F &&f, Tuple &&t) + std::tuple_size >::value>{}); + } + #endif +-} // namespace drogon +\ No newline at end of file ++} // namespace drogon +diff --git a/lib/inc/drogon/utils/optional.h b/lib/inc/drogon/utils/optional.h +index 19ced06..c049553 100644 +--- a/lib/inc/drogon/utils/optional.h ++++ b/lib/inc/drogon/utils/optional.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -21,7 +21,7 @@ + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::nullopt; + using std::optional; + #else +diff --git a/lib/inc/drogon/utils/string_view.h b/lib/inc/drogon/utils/string_view.h +index a2362b7..074d05f 100644 +--- a/lib/inc/drogon/utils/string_view.h ++++ b/lib/inc/drogon/utils/string_view.h +@@ -13,7 +13,7 @@ + */ + + #pragma once +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + #include + #else + #include +@@ -25,7 +25,7 @@ + + namespace drogon + { +-#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus >= 201703L + using std::string_view; + #else + using boost::string_view; +@@ -40,10 +40,10 @@ inline LogStream &operator<<(LogStream &ls, const drogon::string_view &v) + } + } // namespace trantor + +-#if __cplusplus < 201703L && !(defined _MSC_VER && _MSC_VER > 1900) ++#if __cplusplus < 201703L + namespace drogon + { +-#ifndef _MSC_VER ++#if 1 + template + struct StringViewHasher; + +@@ -319,7 +319,7 @@ struct hash + size_t operator()(const drogon::string_view &__str) const noexcept + { + // MSVC is having problems with non-aligned strings +-#ifndef _MSC_VER ++#if 1 + return drogon::StringViewHasher()(__str); + #else + return drogon::ShortStringViewHasher(__str); diff --git a/recipes/drogon/all/patches/1.8.4-0001-remove-shared-libs.patch b/recipes/drogon/all/patches/1.8.4-0001-remove-shared-libs.patch new file mode 100644 index 0000000000000..f51304849a04f --- /dev/null +++ b/recipes/drogon/all/patches/1.8.4-0001-remove-shared-libs.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4406362..c346e60 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,7 +16,6 @@ option(BUILD_CTL "Build drogon_ctl" ${BUILD_PROGRAMS}) + option(BUILD_EXAMPLES "Build examples" ${BUILD_PROGRAMS}) + option(BUILD_ORM "Build orm" ON) + option(COZ_PROFILING "Use coz for profiling" OFF) +-option(BUILD_SHARED_LIBS "Build drogon as a shared lib" OFF) + option(BUILD_DOC "Build Doxygen documentation" OFF) + option(BUILD_BROTLI "Build Brotli" ON) + option(BUILD_YAML_CONFIG "Build yaml config" ON) diff --git a/recipes/drogon/all/patches/1.8.4-0002-find-package-jsoncpp.patch b/recipes/drogon/all/patches/1.8.4-0002-find-package-jsoncpp.patch new file mode 100644 index 0000000000000..362fa96c66cc6 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.4-0002-find-package-jsoncpp.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c346e60..e561e5c 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -206,9 +206,9 @@ else() + endif() + + # jsoncpp +-find_package(Jsoncpp REQUIRED) +-target_link_libraries(${PROJECT_NAME} PUBLIC Jsoncpp_lib) +-list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${JSONCPP_INCLUDE_DIRS}) ++find_package(jsoncpp REQUIRED) ++target_link_libraries(${PROJECT_NAME} PUBLIC jsoncpp_lib) ++list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${jsoncpp_INCLUDE_DIRS}) + + # yamlcpp + if(BUILD_YAML_CONFIG) diff --git a/recipes/drogon/all/patches/1.8.4-0003-find-package-sqlite.patch b/recipes/drogon/all/patches/1.8.4-0003-find-package-sqlite.patch new file mode 100644 index 0000000000000..6f97d35a4d314 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.4-0003-find-package-sqlite.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e561e5c..993b21a 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -437,7 +437,7 @@ if (BUILD_SQLITE) + find_package(SQLite3 QUIET) + find_package(unofficial-sqlite3 QUIET) + if (SQLite3_FOUND) +- target_link_libraries(${PROJECT_NAME} PRIVATE SQLite3_lib) ++ target_link_libraries(${PROJECT_NAME} PRIVATE SQLite::SQLite3) + set(DROGON_FOUND_SQLite3 TRUE) + elseif (unofficial-sqlite3_FOUND) + target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::sqlite3::sqlite3) diff --git a/recipes/drogon/all/patches/1.8.4-0004-find-package-yaml-cpp.patch b/recipes/drogon/all/patches/1.8.4-0004-find-package-yaml-cpp.patch new file mode 100644 index 0000000000000..a9fca7863aea7 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.4-0004-find-package-yaml-cpp.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 44063629..c18c86db 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -215,7 +215,7 @@ if(BUILD_YAML_CONFIG) + find_package(yaml-cpp QUIET) + if(yaml-cpp_FOUND) + message(STATUS "yaml-cpp found") +- target_link_libraries(${PROJECT_NAME} PUBLIC ${YAML_CPP_LIBRARIES}) ++ target_link_libraries(${PROJECT_NAME} PUBLIC yaml-cpp) + target_compile_definitions(${PROJECT_NAME} PUBLIC HAS_YAML_CPP) + else() + message(STATUS "yaml-cpp not used") diff --git a/recipes/drogon/config.yml b/recipes/drogon/config.yml index 0ab8881109d24..7b7f0bad90e21 100644 --- a/recipes/drogon/config.yml +++ b/recipes/drogon/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.4": + folder: "all" "1.8.3": folder: "all" "1.8.2": diff --git a/recipes/eastl/all/CMakeLists.txt b/recipes/eastl/all/CMakeLists.txt deleted file mode 100644 index 9533e6887cb91..0000000000000 --- a/recipes/eastl/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -set(CMAKE_CXX_STANDARD 14) - -add_subdirectory(source_subfolder) diff --git a/recipes/eastl/all/conandata.yml b/recipes/eastl/all/conandata.yml index f1c15b1dc7308..fbaa385964645 100644 --- a/recipes/eastl/all/conandata.yml +++ b/recipes/eastl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.21.12": + url: "https://github.com/electronicarts/EASTL/archive/refs/tags/3.21.12.tar.gz" + sha256: "2a4d77e5eda23ec52fea8b22abbf2ea8002f38396d2a3beddda3ff2e17f7db2e" "3.18.00": url: "https://github.com/electronicarts/EASTL/archive/refs/tags/3.18.00.tar.gz" sha256: "a3c5b970684be02e81fb16fbf92ed2584e055898704fde87c72d0331afdea12b" @@ -21,30 +24,51 @@ sources: url: "https://github.com/electronicarts/EASTL/archive/3.15.00.tar.gz" sha256: "1578a2935ca490920b96c960fb570dab025280bb978fba40c88eb9ac74760c14" patches: + "3.21.12": + - patch_file: "patches/3.21.12-0001-cmake-shared-use-conan-add-install.patch" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" + - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" + patch_description: "disable constexpr for unsupported compilers" + patch_type: "portability" + - patch_file: "patches/3.21.12-0003-rename_reference.patch" + patch_description: "use eastl::remove_reference instead of std::remove_reference" + patch_type: "portability" + patch_source: "https://github.com/electronicarts/EASTL/issues/512" "3.18.00": - patch_file: "patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" - base_path: "source_subfolder" + patch_description: "disable constexpr for unsupported compilers" + patch_type: "portability" "3.17.06": - patch_file: "patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" - base_path: "source_subfolder" + patch_description: "disable constexpr for unsupported compilers" + patch_type: "portability" "3.17.03": - patch_file: "patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" - patch_file: "patches/3.17.03-0002-revert-c++14-constexpr.patch" - base_path: "source_subfolder" + patch_description: "disable constexpr for unsupported compilers" + patch_type: "portability" "3.16.07": - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" "3.16.05": - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" "3.16.01": - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" "3.15.00": - patch_file: "patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch" - base_path: "source_subfolder" + patch_description: "support shared build, use cci's EABase, add install definitions" + patch_type: "conan" diff --git a/recipes/eastl/all/conanfile.py b/recipes/eastl/all/conanfile.py index faccbd629bec0..0e2ac3111ed3a 100644 --- a/recipes/eastl/all/conanfile.py +++ b/recipes/eastl/all/conanfile.py @@ -1,20 +1,36 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import ( + apply_conandata_patches, + copy, + export_conandata_patches, + get, + replace_in_file, + rmdir, +) +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class EastlConan(ConanFile): name = "eastl" - description = "EASTL stands for Electronic Arts Standard Template Library. " \ - "It is an extensive and robust implementation that has an " \ - "emphasis on high performance." + description = ( + "EASTL stands for Electronic Arts Standard Template Library. " + "It is an extensive and robust implementation that has an " + "emphasis on high performance." + ) topics = ("eastl", "stl", "high-performance") license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/electronicarts/EASTL" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,34 +41,22 @@ class EastlConan(ConanFile): "fPIC": True, } - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 14 @property - def _minimum_compilers_version(self): + def _compilers_minimum_version(self): return { "Visual Studio": "14", - "gcc": "5", + "msvc": "190", + "gcc": "5" if Version(self.version) < "3.21.12" else "6", "clang": "3.2", "apple-clang": "4.3", } 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": @@ -60,57 +64,81 @@ 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("eabase/2.09.06") + self.requires("eabase/2.09.12", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) - - mininum_compiler_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - if mininum_compiler_version and tools.Version(self.settings.compiler.version) < mininum_compiler_version: - raise ConanInvalidConfiguration("Compiler is too old for c++ {}".format(self._minimum_cpp_standard)) + 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 check_min_vs(self, "193", raise_invalid=False) and Version(self.version) < "3.21.12": + raise ConanInvalidConfiguration(f"{self.ref} is not compatible with Visual Studio 2022, please use version >= 3.21.12") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["EASTL_BUILD_BENCHMARK"] = False - self._cmake.definitions["EASTL_BUILD_TESTS"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["EASTL_BUILD_BENCHMARK"] = False + tc.variables["EASTL_BUILD_TESTS"] = False + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.generate() + CMakeDeps(self).generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - tools.replace_path_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "include(CommonCppFlags)", - "") + apply_conandata_patches(self) + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "include(CommonCppFlags)", + "", + ) def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("3RDPARTYLICENSES.TXT", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy( + self, + "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + ) + copy( + self, + "3RDPARTYLICENSES.TXT", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + ) + cmake = CMake(self) cmake.install() + rmdir(self, os.path.join(self.package_folder, "doc")) def package_info(self): self.cpp_info.libs = ["EASTL"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.extend(["m", "pthread"]) if self.options.shared: self.cpp_info.defines.append("EA_DLL") - # Do not use these names in set_property, it was a mistake, eastl doesn't export its target + self.cpp_info.set_property("cmake_file_name", "EASTL") + self.cpp_info.set_property("cmake_target_name", "EASTL::EASTL") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "EASTL" + self.cpp_info.filenames["cmake_find_package_multi"] = "EASTL" self.cpp_info.names["cmake_find_package"] = "EASTL" self.cpp_info.names["cmake_find_package_multi"] = "EASTL" diff --git a/recipes/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch b/recipes/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch index 8b004f0ee5054..cb7647d7b88ea 100644 --- a/recipes/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch +++ b/recipes/eastl/all/patches/3.15.00-0001-cmake-shared-use-conan-add-install.patch @@ -1,11 +1,12 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -46,5 +46,18 @@ target_include_directories(EASTL PUBLIC include) +@@ -46,5 +46,19 @@ target_include_directories(EASTL PUBLIC include) #------------------------------------------------------------------------------------------- # Dependencies #------------------------------------------------------------------------------------------- -target_link_libraries(EASTL EABase) -+target_link_libraries(EASTL CONAN_PKG::eabase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EASTL EABase::EABase) +if(BUILD_SHARED_LIBS) + target_compile_definitions(EASTL PUBLIC EASTL_DLL) diff --git a/recipes/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch b/recipes/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch index 05c5b0bd39e41..8e8ec2ed77d6e 100644 --- a/recipes/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch +++ b/recipes/eastl/all/patches/3.17.03-0001-cmake-shared-use-conan-add-install.patch @@ -1,6 +1,6 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -47,8 +47,21 @@ +@@ -47,8 +47,22 @@ # Dependencies #------------------------------------------------------------------------------------------- if (NOT TARGET EABase) @@ -9,7 +9,8 @@ endif() -target_link_libraries(EASTL EABase) -+target_link_libraries(EASTL CONAN_PKG::eabase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EASTL EABase::EABase) +if(BUILD_SHARED_LIBS) + target_compile_definitions(EASTL PUBLIC EASTL_DLL) diff --git a/recipes/eastl/all/patches/3.21.12-0001-cmake-shared-use-conan-add-install.patch b/recipes/eastl/all/patches/3.21.12-0001-cmake-shared-use-conan-add-install.patch new file mode 100644 index 0000000000000..475e12111343c --- /dev/null +++ b/recipes/eastl/all/patches/3.21.12-0001-cmake-shared-use-conan-add-install.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e3eb444..f033794 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,11 +59,22 @@ target_include_directories(EASTL PUBLIC include) + #------------------------------------------------------------------------------------------- + # Dependencies + #------------------------------------------------------------------------------------------- +-if (NOT TARGET EABase) +- add_subdirectory(test/packages/EABase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EASTL EABase::EABase) ++ ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(EASTL PUBLIC EASTL_DLL) ++ if(MSVC OR CYGWIN) ++ target_compile_definitions(EASTL PRIVATE "EASTL_API=__declspec(dllexport)") ++ endif() + endif() + +-target_link_libraries(EASTL EABase) ++include(GNUInstallDirs) ++install(TARGETS EASTL ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY ${CMAKE_INSTALL_INCLUDEDIR}/EASTL DESTINATION include) + + #------------------------------------------------------------------------------------------- + # Installation diff --git a/recipes/eastl/all/patches/3.21.12-0003-rename_reference.patch b/recipes/eastl/all/patches/3.21.12-0003-rename_reference.patch new file mode 100644 index 0000000000000..686977d001a8d --- /dev/null +++ b/recipes/eastl/all/patches/3.21.12-0003-rename_reference.patch @@ -0,0 +1,13 @@ +diff --git a/include/EASTL/internal/type_transformations.h b/include/EASTL/internal/type_transformations.h +index 5454cfa..54a1c14 100644 +--- a/include/EASTL/internal/type_transformations.h ++++ b/include/EASTL/internal/type_transformations.h +@@ -497,7 +497,7 @@ namespace eastl + namespace internal + { + template +- auto try_add_pointer(int) -> type_identity::type*>; ++ auto try_add_pointer(int) -> type_identity::type*>; + template + auto try_add_pointer(...) -> type_identity; + } diff --git a/recipes/eastl/all/test_package/CMakeLists.txt b/recipes/eastl/all/test_package/CMakeLists.txt index 3300ff7750277..8223214fdc1fe 100644 --- a/recipes/eastl/all/test_package/CMakeLists.txt +++ b/recipes/eastl/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(EASTL REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} EASTL::EASTL) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/eastl/all/test_package/conanfile.py b/recipes/eastl/all/test_package/conanfile.py index 5c09494bc67c0..ef5d7042163ec 100644 --- a/recipes/eastl/all/test_package/conanfile.py +++ b/recipes/eastl/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/eastl/all/test_package/test_package.cpp b/recipes/eastl/all/test_package/test_package.cpp index 3f5332883d4d5..433ff947f053b 100644 --- a/recipes/eastl/all/test_package/test_package.cpp +++ b/recipes/eastl/all/test_package/test_package.cpp @@ -1,9 +1,16 @@ -#include -#include +#include +#include -int main() -{ - std::vector vec; - eastl::max_element(vec.begin(), vec.end()); +// https://github.com/electronicarts/EASTL/blob/master/doc/FAQ.md#info15-how-hard-is-it-to-incorporate-eastl-into-my-project +void *operator new[](size_t size, const char *pName, int flags, unsigned debugFlags, const char *file, int line) { + return new uint8_t[size]; +} +void *operator new[](size_t size, size_t alignment, size_t alignmentOffset, const char *pName, int flags, unsigned debugFlags, const char *file, int line) { + return new uint8_t[size]; +} + +int main() { + eastl::hash_map map; + map[0] = 1; return 0; } diff --git a/recipes/eastl/config.yml b/recipes/eastl/config.yml index bfb95b02f09c0..0cd35fae8664c 100644 --- a/recipes/eastl/config.yml +++ b/recipes/eastl/config.yml @@ -1,4 +1,6 @@ versions: + "3.21.12": + folder: "all" "3.18.00": folder: "all" "3.17.06": diff --git a/recipes/effolkronium-random/all/conanfile.py b/recipes/effolkronium-random/all/conanfile.py index 1c77e0e87ce24..3b1d45a29a7e9 100644 --- a/recipes/effolkronium-random/all/conanfile.py +++ b/recipes/effolkronium-random/all/conanfile.py @@ -1,31 +1,55 @@ import os -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class RandomConan(ConanFile): name = "effolkronium-random" description = "Random for modern C++ with convenient API." license = "MIT" - topics = ("conan", "random", "header-only") - homepage = "https://github.com/effolkronium/random" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/effolkronium/random" + topics = ("random", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("random-" + self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE.MIT", dst="licenses", src=self._source_subfolder) - self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) - - def package_id(self): - self.info.header_only() + copy(self, "LICENSE.MIT", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.hpp", + 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", "effolkronium_random") + self.cpp_info.set_property("cmake_target_name", "effolkronium_random") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "effolkronium_random" self.cpp_info.names["cmake_find_package_multi"] = "effolkronium_random" diff --git a/recipes/effolkronium-random/all/test_package/CMakeLists.txt b/recipes/effolkronium-random/all/test_package/CMakeLists.txt index 33ae887aa6aea..186757f8c1657 100644 --- a/recipes/effolkronium-random/all/test_package/CMakeLists.txt +++ b/recipes/effolkronium-random/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(effolkronium_random REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE effolkronium_random) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/effolkronium-random/all/test_package/conanfile.py b/recipes/effolkronium-random/all/test_package/conanfile.py index ea57a464900be..fae501d0afb9e 100644 --- a/recipes/effolkronium-random/all/test_package/conanfile.py +++ b/recipes/effolkronium-random/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -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", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/enhex-generic_serialization/all/conanfile.py b/recipes/enhex-generic_serialization/all/conanfile.py index 9dbb338a5b3f4..f9f7cc76df650 100644 --- a/recipes/enhex-generic_serialization/all/conanfile.py +++ b/recipes/enhex-generic_serialization/all/conanfile.py @@ -1,50 +1,76 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + class EnhexGenericserializationConan(ConanFile): name = "enhex-generic_serialization" - license = "MIT" description = "Lightweight and extensible generic serialization library" - topics = ("serialization") - homepage = "https://github.com/Enhex/generic_serialization" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Enhex/generic_serialization" + topics = ("serialization", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - settings = ("compiler") @property - def _source_subfolder(self): - return "source_subfolder" - - def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + def _min_cppstd(self): + return 17 - minimal_version = { + @property + def _compilers_minimum_version(self): + return { "Visual Studio": "15", + "msvc": "191", "gcc": "7", "clang": "5.0", - "apple-clang": "9.1" + "apple-clang": "9.1", } + + 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) + compiler = str(self.settings.compiler) - compiler_version = tools.Version(self.settings.compiler.version) + compiler_version = Version(self.settings.compiler.version) - if compiler not in minimal_version: - self.output.info("{} requires a compiler that supports at least C++17".format(self.name)) + if compiler not in self._compilers_minimum_version: + self.output.info(f"{self.name} requires a compiler that supports at least C++17") return # Exclude compilers not supported - if compiler_version < minimal_version[compiler]: - raise ConanInvalidConfiguration("{} requires a compiler that supports at least C++17. {} {} is not".format( - self.name, compiler, tools.Version(self.settings.compiler.version.value))) + if compiler_version < self._compilers_minimum_version[compiler]: + raise ConanInvalidConfiguration( + f"{self.name} requires a compiler that supports at least C++17. " + f"{compiler} {Version(self.settings.compiler.version.value)} is not" + ) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/enhex-generic_serialization/all/test_package/CMakeLists.txt b/recipes/enhex-generic_serialization/all/test_package/CMakeLists.txt index 60c63e2f06ba6..cca2369654837 100644 --- a/recipes/enhex-generic_serialization/all/test_package/CMakeLists.txt +++ b/recipes/enhex-generic_serialization/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(enhex-generic_serialization CONFIG REQUIRED) +find_package(enhex-generic_serialization REQUIRED CONFIG) add_executable(example example.cpp) target_link_libraries(example enhex-generic_serialization::enhex-generic_serialization) diff --git a/recipes/enhex-generic_serialization/all/test_package/conanfile.py b/recipes/enhex-generic_serialization/all/test_package/conanfile.py index 6ab1666628a5d..e0f447388fa1b 100644 --- a/recipes/enhex-generic_serialization/all/test_package/conanfile.py +++ b/recipes/enhex-generic_serialization/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" -class EnhexGenericserializationTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - 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.bindir, "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/enhex-generic_serialization/all/test_v1_package/CMakeLists.txt b/recipes/enhex-generic_serialization/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/enhex-generic_serialization/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/enhex-generic_serialization/all/test_v1_package/conanfile.py b/recipes/enhex-generic_serialization/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6ab1666628a5d --- /dev/null +++ b/recipes/enhex-generic_serialization/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class EnhexGenericserializationTestConan(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", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/entt/3.x.x/conandata.yml b/recipes/entt/3.x.x/conandata.yml index b55145bf44224..24bd7f949e5dc 100644 --- a/recipes/entt/3.x.x/conandata.yml +++ b/recipes/entt/3.x.x/conandata.yml @@ -1,67 +1,19 @@ sources: + "3.12.2": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.12.2.tar.gz" + sha256: "3F3E43988218DAECC0530CCAF45E960F7F7416E1FCF2C69799160C18B6A2FEE3" "3.11.1": url: "https://github.com/skypjack/entt/archive/refs/tags/v3.11.1.tar.gz" sha256: "0ac010f232d3089200c5e545bcbd6480cf68b705de6930d8ff7cdb0a29f5b47b" - "3.11.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.11.0.tar.gz" - sha256: "7cca2bd4d4aeef6c5bdbe06b9e047e7f2519ebaff901207cc81ac71a2bbe185e" "3.10.3": url: "https://github.com/skypjack/entt/archive/refs/tags/v3.10.3.tar.gz" sha256: "315918fc678e89a326ce1c13b0e9d3e53882dd9c58a63fef413325917a5c753b" - "3.10.1": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.10.1.tar.gz" - sha256: "f7031545130bfc06f5fe6b2f8c87dcbd4c1254fab86657e2788b70dfeea57965" - "3.10.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.10.0.tar.gz" - sha256: "4c716cebf4f2964824da158dd58cc81d9f1e056a083538e22fb03ae2d64805ee" - "3.9.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.9.0.tar.gz" - sha256: "1b06f1f6627c3702486855877bdeab6885f5d821d3dd78862126d4308c627c23" - "3.8.1": - url: "https://github.com/skypjack/entt/archive/v3.8.1.tar.gz" - sha256: "a2b767f06bca67a73a4d71fb9ebb6ed823bb5146faad3c282b9dbbbdae1aa01b" - "3.8.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.8.0.tar.gz" - sha256: "71c8ff5a604e8e214571a8b2218dfeaf61be59e2fe2ff5b550b4810c37d4da3c" - "3.7.1": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.7.1.tar.gz" - sha256: "fe3ce773c17797c0c57ffa97f73902854fcc8e7afc7e09bea373e0c64fa24a23" - "3.7.0": - url: "https://github.com/skypjack/entt/archive/refs/tags/v3.7.0.tar.gz" - sha256: "39ad5c42acf3434f8c37e0baa18a8cb562c0845383a6b4da17fdbacc9f0a7695" - "3.6.0": - url: "https://github.com/skypjack/entt/archive/v3.6.0.tar.gz" - sha256: "94b7dc874acd0961cfc28cf6b0342eeb0b7c58250ddde8bdc6c101e84b74c190" - "3.5.2": - url: "https://github.com/skypjack/entt/archive/v3.5.2.tar.gz" - sha256: "f9271293c44518386c402c9a2188627819748f66302df48af4f6d08e30661036" - "3.5.1": - url: "https://github.com/skypjack/entt/archive/v3.5.1.tar.gz" - sha256: "f442ece6881ec24863e7f0fbdc4bf641e01b0f87955f49dc4687b2fa564e9c83" - "3.5.0": - url: "https://github.com/skypjack/entt/archive/v3.5.0.tar.gz" - sha256: "89cba5ddf90bcec0dcf8d9554d9acf5ad86f5ce305e3acacf795007ee65c93f8" - "3.4.0": - url: "https://github.com/skypjack/entt/archive/v3.4.0.tar.gz" - sha256: "07086b8c5b1d84a1b76b39b0ce257c36c4f1521b77e664368b3d5ca7c00264e2" - "3.3.2": - url: "https://github.com/skypjack/entt/archive/v3.3.2.tar.gz" - sha256: "150cd89b45bffbcd7643d39bbce282e8fa38307bb5ed25567b79e337376ba1c7" - "3.3.1": - url: "https://github.com/skypjack/entt/archive/v3.3.1.tar.gz" - sha256: "432f31a80fb0463960dfd36e103c206dd67f1bfa91fc48408594c28aa790a3f5" - "3.3.0": - url: "https://github.com/skypjack/entt/archive/v3.3.0.tar.gz" - sha256: "d21a45df4960adc86a8f23a8c3c0cea6d2cecc4ef6946a8040e336d8e5266ab3" - "3.2.2": - url: "https://github.com/skypjack/entt/archive/v3.2.2.tar.gz" - sha256: "94592270b6750dd0b057a4af9d2c1ea8798369b3bb127927a8f70db232808f93" patches: - "3.11.1": - - patch_file: "patches/0001-3.11.0-fix-gcc-7.0-7.3.patch" + "3.12.2": + - patch_file: "patches/0002-3.12.1-fix-gcc-7.0-7.3.patch" patch_description: "Fix GCC 7.0 to 7.3" patch_type: "portability" - "3.11.0": + "3.11.1": - patch_file: "patches/0001-3.11.0-fix-gcc-7.0-7.3.patch" patch_description: "Fix GCC 7.0 to 7.3" patch_type: "portability" diff --git a/recipes/entt/3.x.x/patches/0002-3.12.1-fix-gcc-7.0-7.3.patch b/recipes/entt/3.x.x/patches/0002-3.12.1-fix-gcc-7.0-7.3.patch new file mode 100644 index 0000000000000..d3cb85f5fbcc6 --- /dev/null +++ b/recipes/entt/3.x.x/patches/0002-3.12.1-fix-gcc-7.0-7.3.patch @@ -0,0 +1,20 @@ +--- a/src/entt/meta/meta.hpp ++++ b/src/entt/meta/meta.hpp +@@ -1688,7 +1688,7 @@ public: + using reference = value_type; + using iterator_category = std::input_iterator_tag; + +- constexpr meta_iterator() noexcept ++ meta_iterator() noexcept + : ctx{}, + vtable{}, + handle{} {} +@@ -1782,7 +1782,7 @@ public: + using reference = value_type; + using iterator_category = std::input_iterator_tag; + +- constexpr meta_iterator() noexcept ++ meta_iterator() noexcept + : ctx{}, + vtable{}, + handle{} {} diff --git a/recipes/entt/config.yml b/recipes/entt/config.yml index 0000b93d983f2..3eaedc6257e18 100644 --- a/recipes/entt/config.yml +++ b/recipes/entt/config.yml @@ -1,39 +1,7 @@ versions: - "3.11.1": + "3.12.2": folder: 3.x.x - "3.11.0": + "3.11.1": folder: 3.x.x "3.10.3": folder: 3.x.x - "3.10.1": - folder: 3.x.x - "3.10.0": - folder: 3.x.x - "3.9.0": - folder: 3.x.x - "3.8.1": - folder: 3.x.x - "3.8.0": - folder: 3.x.x - "3.7.1": - folder: 3.x.x - "3.7.0": - folder: 3.x.x - "3.6.0": - folder: 3.x.x - "3.5.2": - folder: 3.x.x - "3.5.1": - folder: 3.x.x - "3.5.0": - folder: 3.x.x - "3.4.0": - folder: 3.x.x - "3.3.2": - folder: 3.x.x - "3.3.1": - folder: 3.x.x - "3.3.0": - folder: 3.x.x - "3.2.2": - folder: 3.x.x diff --git a/recipes/etl/all/conandata.yml b/recipes/etl/all/conandata.yml index 54b5c71761334..d02bdeabb7ddb 100644 --- a/recipes/etl/all/conandata.yml +++ b/recipes/etl/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "20.37.1": + url: "https://github.com/ETLCPP/etl/archive/20.37.1.tar.gz" + sha256: "73c29678e478eca9243c1d0c98e727a2249a7973d1429a847c669bccc65dca88" + "20.37.0": + url: "https://github.com/ETLCPP/etl/archive/20.37.0.tar.gz" + sha256: "94ffb30dc38b9f40566ba7c4ef0c233bca23cfcb4e6c400fcf981729a46413eb" "20.36.0": url: "https://github.com/ETLCPP/etl/archive/20.36.0.tar.gz" sha256: "bcab607d619008c7e3942ecc9cb429e17deb553c81bc5f1fd013fbc1e17f1344" @@ -14,12 +20,6 @@ sources: "20.35.7": url: "https://github.com/ETLCPP/etl/archive/20.35.7.tar.gz" sha256: "20127e36c12a33142645dd5ec0a08d12b34ce9b33986847eeaa8c4201e025895" - "20.35.5": - url: "https://github.com/ETLCPP/etl/archive/20.35.5.tar.gz" - sha256: "d67aead4f1c023eaeb9ae67b62b0aed76138aa1b7dac48f627530ab3ea366281" - "20.35.0": - url: "https://github.com/ETLCPP/etl/archive/20.35.0.tar.gz" - sha256: "1bfbc5679bce41625add0e5d7354ab8521dc4811f13e1627a9816af65f49f42b" "20.34.0": url: "https://github.com/ETLCPP/etl/archive/20.34.0.tar.gz" sha256: "56e25968f20167a161ee50c3eecda3daa91f696660ba59654c1afd22e502c465" @@ -29,12 +29,3 @@ sources: "20.32.1": url: "https://github.com/ETLCPP/etl/archive/20.32.1.tar.gz" sha256: "f39c8ccf33190303946dbcb2b251c86b4516234f57e0e87b83c0a28a1bdb059d" - "20.31.3": - url: "https://github.com/ETLCPP/etl/archive/20.31.3.tar.gz" - sha256: "dabfeaec4e0aaee6920ee429ab262959595b78d65ef7846df13b5fe68ea85f4b" - "20.30.1": - url: "https://github.com/ETLCPP/etl/archive/20.30.1.tar.gz" - sha256: "10b50ca3ae406ae379e85504546843fc9d97be18924e71d8eb7e8e5a418e91cd" - "20.29.3": - url: "https://github.com/ETLCPP/etl/archive/20.29.3.tar.gz" - sha256: "8a0df2b475ea99bb27dd4ee04c39bda69e29be93b3709a1e243dcc2599e92ff4" diff --git a/recipes/etl/config.yml b/recipes/etl/config.yml index f15a6f212d97e..587b12dc52899 100644 --- a/recipes/etl/config.yml +++ b/recipes/etl/config.yml @@ -1,4 +1,8 @@ versions: + "20.37.1": + folder: all + "20.37.0": + folder: all "20.36.0": folder: all "20.35.14": @@ -9,19 +13,9 @@ versions: folder: all "20.35.7": folder: all - "20.35.5": - folder: all - "20.35.0": - folder: all "20.34.0": folder: all "20.33.0": folder: all "20.32.1": folder: all - "20.31.3": - folder: all - "20.30.1": - folder: all - "20.29.3": - folder: all diff --git a/recipes/extra-cmake-modules/all/conandata.yml b/recipes/extra-cmake-modules/all/conandata.yml index c1c71096d72a6..6959b8c4f7d49 100644 --- a/recipes/extra-cmake-modules/all/conandata.yml +++ b/recipes/extra-cmake-modules/all/conandata.yml @@ -11,3 +11,6 @@ sources: "5.93.0": url: "https://download.kde.org/stable/frameworks/5.93/extra-cmake-modules-5.93.0.tar.xz" sha256: "093dea7b11647bc5f74e6971d47ef15b5c410cba2b4620acae00f008d5480b21" + "5.108.0": + url: "https://download.kde.org/stable/frameworks/5.108/extra-cmake-modules-5.108.0.tar.xz" + sha256: "ff14abd21abd34c2d8c00ee7a1ccd173b9a57ed1824e5c01090897ffffed447a" diff --git a/recipes/extra-cmake-modules/all/conanfile.py b/recipes/extra-cmake-modules/all/conanfile.py index 260ac51ba3a9a..94cf7600c9287 100644 --- a/recipes/extra-cmake-modules/all/conanfile.py +++ b/recipes/extra-cmake-modules/all/conanfile.py @@ -1,5 +1,9 @@ import os -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.files import get, copy +from conan.tools.scm import Version + class ExtracmakemodulesConan(ConanFile): name = "extra-cmake-modules" @@ -8,49 +12,65 @@ class ExtracmakemodulesConan(ConanFile): homepage = "https://api.kde.org/ecm/" topics = ("conan", "cmake", "toolchain", "build-settings") description = "KDE's CMake modules" - generators = "cmake" no_copy_source = False + package_type = "build-scripts" + settings = "build_type" + short_paths = True - _cmake = None + def source(self): + get( + self, + **self.conan_data["sources"][self.version], + destination=self.source_folder + ) - @property - def _source_subfolder(self): - return "source_subfolder" + def build_requirements(self): + if self.version <= Version("5.80.0"): + self.tool_requires("cmake/[>=3.5]") + else: + self.tool_requires("cmake/[>=3.16]") - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("extra-cmake-modules-{}".format(self.version), self._source_subfolder) - def _configure_cmake(self): - if self._cmake: - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_HTML_DOCS"] = False + tc.cache_variables["BUILD_QTHELP_DOCS"] = False + tc.cache_variables["BUILD_MAN_DOCS"] = False + tc.cache_variables["BUILD_TESTING"] = False - # KB-H016: do not install Find*.cmake - tools.replace_path_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "install(FILES ${installFindModuleFiles} DESTINATION ${FIND_MODULES_INSTALL_DIR})", "") + if self.package_folder is None: + share_folder = "res" + else: + share_folder = os.path.join(self.package_folder, "res") - self._cmake = CMake(self) - self._cmake.definitions["BUILD_HTML_DOCS"] = False - self._cmake.definitions["BUILD_QTHELP_DOCS"] = False - self._cmake.definitions["BUILD_MAN_DOCS"] = False - self._cmake.definitions["SHARE_INSTALL_DIR"] = os.path.join(self.package_folder, "res") - self._cmake.configure(source_folder=os.path.join(self.source_folder, self._source_subfolder)) - return self._cmake + tc.cache_variables["SHARE_INSTALL_DIR"] = share_folder + tc.generate() def build(self): - cmake = self._configure_cmake() - cmake.build() + cm_folder = "{}-{}".format(self.name, self.version) + cmake = CMake(self) + cmake.configure(build_script_folder=cm_folder) def package(self): - cmake = self._configure_cmake() - cmake.install() - self.copy("testhelper.h", src=os.path.join(self.source_folder, self._source_subfolder, "tests/ECMAddTests"), dst="res/tests") - self.copy("*", src=os.path.join(self.source_folder, self._source_subfolder, "LICENSES"), dst="licenses") + cm_folder = "{}-{}".format(self.name, self.version) + lic_folder_st = os.path.join(cm_folder, "LICENSES") + lic_folder = os.path.join(self.source_folder, lic_folder_st) - def package_info(self): - self.cpp_info.resdirs = ["res"] - self.cpp_info.builddirs = ["res/ECM/cmake", "res/ECM/kde-modules", "res/ECM/modules", "res/ECM/test-modules", "res/ECM/toolchain"] + lic_folder_inst = os.path.join(self.package_folder, "licenses") + copy(self, "*", src=lic_folder, dst=lic_folder_inst) + + cmake = CMake(self) + cmake.install() def package_id(self): - self.info.header_only() + self.info.clear() + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.set_property("cmake_find_mode", "none") + for dirname in ["cmake", "find-modules", "kde-modules", "toolchain", + "modules", "test-modules"]: + self.cpp_info.builddirs.append(os.path.join("res", "ECM", dirname)) diff --git a/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt b/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt index 96f9cb73534c7..1e85f491bc237 100644 --- a/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt +++ b/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(ECM REQUIRED NO_MODULE) list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) diff --git a/recipes/extra-cmake-modules/all/test_package/conanfile.py b/recipes/extra-cmake-modules/all/test_package/conanfile.py index 1ffe0933a5715..72c1f212d5782 100644 --- a/recipes/extra-cmake-modules/all/test_package/conanfile.py +++ b/recipes/extra-cmake-modules/all/test_package/conanfile.py @@ -1,9 +1,22 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.build import can_run import os class ExtraCMakeModulesTestConan(ConanFile): settings = "os", "compiler", "arch", "build_type" - generators = "cmake" + + def build_requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,7 +24,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "example") - self.run(bin_path, run_environment=True) - + if can_run(self): + runpath = os.path.join(self.cpp.build.bindir, "example") + self.run(runpath, env="conanrun") diff --git a/recipes/extra-cmake-modules/config.yml b/recipes/extra-cmake-modules/config.yml index c17f03346f04f..873671640043e 100644 --- a/recipes/extra-cmake-modules/config.yml +++ b/recipes/extra-cmake-modules/config.yml @@ -7,3 +7,5 @@ versions: folder: "all" "5.93.0": folder: "all" + "5.108.0": + folder: "all" diff --git a/recipes/fastgltf/all/conandata.yml b/recipes/fastgltf/all/conandata.yml new file mode 100644 index 0000000000000..04bdef83a98c4 --- /dev/null +++ b/recipes/fastgltf/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "0.5.0": + url: "https://github.com/spnda/fastgltf/archive/refs/tags/v0.5.0.tar.gz" + sha256: "f67558da009bfd1174b3f32606c41c20fe6fbcb70fc516e9f7bf0f63c06e87ff" + "0.4.0": + url: "https://github.com/spnda/fastgltf/archive/refs/tags/v0.4.0.tar.gz" + sha256: "77debe12acb6b498ea77306ce64277cedb14ad803b461ea677a61bc604bb59b5" +patches: + "0.5.0": + - patch_file: "patches/0.5.0-0001-find_package-simdjson.patch" + patch_description: "find_package simdjson" + patch_type: "conan" + patch_source: "https://github.com/spnda/fastgltf/issues/22" diff --git a/recipes/fastgltf/all/conanfile.py b/recipes/fastgltf/all/conanfile.py new file mode 100644 index 0000000000000..133ac9360d184 --- /dev/null +++ b/recipes/fastgltf/all/conanfile.py @@ -0,0 +1,98 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +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 + +import os + +required_conan_version = ">=1.59.0" + + +class fastgltf(ConanFile): + name = "fastgltf" + description = "A blazing fast C++17 glTF 2.0 library powered by SIMD." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/spnda/fastgltf" + topics = ("gltf", "simd", "cpp17") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_small_vector": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_small_vector": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder='src') + + def requirements(self): + self.requires("simdjson/3.2.0") + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FASTGLTF_DOWNLOAD_SIMDJSON"] = False + if self.options.enable_small_vector: + tc.variables["FASTGLTF_USE_SMALL_VECTOR"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["fastgltf"] diff --git a/recipes/fastgltf/all/patches/0.5.0-0001-find_package-simdjson.patch b/recipes/fastgltf/all/patches/0.5.0-0001-find_package-simdjson.patch new file mode 100644 index 0000000000000..488ed53394d16 --- /dev/null +++ b/recipes/fastgltf/all/patches/0.5.0-0001-find_package-simdjson.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f76a8d8..27c1d1a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -74,6 +74,8 @@ if (FASTGLTF_DOWNLOAD_SIMDJSON) + NAMESPACE fastgltf:: + DESTINATION lib/cmake/fastgltf + ) ++else() ++ find_package(simdjson CONFIG REQUIRED) + endif() + + # Create the library target diff --git a/recipes/fastgltf/all/test_package/CMakeLists.txt b/recipes/fastgltf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7718a933cdc53 --- /dev/null +++ b/recipes/fastgltf/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(fastgltf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fastgltf::fastgltf) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if(fastgltf_VERSION VERSION_GREATER_EQUAL "0.5.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE FASTGLTF_0_5_0_LATER) +endif() diff --git a/recipes/fastgltf/all/test_package/conanfile.py b/recipes/fastgltf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/fastgltf/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/fastgltf/all/test_package/test_package.cpp b/recipes/fastgltf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1e9f5938b4446 --- /dev/null +++ b/recipes/fastgltf/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#ifdef FASTGLTF_0_5_0_LATER +# include +#else +# include +#endif + +#include +#include + +int main() { +#ifdef FASTGLTF_0_5_0_LATER + // gcc < 11 uses pthread_once for std::call_once. + // there is an known bug about pthread_once with older glibc. + // This is workaround for that. + // see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60662 + std::this_thread::sleep_for(std::chrono::milliseconds(1)); +#endif + + fastgltf::Parser parser; + printf("Version: " FASTGLTF_QUOTE(FASTGLTF_VERSION) "\n"); + printf("C++17: " FASTGLTF_QUOTE(FASTGLTF_CPP_17) "\n"); + printf("C++20: " FASTGLTF_QUOTE(FASTGLTF_CPP_20) "\n"); +} diff --git a/recipes/fastgltf/all/test_v1_package/CMakeLists.txt b/recipes/fastgltf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/fastgltf/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/fastgltf/all/test_v1_package/conanfile.py b/recipes/fastgltf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/fastgltf/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/fastgltf/config.yml b/recipes/fastgltf/config.yml new file mode 100644 index 0000000000000..d13fcfd021b7b --- /dev/null +++ b/recipes/fastgltf/config.yml @@ -0,0 +1,5 @@ +versions: + "0.5.0": + folder: all + "0.4.0": + folder: all diff --git a/recipes/fernandovelcic-hexdump/all/conanfile.py b/recipes/fernandovelcic-hexdump/all/conanfile.py index 0f297f7cfa6c3..5497ae1f74ccd 100644 --- a/recipes/fernandovelcic-hexdump/all/conanfile.py +++ b/recipes/fernandovelcic-hexdump/all/conanfile.py @@ -1,24 +1,46 @@ -from conans import ConanFile, tools +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class FernandoVelcicHexdumpConan(ConanFile): name = "fernandovelcic-hexdump" description = "A header-only hexdump library." license = ["BSD-3-Clause"] - topics = ("hexadecimal", "hexdump", "inspection", "debug") - homepage = "https://github.com/FernandoVelcic/hexdump" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/FernandoVelcic/hexdump" + topics = ("hexadecimal", "hexdump", "inspection", "debug", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - self.copy(pattern="hexdump.hpp", dst="include", src=self._source_subfolder) + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="hexdump.hpp", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/fernandovelcic-hexdump/all/test_package/CMakeLists.txt b/recipes/fernandovelcic-hexdump/all/test_package/CMakeLists.txt index 5e81affac8e80..3d3b2a5ec56bc 100644 --- a/recipes/fernandovelcic-hexdump/all/test_package/CMakeLists.txt +++ b/recipes/fernandovelcic-hexdump/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(fernandovelcic-hexdump CONFIG REQUIRED) diff --git a/recipes/fernandovelcic-hexdump/all/test_package/conanfile.py b/recipes/fernandovelcic-hexdump/all/test_package/conanfile.py index 84ee68733e516..ef5d7042163ec 100644 --- a/recipes/fernandovelcic-hexdump/all/test_package/conanfile.py +++ b/recipes/fernandovelcic-hexdump/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/fernandovelcic-hexdump/all/test_package/test_package.cpp b/recipes/fernandovelcic-hexdump/all/test_package/test_package.cpp index d9f8d0c243fcc..878b57bcdb438 100644 --- a/recipes/fernandovelcic-hexdump/all/test_package/test_package.cpp +++ b/recipes/fernandovelcic-hexdump/all/test_package/test_package.cpp @@ -29,6 +29,6 @@ int main(int argc, char **argv) testCustomHexdumpBase(); testCustomHexdumpBase(); testCustomHexdumpBase(); - + return 0; } diff --git a/recipes/fernandovelcic-hexdump/all/test_v1_package/CMakeLists.txt b/recipes/fernandovelcic-hexdump/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/fernandovelcic-hexdump/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/fernandovelcic-hexdump/all/test_v1_package/conanfile.py b/recipes/fernandovelcic-hexdump/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..84ee68733e516 --- /dev/null +++ b/recipes/fernandovelcic-hexdump/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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fff/all/conanfile.py b/recipes/fff/all/conanfile.py index b4367b0a79cab..04306861f2e25 100644 --- a/recipes/fff/all/conanfile.py +++ b/recipes/fff/all/conanfile.py @@ -1,26 +1,46 @@ -from conans import ConanFile, tools import os -class TypeSafe(ConanFile): - name = 'fff' - description = 'A testing micro framework for creating function test doubles' - url = 'https://github.com/conan-io/conan-center-index' - homepage = 'https://github.com/meekrosoft/fff' - license = 'MIT' - topics = 'conan', 'c', 'c++', 'embedded', 'tdd', 'micro-framework', 'fake-functions' +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +required_conan_version = ">=1.52.0" + + +class FffConan(ConanFile): + name = "fff" + description = "A testing micro framework for creating function test doubles" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/meekrosoft/fff" + topics = ("c", "c++", "embedded", "tdd", "micro-framework", "fake-functions", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() 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("LICENSE*", dst="licenses", src=self._source_subfolder) - self.copy("fff.h", dst="include", src=self._source_subfolder) + copy( + self, + "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + copy( + self, + "fff.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/fff/all/test_package/CMakeLists.txt b/recipes/fff/all/test_package/CMakeLists.txt index 196188113685c..7547d9c0590d3 100644 --- a/recipes/fff/all/test_package/CMakeLists.txt +++ b/recipes/fff/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(fff REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE fff::fff) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fff/all/test_package/conanfile.py b/recipes/fff/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/fff/all/test_package/conanfile.py +++ b/recipes/fff/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/fff/all/test_package/test_package.cpp b/recipes/fff/all/test_package/test_package.cpp index 80fdb032c8ac4..fabe3f8985bb5 100644 --- a/recipes/fff/all/test_package/test_package.cpp +++ b/recipes/fff/all/test_package/test_package.cpp @@ -1,16 +1,16 @@ -#include -#include "fff.h" +#include + +#include DEFINE_FFF_GLOBALS; FAKE_VOID_FUNC(TestFunction, uint32_t, uint8_t); -int main() -{ - RESET_FAKE(TestFunction); - FFF_RESET_HISTORY(); - - TestFunction(8, 16); - - return 0; +int main() { + RESET_FAKE(TestFunction); + FFF_RESET_HISTORY(); + + TestFunction(8, 16); + + return 0; } diff --git a/recipes/ffmpeg/all/conandata.yml b/recipes/ffmpeg/all/conandata.yml index 89651174ed1ed..d7a1adb10f829 100644 --- a/recipes/ffmpeg/all/conandata.yml +++ b/recipes/ffmpeg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.0": + url: "https://ffmpeg.org/releases/ffmpeg-6.0.tar.bz2" + sha256: "47d062731c9f66a78380e35a19aac77cebceccd1c7cc309b9c82343ffc430c3d" "5.1": url: "https://ffmpeg.org/releases/ffmpeg-5.1.tar.bz2" sha256: "32b56fb01ce90d452958ae25e91c9564abf49ed5453c127bec23c63e530aa8fa" diff --git a/recipes/ffmpeg/all/conanfile.py b/recipes/ffmpeg/all/conanfile.py index b68accaf3f292..67048e13ce52b 100644 --- a/recipes/ffmpeg/all/conanfile.py +++ b/recipes/ffmpeg/all/conanfile.py @@ -277,7 +277,7 @@ def requirements(self): if self.options.with_zeromq: self.requires("zeromq/4.3.4") if self.options.with_sdl: - self.requires("sdl/2.26.1") + self.requires("sdl/2.26.5") if self.options.with_libx264: self.requires("libx264/cci.20220602") if self.options.with_libx265: diff --git a/recipes/ffmpeg/config.yml b/recipes/ffmpeg/config.yml index c829a400b90aa..5596a0ba4cf84 100644 --- a/recipes/ffmpeg/config.yml +++ b/recipes/ffmpeg/config.yml @@ -1,4 +1,6 @@ versions: + "6.0": + folder: "all" "5.1": folder: "all" "5.0": diff --git a/recipes/fire-hpp/all/conanfile.py b/recipes/fire-hpp/all/conanfile.py index e2770d10a2f50..79b1be52cfefe 100644 --- a/recipes/fire-hpp/all/conanfile.py +++ b/recipes/fire-hpp/all/conanfile.py @@ -1,43 +1,54 @@ -from conans import ConanFile, CMake, tools import os +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 copy, get, rmdir + +required_conan_version = ">=1.52.0" + + class FireHppConan(ConanFile): name = "fire-hpp" - homepage = "https://github.com/kongaskristjan/fire-hpp" - url = "https://github.com/conan-io/conan-center-index" description = "Fire for C++: Create fully functional CLIs using function signatures" - topics = ("command-line", "argument", "parser") license = "BSL-1.0" - no_copy_source = True - settings = "os", "arch", "compiler", "build_type" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kongaskristjan/fire-hpp" + topics = ("command-line", "argument", "parser", "header-only") - _source_subfolder = "source_subfolder" - _build_subfolder = "build_subfolder" - _cmake = None + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" def configure(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "{}-{}".format(self.name, self.version) - os.rename(extracted_dir, self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["FIRE_EXAMPLES"] = False - self._cmake.definitions["FIRE_UNIT_TESTS"] = False - self._cmake.configure(source_folder=self._source_subfolder, build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FIRE_EXAMPLES"] = False + tc.variables["FIRE_UNIT_TESTS"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy("LICENCE", dst="licenses", src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, "lib")) + copy(self, "LICENCE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + rmdir(self, os.path.join(self.package_folder, "lib")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/fire-hpp/all/test_package/CMakeLists.txt b/recipes/fire-hpp/all/test_package/CMakeLists.txt index 520f51ea73d4a..8068292a31341 100644 --- a/recipes/fire-hpp/all/test_package/CMakeLists.txt +++ b/recipes/fire-hpp/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -find_package(fire-hpp REQUIRED) +find_package(fire-hpp REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE fire-hpp::fire-hpp) diff --git a/recipes/fire-hpp/all/test_package/conanfile.py b/recipes/fire-hpp/all/test_package/conanfile.py index b6680c7d91280..1d145d1d569ec 100644 --- a/recipes/fire-hpp/all/test_package/conanfile.py +++ b/recipes/fire-hpp/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,7 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - bin_args = "-x=1 -y=2" - self.run("{} {}".format(bin_path, bin_args), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(f"{bin_path} -x=1 -y=2", env="conanrun") diff --git a/recipes/fire-hpp/all/test_package/test_package.cpp b/recipes/fire-hpp/all/test_package/test_package.cpp index 614e5b1984d23..39e02ea0720f9 100644 --- a/recipes/fire-hpp/all/test_package/test_package.cpp +++ b/recipes/fire-hpp/all/test_package/test_package.cpp @@ -2,8 +2,8 @@ #include int fired_main(int x = fire::arg("-x"), int y = fire::arg("-y")) { - std::cout << x + y << std::endl; - return 0; + std::cout << x + y << std::endl; + return 0; } FIRE(fired_main) diff --git a/recipes/flatbush/all/conandata.yml b/recipes/flatbush/all/conandata.yml index 3d50fc3bd1efd..f43d2fb04fed7 100644 --- a/recipes/flatbush/all/conandata.yml +++ b/recipes/flatbush/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.0": + url: "https://github.com/chusitoo/flatbush/archive/refs/tags/v1.2.0.zip" + sha256: "d8d0471ad6aba1e4b1160abc38a0fe21a35e3ea1c2a9509ce9910072f7fc24bb" "1.1.0": url: "https://github.com/chusitoo/flatbush/archive/refs/tags/v1.1.0.zip" sha256: "3ef034110b0ea6f7514d3cdc362976e2a9ab321cc9e4b2c847167ad26df0c0f1" diff --git a/recipes/flatbush/all/conanfile.py b/recipes/flatbush/all/conanfile.py index c9dd4bc6e1a67..b97d78e5d781a 100644 --- a/recipes/flatbush/all/conanfile.py +++ b/recipes/flatbush/all/conanfile.py @@ -1,25 +1,49 @@ -from conans import ConanFile, tools +import os + +from conan import ConanFile +from conan.tools.build import valid_min_cppstd, check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class FlatbushConan(ConanFile): name = "flatbush" - license = "MIT" - homepage = "https://github.com/chusitoo/flatbush" description = "Flatbush for C++" - topics = ("header-only", "flatbush", "r-tree", "hilbert", "zero-copy", "spatial-index") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/chusitoo/flatbush" + topics = ("header-only", "r-tree", "hilbert", "zero-copy", "spatial-index") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True) + @property + def _min_cppstd(self): + return 11 - def package(self): - self.copy(pattern="LICENSE", dst="licenses") - self.copy(pattern="flatbush.h", dst="include") + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "flatbush.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) def package_info(self): - if not tools.valid_min_cppstd(self, "20"): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if not valid_min_cppstd(self, "20"): self.cpp_info.defines = ["FLATBUSH_SPAN"] diff --git a/recipes/flatbush/all/test_package/CMakeLists.txt b/recipes/flatbush/all/test_package/CMakeLists.txt index 6ad4f7bcfdd6b..96d337017953c 100644 --- a/recipes/flatbush/all/test_package/CMakeLists.txt +++ b/recipes/flatbush/all/test_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -project(test_package VERSION 1.0.0 LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) -find_package(flatbush CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} "test_package.cpp") +find_package(flatbush REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} flatbush::flatbush) - set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/flatbush/all/test_package/conanfile.py b/recipes/flatbush/all/test_package/conanfile.py index 5b0ef1df32f11..fae501d0afb9e 100644 --- a/recipes/flatbush/all/test_package/conanfile.py +++ b/recipes/flatbush/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools -from conans.tools import Version +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" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/flatbush/all/test_package/test_package.cpp b/recipes/flatbush/all/test_package/test_package.cpp index 36860193e4ed8..1db2b51eded51 100644 --- a/recipes/flatbush/all/test_package/test_package.cpp +++ b/recipes/flatbush/all/test_package/test_package.cpp @@ -24,8 +24,7 @@ SOFTWARE. #include "flatbush.h" -int main(int argc, char** argv) -{ +int main() { flatbush::FlatbushBuilder wBuilder; wBuilder.add({ 0, 0, 0, 0 }); auto wIndex = wBuilder.finish(); diff --git a/recipes/flatbush/all/test_v1_package/CMakeLists.txt b/recipes/flatbush/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/flatbush/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/flatbush/all/test_v1_package/conanfile.py b/recipes/flatbush/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5b0ef1df32f11 --- /dev/null +++ b/recipes/flatbush/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +from conans.tools import Version +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/flatbush/config.yml b/recipes/flatbush/config.yml index 11b7aff3a5ac4..2424e32f70b3e 100644 --- a/recipes/flatbush/config.yml +++ b/recipes/flatbush/config.yml @@ -1,3 +1,5 @@ versions: + "1.2.0": + folder: "all" "1.1.0": folder: "all" diff --git a/recipes/flecs/all/conandata.yml b/recipes/flecs/all/conandata.yml index d95e9e88c952a..cdf9c604ba992 100644 --- a/recipes/flecs/all/conandata.yml +++ b/recipes/flecs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.4": + url: "https://github.com/SanderMertens/flecs/archive/v3.2.4.tar.gz" + sha256: "0b65426053418911cae1c3f347748fba6eb7d4ae8860ce7fcc91ef25f386d4a1" "3.1.4": url: "https://github.com/SanderMertens/flecs/archive/v3.1.4.tar.gz" sha256: "cc73d529ddc47891fc16c7dd965ca9c4239d1caccae024c81364bf3d49286fe0" diff --git a/recipes/flecs/config.yml b/recipes/flecs/config.yml index 6dd38fdadfe17..629ecd74c6c0c 100644 --- a/recipes/flecs/config.yml +++ b/recipes/flecs/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.4": + folder: all "3.1.4": folder: all "3.1.3": diff --git a/recipes/fontconfig/meson/conanfile.py b/recipes/fontconfig/meson/conanfile.py index 7effda31e1c9d..dc1462585f4ec 100644 --- a/recipes/fontconfig/meson/conanfile.py +++ b/recipes/fontconfig/meson/conanfile.py @@ -56,7 +56,7 @@ def requirements(self): def build_requirements(self): self.tool_requires("gperf/3.1") - self.tool_requires("meson/1.0.1") + self.tool_requires("meson/1.1.1") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/1.9.3") diff --git a/recipes/foxglove-schemas-protobuf/all/CMakeLists.txt b/recipes/foxglove-schemas-protobuf/all/CMakeLists.txt new file mode 100644 index 0000000000000..a8497dc9f144a --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/all/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 3.15) +project(Foxglove-Schemas CXX) + +find_package(Protobuf 3 REQUIRED) + +FILE(GLOB all_protos "schemas/proto/foxglove/*.proto") + +# Create lists of all the generated headers and sources +FOREACH(f ${all_protos}) + file(RELATIVE_PATH f ${CMAKE_CURRENT_SOURCE_DIR}/schemas/proto ${f}) + STRING(REGEX REPLACE "\\.proto$" "" f ${f}) + LIST(APPEND proto_headers "${CMAKE_CURRENT_SOURCE_DIR}/autogenerated/${f}.pb.h") + LIST(APPEND proto_sources "${CMAKE_CURRENT_SOURCE_DIR}/autogenerated/${f}.pb.cc") +ENDFOREACH(f) + +LIST(APPEND proto_sources ${proto_headers}) + +# Create a directory for the generated files +FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/autogenerated) + +# Execute the protoc compiler +add_custom_command( + OUTPUT ${proto_sources} + COMMAND ${CMAKE_COMMAND} -E make_directory autogenerated + COMMAND ${Protobuf_PROTOC_EXECUTABLE} --proto_path=${CMAKE_CURRENT_SOURCE_DIR}/schemas/proto --cpp_out=${CMAKE_CURRENT_SOURCE_DIR}/autogenerated ${all_protos} +) + +add_library(foxglove_schemas_protobuf ${proto_sources}) + +target_include_directories(foxglove_schemas_protobuf PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/autogenerated) + +target_link_libraries(foxglove_schemas_protobuf PUBLIC protobuf::libprotobuf) + +set_property(TARGET foxglove_schemas_protobuf PROPERTY CXX_STANDARD 17) + + +# Set all the headers as public so they are installed and add the proto files since they should also be installed in the include directory +LIST(APPEND proto_headers ${all_protos}) +set_target_properties(foxglove_schemas_protobuf PROPERTIES PUBLIC_HEADER "${proto_headers}" ) + + +install(TARGETS foxglove_schemas_protobuf + LIBRARY DESTINATION lib + PUBLIC_HEADER DESTINATION include/foxglove) diff --git a/recipes/foxglove-schemas-protobuf/all/conandata.yml b/recipes/foxglove-schemas-protobuf/all/conandata.yml new file mode 100644 index 0000000000000..658f5043f7c66 --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + 0.1.0: + url: https://github.com/foxglove/schemas/archive/refs/tags/releases/python/foxglove-schemas-protobuf/v0.1.0.tar.gz + sha256: 42153b62000c0c614301ecd2b9173c69f467dd543db3328a1b0491bce8ee5594 diff --git a/recipes/foxglove-schemas-protobuf/all/conanfile.py b/recipes/foxglove-schemas-protobuf/all/conanfile.py new file mode 100644 index 0000000000000..5a5291f2d6ec4 --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, apply_conandata_patches, export_conandata_patches +from conan.tools.microsoft import check_min_vs +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + + +class FoxgloveSchemasProtobufConan(ConanFile): + name = "foxglove-schemas-protobuf" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/foxglove/schemas" + description = "Protobuf schemas for Foxglove" + license = "MIT" + topics = ("foxglove", "protobuf", "schemas") + + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps" + package_type = "library" + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "msvc": "191", + "gcc": "9", + "clang": "9", + "apple-clang": "12", + } + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=(self.export_sources_folder + "/src")) + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, self._compilers_minimum_version["msvc"]) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("Windows shared builds are not supported yet.") + + def build_requirements(self): + self.tool_requires("protobuf/3.21.9") + + def requirements(self): + self.requires("protobuf/3.21.9", transitive_headers=True, transitive_libs=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.configure() + cmake.install() + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.libs = ["foxglove_schemas_protobuf"] diff --git a/recipes/foxglove-schemas-protobuf/all/test_package/CMakeLists.txt b/recipes/foxglove-schemas-protobuf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..793bfe03abb6b --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(foxglove-schemas-protobuf CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} foxglove-schemas-protobuf::foxglove-schemas-protobuf) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) diff --git a/recipes/foxglove-schemas-protobuf/all/test_package/conanfile.py b/recipes/foxglove-schemas-protobuf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8d2d8af87e4f6 --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.build import can_run +import os + + +class TestPackageConan(ConanFile): + settings = ("os", "arch", "compiler", "build_type") + generators = "CMakeDeps", "CMakeToolchain" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/foxglove-schemas-protobuf/all/test_package/test_package.cpp b/recipes/foxglove-schemas-protobuf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..264f429e55dee --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + + +int main() { + foxglove::SceneUpdate msg; + auto* entity = msg.add_entities(); + return 0; +} diff --git a/recipes/foxglove-schemas-protobuf/config.yml b/recipes/foxglove-schemas-protobuf/config.yml new file mode 100644 index 0000000000000..684647742e06b --- /dev/null +++ b/recipes/foxglove-schemas-protobuf/config.yml @@ -0,0 +1,3 @@ +versions: + 0.1.0: + folder: all diff --git a/recipes/freeimage/all/conanfile.py b/recipes/freeimage/all/conanfile.py index 11a3b438484c7..5f0684be02c51 100644 --- a/recipes/freeimage/all/conanfile.py +++ b/recipes/freeimage/all/conanfile.py @@ -77,9 +77,9 @@ def requirements(self): if self.options.with_jpeg2000: self.requires("openjpeg/2.5.0") if self.options.with_png: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_webp: - self.requires("libwebp/1.3.0") + self.requires("libwebp/1.3.1") if self.options.with_tiff or self.options.with_openexr: # can't upgrade to openexr/3.x.x because plugin tiff requires openexr/2.x.x header files self.requires("openexr/2.5.7") @@ -89,7 +89,7 @@ def requirements(self): if self.options.with_jxr: self.requires("jxrlib/cci.20170615") if self.options.with_tiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.5.1") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/freetype/all/conanfile.py b/recipes/freetype/all/conanfile.py index 907eedb701583..2d1c5c126ce10 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -64,7 +64,7 @@ def layout(self): def requirements(self): if self.options.with_png: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_zlib: self.requires("zlib/1.2.13") if self.options.with_bzip2: diff --git a/recipes/gdcm/all/conanfile.py b/recipes/gdcm/all/conanfile.py index f32e56dd3a6fd..d7959e0134184 100644 --- a/recipes/gdcm/all/conanfile.py +++ b/recipes/gdcm/all/conanfile.py @@ -27,12 +27,14 @@ class GDCMConan(ConanFile): "fPIC": [True, False], "with_json": [True, False], "with_openssl": [True, False], + "with_zlibng": [True, False], } default_options = { "shared": False, "fPIC": True, "with_json": True, "with_openssl": True, + "with_zlibng": False, } @property @@ -56,7 +58,10 @@ def layout(self): def requirements(self): self.requires("expat/2.5.0") self.requires("openjpeg/2.5.0") - self.requires("zlib/1.2.13") + if self.options.with_zlibng: + self.requires("zlib-ng/2.0.7") + else: + self.requires("zlib/1.2.13") if self.settings.os != "Windows": self.requires("libuuid/1.0.3") if Version(self.version) >= Version("3.0.20"): @@ -71,6 +76,10 @@ def validate(self): check_min_cppstd(self, self._min_cppstd) if is_msvc_static_runtime(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} does not support shared and static runtime together.") + if self.info.options.with_zlibng: + zlib_ng = self.dependencies["zlib-ng"] + if not zlib_ng.options.zlib_compat: + raise ConanInvalidConfiguration(f"{self.ref} requires the dependency option zlib-ng:zlib_compat=True") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -222,7 +231,11 @@ def package_info(self): if self.options.with_openssl: self.cpp_info.components["gdcmCommon"].requires.append("openssl::openssl") - self.cpp_info.components["gdcmDSED"].requires.extend(["gdcmCommon", "zlib::zlib"]) + + def zlib(): + return "zlib-ng::zlib-ng" if self.options.with_zlibng else "zlib::zlib" + + self.cpp_info.components["gdcmDSED"].requires.extend(["gdcmCommon", zlib()]) self.cpp_info.components["gdcmIOD"].requires.extend(["gdcmDSED", "gdcmCommon", "expat::expat"]) self.cpp_info.components["gdcmMSFF"].requires.extend(["gdcmIOD", "gdcmDSED", "gdcmDICT", "openjpeg::openjpeg"]) if self.options.with_json: diff --git a/recipes/glaze/all/conandata.yml b/recipes/glaze/all/conandata.yml index 59c05f33d67c1..9a250bd76e55c 100644 --- a/recipes/glaze/all/conandata.yml +++ b/recipes/glaze/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.3.2": + url: "https://github.com/stephenberry/glaze/archive/v1.3.2.tar.gz" + sha256: "c7dd5fd8da63708328e02efbaa91f58df5573114a11c91ae025b711cb0d7f7ab" + "1.3.1": + url: "https://github.com/stephenberry/glaze/archive/v1.3.1.tar.gz" + sha256: "898f86a1dd72ca4e227aad2a76dea8d1e72bf28bad1e6467a6ab1b97848664f0" + "1.3.0": + url: "https://github.com/stephenberry/glaze/archive/v1.3.0.tar.gz" + sha256: "2787efdba0f33adbf73a3b574efedefcda6e8ae2da0a0c8e01be3194898ecd99" "1.2.6": url: "https://github.com/stephenberry/glaze/archive/v1.2.6.tar.gz" sha256: "ef602f1efc7f84669de517181cb091c136e2b9372c176947d0940ebd6c2f2d98" @@ -20,43 +29,11 @@ sources: "0.3.6": url: "https://github.com/stephenberry/glaze/archive/v0.3.6.tar.gz" sha256: "bc87d4fd458f0634a146d6f4c902a952b66c3f718c3e20f680b99066224b51a1" - "0.3.5": - url: "https://github.com/stephenberry/glaze/archive/v0.3.5.tar.gz" - sha256: "4a3e81a4862b57a21b03ed6d5b823397291e50e7b7d24944cc4932c5ae256cf7" - "0.3.2": - url: "https://github.com/stephenberry/glaze/archive/v0.3.2.tar.gz" - sha256: "41f19b1b4872a637ecb63bccb07578255f54c8842faf1bab78779e6342b2fa7e" "0.2.2": url: "https://github.com/stephenberry/glaze/archive/v0.2.2.tar.gz" sha256: "d0d2edcc546b0ebb4bedaeedfb4a54aa678a6fdffa6b20dd6b252ef6325a9e75" - "0.2.1": - url: "https://github.com/stephenberry/glaze/archive/v0.2.1.tar.gz" - sha256: "dcf9ddf51b186dbc4cfd3b9324f9ee238cc1ba46fc2a62effa9293971ac4d1d4" - "0.2.0": - url: "https://github.com/stephenberry/glaze/archive/v0.2.0.tar.gz" - sha256: "2ad0d91f89465eac94efbeb91e435a5b36b7d54c9d8d6ccfb0708f6c6c0c5f87" - "0.1.8": - url: "https://github.com/stephenberry/glaze/archive/v0.1.8.tar.gz" - sha256: "8268ec2a8e0f2d9de2e65830ad9f7a623577c7bd47d465d4c6e4bed9d266ad48" - "0.1.7": - url: "https://github.com/stephenberry/glaze/archive/v0.1.7.tar.gz" - sha256: "7dc31ceaa444fd92339a48a69be638e92daa2858c3228f347b1df54a824b8f62" - "0.1.4": - url: "https://github.com/stephenberry/glaze/archive/v0.1.4.tar.gz" - sha256: "dd46e77973fe5b3cf4cd68fd597ba6b1010ecffd3e10cd8ccbd6cd615e6ffaff" - "0.0.7": - url: "https://github.com/stephenberry/glaze/archive/refs/tags/v0.0.7.tar.gz" - sha256: "124f7e8fea58c012b548ba1b643684fe428c7dbfeb8d8a5f701eb7db4356a759" patches: "0.2.2": - patch_file: "patches/0.2.0-0001-use-cci-frozen.patch" patch_description: "use cci's frozen" patch_type: "conan" - "0.2.1": - - patch_file: "patches/0.2.0-0001-use-cci-frozen.patch" - patch_description: "use cci's frozen" - patch_type: "conan" - "0.2.0": - - patch_file: "patches/0.2.0-0001-use-cci-frozen.patch" - patch_description: "use cci's frozen" - patch_type: "conan" diff --git a/recipes/glaze/config.yml b/recipes/glaze/config.yml index 5039876977670..c9458b20872be 100644 --- a/recipes/glaze/config.yml +++ b/recipes/glaze/config.yml @@ -1,4 +1,10 @@ versions: + "1.3.2": + folder: all + "1.3.1": + folder: all + "1.3.0": + folder: all "1.2.6": folder: all "1.2.5": @@ -13,21 +19,5 @@ versions: folder: all "0.3.6": folder: all - "0.3.5": - folder: all - "0.3.2": - folder: all "0.2.2": folder: all - "0.2.1": - folder: all - "0.2.0": - folder: all - "0.1.8": - folder: all - "0.1.7": - folder: all - "0.1.4": - folder: all - "0.0.7": - folder: all diff --git a/recipes/glext/all/conanfile.py b/recipes/glext/all/conanfile.py index 746356cd3af89..3cbf2eff985c1 100644 --- a/recipes/glext/all/conanfile.py +++ b/recipes/glext/all/conanfile.py @@ -1,35 +1,51 @@ import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import copy, download, load, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" -required_conan_version = ">=1.37.0" class GlextConan(ConanFile): name = "glext" + description = "OpenGL 1.2 and above compatibility profile and extension interfaces" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.khronos.org/registry/OpenGL/index_gl.php" - description = "OpenGL 1.2 and above compatibility profile and extension interfaces" - topics = ("opengl", "gl", "glext") + topics = ("opengl", "gl", "glext", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): self.requires("opengl/system") self.requires("khrplatform/cci.20200529") + def package_id(self): + self.info.clear() + def source(self): - tools.download(filename="glext.h", **self.conan_data["sources"][self.version]) + download(self, filename="glext.h", **self.conan_data["sources"][self.version]) - def package(self): - self.copy(pattern="glext.h", dst=os.path.join("include", "GL")) - license_data = tools.load(os.path.join(self.source_folder, "glext.h")) + def _extract_license(self): + license_data = load(self, os.path.join(self.source_folder, "glext.h")) begin = license_data.find("/*") + len("/*") end = license_data.find("*/") license_data = license_data[begin:end] license_data = license_data.replace("**", "") - tools.save("LICENSE", license_data) - self.copy("LICENSE", dst="licenses") + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_data) - def package_id(self): - self.info.header_only() + def package(self): + self._extract_license() + copy(self, "glext.h", + dst=os.path.join(self.package_folder, "include", "GL"), + src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/glext/all/test_package/CMakeLists.txt b/recipes/glext/all/test_package/CMakeLists.txt index b455e673a3ef0..02474af2d5d00 100644 --- a/recipes/glext/all/test_package/CMakeLists.txt +++ b/recipes/glext/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - find_package(glext REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/glext/all/test_package/conanfile.py b/recipes/glext/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/glext/all/test_package/conanfile.py +++ b/recipes/glext/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/glib/all/conandata.yml b/recipes/glib/all/conandata.yml index 86a2b24a9d299..a457da4866ed6 100644 --- a/recipes/glib/all/conandata.yml +++ b/recipes/glib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.77.0": + url: "https://download.gnome.org/sources/glib/2.77/glib-2.77.0.tar.xz" + sha256: "1897fd8ad4ebb523c32fabe7508c3b0b039c089661ae1e7917df0956a320ac4d" "2.76.3": url: "https://download.gnome.org/sources/glib/2.76/glib-2.76.3.tar.xz" sha256: "c0be444e403d7c3184d1f394f89f0b644710b5e9331b54fa4e8b5037813ad32a" diff --git a/recipes/glib/config.yml b/recipes/glib/config.yml index 362adfbe65783..709e827338b68 100644 --- a/recipes/glib/config.yml +++ b/recipes/glib/config.yml @@ -1,4 +1,6 @@ versions: + "2.77.0": + folder: all "2.76.3": folder: all "2.76.2": diff --git a/recipes/glpk/all/conanfile.py b/recipes/glpk/all/conanfile.py index e03f104fe6d73..7c7e12af60356 100644 --- a/recipes/glpk/all/conanfile.py +++ b/recipes/glpk/all/conanfile.py @@ -1,10 +1,15 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conan.tools.files import rename -from conan.tools.microsoft import is_msvc -from contextlib import contextmanager +from conan import ConanFile, conan_version +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 copy, 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 import os -required_conan_version = ">=1.45.0" +required_conan_version = ">=1.54.0" class GlpkConan(ConanFile): @@ -14,137 +19,98 @@ class GlpkConan(ConanFile): topics = ("linear", "programming", "simplex", "solver") url = "https://github.com/conan-io/conan-center-index" license = "GPL-3.0-or-later" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], } - default_options = { "shared": False, "fPIC": True, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) - @property - def _user_info_build(self): - return getattr(self, "user_info_build", self.deps_user_info) - - def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC 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.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") def build_requirements(self): - self.build_requires("libtool/2.4.6") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, - destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") - @contextmanager - def _build_context(self): + tc = AutotoolsToolchain(self) if is_msvc(self): - with tools.vcvars(self): - env = { - "CC": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - "CXX": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - "LD": "{} link -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - "AR": "{} lib".format(tools.unix_path(self._user_info_build["automake"].ar_lib)), - } - with tools.environment_append(env): - yield - else: - yield - - def _patch_source(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with tools.chdir(self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows, run_environment=True) - tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), - r"-install_name \$rpath/", - "-install_name @rpath/") - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - - self._autotools.libs = [] - yes_no = lambda v: "yes" if v else "no" - args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - "--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True))) - ] + tc.extra_defines.append("__WOE__") + if (Version(conan_version).major < "2" and self.settings.compiler == "Visual Studio" \ + and Version(self.settings.compiler.version) >= "12") or \ + (self.settings.compiler == "msvc" and Version(self.settings.compiler.version) >= "180"): + tc.extra_cflags.append("-FS") + tc.generate() if is_msvc(self): - self._autotools.defines.append("__WOE__") - if self.settings.compiler == "Visual Studio" and \ - tools.Version(self.settings.compiler.version) >= "12": - self._autotools.flags.append("-FS") - self._autotools.configure(args=args, configure_dir=self._source_subfolder) - return self._autotools + env = Environment() + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_msvc") def build(self): - #self._patch_source() - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + 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: pjoin = lambda p: os.path.join(self.package_folder, "lib", p) rename(self, pjoin("glpk.dll.lib"), pjoin("glpk.lib")) def package_info(self): - self.cpp_info.set_property("cmake_find_mode", "both") - self.cpp_info.set_property("cmake_file_name", "glpk") - self.cpp_info.set_property("cmake_target_name", "glpk::glpk") - self.cpp_info.set_property("pkg_config_name", "glpk") - - self.cpp_info.components["libglpk"].set_property("cmake_target_name", "glpk::glpk") - self.cpp_info.components["libglpk"].libs = ["glpk"] - - if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.components["libglpk"].system_libs = ["m"] - - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment var: {}".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"] = "glpk" - self.cpp_info.names["cmake_find_package_multi"] = "glpk" - self.cpp_info.components["libglpk"].names["cmake_find_package"] = "glpk" - self.cpp_info.components["libglpk"].names["cmake_find_package_multi"] = "glpk" - + self.cpp_info.libs = ["glpk"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/glpk/all/test_package/CMakeLists.txt b/recipes/glpk/all/test_package/CMakeLists.txt index 3258d5f78ee30..b283b9e10c4e0 100644 --- a/recipes/glpk/all/test_package/CMakeLists.txt +++ b/recipes/glpk/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(glpk CONFIG REQUIRED) +find_package(glpk REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE glpk::glpk) diff --git a/recipes/glpk/all/test_package/conanfile.py b/recipes/glpk/all/test_package/conanfile.py index 66177d47bc143..0a6bc68712d90 100644 --- a/recipes/glpk/all/test_package/conanfile.py +++ b/recipes/glpk/all/test_package/conanfile.py @@ -1,17 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools -class GlpkTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" - #def build_requirements(self): - # if self.settings.os == "Macos" and self.settings.arch == "armv8": - # # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being - # # set. This could be because you are using a Mac OS X version less than 10.5 - # # or because CMake's platform configuration is corrupt. - # self.build_requires("cmake/3.20.1") + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -19,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/glpk/all/test_package/test_package.c b/recipes/glpk/all/test_package/test_package.c index 965bd82a292c4..4c43ab6e7eb91 100644 --- a/recipes/glpk/all/test_package/test_package.c +++ b/recipes/glpk/all/test_package/test_package.c @@ -11,44 +11,43 @@ int main(void) { glp_prob *lp; int ia[1+1000], ja[1+1000]; double ar[1+1000], z, x1, x2, x3; -s1: lp = glp_create_prob(); -s2: glp_set_prob_name(lp, "sample"); -s3: glp_set_obj_dir(lp, GLP_MAX); -s4: glp_add_rows(lp, 3); -s5: glp_set_row_name(lp, 1, "p"); -s6: glp_set_row_bnds(lp, 1, GLP_UP, 0.0, 100.0); -s7: glp_set_row_name(lp, 2, "q"); -s8: glp_set_row_bnds(lp, 2, GLP_UP, 0.0, 600.0); -s9: glp_set_row_name(lp, 3, "r"); -s10: glp_set_row_bnds(lp, 3, GLP_UP, 0.0, 300.0); -s11: glp_add_cols(lp, 3); -s12: glp_set_col_name(lp, 1, "x1"); -s13: glp_set_col_bnds(lp, 1, GLP_LO, 0.0, 0.0); -s14: glp_set_obj_coef(lp, 1, 10.0); -s15: glp_set_col_name(lp, 2, "x2"); -s16: glp_set_col_bnds(lp, 2, GLP_LO, 0.0, 0.0); -s17: glp_set_obj_coef(lp, 2, 6.0); -s18: glp_set_col_name(lp, 3, "x3"); -s19: glp_set_col_bnds(lp, 3, GLP_LO, 0.0, 0.0); -s20: glp_set_obj_coef(lp, 3, 4.0); -s21: ia[1] = 1, ja[1] = 1, ar[1] = 1.0; /* a[1,1] = 1 */ -s22: ia[2] = 1, ja[2] = 2, ar[2] = 1.0; /* a[1,2] = 1 */ -s23: ia[3] = 1, ja[3] = 3, ar[3] = 1.0; /* a[1,3] = 1 */ -s24: ia[4] = 2, ja[4] = 1, ar[4] = 10.0; /* a[2,1] = 10 */ -s25: ia[5] = 3, ja[5] = 1, ar[5] = 2.0; /* a[3,1] = 2 */ -s26: ia[6] = 2, ja[6] = 2, ar[6] = 4.0; /* a[2,2] = 4 */ -s27: ia[7] = 3, ja[7] = 2, ar[7] = 2.0; /* a[3,2] = 2 */ -s28: ia[8] = 2, ja[8] = 3, ar[8] = 5.0; /* a[2,3] = 5 */ -s29: ia[9] = 3, ja[9] = 3, ar[9] = 6.0; /* a[3,3] = 6 */ -s30: glp_load_matrix(lp, 9, ia, ja, ar); -s31: glp_simplex(lp, NULL); -s32: z = glp_get_obj_val(lp); -s33: x1 = glp_get_col_prim(lp, 1); -s34: x2 = glp_get_col_prim(lp, 2); -s35: x3 = glp_get_col_prim(lp, 3); -s36: printf("\nz = %g; x1 = %g; x2 = %g; x3 = %g\n", + lp = glp_create_prob(); + glp_set_prob_name(lp, "sample"); + glp_set_obj_dir(lp, GLP_MAX); + glp_add_rows(lp, 3); + glp_set_row_name(lp, 1, "p"); + glp_set_row_bnds(lp, 1, GLP_UP, 0.0, 100.0); + glp_set_row_name(lp, 2, "q"); + glp_set_row_bnds(lp, 2, GLP_UP, 0.0, 600.0); + glp_set_row_name(lp, 3, "r"); + glp_set_row_bnds(lp, 3, GLP_UP, 0.0, 300.0); + glp_add_cols(lp, 3); + glp_set_col_name(lp, 1, "x1"); + glp_set_col_bnds(lp, 1, GLP_LO, 0.0, 0.0); + glp_set_obj_coef(lp, 1, 10.0); + glp_set_col_name(lp, 2, "x2"); + glp_set_col_bnds(lp, 2, GLP_LO, 0.0, 0.0); + glp_set_obj_coef(lp, 2, 6.0); + glp_set_col_name(lp, 3, "x3"); + glp_set_col_bnds(lp, 3, GLP_LO, 0.0, 0.0); + glp_set_obj_coef(lp, 3, 4.0); + ia[1] = 1, ja[1] = 1, ar[1] = 1.0; /* a[1,1] = 1 */ + ia[2] = 1, ja[2] = 2, ar[2] = 1.0; /* a[1,2] = 1 */ + ia[3] = 1, ja[3] = 3, ar[3] = 1.0; /* a[1,3] = 1 */ + ia[4] = 2, ja[4] = 1, ar[4] = 10.0; /* a[2,1] = 10 */ + ia[5] = 3, ja[5] = 1, ar[5] = 2.0; /* a[3,1] = 2 */ + ia[6] = 2, ja[6] = 2, ar[6] = 4.0; /* a[2,2] = 4 */ + ia[7] = 3, ja[7] = 2, ar[7] = 2.0; /* a[3,2] = 2 */ + ia[8] = 2, ja[8] = 3, ar[8] = 5.0; /* a[2,3] = 5 */ + ia[9] = 3, ja[9] = 3, ar[9] = 6.0; /* a[3,3] = 6 */ + glp_load_matrix(lp, 9, ia, ja, ar); + glp_simplex(lp, NULL); + z = glp_get_obj_val(lp); + x1 = glp_get_col_prim(lp, 1); + x2 = glp_get_col_prim(lp, 2); + x3 = glp_get_col_prim(lp, 3); + printf("\nz = %g; x1 = %g; x2 = %g; x3 = %g\n", z, x1, x2, x3); -s37: glp_delete_prob(lp); + glp_delete_prob(lp); return 0; } - diff --git a/recipes/glpk/all/test_v1_package/CMakeLists.txt b/recipes/glpk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b21cc49efde95 --- /dev/null +++ b/recipes/glpk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/glpk/all/test_v1_package/conanfile.py b/recipes/glpk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/glpk/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/gmp/all/conandata.yml b/recipes/gmp/all/conandata.yml index 9266fcde97cc7..3c3f2645e9c31 100644 --- a/recipes/gmp/all/conandata.yml +++ b/recipes/gmp/all/conandata.yml @@ -1,6 +1,8 @@ sources: "6.2.1": - url: "https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2" + url: + - "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.bz2" + - "https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2" sha256: "eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c" "6.2.0": url: "https://gmplib.org/download/gmp/gmp-6.2.0.tar.bz2" diff --git a/recipes/google-cloud-cpp/2.x/components_2_12_0.py b/recipes/google-cloud-cpp/2.x/components_2_12_0.py new file mode 100644 index 0000000000000..943f3345fcb41 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/components_2_12_0.py @@ -0,0 +1,411 @@ +# Automatically generated by /usr/local/google/home/coryan/cci-develop/recipes/google-cloud-cpp/2.x/extract_dependencies.py DO NOT EDIT +DEPENDENCIES = { + "accessapproval_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "accesscontextmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "advisorynotifications_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "aiplatform_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_interval_protos', 'type_money_protos'], + "alloydb_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "apigateway_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "apigeeconnect_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "apikeys_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "appengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "artifactregistry_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "asset_protos": ['accesscontextmanager_protos', 'api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'osconfig_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_expr_protos', 'type_timeofday_protos'], + "assuredworkloads_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "automl_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "baremetalsolution_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "batch_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "beyondcorp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "cloud_bigquery_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos', 'type_expr_protos'], + "bigtable_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "billing_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos', 'type_money_protos'], + "binaryauthorization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "certificatemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "channel_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_decimal_protos', 'type_money_protos', 'type_postal_address_protos'], + "cloudbuild_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "cloud_common_common_protos": ['api_field_behavior_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "composer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "confidentialcomputing_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "connectors_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "contactcenterinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "container_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'], + "containeranalysis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "contentwarehouse_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'documentai_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_date_protos', 'type_datetime_protos', 'type_expr_protos', 'type_interval_protos', 'type_money_protos', 'type_postal_address_protos'], + "datacatalog_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "datamigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "dataplex_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "dataproc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "datastream_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "deploy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "cloud_dialogflow_v2_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "dialogflow_cx_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "dlp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "documentai_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_date_protos', 'type_datetime_protos', 'type_money_protos', 'type_postal_address_protos'], + "domains_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_money_protos', 'type_postal_address_protos'], + "edgecontainer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "essentialcontacts_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "eventarc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'], + "filestore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'cloud_common_common_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "functions_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "gameservices_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkebackup_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkehub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkemulticloud_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "grafeas_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "iam_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "iap_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "ids_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "iot_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "kms_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "language_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "logging_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "logging_type_type_protos": ['grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "managedidentities_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "memcache_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "monitoring_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_calendar_period_protos'], + "networkconnectivity_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networkmanagement_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networkservices_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "notebooks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "optimization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "orgpolicy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_expr_protos'], + "osconfig_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "oslogin_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "policytroubleshooter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "privateca_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "profiler_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "pubsub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "recaptchaenterprise_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "recommender_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_money_protos'], + "redis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "resourcemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "resourcesettings_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "retail_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "run_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "scheduler_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "secretmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "securitycenter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "servicecontrol_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'protobuf::libprotobuf', 'rpc_context_attribute_context_protos', 'rpc_status_protos'], + "servicedirectory_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "servicemanagement_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_config_change_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_resource_protos', 'api_service_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "serviceusage_protos": ['api_annotations_protos', 'api_auth_protos', 'api_client_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "shell_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "spanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "cloud_speech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "storage_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos'], + "storageinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos'], + "storagetransfer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_timeofday_protos'], + "support_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "talent_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos', 'type_money_protos', 'type_postal_address_protos', 'type_timeofday_protos'], + "tasks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "cloud_texttospeech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "timeseriesinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "tpu_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "devtools_cloudtrace_v2_trace_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "translate_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "video_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_datetime_protos'], + "videointelligence_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "vision_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_latlng_protos'], + "vmmigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos'], + "vmwareengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "vpcaccess_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "webrisk_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "websecurityscanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "workflows_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "workstations_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "api_annotations_protos": ['api_http_protos'], + "api_auth_protos": ['api_annotations_protos'], + "api_billing_protos": ['api_annotations_protos', 'api_metric_protos'], + "api_client_protos": ['api_launch_stage_protos'], + "api_distribution_protos": ['api_annotations_protos'], + "api_endpoint_protos": ['api_annotations_protos'], + "api_log_protos": ['api_label_protos'], + "api_logging_protos": ['api_annotations_protos', 'api_label_protos'], + "api_metric_protos": ['api_label_protos', 'api_launch_stage_protos'], + "api_monitored_resource_protos": ['api_label_protos', 'api_launch_stage_protos'], + "api_monitoring_protos": ['api_annotations_protos'], + "api_quota_protos": ['api_annotations_protos'], + "api_service_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_resource_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos'], + "api_usage_protos": ['api_annotations_protos', 'api_visibility_protos'], + "devtools_cloudtrace_v2_tracing_protos": ['api_client_protos', 'api_field_behavior_protos', 'devtools_cloudtrace_v2_trace_protos', 'devtools_cloudtrace_v2_trace_protos', 'rpc_status_protos'], +} + +PROTO_COMPONENTS = { + "accessapproval_protos", + "accesscontextmanager_protos", + "advisorynotifications_protos", + "aiplatform_protos", + "alloydb_protos", + "api_annotations_protos", + "api_auth_protos", + "api_backend_protos", + "api_billing_protos", + "api_client_protos", + "api_config_change_protos", + "api_context_protos", + "api_control_protos", + "api_distribution_protos", + "api_documentation_protos", + "api_endpoint_protos", + "api_field_behavior_protos", + "api_http_protos", + "api_httpbody_protos", + "api_label_protos", + "api_launch_stage_protos", + "api_log_protos", + "api_logging_protos", + "api_metric_protos", + "api_monitored_resource_protos", + "api_monitoring_protos", + "api_quota_protos", + "api_resource_protos", + "api_routing_protos", + "api_service_protos", + "api_source_info_protos", + "api_system_parameter_protos", + "api_usage_protos", + "api_visibility_protos", + "apigateway_protos", + "apigeeconnect_protos", + "apikeys_protos", + "appengine_protos", + "artifactregistry_protos", + "asset_protos", + "assuredworkloads_protos", + "automl_protos", + "baremetalsolution_protos", + "batch_protos", + "beyondcorp_protos", + "bigtable_protos", + "billing_protos", + "binaryauthorization_protos", + "certificatemanager_protos", + "channel_protos", + "cloud_bigquery_protos", + "cloud_common_common_protos", + "cloud_dialogflow_v2_protos", + "cloud_speech_protos", + "cloud_texttospeech_protos", + "cloudbuild_protos", + "composer_protos", + "confidentialcomputing_protos", + "connectors_protos", + "contactcenterinsights_protos", + "container_protos", + "containeranalysis_protos", + "contentwarehouse_protos", + "datacatalog_protos", + "datamigration_protos", + "dataplex_protos", + "dataproc_protos", + "datastream_protos", + "deploy_protos", + "devtools_cloudtrace_v2_trace_protos", + "devtools_cloudtrace_v2_tracing_protos", + "devtools_source_v1_source_context_protos", + "dialogflow_cx_protos", + "dlp_protos", + "documentai_protos", + "domains_protos", + "edgecontainer_protos", + "essentialcontacts_protos", + "eventarc_protos", + "filestore_protos", + "functions_protos", + "gameservices_protos", + "gkebackup_protos", + "gkehub_protos", + "gkemulticloud_protos", + "grafeas_protos", + "iam_protos", + "iam_v1_iam_policy_protos", + "iam_v1_options_protos", + "iam_v1_policy_protos", + "iap_protos", + "ids_protos", + "iot_protos", + "kms_protos", + "language_protos", + "logging_protos", + "logging_type_type_protos", + "longrunning_operations_protos", + "managedidentities_protos", + "memcache_protos", + "monitoring_protos", + "networkconnectivity_protos", + "networkmanagement_protos", + "networkservices_protos", + "notebooks_protos", + "optimization_protos", + "orgpolicy_protos", + "osconfig_protos", + "oslogin_protos", + "policytroubleshooter_protos", + "privateca_protos", + "profiler_protos", + "pubsub_protos", + "recaptchaenterprise_protos", + "recommender_protos", + "redis_protos", + "resourcemanager_protos", + "resourcesettings_protos", + "retail_protos", + "rpc_code_protos", + "rpc_context_attribute_context_protos", + "rpc_error_details_protos", + "rpc_status_protos", + "run_protos", + "scheduler_protos", + "secretmanager_protos", + "securitycenter_protos", + "servicecontrol_protos", + "servicedirectory_protos", + "servicemanagement_protos", + "serviceusage_protos", + "shell_protos", + "spanner_protos", + "storage_protos", + "storageinsights_protos", + "storagetransfer_protos", + "support_protos", + "talent_protos", + "tasks_protos", + "timeseriesinsights_protos", + "tpu_protos", + "translate_protos", + "type_calendar_period_protos", + "type_color_protos", + "type_date_protos", + "type_datetime_protos", + "type_dayofweek_protos", + "type_decimal_protos", + "type_expr_protos", + "type_interval_protos", + "type_latlng_protos", + "type_money_protos", + "type_postal_address_protos", + "type_timeofday_protos", + "video_protos", + "videointelligence_protos", + "vision_protos", + "vmmigration_protos", + "vmwareengine_protos", + "vpcaccess_protos", + "webrisk_protos", + "websecurityscanner_protos", + "workflows_protos", + "workstations_protos" +} + +COMPONENTS = { + "accessapproval", + "accesscontextmanager", + "advisorynotifications", + "aiplatform", + "alloydb", + "apigateway", + "apigeeconnect", + "apikeys", + "appengine", + "artifactregistry", + "asset", + "assuredworkloads", + "automl", + "baremetalsolution", + "batch", + "beyondcorp", + "bigquery", + "bigtable", + "billing", + "binaryauthorization", + "certificatemanager", + "channel", + "cloudbuild", + "composer", + "confidentialcomputing", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "contentwarehouse", + "datacatalog", + "datamigration", + "dataplex", + "dataproc", + "datastream", + "deploy", + "dialogflow_cx", + "dialogflow_es", + "dlp", + "documentai", + "domains", + "edgecontainer", + "essentialcontacts", + "eventarc", + "filestore", + "functions", + "gameservices", + "gkebackup", + "gkehub", + "gkemulticloud", + "iam", + "iap", + "ids", + "iot", + "kms", + "language", + "logging", + "managedidentities", + "memcache", + "monitoring", + "networkconnectivity", + "networkmanagement", + "networkservices", + "notebooks", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policytroubleshooter", + "privateca", + "profiler", + "pubsub", + "recaptchaenterprise", + "recommender", + "redis", + "resourcemanager", + "resourcesettings", + "retail", + "run", + "scheduler", + "secretmanager", + "securitycenter", + "servicecontrol", + "servicedirectory", + "servicemanagement", + "serviceusage", + "shell", + "spanner", + "speech", + "storage", + "storageinsights", + "storagetransfer", + "support", + "talent", + "tasks", + "texttospeech", + "timeseriesinsights", + "tpu", + "trace", + "translate", + "video", + "videointelligence", + "vision", + "vmmigration", + "vmwareengine", + "vpcaccess", + "webrisk", + "websecurityscanner", + "workflows", + "workstations" +} diff --git a/recipes/google-cloud-cpp/2.x/components_2_5_0.py b/recipes/google-cloud-cpp/2.x/components_2_5_0.py new file mode 100644 index 0000000000000..9244c68af5641 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/components_2_5_0.py @@ -0,0 +1,364 @@ +# Automatically generated by /usr/local/google/home/coryan/cci-develop/recipes/google-cloud-cpp/2.x/extract_dependencies.py DO NOT EDIT +DEPENDENCIES = { + "accessapproval_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "accesscontextmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "apigateway_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "apigeeconnect_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "appengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "artifactregistry_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "asset_protos": ['accesscontextmanager_protos', 'api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'osconfig_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_expr_protos', 'type_timeofday_protos'], + "assuredworkloads_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "automl_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "baremetalsolution_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "batch_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "beyondcorp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "cloud_bigquery_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos', 'type_expr_protos'], + "bigtable_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "billing_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos', 'type_money_protos'], + "binaryauthorization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "certificatemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "channel_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_decimal_protos', 'type_money_protos', 'type_postal_address_protos'], + "cloudbuild_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "cloud_common_common_protos": ['api_field_behavior_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "composer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "connectors_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "contactcenterinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "container_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'], + "containeranalysis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "datacatalog_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "datamigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "dataplex_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "dataproc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "datastream_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "debugger_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'devtools_source_v1_source_context_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "deploy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "cloud_dialogflow_v2_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "dialogflow_cx_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "dlp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "documentai_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_date_protos', 'type_datetime_protos', 'type_money_protos', 'type_postal_address_protos'], + "edgecontainer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "eventarc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'], + "filestore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'cloud_common_common_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "functions_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "gameservices_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "gkehub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "grafeas_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "iam_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "iap_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "ids_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "iot_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "kms_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "language_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "logging_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "logging_type_type_protos": ['api_annotations_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "managedidentities_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "memcache_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "monitoring_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_calendar_period_protos'], + "networkconnectivity_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "networkmanagement_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "notebooks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "optimization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'], + "orgpolicy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_expr_protos'], + "osconfig_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "oslogin_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "policytroubleshooter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "privateca_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "profiler_protos": ['api_annotations_protos', 'api_client_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "pubsub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "recommender_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_money_protos'], + "redis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'], + "resourcemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "resourcesettings_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "retail_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'], + "run_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "scheduler_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "secretmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "securitycenter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "servicecontrol_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "servicedirectory_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'], + "servicemanagement_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_config_change_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_resource_protos', 'api_service_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "serviceusage_protos": ['api_annotations_protos', 'api_auth_protos', 'api_client_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "shell_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "spanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "cloud_speech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "storage_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos'], + "storagetransfer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_timeofday_protos'], + "talent_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos', 'type_money_protos', 'type_postal_address_protos', 'type_timeofday_protos'], + "tasks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "cloud_texttospeech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "tpu_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "devtools_cloudtrace_v2_trace_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "translate_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "video_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "videointelligence_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "vision_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_latlng_protos'], + "vmmigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos'], + "vmwareengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "vpcaccess_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "webrisk_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "websecurityscanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'], + "workflows_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "api_annotations_protos": ['api_http_protos'], + "api_auth_protos": ['api_annotations_protos'], + "api_billing_protos": ['api_annotations_protos', 'api_metric_protos'], + "api_client_protos": ['api_launch_stage_protos'], + "api_distribution_protos": ['api_annotations_protos'], + "api_endpoint_protos": ['api_annotations_protos'], + "api_log_protos": ['api_label_protos'], + "api_logging_protos": ['api_annotations_protos', 'api_label_protos'], + "api_metric_protos": ['api_label_protos', 'api_launch_stage_protos'], + "api_monitored_resource_protos": ['api_label_protos', 'api_launch_stage_protos'], + "api_monitoring_protos": ['api_annotations_protos'], + "api_quota_protos": ['api_annotations_protos'], + "api_service_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_resource_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos'], + "api_usage_protos": ['api_annotations_protos', 'api_visibility_protos'], + "devtools_cloudtrace_v2_tracing_protos": ['api_client_protos', 'api_field_behavior_protos', 'devtools_cloudtrace_v2_trace_protos', 'devtools_cloudtrace_v2_trace_protos', 'rpc_status_protos'], +} + +PROTO_COMPONENTS = { + "accessapproval_protos", + "accesscontextmanager_protos", + "api_annotations_protos", + "api_auth_protos", + "api_backend_protos", + "api_billing_protos", + "api_client_protos", + "api_config_change_protos", + "api_context_protos", + "api_control_protos", + "api_distribution_protos", + "api_documentation_protos", + "api_endpoint_protos", + "api_field_behavior_protos", + "api_http_protos", + "api_httpbody_protos", + "api_label_protos", + "api_launch_stage_protos", + "api_log_protos", + "api_logging_protos", + "api_metric_protos", + "api_monitored_resource_protos", + "api_monitoring_protos", + "api_quota_protos", + "api_resource_protos", + "api_routing_protos", + "api_service_protos", + "api_source_info_protos", + "api_system_parameter_protos", + "api_usage_protos", + "api_visibility_protos", + "apigateway_protos", + "apigeeconnect_protos", + "appengine_protos", + "artifactregistry_protos", + "asset_protos", + "assuredworkloads_protos", + "automl_protos", + "baremetalsolution_protos", + "batch_protos", + "beyondcorp_protos", + "bigtable_protos", + "billing_protos", + "binaryauthorization_protos", + "certificatemanager_protos", + "channel_protos", + "cloud_bigquery_protos", + "cloud_common_common_protos", + "cloud_dialogflow_v2_protos", + "cloud_speech_protos", + "cloud_texttospeech_protos", + "cloudbuild_protos", + "composer_protos", + "connectors_protos", + "contactcenterinsights_protos", + "container_protos", + "containeranalysis_protos", + "datacatalog_protos", + "datamigration_protos", + "dataplex_protos", + "dataproc_protos", + "datastream_protos", + "debugger_protos", + "deploy_protos", + "devtools_cloudtrace_v2_trace_protos", + "devtools_cloudtrace_v2_tracing_protos", + "devtools_source_v1_source_context_protos", + "dialogflow_cx_protos", + "dlp_protos", + "documentai_protos", + "edgecontainer_protos", + "eventarc_protos", + "filestore_protos", + "functions_protos", + "gameservices_protos", + "gkehub_protos", + "grafeas_protos", + "iam_protos", + "iam_v1_iam_policy_protos", + "iam_v1_options_protos", + "iam_v1_policy_protos", + "iap_protos", + "ids_protos", + "iot_protos", + "kms_protos", + "language_protos", + "logging_protos", + "logging_type_type_protos", + "longrunning_operations_protos", + "managedidentities_protos", + "memcache_protos", + "monitoring_protos", + "networkconnectivity_protos", + "networkmanagement_protos", + "notebooks_protos", + "optimization_protos", + "orgpolicy_protos", + "osconfig_protos", + "oslogin_protos", + "policytroubleshooter_protos", + "privateca_protos", + "profiler_protos", + "pubsub_protos", + "recommender_protos", + "redis_protos", + "resourcemanager_protos", + "resourcesettings_protos", + "retail_protos", + "rpc_code_protos", + "rpc_error_details_protos", + "rpc_status_protos", + "run_protos", + "scheduler_protos", + "secretmanager_protos", + "securitycenter_protos", + "servicecontrol_protos", + "servicedirectory_protos", + "servicemanagement_protos", + "serviceusage_protos", + "shell_protos", + "spanner_protos", + "storage_protos", + "storagetransfer_protos", + "talent_protos", + "tasks_protos", + "tpu_protos", + "translate_protos", + "type_calendar_period_protos", + "type_color_protos", + "type_date_protos", + "type_datetime_protos", + "type_dayofweek_protos", + "type_decimal_protos", + "type_expr_protos", + "type_latlng_protos", + "type_money_protos", + "type_postal_address_protos", + "type_timeofday_protos", + "video_protos", + "videointelligence_protos", + "vision_protos", + "vmmigration_protos", + "vmwareengine_protos", + "vpcaccess_protos", + "webrisk_protos", + "websecurityscanner_protos", + "workflows_protos" +} + +COMPONENTS = { + "accessapproval", + "accesscontextmanager", + "apigateway", + "apigeeconnect", + "appengine", + "artifactregistry", + "asset", + "assuredworkloads", + "automl", + "baremetalsolution", + "batch", + "beyondcorp", + "bigquery", + "bigtable", + "billing", + "binaryauthorization", + "certificatemanager", + "channel", + "cloudbuild", + "composer", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "datacatalog", + "datamigration", + "dataplex", + "dataproc", + "datastream", + "debugger", + "deploy", + "dialogflow_cx", + "dialogflow_es", + "dlp", + "documentai", + "edgecontainer", + "eventarc", + "filestore", + "functions", + "gameservices", + "gkehub", + "iam", + "iap", + "ids", + "iot", + "kms", + "language", + "logging", + "managedidentities", + "memcache", + "monitoring", + "networkconnectivity", + "networkmanagement", + "notebooks", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policytroubleshooter", + "privateca", + "profiler", + "pubsub", + "recommender", + "redis", + "resourcemanager", + "resourcesettings", + "retail", + "run", + "scheduler", + "secretmanager", + "securitycenter", + "servicecontrol", + "servicedirectory", + "servicemanagement", + "serviceusage", + "shell", + "spanner", + "speech", + "storage", + "storagetransfer", + "talent", + "tasks", + "texttospeech", + "tpu", + "trace", + "translate", + "video", + "videointelligence", + "vision", + "vmmigration", + "vmwareengine", + "vpcaccess", + "webrisk", + "websecurityscanner", + "workflows" +} diff --git a/recipes/google-cloud-cpp/2.x/conan_cmake_project_include.cmake b/recipes/google-cloud-cpp/2.x/conan_cmake_project_include.cmake deleted file mode 100644 index 17098fdadc87d..0000000000000 --- a/recipes/google-cloud-cpp/2.x/conan_cmake_project_include.cmake +++ /dev/null @@ -1,10 +0,0 @@ -find_package(googleapis CONFIG REQUIRED) -if (NOT ("${googleapis_RES_DIRS_RELEASE}" STREQUAL "")) - set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_RELEASE}") -elseif (NOT ("${googleapis_RES_DIRS_RELWITHDEBINFO}" STREQUAL "")) - set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_RELWITHDEBINFO}") -elseif (NOT ("${googleapis_RES_DIRS_MINSIZEREL}" STREQUAL "")) - set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_MINSIZEREL}") -elseif (NOT ("${googleapis_RES_DIRS_DEBUG}" STREQUAL "")) - set(EXTERNAL_GOOGLEAPIS_SOURCE "${googleapis_RES_DIRS_DEBUG}") -endif () diff --git a/recipes/google-cloud-cpp/2.x/conandata.yml b/recipes/google-cloud-cpp/2.x/conandata.yml index 94473c6cb2ac9..d9339e05c5ec4 100644 --- a/recipes/google-cloud-cpp/2.x/conandata.yml +++ b/recipes/google-cloud-cpp/2.x/conandata.yml @@ -2,11 +2,11 @@ sources: "2.5.0": url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.5.0.tar.gz" sha256: "ac93ef722d08bfb220343bde2f633c7c11f15e34ec3ecd0a57dbd3ff729cc3a6" + "2.12.0": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.12.0.tar.gz" + sha256: "8cda870803925c62de8716a765e03eb9d34249977e5cdb7d0d20367e997a55e2" patches: "2.5.0": - - patch_file: "patches/2.5.0/001-use-googleapis-conan-package.patch" - patch_description: "Use Conan package for googleapis" - patch_type: conan - patch_file: "patches/2.5.0/002-interface-library-properties.patch" patch_source: https://github.com/googleapis/google-cloud-cpp/pull/10636 patch_description: "Fix problems with INTERFACE proto libraries" @@ -14,3 +14,15 @@ patches: - patch_file: "patches/2.5.0/003-use-conan-msvc-runtime.patch" patch_description: "Let Conan select the MSVC runtime" patch_type: conan + - patch_file: "patches/2.5.0/004-remove-duplicate-protos.patch" + patch_source: https://github.com/googleapis/google-cloud-cpp/pull/10486 + patch_description: "Some libraries defined had duplicate symbols" + patch_type: backport + - patch_file: "patches/2.5.0/005-interface-library-properties.patch" + patch_source: https://github.com/googleapis/google-cloud-cpp/pull/10636 + patch_description: "Fix problems with INTERFACE proto libraries" + patch_type: backport + "2.12.0": + - patch_file: "patches/2.12.0/001-use-conan-msvc-runtime.patch" + patch_description: "Let Conan select the MSVC runtime" + patch_type: conan diff --git a/recipes/google-cloud-cpp/2.x/conanfile.py b/recipes/google-cloud-cpp/2.x/conanfile.py index 0da218c665ea2..810fc35bc2f60 100644 --- a/recipes/google-cloud-cpp/2.x/conanfile.py +++ b/recipes/google-cloud-cpp/2.x/conanfile.py @@ -9,6 +9,19 @@ from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration +# Load the generated component dependency information. +# +# `google-cloud-cpp` has well over 200 components. Conan cannot use the CMake +# files generated by `google-cloud-cpp`. Manually maintaining this dependency +# information is error prone and fairly tedious. A helper script in this +# directory reproduces the algorithms used by `google-cloud-cpp` to generate its +# dependency information. With each new revision of `google-cloud-cpp` the +# script will be used to generate a new file with the component dependency +# information. The expectation is that maintaining this script will be easier +# than writing long lists of dependencies by hand. +import components_2_5_0 +import components_2_12_0 + required_conan_version = ">=1.56.0" @@ -31,11 +44,30 @@ class GoogleCloudCppConan(ConanFile): settings = "os", "arch", "compiler", "build_type" options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} + exports = ["components_2_5_0.py", + "components_2_12_0.py", + ] short_paths = True + _GA_COMPONENTS = { + '2.5.0': components_2_5_0.COMPONENTS, + '2.12.0': components_2_12_0.COMPONENTS, + } + _PROTO_COMPONENTS = { + '2.5.0': components_2_5_0.PROTO_COMPONENTS, + '2.12.0': components_2_12_0.PROTO_COMPONENTS, + } + _PROTO_COMPONENT_DEPENDENCIES = { + "2.5.0": components_2_5_0.DEPENDENCIES, + "2.12.0": components_2_12_0.DEPENDENCIES, + } + # Some components require custom dependency definitions. + _REQUIRES_CUSTOM_DEPENDENCIES = { + "bigquery", "bigtable", "iam", "pubsub", "spanner", "storage", + } + def export_sources(self): - copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) export_conandata_patches(self) def config_options(self): @@ -46,8 +78,6 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") self.options["protobuf"].shared = True - self.options["googleapis"].shared = True - self.options["grpc-proto"].shared = True self.options["grpc"].shared = True def validate(self): @@ -64,6 +94,21 @@ def validate(self): "Recipe not prepared for cross-building (yet)" ) + if self.version not in self._GA_COMPONENTS: + raise ConanInvalidConfiguration( + "The components are unknown for version %s" % self.version + ) + + if self.version not in self._PROTO_COMPONENTS: + raise ConanInvalidConfiguration( + "The proto components are unknown for version %s" % self.version + ) + + if self.version not in self._PROTO_COMPONENT_DEPENDENCIES: + raise ConanInvalidConfiguration( + "The inter-component dependencies are unknown for version %s" % self.version + ) + if ( self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "6.0" @@ -81,14 +126,10 @@ def validate(self): if self.info.options.shared and \ (not self.dependencies["protobuf"].options.shared or \ - not self.dependencies["googleapis"].options.shared or \ - not self.dependencies["grpc-proto"].options.shared or \ not self.dependencies["grpc"].options.shared): raise ConanInvalidConfiguration( - "If built as shared, protobuf, googleapis, grpc-proto, and grpc must be shared as well." - " Please, use `protobuf/*:shared=True`, `googleapis/*:shared=True`, `grpc-proto/*:shared=True`," - " and `grpc/*:shared=True`", - ) + "If built as shared, protobuf, and grpc must be shared as well." + " Please, use `protobuf/*:shared=True`, and `grpc/*:shared=True`.") def layout(self): cmake_layout(self, src_folder="src") @@ -105,13 +146,6 @@ def requirements(self): self.requires("libcurl/7.88.1") self.requires("openssl/[>=1.1 <4]") self.requires("zlib/1.2.13") - # `google-cloud-cpp` contains code generated from the proto files. - # Working with older versions of these protos almost always will fail, as - # at least some of the RPCs included in the GRPC-generator stubs will be - # missing. - # Working with newer versions of these protos almost always will work. There - # are very few breaking changes on the proto files. - self.requires(f"googleapis/{self._GOOGLEAPIS_VERSIONS[self.version]}", transitive_headers=True) def build_requirements(self): # For the grpc-cpp-plugin executable @@ -119,7 +153,6 @@ def build_requirements(self): def generate(self): tc = CMakeToolchain(self) - tc.cache_variables["CMAKE_PROJECT_google-cloud-cpp_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") tc.variables["BUILD_TESTING"] = False tc.variables["GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK"] = False tc.variables["GOOGLE_CLOUD_CPP_ENABLE"] = ",".join(self._components()) @@ -147,124 +180,44 @@ def build(self): cmake.configure() cmake.build() - _GOOGLEAPIS_VERSIONS = { - "2.5.0": "cci.20221108", - } - - _GA_COMPONENTS_BASE = {"bigquery", "bigtable", "iam", "pubsub", "spanner", "storage"} - _GA_COMPONENTS_VERSION = { - '2.5.0': { - "accessapproval", - "accesscontextmanager", - "apigateway", - "apigeeconnect", - "appengine", - "artifactregistry", - "asset", - "assuredworkloads", - "automl", - "baremetalsolution", - "batch", - "beyondcorp", - "billing", - "binaryauthorization", - "certificatemanager", - "channel", - "cloudbuild", - "composer", - "connectors", - "contactcenterinsights", - "container", - "containeranalysis", - "datacatalog", - "datamigration", - "dataplex", - "dataproc", - "datastream", - "debugger", - "deploy", - "dialogflow_cx", - "dialogflow_es", - "dlp", - "documentai", - "edgecontainer", - "eventarc", - "filestore", - "functions", - "gameservices", - "gkehub", - "iap", - "ids", - "iot", - "kms", - "language", - "logging", - "managedidentities", - "memcache", - "monitoring", - "networkconnectivity", - "networkmanagement", - "notebooks", - "optimization", - "orgpolicy", - "osconfig", - "oslogin", - "policytroubleshooter", - "privateca", - "profiler", - "recommender", - "redis", - "resourcemanager", - "resourcesettings", - "retail", - "run", - "scheduler", - "secretmanager", - "securitycenter", - "servicecontrol", - "servicedirectory", - "servicemanagement", - "serviceusage", - "shell", - "speech", - "storagetransfer", - "talent", - "tasks", - "texttospeech", - "tpu", - "trace", - "translate", - "video", - "videointelligence", - "vision", - "vmmigration", - "vmwareengine", - "vpcaccess", - "webrisk", - "websecurityscanner", - "workflows", - }, + def _generate_proto_requires(self, component): + deps = self._PROTO_COMPONENT_DEPENDENCIES.get(self.version, dict()) + return deps.get(component, []) + + _SKIPPED_COMPONENTS = { + # Some protos do not compile due to inconvenient system macros clashing + # with proto enum values. Protobuf can workaround these problems, but + # the current version in Conan index (protobuf/3.21.4) do not contain + # the fixes for these cases. + # TODO - review after protobuf >= 4.23.x + 'asset', + 'channel', + 'storagetransfer', + # TODO - certificatemanager crashes the gRPC code generator. Add it back + # after gRPC >= 1.53.x + 'certificatemanager', } def _components(self): - result = self._GA_COMPONENTS_BASE - for v in sorted(self._GA_COMPONENTS_VERSION.keys()): - if v > Version(self): - break - result = result.union(self._GA_COMPONENTS_VERSION[v]) - # Some protos do not compile due to inconvenient system macros clashing with proto enum values. - # Protobuf can workaround these problems, but the current version in Conan index (protobuf/3.21.4) - # do not contain the fixes for these cases. - # TODO - review after protobuf >= 3.22.x - result.remove('asset') - result.remove('channel') - result.remove('storagetransfer') - # Some of the macros are platform specific. + result = self._GA_COMPONENTS.get(self.version, []).copy() + for c in self._SKIPPED_COMPONENTS: + result.remove(c) + # TODO - these do not build on Android due to conflicts between OS + # macros and Proto enums. Revisit after Protobuf >= 4.23.x if self.settings.os == "Android": result.remove('accesscontextmanager') result.remove('talent') - # TODO - certificatemanager crashes the gRPC code generator. Add it back after gRPC >= 1.53.x - result.remove('certificatemanager') + return result + + def _proto_components(self): + result = self._PROTO_COMPONENTS.get(self.version, []).copy() + for c in self._SKIPPED_COMPONENTS: + result.remove(c + '_protos') + # TODO - these do not build on Android due to conflicts between OS + # macros and Proto enums. Revisit after Protobuf >= 4.23.x + if self.settings.os == "Android": + result.remove('accesscontextmanager_protos') + result.remove('talent_protos') return result def package(self): @@ -275,8 +228,7 @@ def package(self): rmdir(self, path=os.path.join(self.package_folder, "lib", "pkgconfig")) def _add_proto_component(self, component): - PROTOS_SHARED_REQUIRES=["googleapis::googleapis", "grpc::grpc++", "grpc::_grpc", "protobuf::libprotobuf"] - self.cpp_info.components[component].requires = PROTOS_SHARED_REQUIRES + self.cpp_info.components[component].requires = self._generate_proto_requires(component) self.cpp_info.components[component].libs = [f"google_cloud_cpp_{component}"] self.cpp_info.components[component].names["pkg_config"] = f"google_cloud_cpp_{component}" @@ -296,15 +248,29 @@ def package_info(self): self.cpp_info.components["rest_internal"].names["pkg_config"] = "google_cloud_cpp_common" # A small number of gRPC-generated stubs are used directly in the common components - # shared by all gRPC-based libraries. These bust be defined without reference to `grpc_utils`. - GRPC_UTILS_REQUIRED_PROTOS=["iam_protos", "longrunning_operations_protos", "rpc_error_details_protos", "rpc_status_protos"] + # shared by all gRPC-based libraries. These must be defined without reference to `grpc_utils`. + GRPC_UTILS_REQUIRED_PROTOS={"iam_protos", "longrunning_operations_protos", "rpc_error_details_protos", "rpc_status_protos"} for component in GRPC_UTILS_REQUIRED_PROTOS: self._add_proto_component(component) - self.cpp_info.components["grpc_utils"].requires = GRPC_UTILS_REQUIRED_PROTOS + ["common", "abseil::absl_function_ref", "abseil::absl_memory", "abseil::absl_time", "grpc::grpc++", "grpc::_grpc"] + self.cpp_info.components["grpc_utils"].requires = list(GRPC_UTILS_REQUIRED_PROTOS) + ["common", "abseil::absl_function_ref", "abseil::absl_memory", "abseil::absl_time", "grpc::grpc++", "grpc::_grpc"] self.cpp_info.components["grpc_utils"].libs = ["google_cloud_cpp_grpc_utils"] self.cpp_info.components["grpc_utils"].names["pkg_config"] = "google_cloud_cpp_grpc_utils" + for component in self._proto_components(): + if component not in GRPC_UTILS_REQUIRED_PROTOS: + self._add_proto_component(component) + + # Interface libraries for backwards compatibility + self.cpp_info.components["dialogflow_es_protos"].requires = ["cloud_dialogflow_v2_protos"] + self.cpp_info.components["logging_type_protos"].requires = ["logging_type_type_protos"] + self.cpp_info.components["speech_protos"].requires = ["cloud_speech_protos"] + self.cpp_info.components["texttospeech_protos"].requires = ["cloud_texttospeech_protos"] + self.cpp_info.components["trace_protos"].requires = [ + "devtools_cloudtrace_v2_trace_protos", + "devtools_cloudtrace_v2_tracing_protos", + ] + for component in self._components(): # bigquery proto library predates the adoption of more consistent naming if component == 'bigquery': @@ -317,11 +283,7 @@ def package_info(self): continue # `storage` is the only component that does not depend on a matching `*_protos` library protos=f"{component}_protos" - if component != 'storage' and component not in GRPC_UTILS_REQUIRED_PROTOS: - self._add_proto_component(protos) - # The components in self._GA_COMPONENTS_BASE are hand-crafted and need custom - # definitions (see below) - if component in self._GA_COMPONENTS_BASE: + if component in self._REQUIRES_CUSTOM_DEPENDENCIES: continue self._add_grpc_component(component, protos) diff --git a/recipes/google-cloud-cpp/2.x/extract_dependencies.py b/recipes/google-cloud-cpp/2.x/extract_dependencies.py new file mode 100755 index 0000000000000..1a7607684544a --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/extract_dependencies.py @@ -0,0 +1,366 @@ +#!/usr/bin/env python3 + +import argparse +import glob +import os + +"""Extract google-cloud-cpp's component dependency info for use in Conan. + +google-cloud-cpp builds a number (about 100) of libraries from proto files. +These libraries have dependencies between them. In Conan, one cannot use the +dependencies preserved in the *-config.cmake files generated by the package, so +we have to reconstruct the dependencies here. + +Fortunately, google-cloud-cpp uses a number of *.deps files to keep these +dependencies. We just need to reimplement their algorithm to load these files +and convert them to CMake dependencies. + +The *.deps files themselves are generated (and committed to GitHub) from +Bazel rules. +""" + +# Used in _generate_proto_requires(): common requirements +_PROTO_DEPS_COMMON_REQUIRES = {"grpc::grpc++", "grpc::_grpc", "protobuf::libprotobuf"} + +# Used in _generate_proto_requires(): the *.deps files are generated from +# Bazel and contain a few targets that do not exit (nor do they need to +# exist) in CMake. +_PROTO_DEPS_REMOVED_TARGETS = { + "cloud_kms_v1_kms_protos", + "cloud_orgpolicy_v1_orgpolicy_protos", + "cloud_oslogin_common_common_protos", + "cloud_recommender_v1_recommender_protos", + "identity_accesscontextmanager_type_type_protos", +} + +# Used in _generate_proto_requires(): the *.deps files are generated from +# Bazel and contain a few targets that have incorrect names for CMake. +_PROTO_DEPS_REPLACED_TARGETS = { + "grafeas_v1_grafeas_protos": "grafeas_protos", + "identity_accesscontextmanager_v1_accesscontextmanager_protos": "accesscontextmanager_protos", + "cloud_osconfig_v1_osconfig_protos": "osconfig_protos", + "devtools_source_v1_source_protos": "devtools_source_v1_source_context_protos", + "cloud_documentai_v1_documentai_protos": "documentai_protos", +} + +# A few *.deps files use ad-hoc naming. +_PROTO_DEPS_REPLACED_NAMES = { + "common": "cloud_common_common", + "bigquery": "cloud_bigquery", + "dialogflow": "cloud_dialogflow_v2", + "logging_type": "logging_type_type", + "texttospeech": "cloud_texttospeech", + "speech": "cloud_speech", + "trace": "devtools_cloudtrace_v2_trace", +} + +# A few *.deps files are not used. +_PROTO_DEPS_UNUSED = { + "iam_policy", +} + +# A few _protos libraries were introduced before `google-cloud-cpp` adopted +# more consistent naming. +_PROTO_BASE_COMPONENTS = { + "api_service_protos", + "api_visibility_protos", + "api_monitoring_protos", + "type_date_protos", + "api_control_protos", + "api_client_protos", + "api_annotations_protos", + "api_httpbody_protos", + "iam_v1_policy_protos", + "api_auth_protos", + "api_resource_protos", + "api_billing_protos", + "api_quota_protos", + "api_source_info_protos", + "api_backend_protos", + "type_datetime_protos", + "iam_v1_options_protos", + "api_endpoint_protos", + "api_launch_stage_protos", + "api_documentation_protos", + "devtools_source_v1_source_context_protos", + "type_color_protos", + "api_distribution_protos", + "api_config_change_protos", + "iam_v1_iam_policy_protos", + "type_expr_protos", + "api_routing_protos", + "api_usage_protos", + "logging_type_type_protos", + "type_calendar_period_protos", + "rpc_code_protos", + "api_system_parameter_protos", + "cloud_common_common_protos", + "type_postal_address_protos", + "type_latlng_protos", + "type_dayofweek_protos", + "api_monitored_resource_protos", + "type_money_protos", + "api_metric_protos", + "api_label_protos", + "api_log_protos", + "grafeas_protos", + "api_http_protos", + "type_timeofday_protos", + "api_field_behavior_protos", + "api_context_protos", + "api_logging_protos", +} + +# A list of experimental components used when `google-cloud-cpp` does not +# provide an easy-to-use list. +_DEFAULT_EXPERIMENTAL_COMPONENTS = { + "apikeys", + "pubsublite", +} + +# A list of components used when `google-cloud-cpp` does not provide an +# easy-to-use list. +_DEFAULT_COMPONENTS = { + "accessapproval", + "accesscontextmanager", + "apigateway", + "apigeeconnect", + "appengine", + "artifactregistry", + "asset", + "assuredworkloads", + "automl", + "baremetalsolution", + "batch", + "beyondcorp", + "bigquery", + "bigtable", + "billing", + "binaryauthorization", + "certificatemanager", + "channel", + "cloudbuild", + "composer", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "datacatalog", + "datamigration", + "dataplex", + "dataproc", + "datastream", + "debugger", + "deploy", + "dialogflow_cx", + "dialogflow_es", + "dlp", + "documentai", + "edgecontainer", + "eventarc", + "filestore", + "functions", + "gameservices", + "gkehub", + "iam", + "iap", + "ids", + "iot", + "kms", + "language", + "logging", + "managedidentities", + "memcache", + "monitoring", + "networkconnectivity", + "networkmanagement", + "notebooks", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policytroubleshooter", + "privateca", + "profiler", + "pubsub", + "recommender", + "redis", + "resourcemanager", + "resourcesettings", + "retail", + "run", + "scheduler", + "secretmanager", + "securitycenter", + "servicecontrol", + "servicedirectory", + "servicemanagement", + "serviceusage", + "shell", + "spanner", + "speech", + "storage", + "storagetransfer", + "talent", + "tasks", + "texttospeech", + "tpu", + "trace", + "translate", + "video", + "videointelligence", + "vision", + "vmmigration", + "vmwareengine", + "vpcaccess", + "webrisk", + "websecurityscanner", + "workflows", +} + +# `google-cloud-cpp` managems these dependencies using CMake code. +_HARD_CODED_DEPENDENCIES = { + "api_annotations_protos": ["api_http_protos"], + "api_auth_protos": ["api_annotations_protos"], + "api_client_protos": ["api_launch_stage_protos"], + "api_metric_protos": ["api_launch_stage_protos", "api_label_protos"], + "api_billing_protos": ["api_annotations_protos", "api_metric_protos"], + "api_distribution_protos": ["api_annotations_protos"], + "api_endpoint_protos": ["api_annotations_protos"], + "api_log_protos": ["api_label_protos"], + "api_logging_protos": ["api_annotations_protos", "api_label_protos"], + "api_monitored_resource_protos": ["api_launch_stage_protos", "api_label_protos"], + "api_monitoring_protos": ["api_annotations_protos"], + "api_quota_protos": ["api_annotations_protos"], + "api_usage_protos": ["api_annotations_protos", "api_visibility_protos"], + "api_service_protos": [ + "api_annotations_protos", + "api_auth_protos", + "api_backend_protos", + "api_billing_protos", + "api_client_protos", + "api_context_protos", + "api_control_protos", + "api_documentation_protos", + "api_endpoint_protos", + "api_http_protos", + "api_label_protos", + "api_log_protos", + "api_logging_protos", + "api_metric_protos", + "api_monitored_resource_protos", + "api_monitoring_protos", + "api_quota_protos", + "api_resource_protos", + "api_source_info_protos", + "api_system_parameter_protos", + "api_usage_protos", + ], + "devtools_cloudtrace_v2_tracing_protos": [ + "devtools_cloudtrace_v2_trace_protos", + "devtools_cloudtrace_v2_trace_protos", + "api_client_protos", + "api_field_behavior_protos", + "rpc_status_protos", + ], +} + + +def _components(source_folder): + libraries = os.path.join(source_folder, "libraries.bzl") + # Use the hard-coded list because the `google-cloud-cpp` does not provide + # an easy way to get all the components. + if not os.path.exists(libraries): + return _DEFAULT_COMPONENTS + # The `libraries.bzl` file is a Starlark file that simply defines some + # variables listing all GA, experimental, and "transition", components. + # We want both the GA and transition components, the latter are components + # that recently transitioned from experimental to GA. + g = dict() + with open(libraries) as f: + exec(compile(f.read(), libraries, "exec"), g) + return ( + g["GOOGLE_CLOUD_CPP_GA_LIBRARIES"] + g["GOOGLE_CLOUD_CPP_TRANSITION_LIBRARIES"] + ) + + +def _experimental_components(source_folder): + libraries = os.path.join(source_folder, "libraries.bzl") + # Use the hard-coded list because the `google-cloud-cpp` does not provide + # an easy way to get all the components. + if not os.path.exists(libraries): + return _DEFAULT_EXPERIMENTAL_COMPONENTS + # The `libraries.bzl` file is a Starlark file that simply defines some + # variables listing all GA, experimental, and "transition", components. + # We want to return any experimental components, the caller will skip them + # as they are not built by Conan. + g = dict() + with open(libraries) as f: + exec(compile(f.read(), libraries, "exec"), g) + return g["GOOGLE_CLOUD_CPP_EXPERIMENTAL_LIBRARIES"] + + +def _generate_proto_requires(depfile): + """Load the dependencies for a single google-cloud-cpp::*-protos library.""" + requires = [] + with open(depfile, "r", encoding="utf-8") as f: + for line in f.readlines(): + line = line.strip() + line = line.replace(":", "_") + line = line.replace("_proto", "_protos") + line = line.replace("@com_google_googleapis//", "") + line = line.replace("google/", "") + line = line.replace("/", "_") + if line in _PROTO_DEPS_REMOVED_TARGETS: + continue + line = _PROTO_DEPS_REPLACED_TARGETS.get(line, line) + requires.append(line) + return list(_PROTO_DEPS_COMMON_REQUIRES) + requires + + +def main(): + """Generate a python file representing the google-cloud-cpp proto deps.""" + parser = argparse.ArgumentParser(description=(__doc__)) + parser.add_argument( + "-s", + "--source-folder", + help="a directory where `google-cloud-cpp` source has been extracted", + ) + args = parser.parse_args() + source_folder = vars(args)["source_folder"] + deps_folder = os.path.join(source_folder, "external", "googleapis", "protodeps") + print("# Automatically generated by %s DO NOT EDIT" % __file__) + print("DEPENDENCIES = {") + proto_components = _PROTO_BASE_COMPONENTS.copy() + files = sorted(glob.glob(os.path.join(deps_folder, "*.deps"))) + experimental = set(_experimental_components(source_folder)) + for filename in files: + component = os.path.basename(filename).replace(".deps", "") + component = _PROTO_DEPS_REPLACED_NAMES.get(component, component) + if component in experimental or component in _PROTO_DEPS_UNUSED: + # Experimental components have an associated *_protos, component. + # The Conan package only compiles the GA components, so we need + # to skip these. + continue + component = component + "_protos" + deps = _generate_proto_requires(filename) + proto_components.add(component) + proto_components.update(deps) + print(f' "{component}": {sorted(deps)},') + for component in sorted(_HARD_CODED_DEPENDENCIES.keys()): + deps = _HARD_CODED_DEPENDENCIES[component] + proto_components.add(component) + proto_components.update(deps) + print(f' "{component}": {sorted(deps)},') + print("}") + proto_components = proto_components - _PROTO_DEPS_COMMON_REQUIRES + names = ['"%s"' % c for c in proto_components] + joined = ",\n ".join(sorted(names)) + print(f"\nPROTO_COMPONENTS = {{\n {joined}\n}}") + names = ['"%s"' % c for c in _components(source_folder)] + joined = ",\n ".join(sorted(names)) + print(f"\nCOMPONENTS = {{\n {joined}\n}}") + + +if __name__ == "__main__": + main() diff --git a/recipes/google-cloud-cpp/2.x/patches/2.12.0/001-use-conan-msvc-runtime.patch b/recipes/google-cloud-cpp/2.x/patches/2.12.0/001-use-conan-msvc-runtime.patch new file mode 100644 index 0000000000000..bfefce3078428 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.12.0/001-use-conan-msvc-runtime.patch @@ -0,0 +1,53 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index faab325a..657abd4c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,7 +53,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + endif () + + list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) +-include(SelectMSVCRuntime) + + option(GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK + "If enabled, check that the user has defined OPENSSL_ROOT_DIR on macOS" +diff --git a/cmake/GoogleCloudCppCommon.cmake b/cmake/GoogleCloudCppCommon.cmake +index b487a1bc..880c98fe 100644 +--- a/cmake/GoogleCloudCppCommon.cmake ++++ b/cmake/GoogleCloudCppCommon.cmake +@@ -17,9 +17,6 @@ + # Get the destination directories based on the GNU recommendations. + include(GNUInstallDirs) + +-# Pick the right MSVC runtime libraries. +-include(SelectMSVCRuntime) +- + # Enable Werror + include(EnableWerror) + +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index 0cb7a9ae..d9016a0b 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -14,9 +14,6 @@ + # limitations under the License. + # ~~~ + +-# Pick the right MSVC runtime libraries. +-include(SelectMSVCRuntime) +- + add_executable(gcs2cbt gcs2cbt.cc) + target_link_libraries(gcs2cbt google-cloud-cpp::bigtable + google-cloud-cpp::storage google-cloud-cpp::grpc_utils) +diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt +index 03535ff8..2b05c214 100644 +--- a/external/googleapis/CMakeLists.txt ++++ b/external/googleapis/CMakeLists.txt +@@ -157,8 +157,6 @@ if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") + endif () + +-include(SelectMSVCRuntime) +- + google_cloud_cpp_add_protos_property() + + function (external_googleapis_short_name var proto) diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/001-use-googleapis-conan-package.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/001-use-googleapis-conan-package.patch deleted file mode 100644 index 44737240ad451..0000000000000 --- a/recipes/google-cloud-cpp/2.x/patches/2.5.0/001-use-googleapis-conan-package.patch +++ /dev/null @@ -1,1279 +0,0 @@ -diff --git a/cmake/CompileProtos.cmake b/cmake/CompileProtos.cmake -index 366edba..4eb5ea3 100644 ---- a/cmake/CompileProtos.cmake -+++ b/cmake/CompileProtos.cmake -@@ -362,20 +362,10 @@ function (google_cloud_cpp_proto_library libname) - return() - endif () - -- if (${_opt_LOCAL_INCLUDE}) -- google_cloud_cpp_generate_proto( -- proto_sources ${_opt_UNPARSED_ARGUMENTS} LOCAL_INCLUDE -- PROTO_PATH_DIRECTORIES ${_opt_PROTO_PATH_DIRECTORIES}) -- else () -- google_cloud_cpp_generate_proto( -- proto_sources ${_opt_UNPARSED_ARGUMENTS} PROTO_PATH_DIRECTORIES -- ${_opt_PROTO_PATH_DIRECTORIES}) -- endif () -- - add_library(${libname} ${proto_sources}) - set_property(TARGET ${libname} PROPERTY PROTO_SOURCES - ${_opt_UNPARSED_ARGUMENTS}) -- target_link_libraries(${libname} PUBLIC gRPC::grpc++ gRPC::grpc -+ target_link_libraries(${libname} PUBLIC gRPC::grpc++ gRPC::grpc googleapis::googleapis - protobuf::libprotobuf) - # We want to treat the generated code as "system" headers so they get - # ignored by the more aggressive warnings. -diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt -index ad2bd4b..28bf016 100644 ---- a/external/googleapis/CMakeLists.txt -+++ b/external/googleapis/CMakeLists.txt -@@ -16,24 +16,6 @@ - - include(GoogleapisConfig) - --set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL -- "https://github.com/googleapis/googleapis/archive/${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA}.tar.gz" -- "https://storage.googleapis.com/cloud-cpp-community-archive/com_google_googleapis/${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA}.tar.gz" --) --set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL_HASH -- "${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256}") --if (GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL) -- set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL -- ${GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL}) --endif () --if (GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL_HASH) -- set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL_HASH -- "${GOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL_HASH}") --endif () -- --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") -- - set(EXTERNAL_GOOGLEAPIS_PROTO_FILES - # cmake-format: sort - "google/api/annotations.proto" -@@ -113,32 +95,6 @@ foreach (file IN LISTS protolists) - endforeach () - endforeach () - --include(ExternalProject) -- --externalproject_add( -- googleapis_download -- EXCLUDE_FROM_ALL ON -- PREFIX "${PROJECT_BINARY_DIR}/external/googleapis" -- URL ${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL} -- URL_HASH SHA256=${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL_HASH} -- PATCH_COMMAND -- "" -- # ~~~ -- # Scaffolding for patching googleapis after download. For example: -- # PATCH_COMMAND -- # patch -- # -p1 -- # --input=/workspace/external/googleapis.patch -- # NOTE: This should only be used while developing with a new -- # protobuf message. No changes to `PATCH_COMMAND` should ever be -- # committed to the main branch. -- # ~~~ -- CONFIGURE_COMMAND "" -- BUILD_COMMAND "" -- INSTALL_COMMAND "" -- BUILD_BYPRODUCTS ${EXTERNAL_GOOGLEAPIS_BYPRODUCTS} -- LOG_DOWNLOAD OFF) -- - # Sometimes (this happens often with vcpkg) protobuf is installed in a non- - # standard directory. We need to find out where, and then add that directory to - # the search path for protos. -@@ -187,7 +143,6 @@ function (external_googleapis_add_library proto) - endfunction () - - function (external_googleapis_set_version_and_alias short_name) -- add_dependencies("google_cloud_cpp_${short_name}" googleapis_download) - set_target_properties( - "google_cloud_cpp_${short_name}" - PROPERTIES EXPORT_NAME google-cloud-cpp::${short_name} -diff --git a/google/cloud/accessapproval/CMakeLists.txt b/google/cloud/accessapproval/CMakeLists.txt -index 43af932..e297251 100644 ---- a/google/cloud/accessapproval/CMakeLists.txt -+++ b/google/cloud/accessapproval/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::accessapproval_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/accesscontextmanager/CMakeLists.txt b/google/cloud/accesscontextmanager/CMakeLists.txt -index 9ff4ce8..3c96472 100644 ---- a/google/cloud/accesscontextmanager/CMakeLists.txt -+++ b/google/cloud/accesscontextmanager/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::accesscontextmanager_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/apigateway/CMakeLists.txt b/google/cloud/apigateway/CMakeLists.txt -index 5764bd3..517eb1e 100644 ---- a/google/cloud/apigateway/CMakeLists.txt -+++ b/google/cloud/apigateway/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::apigateway_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/apigeeconnect/CMakeLists.txt b/google/cloud/apigeeconnect/CMakeLists.txt -index 17bd60f..af353aa 100644 ---- a/google/cloud/apigeeconnect/CMakeLists.txt -+++ b/google/cloud/apigeeconnect/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::apigeeconnect_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/apikeys/CMakeLists.txt b/google/cloud/apikeys/CMakeLists.txt -index 9359474..6410175 100644 ---- a/google/cloud/apikeys/CMakeLists.txt -+++ b/google/cloud/apikeys/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::apikeys_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/appengine/CMakeLists.txt b/google/cloud/appengine/CMakeLists.txt -index 154a058..6136505 100644 ---- a/google/cloud/appengine/CMakeLists.txt -+++ b/google/cloud/appengine/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::appengine_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/artifactregistry/CMakeLists.txt b/google/cloud/artifactregistry/CMakeLists.txt -index 43d5f07..53184d4 100644 ---- a/google/cloud/artifactregistry/CMakeLists.txt -+++ b/google/cloud/artifactregistry/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::artifactregistry_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/asset/CMakeLists.txt b/google/cloud/asset/CMakeLists.txt -index dc33c07..6924523 100644 ---- a/google/cloud/asset/CMakeLists.txt -+++ b/google/cloud/asset/CMakeLists.txt -@@ -31,8 +31,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/assuredworkloads/CMakeLists.txt b/google/cloud/assuredworkloads/CMakeLists.txt -index a081c00..01332c6 100644 ---- a/google/cloud/assuredworkloads/CMakeLists.txt -+++ b/google/cloud/assuredworkloads/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::assuredworkloads_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/automl/CMakeLists.txt b/google/cloud/automl/CMakeLists.txt -index c890e5e..f711f54 100644 ---- a/google/cloud/automl/CMakeLists.txt -+++ b/google/cloud/automl/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::automl_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/baremetalsolution/CMakeLists.txt b/google/cloud/baremetalsolution/CMakeLists.txt -index df02616..f4cbee4 100644 ---- a/google/cloud/baremetalsolution/CMakeLists.txt -+++ b/google/cloud/baremetalsolution/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::baremetalsolution_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/batch/CMakeLists.txt b/google/cloud/batch/CMakeLists.txt -index 03a1a3d..9645386 100644 ---- a/google/cloud/batch/CMakeLists.txt -+++ b/google/cloud/batch/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::batch_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/beyondcorp/CMakeLists.txt b/google/cloud/beyondcorp/CMakeLists.txt -index e8eea05..24b9a98 100644 ---- a/google/cloud/beyondcorp/CMakeLists.txt -+++ b/google/cloud/beyondcorp/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::beyondcorp_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/billing/CMakeLists.txt b/google/cloud/billing/CMakeLists.txt -index 54c45e6..4c928e6 100644 ---- a/google/cloud/billing/CMakeLists.txt -+++ b/google/cloud/billing/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::billing_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/binaryauthorization/CMakeLists.txt b/google/cloud/binaryauthorization/CMakeLists.txt -index 9f8cd45..48363e2 100644 ---- a/google/cloud/binaryauthorization/CMakeLists.txt -+++ b/google/cloud/binaryauthorization/CMakeLists.txt -@@ -32,8 +32,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/certificatemanager/CMakeLists.txt b/google/cloud/certificatemanager/CMakeLists.txt -index 84a25b0..f4bae6d 100644 ---- a/google/cloud/certificatemanager/CMakeLists.txt -+++ b/google/cloud/certificatemanager/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::certificatemanager_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/channel/CMakeLists.txt b/google/cloud/channel/CMakeLists.txt -index ed6967b..ac19559 100644 ---- a/google/cloud/channel/CMakeLists.txt -+++ b/google/cloud/channel/CMakeLists.txt -@@ -35,8 +35,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::channel_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/cloudbuild/CMakeLists.txt b/google/cloud/cloudbuild/CMakeLists.txt -index 8f30f40..04d6a82 100644 ---- a/google/cloud/cloudbuild/CMakeLists.txt -+++ b/google/cloud/cloudbuild/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::cloudbuild_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/composer/CMakeLists.txt b/google/cloud/composer/CMakeLists.txt -index cde8542..c9af9d1 100644 ---- a/google/cloud/composer/CMakeLists.txt -+++ b/google/cloud/composer/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::composer_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/connectors/CMakeLists.txt b/google/cloud/connectors/CMakeLists.txt -index aef9110..cfd986f 100644 ---- a/google/cloud/connectors/CMakeLists.txt -+++ b/google/cloud/connectors/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::connectors_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/contactcenterinsights/CMakeLists.txt b/google/cloud/contactcenterinsights/CMakeLists.txt -index 03b74ed..3f8831c 100644 ---- a/google/cloud/contactcenterinsights/CMakeLists.txt -+++ b/google/cloud/contactcenterinsights/CMakeLists.txt -@@ -30,8 +30,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/container/CMakeLists.txt b/google/cloud/container/CMakeLists.txt -index 20a6c8b..dedca21 100644 ---- a/google/cloud/container/CMakeLists.txt -+++ b/google/cloud/container/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::container_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/containeranalysis/CMakeLists.txt b/google/cloud/containeranalysis/CMakeLists.txt -index 7548de3..e2486d2 100644 ---- a/google/cloud/containeranalysis/CMakeLists.txt -+++ b/google/cloud/containeranalysis/CMakeLists.txt -@@ -30,8 +30,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/datacatalog/CMakeLists.txt b/google/cloud/datacatalog/CMakeLists.txt -index 7e80060..dd20ab2 100644 ---- a/google/cloud/datacatalog/CMakeLists.txt -+++ b/google/cloud/datacatalog/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::datacatalog_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/datamigration/CMakeLists.txt b/google/cloud/datamigration/CMakeLists.txt -index ee95f1a..1772e90 100644 ---- a/google/cloud/datamigration/CMakeLists.txt -+++ b/google/cloud/datamigration/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::datamigration_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dataplex/CMakeLists.txt b/google/cloud/dataplex/CMakeLists.txt -index c83e390..079242e 100644 ---- a/google/cloud/dataplex/CMakeLists.txt -+++ b/google/cloud/dataplex/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dataplex_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dataproc/CMakeLists.txt b/google/cloud/dataproc/CMakeLists.txt -index ed180ca..e8c5912 100644 ---- a/google/cloud/dataproc/CMakeLists.txt -+++ b/google/cloud/dataproc/CMakeLists.txt -@@ -32,8 +32,6 @@ find_package(absl CONFIG REQUIRED) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/datastream/CMakeLists.txt b/google/cloud/datastream/CMakeLists.txt -index 7ecfd1f..2a7c100 100644 ---- a/google/cloud/datastream/CMakeLists.txt -+++ b/google/cloud/datastream/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::datastream_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/debugger/CMakeLists.txt b/google/cloud/debugger/CMakeLists.txt -index 8c299f3..3fae60d 100644 ---- a/google/cloud/debugger/CMakeLists.txt -+++ b/google/cloud/debugger/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::debugger_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/deploy/CMakeLists.txt b/google/cloud/deploy/CMakeLists.txt -index 73c0d68..9181cb8 100644 ---- a/google/cloud/deploy/CMakeLists.txt -+++ b/google/cloud/deploy/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::deploy_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dialogflow_cx/CMakeLists.txt b/google/cloud/dialogflow_cx/CMakeLists.txt -index 90c70e3..4aead59 100644 ---- a/google/cloud/dialogflow_cx/CMakeLists.txt -+++ b/google/cloud/dialogflow_cx/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dialogflow_cx_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dialogflow_es/CMakeLists.txt b/google/cloud/dialogflow_es/CMakeLists.txt -index 0ddf345..fad8716 100644 ---- a/google/cloud/dialogflow_es/CMakeLists.txt -+++ b/google/cloud/dialogflow_es/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dialogflow_es_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/dlp/CMakeLists.txt b/google/cloud/dlp/CMakeLists.txt -index 67c6329..f6eaa27 100644 ---- a/google/cloud/dlp/CMakeLists.txt -+++ b/google/cloud/dlp/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::dlp_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/documentai/CMakeLists.txt b/google/cloud/documentai/CMakeLists.txt -index 00bc94b..42fd1e1 100644 ---- a/google/cloud/documentai/CMakeLists.txt -+++ b/google/cloud/documentai/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::documentai_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/edgecontainer/CMakeLists.txt b/google/cloud/edgecontainer/CMakeLists.txt -index 4cacb9a..08a2f2e 100644 ---- a/google/cloud/edgecontainer/CMakeLists.txt -+++ b/google/cloud/edgecontainer/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::edgecontainer_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/eventarc/CMakeLists.txt b/google/cloud/eventarc/CMakeLists.txt -index d5e2854..fe37f94 100644 ---- a/google/cloud/eventarc/CMakeLists.txt -+++ b/google/cloud/eventarc/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::eventarc_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/filestore/CMakeLists.txt b/google/cloud/filestore/CMakeLists.txt -index 1f5a0e8..0ae2d00 100644 ---- a/google/cloud/filestore/CMakeLists.txt -+++ b/google/cloud/filestore/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::filestore_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/functions/CMakeLists.txt b/google/cloud/functions/CMakeLists.txt -index ec9ebcd..50d9fc7 100644 ---- a/google/cloud/functions/CMakeLists.txt -+++ b/google/cloud/functions/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::functions_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/gameservices/CMakeLists.txt b/google/cloud/gameservices/CMakeLists.txt -index 30d81ff..0b9cf8c 100644 ---- a/google/cloud/gameservices/CMakeLists.txt -+++ b/google/cloud/gameservices/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::gameservices_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/gkehub/CMakeLists.txt b/google/cloud/gkehub/CMakeLists.txt -index 1747a18..d71c854 100644 ---- a/google/cloud/gkehub/CMakeLists.txt -+++ b/google/cloud/gkehub/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::gkehub_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/grafeas/CMakeLists.txt b/google/cloud/grafeas/CMakeLists.txt -index 2ed9350..33ba5fd 100644 ---- a/google/cloud/grafeas/CMakeLists.txt -+++ b/google/cloud/grafeas/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::grafeas_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/iap/CMakeLists.txt b/google/cloud/iap/CMakeLists.txt -index a22e9b0..4c78edb 100644 ---- a/google/cloud/iap/CMakeLists.txt -+++ b/google/cloud/iap/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::iap_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/ids/CMakeLists.txt b/google/cloud/ids/CMakeLists.txt -index 4724bf2..fc73ea3 100644 ---- a/google/cloud/ids/CMakeLists.txt -+++ b/google/cloud/ids/CMakeLists.txt -@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::ids_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/iot/CMakeLists.txt b/google/cloud/iot/CMakeLists.txt -index 3619b82..1874025 100644 ---- a/google/cloud/iot/CMakeLists.txt -+++ b/google/cloud/iot/CMakeLists.txt -@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::iot_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/kms/CMakeLists.txt b/google/cloud/kms/CMakeLists.txt -index 14a2ef3..59a3596 100644 ---- a/google/cloud/kms/CMakeLists.txt -+++ b/google/cloud/kms/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::kms_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/language/CMakeLists.txt b/google/cloud/language/CMakeLists.txt -index 123ef3c..add8dbc 100644 ---- a/google/cloud/language/CMakeLists.txt -+++ b/google/cloud/language/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::language_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/managedidentities/CMakeLists.txt b/google/cloud/managedidentities/CMakeLists.txt -index 674ce03..b5e4bfa 100644 ---- a/google/cloud/managedidentities/CMakeLists.txt -+++ b/google/cloud/managedidentities/CMakeLists.txt -@@ -31,8 +31,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::managedidentities_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/memcache/CMakeLists.txt b/google/cloud/memcache/CMakeLists.txt -index 8a0ad6b..2fafadc 100644 ---- a/google/cloud/memcache/CMakeLists.txt -+++ b/google/cloud/memcache/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::memcache_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/monitoring/CMakeLists.txt b/google/cloud/monitoring/CMakeLists.txt -index e021974..346a1a6 100644 ---- a/google/cloud/monitoring/CMakeLists.txt -+++ b/google/cloud/monitoring/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::monitoring_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/networkconnectivity/CMakeLists.txt b/google/cloud/networkconnectivity/CMakeLists.txt -index 4ca5e45..ffe44d2 100644 ---- a/google/cloud/networkconnectivity/CMakeLists.txt -+++ b/google/cloud/networkconnectivity/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::networkconnectivity_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/networkmanagement/CMakeLists.txt b/google/cloud/networkmanagement/CMakeLists.txt -index 3fe12a5..d94db72 100644 ---- a/google/cloud/networkmanagement/CMakeLists.txt -+++ b/google/cloud/networkmanagement/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::networkmanagement_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/notebooks/CMakeLists.txt b/google/cloud/notebooks/CMakeLists.txt -index 4cc76ea..2508e4b 100644 ---- a/google/cloud/notebooks/CMakeLists.txt -+++ b/google/cloud/notebooks/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::notebooks_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/optimization/CMakeLists.txt b/google/cloud/optimization/CMakeLists.txt -index 474c28a..e37eb3f 100644 ---- a/google/cloud/optimization/CMakeLists.txt -+++ b/google/cloud/optimization/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::optimization_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/orgpolicy/CMakeLists.txt b/google/cloud/orgpolicy/CMakeLists.txt -index b6935e6..8fe4286 100644 ---- a/google/cloud/orgpolicy/CMakeLists.txt -+++ b/google/cloud/orgpolicy/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::orgpolicy_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/osconfig/CMakeLists.txt b/google/cloud/osconfig/CMakeLists.txt -index 7b5dfe5..19f88a1 100644 ---- a/google/cloud/osconfig/CMakeLists.txt -+++ b/google/cloud/osconfig/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::osconfig_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/oslogin/CMakeLists.txt b/google/cloud/oslogin/CMakeLists.txt -index 1092f6f..87410cf 100644 ---- a/google/cloud/oslogin/CMakeLists.txt -+++ b/google/cloud/oslogin/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::oslogin_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/policytroubleshooter/CMakeLists.txt b/google/cloud/policytroubleshooter/CMakeLists.txt -index aa934d5..9f0bb42 100644 ---- a/google/cloud/policytroubleshooter/CMakeLists.txt -+++ b/google/cloud/policytroubleshooter/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::policytroubleshooter_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/privateca/CMakeLists.txt b/google/cloud/privateca/CMakeLists.txt -index 5ba62ac..b47750d 100644 ---- a/google/cloud/privateca/CMakeLists.txt -+++ b/google/cloud/privateca/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::privateca_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/profiler/CMakeLists.txt b/google/cloud/profiler/CMakeLists.txt -index b1388dc..d2fe3b2 100644 ---- a/google/cloud/profiler/CMakeLists.txt -+++ b/google/cloud/profiler/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::profiler_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/pubsublite/CMakeLists.txt b/google/cloud/pubsublite/CMakeLists.txt -index 12b2b33..2ec80d0 100644 ---- a/google/cloud/pubsublite/CMakeLists.txt -+++ b/google/cloud/pubsublite/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::pubsublite_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/recommender/CMakeLists.txt b/google/cloud/recommender/CMakeLists.txt -index b44cd96..26fdfb5 100644 ---- a/google/cloud/recommender/CMakeLists.txt -+++ b/google/cloud/recommender/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::recommender_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/redis/CMakeLists.txt b/google/cloud/redis/CMakeLists.txt -index 9387bbd..c3bbd0e 100644 ---- a/google/cloud/redis/CMakeLists.txt -+++ b/google/cloud/redis/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::redis_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/resourcemanager/CMakeLists.txt b/google/cloud/resourcemanager/CMakeLists.txt -index d445a8f..2689c33 100644 ---- a/google/cloud/resourcemanager/CMakeLists.txt -+++ b/google/cloud/resourcemanager/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::resourcemanager_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/resourcesettings/CMakeLists.txt b/google/cloud/resourcesettings/CMakeLists.txt -index afac58e..c0b4359 100644 ---- a/google/cloud/resourcesettings/CMakeLists.txt -+++ b/google/cloud/resourcesettings/CMakeLists.txt -@@ -32,8 +32,6 @@ find_package(absl CONFIG REQUIRED) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/retail/CMakeLists.txt b/google/cloud/retail/CMakeLists.txt -index cbda24a..da3b066 100644 ---- a/google/cloud/retail/CMakeLists.txt -+++ b/google/cloud/retail/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::retail_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/run/CMakeLists.txt b/google/cloud/run/CMakeLists.txt -index f771798..7906713 100644 ---- a/google/cloud/run/CMakeLists.txt -+++ b/google/cloud/run/CMakeLists.txt -@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::run_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/scheduler/CMakeLists.txt b/google/cloud/scheduler/CMakeLists.txt -index d4e2310..eeaae20 100644 ---- a/google/cloud/scheduler/CMakeLists.txt -+++ b/google/cloud/scheduler/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::scheduler_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/secretmanager/CMakeLists.txt b/google/cloud/secretmanager/CMakeLists.txt -index f33f9bf..949f929 100644 ---- a/google/cloud/secretmanager/CMakeLists.txt -+++ b/google/cloud/secretmanager/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::secretmanager_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/securitycenter/CMakeLists.txt b/google/cloud/securitycenter/CMakeLists.txt -index e482223..bad25ac 100644 ---- a/google/cloud/securitycenter/CMakeLists.txt -+++ b/google/cloud/securitycenter/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::securitycenter_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/servicecontrol/CMakeLists.txt b/google/cloud/servicecontrol/CMakeLists.txt -index b2f6362..c1c55f3 100644 ---- a/google/cloud/servicecontrol/CMakeLists.txt -+++ b/google/cloud/servicecontrol/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::servicecontrol_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/servicedirectory/CMakeLists.txt b/google/cloud/servicedirectory/CMakeLists.txt -index a66c216..527201a 100644 ---- a/google/cloud/servicedirectory/CMakeLists.txt -+++ b/google/cloud/servicedirectory/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::servicedirectory_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/servicemanagement/CMakeLists.txt b/google/cloud/servicemanagement/CMakeLists.txt -index 96b1a0b..c9981ae 100644 ---- a/google/cloud/servicemanagement/CMakeLists.txt -+++ b/google/cloud/servicemanagement/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::servicemanagement_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/serviceusage/CMakeLists.txt b/google/cloud/serviceusage/CMakeLists.txt -index f9b199a..fddb936 100644 ---- a/google/cloud/serviceusage/CMakeLists.txt -+++ b/google/cloud/serviceusage/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::serviceusage_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/shell/CMakeLists.txt b/google/cloud/shell/CMakeLists.txt -index 178b8bc..a7181f6 100644 ---- a/google/cloud/shell/CMakeLists.txt -+++ b/google/cloud/shell/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::shell_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/speech/CMakeLists.txt b/google/cloud/speech/CMakeLists.txt -index 4cc2e0a..3f52437 100644 ---- a/google/cloud/speech/CMakeLists.txt -+++ b/google/cloud/speech/CMakeLists.txt -@@ -39,8 +39,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::speech_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/storagetransfer/CMakeLists.txt b/google/cloud/storagetransfer/CMakeLists.txt -index fd8a5ae..163e9b4 100644 ---- a/google/cloud/storagetransfer/CMakeLists.txt -+++ b/google/cloud/storagetransfer/CMakeLists.txt -@@ -38,8 +38,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::storagetransfer_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/talent/CMakeLists.txt b/google/cloud/talent/CMakeLists.txt -index 574023e..405dc48 100644 ---- a/google/cloud/talent/CMakeLists.txt -+++ b/google/cloud/talent/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::talent_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/tasks/CMakeLists.txt b/google/cloud/tasks/CMakeLists.txt -index 3b5678e..026f9b1 100644 ---- a/google/cloud/tasks/CMakeLists.txt -+++ b/google/cloud/tasks/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::tasks_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/texttospeech/CMakeLists.txt b/google/cloud/texttospeech/CMakeLists.txt -index 0fdc54a..840e8d4 100644 ---- a/google/cloud/texttospeech/CMakeLists.txt -+++ b/google/cloud/texttospeech/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::texttospeech_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/tpu/CMakeLists.txt b/google/cloud/tpu/CMakeLists.txt -index 2666b6b..cdaf519 100644 ---- a/google/cloud/tpu/CMakeLists.txt -+++ b/google/cloud/tpu/CMakeLists.txt -@@ -27,8 +27,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::tpu_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/trace/CMakeLists.txt b/google/cloud/trace/CMakeLists.txt -index 99a04f5..80d4c1b 100644 ---- a/google/cloud/trace/CMakeLists.txt -+++ b/google/cloud/trace/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::trace_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/translate/CMakeLists.txt b/google/cloud/translate/CMakeLists.txt -index f8a0394..6a44718 100644 ---- a/google/cloud/translate/CMakeLists.txt -+++ b/google/cloud/translate/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::translate_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/video/CMakeLists.txt b/google/cloud/video/CMakeLists.txt -index b1b2628..df98ae4 100644 ---- a/google/cloud/video/CMakeLists.txt -+++ b/google/cloud/video/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::video_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/videointelligence/CMakeLists.txt b/google/cloud/videointelligence/CMakeLists.txt -index 1963d27..4638ddc 100644 ---- a/google/cloud/videointelligence/CMakeLists.txt -+++ b/google/cloud/videointelligence/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::videointelligence_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/vision/CMakeLists.txt b/google/cloud/vision/CMakeLists.txt -index b23e737..004b803 100644 ---- a/google/cloud/vision/CMakeLists.txt -+++ b/google/cloud/vision/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vision_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/vmmigration/CMakeLists.txt b/google/cloud/vmmigration/CMakeLists.txt -index aa88701..e799a3b 100644 ---- a/google/cloud/vmmigration/CMakeLists.txt -+++ b/google/cloud/vmmigration/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vmmigration_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/vmwareengine/CMakeLists.txt b/google/cloud/vmwareengine/CMakeLists.txt -index 55adb2f..79c0f53 100644 ---- a/google/cloud/vmwareengine/CMakeLists.txt -+++ b/google/cloud/vmwareengine/CMakeLists.txt -@@ -38,8 +38,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vmwareengine_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/vpcaccess/CMakeLists.txt b/google/cloud/vpcaccess/CMakeLists.txt -index 5ce47b7..dc7454e 100644 ---- a/google/cloud/vpcaccess/CMakeLists.txt -+++ b/google/cloud/vpcaccess/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::vpcaccess_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/webrisk/CMakeLists.txt b/google/cloud/webrisk/CMakeLists.txt -index 5be0ce7..5d3123f 100644 ---- a/google/cloud/webrisk/CMakeLists.txt -+++ b/google/cloud/webrisk/CMakeLists.txt -@@ -28,8 +28,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::webrisk_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/websecurityscanner/CMakeLists.txt b/google/cloud/websecurityscanner/CMakeLists.txt -index e21608e..c95230e 100644 ---- a/google/cloud/websecurityscanner/CMakeLists.txt -+++ b/google/cloud/websecurityscanner/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::websecurityscanner_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") -diff --git a/google/cloud/workflows/CMakeLists.txt b/google/cloud/workflows/CMakeLists.txt -index 76c239a..aef6492 100644 ---- a/google/cloud/workflows/CMakeLists.txt -+++ b/google/cloud/workflows/CMakeLists.txt -@@ -29,8 +29,6 @@ set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS google-cloud-cpp::workflows_protos) - - include(GoogleCloudCppCommon) - --set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto) - if (PROTO_INCLUDE_DIR) - list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch index 6800c78c11f3e..4099fd00cae2f 100644 --- a/recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch +++ b/recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch @@ -1,5 +1,5 @@ diff --git a/cmake/CompileProtos.cmake b/cmake/CompileProtos.cmake -index 4eb5ea3..9de47cd 100644 +index 366edba..74c27bf 100644 --- a/cmake/CompileProtos.cmake +++ b/cmake/CompileProtos.cmake @@ -315,6 +315,10 @@ include(GNUInstallDirs) @@ -25,10 +25,10 @@ index 4eb5ea3..9de47cd 100644 foreach (header ${target_protos}) # Skip anything that is not a header file. diff --git a/google/cloud/dialogflow_es/CMakeLists.txt b/google/cloud/dialogflow_es/CMakeLists.txt -index fad8716..cc44723 100644 +index 0ddf345..2a00f2d 100644 --- a/google/cloud/dialogflow_es/CMakeLists.txt +++ b/google/cloud/dialogflow_es/CMakeLists.txt -@@ -35,7 +35,12 @@ endif () +@@ -37,7 +37,12 @@ endif () include(CompileProtos) add_library(google_cloud_cpp_dialogflow_es_protos INTERFACE) diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch index 875dd10498af2..f021f480b2dd1 100644 --- a/recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch +++ b/recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch @@ -39,10 +39,10 @@ index 0cb7a9a..d9016a0 100644 target_link_libraries(gcs2cbt google-cloud-cpp::bigtable google-cloud-cpp::storage google-cloud-cpp::grpc_utils) diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt -index 28bf016..c281ce8 100644 +index ad2bd4b..cd1eb3a 100644 --- a/external/googleapis/CMakeLists.txt +++ b/external/googleapis/CMakeLists.txt -@@ -103,8 +103,6 @@ if (PROTO_INCLUDE_DIR) +@@ -147,8 +147,6 @@ if (PROTO_INCLUDE_DIR) list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") endif () diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/004-remove-duplicate-protos.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/004-remove-duplicate-protos.patch new file mode 100644 index 0000000000000..3bae252294281 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.5.0/004-remove-duplicate-protos.patch @@ -0,0 +1,108 @@ +diff --git a/google/cloud/speech/CMakeLists.txt b/google/cloud/speech/CMakeLists.txt +index 4cc2e0a..59546c7 100644 +--- a/google/cloud/speech/CMakeLists.txt ++++ b/google/cloud/speech/CMakeLists.txt +@@ -46,19 +46,18 @@ if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") + endif () + +-include(CompileProtos) +-google_cloud_cpp_load_protolist( +- proto_list +- "${PROJECT_SOURCE_DIR}/external/googleapis/protolists/speech.list") +-google_cloud_cpp_load_protodeps( +- proto_deps +- "${PROJECT_SOURCE_DIR}/external/googleapis/protodeps/speech.deps") +-google_cloud_cpp_grpcpp_library( +- google_cloud_cpp_speech_protos # cmake-format: sort +- ${proto_list} PROTO_PATH_DIRECTORIES "${EXTERNAL_GOOGLEAPIS_SOURCE}" +- "${PROTO_INCLUDE_DIR}") +-external_googleapis_set_version_and_alias(speech_protos) +-target_link_libraries(google_cloud_cpp_speech_protos PUBLIC ${proto_deps}) ++add_library(google_cloud_cpp_speech_protos INTERFACE) ++target_link_libraries(google_cloud_cpp_speech_protos ++ INTERFACE google-cloud-cpp::cloud_speech_protos) ++set_target_properties( ++ google_cloud_cpp_speech_protos ++ PROPERTIES EXPORT_NAME google-cloud-cpp::speech_protos ++ VERSION "${PROJECT_VERSION}" ++ SOVERSION "${PROJECT_VERSION_MAJOR}") ++target_compile_options(google_cloud_cpp_speech_protos ++ INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) ++add_library(google-cloud-cpp::speech_protos ALIAS ++ google_cloud_cpp_speech_protos) + + file( + GLOB source_files +diff --git a/google/cloud/texttospeech/CMakeLists.txt b/google/cloud/texttospeech/CMakeLists.txt +index 0fdc54a..c43aa51 100644 +--- a/google/cloud/texttospeech/CMakeLists.txt ++++ b/google/cloud/texttospeech/CMakeLists.txt +@@ -36,19 +36,18 @@ if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") + endif () + +-include(CompileProtos) +-google_cloud_cpp_load_protolist( +- proto_list +- "${PROJECT_SOURCE_DIR}/external/googleapis/protolists/texttospeech.list") +-google_cloud_cpp_load_protodeps( +- proto_deps +- "${PROJECT_SOURCE_DIR}/external/googleapis/protodeps/texttospeech.deps") +-google_cloud_cpp_grpcpp_library( +- google_cloud_cpp_texttospeech_protos # cmake-format: sort +- ${proto_list} PROTO_PATH_DIRECTORIES "${EXTERNAL_GOOGLEAPIS_SOURCE}" +- "${PROTO_INCLUDE_DIR}") +-external_googleapis_set_version_and_alias(texttospeech_protos) +-target_link_libraries(google_cloud_cpp_texttospeech_protos PUBLIC ${proto_deps}) ++add_library(google_cloud_cpp_texttospeech_protos INTERFACE) ++target_link_libraries(google_cloud_cpp_texttospeech_protos ++ INTERFACE google-cloud-cpp::cloud_texttospeech_protos) ++set_target_properties( ++ google_cloud_cpp_texttospeech_protos ++ PROPERTIES EXPORT_NAME google-cloud-cpp::texttospeech_protos ++ VERSION "${PROJECT_VERSION}" ++ SOVERSION "${PROJECT_VERSION_MAJOR}") ++target_compile_options(google_cloud_cpp_texttospeech_protos ++ INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) ++add_library(google-cloud-cpp::texttospeech_protos ALIAS ++ google_cloud_cpp_texttospeech_protos) + + file( + GLOB source_files +diff --git a/google/cloud/trace/CMakeLists.txt b/google/cloud/trace/CMakeLists.txt +index 99a04f5..0afc230 100644 +--- a/google/cloud/trace/CMakeLists.txt ++++ b/google/cloud/trace/CMakeLists.txt +@@ -35,18 +35,19 @@ if (PROTO_INCLUDE_DIR) + list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}") + endif () + +-include(CompileProtos) +-google_cloud_cpp_load_protolist( +- proto_list +- "${PROJECT_SOURCE_DIR}/external/googleapis/protolists/trace.list") +-google_cloud_cpp_load_protodeps( +- proto_deps "${PROJECT_SOURCE_DIR}/external/googleapis/protodeps/trace.deps") +-google_cloud_cpp_grpcpp_library( +- google_cloud_cpp_trace_protos # cmake-format: sort +- ${proto_list} PROTO_PATH_DIRECTORIES "${EXTERNAL_GOOGLEAPIS_SOURCE}" +- "${PROTO_INCLUDE_DIR}") +-external_googleapis_set_version_and_alias(trace_protos) +-target_link_libraries(google_cloud_cpp_trace_protos PUBLIC ${proto_deps}) ++add_library(google_cloud_cpp_trace_protos INTERFACE) ++target_link_libraries( ++ google_cloud_cpp_trace_protos ++ INTERFACE google-cloud-cpp::devtools_cloudtrace_v2_trace_protos ++ google-cloud-cpp::devtools_cloudtrace_v2_tracing_protos) ++set_target_properties( ++ google_cloud_cpp_trace_protos ++ PROPERTIES EXPORT_NAME google-cloud-cpp::trace_protos ++ VERSION "${PROJECT_VERSION}" ++ SOVERSION "${PROJECT_VERSION_MAJOR}") ++target_compile_options(google_cloud_cpp_trace_protos ++ INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) ++add_library(google-cloud-cpp::trace_protos ALIAS google_cloud_cpp_trace_protos) + + file( + GLOB source_files diff --git a/recipes/google-cloud-cpp/2.x/patches/2.5.0/005-interface-library-properties.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/005-interface-library-properties.patch new file mode 100644 index 0000000000000..4ecbc354da0bd --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.5.0/005-interface-library-properties.patch @@ -0,0 +1,51 @@ +diff --git a/google/cloud/speech/CMakeLists.txt b/google/cloud/speech/CMakeLists.txt +index 59546c7..51bc0b6 100644 +--- a/google/cloud/speech/CMakeLists.txt ++++ b/google/cloud/speech/CMakeLists.txt +@@ -49,11 +49,8 @@ endif () + add_library(google_cloud_cpp_speech_protos INTERFACE) + target_link_libraries(google_cloud_cpp_speech_protos + INTERFACE google-cloud-cpp::cloud_speech_protos) +-set_target_properties( +- google_cloud_cpp_speech_protos +- PROPERTIES EXPORT_NAME google-cloud-cpp::speech_protos +- VERSION "${PROJECT_VERSION}" +- SOVERSION "${PROJECT_VERSION_MAJOR}") ++set_target_properties(google_cloud_cpp_speech_protos ++ PROPERTIES EXPORT_NAME google-cloud-cpp::speech_protos) + target_compile_options(google_cloud_cpp_speech_protos + INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) + add_library(google-cloud-cpp::speech_protos ALIAS +diff --git a/google/cloud/texttospeech/CMakeLists.txt b/google/cloud/texttospeech/CMakeLists.txt +index c43aa51..3041dac 100644 +--- a/google/cloud/texttospeech/CMakeLists.txt ++++ b/google/cloud/texttospeech/CMakeLists.txt +@@ -41,9 +41,7 @@ target_link_libraries(google_cloud_cpp_texttospeech_protos + INTERFACE google-cloud-cpp::cloud_texttospeech_protos) + set_target_properties( + google_cloud_cpp_texttospeech_protos +- PROPERTIES EXPORT_NAME google-cloud-cpp::texttospeech_protos +- VERSION "${PROJECT_VERSION}" +- SOVERSION "${PROJECT_VERSION_MAJOR}") ++ PROPERTIES EXPORT_NAME google-cloud-cpp::texttospeech_protos) + target_compile_options(google_cloud_cpp_texttospeech_protos + INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) + add_library(google-cloud-cpp::texttospeech_protos ALIAS +diff --git a/google/cloud/trace/CMakeLists.txt b/google/cloud/trace/CMakeLists.txt +index 0afc230..828603d 100644 +--- a/google/cloud/trace/CMakeLists.txt ++++ b/google/cloud/trace/CMakeLists.txt +@@ -40,11 +40,8 @@ target_link_libraries( + google_cloud_cpp_trace_protos + INTERFACE google-cloud-cpp::devtools_cloudtrace_v2_trace_protos + google-cloud-cpp::devtools_cloudtrace_v2_tracing_protos) +-set_target_properties( +- google_cloud_cpp_trace_protos +- PROPERTIES EXPORT_NAME google-cloud-cpp::trace_protos +- VERSION "${PROJECT_VERSION}" +- SOVERSION "${PROJECT_VERSION_MAJOR}") ++set_target_properties(google_cloud_cpp_trace_protos ++ PROPERTIES EXPORT_NAME google-cloud-cpp::trace_protos) + target_compile_options(google_cloud_cpp_trace_protos + INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) + add_library(google-cloud-cpp::trace_protos ALIAS google_cloud_cpp_trace_protos) diff --git a/recipes/google-cloud-cpp/config.yml b/recipes/google-cloud-cpp/config.yml index 90eb7ac7b97bc..d5603efb5114a 100644 --- a/recipes/google-cloud-cpp/config.yml +++ b/recipes/google-cloud-cpp/config.yml @@ -11,3 +11,5 @@ versions: folder: "all" "2.5.0": folder: "2.x" + "2.12.0": + folder: "2.x" diff --git a/recipes/gperftools/all/conandata.yml b/recipes/gperftools/all/conandata.yml new file mode 100644 index 0000000000000..8b70af3488037 --- /dev/null +++ b/recipes/gperftools/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.10.0": + url: "https://github.com/gperftools/gperftools/releases/download/gperftools-2.10/gperftools-2.10.tar.gz" + sha256: "83e3bfdd28b8bcf53222c3798d4d395d52dadbbae59e8730c4a6d31a9c3732d8" diff --git a/recipes/gperftools/all/conanfile.py b/recipes/gperftools/all/conanfile.py new file mode 100644 index 0000000000000..60812b411ba17 --- /dev/null +++ b/recipes/gperftools/all/conanfile.py @@ -0,0 +1,227 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os, XCRun +from conan.tools.build import cross_building +from conan.tools.cmake import cmake_layout +from conan.tools.env import VirtualRunEnv +from conan.tools.files import get, copy, rm, rmdir, replace_in_file +from conan.tools.gnu import AutotoolsToolchain, AutotoolsDeps, Autotools + +required_conan_version = ">=1.53.0" + + +class GperftoolsConan(ConanFile): + name = "gperftools" + description = "High-performance multi-threaded malloc()" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/gperftools/gperftools" + topics = ("memory", "allocator", "tcmalloc", "google-perftools") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_cpu_profiler": [True, False], + "build_heap_profiler": [True, False], + "build_heap_checker": [True, False], + "build_debugalloc": [True, False], + "dynamic_sized_delete_support": [True, False], + "emergency_malloc": [None, True, False], + "enable_aggressive_decommit_by_default": [True, False], + "enable_frame_pointers": [True, False], + "enable_large_alloc_report": [True, False], + "enable_libunwind": [True, False], + "enable_stacktrace_via_backtrace": [None, True, False], + "sized_delete": [True, False], + "tcmalloc_alignment": [None, "ANY"], + "tcmalloc_pagesize": [None, "ANY"], + } + default_options = { + "shared": False, + "fPIC": True, + "build_cpu_profiler": False, + "build_heap_profiler": False, + "build_heap_checker": False, + "build_debugalloc": False, + "dynamic_sized_delete_support": False, + "emergency_malloc": None, + "enable_aggressive_decommit_by_default": False, + "enable_frame_pointers": False, + "enable_large_alloc_report": False, + "enable_libunwind": True, + "enable_stacktrace_via_backtrace": False, + "sized_delete": False, + "tcmalloc_alignment": None, + "tcmalloc_pagesize": None, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + @property + def _build_minimal(self): + # Corresponds to the gperftools build_minimal option + return not ( + self.options.build_cpu_profiler + or self.options.build_heap_profiler + or self.options.build_heap_checker + ) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if self._build_minimal: + # Minimal build does not include stack trace support, so these options are irrelevant + self.options.rm_safe("enable_libunwind") + self.options.rm_safe("enable_frame_pointers") + self.options.rm_safe("enable_stacktrace_via_backtrace") + self.options.rm_safe("emergency_malloc") + elif self.options.enable_libunwind: + # enable_stacktrace_via_backtrace has no effect if libunwind is enabled + self.options.rm_safe("enable_stacktrace_via_backtrace") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration( + "gperftools recipe does not currently support Windows. Contributions are welcome." + ) + + def requirements(self): + if self.options.get_safe("enable_libunwind", False): + self.requires("libunwind/1.6.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + args = {} + args["prefix"] = "" + args["enable-cpu-profiler"] = self.options.build_cpu_profiler + args["enable-heap-profiler"] = self.options.build_heap_profiler + args["enable-heap-checker"] = self.options.build_heap_checker + args["enable-debugalloc"] = self.options.build_debugalloc + args["enable-minimal"] = self._build_minimal + args["enable-dynamic-sized-delete-support"] = self.options.dynamic_sized_delete_support + args["enable-sized-delete"] = self.options.sized_delete + args["enable-large-alloc-report"] = self.options.enable_large_alloc_report + args["enable-aggressive-decommit-by-default"] = self.options.enable_aggressive_decommit_by_default + if self._build_minimal: + # No stack trace support will be built + args["enable-libunwind"] = False + args["enable-frame-pointers"] = False + args["enable-stacktrace-via-backtrace"] = False + args["enable-emergency-malloc"] = False + else: + args["enable-libunwind"] = self.options.enable_libunwind + args["enable-frame-pointers"] = self.options.enable_frame_pointers + args["enable-stacktrace-via-backtrace"] = self.options.get_safe( + "enable_stacktrace_via_backtrace", False + ) + args["enable-emergency-malloc"] = self.options.emergency_malloc + args["with-tcmalloc-alignment"] = self.options.tcmalloc_alignment + args["with-tcmalloc-pagesize"] = self.options.tcmalloc_pagesize + + # Based on https://github.com/conan-io/conan-center-index/blob/c647b1/recipes/libx264/all/conanfile.py#L94 + if is_apple_os(self) and self.settings.arch == "armv8": + args["host"] = "aarch64-apple-darwin" + tc.extra_asflags = ["-arch arm64"] + tc.extra_ldflags = ["-arch arm64"] + if self.settings.os != "Macos": + xcrun = XCRun(self) + platform_flags = ["-isysroot", xcrun.sdk_path] + apple_min_version_flag = AutotoolsToolchain(self).apple_min_version_flag + if apple_min_version_flag: + platform_flags.append(apple_min_version_flag) + tc.extra_asflags.extend(platform_flags) + tc.extra_cflags.extend(platform_flags) + tc.extra_ldflags.extend(platform_flags) + + for k, v in args.items(): + if v in [True, False]: + v = "yes" if v else "no" + if v is not None: + tc.configure_args.append(f"--{k}={v}") + tc.generate() + + tc = AutotoolsDeps(self) + tc.generate() + + def _patch_sources(self): + # Disable building of tests and benchmarks in Makefile + for pattern in ["noinst_PROGRAMS = ", "TESTS = "]: + replace_in_file( + self, + os.path.join(self.source_folder, "Makefile.in"), + pattern, + f"{pattern}\n_{pattern}", + ) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy( + self, + pattern="COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + autotools = Autotools(self) + autotools.install() + + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def _add_component(self, lib): + self.cpp_info.components[lib].libs = [lib] + + def package_info(self): + self._add_component("tcmalloc_minimal") + if self.options.build_debugalloc: + self._add_component("tcmalloc_minimal_debug") + if self.options.build_heap_profiler or self.options.build_heap_checker: + self._add_component("tcmalloc") + if self.options.build_debugalloc: + self._add_component("tcmalloc_debug") + if self.options.build_cpu_profiler: + self._add_component("profiler") + if "tcmalloc" in self.cpp_info.components: + self._add_component("tcmalloc_and_profiler") + + for component in self.cpp_info.components.values(): + if self.settings.os in ["Linux", "FreeBSD"]: + component.system_libs.extend(["pthread", "m"]) + if self.options.get_safe("enable_libunwind"): + component.requires.append("libunwind::libunwind") + + # Select the preferred library to link against by default + main_component = self.cpp_info.components["gperftools"] + for lib in [ + "tcmalloc_and_profiler", + "tcmalloc", + "tcmalloc_debug", + "tcmalloc_minimal_debug", + "tcmalloc_minimal", + ]: + if lib in self.cpp_info.components: + main_component.requires = [lib] + if lib != "tcmalloc_and_profiler" and "profiler" in self.cpp_info.components: + main_component.requires.append("profiler") + break diff --git a/recipes/gperftools/all/test_package/CMakeLists.txt b/recipes/gperftools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c9f3e082d85e9 --- /dev/null +++ b/recipes/gperftools/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(gperftools REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gperftools::gperftools) + +add_executable(${PROJECT_NAME}_minimal test_package.cpp) +target_link_libraries(${PROJECT_NAME}_minimal PRIVATE gperftools::tcmalloc_minimal) diff --git a/recipes/gperftools/all/test_package/conanfile.py b/recipes/gperftools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f5cf204295e19 --- /dev/null +++ b/recipes/gperftools/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gperftools/all/test_package/test_package.cpp b/recipes/gperftools/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ee9b96dfbc3cd --- /dev/null +++ b/recipes/gperftools/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include +#include +#include + +int main() { + void *p = tc_malloc(100); + tc_free(p); + std::cout << TC_VERSION_STRING << std::endl; + return p == 0 ? EXIT_FAILURE : EXIT_SUCCESS; +} diff --git a/recipes/gperftools/config.yml b/recipes/gperftools/config.yml new file mode 100644 index 0000000000000..22d65dcfdfac6 --- /dev/null +++ b/recipes/gperftools/config.yml @@ -0,0 +1,3 @@ +versions: + "2.10.0": + folder: all diff --git a/recipes/graphthewy/all/conanfile.py b/recipes/graphthewy/all/conanfile.py index 87bfe2e73e236..a57627cf2f7dd 100644 --- a/recipes/graphthewy/all/conanfile.py +++ b/recipes/graphthewy/all/conanfile.py @@ -1,55 +1,63 @@ import os -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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class GraphthewyConan(ConanFile): name = "graphthewy" + description = "Simple header-only C++ Library for graph modelling (directed or not) and graph cycle detection. " license = "EUPL-1.2" - homepage = "https://github.com/alex-87/graphthewy" url = "https://github.com/conan-io/conan-center-index" - description = "Simple header-only C++ Library for graph modelling (directed or not) and graph cycle detection. " + homepage = "https://github.com/alex-87/graphthewy" topics = ("graph", "algorithm", "modelling", "header-only") - settings = "compiler" + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(self.name + "-" + self.version, self._source_subfolder) + @property + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): return { "Visual Studio": "15.7", + "msvc": "191", "gcc": "7", "clang": "7", "apple-clang": "10" - } - - @property - def _source_subfolder(self): - return "source_subfolder" + } - def configure(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 17) + def layout(self): + basic_layout(self, src_folder="src") - def lazy_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] + 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 not minimum_version: - self.output.warn("graphthewy requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("graphthewy requires C++17, which your compiler does not support.") + 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): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.hpp", dst=os.path.join("include", "graphthewy"), src=self._source_subfolder, keep_path=False) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.hpp", dst=os.path.join(self.package_folder, "include", "graphthewy"), src=self.source_folder, keep_path=False) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/graphthewy/all/test_package/CMakeLists.txt b/recipes/graphthewy/all/test_package/CMakeLists.txt index 4f4089cf5e4ec..3883365747974 100644 --- a/recipes/graphthewy/all/test_package/CMakeLists.txt +++ b/recipes/graphthewy/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(graphthewy REQUIRED CONFIG) add_executable(test_package test_package.cpp) -target_link_libraries(test_package ${CONAN_LIBS}) - +target_link_libraries(test_package PRIVATE graphthewy::graphthewy) set_property(TARGET test_package PROPERTY CXX_STANDARD 17) diff --git a/recipes/graphthewy/all/test_package/conanfile.py b/recipes/graphthewy/all/test_package/conanfile.py index 1d8d5788c2d75..fae501d0afb9e 100644 --- a/recipes/graphthewy/all/test_package/conanfile.py +++ b/recipes/graphthewy/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" -class GraphthewyTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/graphthewy/all/test_package/test_package.cpp b/recipes/graphthewy/all/test_package/test_package.cpp index 10db9f97c57c1..c60ac86359e1d 100644 --- a/recipes/graphthewy/all/test_package/test_package.cpp +++ b/recipes/graphthewy/all/test_package/test_package.cpp @@ -1,7 +1,7 @@ #include #include -int main(int argc, char** arvg) +int main() { graphthewy::UndirectedGraph(g); g.addVertex(1); @@ -11,7 +11,7 @@ int main(int argc, char** arvg) g.link(2, 3); g.link(3, 1); - graphthewy::GraphCyclegc(g); + graphthewy::GraphCycle gc(g); return (gc.hasCycle() == true ? 0 : -1); } diff --git a/recipes/graphthewy/all/test_v1_package/CMakeLists.txt b/recipes/graphthewy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/graphthewy/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/graphthewy/all/test_v1_package/conanfile.py b/recipes/graphthewy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3c2537c3ee226 --- /dev/null +++ b/recipes/graphthewy/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class GraphthewyTestConan(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/greatest/all/conanfile.py b/recipes/greatest/all/conanfile.py index cda1c077e6c1d..24675294fec7f 100644 --- a/recipes/greatest/all/conanfile.py +++ b/recipes/greatest/all/conanfile.py @@ -1,4 +1,10 @@ -from conans import ConanFile, tools +import os + +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class GreatestConan(ConanFile): @@ -8,19 +14,24 @@ class GreatestConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/silentbicycle/greatest" topics = ("testing", "testing-framework", "unit-testing", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("greatest.h", dst="include", src=self._source_subfolder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "greatest.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/greatest/all/test_package/CMakeLists.txt b/recipes/greatest/all/test_package/CMakeLists.txt index a5ffd526aaea7..7ddc15d912feb 100644 --- a/recipes/greatest/all/test_package/CMakeLists.txt +++ b/recipes/greatest/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(greatest REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.c) -target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${CMAKE_PROJECT_NAME} greatest::greatest) diff --git a/recipes/greatest/all/test_package/conanfile.py b/recipes/greatest/all/test_package/conanfile.py index d4128b0450777..fae501d0afb9e 100644 --- a/recipes/greatest/all/test_package/conanfile.py +++ b/recipes/greatest/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gstreamer/all/conanfile.py b/recipes/gstreamer/all/conanfile.py index 2c45e3ce6053d..7bd590a8dadbf 100644 --- a/recipes/gstreamer/all/conanfile.py +++ b/recipes/gstreamer/all/conanfile.py @@ -47,7 +47,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.76.2", transitive_headers=True, transitive_libs=True) + self.requires("glib/2.76.3", transitive_headers=True, transitive_libs=True) def validate(self): if not self.dependencies.direct_host["glib"].options.shared and self.info.options.shared: @@ -55,10 +55,10 @@ def validate(self): raise ConanInvalidConfiguration("shared GStreamer cannot link to static GLib") def build_requirements(self): - self.tool_requires("meson/1.1.0") + self.tool_requires("meson/1.1.1") # There used to be an issue with glib being shared by default but its dependencies being static # No longer the case, but see: https://github.com/conan-io/conan-center-index/pull/13400#issuecomment-1551565573 for context - self.tool_requires("glib/2.76.2") + self.tool_requires("glib/2.76.3") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/1.9.3") if self.options.with_introspection: diff --git a/recipes/gtk-doc-stub/all/conandata.yml b/recipes/gtk-doc-stub/all/conandata.yml index f0e15055fe310..c03929cb0c469 100644 --- a/recipes/gtk-doc-stub/all/conandata.yml +++ b/recipes/gtk-doc-stub/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "cci.20181216": - patch_file: "patches/0001-relocatable-gtkdocize.patch" - base_path: "source_subfolder" diff --git a/recipes/gtk-doc-stub/all/conanfile.py b/recipes/gtk-doc-stub/all/conanfile.py index dc86c338bb133..e2a8032aad958 100644 --- a/recipes/gtk-doc-stub/all/conanfile.py +++ b/recipes/gtk-doc-stub/all/conanfile.py @@ -1,8 +1,13 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -import functools +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path_package_info_legacy + import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class GtkDocStubConan(ConanFile): @@ -12,54 +17,59 @@ class GtkDocStubConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" license = "GPL-2.0-or-later" topics = ("gtk", "documentation", "gtkdocize") + package_type = "application" settings = "os" - exports_sources = "patches/*" - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + 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 package_id(self): - self.info.header_only() + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - args = [ - "--datadir={}".format(tools.unix_path(os.path.join(self.package_folder, "res"))), - "--datarootdir={}".format(tools.unix_path(os.path.join(self.package_folder, "res"))), - ] - autotools.configure(args=args, configure_dir=self._source_subfolder) - return autotools + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--datarootdir=${prefix}/res") + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - autotools = self._configure_autotools() + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) autotools.install() def package_info(self): + self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] self.cpp_info.resdirs = ["res"] - automake_dir = tools.unix_path(os.path.join(self.package_folder, "res", "aclocal")) - self.output.info("Appending AUTOMAKE_CONAN_INCLUDES environment variable: {}".format(automake_dir)) + self.buildenv_info.append_path("PATH", os.path.join(self.package_folder, "bin")) + + automake_dir = unix_path_package_info_legacy(self, os.path.join(self.package_folder, "res", "aclocal")) + self.buildenv_info.append_path("AUTOMAKE_CONAN_INCLUDES", automake_dir) + + # TODO: remove the following when only Conan 2.0 is supported + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) self.env_info.AUTOMAKE_CONAN_INCLUDES.append(automake_dir) diff --git a/recipes/gtk-doc-stub/all/test_package/conanfile.py b/recipes/gtk-doc-stub/all/test_package/conanfile.py index 9346d5cf9cd7a..f3486b7aa5a22 100644 --- a/recipes/gtk-doc-stub/all/test_package/conanfile.py +++ b/recipes/gtk-doc-stub/all/test_package/conanfile.py @@ -1,37 +1,45 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -import os -import shutil +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.files import copy +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - exports_sources = "configure.ac", + exports_sources = "configure.ac" test_type = "explicit" + win_bash = True # This assignment must be *here* to avoid "Cannot wrap command with different envs." in Conan 1.x @property def _settings_build(self): return getattr(self, "settings_build", self.settings) - def requirements(self): - self.requires(self.tested_reference_str) + def layout(self): + basic_layout(self) def build_requirements(self): - self.build_requires(self.tested_reference_str) - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - self.build_requires("automake/1.16.4") + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows": + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + self.tool_requires("automake/1.16.5") + + def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--enable-option-checking=fatal") + tc.configure_args.append("--enable-gtk-doc=no") + tc.generate() def build(self): - for src in self.exports_sources: - shutil.copy(os.path.join(self.source_folder, src), - os.path.join(self.build_folder, src)) - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True, win_bash=tools.os_info.is_windows) - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - args = [ - "--enable-option-checking=fatal", - "--enable-gtk-doc=no", - ] - autotools.configure(args=args) + copy(self, "configure.ac", self.export_sources_folder, self.build_folder) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() def test(self): - self.run("gtkdocize --copy", run_environment=True, win_bash=tools.os_info.is_windows) + if can_run(self): + self.run(f"gtkdocize --version", env="conanbuild") diff --git a/recipes/gurkenlaeufer/all/conandata.yml b/recipes/gurkenlaeufer/all/conandata.yml index 7f1f9f96ad208..8c528ae68f26c 100644 --- a/recipes/gurkenlaeufer/all/conandata.yml +++ b/recipes/gurkenlaeufer/all/conandata.yml @@ -1,4 +1,8 @@ sources: + "1.1.0": + url: + - "https://github.com/paulelsner/gurkenlaeufer/archive/refs/tags/v1.1.0.zip" + sha256: "afa8ff520354ece11c97537ba61998b04fca02d3eda1909d112f008dd4522ba0" "1.0.1": url: - "https://github.com/paulelsner/gurkenlaeufer/archive/refs/tags/v1.0.1.zip" diff --git a/recipes/gurkenlaeufer/config.yml b/recipes/gurkenlaeufer/config.yml index 715e55357a17b..20ec1c9e2bdee 100644 --- a/recipes/gurkenlaeufer/config.yml +++ b/recipes/gurkenlaeufer/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.0": + folder: all "1.0.1": folder: all diff --git a/recipes/happly/all/conanfile.py b/recipes/happly/all/conanfile.py index 21fdcfcb45fd6..2d6741283955a 100644 --- a/recipes/happly/all/conanfile.py +++ b/recipes/happly/all/conanfile.py @@ -1,30 +1,42 @@ -from conans import ConanFile, tools +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class HapplyConan(ConanFile): name = "happly" + description = "A C++ header-only parser for the PLY file format. Parse .ply happily!" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/nmwsharp/happly" - topics = ("conan", "happly", "ply", "3D") - license = "MIT" - description = "A C++ header-only parser for the PLY file format. Parse .ply happily!" - settings = "compiler" + topics = ("ply", "3D", "mesh", "point cloud", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("happly.h", src=self._source_subfolder, dst="include") + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "happly.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/happly/all/test_package/CMakeLists.txt b/recipes/happly/all/test_package/CMakeLists.txt index 33ae887aa6aea..6b4a4a756dfdf 100644 --- a/recipes/happly/all/test_package/CMakeLists.txt +++ b/recipes/happly/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(happly REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE happly::happly) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/happly/all/test_package/conanfile.py b/recipes/happly/all/test_package/conanfile.py index 5a25a64cfaaa9..93e4ec3d18f37 100644 --- a/recipes/happly/all/test_package/conanfile.py +++ b/recipes/happly/all/test_package/conanfile.py @@ -1,12 +1,21 @@ import glob import os -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 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) @@ -14,8 +23,9 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run(os.path.join("bin", "test_package")) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") # Let's check if the *.ply file has been created successfully ply_format_file = glob.glob("*.ply")[0] assert os.path.exists(ply_format_file) diff --git a/recipes/happly/all/test_v1_package/CMakeLists.txt b/recipes/happly/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/happly/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/happly/all/test_v1_package/conanfile.py b/recipes/happly/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4b114846091e7 --- /dev/null +++ b/recipes/happly/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +import glob +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.settings): + self.run(os.path.join("bin", "test_package")) + # Let's check if the *.ply file has been created successfully + ply_format_file = glob.glob("*.ply")[0] + assert os.path.exists(ply_format_file) diff --git a/recipes/harfbuzz/all/conandata.yml b/recipes/harfbuzz/all/conandata.yml index f28956a8ac497..807ef3305d985 100644 --- a/recipes/harfbuzz/all/conandata.yml +++ b/recipes/harfbuzz/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "8.0.1": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/8.0.1/harfbuzz-8.0.1.tar.xz" + sha256: "c1ce780acd385569f25b9a29603d1d5bc71e6940e55bfdd4f7266fad50e42620" + "8.0.0": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/8.0.0/harfbuzz-8.0.0.tar.xz" + sha256: "1f98b5e3d06a344fe667d7e8210094ced458791499839bddde98c167ce6a7c79" "7.3.0": url: "https://github.com/harfbuzz/harfbuzz/releases/download/7.3.0/harfbuzz-7.3.0.tar.xz" sha256: "20770789749ac9ba846df33983dbda22db836c70d9f5d050cb9aa5347094a8fb" diff --git a/recipes/harfbuzz/config.yml b/recipes/harfbuzz/config.yml index 2957fc897516b..b575f01311eb4 100644 --- a/recipes/harfbuzz/config.yml +++ b/recipes/harfbuzz/config.yml @@ -1,4 +1,8 @@ versions: + "8.0.1": + folder: all + "8.0.0": + folder: all "7.3.0": folder: all "7.1.0": diff --git a/recipes/hazelcast-cpp-client/all/conandata.yml b/recipes/hazelcast-cpp-client/all/conandata.yml index 03a7693f717d9..b475516774d72 100644 --- a/recipes/hazelcast-cpp-client/all/conandata.yml +++ b/recipes/hazelcast-cpp-client/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.3.0": + url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v5.3.0.tar.gz" + sha256: "5d38710d027b6311a479c2e4c42f9ac2a04c831a3eb673d4539a2221c8ff8015" "5.2.0": url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v5.2.0.tar.gz" sha256: "49afe765fe4e8ddf134ebf2862a698b8d0dd8dc724d4300e09e5bf7da9e4cbfb" diff --git a/recipes/hazelcast-cpp-client/config.yml b/recipes/hazelcast-cpp-client/config.yml index cc9a79c74eb46..7e4b5ade25250 100644 --- a/recipes/hazelcast-cpp-client/config.yml +++ b/recipes/hazelcast-cpp-client/config.yml @@ -1,4 +1,6 @@ versions: + "5.3.0": + folder: all "5.2.0": folder: all "5.1.0": diff --git a/recipes/highs/all/conandata.yml b/recipes/highs/all/conandata.yml index 03938c9f3bdf9..373553d2ba8bb 100644 --- a/recipes/highs/all/conandata.yml +++ b/recipes/highs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.3": + url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.5.3.tar.gz" + sha256: "ce1a7d2f008e60cc69ab06f8b16831bd0fcd5f6002d3bbebae9d7a3513a1d01d" "1.4.2": url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.4.2.tar.gz" sha256: "29330e284491143cd53a547c23178221df46423679a98f6684251e65cc384d2b" diff --git a/recipes/highs/all/conanfile.py b/recipes/highs/all/conanfile.py index 0873a3aeb59f0..a45cfe7de91d8 100644 --- a/recipes/highs/all/conanfile.py +++ b/recipes/highs/all/conanfile.py @@ -4,6 +4,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version from os.path import join required_conan_version = ">=1.53.0" @@ -65,7 +66,7 @@ def build(self): apply_conandata_patches(self) cmake = CMake(self) cmake.configure() - cmake.build(target="libhighs") + cmake.build(target="highs") def package(self): copy(self, pattern="LICENSE", src=self.source_folder, dst=join(self.package_folder, "licenses")) @@ -76,7 +77,11 @@ def package(self): copy(self, pattern="*.dylib*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) else: copy(self, pattern="*.a", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) - copy(self, pattern="*.lib", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib"), keep_path=False) + if Version(self.version) >= Version("1.5.3"): + # https://github.com/ERGO-Code/HiGHS/commit/2c24b4cb6ecece98ed807dbeff9b27a2fbba8d37 + copy(self, pattern="*.lib", src=self.build_folder, dst=join(self.package_folder, "lib"), keep_path=False) + else: + copy(self, pattern="*.lib", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib"), keep_path=False) fix_apple_shared_install_name(self) def package_info(self): @@ -84,5 +89,6 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") self.cpp_info.system_libs.append("pthread") - if is_msvc(self): + if is_msvc(self) and Version(self.version) < Version("1.5.3"): + # https://github.com/ERGO-Code/HiGHS/commit/7d784db29ab22003670b8b2eb494ab1a97f1815b self.cpp_info.defines.append("_ITERATOR_DEBUG_LEVEL=0") diff --git a/recipes/highs/config.yml b/recipes/highs/config.yml index ba127d382373b..03874f3b48754 100644 --- a/recipes/highs/config.yml +++ b/recipes/highs/config.yml @@ -1,3 +1,5 @@ versions: + "1.5.3": + folder: all "1.4.2": folder: all diff --git a/recipes/highway/all/conandata.yml b/recipes/highway/all/conandata.yml index ae12819eb44d8..a0cdc4a6b1936 100644 --- a/recipes/highway/all/conandata.yml +++ b/recipes/highway/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.4": + url: "https://github.com/google/highway/archive/1.0.4.tar.gz" + sha256: "faccd343935c9e98afd1016e9d20e0b8b89d908508d1af958496f8c2d3004ac2" "1.0.3": url: "https://github.com/google/highway/archive/1.0.3.tar.gz" sha256: "566fc77315878473d9a6bd815f7de78c73734acdcb745c3dde8579560ac5440e" diff --git a/recipes/highway/all/conanfile.py b/recipes/highway/all/conanfile.py index 47b313cb31ecc..0da9b64e6b9f4 100644 --- a/recipes/highway/all/conanfile.py +++ b/recipes/highway/all/conanfile.py @@ -12,10 +12,11 @@ class HighwayConan(ConanFile): name = "highway" description = "Performance-portable, length-agnostic SIMD with runtime dispatch" - topics = ("simd",) license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/google/highway" + topics = ("simd", "neon", "avx", "sse",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -49,6 +50,7 @@ def config_options(self): def configure(self): if Version(self.version) < "0.16.0": del self.options.shared + self.package_type = "static-library" elif self.options.shared: self.options.rm_safe("fPIC") @@ -71,6 +73,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False tc.variables["HWY_ENABLE_EXAMPLES"] = False + tc.variables["HWY_ENABLE_TESTS"] = False tc.generate() def _patch_sources(self): @@ -93,6 +96,7 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.components["hwy"].set_property("pkg_config_name", "libhwy") diff --git a/recipes/highway/config.yml b/recipes/highway/config.yml index 08286722329d4..d3cb7d334892f 100644 --- a/recipes/highway/config.yml +++ b/recipes/highway/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.4": + folder: all "1.0.3": folder: all "1.0.2": diff --git a/recipes/hippomocks/all/conanfile.py b/recipes/hippomocks/all/conanfile.py index 313e2b97cc5a4..8ecc6faeb6ba7 100755 --- a/recipes/hippomocks/all/conanfile.py +++ b/recipes/hippomocks/all/conanfile.py @@ -1,28 +1,54 @@ -from conans import ConanFile, ConanFile, tools -import os, glob +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class HippomocksConan(ConanFile): - name = 'hippomocks' - _libname = 'HippoMocks' - description = 'Single-header mocking framework.' - topics = ("conan", "hippomocks", "mock", "framework") + name = "hippomocks" + description = "Single-header mocking framework." + license = "LGPL-2.1" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/dascandy/hippomocks" - license = 'LGPL-2.1' + topics = ("mock", "framework", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob("%s-*" % (self.name))[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _libname(self): + return "HippoMocks" def package(self): - self.copy('LICENSE', dst='licenses', src=self._source_subfolder) - self.copy('*.h', dst=os.path.join('include', self._libname), src=os.path.join(self._source_subfolder, self._libname)) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include", self._libname), + src=os.path.join(self.source_folder, self._libname)) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/hippomocks/all/test_package/CMakeLists.txt b/recipes/hippomocks/all/test_package/CMakeLists.txt index aff8268476df7..2e78c73ea8082 100755 --- a/recipes/hippomocks/all/test_package/CMakeLists.txt +++ b/recipes/hippomocks/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(hippomocks REQUIRED) +find_package(hippomocks REQUIRED CONFIG) add_executable(${PROJECT_NAME} main.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE hippomocks::hippomocks) diff --git a/recipes/hippomocks/all/test_package/conanfile.py b/recipes/hippomocks/all/test_package/conanfile.py index e065617c053bc..ef5d7042163ec 100755 --- a/recipes/hippomocks/all/test_package/conanfile.py +++ b/recipes/hippomocks/all/test_package/conanfile.py @@ -1,16 +1,26 @@ -from conans import ConanFile, CMake, tools, RunEnvironment +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" + 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() + 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/hippomocks/all/test_package/main.cpp b/recipes/hippomocks/all/test_package/main.cpp old mode 100755 new mode 100644 diff --git a/recipes/hippomocks/all/test_v1_package/CMakeLists.txt b/recipes/hippomocks/all/test_v1_package/CMakeLists.txt new file mode 100755 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/hippomocks/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/hippomocks/all/test_v1_package/conanfile.py b/recipes/hippomocks/all/test_v1_package/conanfile.py new file mode 100755 index 0000000000000..121b7b9615044 --- /dev/null +++ b/recipes/hippomocks/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools, RunEnvironment +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/hiredis/all/conandata.yml b/recipes/hiredis/all/conandata.yml index 2063383701218..780975d1b5665 100644 --- a/recipes/hiredis/all/conandata.yml +++ b/recipes/hiredis/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.0": + url: "https://github.com/redis/hiredis/archive/v1.2.0.tar.gz" + sha256: "82ad632d31ee05da13b537c124f819eb88e18851d9cb0c30ae0552084811588c" "1.1.0": url: "https://github.com/redis/hiredis/archive/v1.1.0.tar.gz" sha256: "fe6d21741ec7f3fc9df409d921f47dfc73a4d8ff64f4ac6f1d95f951bf7f53d6" @@ -9,6 +12,10 @@ sources: url: "https://github.com/redis/hiredis/archive/v1.0.0.tar.gz" sha256: "2a0b5fe5119ec973a0c1966bfc4bd7ed39dbce1cb6d749064af9121fe971936f" patches: + "1.2.0": + - patch_file: "patches/0002-fix-aix.patch" + patch_description: "support AIX build" + patch_type: "portability" "1.1.0": - patch_file: "patches/0001-fix-cmake-1.1.0.patch" patch_description: "divide static/shared build, fix openssl link name" diff --git a/recipes/hiredis/all/conanfile.py b/recipes/hiredis/all/conanfile.py index 95c01b327b522..4973e6b1da136 100644 --- a/recipes/hiredis/all/conanfile.py +++ b/recipes/hiredis/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, rm from conan.tools.scm import Version from conan.tools.microsoft import is_msvc import os @@ -53,6 +53,9 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + # Since 1.2.0, BUILD_SHARED_LIBS has been defined by option() + if Version(self.version) >= "1.2.0": + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared tc.variables["ENABLE_SSL"] = self.options.with_ssl tc.variables["DISABLE_TESTS"] = True tc.variables["ENABLE_EXAMPLES"] = False @@ -74,13 +77,14 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "build")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "hiredis") suffix = "" if Version(self.version) >= "1.1.0": - if is_msvc(self) and not self.options.shared: + if is_msvc(self) and not self.options.shared and Version(self.version) < "1.2.0": suffix += "_static" if self.settings.build_type == "Debug": suffix += "d" diff --git a/recipes/hiredis/config.yml b/recipes/hiredis/config.yml index b06a4f7517eb0..44921f335f1c8 100644 --- a/recipes/hiredis/config.yml +++ b/recipes/hiredis/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.0": folder: all "1.0.2": diff --git a/recipes/hwloc/all/conandata.yml b/recipes/hwloc/all/conandata.yml index bfdda23bd429a..7281cec31bd36 100644 --- a/recipes/hwloc/all/conandata.yml +++ b/recipes/hwloc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.9.2": + sha256: "ffb554d5735e0e0a19d1fd4b2b86e771d3b58b2d97f257eedacae67ade5054b3" + url: https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.2.tar.gz "2.9.1": sha256: "a440e2299f7451dc10a57ddbfa3f116c2a6c4be1bb97c663edd3b9c7b3b3b4cf" url: https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.1.tar.gz diff --git a/recipes/hwloc/config.yml b/recipes/hwloc/config.yml index 724950afba073..b0052643e431c 100644 --- a/recipes/hwloc/config.yml +++ b/recipes/hwloc/config.yml @@ -1,4 +1,6 @@ versions: + "2.9.2": + folder: all "2.9.1": folder: all "2.9.0": diff --git a/recipes/icecream-cpp/all/conanfile.py b/recipes/icecream-cpp/all/conanfile.py index ad2f369b0f440..472b8f9d1ba62 100644 --- a/recipes/icecream-cpp/all/conanfile.py +++ b/recipes/icecream-cpp/all/conanfile.py @@ -1,42 +1,49 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class IcecreamcppConan(ConanFile): name = "icecream-cpp" + description = "A little library to help with the print debugging on C++11 and forward." license = "MIT" - homepage = "https://github.com/renatoGarcia/icecream-cpp" url = "https://github.com/conan-io/conan-center-index" - description = "A little library to help with the print debugging on C++11 and forward." - topics = ("debug", "single-header-lib", "print") - settings = "compiler" + homepage = "https://github.com/renatoGarcia/icecream-cpp" + topics = ("debug", "single-header-lib", "print", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + 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, 11) + check_min_cppstd(self, 11) - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration( - "icecream-cpp can't be used by {0} {1}".format( - self.settings.compiler, - self.settings.compiler.version - ) + f"icecream-cpp can't be used by {self.settings.compiler} {self.settings.compiler.version}" ) - def package_id(self): - self.info.header_only() - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy("icecream.hpp", dst="include", src=self._source_subfolder) + copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "icecream.hpp", 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/icecream-cpp/all/test_package/CMakeLists.txt b/recipes/icecream-cpp/all/test_package/CMakeLists.txt index 6aab347eddf53..5b9d4de6b2558 100644 --- a/recipes/icecream-cpp/all/test_package/CMakeLists.txt +++ b/recipes/icecream-cpp/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(icecream-cpp REQUIRED CONFIG) add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example PRIVATE icecream-cpp::icecream-cpp) set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/icecream-cpp/all/test_package/conanfile.py b/recipes/icecream-cpp/all/test_package/conanfile.py index 186ee2682166d..e0f447388fa1b 100644 --- a/recipes/icecream-cpp/all/test_package/conanfile.py +++ b/recipes/icecream-cpp/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" -class IcecreamcppTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not 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.bindir, "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/id3v2lib/all/conanfile.py b/recipes/id3v2lib/all/conanfile.py index 084cf1767bdcf..d920c95d34bde 100644 --- a/recipes/id3v2lib/all/conanfile.py +++ b/recipes/id3v2lib/all/conanfile.py @@ -8,7 +8,7 @@ required_conan_version = ">=1.53.0" -class LibwebmConan(ConanFile): +class Id3v2libConan(ConanFile): name = "id3v2lib" description = "id3v2lib is a library written in C to read and edit id3 tags from mp3 files." topics = ("conan", "id3", "tags", "mp3", "container", "media", "audio") diff --git a/recipes/imgui/all/conandata.yml b/recipes/imgui/all/conandata.yml index 1eb68f99063db..82db7f4c7e4b5 100644 --- a/recipes/imgui/all/conandata.yml +++ b/recipes/imgui/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.89.7": + url: "https://github.com/ocornut/imgui/archive/v1.89.7.tar.gz" + sha256: "115ee9e242af98a884302ac0f6ca3b2b26b1f10c660205f5e7ad9f1d1c96d269" + "1.89.7-docking": + url: "https://github.com/ocornut/imgui/archive/v1.89.7-docking.tar.gz" + sha256: "28216ec07e87f075b63486d8d5212e4d89542b69bd10a482f1b4b7dc6f1613a0" + "1.89.5": + url: "https://github.com/ocornut/imgui/archive/v1.89.5.tar.gz" + sha256: "eab371005c86dd029523a0c4ba757840787163740d45c1f4e5a110eb21820546" "1.89.4": url: "https://github.com/ocornut/imgui/archive/v1.89.4.tar.gz" sha256: "69f1e83adcab3fdd27b522f5075f407361b0d3875e3522b13d33bc2ae2c7d48c" diff --git a/recipes/imgui/config.yml b/recipes/imgui/config.yml index ce92302f4a251..737cb8b3dbc2c 100644 --- a/recipes/imgui/config.yml +++ b/recipes/imgui/config.yml @@ -1,4 +1,10 @@ versions: + "1.89.7": + folder: all + "1.89.7-docking": + folder: all + "1.89.5": + folder: all "1.89.4": folder: all "1.89.3": diff --git a/recipes/indirect_value/all/conanfile.py b/recipes/indirect_value/all/conanfile.py index ce84972958e04..7ef5edf99c73d 100644 --- a/recipes/indirect_value/all/conanfile.py +++ b/recipes/indirect_value/all/conanfile.py @@ -1,24 +1,27 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class IndirectValueConan(ConanFile): name = "indirect_value" - homepage = "https://github.com/jbcoe/indirect_value" description = "Production-quality reference implementation of P1950: A Free-Store-Allocated Value Type For C++" - topics = ("std", "vocabulary-type", "value-semantics") license = "MIT" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jbcoe/indirect_value" + topics = ("std", "vocabulary-type", "value-semantics", "header-only") + + package_type = "header-library" 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 17 @@ -29,40 +32,45 @@ def _minimum_compilers_version(self): "Visual Studio": "16", "gcc": "8", "clang": "8", - "apple-clang": "11" + "apple-clang": "11", } + 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) - min_version = self._minimum_compilers_version.get( - str(self.settings.compiler)) + 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.warning(f"{self.name} recipe lacks information about the " + f"{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)) - - def package_id(self): - self.info.header_only() + f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler" + f" {self.settings.compiler} {self.settings.compiler.version} does not support it." + ) 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="indirect_value.*", dst="include", - src=self._source_subfolder) - self.copy("*LICENSE*", dst="licenses", keep_path=False) + copy(self, "indirect_value.*", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder) + copy(self, "*LICENSE*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + keep_path=False) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "indirect_value") self.cpp_info.set_property("cmake_target_name", "indirect_value::indirect_value") diff --git a/recipes/indirect_value/all/test_package/CMakeLists.txt b/recipes/indirect_value/all/test_package/CMakeLists.txt index fd68256049f87..e44109c29e389 100644 --- a/recipes/indirect_value/all/test_package/CMakeLists.txt +++ b/recipes/indirect_value/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(indirect_value REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/indirect_value/all/test_package/conanfile.py b/recipes/indirect_value/all/test_package/conanfile.py index 9b63bd176646b..fae501d0afb9e 100644 --- a/recipes/indirect_value/all/test_package/conanfile.py +++ b/recipes/indirect_value/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain" + 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,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/indirect_value/all/test_v1_package/CMakeLists.txt b/recipes/indirect_value/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/indirect_value/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/indirect_value/all/test_v1_package/conanfile.py b/recipes/indirect_value/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9b63bd176646b --- /dev/null +++ b/recipes/indirect_value/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/influxdb-cpp/all/conanfile.py b/recipes/influxdb-cpp/all/conanfile.py index fa5b1610b16b3..c4120819ef945 100644 --- a/recipes/influxdb-cpp/all/conanfile.py +++ b/recipes/influxdb-cpp/all/conanfile.py @@ -1,33 +1,48 @@ import os -from conans import ConanFile, tools -import glob +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class InfluxDBCppConan(ConanFile): name = "influxdb-cpp" + description = "C++ client for InfluxDB." license = "MIT" - homepage = "https://github.com/orca-zhang/influxdb-cpp" url = "https://github.com/conan-io/conan-center-index" - description = "C++ client for InfluxDB." - topics = ("single-header-lib", "influxdb") - settings = "os" + homepage = "https://github.com/orca-zhang/influxdb-cpp" + topics = ("single-header-lib", "influxdb", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - _source_subfolder = "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + @property + def _min_cppstd(self): + return 11 + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob("influxdb-cpp-*")[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy('LICENSE', dst='licenses', src=self._source_subfolder) - self.copy('influxdb.hpp', dst='include', src=self._source_subfolder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "influxdb.hpp", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] if self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32"] - - def package_id(self): - self.info.header_only() diff --git a/recipes/influxdb-cpp/all/test_package/CMakeLists.txt b/recipes/influxdb-cpp/all/test_package/CMakeLists.txt index 6aab347eddf53..8aaa0b611508b 100644 --- a/recipes/influxdb-cpp/all/test_package/CMakeLists.txt +++ b/recipes/influxdb-cpp/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(influxdb-cpp REQUIRED CONFIG) -add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) -set_property(TARGET example PROPERTY CXX_STANDARD 11) +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE influxdb-cpp::influxdb-cpp) +set_property(TARGET test_package PROPERTY CXX_STANDARD 11) diff --git a/recipes/influxdb-cpp/all/test_package/conanfile.py b/recipes/influxdb-cpp/all/test_package/conanfile.py index 17295afcb8561..fae501d0afb9e 100644 --- a/recipes/influxdb-cpp/all/test_package/conanfile.py +++ b/recipes/influxdb-cpp/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" -class InfluxDBCppTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/influxdb-cpp/all/test_package/example.cpp b/recipes/influxdb-cpp/all/test_package/test_package.cpp similarity index 100% rename from recipes/influxdb-cpp/all/test_package/example.cpp rename to recipes/influxdb-cpp/all/test_package/test_package.cpp diff --git a/recipes/influxdb-cpp/all/test_v1_package/CMakeLists.txt b/recipes/influxdb-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/influxdb-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/influxdb-cpp/all/test_v1_package/conanfile.py b/recipes/influxdb-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49bc2bd787325 --- /dev/null +++ b/recipes/influxdb-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class InfluxDBCppTestConan(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): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/inih/all/conandata.yml b/recipes/inih/all/conandata.yml index f45a313d7e7e2..d0684466616d8 100644 --- a/recipes/inih/all/conandata.yml +++ b/recipes/inih/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "57": + url: "https://github.com/benhoyt/inih/archive/r57.tar.gz" + sha256: "f03f98ca35c3adb56b2358573c8d3eda319ccd5287243d691e724b7eafa970b3" "56": url: "https://github.com/benhoyt/inih/archive/r56.tar.gz" sha256: "4f2ba6bd122d30281a8c7a4d5723b7af90b56aa828c0e88256d7fceda03a491a" diff --git a/recipes/inih/all/conanfile.py b/recipes/inih/all/conanfile.py index d2890dd500498..7b43c7f01710c 100644 --- a/recipes/inih/all/conanfile.py +++ b/recipes/inih/all/conanfile.py @@ -3,9 +3,11 @@ from conan.tools.apple import fix_apple_shared_install_name from conan.tools.env import VirtualBuildEnv from conan.tools.files import copy, get, rmdir +from conan.tools.build import check_min_cppstd from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -24,12 +26,18 @@ class InihConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_inireader": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_inireader": True, } + @property + def _min_cppstd(self): + return 11 + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -37,18 +45,24 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.cppstd") - self.settings.rm_safe("compiler.libcxx") + # INIReader is written in C++ + if not self.options.with_inireader: + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def layout(self): basic_layout(self, src_folder="src") def validate(self): + # since 57, INIReader requires C++11 + if Version(self.version) >= "57" and self.options.with_inireader and \ + self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) if self.options.shared and is_msvc(self): raise ConanInvalidConfiguration("Shared inih is not supported with msvc") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.1.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -58,7 +72,10 @@ def generate(self): env.generate() tc = MesonToolchain(self) tc.project_options["distro_install"] = True - tc.project_options["with_INIReader"] = True + tc.project_options["with_INIReader"] = self.options.with_inireader + # since 57, INIReader requires C++11 + if Version(self.version) >= "57" and not is_msvc(self): + tc.cpp_args.append("-std=c++11") tc.generate() def build(self): @@ -80,9 +97,10 @@ def package_info(self): self.cpp_info.components["libinih"].set_property("pkg_config_name", "inih") self.cpp_info.components["libinih"].libs = ["inih"] - self.cpp_info.components["inireader"].set_property("pkg_config_name", "INIReader") - self.cpp_info.components["inireader"].libs = ["INIReader"] - self.cpp_info.components["inireader"].requires = ["libinih"] + if self.options.with_inireader: + self.cpp_info.components["inireader"].set_property("pkg_config_name", "INIReader") + self.cpp_info.components["inireader"].libs = ["INIReader"] + self.cpp_info.components["inireader"].requires = ["libinih"] def fix_msvc_libname(conanfile, remove_lib_prefix=True): """remove lib prefix & change extension to .lib in case of cl like compiler""" diff --git a/recipes/inih/config.yml b/recipes/inih/config.yml index 3746836949531..c64487db679f8 100644 --- a/recipes/inih/config.yml +++ b/recipes/inih/config.yml @@ -1,4 +1,6 @@ versions: + "57": + folder: "all" "56": folder: "all" "55": diff --git a/recipes/inversify-cpp/all/conanfile.py b/recipes/inversify-cpp/all/conanfile.py index 3d897954ee020..cbe49e9425718 100644 --- a/recipes/inversify-cpp/all/conanfile.py +++ b/recipes/inversify-cpp/all/conanfile.py @@ -1,20 +1,31 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class InversifyCppConan(ConanFile): name = "inversify-cpp" description = "C++17 inversion of control and dependency injection container library" - topics = ("ioc", "container", "dependency", "injection") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mosure/inversify-cpp" - license = "MIT" - settings = "compiler" + topics = ("ioc", "container", "dependency", "injection", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return 17 + @property def _compilers_minimum_version(self): return { @@ -24,27 +35,36 @@ def _compilers_minimum_version(self): "apple-clang": "11", } + 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, 17) + check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++{self._min_cppstd}, " + "which your compiler does not support.") else: - self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) - - @property - def _source_subfolder(self): - return "source_subfolder" + self.output.warning(f"{self.name} requires C++{self._min_cppstd}. " + f"Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") 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="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/inversify-cpp/all/test_package/CMakeLists.txt b/recipes/inversify-cpp/all/test_package/CMakeLists.txt index fc7a3028bf1a1..98d70570dc70a 100644 --- a/recipes/inversify-cpp/all/test_package/CMakeLists.txt +++ b/recipes/inversify-cpp/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(inversify-cpp CONFIG REQUIRED) +find_package(inversify-cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} inversify-cpp::inversify-cpp) diff --git a/recipes/inversify-cpp/all/test_package/conanfile.py b/recipes/inversify-cpp/all/test_package/conanfile.py index 49a3a66ea5bad..fae501d0afb9e 100644 --- a/recipes/inversify-cpp/all/test_package/conanfile.py +++ b/recipes/inversify-cpp/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/inversify-cpp/all/test_package/test_package.cpp b/recipes/inversify-cpp/all/test_package/test_package.cpp index 3bf0d0cfb88a1..4f9ae5cdc6296 100644 --- a/recipes/inversify-cpp/all/test_package/test_package.cpp +++ b/recipes/inversify-cpp/all/test_package/test_package.cpp @@ -2,21 +2,17 @@ #include "mosure/inversify.hpp" - namespace inversify = mosure::inversify; namespace symbols { - using foo = inversify::Symbol; +using foo = inversify::Symbol; } - int main() { - inversify::Container< - symbols::foo - > container; + inversify::Container container; container.bind().toConstantValue(true); - std::cout <<"working: " << container.get() << std::endl; + std::cout << "working: " << container.get() << std::endl; return 0; } diff --git a/recipes/inversify-cpp/all/test_v1_package/CMakeLists.txt b/recipes/inversify-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/inversify-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/inversify-cpp/all/test_v1_package/conanfile.py b/recipes/inversify-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/inversify-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/jinja2cpp/all/CMakeLists.txt b/recipes/jinja2cpp/all/CMakeLists.txt deleted file mode 100644 index 4b0bc06c8282d..0000000000000 --- a/recipes/jinja2cpp/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(source_subfolder) diff --git a/recipes/jinja2cpp/all/conandata.yml b/recipes/jinja2cpp/all/conandata.yml index ba871764ca5c4..01898ea7a626a 100644 --- a/recipes/jinja2cpp/all/conandata.yml +++ b/recipes/jinja2cpp/all/conandata.yml @@ -1,6 +1,6 @@ sources: "1.2.1": - url: "https://github.com/jinja2cpp/Jinja2Cpp/archive/refs/tags/1.2.1.tar.gz" + url: "https://github.com/jinja2cpp/Jinja2Cpp/archive/1.2.1.tar.gz" sha256: "2e61516fd4fd77452c8dd7a6f958ad47c42990df9b7bdc62cf2deb8aa7819b6c" "1.1.0": url: "https://github.com/jinja2cpp/Jinja2Cpp/archive/1.1.0.tar.gz" @@ -8,7 +8,9 @@ sources: patches: "1.2.1": - patch_file: "patches/fix-cmake-1.2.1.patch" - base_path: "source_subfolder" + patch_description: "use cci package, fix compilation error on MSVC" + patch_type: "conan" "1.1.0": - patch_file: "patches/fix-cmake-1.1.0.patch" - base_path: "source_subfolder" + patch_description: "use cci package, include mutex for std::unique_lock" + patch_type: "conan" diff --git a/recipes/jinja2cpp/all/conanfile.py b/recipes/jinja2cpp/all/conanfile.py index 5ccade1cbf22f..f6bfa2d0a3b34 100644 --- a/recipes/jinja2cpp/all/conanfile.py +++ b/recipes/jinja2cpp/all/conanfile.py @@ -1,20 +1,22 @@ -from conan.tools.microsoft import msvc_runtime_flag -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import msvc_runtime_flag, is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -import textwrap - -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class Jinja2cppConan(ConanFile): name = "jinja2cpp" + description = "Jinja2 C++ (and for C++) almost full-conformance template engine implementation" license = "MIT" - homepage = "https://jinja2cpp.dev/" url = "https://github.com/conan-io/conan-center-index" - description = "Jinja2 C++ (and for C++) almost full-conformance template engine implementation" + homepage = "https://jinja2cpp.dev/" topics = ("cpp14", "cpp17", "jinja2", "string templates", "templates engine") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,25 +27,22 @@ class Jinja2cppConan(ConanFile): "fPIC": True, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return 14 @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } 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": @@ -51,98 +50,72 @@ 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.78.0") - self.requires("expected-lite/0.5.0") - self.requires("optional-lite/3.5.0") - self.requires("rapidjson/cci.20211112") - self.requires("string-view-lite/1.6.0") - self.requires("variant-lite/2.0.0") + self.requires("boost/1.82.0") + self.requires("expected-lite/0.6.3", transitive_headers=True) + self.requires("optional-lite/3.5.0", transitive_headers=True) + self.requires("rapidjson/cci.20220822") + self.requires("string-view-lite/1.7.0", transitive_headers=True) + self.requires("variant-lite/2.0.0", transitive_headers=True) if self.version == "1.1.0": self.requires("fmt/6.2.1") # not compatible with fmt >= 7.0.0 else: - self.requires("nlohmann_json/3.10.5") - self.requires("fmt/8.1.1") + self.requires("nlohmann_json/3.11.2") + self.requires("fmt/10.0.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 14) + 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): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["JINJA2CPP_BUILD_TESTS"] = False + tc.variables["JINJA2CPP_STRICT_WARNINGS"] = False + tc.variables["JINJA2CPP_BUILD_SHARED"] = self.options.shared + tc.variables["JINJA2CPP_DEPS_MODE"] = "conan-build" + tc.variables["JINJA2CPP_CXX_STANDARD"] = self.settings.compiler.get_safe("cppstd", 14) + if is_msvc(self): + # Runtime type configuration for Jinja2C++ should be strictly '/MT' or '/MD' + runtime = "/MD" if "MD" in msvc_runtime_flag(self) else "/MT" + tc.variables["JINJA2CPP_MSVC_RUNTIME_TYPE"] = runtime + tc.generate() + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) # Don't force MD for shared lib, allow to honor runtime from profile - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "set(JINJA2CPP_MSVC_RUNTIME_TYPE \"/MD\")", "") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["JINJA2CPP_BUILD_TESTS"] = False - self._cmake.definitions["JINJA2CPP_STRICT_WARNINGS"] = False - self._cmake.definitions["JINJA2CPP_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["JINJA2CPP_DEPS_MODE"] = "conan-build" - self._cmake.definitions["JINJA2CPP_CXX_STANDARD"] = self.settings.compiler.get_safe("cppstd", 14) - # Conan cmake generator omits the build_type flag for MSVC multiconfiguration CMake, - # but provide build-type-specific runtime type flag. For now, Jinja2C++ build scripts - # need to know the build type is being built in order to setup internal flags correctly - self._cmake.definitions["CMAKE_BUILD_TYPE"] = self.settings.build_type - if self._is_msvc: - # Runtime type configuration for Jinja2C++ should be strictly '/MT' or '/MD' - runtime = "/MD" if "MD" in msvc_runtime_flag(self) else "/MT" - self._cmake.definitions["JINJA2CPP_MSVC_RUNTIME_TYPE"] = runtime - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(JINJA2CPP_MSVC_RUNTIME_TYPE \"/MD\")", "") def build(self): - if self.version == "1.1.0": - if tools.Version(self.deps_cpp_info["fmt"].version) >= "7.0.0": - raise ConanInvalidConfiguration("jinja2cpp requires fmt < 7.0.0") self._patch_sources() - cmake = self._configure_cmake() + 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", "jinja2cpp")) - tools.rmdir(os.path.join(self.package_folder, "share")) - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - {"jinja2cpp": "jinja2cpp::jinja2cpp"} - ) - - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): - content = "" - for alias, aliased in targets.items(): - content += textwrap.dedent("""\ - if(TARGET {aliased} AND NOT TARGET {alias}) - add_library({alias} INTERFACE IMPORTED) - set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) - endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) - - @property - def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + rmdir(self, os.path.join(self.package_folder, "lib", "jinja2cpp")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "jinja2cpp") self.cpp_info.set_property("cmake_target_name", "jinja2cpp") self.cpp_info.libs = ["jinja2cpp"] - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/jinja2cpp/all/patches/fix-cmake-1.1.0.patch b/recipes/jinja2cpp/all/patches/fix-cmake-1.1.0.patch index 2c9056e924d37..e1b4bd4776539 100644 --- a/recipes/jinja2cpp/all/patches/fix-cmake-1.1.0.patch +++ b/recipes/jinja2cpp/all/patches/fix-cmake-1.1.0.patch @@ -1,3 +1,5 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b5c8b3c..c0afc14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,10 +21,6 @@ option(JINJA2CPP_STRICT_WARNINGS "Enable additional warnings and treat them as e @@ -29,20 +31,37 @@ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jinja2cpp ) +diff --git a/include/jinja2cpp/template_env.h b/include/jinja2cpp/template_env.h +index d49859e..0bd456e 100644 +--- a/include/jinja2cpp/template_env.h ++++ b/include/jinja2cpp/template_env.h +@@ -6,6 +6,7 @@ + #include "filesystem_handler.h" + #include "template.h" + ++#include + #include + #include + +diff --git a/thirdparty/thirdparty-conan-build.cmake b/thirdparty/thirdparty-conan-build.cmake +index 5aecfbd..957657f 100644 --- a/thirdparty/thirdparty-conan-build.cmake +++ b/thirdparty/thirdparty-conan-build.cmake -@@ -8,7 +8,11 @@ find_package(string-view-lite) +@@ -6,9 +6,13 @@ find_package(optional-lite) + find_package(string-view-lite) + find_package(Boost) - set(CONAN_BOOST_PACKAGE_NAME Boost::Boost) +-set(CONAN_BOOST_PACKAGE_NAME Boost::Boost) find_package(fmt) -find_package(rapidjson) +find_package(RapidJSON) - --set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt rapidjson::rapidjson) --set(JINJA2_PUBLIC_LIBS_INT expected-lite::expected-lite variant-lite::variant-lite optional-lite::optional-lite string-view-lite::string-view-lite) ++ +# TODO: replace conan targets by official imported targets when fixed in corresponding recipes: +# - CONAN_PKG::rapidjson => rapidjson +# - CONAN_PKG::optional-lite => nonstd::optional-lite +# - CONAN_PKG::variant-lite => nonstd::variant-lite -+set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt CONAN_PKG::rapidjson) -+set(JINJA2_PUBLIC_LIBS_INT nonstd::expected-lite CONAN_PKG::variant-lite CONAN_PKG::optional-lite nonstd::string-view-lite) ++set(JINJA2_PRIVATE_LIBS_INT Boost::headers Boost::filesystem fmt::fmt rapidjson) ++set(JINJA2_PUBLIC_LIBS_INT nonstd::expected-lite nonstd::variant-lite nonstd::optional-lite nonstd::string-view-lite) + +-set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt rapidjson::rapidjson) +-set(JINJA2_PUBLIC_LIBS_INT expected-lite::expected-lite variant-lite::variant-lite optional-lite::optional-lite string-view-lite::string-view-lite) diff --git a/recipes/jinja2cpp/all/patches/fix-cmake-1.2.1.patch b/recipes/jinja2cpp/all/patches/fix-cmake-1.2.1.patch index d355b60a17daa..391fd64166078 100644 --- a/recipes/jinja2cpp/all/patches/fix-cmake-1.2.1.patch +++ b/recipes/jinja2cpp/all/patches/fix-cmake-1.2.1.patch @@ -12,7 +12,7 @@ index bf603b0..6229f02 100644 ) diff --git a/src/helpers.h b/src/helpers.h -index 3af280f..a6a3205 100644 +index 3af280f..b1c31fe 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -32,12 +32,21 @@ struct MultiStringLiteral @@ -37,3 +37,33 @@ index 3af280f..a6a3205 100644 template struct SelectMemberPtr; +diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt +index 77794b9..e31b999 100644 +--- a/thirdparty/CMakeLists.txt ++++ b/thirdparty/CMakeLists.txt +@@ -67,8 +67,8 @@ if(JINJA2CPP_BUILD_TESTS) + endif() + + if (NOT DEFINED JINJA2_PRIVATE_LIBS_INT) +- set(JINJA2CPP_PRIVATE_LIBS ${JINJA2CPP_PRIVATE_LIBS} Boost::variant +- Boost::filesystem Boost::algorithm Boost::lexical_cast fmt RapidJson) ++ set(JINJA2CPP_PRIVATE_LIBS ${JINJA2CPP_PRIVATE_LIBS} Boost::headers ++ Boost::filesystem fmt RapidJson) + else () + set (JINJA2CPP_PRIVATE_LIBS ${JINJA2_PRIVATE_LIBS_INT}) + endif () +diff --git a/thirdparty/thirdparty-conan-build.cmake b/thirdparty/thirdparty-conan-build.cmake +index ec1e2c4..3a70e8a 100644 +--- a/thirdparty/thirdparty-conan-build.cmake ++++ b/thirdparty/thirdparty-conan-build.cmake +@@ -7,9 +7,8 @@ find_package(string-view-lite REQUIRED) + find_package(nlohmann_json REQUIRED) + + find_package(Boost) +-set(CONAN_BOOST_PACKAGE_NAME Boost::Boost) + find_package(fmt) + find_package(RapidJSON) + +-set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt RapidJSON::RapidJSON nlohmann_json::nlohmann_json) ++set(JINJA2_PRIVATE_LIBS_INT Boost::headers Boost::filesystem fmt::fmt rapidjson nlohmann_json::nlohmann_json) + set(JINJA2_PUBLIC_LIBS_INT nonstd::expected-lite nonstd::variant-lite nonstd::optional-lite nonstd::string-view-lite) diff --git a/recipes/jinja2cpp/all/test_package/CMakeLists.txt b/recipes/jinja2cpp/all/test_package/CMakeLists.txt index 5f02285c2de3e..832ed53e2f10d 100644 --- a/recipes/jinja2cpp/all/test_package/CMakeLists.txt +++ b/recipes/jinja2cpp/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(jinja2cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} jinja2cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} PRIVATE jinja2cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/jinja2cpp/all/test_package/conanfile.py b/recipes/jinja2cpp/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/jinja2cpp/all/test_package/conanfile.py +++ b/recipes/jinja2cpp/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/joltphysics/all/conandata.yml b/recipes/joltphysics/all/conandata.yml index 7c5580239b9ad..3b85494834125 100644 --- a/recipes/joltphysics/all/conandata.yml +++ b/recipes/joltphysics/all/conandata.yml @@ -1,9 +1,16 @@ sources: + "3.0.1": + url: "https://github.com/jrouwe/JoltPhysics/archive/refs/tags/v3.0.1.tar.gz" + sha256: "7ebb40bf2dddbcf0515984582aaa197ddd06e97581fd55b98cb64f91b243b8a6" "2.0.1": url: "https://github.com/jrouwe/JoltPhysics/archive/refs/tags/v2.0.1.tar.gz" sha256: "96ae2e8691c4802e56bf2587da30f2cc86b8abe82a78bc2398065bd87dd718af" patches: + "3.0.1": + - patch_file: "patches/3.0.1-0001-fix-cmake.patch" + patch_description: "Fix CMakeLists: no warnings as errors, allow shared, add install target, and add profile & debug_renderer options" + patch_type: "conan" "2.0.1": - - patch_file: "patches/0001-fix-cmake.patch" + - patch_file: "patches/2.0.1-0001-fix-cmake.patch" patch_description: "Fix CMakeLists: no warnings as errors, allow shared, add install target, and add profile & debug_renderer options" patch_type: "conan" diff --git a/recipes/joltphysics/all/conanfile.py b/recipes/joltphysics/all/conanfile.py index dc05fc97bdff2..ef2cbdfc71184 100644 --- a/recipes/joltphysics/all/conanfile.py +++ b/recipes/joltphysics/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get 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" @@ -87,6 +88,9 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) @@ -127,6 +131,8 @@ def generate(self): tc.variables["USE_STATIC_MSVC_RUNTIME_LIBRARY"] = is_msvc_static_runtime(self) tc.variables["JPH_DEBUG_RENDERER"] = self.options.debug_renderer tc.variables["JPH_PROFILE_ENABLED"] = self.options.profile + if Version(self.version) >= "3.0.0": + tc.variables["ENABLE_ALL_WARNINGS"] = False tc.generate() def build(self): diff --git a/recipes/joltphysics/all/patches/0001-fix-cmake.patch b/recipes/joltphysics/all/patches/2.0.1-0001-fix-cmake.patch similarity index 100% rename from recipes/joltphysics/all/patches/0001-fix-cmake.patch rename to recipes/joltphysics/all/patches/2.0.1-0001-fix-cmake.patch diff --git a/recipes/joltphysics/all/patches/3.0.1-0001-fix-cmake.patch b/recipes/joltphysics/all/patches/3.0.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..b42aafe47bc62 --- /dev/null +++ b/recipes/joltphysics/all/patches/3.0.1-0001-fix-cmake.patch @@ -0,0 +1,125 @@ +diff --git a/Build/CMakeLists.txt b/Build/CMakeLists.txt +index e4fddc5..b106489 100644 +--- a/Build/CMakeLists.txt ++++ b/Build/CMakeLists.txt +@@ -19,8 +19,8 @@ option(CROSS_COMPILE_ARM "Cross compile to aarch64-linux-gnu" OFF) + # If you don't do this you may get an error: /usr/bin/ld: libJolt.a: error adding symbols: file format not recognized + option(INTERPROCEDURAL_OPTIMIZATION "Enable interprocedural optimizations" ON) + +-# When turning this on, in Debug and Release mode, the library will emit extra code to ensure that the 4th component of a 3-vector is kept the same as the 3rd component +-# and will enable floating point exceptions during simulation to detect divisions by zero. ++# When turning this on, in Debug and Release mode, the library will emit extra code to ensure that the 4th component of a 3-vector is kept the same as the 3rd component ++# and will enable floating point exceptions during simulation to detect divisions by zero. + # Note that this currently only works using MSVC. Clang turns Float2 into a SIMD vector sometimes causing floating point exceptions (the option is ignored). + option(FLOATING_POINT_EXCEPTIONS_ENABLED "Enable floating point exceptions" ON) + +@@ -47,17 +47,10 @@ include(CMakeDependentOption) + # Windows Store only supports the DLL version + cmake_dependent_option(USE_STATIC_MSVC_RUNTIME_LIBRARY "Use the static MSVC runtime library" ON "MSVC;NOT WINDOWS_STORE" OFF) + +-# Determine which configurations exist +-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CONFIGURATION_TYPES "Debug;Release;Distribution") +-elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") +- set(CMAKE_CONFIGURATION_TYPES "Debug;Release;ReleaseASAN;ReleaseUBSAN;ReleaseCoverage;Distribution") +-endif() +- + if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") AND NOT MINGW) + # Fill in the path to the asan libraries + set(CLANG_LIB_PATH "\"$(VSInstallDir)\\VC\\Tools\\Llvm\\x64\\lib\\clang\\${CMAKE_CXX_COMPILER_VERSION}\\lib\\windows\"") +- ++ + # 64 bit architecture + set(CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE "x64") + +@@ -68,7 +61,7 @@ if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUA + + # Set general compiler flags + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /Gm- /MP /nologo /diagnostics:classic /FC /fp:except- /Zc:inline") +- ++ + # Enable warnings + if (ENABLE_ALL_WARNINGS) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /WX") +@@ -189,7 +182,7 @@ set(PHYSICS_REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../) + include(${PHYSICS_REPO_ROOT}/Jolt/Jolt.cmake) + if (IOS) + # Ensure that we enable SSE4.2 for the x86_64 build, CMAKE_SYSTEM_PROCESSOR is not set for iOS +- set_property(TARGET Jolt PROPERTY XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=x86_64] "$(inherited) -msse4.2 -mpopcnt") ++ set_property(TARGET Jolt PROPERTY XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=x86_64] "$(inherited) -msse4.2 -mpopcnt") + endif() + + # Install Jolt library and includes +@@ -202,7 +195,7 @@ foreach(SRC_FILE ${JOLT_PHYSICS_SRC_FILES}) + endif() + endforeach() + +-# Check if we're the root CMakeLists.txt, if not we are included by another CMake file and we should disable everything except for the main library ++# Check if we're the root CMakeLists.txt, if not we are included by another CMake file and we should disable everything except for the main library + if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + # Ability to turn ON/OFF individual applications + option(TARGET_UNIT_TESTS "Build Unit Tests" ON) +@@ -258,7 +251,7 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + target_link_options(PerformanceTest PUBLIC "/SUBSYSTEM:CONSOLE") + endif() + set_property(TARGET PerformanceTest PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${PHYSICS_REPO_ROOT}") +- ++ + # Copy the assets folder + add_custom_command(TARGET PerformanceTest PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${PHYSICS_REPO_ROOT}/Assets/ $/Assets/) + endif() +@@ -276,4 +269,4 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + include(${PHYSICS_REPO_ROOT}/JoltViewer/JoltViewer.cmake) + endif() + endif() +-endif() +\ No newline at end of file ++endif() +diff --git a/Jolt/Jolt.cmake b/Jolt/Jolt.cmake +index 176a757..efed8f0 100644 +--- a/Jolt/Jolt.cmake ++++ b/Jolt/Jolt.cmake +@@ -430,14 +430,28 @@ endif() + source_group(TREE ${JOLT_PHYSICS_ROOT} FILES ${JOLT_PHYSICS_SRC_FILES}) + + # Create Jolt lib +-add_library(Jolt STATIC ${JOLT_PHYSICS_SRC_FILES}) ++add_library(Jolt ${JOLT_PHYSICS_SRC_FILES}) ++target_compile_features(Jolt PUBLIC cxx_std_17) ++include(GNUInstallDirs) ++install( ++ TARGETS Jolt ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) ++install(DIRECTORY ${JOLT_PHYSICS_ROOT} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING REGEX "(.*).(h|inl)$") ++if(JPH_DEBUG_RENDERER) ++ target_compile_definitions(Jolt PUBLIC JPH_DEBUG_RENDERER) ++endif() ++if(JPH_PROFILE_ENABLED) ++ target_compile_definitions(Jolt PUBLIC JPH_PROFILE_ENABLED) ++endif() + target_include_directories(Jolt PUBLIC ${PHYSICS_REPO_ROOT}) +-target_precompile_headers(Jolt PRIVATE ${JOLT_PHYSICS_ROOT}/Jolt.h) +-target_compile_definitions(Jolt PUBLIC "$<$:_DEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>") +-target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>") ++target_compile_definitions(Jolt PUBLIC "$<$:_DEBUG>") ++target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") + target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") +-target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_PROFILE_ENABLED;JPH_DISABLE_TEMP_ALLOCATOR;JPH_DISABLE_CUSTOM_ALLOCATOR;JPH_DEBUG_RENDERER>") +-target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>") ++target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_DISABLE_TEMP_ALLOCATOR;JPH_DISABLE_CUSTOM_ALLOCATOR>") ++target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") + target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") + + # Setting floating point exceptions +@@ -471,7 +485,7 @@ function(EMIT_X86_INSTRUCTION_SET_DEFINITIONS) + endif() + if (USE_AVX) + target_compile_definitions(Jolt PUBLIC JPH_USE_AVX) +- endif() ++ endif() + if (USE_SSE4_1) + target_compile_definitions(Jolt PUBLIC JPH_USE_SSE4_1) + endif() diff --git a/recipes/joltphysics/config.yml b/recipes/joltphysics/config.yml index bb7eb85dfac49..41bbdfae2300d 100644 --- a/recipes/joltphysics/config.yml +++ b/recipes/joltphysics/config.yml @@ -1,3 +1,5 @@ versions: + "3.0.1": + folder: all "2.0.1": folder: all diff --git a/recipes/jpcre2/all/conanfile.py b/recipes/jpcre2/all/conanfile.py index f0f2f817d89da..537216e3b272a 100644 --- a/recipes/jpcre2/all/conanfile.py +++ b/recipes/jpcre2/all/conanfile.py @@ -1,33 +1,44 @@ -from conans import ConanFile, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class Jpcre2Conan(ConanFile): name = "jpcre2" - homepage = "https://github.com/jpcre2/jpcre2" description = "Header-only C++ wrapper for PCRE2 library." - topics = ("regex", "pcre2", "header-only", "single-header") - url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jpcre2/jpcre2" + topics = ("regex", "pcre2", "header-only", "single-header") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("pcre2/10.37") + self.requires("pcre2/10.42") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - self.copy("jpcre2.hpp", dst="include", src=os.path.join(self._source_subfolder, "src")) - - def package_id(self): - self.info.header_only() + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "jpcre2.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "src")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/jpcre2/all/test_package/CMakeLists.txt b/recipes/jpcre2/all/test_package/CMakeLists.txt index c2f7a55ce01f3..dd0af07a2c068 100644 --- a/recipes/jpcre2/all/test_package/CMakeLists.txt +++ b/recipes/jpcre2/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(jpcre2 REQUIRED) +find_package(jpcre2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE jpcre2::jpcre2) diff --git a/recipes/jpcre2/all/test_package/conanfile.py b/recipes/jpcre2/all/test_package/conanfile.py index 3da371b660e0a..fae501d0afb9e 100644 --- a/recipes/jpcre2/all/test_package/conanfile.py +++ b/recipes/jpcre2/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/jpcre2/all/test_package/test_package.cpp b/recipes/jpcre2/all/test_package/test_package.cpp index dbaa3accd96c7..a1ec58eee8bf5 100644 --- a/recipes/jpcre2/all/test_package/test_package.cpp +++ b/recipes/jpcre2/all/test_package/test_package.cpp @@ -2,12 +2,10 @@ typedef jpcre2::select jp; -int main(int, char**) -{ +int main(int, char **) { jp::Regex re; re.setPattern("Hello (\\S+?)").compile(); - if (!re.match("Hello conan-center-index")) - { + if (!re.match("Hello conan-center-index")) { return 1; } diff --git a/recipes/jpcre2/all/test_v1_package/CMakeLists.txt b/recipes/jpcre2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/jpcre2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/jpcre2/all/test_v1_package/conanfile.py b/recipes/jpcre2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/jpcre2/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/json-schema-validator/all/conanfile.py b/recipes/json-schema-validator/all/conanfile.py index 116cea1b74c21..2d269b725c767 100644 --- a/recipes/json-schema-validator/all/conanfile.py +++ b/recipes/json-schema-validator/all/conanfile.py @@ -23,10 +23,19 @@ class JsonSchemaValidatorConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "json_diagnostics": [True, False], + } + options_description = { + "json_diagnostics": ( + "Defines JSON_DIAGNOSTICS=1 for the nlohmann_json library. " + "Refer https://json.nlohmann.me/api/macros/json_diagnostics/ " + "This macro enables extended diagnostics for exception messages." + ) } default_options = { "shared": False, "fPIC": True, + "json_diagnostics": False, } short_paths = True @@ -83,6 +92,8 @@ def generate(self): else: tc.variables["JSON_VALIDATOR_BUILD_TESTS"] = False tc.variables["JSON_VALIDATOR_BUILD_EXAMPLES"] = False + if self.options.json_diagnostics: + tc.preprocessor_definitions["JSON_DIAGNOSTICS"] = '1' if Version(self.version) < "2.1.0": nlohmann_json_includedirs = self.dependencies["nlohmann_json"].cpp_info.aggregated_components().includedirs tc.variables["NLOHMANN_JSON_DIR"] = ";".join([p.replace("\\", "/") for p in nlohmann_json_includedirs]) @@ -131,6 +142,8 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "nlohmann_json_schema_validator") self.cpp_info.set_property("cmake_target_name", "nlohmann_json_schema_validator") self.cpp_info.libs = ["json-schema-validator" if Version(self.version) < "2.1.0" else "nlohmann_json_schema_validator"] + if self.options.json_diagnostics: + self.cpp_info.defines = ["JSON_DIAGNOSTICS=1"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/jsoncons/all/conandata.yml b/recipes/jsoncons/all/conandata.yml index 522f8707b0c51..ee163c0bae477 100644 --- a/recipes/jsoncons/all/conandata.yml +++ b/recipes/jsoncons/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.171.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.171.0.tar.gz" + sha256: "0be840e984e30e70747c01e55669bbd4c49737cffc5852ccc5625dfe3dd38530" + "0.170.2": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.170.2.tar.gz" + sha256: "0ff0cd407f6b27dea66a3202bc8bc2e043ec1614419e76840eda5b5f8045a43a" "0.169.0": url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.169.0.tar.gz" - sha256: 423dc99d6950056fb55782513daf74adf37501eaf01b977b2415873cd0c44243 + sha256: "423dc99d6950056fb55782513daf74adf37501eaf01b977b2415873cd0c44243" diff --git a/recipes/jsoncons/all/conanfile.py b/recipes/jsoncons/all/conanfile.py index 32d3c9bc0d9c9..acb202ad18e68 100644 --- a/recipes/jsoncons/all/conanfile.py +++ b/recipes/jsoncons/all/conanfile.py @@ -12,7 +12,14 @@ class JsonconsConan(ConanFile): license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/danielaparker/jsoncons" - topics = ("json", "csv", "cpp", "json-serialization", "cbor", "json-parser", "messagepack", "json-pointer", "json-patch", "json-diff", "bson", "ubjson", "json-parsing", "jsonpath", "jmespath", "csv-parser", "csv-reader", "jsonschema", "json-construction", "streaming-json-read", "header-only") + topics = ( + "json", "csv", "json-serialization", "cbor", "json-parser", + "messagepack", "json-pointer", "json-patch", "json-diff", "bson", + "ubjson", "json-parsing", "jsonpath", "jmespath", "csv-parser", + "csv-reader", "jsonschema", "json-construction", "streaming-json-read", + "header-only", + ) + pckage_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -23,19 +30,13 @@ 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 package(self): copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) copy(self, pattern="*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): - # Folders not used for header-only self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/jsoncons/all/test_package/CMakeLists.txt b/recipes/jsoncons/all/test_package/CMakeLists.txt index a15fe60ff614b..15f5b1aabdb29 100644 --- a/recipes/jsoncons/all/test_package/CMakeLists.txt +++ b/recipes/jsoncons/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(test_package) +project(test_package LANGUAGES CXX) find_package(jsoncons CONFIG REQUIRED) diff --git a/recipes/jsoncons/config.yml b/recipes/jsoncons/config.yml index 0354650b51267..9830af3e7e5e0 100644 --- a/recipes/jsoncons/config.yml +++ b/recipes/jsoncons/config.yml @@ -1,3 +1,7 @@ versions: + "0.171.0": + folder: "all" + "0.170.2": + folder: "all" "0.169.0": folder: "all" diff --git a/recipes/jsonnet/all/CMakeLists.txt b/recipes/jsonnet/all/CMakeLists.txt deleted file mode 100644 index 881b1cb39250b..0000000000000 --- a/recipes/jsonnet/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory(source_subfolder) diff --git a/recipes/jsonnet/all/conandata.yml b/recipes/jsonnet/all/conandata.yml index af6fab5053143..260d7031fb23c 100644 --- a/recipes/jsonnet/all/conandata.yml +++ b/recipes/jsonnet/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.20.0": + url: "https://github.com/google/jsonnet/archive/v0.20.0.tar.gz" + sha256: "77bd269073807731f6b11ff8d7c03e9065aafb8e4d038935deb388325e52511b" "0.19.1": url: "https://github.com/google/jsonnet/archive/v0.19.1.tar.gz" sha256: "f5a20f2dc98fdebd5d42a45365f52fa59a7e6b174e43970fea4f9718a914e887" @@ -9,18 +12,35 @@ sources: url: "https://github.com/google/jsonnet/archive/v0.17.0.tar.gz" sha256: "076b52edf888c01097010ad4299e3b2e7a72b60a41abbc65af364af1ed3c8dbe" patches: + "0.20.0": + - patch_file: "patches/0.18.0/0001-fix-nlohmann-include.patch" + patch_description: "fix include path to use cci package" + patch_type: "conan" + - patch_file: "patches/0.18.0/0002-cmake-fixes.patch" + patch_description: "fix rapidyaml name, add installation" + patch_type: "conan" + - patch_file: "patches/0.20.0/0003-use-cpp17.patch" + patch_description: "use C++17" + patch_type: "portability" + patch_source: "https://github.com/google/jsonnet/pull/1076" "0.19.1": - patch_file: "patches/0.18.0/0001-fix-nlohmann-include.patch" - base_path: "source_subfolder" + patch_description: "fix include path to use cci package" + patch_type: "conan" - patch_file: "patches/0.18.0/0002-cmake-fixes.patch" - base_path: "source_subfolder" + patch_description: "fix rapidyaml name, add installation" + patch_type: "conan" "0.18.0": - patch_file: "patches/0.18.0/0001-fix-nlohmann-include.patch" - base_path: "source_subfolder" + patch_description: "fix include path to use cci package" + patch_type: "conan" - patch_file: "patches/0.18.0/0002-cmake-fixes.patch" - base_path: "source_subfolder" + patch_description: "fix rapidyaml name, add installation" + patch_type: "conan" "0.17.0": - patch_file: "patches/0.17.0/0001-fix-nlohmann-include.patch" - base_path: "source_subfolder" + patch_description: "fix include path to use cci package" + patch_type: "conan" - patch_file: "patches/0.17.0/0002-cmake-fixes.patch" - base_path: "source_subfolder" + patch_description: "fix rapidyaml name, add installation" + patch_type: "conan" diff --git a/recipes/jsonnet/all/conanfile.py b/recipes/jsonnet/all/conanfile.py index ff9c2346a3e5f..0581568a5b5ce 100644 --- a/recipes/jsonnet/all/conanfile.py +++ b/recipes/jsonnet/all/conanfile.py @@ -1,19 +1,23 @@ -import functools -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc, msvc_runtime_flag +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.build import check_min_cppstd, cross_building, stdcpp_library +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os -required_conan_version = ">=1.33.0" - +required_conan_version = ">=1.53.0" class JsonnetConan(ConanFile): name = "jsonnet" description = "Jsonnet - The data templating language" - topics = ("config", "json", "functional", "configuration") license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/google/jsonnet" + topics = ("config", "json", "functional", "configuration") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -22,15 +26,25 @@ class JsonnetConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake", "cmake_find_package" @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "11" if Version(self.version) < "0.20.0" else "17" @property - def _build_subfolder(self): - return "build_subfolder" + def _compilers_minimum_version(self): + return { + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -38,70 +52,78 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - # This is a workround. - # If jsonnet is shared, rapidyaml must be built as shared, - # or the c4core functions that rapidyaml depends on will not be able to be found. - # This seems to be a issue of rapidyaml. - # https://github.com/conan-io/conan-center-index/pull/9786#discussion_r829887879 - if tools.Version(self.version) >= "0.18.0": - self.options["rapidyaml"].shared = True + self.options.rm_safe("fPIC") - def requirements(self): - self.requires("nlohmann_json/3.10.5") - if tools.Version(self.version) >= "0.18.0": - self.requires("rapidyaml/0.4.1") + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): - if hasattr(self, "settings_build") and tools.cross_building(self, skip_x64_x86=True): - raise ConanInvalidConfiguration("jsonnet does not support cross building") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if Version(self.version) == "0.17.0" and Version(self.settings.compiler.get_safe("cppstd")) > "17": + raise ConanInvalidConfiguration(f"{self.ref} does not support C++{self.settings.compiler.cppstd}") - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "11") + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration(f"{self.ref} does not support cross building") if self.options.shared and is_msvc(self) and "d" in msvc_runtime_flag(self): - raise ConanInvalidConfiguration("shared {} is not supported with MTd/MDd runtime".format(self.name)) + raise ConanInvalidConfiguration(f"shared {self.ref} is not supported with MTd/MDd runtime") - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + # This is a workround. + # If jsonnet is shared, rapidyaml must be built as shared, + # or the c4core functions that rapidyaml depends on will not be able to be found. + # This seems to be a issue of rapidyaml. + # https://github.com/conan-io/conan-center-index/pull/9786#discussion_r829887879 + if self.options.shared and Version(self.version) >= "0.18.0" and self.dependencies["rapidyaml"].options.shared == False: + raise ConanInvalidConfiguration(f"shared {self.ref} requires rapidyaml to be built as shared") - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + def requirements(self): + self.requires("nlohmann_json/3.11.2") + if Version(self.version) >= "0.18.0": + self.requires("rapidyaml/0.5.0") - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_TESTS"] = False - cmake.definitions["BUILD_STATIC_LIBS"] = not self.options.shared - cmake.definitions["BUILD_SHARED_BINARIES"] = False - cmake.definitions["BUILD_JSONNET"] = False - cmake.definitions["BUILD_JSONNETFMT"] = False - cmake.definitions["USE_SYSTEM_JSON"] = True - cmake.configure(build_folder=self._build_subfolder) - return cmake + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["BUILD_SHARED_BINARIES"] = False + tc.variables["BUILD_JSONNET"] = False + tc.variables["BUILD_JSONNETFMT"] = False + tc.variables["USE_SYSTEM_JSON"] = True + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.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 package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - 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() def package_info(self): self.cpp_info.components["libjsonnet"].libs = ["jsonnet"] self.cpp_info.components["libjsonnet"].requires = ["nlohmann_json::nlohmann_json"] - if tools.Version(self.version) >= "0.18.0": + if Version(self.version) >= "0.18.0": self.cpp_info.components["libjsonnet"].requires.append("rapidyaml::rapidyaml") - if tools.stdcpp_library(self): - self.cpp_info.components["libjsonnet"].system_libs.append(tools.stdcpp_library(self)) + if stdcpp_library(self): + self.cpp_info.components["libjsonnet"].system_libs.append(stdcpp_library(self)) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libjsonnet"].system_libs.append("m") diff --git a/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch b/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch index 6d8e892eb89a7..887943f82c372 100644 --- a/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch +++ b/recipes/jsonnet/all/patches/0.17.0/0002-cmake-fixes.patch @@ -1,32 +1,44 @@ -- install headers -- optionally disable shared build -- add md5 objects to c library -- allow MSVC ---- core/CMakeLists.txt -+++ core/CMakeLists.txt -@@ -16,8 +16,8 @@ set(LIBJSONNET_HEADERS - string_utils.h +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 385ea82..34b1c63 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,7 +40,7 @@ if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" OR + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++11 -fPIC ${OPT}") + else() + # TODO: Windows support. +- message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") ++ message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") + endif() + + set(CMAKE_CXX_STANDARD 11) +diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt +index e8ad830..7d87527 100644 +--- a/core/CMakeLists.txt ++++ b/core/CMakeLists.txt +@@ -17,7 +17,8 @@ set(LIBJSONNET_HEADERS unicode.h vm.h) -- + -set(LIBJSONNET_SOURCE +install(FILES ../include/libjsonnet.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +set(LIBJSONNET_SOURCE $ desugarer.cpp formatter.cpp lexer.cpp -@@ -27,7 +27,7 @@ set(LIBJSONNET_SOURCE - static_analysis.cpp +@@ -28,6 +29,7 @@ set(LIBJSONNET_SOURCE string_utils.cpp vm.cpp) -- + +if (NOT BUILD_STATIC_LIBS) add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE}) add_dependencies(libjsonnet md5 stdlib) target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json) -@@ -50,7 +50,7 @@ install(TARGETS libjsonnet +@@ -47,10 +49,10 @@ set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet + install(TARGETS libjsonnet + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") -+ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") target_include_directories(libjsonnet INTERFACE $) - @@ -34,9 +46,11 @@ if (BUILD_STATIC_LIBS) # Static library for jsonnet command-line tool. add_library(libjsonnet_static STATIC ${LIBJSONNET_SOURCE}) ---- cpp/CMakeLists.txt -+++ cpp/CMakeLists.txt -@@ -3,11 +3,11 @@ +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index 5549902..3091a9c 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -3,14 +3,14 @@ set(LIBJSONNETPP_HEADERS ../include/libjsonnet++.h ) @@ -51,7 +65,13 @@ add_dependencies(libjsonnet++ jsonnet) -# target_link_libraries(libjsonnet libjsonnet) +target_link_libraries(libjsonnet++ libjsonnet) -@@ -24,7 +24,7 @@ + + # CMake prepends CMAKE_SHARED_LIBRARY_PREFIX to shared libraries, so without + # this step the output would be |liblibjsonnet|. +@@ -21,10 +21,10 @@ set_target_properties(libjsonnet++ PROPERTIES OUTPUT_NAME jsonnet++ + install(TARGETS libjsonnet++ + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") target_include_directories(libjsonnet++ INTERFACE @@ -61,20 +81,11 @@ if (BUILD_STATIC_LIBS) # Static library for jsonnet command-line tool. add_library(libjsonnet++_static STATIC ${LIBJSONNETPP_SOURCE}) ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -40,7 +40,7 @@ - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++11 -fPIC ${OPT}") - else() - # TODO: Windows support. -- message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") -+ message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") - endif() - - set(CMAKE_CXX_STANDARD 11) ---- stdlib/CMakeLists.txt -+++ stdlib/CMakeLists.txt -@@ -5,7 +5,7 @@ +diff --git a/stdlib/CMakeLists.txt b/stdlib/CMakeLists.txt +index a481d9f..00ff502 100644 +--- a/stdlib/CMakeLists.txt ++++ b/stdlib/CMakeLists.txt +@@ -5,7 +5,7 @@ add_executable(to_c_array to_c_array.cpp) # Custom command that will only build stdlib when it changes. add_custom_command( OUTPUT ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h @@ -83,5 +94,3 @@ ${PROJECT_SOURCE_DIR}/stdlib/std.jsonnet ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h DEPENDS to_c_array std.jsonnet) - - diff --git a/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch b/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch index 505ce96c21e93..58b0135ca2153 100644 --- a/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch +++ b/recipes/jsonnet/all/patches/0.18.0/0002-cmake-fixes.patch @@ -20,7 +20,7 @@ index 5df20ca..c14c93c 100644 add_subdirectory(cpp) add_subdirectory(cmd) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt -index e62a858..c0389f8 100644 +index e62a858..f0fb69f 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -17,7 +17,8 @@ set(LIBJSONNET_HEADERS @@ -33,15 +33,21 @@ index e62a858..c0389f8 100644 desugarer.cpp formatter.cpp lexer.cpp -@@ -28,6 +29,7 @@ set(LIBJSONNET_SOURCE +@@ -28,9 +29,12 @@ set(LIBJSONNET_SOURCE string_utils.cpp vm.cpp) ++find_package(ryml REQUIRED CONFIG) ++ +if (NOT BUILD_STATIC_LIBS) add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE}) add_dependencies(libjsonnet md5 stdlib) - target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json ryml) -@@ -47,10 +49,10 @@ set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet +-target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json ryml) ++target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json ryml::ryml) + + file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/../include/libjsonnet.h JSONNET_VERSION_DEF + REGEX "[#]define[ \t]+LIB_JSONNET_VERSION[ \t]+") +@@ -47,15 +51,15 @@ set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet install(TARGETS libjsonnet LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" @@ -54,6 +60,12 @@ index e62a858..c0389f8 100644 if (BUILD_STATIC_LIBS) # Static library for jsonnet command-line tool. add_library(libjsonnet_static STATIC ${LIBJSONNET_SOURCE}) + add_dependencies(libjsonnet_static md5 stdlib) +- target_link_libraries(libjsonnet_static md5 nlohmann_json::nlohmann_json ryml) ++ target_link_libraries(libjsonnet_static md5 nlohmann_json::nlohmann_json ryml::ryml) + set_target_properties(libjsonnet_static PROPERTIES OUTPUT_NAME jsonnet) + install(TARGETS libjsonnet_static DESTINATION "${CMAKE_INSTALL_LIBDIR}") + target_include_directories(libjsonnet_static INTERFACE diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index eb7686c..cbf21bb 100644 --- a/cpp/CMakeLists.txt diff --git a/recipes/jsonnet/all/patches/0.20.0/0003-use-cpp17.patch b/recipes/jsonnet/all/patches/0.20.0/0003-use-cpp17.patch new file mode 100644 index 0000000000000..6735bb58adc58 --- /dev/null +++ b/recipes/jsonnet/all/patches/0.20.0/0003-use-cpp17.patch @@ -0,0 +1,14 @@ +iff --git a/CMakeLists.txt b/CMakeLists.txt +index c14c93c..b1cb1b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,7 +43,8 @@ else() + message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID} not supported") + endif() + +-set(CMAKE_CXX_STANDARD 11) ++# FIXME: This is a temporary workaround, necessary in MSVC only for version 0.20 and Conan 1.X ++set(CMAKE_CXX_STANDARD 17) + + + # Include external googletest project. This runs a CMake sub-script diff --git a/recipes/jsonnet/all/test_package/CMakeLists.txt b/recipes/jsonnet/all/test_package/CMakeLists.txt index b1f60f164ad79..ad42d5d0faada 100644 --- a/recipes/jsonnet/all/test_package/CMakeLists.txt +++ b/recipes/jsonnet/all/test_package/CMakeLists.txt @@ -1,14 +1,15 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C CXX) find_package(jsonnet CONFIG REQUIRED) add_executable(${PROJECT_NAME}_c test_package.c) -target_link_libraries(${PROJECT_NAME}_c jsonnet::libjsonnet) +target_link_libraries(${PROJECT_NAME}_c PRIVATE jsonnet::libjsonnet) add_executable(${PROJECT_NAME}_cxx test_package.cpp) -target_link_libraries(${PROJECT_NAME}_cxx jsonnet::libjsonnetpp) -set_property(TARGET ${PROJECT_NAME}_cxx PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME}_cxx PRIVATE jsonnet::libjsonnetpp) +if(jsonnet_VERSION VERSION_LESS "0.20.0") + target_compile_features(${PROJECT_NAME}_cxx PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME}_cxx PRIVATE cxx_std_17) +endif() diff --git a/recipes/jsonnet/all/test_package/conanfile.py b/recipes/jsonnet/all/test_package/conanfile.py index 1460ef0546803..7f7fcbab40166 100644 --- a/recipes/jsonnet/all/test_package/conanfile.py +++ b/recipes/jsonnet/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", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +20,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package_c"), run_environment=True) - self.run(os.path.join("bin", "test_package_cxx"), run_environment=True) + if can_run(self): + self.run(os.path.join(self.cpp.build.bindir, "test_package_c"), env="conanrun") + self.run(os.path.join(self.cpp.build.bindir, "test_package_cxx"), env="conanrun") diff --git a/recipes/jsonnet/all/test_v1_package/CMakeLists.txt b/recipes/jsonnet/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/jsonnet/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/jsonnet/all/test_v1_package/conanfile.py b/recipes/jsonnet/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..25fbcb7a6d066 --- /dev/null +++ b/recipes/jsonnet/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): + self.run(os.path.join("bin", "test_package_c"), run_environment=True) + self.run(os.path.join("bin", "test_package_cxx"), run_environment=True) diff --git a/recipes/jsonnet/config.yml b/recipes/jsonnet/config.yml index d98d76db4349a..be300c9c5c2b0 100644 --- a/recipes/jsonnet/config.yml +++ b/recipes/jsonnet/config.yml @@ -1,4 +1,6 @@ versions: + "0.20.0": + folder: all "0.19.1": folder: all "0.18.0": diff --git a/recipes/jwt-cpp/all/conanfile.py b/recipes/jwt-cpp/all/conanfile.py index 75e913785ea24..bbf3918d2b235 100644 --- a/recipes/jwt-cpp/all/conanfile.py +++ b/recipes/jwt-cpp/all/conanfile.py @@ -24,7 +24,7 @@ def export_sources(self): export_conandata_patches(self) def requirements(self): - self.requires("openssl/1.1.1s") + self.requires("openssl/[>1.1.1c,<1.1.1u]") if not self._supports_generic_json: self.requires("picojson/1.3.0") diff --git a/recipes/jxrlib/all/conanfile.py b/recipes/jxrlib/all/conanfile.py index d4c71b54de455..14c91a4a33519 100644 --- a/recipes/jxrlib/all/conanfile.py +++ b/recipes/jxrlib/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class JxrlibConan(ConanFile): @@ -15,6 +15,7 @@ class JxrlibConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" license = "BSD-2-Clause" topics = ("jxr", "jpeg", "xr") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -36,18 +37,9 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/kainjow-mustache/all/conanfile.py b/recipes/kainjow-mustache/all/conanfile.py index 5a235a430af98..0d2d3ee8e05e2 100644 --- a/recipes/kainjow-mustache/all/conanfile.py +++ b/recipes/kainjow-mustache/all/conanfile.py @@ -1,35 +1,48 @@ -from conans import ConanFile, tools import os -import glob + +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class KainjowMustacheConan(ConanFile): name = "kainjow-mustache" description = "Mustache text templates for modern C++" - topics = ("conan", "mustache", "template") + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/kainjow/Mustache" - license = "BSL-1.0" + topics = ("mustache", "template", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename( - "Mustache-{}".format(self.version), - self._source_subfolder - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("mustache.hpp", dst=os.path.join("include", "kainjow"), src=self._source_subfolder) - - def package_id(self): - self.info.header_only() + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "mustache.hpp", + dst=os.path.join(self.package_folder, "include", "kainjow"), + src=self.source_folder) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "kainjow_mustache") + self.cpp_info.set_property("cmake_target_name", "kainjow_mustache::kainjow_mustache") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "kainjow_mustache" self.cpp_info.names["cmake_find_package_multi"] = "kainjow_mustache" diff --git a/recipes/kainjow-mustache/all/test_package/CMakeLists.txt b/recipes/kainjow-mustache/all/test_package/CMakeLists.txt index 10c7c5ddbef7f..931342e8916cd 100644 --- a/recipes/kainjow-mustache/all/test_package/CMakeLists.txt +++ b/recipes/kainjow-mustache/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.9) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(kainjow_mustache REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE kainjow_mustache::kainjow_mustache) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/kainjow-mustache/all/test_package/conanfile.py b/recipes/kainjow-mustache/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/kainjow-mustache/all/test_package/conanfile.py +++ b/recipes/kainjow-mustache/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/kainjow-mustache/all/test_package/test_package.cpp b/recipes/kainjow-mustache/all/test_package/test_package.cpp index e2d83b0f477ec..d45d847b4bf07 100644 --- a/recipes/kainjow-mustache/all/test_package/test_package.cpp +++ b/recipes/kainjow-mustache/all/test_package/test_package.cpp @@ -1,18 +1,15 @@ -#include #include "kainjow/mustache.hpp" - +#include int main() { - using namespace kainjow::mustache; + using namespace kainjow::mustache; - mustache tmpl{"{{#employees}}{{name}}{{#comma}}, {{/comma}}{{/employees}}"}; - data employees{data::type::list}; - employees - << object{{"name", "Steve"}, {"comma", true}} - << object{{"name", "Bill"}}; + mustache tmpl{"{{#employees}}{{name}}{{#comma}}, {{/comma}}{{/employees}}"}; + data employees{data::type::list}; + employees << object{{"name", "Steve"}, {"comma", true}} << object{{"name", "Bill"}}; - if( tmpl.render({"employees", employees}) == "Steve, Bill" ) { - return 0; - } - return 1; + if (tmpl.render({"employees", employees}) == "Steve, Bill") { + return 0; + } + return 1; } diff --git a/recipes/keychain/all/CMakeLists.txt b/recipes/keychain/all/CMakeLists.txt deleted file mode 100644 index 1848ca5a77c35..0000000000000 --- a/recipes/keychain/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/keychain/all/conandata.yml b/recipes/keychain/all/conandata.yml index b28baa662e7b6..af35ed376e432 100644 --- a/recipes/keychain/all/conandata.yml +++ b/recipes/keychain/all/conandata.yml @@ -2,3 +2,6 @@ sources: "1.2.0": url: "https://github.com/hrantzsch/keychain/archive/v1.2.0.tar.gz" sha256: "82cc66a7fa12af43f3e2efeb378bacb0a514056617e369430f252da2392acaae" + "1.2.1": + url: "https://github.com/hrantzsch/keychain/archive/v1.2.1.tar.gz" + sha256: "725cc30da0451403713dee648edd06686fdc31b5041e75e3350e6056c78de076" diff --git a/recipes/keychain/all/conanfile.py b/recipes/keychain/all/conanfile.py index d6ff7829ddf3c..216336cf7d368 100644 --- a/recipes/keychain/all/conanfile.py +++ b/recipes/keychain/all/conanfile.py @@ -1,60 +1,75 @@ -from conans import ConanFile, CMake, tools +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 collect_libs, copy, get, replace_in_file +from conan.tools.gnu import PkgConfigDeps + import os + class KeychainConan(ConanFile): name = "keychain" homepage = "https://github.com/hrantzsch/keychain" description = "A cross-platform wrapper for the operating system's credential storage" - topics = ("conan", "keychain", "security", "credentials", "password", "cpp11") + topics = ("keychain", "security", "credentials", "password", "cpp11") url = "https://github.com/conan-io/conan-center-index" license = "MIT" + package_type = "library" settings = "os", "arch", "compiler", "build_type" - exports_sources = ["CMakeLists.txt"] - generators = "cmake", "pkg_config" - options = {'fPIC': [False, True]} - default_options = {'fPIC': True} - - @property - def _source_subfolder(self): - return "source_subfolder" - - def configure(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + options = {'shared': [False, True], 'fPIC': [False, True]} + default_options = {"shared": False, "fPIC": True} def config_options(self): if self.settings.os == 'Windows': del self.options.fPIC + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, 11) + def requirements(self): if self.settings.os == "Linux": self.requires("libsecret/0.20.4") + self.requires("glib/2.76.0") def build_requirements(self): if self.settings.os == "Linux": - self.build_requires("pkgconf/1.7.3") + self.tool_requires("pkgconf/1.7.3") + + def layout(self): + cmake_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(self.name + "-" + self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + # Ensure .dll is installed on Windows + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "TARGETS ${PROJECT_NAME}", "TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin") - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_TESTS"] = False - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + # Export all symbols by default to allow generating a shared library with msvc + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + pc = PkgConfigDeps(self) + pc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="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() def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.settings.os == 'Macos': self.cpp_info.frameworks = ['Security', 'CoreFoundation'] diff --git a/recipes/keychain/all/test_package/CMakeLists.txt b/recipes/keychain/all/test_package/CMakeLists.txt index 8a9dd0b5b3015..84121712cf11b 100644 --- a/recipes/keychain/all/test_package/CMakeLists.txt +++ b/recipes/keychain/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(keychain CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON) +target_link_libraries(${PROJECT_NAME} keychain::keychain) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/keychain/all/test_package/conanfile.py b/recipes/keychain/all/test_package/conanfile.py index bd7165a553cf4..e0f3e3cf43edb 100644 --- a/recipes/keychain/all/test_package/conanfile.py +++ b/recipes/keychain/all/test_package/conanfile.py @@ -1,17 +1,27 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) cmake.configure() cmake.build() + def layout(self): + cmake_layout(self) + def test(self): - if 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/keychain/all/test_package/test_package.cpp b/recipes/keychain/all/test_package/test_package.cpp index b28378d16ed4a..fef9682a48345 100644 --- a/recipes/keychain/all/test_package/test_package.cpp +++ b/recipes/keychain/all/test_package/test_package.cpp @@ -1,4 +1,5 @@ #include +#include using namespace keychain; @@ -13,5 +14,7 @@ void never_called(Error &error) { int main() { Error error; + + std::cout << "Keychain Conan test_package\n"; return error.type == ErrorType::NoError ? 0 : 1; } diff --git a/recipes/keychain/config.yml b/recipes/keychain/config.yml index 7ed1f1b6fc695..307602a029f0f 100644 --- a/recipes/keychain/config.yml +++ b/recipes/keychain/config.yml @@ -1,3 +1,5 @@ versions: "1.2.0": folder: all + "1.2.1": + folder: all diff --git a/recipes/lefticus-tools/all/conandata.yml b/recipes/lefticus-tools/all/conandata.yml new file mode 100644 index 0000000000000..5f60c304dca5d --- /dev/null +++ b/recipes/lefticus-tools/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230420": + url: "https://github.com/lefticus/tools/archive/137dd15b8aa9d43cc8633b972eec82c9009b6bbd.tar.gz" + sha256: "f1ef4929ea608fb466e11af635d2537808a7df7b1bc664d9742d147ed08e24c2" diff --git a/recipes/lefticus-tools/all/conanfile.py b/recipes/lefticus-tools/all/conanfile.py new file mode 100644 index 0000000000000..b9179faa1d97b --- /dev/null +++ b/recipes/lefticus-tools/all/conanfile.py @@ -0,0 +1,64 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.errors import ConanInvalidConfiguration +from conan import Version +import os + + +required_conan_version = ">=1.53.0" + + +class LefticusToolsConan(ConanFile): + name = "lefticus-tools" + description = "Some handy C++ tools" + topics = ("tools", "cpp", "cmake") + license = "MIT" + homepage = "https://github.com/lefticus/tools" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return "20" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "13", + "apple-clang": "14", + } + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="ProjectOptions", dst=os.path.join(self.package_folder, "lib", "cmake"), src=self.source_folder) + copy(self, pattern="*.cmake", dst=os.path.join(self.package_folder, "lib", "cmake", "cmake"), src=os.path.join(self.source_folder, "cmake")) + copy(self, pattern="*.hpp", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_target_name", "lefticus::tools") + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] diff --git a/recipes/lefticus-tools/all/test_package/CMakeLists.txt b/recipes/lefticus-tools/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d6a06ccd62240 --- /dev/null +++ b/recipes/lefticus-tools/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(lefticus-tools REQUIRED CONFIG) + +add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE lefticus::tools) +target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/lefticus-tools/all/test_package/conanfile.py b/recipes/lefticus-tools/all/test_package/conanfile.py new file mode 100644 index 0000000000000..254feca104287 --- /dev/null +++ b/recipes/lefticus-tools/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, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/lefticus-tools/all/test_package/test_package.cpp b/recipes/lefticus-tools/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..01077cece833f --- /dev/null +++ b/recipes/lefticus-tools/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include + +#include "lefticus/tools/consteval_invoke.hpp" + + +constexpr unsigned int Factorial(unsigned int number) { + return number <= 1 ? number : Factorial(number - 1) * number; +} + + +int main() { + std::cout << "Factorial of 3 is: " << lefticus::tools::consteval_invoke(Factorial, 3) << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/lefticus-tools/config.yml b/recipes/lefticus-tools/config.yml new file mode 100644 index 0000000000000..7c6ba2bb8da04 --- /dev/null +++ b/recipes/lefticus-tools/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230420": + folder: all diff --git a/recipes/leptonica/all/conanfile.py b/recipes/leptonica/all/conanfile.py index 109404f2d8984..405081e59b384 100644 --- a/recipes/leptonica/all/conanfile.py +++ b/recipes/leptonica/all/conanfile.py @@ -76,13 +76,13 @@ def requirements(self): elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.1") if self.options.with_png: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_tiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.5.1") if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") if self.options.with_webp: - self.requires("libwebp/1.3.0") + self.requires("libwebp/1.3.1") def build_requirements(self): if self.options.with_webp or self.options.with_openjpeg: diff --git a/recipes/lest/all/conanfile.py b/recipes/lest/all/conanfile.py index 64f52a3c5b929..8360bb0147108 100644 --- a/recipes/lest/all/conanfile.py +++ b/recipes/lest/all/conanfile.py @@ -1,27 +1,47 @@ import os -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + class LestConan(ConanFile): name = "lest" - description = "A modern, C++11-native, single-file header-only, tiny framework for unit-tests, TDD and BDD." + description = ( + "A modern, C++11-native, single-file header-only, " + "tiny framework for unit-tests, TDD and BDD." + ) license = "BSL-1.0" - topics = ("conan", "testing", "testing-framework", "unit-testing", "header-only") - homepage = "https://github.com/martinmoene/lest" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/lest" + topics = ("testing", "testing-framework", "unit-testing", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(self.name + "-" + self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy( + self, + "LICENSE.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/lest/all/test_package/CMakeLists.txt b/recipes/lest/all/test_package/CMakeLists.txt index 33ae887aa6aea..5d9ebbc9ca6a1 100644 --- a/recipes/lest/all/test_package/CMakeLists.txt +++ b/recipes/lest/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(lest REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE lest::lest) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/lest/all/test_package/conanfile.py b/recipes/lest/all/test_package/conanfile.py index ea57a464900be..ef5d7042163ec 100644 --- a/recipes/lest/all/test_package/conanfile.py +++ b/recipes/lest/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libbigwig/all/conanfile.py b/recipes/libbigwig/all/conanfile.py index 0f28a5364da62..cf0ba30f73906 100644 --- a/recipes/libbigwig/all/conanfile.py +++ b/recipes/libbigwig/all/conanfile.py @@ -45,9 +45,9 @@ def requirements(self): if self.options.with_curl: # transitive_headers=True is required due to includes in bigWigIO.h # https://github.com/dpryan79/libBigWig/blob/master/bigWigIO.h#L5 - self.requires("libcurl/8.0.1", transitive_headers=True) + self.requires("libcurl/8.1.2", transitive_headers=True) if self.options.with_zlibng: - self.requires("zlib-ng/2.0.7") + self.requires("zlib-ng/2.1.3") else: self.requires("zlib/1.2.13") diff --git a/recipes/libcoro/all/conandata.yml b/recipes/libcoro/all/conandata.yml index b59d551a8df2f..61258b10a8ddf 100644 --- a/recipes/libcoro/all/conandata.yml +++ b/recipes/libcoro/all/conandata.yml @@ -1,15 +1,25 @@ sources: + "0.8": + url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.8.tar.gz" + sha256: "09d8de39c9233d79c0dd1379c6826c636f63667f21001b66eb9b2080f6b270ad" "0.7": url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.7.tar.gz" sha256: "ce1f3f1c4fa21b53d1cd195a29bd5a2313e53aa35637b402db04207d02316e51" patches: + "0.8": + - patch_file: "patches/0.8-0001-allow-shared-lib.patch" + patch_type: "conan" + patch_description: "Allow to build the library as a shared library" + - patch_file: "patches/0.8-0002-disable-git-config.patch" + patch_type: "conan" + patch_description: "Comment out invocation of git config command" "0.7": - - patch_file: "patches/allow-shared-lib.patch" + - patch_file: "patches/0.7-0001-allow-shared-lib.patch" patch_type: "conan" patch_description: "Allow to build the library as a shared library" - - patch_file: "patches/disable-git-config.patch" + - patch_file: "patches/0.7-0002-disable-git-config.patch" patch_type: "conan" patch_description: "Comment out invocation of git config command" - - patch_file: "patches/fix-dependencies.patch" + - patch_file: "patches/0.7-0003-fix-dependencies.patch" patch_type: "conan" patch_description: "Replace add_subdirectory dependencies with find_package" diff --git a/recipes/libcoro/all/conanfile.py b/recipes/libcoro/all/conanfile.py index 2d097def986f0..ea05c701592dc 100644 --- a/recipes/libcoro/all/conanfile.py +++ b/recipes/libcoro/all/conanfile.py @@ -12,19 +12,21 @@ class LibcoroConan(ConanFile): name = "libcoro" description = "C++20 coroutine library" - homepage = "https://github.com/jbaldwin/libcoro" topics = ("coroutines", "concurrency", "tasks", "executors", "networking") license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jbaldwin/libcoro" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], + "with_networking": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_networking": True, } @property @@ -43,6 +45,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "0.8": + del self.options.with_networking def configure(self): if self.options.shared: @@ -52,8 +56,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("openssl/3.1.0", transitive_headers=True) - self.requires("c-ares/1.19.0", transitive_headers=True) + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) + self.requires("c-ares/1.19.1", transitive_headers=True) self.requires("tl-expected/1.1.0", transitive_headers=True) def validate(self): @@ -77,6 +81,9 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["LIBCORO_BUILD_TESTS"] = False tc.variables["LIBCORO_BUILD_EXAMPLES"] = False + if Version(self.version) >= "0.8": + tc.variables["LIBCORO_EXTERNAL_DEPENDENCIES"] = True + tc.variables["LIBCORO_FEATURE_NETWORKING"] = self.options.with_networking tc.generate() deps = CMakeDeps(self) deps.generate() @@ -96,6 +103,9 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "libcoro") self.cpp_info.set_property("cmake_target_name", "libcoro::libcoro") - self.cpp_info.libs = ["libcoro"] + if Version(self.version) >= "0.8": + self.cpp_info.libs = ["coro"] + else: + self.cpp_info.libs = ["libcoro"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/libcoro/all/patches/allow-shared-lib.patch b/recipes/libcoro/all/patches/0.7-0001-allow-shared-lib.patch similarity index 100% rename from recipes/libcoro/all/patches/allow-shared-lib.patch rename to recipes/libcoro/all/patches/0.7-0001-allow-shared-lib.patch diff --git a/recipes/libcoro/all/patches/disable-git-config.patch b/recipes/libcoro/all/patches/0.7-0002-disable-git-config.patch similarity index 100% rename from recipes/libcoro/all/patches/disable-git-config.patch rename to recipes/libcoro/all/patches/0.7-0002-disable-git-config.patch diff --git a/recipes/libcoro/all/patches/fix-dependencies.patch b/recipes/libcoro/all/patches/0.7-0003-fix-dependencies.patch similarity index 100% rename from recipes/libcoro/all/patches/fix-dependencies.patch rename to recipes/libcoro/all/patches/0.7-0003-fix-dependencies.patch diff --git a/recipes/libcoro/all/patches/0.8-0001-allow-shared-lib.patch b/recipes/libcoro/all/patches/0.8-0001-allow-shared-lib.patch new file mode 100644 index 0000000000000..0481b258f7f9a --- /dev/null +++ b/recipes/libcoro/all/patches/0.8-0001-allow-shared-lib.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f37206b..8221a5d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -91,7 +91,7 @@ if(LIBCORO_FEATURE_NETWORKING) + ) + endif() + +-add_library(${PROJECT_NAME} STATIC ${LIBCORO_SOURCE_FILES}) ++add_library(${PROJECT_NAME} ${LIBCORO_SOURCE_FILES}) + set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX PREFIX "") + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) + target_include_directories(${PROJECT_NAME} PUBLIC inc) diff --git a/recipes/libcoro/all/patches/0.8-0002-disable-git-config.patch b/recipes/libcoro/all/patches/0.8-0002-disable-git-config.patch new file mode 100644 index 0000000000000..9996b0fa3402a --- /dev/null +++ b/recipes/libcoro/all/patches/0.8-0002-disable-git-config.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8de8174..4790572 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -11,13 +11,6 @@ if (NOT "$ENV{version}" STREQUAL "") + set(PROJECT_VERSION "$ENV{version}" CACHE INTERNAL "Copied from environment variable") + endif() + +-# Set the githooks directory to auto format and update the readme. +-message("${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR} -> git config --local core.hooksPath .githooks") +-execute_process( +- COMMAND git config --local core.hooksPath .githooks +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +-) +- + option(LIBCORO_EXTERNAL_DEPENDENCIES "Use Cmake find_package to resolve dependencies instead of embedded libraries, Default=OFF." OFF) + option(LIBCORO_BUILD_TESTS "Build the tests, Default=ON." ON) + option(LIBCORO_CODE_COVERAGE "Enable code coverage, tests must also be enabled, Default=OFF" OFF) diff --git a/recipes/libcoro/config.yml b/recipes/libcoro/config.yml index 0536885a53045..a836136a32631 100644 --- a/recipes/libcoro/config.yml +++ b/recipes/libcoro/config.yml @@ -1,3 +1,5 @@ versions: + "0.8": + folder: all "0.7": folder: all diff --git a/recipes/libcurl/all/conanfile.py b/recipes/libcurl/all/conanfile.py index 0e354bcda9e97..6fc552c1f2f77 100644 --- a/recipes/libcurl/all/conanfile.py +++ b/recipes/libcurl/all/conanfile.py @@ -183,11 +183,11 @@ def requirements(self): if self.options.with_ssl == "openssl": self.requires("openssl/[>=1.1 <4]") elif self.options.with_ssl == "wolfssl": - self.requires("wolfssl/5.5.1") + self.requires("wolfssl/5.6.3") if self.options.with_nghttp2: self.requires("libnghttp2/1.54.0") if self.options.with_libssh2: - self.requires("libssh2/1.10.0") + self.requires("libssh2/1.11.0") if self.options.with_zlib: self.requires("zlib/1.2.13") if self.options.with_brotli: diff --git a/recipes/libdivide/all/conanfile.py b/recipes/libdivide/all/conanfile.py index 47e6ad87f66f6..2252c68d61a0f 100644 --- a/recipes/libdivide/all/conanfile.py +++ b/recipes/libdivide/all/conanfile.py @@ -1,16 +1,24 @@ -from conans import ConanFile, tools +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.33.0" class LibdivideConan(ConanFile): name = "libdivide" description = "Header-only C/C++ library for optimizing integer division." - topics = ("libdivide", "division", "integer", ) license = ["Zlib", "BSL-1.0"] - homepage = "http://libdivide.com/" url = "https://github.com/conan-io/conan-center-index" - settings = "arch", "compiler" - no_copy_source = True + homepage = "http://libdivide.com/" + topics = ("libdivide", "division", "integer", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" options = { "simd_intrinsics": [False, "sse2", "avx2", "avx512"], "sse2": [True, False], @@ -25,53 +33,52 @@ class LibdivideConan(ConanFile): "avx512": False, "neon": False, } - - @property - def _source_subfolder(self): - return "source_subfolder" + no_copy_source = True def config_options(self): - if tools.Version(self.version) < "4.0.0": - del self.options.sse2 - del self.options.avx2 - del self.options.avx512 - del self.options.neon + if Version(self.version) < "4.0.0": + self.options.rm_safe("sse2") + self.options.rm_safe("avx2") + self.options.rm_safe("avx512") + self.options.rm_safe("neon") if self.settings.arch not in ["x86", "x86_64"]: - del self.options.simd_intrinsics + self.options.rm_safe("simd_intrinsics") else: - del self.options.simd_intrinsics + self.options.rm_safe("simd_intrinsics") if self.settings.arch not in ["x86", "x86_64"]: - del self.options.sse2 - del self.options.avx2 - del self.options.avx512 + self.options.rm_safe("sse2") + self.options.rm_safe("avx2") + self.options.rm_safe("avx512") if not str(self.settings.arch).startswith("arm"): - del self.options.neon + self.options.rm_safe("neon") - def configure(self): - if tools.Version(self.version) < "4.0.0" and self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if Version(self.version) < "4.0.0" and self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) 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("LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy("libdivide.h", dst="include", src=self._source_subfolder) - self.copy("constant_fast_div.h", dst="include", src=self._source_subfolder) - self.copy("s16_ldparams.h", dst="include", src=self._source_subfolder) - self.copy("u16_ldparams.h", dst="include", src=self._source_subfolder) + copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "libdivide.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + copy(self, "constant_fast_div.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + copy(self, "s16_ldparams.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + copy(self, "u16_ldparams.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 = [] + simd = self.options.get_safe("simd_intrinsics", False) if bool(simd): - self.cpp_info.defines = [ - {"sse2": "LIBDIVIDE_SSE2", - "avx2": "LIBDIVIDE_AVX2", - "avx512": "LIBDIVIDE_AVX512"}[str(simd)] - ] + self.cpp_info.defines = [{"sse2": "LIBDIVIDE_SSE2", "avx2": "LIBDIVIDE_AVX2", "avx512": "LIBDIVIDE_AVX512"}[str(simd)]] if self.options.get_safe("sse2", False): self.cpp_info.defines.append("LIBDIVIDE_SSE2") if self.options.get_safe("avx2", False): diff --git a/recipes/libdivide/all/test_package/CMakeLists.txt b/recipes/libdivide/all/test_package/CMakeLists.txt index c08b1cebc6009..619dae18c0777 100644 --- a/recipes/libdivide/all/test_package/CMakeLists.txt +++ b/recipes/libdivide/all/test_package/CMakeLists.txt @@ -1,15 +1,18 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX C) find_package(libdivide REQUIRED CONFIG) add_executable(${PROJECT_NAME}_c test_package.c) target_link_libraries(${PROJECT_NAME}_c libdivide::libdivide) -set_property(TARGET ${PROJECT_NAME}_c PROPERTY C_STANDARD 99) +set_target_properties(${PROJECT_NAME}_c PROPERTIES +C_STANDARD 99 +LINKER_LANGUAGE C +) add_executable(${PROJECT_NAME}_cpp test_package.cpp) target_link_libraries(${PROJECT_NAME}_cpp libdivide::libdivide) -set_property(TARGET ${PROJECT_NAME}_cpp PROPERTY CXX_STANDARD 11) +set_target_properties( ${PROJECT_NAME}_cpp PROPERTIES +CXX_STANDARD 11 +LINKER_LANGUAGE CXX +) diff --git a/recipes/libdivide/all/test_package/conanfile.py b/recipes/libdivide/all/test_package/conanfile.py index 0eee35d285cde..b89281b9f4061 100644 --- a/recipes/libdivide/all/test_package/conanfile.py +++ b/recipes/libdivide/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain" + 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,8 +21,8 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_c_path = os.path.join("bin", "test_package_c") - self.run(bin_c_path, run_environment=True) - bin_cpp_path = os.path.join("bin", "test_package_cpp") - self.run(bin_cpp_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package_c") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package_cpp") + self.run(bin_path, env="conanrun") diff --git a/recipes/libdivide/all/test_v1_package/CMakeLists.txt b/recipes/libdivide/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/libdivide/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libdivide/all/test_v1_package/conanfile.py b/recipes/libdivide/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0eee35d285cde --- /dev/null +++ b/recipes/libdivide/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_c_path = os.path.join("bin", "test_package_c") + self.run(bin_c_path, run_environment=True) + bin_cpp_path = os.path.join("bin", "test_package_cpp") + self.run(bin_cpp_path, run_environment=True) diff --git a/recipes/libdivide/all/test_v1_package/test_package.c b/recipes/libdivide/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..dc8a5151154fd --- /dev/null +++ b/recipes/libdivide/all/test_v1_package/test_package.c @@ -0,0 +1,12 @@ +#include + +#include +#include +#include + +int main() { + struct libdivide_s64_t fast_d = libdivide_s64_gen(30); + int64_t a = 60; + printf("%" PRId64 "\n", libdivide_s64_do(a, &fast_d)); + return 0; +} diff --git a/recipes/libdrawille/all/conandata.yml b/recipes/libdrawille/all/conandata.yml new file mode 100644 index 0000000000000..7562384137dba --- /dev/null +++ b/recipes/libdrawille/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "cci.20160428": + url: "https://github.com/Huulivoide/libdrawille/archive/e7e366e739c80120690dd0ee9f41648d2556f800.tar.gz" + sha256: "c4f4e4b74d419bb06e8fdf4886421216d65eb095e69fb8bcdeb33960bbd7ae16" +patches: + "cci.20160428": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "disable test, examples add installer, link mathlib only on Linux" + patch_type: "conan" + - patch_file: "patches/0002-support-msvc.patch" + patch_description: "rename restrict keyword for msvc" + patch_type: "portability" diff --git a/recipes/libdrawille/all/conanfile.py b/recipes/libdrawille/all/conanfile.py new file mode 100644 index 0000000000000..b6f2dc8f8a984 --- /dev/null +++ b/recipes/libdrawille/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + +class LibdrawilleConan(ConanFile): + name = "libdrawille" + description = "C implementation of drawille library and extra drawing functionality" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Huulivoide/libdrawille/" + topics = ("drawille") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"{self.ref} supports x86 and x86_64 only.") + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC.(yet)") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["drawille"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libdrawille/all/patches/0001-fix-cmake.patch b/recipes/libdrawille/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..e45992f62132f --- /dev/null +++ b/recipes/libdrawille/all/patches/0001-fix-cmake.patch @@ -0,0 +1,55 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8d225ed..dc1a1b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + cmake_minimum_required(VERSION 3.4) + project(libdrawille VERSION 0.0.1 LANGUAGES C) + +-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -pedantic") ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic") + set(CMAKE_C_STANDARD 11) + set(CMAKE_C_STANDARD_REQUIRED ON) + +@@ -12,6 +12,3 @@ elseif(${WIN32}) + endif() + + add_subdirectory(src) +-add_subdirectory(test) +-add_subdirectory(examples) +-add_subdirectory(benchmark) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3c74714..240ca8b 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,9 +1,26 @@ +-find_library(MATH m) +- + set(SOURCE_FILES Canvas.c stamp.c mat3.c polygon.c point.c utils.c x86/sse.c x86/avx2.c) + set_source_files_properties(x86/sse.c PROPERTIES COMPILE_FLAGS "-msse -msse2 -msse4") + set_source_files_properties(x86/avx2.c PROPERTIES COMPILE_FLAGS "-msse -msse2 -msse4 -mavx -mavx2") + +-add_library(libdrawille ${SOURCE_FILES}) +-target_link_libraries(libdrawille ${MATH}) ++add_library(drawille ${SOURCE_FILES}) ++ ++find_library(MATH m) ++if(MATH) ++ target_link_libraries(drawille ${MATH}) ++endif() ++ ++include(GNUInstallDirs) ++ ++install( ++ TARGETS drawille ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) + ++install( ++ FILES ++ Canvas.h ++ mat3.h ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/drawille ++) diff --git a/recipes/libdrawille/all/patches/0002-support-msvc.patch b/recipes/libdrawille/all/patches/0002-support-msvc.patch new file mode 100644 index 0000000000000..24685ef15d80a --- /dev/null +++ b/recipes/libdrawille/all/patches/0002-support-msvc.patch @@ -0,0 +1,95 @@ +diff --git a/src/stamp.c b/src/stamp.c +index 73c78d0..6da8910 100644 +--- a/src/stamp.c ++++ b/src/stamp.c +@@ -138,8 +138,13 @@ int draw_stamp_outline(Canvas* c, Color color, const Stamp* s) { + return 1; + } + ++#ifdef _MSC_VER ++void fill_triangle(Canvas* __restrict canvas, const Color color, ++ const Point v1, const Point v2, const Point v3) { ++#else + void fill_triangle(Canvas* restrict canvas, const Color color, + const Point v1, const Point v2, const Point v3) { ++#endif + // 28.4 fixed-point coordinates + const int Y1 = to_fixed(v1.y); + const int Y2 = to_fixed(v2.y); +diff --git a/src/stamp.h b/src/stamp.h +index 5132bd7..009fea9 100644 +--- a/src/stamp.h ++++ b/src/stamp.h +@@ -35,7 +35,12 @@ void apply_matrix(Stamp* s); + int draw_stamp_outline(Canvas* c, Color color, const Stamp* s); + int fill_shape(Canvas* c, Color color, const Stamp* s); + ++#ifdef _MSC_VER ++void fill_triangle(Canvas* __restrict canvas, const Color color, ++ const Point v1, const Point v2, const Point v3); ++#else + void fill_triangle(Canvas* restrict canvas, const Color color, + const Point v1, const Point v2, const Point v3); ++#endif + + #endif //LIBDRAWILLE_STAMP_H +diff --git a/src/x86/avx2.c b/src/x86/avx2.c +index 100c474..27870a8 100644 +--- a/src/x86/avx2.c ++++ b/src/x86/avx2.c +@@ -17,8 +17,13 @@ static inline __m256i to_fixed_avx2(const float a, const float b, const float c, + return _mm256_cvtps_epi32(m); + } + ++#ifdef _MSC_VER ++void fill_triangle_avx2(Canvas* __restrict canvas, const Color color, ++ const Point v1, const Point v2, const Point v3) { ++#else + void fill_triangle_avx2(Canvas* restrict canvas, const Color color, + const Point v1, const Point v2, const Point v3) { ++#endif + // Block size, standard 8x8 (must be power of two) + const int q = 8; + +diff --git a/src/x86/sse.c b/src/x86/sse.c +index 27a6380..5cf0b48 100644 +--- a/src/x86/sse.c ++++ b/src/x86/sse.c +@@ -10,8 +10,13 @@ static inline __m128i to_fixed_sse(const float a, const float b, const float c) + return _mm_cvtps_epi32(m); + } + ++#ifdef _MSC_VER ++void fill_triangle_sse4(Canvas* __restrict canvas, const Color color, ++ const Point v1, const Point v2, const Point v3) { ++#else + void fill_triangle_sse4(Canvas* restrict canvas, const Color color, + const Point v1, const Point v2, const Point v3) { ++#endif + // Block size, standard 8x8 (must be power of two) + const int q = 8; + +diff --git a/src/x86/x86.h b/src/x86/x86.h +index c31cd03..4d161cb 100644 +--- a/src/x86/x86.h ++++ b/src/x86/x86.h +@@ -36,10 +36,19 @@ static inline void printv8h(const char* prefix, vec8 v) { + } + + ++#ifdef _MSC_VER ++void fill_triangle_sse4(Canvas* __restrict canvas, const Color color, ++ const Point v1, const Point v2, const Point v3); ++ ++void fill_triangle_avx2(Canvas* __restrict canvas, const Color color, ++ const Point v1, const Point v2, const Point v3); ++#else + void fill_triangle_sse4(Canvas* restrict canvas, const Color color, + const Point v1, const Point v2, const Point v3); + + void fill_triangle_avx2(Canvas* restrict canvas, const Color color, + const Point v1, const Point v2, const Point v3); ++#endif ++ + + #endif //LIBDRAWILLE_X86_H diff --git a/recipes/libdrawille/all/test_package/CMakeLists.txt b/recipes/libdrawille/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c756c82332027 --- /dev/null +++ b/recipes/libdrawille/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(libdrawille REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libdrawille::libdrawille) diff --git a/recipes/libdrawille/all/test_package/conanfile.py b/recipes/libdrawille/all/test_package/conanfile.py new file mode 100644 index 0000000000000..78a82060a3202 --- /dev/null +++ b/recipes/libdrawille/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, src_folder=".") + + 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/libdrawille/all/test_package/test_package.c b/recipes/libdrawille/all/test_package/test_package.c new file mode 100644 index 0000000000000..e6581befbb41a --- /dev/null +++ b/recipes/libdrawille/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include "drawille/Canvas.h" + + +int main() { + Canvas* canvas = new_canvas(100, 100); + + free_canvas(canvas); + + return 0; +} diff --git a/recipes/libdrawille/all/test_v1_package/CMakeLists.txt b/recipes/libdrawille/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libdrawille/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/libdrawille/all/test_v1_package/conanfile.py b/recipes/libdrawille/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libdrawille/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/libdrawille/config.yml b/recipes/libdrawille/config.yml new file mode 100644 index 0000000000000..4478b307ea3a4 --- /dev/null +++ b/recipes/libdrawille/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20160428": + folder: all diff --git a/recipes/libgeotiff/all/conanfile.py b/recipes/libgeotiff/all/conanfile.py index dd7258309aa60..4125b818ee21d 100644 --- a/recipes/libgeotiff/all/conanfile.py +++ b/recipes/libgeotiff/all/conanfile.py @@ -43,7 +43,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libtiff/4.4.0") + # libgeotiff/include/xtiffio.h includes libtiff/include/tiffio.h + self.requires("libtiff/4.5.1", transitive_headers=True, transitive_libs=True) self.requires("proj/9.1.1") def source(self): diff --git a/recipes/libgettext/all/conandata.yml b/recipes/libgettext/all/conandata.yml index 6024e755af9d8..c7f8b2f8602a5 100644 --- a/recipes/libgettext/all/conandata.yml +++ b/recipes/libgettext/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.22": + url: "https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.tar.gz" + sha256: "49f089be11b490170bbf09ed2f51e5f5177f55be4cc66504a5861820e0fb06ab" "0.21": url: "https://ftp.gnu.org/pub/gnu/gettext/gettext-0.21.tar.gz" sha256: "c77d0da3102aec9c07f43671e60611ebff89a996ef159497ce8e59d075786b12" diff --git a/recipes/libgettext/all/conanfile.py b/recipes/libgettext/all/conanfile.py index e480512d27ccf..30249cef99da1 100644 --- a/recipes/libgettext/all/conanfile.py +++ b/recipes/libgettext/all/conanfile.py @@ -1,3 +1,4 @@ +import glob import os from conan import ConanFile @@ -182,7 +183,7 @@ def programs(): def build(self): apply_conandata_patches(self) autotools = Autotools(self) - autotools.configure("gettext-tools") + autotools.configure("gettext-runtime") autotools.make() def package(self): @@ -214,8 +215,6 @@ def fix_msvc_libname(conanfile, remove_lib_prefix=True): """remove lib prefix & change extension to .lib in case of cl like compiler""" if not conanfile.settings.get_safe("compiler.runtime"): return - from conan.tools.files import rename - import glob libdirs = getattr(conanfile.cpp.package, "libdirs") for libdir in libdirs: for ext in [".dll.a", ".dll.lib", ".a"]: diff --git a/recipes/libgettext/config.yml b/recipes/libgettext/config.yml index dc03f51a1d462..c7ed4b0b0c8c1 100644 --- a/recipes/libgettext/config.yml +++ b/recipes/libgettext/config.yml @@ -1,4 +1,6 @@ versions: + "0.22": + folder: all "0.21": folder: all "0.20.1": diff --git a/recipes/libharu/all/conanfile.py b/recipes/libharu/all/conanfile.py index fc6fd0d3335fc..73045d8d62bce 100644 --- a/recipes/libharu/all/conanfile.py +++ b/recipes/libharu/all/conanfile.py @@ -48,7 +48,7 @@ def layout(self): def requirements(self): self.requires("zlib/1.2.13") - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) diff --git a/recipes/libinterpolate/all/conandata.yml b/recipes/libinterpolate/all/conandata.yml index ccfe0443cddf0..7d38fb0462c3a 100644 --- a/recipes/libinterpolate/all/conandata.yml +++ b/recipes/libinterpolate/all/conandata.yml @@ -7,3 +7,7 @@ sources: url: - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.3.tar.gz" sha256: "bb2f253c27594b4e56ed9349630086665f529100eac2cd3cba63d198c3a84ff9" + "2.6.4": + url: + - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.4.tar.gz" + sha256: "231a39fcc87ffc3e03936f7a21abc78ef309c2f1de79bd3ae72c24d78352d666" diff --git a/recipes/libinterpolate/all/conanfile.py b/recipes/libinterpolate/all/conanfile.py index 62e7baa6e4ea4..b1c88daae5803 100644 --- a/recipes/libinterpolate/all/conanfile.py +++ b/recipes/libinterpolate/all/conanfile.py @@ -43,9 +43,10 @@ def requirements(self): self.requires("eigen/3.3.7", transitive_headers=True) def validate(self): - if self.settings.os != "Linux": - raise ConanInvalidConfiguration("libInterpolate currently only supports Linux. Upstream PR's are welcome (https://github.com/CD3/libInterpolate/issues/14).") - + if Version(self.version) < "2.6.4" and self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} is not supported by {self.settings.os}; Try the version >= 2.6.4") + if Version(self.version) >= "2.6.4" and self.settings.os not in ["Linux", "Windows"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported by {self.settings.os}.") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get( diff --git a/recipes/libinterpolate/config.yml b/recipes/libinterpolate/config.yml index f4cf1cbc64d28..2f31497672d43 100644 --- a/recipes/libinterpolate/config.yml +++ b/recipes/libinterpolate/config.yml @@ -3,3 +3,5 @@ versions: folder: all "2.6.3": folder: all + "2.6.4": + folder: all diff --git a/recipes/libmount/all/conandata.yml b/recipes/libmount/all/conandata.yml index 5bf946443eb38..18c98b7cab46c 100644 --- a/recipes/libmount/all/conandata.yml +++ b/recipes/libmount/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.39": + url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/util-linux-2.39.tar.xz" + sha256: "32b30a336cda903182ed61feb3e9b908b762a5e66fe14e43efb88d37162075cb" "2.36.2": url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-2.36.2.tar.xz" sha256: "f7516ba9d8689343594356f0e5e1a5f0da34adfbc89023437735872bb5024c5f" diff --git a/recipes/libmount/config.yml b/recipes/libmount/config.yml index c0f9ff233a2c0..b9150d1aa9e48 100644 --- a/recipes/libmount/config.yml +++ b/recipes/libmount/config.yml @@ -1,4 +1,6 @@ versions: + "2.39": + folder: all "2.36.2": folder: all "2.36": diff --git a/recipes/libnghttp2/all/conandata.yml b/recipes/libnghttp2/all/conandata.yml index 4bb9bc4aa3c48..834d98b9d2153 100644 --- a/recipes/libnghttp2/all/conandata.yml +++ b/recipes/libnghttp2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.55.0": + url: "https://github.com/nghttp2/nghttp2/archive/v1.55.0.tar.gz" + sha256: "6d2a4d246e84cb1e3e581591bd1c50ecc085e50090bc068ed5a67f87c6b4a06e" "1.54.0": url: "https://github.com/nghttp2/nghttp2/archive/v1.54.0.tar.gz" sha256: "aae8bda9e06d7c51a12488175086edc44a46c230561dc7c45d779e00e43d4b8e" @@ -23,21 +26,6 @@ sources: "1.46.0": url: "https://github.com/nghttp2/nghttp2/releases/download/v1.46.0/nghttp2-1.46.0.tar.xz" sha256: "1a68cc4a5732afb735baf50aaac3cb3a6771e49f744bd5db6c49ab5042f12a43" - "1.45.1": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.45.1/nghttp2-1.45.1.tar.xz" - sha256: "abdc4addccadbc7d89abe27c4d6427d78e57d139f69c1f45749227393c68bf79" - "1.43.0": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.43.0/nghttp2-1.43.0.tar.xz" - sha256: "f7d54fa6f8aed29f695ca44612136fa2359013547394d5dffeffca9e01a26b0f" - "1.42.0": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.42.0/nghttp2-1.42.0.tar.xz" - sha256: "c5a7f09020f31247d0d1609078a75efadeccb7e5b86fc2e4389189b1b431fe63" - "1.40.0": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.40.0/nghttp2-1.40.0.tar.xz" - sha256: "09fc43d428ff237138733c737b29fb1a7e49d49de06d2edbed3bc4cdcee69073" - "1.39.2": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.39.2/nghttp2-1.39.2.tar.xz" - sha256: "a2d216450abd2beaf4e200c168957968e89d602ca4119338b9d7ab059fd4ce8b" patches: "1.49.0": - patch_file: "patches/fix-findJemalloc.cmake" @@ -51,25 +39,3 @@ patches: "1.46.0": - patch_file: "patches/fix-findJemalloc.cmake" - patch_file: "patches/fix-findLibevent.cmake" - "1.45.1": - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" - "1.43.0": - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" - "1.42.0": - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" - "1.40.0": - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" - - patch_file: "patches/1.40.0-remove-static-suffix.patch" - patch_type: "backport" - patch_source: https://github.com/curl/curl/pull/7515#issuecomment-890320856 - patch_description: >- - Fix the breaking change that was introduced in 1.40.0 and made optional - in 1.40.1 - "1.39.2": - - patch_file: "patches/fix-addNghttp2IncludesPathCMake.patch" - - patch_file: "patches/fix-findJemalloc.cmake" - - patch_file: "patches/fix-findLibevent.cmake" diff --git a/recipes/libnghttp2/all/conanfile.py b/recipes/libnghttp2/all/conanfile.py index d6777fe1e084b..b7976951f311e 100644 --- a/recipes/libnghttp2/all/conanfile.py +++ b/recipes/libnghttp2/all/conanfile.py @@ -63,17 +63,17 @@ def requirements(self): if self.options.with_app or self.options.get_safe("with_asio"): self.requires("openssl/[>=1.1 <4]") if self.options.with_app: - self.requires("c-ares/1.19.0") + self.requires("c-ares/1.19.1") self.requires("libev/4.33") self.requires("libevent/2.1.12") - self.requires("libxml2/2.10.4") + self.requires("libxml2/2.11.4") self.requires("zlib/1.2.13") if self.options.with_jemalloc: self.requires("jemalloc/5.3.0") if self.options.with_hpack: self.requires("jansson/2.14") if self.options.get_safe("with_asio"): - self.requires("boost/1.81.0") + self.requires("boost/1.82.0") def validate(self): if self.options.get_safe("with_asio") and is_msvc(self): diff --git a/recipes/libnghttp2/all/patches/1.40.0-remove-static-suffix.patch b/recipes/libnghttp2/all/patches/1.40.0-remove-static-suffix.patch deleted file mode 100644 index b769d5a577c38..0000000000000 --- a/recipes/libnghttp2/all/patches/1.40.0-remove-static-suffix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- lib/CMakeLists.txt.orig 2022-12-23 11:01:09.000000000 +0200 -+++ lib/CMakeLists.txt 2022-12-23 11:01:22.000000000 +0200 -@@ -62,7 +62,7 @@ if(HAVE_CUNIT OR ENABLE_STATIC_LIB) - set_target_properties(nghttp2_static PROPERTIES - COMPILE_FLAGS "${WARNCFLAGS}" - VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} -- ARCHIVE_OUTPUT_NAME nghttp2_static -+ ARCHIVE_OUTPUT_NAME nghttp2 - ) - target_compile_definitions(nghttp2_static PUBLIC "-DNGHTTP2_STATICLIB") - if(ENABLE_STATIC_LIB) diff --git a/recipes/libnghttp2/all/patches/fix-addNghttp2IncludesPathCMake.patch b/recipes/libnghttp2/all/patches/fix-addNghttp2IncludesPathCMake.patch deleted file mode 100644 index f3458ec8b39b9..0000000000000 --- a/recipes/libnghttp2/all/patches/fix-addNghttp2IncludesPathCMake.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- CMakeLists.txt.orig 2019-12-12 20:23:38.855819744 +0100 -+++ CMakeLists.txt 2019-12-12 20:22:54.194563670 +0100 -@@ -449,6 +449,8 @@ - - install(FILES README.rst DESTINATION "${CMAKE_INSTALL_DOCDIR}") - -+include_directories(lib/includes) -+ - add_subdirectory(lib) - #add_subdirectory(lib/includes) - add_subdirectory(third-party) diff --git a/recipes/libnghttp2/all/test_package/CMakeLists.txt b/recipes/libnghttp2/all/test_package/CMakeLists.txt index eb7f9cd8b9769..f359e60515137 100644 --- a/recipes/libnghttp2/all/test_package/CMakeLists.txt +++ b/recipes/libnghttp2/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(libnghttp2 REQUIRED CONFIG) diff --git a/recipes/libnghttp2/config.yml b/recipes/libnghttp2/config.yml index f75606a075b1c..75ab39061ab25 100644 --- a/recipes/libnghttp2/config.yml +++ b/recipes/libnghttp2/config.yml @@ -1,4 +1,6 @@ versions: + "1.55.0": + folder: all "1.54.0": folder: all "1.53.0": @@ -15,13 +17,3 @@ versions: folder: all "1.46.0": folder: all - "1.45.1": - folder: all - "1.43.0": - folder: all - "1.42.0": - folder: all - "1.40.0": - folder: all - "1.39.2": - folder: all diff --git a/recipes/libnl/all/conandata.yml b/recipes/libnl/all/conandata.yml index edfebcd8dad20..cf3856e1f84ca 100644 --- a/recipes/libnl/all/conandata.yml +++ b/recipes/libnl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.7.0": + sha256: 9fe43ccbeeea72c653bdcf8c93332583135cda46a79507bfd0a483bb57f65939 + url: https://github.com/thom311/libnl/releases/download/libnl3_7_0/libnl-3.7.0.tar.gz "3.2.25": sha256: 8beb7590674957b931de6b7f81c530b85dc7c1ad8fbda015398bc1e8d1ce8ec5 - url: https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz + url: https://github.com/thom311/libnl/releases/download/libnl3_2_25/libnl-3.2.25.tar.gz diff --git a/recipes/libnl/all/conanfile.py b/recipes/libnl/all/conanfile.py index 1bd02b2f42194..2dd67d7ee45af 100644 --- a/recipes/libnl/all/conanfile.py +++ b/recipes/libnl/all/conanfile.py @@ -1,8 +1,11 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import get, rmdir, copy, rm +from conan.tools.layout import basic_layout +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class LibNlConan(ConanFile): @@ -15,63 +18,50 @@ class LibNlConan(ConanFile): settings = "os", "arch", "compiler", "build_type" options = {"fPIC": [True, False], "shared": [True, False]} default_options = {"fPIC": True, "shared": False} - build_requires = ( "flex/2.6.4", "bison/3.7.6" ) - - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def build_requirements(self): + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") + def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) 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") + # This is a pure C library + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration("Libnl is only supported on Linux") - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - config_args = [ - "--prefix={}".format(tools.unix_path(self.package_folder)), - ] - if self.options.shared: - config_args.extend(["--enable-shared=yes", "--enable-static=no"]) - else: - config_args.extend(["--enable-shared=no", "--enable-static=yes"]) + def layout(self): + basic_layout(self, src_folder="src") - self._autotools.configure(configure_dir=self._source_subfolder, args=config_args) - return self._autotools + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() def build(self): - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - autotools = self._configure_autotools() + autotools = Autotools(self) autotools.install() - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "etc")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.components["nl"].libs = ["nl-3"] self.cpp_info.components["nl"].includedirs = [os.path.join('include', 'libnl3')] - if self._settings_build.os != "Windows": + if self.settings.os != "Windows": self.cpp_info.components["nl"].system_libs = ["pthread", "m"] self.cpp_info.components["nl-route"].libs = ["nl-route-3"] self.cpp_info.components["nl-route"].requires = ["nl"] @@ -81,5 +71,7 @@ def package_info(self): self.cpp_info.components["nl-nf"].requires = ["nl-route"] self.cpp_info.components["nl-cli"].libs = ["nl-cli-3"] self.cpp_info.components["nl-cli"].requires = ["nl-nf", "nl-genl"] + if self.settings.os != "Windows": + self.cpp_info.components["nl-cli"].system_libs = ["dl"] self.cpp_info.components["nl-idiag"].libs = ["nl-idiag-3"] self.cpp_info.components["nl-idiag"].requires = ["nl"] diff --git a/recipes/libnl/all/test_package/CMakeLists.txt b/recipes/libnl/all/test_package/CMakeLists.txt index df9446e8809cf..c5d1b19c7a8f9 100644 --- a/recipes/libnl/all/test_package/CMakeLists.txt +++ b/recipes/libnl/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.5) -project(netlink_example) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libnl REQUIRED CONFIG) -add_executable(show_links show_links.c) -target_link_libraries(show_links ${CONAN_LIBS}) +add_executable(${PROJECT_NAME} ${PROJECT_NAME}.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libnl::nl libnl::nl-route libnl::nl-genl libnl::nl-nf libnl::nl-cli libnl::nl-idiag) diff --git a/recipes/libnl/all/test_package/conanfile.py b/recipes/libnl/all/test_package/conanfile.py index c130487451ae0..9b544e8a245c0 100644 --- a/recipes/libnl/all/test_package/conanfile.py +++ b/recipes/libnl/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -import os.path - -from conans import ConanFile, CMake, tools +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout class NetlinkTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + 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) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join(self.build_folder, "bin", "show_links") - self.run(bin_path, cwd=self.source_folder, 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/libnl/all/test_package/show_links.c b/recipes/libnl/all/test_package/test_package.c similarity index 100% rename from recipes/libnl/all/test_package/show_links.c rename to recipes/libnl/all/test_package/test_package.c diff --git a/recipes/libnl/config.yml b/recipes/libnl/config.yml index 992cfb9a265e6..3901cc1eb7ac9 100644 --- a/recipes/libnl/config.yml +++ b/recipes/libnl/config.yml @@ -1,3 +1,5 @@ versions: + 3.7.0: + folder: all 3.2.25: folder: all diff --git a/recipes/libpng/all/conan_cmake_project_include.cmake b/recipes/libpng/all/conan_cmake_project_include.cmake new file mode 100644 index 0000000000000..e70fb28d5bf7d --- /dev/null +++ b/recipes/libpng/all/conan_cmake_project_include.cmake @@ -0,0 +1,7 @@ +# Older versions of libpng's CMakeLists reference the ZLIB_LIBRARy +# varible which was never officially documented. +# This was fixed in which first went into version 1.6.38. +# This can be deleted once the recipe no longer supports versions older than that. +# https://github.com/glennrp/libpng/commit/9f734b13f4ea062af98652c4c7678f667d2d85c7 +find_package(ZLIB CONFIG REQUIRED) +set(ZLIB_LIBRARY "${ZLIB_LIBRARIES}") diff --git a/recipes/libpng/all/conandata.yml b/recipes/libpng/all/conandata.yml index e10462996e48c..bb5cbe33cccce 100644 --- a/recipes/libpng/all/conandata.yml +++ b/recipes/libpng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.40": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.40/libpng-1.6.40.tar.xz" + sha256: "535b479b2467ff231a3ec6d92a525906fb8ef27978be4f66dbe05d3f3a01b3a1" "1.6.39": url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.39/libpng-1.6.39.tar.xz" sha256: "1f4696ce70b4ee5f85f1e1623dc1229b210029fa4b7aee573df3e2ba7b036937" @@ -8,17 +11,9 @@ sources: "1.6.37": url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.37/libpng-1.6.37.tar.xz" sha256: "505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca" + "1.6.32": + url: "https://sourceforge.net/projects/libpng/files/libpng16/older-releases/1.6.32/libpng-1.6.32.tar.xz" + sha256: "c918c3113de74a692f0a1526ce881dc26067763eb3915c57ef3a0f7b6886f59b" "1.5.30": url: "https://sourceforge.net/projects/libpng/files/libpng15/1.5.30/libpng-1.5.30.tar.xz" sha256: "7d76275fad2ede4b7d87c5fd46e6f488d2a16b5a69dc968ffa840ab39ba756ed" -patches: - "1.6.37": - - patch_file: "patches/0001-1.6.37-cmakefile-zlib.patch" - patch_description: "Update ZLib include and library paths for conan to provide\ - \ lib. Remove Zlib dll definition." - patch_type: "conan" - "1.5.30": - - patch_file: "patches/0001-1.5.30-cmakefile-zlib.patch" - patch_description: "Update ZLib include and library paths for conan to provide\ - \ lib. Remove Zlib dll definition." - patch_type: "conan" diff --git a/recipes/libpng/all/conanfile.py b/recipes/libpng/all/conanfile.py index 5b838438efa3b..f8d672f0bb237 100644 --- a/recipes/libpng/all/conanfile.py +++ b/recipes/libpng/all/conanfile.py @@ -68,6 +68,7 @@ def _neon_msa_sse_vsx_mapping(self): def export_sources(self): export_conandata_patches(self) + copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -102,11 +103,13 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["PNG_TESTS"] = False - tc.variables["PNG_SHARED"] = self.options.shared - tc.variables["PNG_STATIC"] = not self.options.shared - tc.variables["PNG_DEBUG"] = self.settings.build_type == "Debug" - tc.variables["PNG_PREFIX"] = self.options.api_prefix + tc.cache_variables["PNG_TESTS"] = False + tc.cache_variables["PNG_SHARED"] = self.options.shared + tc.cache_variables["PNG_STATIC"] = not self.options.shared + tc.cache_variables["PNG_DEBUG"] = self.settings.build_type == "Debug" + tc.cache_variables["PNG_PREFIX"] = self.options.api_prefix + if Version(self.version) < "1.6.38": + tc.cache_variables["CMAKE_PROJECT_libpng_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") if self._has_neon_support: tc.variables["PNG_ARM_NEON"] = self._neon_msa_sse_vsx_mapping[str(self.options.neon)] if self._has_msa_support: @@ -125,26 +128,6 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - if self.settings.os == "Windows": - if Version(self.version) <= "1.5.2": - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - 'set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME}_static)', - 'set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME})') - else: - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - 'OUTPUT_NAME "${PNG_LIB_NAME}_static', - 'OUTPUT_NAME "${PNG_LIB_NAME}') - if not (is_msvc(self) or self._is_clang_cl): - if Version(self.version) < "1.6.38": - src_text = 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $ $/${DEST_FILE}' - else: - src_text = '''COMMAND "${CMAKE_COMMAND}" - -E copy_if_different - $ - $/${DEST_FILE}''' - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - src_text, - 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $/$ $/${DEST_FILE}') def build(self): self._patch_sources() @@ -175,6 +158,8 @@ def package_info(self): prefix = "lib" if (is_msvc(self) or self._is_clang_cl) else "" suffix = major_min_version if self.settings.os == "Windows" else "" + if is_msvc(self) or self._is_clang_cl: + suffix += "_static" if not self.options.shared else "" suffix += "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" self.cpp_info.libs = [f"{prefix}png{suffix}"] if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: diff --git a/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch b/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch deleted file mode 100644 index d78bd326e5e4c..0000000000000 --- a/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b861195..8e3d2ca 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -41,7 +41,7 @@ set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) - - # needed packages - find_package(ZLIB REQUIRED) --include_directories(${ZLIB_INCLUDE_DIR}) -+include_directories(${ZLIB_INCLUDE_DIRS}) - - if(NOT WIN32) - find_library(M_LIBRARY -@@ -312,7 +312,7 @@ if(PNG_DEBUG) - endif() - - # NOW BUILD OUR TARGET --include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) -+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS}) - - unset(PNG_LIB_TARGETS) - -@@ -326,7 +326,7 @@ if(PNG_SHARED) - set_target_properties(png PROPERTIES PREFIX "lib") - set_target_properties(png PROPERTIES IMPORT_PREFIX "lib") - endif() -- target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY}) - - if(UNIX AND AWK) - if(HAVE_LD_VERSION_SCRIPT) -@@ -361,7 +361,7 @@ if(PNG_STATIC) - # msvc does not append 'lib' - do it here to have consistent name - set_target_properties(png_static PROPERTIES PREFIX "lib") - endif() -- target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(PNG_FRAMEWORK) -@@ -378,7 +378,7 @@ if(PNG_FRAMEWORK) - XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" - PUBLIC_HEADER "${libpng_public_hdrs}" - OUTPUT_NAME png) -- target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(NOT PNG_LIB_TARGETS) diff --git a/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch b/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch deleted file mode 100644 index aaf8fda5cb495..0000000000000 --- a/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- CMakeLists.txt 2019-04-14 20:10:32.000000000 +0200 -+++ CMakeLists.txt 2019-07-04 11:25:33.862280292 +0200 -@@ -40,7 +40,7 @@ - - if(NOT PNG_BUILD_ZLIB) - find_package(ZLIB REQUIRED) -- include_directories(${ZLIB_INCLUDE_DIR}) -+ include_directories(${ZLIB_INCLUDE_DIRS}) - endif() - - if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU) -@@ -522,7 +522,7 @@ - endif() - - # NOW BUILD OUR TARGET --include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) -+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS}) - - unset(PNG_LIB_TARGETS) - -@@ -536,7 +536,7 @@ - set_target_properties(png PROPERTIES PREFIX "lib") - set_target_properties(png PROPERTIES IMPORT_PREFIX "lib") - endif() -- target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY}) - - if(UNIX AND AWK) - if(HAVE_LD_VERSION_SCRIPT) -@@ -571,7 +571,7 @@ - # msvc does not append 'lib' - do it here to have consistent name - set_target_properties(png_static PROPERTIES PREFIX "lib") - endif() -- target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(PNG_FRAMEWORK) -@@ -588,7 +588,7 @@ - XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" - PUBLIC_HEADER "${libpng_public_hdrs}" - OUTPUT_NAME png) -- target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(NOT PNG_LIB_TARGETS) -@@ -753,7 +753,7 @@ - set(PNG_BIN_TARGETS pngfix) - - add_executable(png-fix-itxt ${png_fix_itxt_sources}) -- target_link_libraries(png-fix-itxt ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(png-fix-itxt ${ZLIB_LIBRARIES} ${M_LIBRARY}) - list(APPEND PNG_BIN_TARGETS png-fix-itxt) - endif() - diff --git a/recipes/libpng/config.yml b/recipes/libpng/config.yml index feabbd00c1919..e93a6a24ec85a 100644 --- a/recipes/libpng/config.yml +++ b/recipes/libpng/config.yml @@ -1,9 +1,13 @@ versions: + "1.6.40": + folder: all "1.6.39": folder: all "1.6.38": folder: all "1.6.37": folder: all + "1.6.32": + folder: all "1.5.30": folder: all diff --git a/recipes/libpq/all/conandata.yml b/recipes/libpq/all/conandata.yml index 3f978881fafe5..eef5fefc1dd9a 100644 --- a/recipes/libpq/all/conandata.yml +++ b/recipes/libpq/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "15.3": + url: "https://ftp.postgresql.org/pub/source/v15.3/postgresql-15.3.tar.bz2" + sha256: "ffc7d4891f00ffbf5c3f4eab7fbbced8460b8c0ee63c5a5167133b9e6599d932" + "14.8": + url: "https://ftp.postgresql.org/pub/source/v14.8/postgresql-14.8.tar.bz2" + sha256: "39d38f0030737ed03835debeefee3b37d335462ce4995e2497bc38d621ebe45a" "14.7": url: "https://ftp.postgresql.org/pub/source/v14.7/postgresql-14.7.tar.bz2" sha256: "cef60f0098fa8101c1546f4254e45b722af5431337945b37af207007630db331" diff --git a/recipes/libpq/config.yml b/recipes/libpq/config.yml index 01599254d7d82..bf80d539d9d1e 100644 --- a/recipes/libpq/config.yml +++ b/recipes/libpq/config.yml @@ -1,4 +1,8 @@ versions: + "15.3": + folder: all + "14.8": + folder: all "14.7": folder: all "14.5": diff --git a/recipes/librasterlite/all/conanfile.py b/recipes/librasterlite/all/conanfile.py index 788447253ed3c..f454426605362 100644 --- a/recipes/librasterlite/all/conanfile.py +++ b/recipes/librasterlite/all/conanfile.py @@ -55,10 +55,10 @@ def layout(self): def requirements(self): self.requires("libgeotiff/1.7.1") self.requires("libjpeg/9e") - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") self.requires("libspatialite/5.0.1") - self.requires("libtiff/4.4.0") - self.requires("sqlite3/3.41.1") + self.requires("libtiff/4.5.1") + self.requires("sqlite3/3.42.0") def build_requirements(self): if not is_msvc(self): diff --git a/recipes/libraw/all/conanfile.py b/recipes/libraw/all/conanfile.py index e68c86171e78e..8ac3fa60eafca 100644 --- a/recipes/libraw/all/conanfile.py +++ b/recipes/libraw/all/conanfile.py @@ -51,7 +51,7 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.4") + self.requires("libjpeg-turbo/2.1.5") if self.options.with_lcms: self.requires("lcms/2.14") if self.options.with_jasper: diff --git a/recipes/libsecret/all/conanfile.py b/recipes/libsecret/all/conanfile.py index 3311696c926bf..2988bdf94bf2c 100644 --- a/recipes/libsecret/all/conanfile.py +++ b/recipes/libsecret/all/conanfile.py @@ -1,15 +1,14 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name -from conan.tools.build import can_run -from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.env import VirtualBuildEnv from conan.tools.files import copy, get, rmdir from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0 <2.0 || >=2.0.6" class LibsecretConan(ConanFile): @@ -54,7 +53,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.76.0", transitive_headers=True, transitive_libs=True, run=can_run(self)) + self.requires("glib/2.76.0", transitive_headers=True, transitive_libs=True) if self._use_gcrypt: self.requires("libgcrypt/1.8.4") @@ -68,8 +67,14 @@ def build_requirements(self): 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") - if not can_run(self): - self.tool_requires("glib/2.76.0") + self.tool_requires("glib/") + + if self.settings.os == "Macos": + # Avoid using gettext from homebrew which may be linked against + # a different/incompatible libiconv than the one being exposed + # in the runtime environment (DYLD_LIBRARY_PATH) + # See https://github.com/conan-io/conan-center-index/pull/17502#issuecomment-1542492466 + self.tool_requires("gettext/0.21") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -77,9 +82,6 @@ def source(self): def generate(self): env = VirtualBuildEnv(self) env.generate() - if can_run(self): - env = VirtualRunEnv(self) - env.generate(scope="build") tc = MesonToolchain(self) tc.project_options["introspection"] = "false" tc.project_options["manpage"] = "false" @@ -104,7 +106,7 @@ def package(self): def package_info(self): self.cpp_info.set_property("pkg_config_name", "libsecret-1") - self.cpp_info.requires = ["glib::glib-2.0", "glib::gobject-2.0"] + self.cpp_info.requires = ["glib::glib-2.0", "glib::gobject-2.0", "glib::gio-2.0"] if self._use_gcrypt: self.cpp_info.requires.append("libgcrypt::libgcrypt") self.cpp_info.includedirs = [os.path.join("include", "libsecret-1")] diff --git a/recipes/libspatialite/all/conanfile.py b/recipes/libspatialite/all/conanfile.py index e6186b890b333..4260480b1b097 100644 --- a/recipes/libspatialite/all/conanfile.py +++ b/recipes/libspatialite/all/conanfile.py @@ -85,7 +85,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("sqlite3/3.41.1") + self.requires("sqlite3/3.42.0") self.requires("zlib/1.2.13") if self.options.with_proj: self.requires("proj/9.1.1") diff --git a/recipes/libspng/all/conandata.yml b/recipes/libspng/all/conandata.yml index 20e5a777bfee5..39fc43e8152e7 100644 --- a/recipes/libspng/all/conandata.yml +++ b/recipes/libspng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.4": + url: "https://github.com/randy408/libspng/archive/refs/tags/v0.7.4.tar.gz" + sha256: "47ec02be6c0a6323044600a9221b049f63e1953faf816903e7383d4dc4234487" "0.7.3": url: "https://github.com/randy408/libspng/archive/refs/tags/v0.7.3.tar.gz" sha256: "a50cadbe808ffda1a7fab17d145f52a23b163f34b3eb3696c7ecb5a52340fc1d" @@ -6,6 +9,13 @@ sources: url: "https://github.com/randy408/libspng/archive/refs/tags/v0.7.2.tar.gz" sha256: "4acf25571d31f540d0b7ee004f5461d68158e0a13182505376805da99f4ccc4e" patches: + "0.7.4": + - patch_file: "patches/0.7.4-0001-allow-miniz.patch" + # Miniz is supported by the project, but does not currently expose a CMake + # option to toggle it. This can be removed once the project supports it + # or when the recipe moves to use Meson instead + patch_description: "add miniz option which is written in docs/BUILD.md" + patch_type: "portability" "0.7.3": - patch_file: "patches/0.7.3-0001-fix-dll-install.patch" patch_description: "fix install path" diff --git a/recipes/libspng/all/conanfile.py b/recipes/libspng/all/conanfile.py index 47f9d1ea0e572..b9d182dd24f28 100644 --- a/recipes/libspng/all/conanfile.py +++ b/recipes/libspng/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -72,6 +73,8 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + if Version(self.version) >= "0.7.4": + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("pkg_config_name", "libspng") @@ -80,3 +83,7 @@ def package_info(self): self.cpp_info.libs = ["spng"] if self.options.shared else ["spng_static"] if self.settings.os in ["Linux", "Android", "FreeBSD"]: self.cpp_info.system_libs.append("m") + + if Version(self.version) >= "0.7.4": + self.cpp_info.set_property("cmake_file_name", "SPNG") + self.cpp_info.set_property("cmake_target_name", "spng::spng{}".format("" if self.options.shared else "_static")) diff --git a/recipes/libspng/all/patches/0.7.4-0001-allow-miniz.patch b/recipes/libspng/all/patches/0.7.4-0001-allow-miniz.patch new file mode 100644 index 0000000000000..05e6f905e4d1e --- /dev/null +++ b/recipes/libspng/all/patches/0.7.4-0001-allow-miniz.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index da1917e..30c220d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,6 +12,7 @@ set(SPNG_VERSION ${SPNG_MAJOR}.${SPNG_MINOR}.${SPNG_REVISION}) + option(ENABLE_OPT "Enable architecture-specific optimizations" ON) + option(SPNG_SHARED "Build shared lib" ON) + option(SPNG_STATIC "Build static lib" ON) ++option(SPNG_USE_MINIZ "Use Miniz instead of zlib" OFF) + option(BUILD_EXAMPLES "Build examples" ON) + + include(GNUInstallDirs) +@@ -47,14 +48,24 @@ if(SPNG_STATIC) + list(APPEND spng_TARGETS spng_static) + endif() + +-find_package(ZLIB REQUIRED) ++if(SPNG_USE_MINIZ) ++ find_package(miniz REQUIRED) ++ set(compress_LIBS miniz::miniz) ++else() ++ find_package(ZLIB REQUIRED) ++ set(compress_LIBS ZLIB::ZLIB) ++endif() ++ + foreach(spng_TARGET ${spng_TARGETS}) + target_include_directories(${spng_TARGET} PUBLIC + $ + $ + ) +- target_link_libraries(${spng_TARGET} PRIVATE ZLIB::ZLIB) ++ target_link_libraries(${spng_TARGET} PRIVATE ${compress_LIBS}) + target_link_libraries(${spng_TARGET} PRIVATE ${MATH_LIBRARY}) ++ if (SPNG_USE_MINIZ) ++ target_compile_definitions(${spng_TARGET} PRIVATE SPNG_USE_MINIZ) ++ endif() + endforeach() + + set(project_config "${CMAKE_CURRENT_BINARY_DIR}/SPNGConfig.cmake") diff --git a/recipes/libspng/all/test_package/CMakeLists.txt b/recipes/libspng/all/test_package/CMakeLists.txt index c8aa2ff46daf5..37a57f5a95869 100644 --- a/recipes/libspng/all/test_package/CMakeLists.txt +++ b/recipes/libspng/all/test_package/CMakeLists.txt @@ -1,7 +1,16 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -find_package(libspng REQUIRED CONFIG) +find_package(libspng CONFIG) +if (NOT libspng_FOUND) + find_package(SPNG REQUIRED CONFIG) +endif() add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE libspng::libspng) +if (TARGET libspng::libspng) + target_link_libraries(${PROJECT_NAME} PRIVATE libspng::libspng) +elseif(TARGET spng::spng) + target_link_libraries(${PROJECT_NAME} PRIVATE spng::spng) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE spng::spng_static) +endif() diff --git a/recipes/libspng/config.yml b/recipes/libspng/config.yml index ed848445a96cc..f0510efbdd19d 100644 --- a/recipes/libspng/config.yml +++ b/recipes/libspng/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.4": + folder: all "0.7.3": folder: all "0.7.2": diff --git a/recipes/libssh2/all/CMakeLists.txt b/recipes/libssh2/all/CMakeLists.txt deleted file mode 100644 index 8315062fd31ee..0000000000000 --- a/recipes/libssh2/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper C) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/libssh2/all/conandata.yml b/recipes/libssh2/all/conandata.yml index 710cae0e7118d..f30a9ab38ce9b 100644 --- a/recipes/libssh2/all/conandata.yml +++ b/recipes/libssh2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.11.0": + sha256: 3736161e41e2693324deb38c26cfdc3efe6209d634ba4258db1cecff6a5ad461 + url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.11.0/libssh2-1.11.0.tar.gz "1.10.0": sha256: 2d64e90f3ded394b91d3a2e774ca203a4179f69aebee03003e5a6fa621e41d51 url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.10.0/libssh2-1.10.0.tar.gz @@ -11,16 +14,3 @@ sources: "1.8.0": sha256: 39f34e2f6835f4b992cafe8625073a88e5a28ba78f83e8099610a7b3af4676d4 url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.8.0/libssh2-1.8.0.tar.gz -patches: - "1.10.0": - - patch_file: "patches/0001-threads.patch" - base_path: "source_subfolder" - "1.9.0": - - patch_file: "patches/0001-threads.patch" - base_path: "source_subfolder" - "1.8.2": - - patch_file: "patches/0001-threads.patch" - base_path: "source_subfolder" - "1.8.0": - - patch_file: "patches/0001-threads.patch" - base_path: "source_subfolder" diff --git a/recipes/libssh2/all/conanfile.py b/recipes/libssh2/all/conanfile.py index bb49ef120e615..eb8b1cad9c233 100644 --- a/recipes/libssh2/all/conanfile.py +++ b/recipes/libssh2/all/conanfile.py @@ -1,8 +1,11 @@ -from conans import ConanFile, CMake, tools -import functools +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, collect_libs +from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class Libssh2Conan(ConanFile): @@ -12,7 +15,7 @@ class Libssh2Conan(ConanFile): homepage = "https://libssh2.org" topics = ("libssh", "ssh", "shell", "ssh2", "connection") license = "BSD-3-Clause" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -33,16 +36,36 @@ class Libssh2Conan(ConanFile): "enable_debug_logging": False, } - generators = "cmake", "cmake_find_package" + def export_sources(self): + export_conandata_patches(self) - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + cmake_layout(self, src_folder="src") - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["ENABLE_ZLIB_COMPRESSION"] = self.options.with_zlib + tc.cache_variables["ENABLE_CRYPT_NONE"] = self.options.enable_crypt_none + tc.cache_variables["ENABLE_MAC_NONE"] = self.options.enable_mac_none + tc.cache_variables["ENABLE_DEBUG_LOGGING"] = self.options.enable_debug_logging + if self.options.crypto_backend == "openssl": + tc.cache_variables["CRYPTO_BACKEND"] = "OpenSSL" + tc.cache_variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + elif self.options.crypto_backend == "mbedtls": + tc.cache_variables["CRYPTO_BACKEND"] = "mbedTLS" + tc.cache_variables["BUILD_EXAMPLES"] = False + tc.cache_variables['BUILD_TESTING'] = not self.conf.get("tools.build:skip_test", default=True, check_type=bool) + tc.cache_variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + # To install relocatable shared lib on Macos by default + tc.variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Workaround until github.com/conan-io/conan/pull/12600 is merged + if is_msvc(self): + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def config_options(self): if self.settings.os == "Windows": @@ -50,68 +73,44 @@ 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") + # This is a pure C library + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/1.2.13") if self.options.crypto_backend == "openssl": - self.requires("openssl/1.1.1q") + self.requires("openssl/[>=1.1 <4]") elif self.options.crypto_backend == "mbedtls": # libssh2/<=1.10.0 doesn't support mbedtls/3.x.x self.requires("mbedtls/2.25.0") 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) + apply_conandata_patches(self) - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)", - "list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)") - - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): cmake = CMake(self) - cmake.definitions["ENABLE_ZLIB_COMPRESSION"] = self.options.with_zlib - cmake.definitions["ENABLE_CRYPT_NONE"] = self.options.enable_crypt_none - cmake.definitions["ENABLE_MAC_NONE"] = self.options.enable_mac_none - cmake.definitions["ENABLE_DEBUG_LOGGING"] = self.options.enable_debug_logging - if self.options.crypto_backend == "openssl": - cmake.definitions["CRYPTO_BACKEND"] = "OpenSSL" - cmake.definitions["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath - elif self.options.crypto_backend == "mbedtls": - cmake.definitions["CRYPTO_BACKEND"] = "mbedTLS" - cmake.definitions["BUILD_EXAMPLES"] = False - cmake.definitions["BUILD_TESTING"] = False - # To install relocatable shared lib on Macos by default - cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" cmake.configure() - return cmake - - def build(self): - self._patch_sources() - cmake = self._configure_cmake() cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "share")) # only docs and manpages + 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) def package_info(self): self.cpp_info.set_property("cmake_file_name", "Libssh2") self.cpp_info.set_property("cmake_target_name", "Libssh2::libssh2") self.cpp_info.set_property("pkg_config_name", "libssh2") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["_libssh2"].libs = tools.collect_libs(self) + self.cpp_info.components["_libssh2"].libs = collect_libs(self) if self.settings.os == "Windows": self.cpp_info.components["_libssh2"].system_libs.append("ws2_32") elif self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/libssh2/all/test_package/CMakeLists.txt b/recipes/libssh2/all/test_package/CMakeLists.txt index dfda6b6e8ad0d..92f94a36409ed 100644 --- a/recipes/libssh2/all/test_package/CMakeLists.txt +++ b/recipes/libssh2/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(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) find_package(Libssh2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} Libssh2::libssh2) +target_link_libraries(${PROJECT_NAME} PRIVATE Libssh2::libssh2) diff --git a/recipes/libssh2/all/test_package/conanfile.py b/recipes/libssh2/all/test_package/conanfile.py index 49a3a66ea5bad..a9bc449b529dc 100644 --- a/recipes/libssh2/all/test_package/conanfile.py +++ b/recipes/libssh2/all/test_package/conanfile.py @@ -1,17 +1,26 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) cmake.configure() cmake.build() + def layout(self): + cmake_layout(self) + def test(self): - if 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/libssh2/config.yml b/recipes/libssh2/config.yml index 42bce17ced607..3cada2e5e398c 100644 --- a/recipes/libssh2/config.yml +++ b/recipes/libssh2/config.yml @@ -1,4 +1,6 @@ versions: + "1.11.0": + folder: all "1.10.0": folder: all "1.9.0": diff --git a/recipes/libsystemd/all/conandata.yml b/recipes/libsystemd/all/conandata.yml index 8c721280d7274..d4431fac17cc4 100644 --- a/recipes/libsystemd/all/conandata.yml +++ b/recipes/libsystemd/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "253.6": + url: "https://github.com/systemd/systemd-stable/archive/v253.6.tar.gz" + sha256: "a0aebcfaa2e001a4d846691631d1722c4cfa1a175e4ea62db6edca0ea3cf1e3e" "253.3": url: "https://github.com/systemd/systemd-stable/archive/v253.3.tar.gz" sha256: "569775d77084e45d15e103004cf4fbc00d7249c33791471b80f0c3296962bbfd" @@ -21,6 +24,13 @@ sources: url: "https://github.com/systemd/systemd-stable/archive/v246.16.tar.gz" sha256: "b69f9940d65870f090269a28f1047a633d4b80d0001e091d53a031dd40a822d2" patches: + "253.6": + - patch_file: "patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch" + patch_description: "allow to use meson.build with older versions of Python by replacing utf8 message to ascii message in the helper script" + patch_type: "conan" + - patch_file: "patches/251.15/0001-Remove-dependency-from-coreutils.patch" + patch_description: "allow to build in environments without 'realpath --relative-to' by replacing it with conan-specific build variable" + patch_type: "conan" "253.3": - patch_file: "patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch" patch_description: "allow to use meson.build with older versions of Python by replacing utf8 message to ascii message in the helper script" diff --git a/recipes/libsystemd/all/conanfile.py b/recipes/libsystemd/all/conanfile.py index 17ae41f5c8e6a..7d0c3d3c0590f 100644 --- a/recipes/libsystemd/all/conanfile.py +++ b/recipes/libsystemd/all/conanfile.py @@ -53,7 +53,9 @@ def layout(self): def requirements(self): self.requires("libcap/2.68") - self.requires("libmount/2.36.2") + self.requires("libmount/2.39") + if Version(self.version) >= "253.6": + self.requires("libxcrypt/4.4.35") if self.options.with_selinux: self.requires("libselinux/3.3") if self.options.with_lz4: @@ -68,7 +70,7 @@ def validate(self): raise ConanInvalidConfiguration("Only Linux supported") def build_requirements(self): - self.tool_requires("meson/1.1.0") + self.tool_requires("meson/1.1.1") 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): diff --git a/recipes/libsystemd/config.yml b/recipes/libsystemd/config.yml index 83bb58c5a15a2..f584486360691 100644 --- a/recipes/libsystemd/config.yml +++ b/recipes/libsystemd/config.yml @@ -1,4 +1,6 @@ versions: + "253.6": + folder: all "253.3": folder: all "252.9": diff --git a/recipes/libtiff/all/conandata.yml b/recipes/libtiff/all/conandata.yml index a3b0e93e72a46..cc7431489956e 100644 --- a/recipes/libtiff/all/conandata.yml +++ b/recipes/libtiff/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.5.1": + url: "http://download.osgeo.org/libtiff/tiff-4.5.1.tar.gz" + sha256: "d7f38b6788e4a8f5da7940c5ac9424f494d8a79eba53d555f4a507167dca5e2b" "4.5.0": url: "http://download.osgeo.org/libtiff/tiff-4.5.0.tar.gz" sha256: "c7a1d9296649233979fa3eacffef3fa024d73d05d589cb622727b5b08c423464" @@ -8,19 +11,11 @@ sources: "4.3.0": url: "http://download.osgeo.org/libtiff/tiff-4.3.0.tar.gz" sha256: "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8" - "4.2.0": - url: "http://download.osgeo.org/libtiff/tiff-4.2.0.tar.gz" - sha256: "eb0484e568ead8fa23b513e9b0041df7e327f4ee2d22db5a533929dfc19633cb" - "4.1.0": - url: "http://download.osgeo.org/libtiff/tiff-4.1.0.tar.gz" - sha256: "5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634" - "4.0.9": - url: "http://download.osgeo.org/libtiff/tiff-4.0.9.tar.gz" - sha256: "6e7bdeec2c310734e734d19aae3a71ebe37a4d842e0e23dbb1b8921c0026cfcd" - "4.0.8": - url: "http://download.osgeo.org/libtiff/tiff-4.0.8.tar.gz" - sha256: "59d7a5a8ccd92059913f246877db95a2918e6c04fb9d43fd74e5c3390dac2910" patches: + "4.5.1": + - patch_file: "patches/4.5.1-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" "4.5.0": - patch_file: "patches/4.5.0-0001-cmake-dependencies.patch" patch_description: "CMake: robust handling of dependencies" @@ -33,35 +28,3 @@ patches: - patch_file: "patches/4.3.0-0001-cmake-dependencies.patch" patch_description: "CMake: robust handling of dependencies" patch_type: "conan" - "4.2.0": - - patch_file: "patches/4.2.0-0001-cmake-dependencies.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "conan" - "4.1.0": - - patch_file: "patches/4.1.0-0001-cmake-dependencies.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "conan" - - patch_file: "patches/4.1.0-0002-no-libm-mingw.patch" - patch_description: "port to MINGW: Exclude libm from MINGW since math related functions are already included in libmsvcrt.a" - patch_type: "portability" - patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" - "4.0.9": - - patch_file: "patches/4.0.8-0001-cmake-dependencies.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "conan" - - patch_file: "patches/4.0.8-0002-no-libm-mingw.patch" - patch_description: "port to MINGW: Exclude libm from MINGW since math related functions are already included in libmsvcrt.a" - patch_type: "portability" - patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" - "4.0.8": - - patch_file: "patches/4.0.8-0001-cmake-dependencies.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "conan" - - patch_file: "patches/4.0.8-0002-no-libm-mingw.patch" - patch_description: "port to MINGW: Exclude libm from MINGW since math related functions are already included in libmsvcrt.a" - patch_type: "portability" - patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" - - patch_file: "patches/4.0.8-0003-file-offsets-bits-mingw.patch" - patch_description: "port to MINGW: enable Large file support by defining _FILE_OFFSET_BITS=64" - patch_type: "portability" - patch_source: "https://gitlab.com/libtiff/libtiff/-/commit/f2a3b020402943f90957552a884788e70ece6cd7" diff --git a/recipes/libtiff/all/conanfile.py b/recipes/libtiff/all/conanfile.py index 9d78f893c2d31..6305fc3fa4a6f 100644 --- a/recipes/libtiff/all/conanfile.py +++ b/recipes/libtiff/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os @@ -44,30 +44,12 @@ class LibtiffConan(ConanFile): "cxx": True, } - @property - def _has_webp_option(self): - return Version(self.version) >= "4.0.10" - - @property - def _has_zstd_option(self): - return Version(self.version) >= "4.0.10" - - @property - def _has_libdeflate_option(self): - return Version(self.version) >= "4.2.0" - def export_sources(self): export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if not self._has_webp_option: - del self.options.webp - if not self._has_zstd_option: - del self.options.zstd - if not self._has_libdeflate_option: - del self.options.libdeflate def configure(self): if self.options.shared: @@ -82,7 +64,7 @@ def layout(self): def requirements(self): if self.options.zlib: self.requires("zlib/1.2.13") - if self.options.get_safe("libdeflate"): + if self.options.libdeflate: self.requires("libdeflate/1.18") if self.options.lzma: self.requires("xz_utils/5.4.2") @@ -94,15 +76,20 @@ def requirements(self): self.requires("mozjpeg/4.1.1") if self.options.jbig: self.requires("jbig/20160605") - if self.options.get_safe("zstd"): + if self.options.zstd: self.requires("zstd/1.5.5") - if self.options.get_safe("webp"): - self.requires("libwebp/1.3.0") + if self.options.webp: + self.requires("libwebp/1.3.1") def validate(self): - if self.options.get_safe("libdeflate") and not self.options.zlib: + if self.options.libdeflate and not self.options.zlib: raise ConanInvalidConfiguration("libtiff:libdeflate=True requires libtiff:zlib=True") + def build_requirements(self): + if Version(self.version) >= "4.5.1": + # https://github.com/conan-io/conan/issues/3482#issuecomment-662284561 + self.tool_requires("cmake/[>=3.18 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -113,14 +100,10 @@ def generate(self): tc.variables["jpeg12"] = False tc.variables["jbig"] = self.options.jbig tc.variables["zlib"] = self.options.zlib - if self._has_libdeflate_option: - tc.variables["libdeflate"] = self.options.libdeflate - if self._has_zstd_option: - tc.variables["zstd"] = self.options.zstd - if self._has_webp_option: - tc.variables["webp"] = self.options.webp - if Version(self.version) >= "4.3.0": - tc.variables["lerc"] = False # TODO: add lerc support for libtiff versions >= 4.3.0 + tc.variables["libdeflate"] = self.options.libdeflate + tc.variables["zstd"] = self.options.zstd + tc.variables["webp"] = self.options.webp + tc.variables["lerc"] = False # TODO: add lerc support for libtiff versions >= 4.3.0 if Version(self.version) >= "4.5.0": # Disable tools, test, contrib, man & html generation tc.variables["tiff-tools"] = False @@ -130,13 +113,23 @@ def generate(self): tc.variables["cxx"] = self.options.cxx # BUILD_SHARED_LIBS must be set in command line because defined upstream before project() tc.cache_variables["BUILD_SHARED_LIBS"] = bool(self.options.shared) + tc.cache_variables["CMAKE_FIND_PACKAGE_PREFER_CONFIG"] = True tc.generate() deps = CMakeDeps(self) + if Version(self.version) >= "4.5.1": + deps.set_property("jbig", "cmake_target_name", "JBIG::JBIG") + deps.set_property("xz_utils", "cmake_target_name", "liblzma::liblzma") + deps.set_property("libdeflate", "cmake_file_name", "Deflate") + deps.set_property("libdeflate", "cmake_target_name", "Deflate::Deflate") deps.generate() def _patch_sources(self): apply_conandata_patches(self) + # remove FindXXXX for conan dependencies + for module in ["Deflate", "JBIG", "JPEG", "LERC", "WebP", "ZSTD", "liblzma", "LibLZMA"]: + rm(self, f"Find{module}.cmake", os.path.join(self.source_folder, "cmake")) + # Export symbols of tiffxx for msvc shared replace_in_file(self, os.path.join(self.source_folder, "libtiff", "CMakeLists.txt"), "set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})", @@ -177,7 +170,7 @@ def package_info(self): self.cpp_info.requires = [] if self.options.zlib: self.cpp_info.requires.append("zlib::zlib") - if self.options.get_safe("libdeflate"): + if self.options.libdeflate: self.cpp_info.requires.append("libdeflate::libdeflate") if self.options.lzma: self.cpp_info.requires.append("xz_utils::xz_utils") @@ -189,9 +182,9 @@ def package_info(self): self.cpp_info.requires.append("mozjpeg::libjpeg") if self.options.jbig: self.cpp_info.requires.append("jbig::jbig") - if self.options.get_safe("zstd"): + if self.options.zstd: self.cpp_info.requires.append("zstd::zstd") - if self.options.get_safe("webp"): + if self.options.webp: self.cpp_info.requires.append("libwebp::libwebp") # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed diff --git a/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch deleted file mode 100644 index 7b7979045b5a1..0000000000000 --- a/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -544,12 +544,10 @@ endif() - option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) - if (jbig) - set(JBIG_FOUND 0) -- find_path(JBIG_INCLUDE_DIR jbig.h) -- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) -- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) -- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) -+ find_package(jbig REQUIRED CONFIG) -+ if (1) - set(JBIG_FOUND 1) -- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) -+ set(JBIG_LIBRARIES jbig::jbig) - endif() - endif() - set(JBIG_SUPPORT 0) -@@ -564,7 +562,7 @@ set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) - set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARY}) --check_function_exists(jbg_newlen HAVE_JBG_NEWLEN) -+set(HAVE_JBG_NEWLEN TRUE) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - -@@ -701,8 +699,8 @@ endif() - if(ZLIB_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES}) - endif() --if(JPEG_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) -+if(JPEG_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) - endif() - if(JPEG12_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch b/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch deleted file mode 100644 index 216911511380b..0000000000000 --- a/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -206,7 +206,9 @@ else() - endif() - - # Find libm, if available --find_library(M_LIBRARY m) -+if (NOT MINGW) -+ find_library(M_LIBRARY m) -+endif() - - check_include_file(assert.h HAVE_ASSERT_H) - check_include_file(dlfcn.h HAVE_DLFCN_H) diff --git a/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch b/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch deleted file mode 100644 index 44a861121db9c..0000000000000 --- a/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -469,7 +469,7 @@ report_values(CMAKE_HOST_SYSTEM_PROCESSOR HOST_FILLORDER - HOST_BIG_ENDIAN HAVE_IEEEFP) - - # Large file support --if (UNIX) -+if (UNIX OR MINGW) - # This might not catch every possibility catered for by - # AC_SYS_LARGEFILE. - add_definitions(-D_FILE_OFFSET_BITS=64) diff --git a/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch deleted file mode 100644 index b8a3ec4a4b033..0000000000000 --- a/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch +++ /dev/null @@ -1,85 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -489,12 +489,10 @@ endif() - option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) - if (jbig) - set(JBIG_FOUND 0) -- find_path(JBIG_INCLUDE_DIR jbig.h) -- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) -- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) -- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) -+ find_package(jbig REQUIRED CONFIG) -+ if (1) - set(JBIG_FOUND 1) -- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) -+ set(JBIG_LIBRARIES jbig::jbig) - endif() - endif() - set(JBIG_SUPPORT 0) -@@ -507,7 +505,7 @@ endif() - - set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) --check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) -+set(HAVE_JBG_NEWLEN TRUE) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - - # liblzma2 -@@ -523,13 +521,11 @@ endif() - # libzstd - option(zstd "use libzstd (required for ZSTD compression)" ON) - if (zstd) -- find_path(ZSTD_INCLUDE_DIR zstd.h) -- find_library(ZSTD_LIBRARY NAMES zstd) -- if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY) -- check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH) -+ find_package(zstd REQUIRED CONFIG) -+ if (1) -+ set(ZSTD_RECENT_ENOUGH TRUE) - if (ZSTD_RECENT_ENOUGH) - set(ZSTD_FOUND TRUE) -- set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) - message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}") - else () - message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0") -@@ -544,15 +540,13 @@ endif() - # libwebp - option(webp "use libwebp (required for WEBP compression)" ON) - if (webp) -- find_path(WEBP_INCLUDE_DIR /webp/decode.h) -- find_library(WEBP_LIBRARY NAMES webp) -+ find_package(WebP REQUIRED CONFIG) - endif() - set(WEBP_SUPPORT 0) --set(WEBP_FOUND FALSE) --if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY) -+if (WebP_FOUND) - set(WEBP_SUPPORT 1) - set(WEBP_FOUND TRUE) -- set(WEBP_LIBRARIES ${WEBP_LIBRARY}) -+ set(WEBP_LIBRARIES WebP::webp) - message(STATUS "Found WEBP library: ${WEBP_LIBRARY}") - endif() - -@@ -681,8 +675,8 @@ endif() - if(ZLIB_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES}) - endif() --if(JPEG_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) -+if(JPEG_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) - endif() - if(JPEG12_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) -@@ -693,8 +687,8 @@ endif() - if(LIBLZMA_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES}) - endif() --if(ZSTD_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES}) -+if(ZSTD_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS $,zstd::libzstd_shared,zstd::libzstd_static>) - endif() - if(WEBP_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch b/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch deleted file mode 100644 index 0fcf8f5711810..0000000000000 --- a/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -207,7 +207,9 @@ else() - endif() - - # Find libm, if available --find_library(M_LIBRARY m) -+if (NOT MINGW) -+ find_library(M_LIBRARY m) -+endif() - - check_include_file(assert.h HAVE_ASSERT_H) - check_include_file(dlfcn.h HAVE_DLFCN_H) diff --git a/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch deleted file mode 100644 index 7b04f533eb0f4..0000000000000 --- a/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch +++ /dev/null @@ -1,102 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -463,12 +463,10 @@ set(ZIP_SUPPORT ${ZLIB_SUPPORT}) - option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ON) - if (libdeflate) - set(DEFLATE_FOUND 0) -- find_path(DEFLATE_INCLUDE_DIR libdeflate.h) -- set(DEFLATE_NAMES ${DEFLATE_NAMES} deflate) -- find_library(DEFLATE_LIBRARY NAMES ${DEFLATE_NAMES}) -- if (DEFLATE_INCLUDE_DIR AND DEFLATE_LIBRARY) -+ find_package(libdeflate REQUIRED CONFIG) -+ if (1) - set(DEFLATE_FOUND 1) -- set(DEFLATE_LIBRARIES ${DEFLATE_LIBRARY}) -+ set(DEFLATE_LIBRARIES $,libdeflate::libdeflate,libdeflate::libdeflate_static>) - endif() - endif() - set(LIBDEFLATE_SUPPORT FALSE) -@@ -517,12 +515,10 @@ endif() - option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) - if (jbig) - set(JBIG_FOUND 0) -- find_path(JBIG_INCLUDE_DIR jbig.h) -- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) -- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) -- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) -+ find_package(jbig REQUIRED CONFIG) -+ if (1) - set(JBIG_FOUND 1) -- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) -+ set(JBIG_LIBRARIES jbig::jbig) - endif() - endif() - set(JBIG_SUPPORT 0) -@@ -535,7 +531,7 @@ endif() - - set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) --check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) -+set(HAVE_JBG_NEWLEN TRUE) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - - # liblzma2 -@@ -551,14 +547,11 @@ endif() - # libzstd - option(zstd "use libzstd (required for ZSTD compression)" ON) - if (zstd) -- find_path(ZSTD_INCLUDE_DIR zstd.h) -- find_library(ZSTD_LIBRARY NAMES zstd) -- if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY) -- check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH) -+ find_package(zstd REQUIRED CONFIG) -+ if (1) -+ set(ZSTD_RECENT_ENOUGH TRUE) - if (ZSTD_RECENT_ENOUGH) - set(ZSTD_FOUND TRUE) -- set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) -- message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}") - else () - message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0") - endif () -@@ -572,15 +565,13 @@ endif() - # libwebp - option(webp "use libwebp (required for WEBP compression)" ON) - if (webp) -- find_path(WEBP_INCLUDE_DIR /webp/decode.h) -- find_library(WEBP_LIBRARY NAMES webp) -+ find_package(WebP REQUIRED CONFIG) - endif() - set(WEBP_SUPPORT 0) --set(WEBP_FOUND FALSE) --if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY) -+if (WebP_FOUND) - set(WEBP_SUPPORT 1) - set(WEBP_FOUND TRUE) -- set(WEBP_LIBRARIES ${WEBP_LIBRARY}) -+ set(WEBP_LIBRARIES WebP::webp) - message(STATUS "Found WEBP library: ${WEBP_LIBRARY}") - endif() - -@@ -715,8 +706,8 @@ endif() - if(DEFLATE_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${DEFLATE_LIBRARIES}) - endif() --if(JPEG_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) -+if(JPEG_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) - endif() - if(JPEG12_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) -@@ -727,8 +718,8 @@ endif() - if(LIBLZMA_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES}) - endif() --if(ZSTD_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES}) -+if(ZSTD_FOUND) -+ list(APPEND TIFF_LIBRARY_DEPS $,zstd::libzstd_shared,zstd::libzstd_static>) - endif() - if(WEBP_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.5.1-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.5.1-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..761950e496109 --- /dev/null +++ b/recipes/libtiff/all/patches/4.5.1-0001-cmake-dependencies.patch @@ -0,0 +1,31 @@ +diff --git a/cmake/JPEGCodec.cmake b/cmake/JPEGCodec.cmake +index 8455a3ec..09fe975a 100644 +--- a/cmake/JPEGCodec.cmake ++++ b/cmake/JPEGCodec.cmake +@@ -42,25 +42,7 @@ endif() + if (JPEG_SUPPORT) + # Check for jpeg12_read_scanlines() which has been added in libjpeg-turbo 2.2 + # for dual 8/12 bit mode. +- include(CheckCSourceCompiles) +- include(CMakePushCheckState) +- cmake_push_check_state(RESET) +- set(CMAKE_REQUIRED_INCLUDES "${JPEG_INCLUDE_DIRS}") +- set(CMAKE_REQUIRED_LIBRARIES "${JPEG_LIBRARIES}") +- check_c_source_compiles( +- " +- #include +- #include +- #include \"jpeglib.h\" +- int main() +- { +- jpeg_read_scanlines(0,0,0); +- jpeg12_read_scanlines(0,0,0); +- return 0; +- } +- " +- HAVE_JPEGTURBO_DUAL_MODE_8_12) +- cmake_pop_check_state() ++ set(HAVE_JPEGTURBO_DUAL_MODE_8_12 FALSE) + endif() + + if (NOT HAVE_JPEGTURBO_DUAL_MODE_8_12) diff --git a/recipes/libtiff/config.yml b/recipes/libtiff/config.yml index bbe65356cc08b..961a315dc8eb6 100644 --- a/recipes/libtiff/config.yml +++ b/recipes/libtiff/config.yml @@ -1,15 +1,9 @@ versions: + "4.5.1": + folder: all "4.5.0": folder: all "4.4.0": folder: all "4.3.0": folder: all - "4.2.0": - folder: all - "4.1.0": - folder: all - "4.0.9": - folder: all - "4.0.8": - folder: all diff --git a/recipes/libunwind/all/conandata.yml b/recipes/libunwind/all/conandata.yml index 3379c640096e5..933dd5e18e6e0 100644 --- a/recipes/libunwind/all/conandata.yml +++ b/recipes/libunwind/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.7.0": + url: "https://github.com/libunwind/libunwind/releases/download/v1.7.0/libunwind-1.70.tar.gz" + sha256: "c24c913d2337d6eff851b6ab32aadfb683a86fee48d28fe1fc9cd56c8e9dfa58" "1.6.2": url: "https://github.com/libunwind/libunwind/releases/download/v1.6.2/libunwind-1.6.2.tar.gz" sha256: "4a6aec666991fb45d0889c44aede8ad6eb108071c3554fcdff671f9c94794976" diff --git a/recipes/libunwind/all/conanfile.py b/recipes/libunwind/all/conanfile.py index dd6ce3246217b..bf9a535448738 100644 --- a/recipes/libunwind/all/conanfile.py +++ b/recipes/libunwind/all/conanfile.py @@ -53,7 +53,7 @@ def layout(self): def requirements(self): if self.options.minidebuginfo: - self.requires("xz_utils/5.4.0") + self.requires("xz_utils/5.4.2") if self.options.zlibdebuginfo: self.requires("zlib/1.2.13") diff --git a/recipes/libunwind/config.yml b/recipes/libunwind/config.yml index 26cf6b32aa2bf..06062bdf41682 100644 --- a/recipes/libunwind/config.yml +++ b/recipes/libunwind/config.yml @@ -1,4 +1,6 @@ versions: + "1.7.0": + folder: all "1.6.2": folder: all "1.5.0": diff --git a/recipes/libuv/all/conandata.yml b/recipes/libuv/all/conandata.yml index f54bb8fd1e59d..c45d8fcd3b551 100644 --- a/recipes/libuv/all/conandata.yml +++ b/recipes/libuv/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.46.0": + url: "https://github.com/libuv/libuv/archive/v1.46.0.tar.gz" + sha256: "7aa66be3413ae10605e1f5c9ae934504ffe317ef68ea16fdaa83e23905c681bd" "1.45.0": url: "https://github.com/libuv/libuv/archive/v1.45.0.tar.gz" sha256: "458e34d5ef7f3c0394a2bfd8c39d757cb1553baa5959b9b4b45df63aa027a228" @@ -27,6 +30,10 @@ sources: url: "https://github.com/libuv/libuv/archive/v1.38.1.zip" sha256: "0359369492742eb2a36312fffe26f80bcffe4cec981a4fd72d182b061ee14890" patches: + "1.46.0": + - patch_file: "patches/1.45.0/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" "1.45.0": - patch_file: "patches/1.45.0/fix-cmake.patch" patch_description: "separate shared and static library build" diff --git a/recipes/libuv/config.yml b/recipes/libuv/config.yml index d0dda281ae9b7..db07c8e653143 100644 --- a/recipes/libuv/config.yml +++ b/recipes/libuv/config.yml @@ -1,4 +1,6 @@ versions: + "1.46.0": + folder: all "1.45.0": folder: all "1.44.2": diff --git a/recipes/libwebp/all/conandata.yml b/recipes/libwebp/all/conandata.yml index ac9853ed7cd15..b036ea65e6055 100644 --- a/recipes/libwebp/all/conandata.yml +++ b/recipes/libwebp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.1": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.1.tar.gz" + sha256: "b3779627c2dfd31e3d8c4485962c2efe17785ef975e2be5c8c0c9e6cd3c4ef66" "1.3.0": url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.0.tar.gz" sha256: "64ac4614db292ae8c5aa26de0295bf1623dbb3985054cb656c55e67431def17c" @@ -24,6 +27,10 @@ sources: url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.3.tar.gz" sha256: "e20a07865c8697bba00aebccc6f54912d6bc333bb4d604e6b07491c1a226b34f" patches: + "1.3.1": + - patch_file: "patches/1.3.1-0001-fix-cmake.patch" + patch_description: "disable PIC, disable prefix library name on MSVC" + patch_type: "conan" "1.3.0": - patch_file: "patches/1.3.0-0001-fix-cmake.patch" patch_description: "disable PIC, disable prefix library name on MSVC" diff --git a/recipes/libwebp/all/patches/1.3.1-0001-fix-cmake.patch b/recipes/libwebp/all/patches/1.3.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..72ee3a1218366 --- /dev/null +++ b/recipes/libwebp/all/patches/1.3.1-0001-fix-cmake.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad5e14c3..89c836f3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,7 +58,6 @@ if(WEBP_LINK_STATIC) + else() + set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + endif() +- set(CMAKE_POSITION_INDEPENDENT_CODE ON) + # vwebp does not compile on Ubuntu with static libraries so disabling it for + # now. + set(WEBP_BUILD_VWEBP OFF) +@@ -153,7 +152,7 @@ endif() + set(PTHREAD_LIBS ${CMAKE_THREAD_LIBS_INIT}) + set(INSTALLED_LIBRARIES) + +-if(MSVC) ++if(0) + # match the naming convention used by nmake + set(webp_libname_prefix "lib") + set(CMAKE_SHARED_LIBRARY_PREFIX "${webp_libname_prefix}") diff --git a/recipes/libwebp/config.yml b/recipes/libwebp/config.yml index df097a6cc668f..3bf80d4385ecd 100644 --- a/recipes/libwebp/config.yml +++ b/recipes/libwebp/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.1": + folder: all "1.3.0": folder: all "1.2.4": diff --git a/recipes/linux-headers-generic/all/conanfile.py b/recipes/linux-headers-generic/all/conanfile.py index 32a14abb318da..8179bf6408f18 100644 --- a/recipes/linux-headers-generic/all/conanfile.py +++ b/recipes/linux-headers-generic/all/conanfile.py @@ -1,22 +1,29 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.files import chdir, copy, get +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" class LinuxHeadersGenericConan(ConanFile): name = "linux-headers-generic" + description = "Generic Linux kernel headers" + license = "GPL-2.0-only" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.kernel.org/" - license = "GPL-2.0-only" - description = "Generic Linux kernel headers" - topics = ("linux", "headers", "generic") - settings = "os", "arch", "build_type", "compiler" + topics = ("linux", "headers", "generic", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): del self.info.settings.os @@ -26,18 +33,29 @@ def package_id(self): def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration("linux-headers-generic supports only Linux") - if hasattr(self, "settings_build") and tools.cross_building(self): + if hasattr(self, "settings_build") and cross_building(self): raise ConanInvalidConfiguration("linux-headers-generic can not be cross-compiled") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() def build(self): - with tools.chdir(os.path.join(self._source_subfolder)): - autotools = AutoToolsBuildEnvironment(self) + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.make(target="headers") def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - self.copy("include/*.h", src=os.path.join(self._source_subfolder, "usr")) + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "include/*.h", + dst=self.package_folder, + src=os.path.join(self.source_folder, "usr")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/linux-headers-generic/all/test_package/CMakeLists.txt b/recipes/linux-headers-generic/all/test_package/CMakeLists.txt index 34af13462f44f..486ec186a2730 100644 --- a/recipes/linux-headers-generic/all/test_package/CMakeLists.txt +++ b/recipes/linux-headers-generic/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(linux-headers-generic REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE linux-headers-generic::linux-headers-generic) diff --git a/recipes/linux-headers-generic/all/test_package/conanfile.py b/recipes/linux-headers-generic/all/test_package/conanfile.py index 92074169bcc74..fae501d0afb9e 100644 --- a/recipes/linux-headers-generic/all/test_package/conanfile.py +++ b/recipes/linux-headers-generic/all/test_package/conanfile.py @@ -1,11 +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 -required_conan_version = ">=1.33.0" class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/logr/0.1.0/CMakeLists.txt b/recipes/logr/0.1.0/CMakeLists.txt deleted file mode 100644 index c21cb501798d1..0000000000000 --- a/recipes/logr/0.1.0/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder/logr) diff --git a/recipes/logr/0.1.0/conandata.yml b/recipes/logr/0.1.0/conandata.yml index 368303bc2a36c..bd261e654fa90 100644 --- a/recipes/logr/0.1.0/conandata.yml +++ b/recipes/logr/0.1.0/conandata.yml @@ -2,3 +2,8 @@ sources: "0.1.0": url: "https://github.com/ngrodzitski/logr/archive/v0.1.0.tar.gz" sha256: "6b2e68b6425362f678b7485cd2c8cef7db377ac8ccd45646c84941b189b0b82d" +patches: + "0.1.0": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "correct the order of cmake min and project" + patch_type: "conan" diff --git a/recipes/logr/0.1.0/conanfile.py b/recipes/logr/0.1.0/conanfile.py index a3500eef56a0a..967c8e88b68f9 100644 --- a/recipes/logr/0.1.0/conanfile.py +++ b/recipes/logr/0.1.0/conanfile.py @@ -1,97 +1,104 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.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 +required_conan_version = ">=1.53.0" + class LogrConan(ConanFile): name = "logr" - license = "BSD 3-Clause License" - homepage = "https://github.com/ngrodzitski/logr" - url = "https://github.com/conan-io/conan-center-index" description = "Logger frontend substitution for spdlog, glog, etc for server/desktop applications" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ngrodzitski/logr" topics = ("logger", "development", "util", "utils") - generators = "cmake" - settings = "os", "compiler", "build_type", "arch" - exports_sources = ["CMakeLists.txt"] - - options = { "backend": ["spdlog", "glog", "log4cplus", "log4cplus-unicode", None] } - default_options = { "backend": "spdlog"} - - _cmake = None + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "backend": ["spdlog", "glog", "log4cplus", "log4cplus-unicode", None], + } + default_options = { + "backend": "spdlog", + } @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property - def _build_subfolder(self): - return "build_subfolder" - - def requirements(self): - self.requires("fmt/7.1.2") - - if self.options.backend == "spdlog": - self.requires("spdlog/1.8.0") - elif self.options.backend == "glog": - self.requires("glog/0.4.0") - elif self.options.backend == "log4cplus": - self.requires("log4cplus/2.0.5") - elif self.options.backend == "log4cplus-unicode": - self.requires("log4cplus/2.0.5") - - def configure(self): - minimal_cpp_standard = "17" - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, minimal_cpp_standard) - minimal_version = { + def _compilers_minimum_version(self): + return { "gcc": "7", "clang": "7", "apple-clang": "10", - "Visual Studio": "16" + "Visual Studio": "16", + "msvc": "192", } - compiler = str(self.settings.compiler) - if compiler not in minimal_version: - self.output.warn( - "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) - self.output.warn( - "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) - return - - version = tools.Version(self.settings.compiler.version) - if version < minimal_version[compiler]: - raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + def export_sources(self): + export_conandata_patches(self) - def _configure_cmake(self): - if self._cmake: - return self._cmake + def layout(self): + cmake_layout(self, src_folder="src") - self._cmake = CMake(self) - self._cmake.definitions["LOGR_WITH_SPDLOG_BACKEND"] = self.options.backend == "spdlog" - self._cmake.definitions["LOGR_WITH_GLOG_BACKEND"] = self.options.backend == "glog" - self._cmake.definitions["LOGR_WITH_LOG4CPLUS_BACKEND"] = self.options.backend in ["log4cplus", "log4cplus-unicode"] - - self._cmake.definitions["LOGR_INSTALL"] = True - - self._cmake.configure( build_folder=self._build_subfolder ) - return self._cmake - - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + def requirements(self): + self.requires("fmt/9.1.0") + if self.options.backend == "spdlog": + self.requires("spdlog/1.11.0") + elif self.options.backend == "glog": + self.requires("glog/0.6.0") + elif self.options.backend in ["log4cplus", "log4cplus-unicode"]: + self.requires("log4cplus/2.0.5") - def build(self): + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) if self.options.backend == "log4cplus" and self.options["log4cplus"].unicode: raise ConanInvalidConfiguration("backend='log4cplus' requires log4cplus:unicode=False") elif self.options.backend == "log4cplus-unicode" and not self.options["log4cplus"].unicode: raise ConanInvalidConfiguration("backend='log4cplus-unicode' requires log4cplus:unicode=True") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["LOGR_WITH_SPDLOG_BACKEND"] = self.options.backend == "spdlog" + tc.cache_variables["LOGR_WITH_GLOG_BACKEND"] = self.options.backend == "glog" + tc.cache_variables["LOGR_WITH_LOG4CPLUS_BACKEND"] = self.options.backend in ["log4cplus", "log4cplus-unicode"] + tc.cache_variables["LOGR_INSTALL"] = True + tc.cache_variables["LOGR_BUILD_TESTS"] = False + tc.cache_variables["LOGR_BUILD_EXAMPLES"] = False + tc.cache_variables["LOGR_BUILD_BENCHMARKS"] = False + tc.generate() + dpes = CMakeDeps(self) + dpes.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - 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")) + rmdir(self, os.path.join(self.package_folder, "lib")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/logr/0.1.0/patches/0001-fix-cmake.patch b/recipes/logr/0.1.0/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..e806e32f6aa85 --- /dev/null +++ b/recipes/logr/0.1.0/patches/0001-fix-cmake.patch @@ -0,0 +1,61 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e8c2ce1..be74c3d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,13 +4,6 @@ cmake_minimum_required(VERSION 3.14) + + set(logr_root_prj logr_root) + +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/cpp_standard.cmake") +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/libcxx.cmake") +-include( "${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/static_runtime.cmake" ) +- +-message(STATUS "ENABLE C++17") +-cxx_17() +- + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + + # ------------------------------------------------------------------------------ +@@ -30,8 +23,6 @@ message( STATUS "Use package manager: ${LOGR_PKG_PROVIDER}") + + + if( "${logr_pkg_provider_lowercase}" STREQUAL "conan" ) +- set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH}) +- set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR} ${CMAKE_PREFIX_PATH}) + elseif ( "${logr_pkg_provider_lowercase}" STREQUAL "vcpkg" ) + if( NOT CMAKE_TOOLCHAIN_FILE ) + message( FATAL_ERROR "CMAKE_TOOLCHAIN_FILE must be defined when using vcpkg") +@@ -65,18 +56,6 @@ option(LOGR_WITH_LOG4CPLUS_BACKEND "Provide logr with log4cplus backend" ON) + # ------------------------------------------------------------------------------ + + project(${logr_root_prj} CXX) +-handle_explicit_libcxx_if_necessary() +-handle_explicit_static_runtime_if_necessary() +- +-# ------------------------------------------------------------------------------ +-# Various helpers: +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/common_options.cmake") +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/compiler_flags.cmake") +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/find_program_required.cmake") +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/append_src_files.cmake") +-include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/link_threads_if_necessary.cmake") +-include( "${CMAKE_CURRENT_SOURCE_DIR}/cmake-scripts/static_analysis.cmake" ) +-# ------------------------------------------------------------------------------ + + # ------------------------------------------------------------------------------ + # A piece to define hint for pretty source files paths. +@@ -98,6 +77,14 @@ else () + endif () + # ------------------------------------------------------------------------------ + ++ ++message(STATUS "*** dump start cmake variables ***") ++get_cmake_property(_variableNames VARIABLES) ++foreach(_variableName ${_variableNames}) ++ message(STATUS "${_variableName}=${${_variableName}}") ++endforeach() ++message(STATUS "*** dump end ***") ++ + find_package(fmt REQUIRED) + + if (LOGR_WITH_SPDLOG_BACKEND) diff --git a/recipes/logr/0.1.0/test_package/CMakeLists.txt b/recipes/logr/0.1.0/test_package/CMakeLists.txt index cd3eca474d6d3..f0b27f088f57f 100644 --- a/recipes/logr/0.1.0/test_package/CMakeLists.txt +++ b/recipes/logr/0.1.0/test_package/CMakeLists.txt @@ -1,13 +1,8 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) +find_package(logr REQUIRED CONFIG) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE logr::logr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logr/0.1.0/test_package/conanfile.py b/recipes/logr/0.1.0/test_package/conanfile.py index b862d3bd0137e..ef5d7042163ec 100644 --- a/recipes/logr/0.1.0/test_package/conanfile.py +++ b/recipes/logr/0.1.0/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" -class LogrTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/logr/0.1.0/test_package/example.cpp b/recipes/logr/0.1.0/test_package/test_package.cpp similarity index 91% rename from recipes/logr/0.1.0/test_package/example.cpp rename to recipes/logr/0.1.0/test_package/test_package.cpp index e80e0e10f0233..de16c1837fbb2 100644 --- a/recipes/logr/0.1.0/test_package/example.cpp +++ b/recipes/logr/0.1.0/test_package/test_package.cpp @@ -1,5 +1,4 @@ -#include - +#include #include #include @@ -22,7 +21,7 @@ int main() auto logger = make_logger(); logger.info( []( auto & out ){ - fmt::format_to( out, + format_to( std::back_inserter(out), "Welcome to logr (v{}.{}.{}), package is provided by Conan!", LOGR_VERSION_MAJOR, LOGR_VERSION_MINOR, diff --git a/recipes/logr/all/conandata.yml b/recipes/logr/all/conandata.yml index 46dc2294ce601..3a291a696ec11 100644 --- a/recipes/logr/all/conandata.yml +++ b/recipes/logr/all/conandata.yml @@ -1,19 +1,19 @@ sources: - "0.2.0": - url: "https://github.com/ngrodzitski/logr/archive/v0.2.0.tar.gz" - sha256: "4e1707f9450f12b0752d8ef4d72a3f38a2e6be0014ca7edde049f22e9b9119a4" - "0.2.1": - url: "https://github.com/ngrodzitski/logr/archive/v0.2.1.tar.gz" - sha256: "411282bb03d678d7266951b979102392dbf7e5e14b629bccfb2c4e74cfa758c6" - "0.3.0": - url: "https://github.com/ngrodzitski/logr/archive/v0.3.0.tar.gz" - sha256: "21eea6cce32e3ccf3769f66211143b17f8b36891e79ec3ef5209f849d9e79ad7" - "0.4.0": - url: "https://github.com/ngrodzitski/logr/archive/v0.4.0.tar.gz" - sha256: "c355aa455d0a9c6d1d3bc168a2db0cd7f3c9706b382088e96948ec3a4cf1286f" - "0.5.1": - url: "https://github.com/ngrodzitski/logr/archive/v0.5.1.tar.gz" - sha256: "674be6a53d5b3f40273b1b5710ac9e32d870827032b5008c41621db47f4b3b0e" "0.6.0": url: "https://github.com/ngrodzitski/logr/archive/v0.6.0.tar.gz" sha256: "2ecb40396add33f2120a79957633533381f3df13cb3b53278eb9dec3a1230eb2" + "0.5.1": + url: "https://github.com/ngrodzitski/logr/archive/v0.5.1.tar.gz" + sha256: "674be6a53d5b3f40273b1b5710ac9e32d870827032b5008c41621db47f4b3b0e" + "0.4.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.4.0.tar.gz" + sha256: "c355aa455d0a9c6d1d3bc168a2db0cd7f3c9706b382088e96948ec3a4cf1286f" + "0.3.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.3.0.tar.gz" + sha256: "21eea6cce32e3ccf3769f66211143b17f8b36891e79ec3ef5209f849d9e79ad7" + "0.2.1": + url: "https://github.com/ngrodzitski/logr/archive/v0.2.1.tar.gz" + sha256: "411282bb03d678d7266951b979102392dbf7e5e14b629bccfb2c4e74cfa758c6" + "0.2.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.2.0.tar.gz" + sha256: "4e1707f9450f12b0752d8ef4d72a3f38a2e6be0014ca7edde049f22e9b9119a4" diff --git a/recipes/logr/all/conanfile.py b/recipes/logr/all/conanfile.py index a5e869c032b2e..7f984ac3075da 100644 --- a/recipes/logr/all/conanfile.py +++ b/recipes/logr/all/conanfile.py @@ -12,30 +12,34 @@ class LogrConan(ConanFile): name = "logr" - license = "BSD-3-Clause" - homepage = "https://github.com/ngrodzitski/logr" - url = "https://github.com/conan-io/conan-center-index" description = ( "Logger frontend substitution for spdlog, glog, etc " "for server/desktop applications" ) + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ngrodzitski/logr" topics = ("logger", "development", "util", "utils") - - settings = "os", "compiler", "build_type", "arch" - - options = {"backend": ["spdlog", "glog", "log4cplus", "boostlog", None]} - default_options = {"backend": "spdlog"} + settings = "os", "arch", "compiler", "build_type" + options = { + "backend": ["spdlog", "glog", "log4cplus", "boostlog", None], + } + default_options = { + "backend": "spdlog", + } def layout(self): basic_layout(self, src_folder="src") def requirements(self): - if Version(self.version) >= "0.6.0": + if self.options.backend != "spdlog": + fmt_ref = "fmt/10.0.0" + elif Version(self.version) >= "0.6.0": fmt_ref = "fmt/9.1.0" spdlog_ref = "spdlog/1.11.0" else: fmt_ref = "fmt/8.1.1" - spdlog_ref = "spdlog/1.9.2" + spdlog_ref = "spdlog/1.10.0" self.requires(fmt_ref) @@ -44,9 +48,9 @@ def requirements(self): elif self.options.backend == "glog": self.requires("glog/0.6.0") elif self.options.backend == "log4cplus": - self.requires("log4cplus/2.0.5") + self.requires("log4cplus/2.1.0") elif self.options.backend == "boostlog": - self.requires("boost/1.77.0") + self.requires("boost/1.82.0") def package_id(self): self.info.settings.clear() diff --git a/recipes/logr/all/test_package/CMakeLists.txt b/recipes/logr/all/test_package/CMakeLists.txt index 866a0cc839d26..5e62d2b8b4d92 100644 --- a/recipes/logr/all/test_package/CMakeLists.txt +++ b/recipes/logr/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(logr REQUIRED) -add_executable(${PROJECT_NAME} example.cpp) -target_link_libraries(${PROJECT_NAME} logr::logr) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE logr::logr) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logr/all/test_package/conanfile.py b/recipes/logr/all/test_package/conanfile.py index a9fb96656f203..f5cf204295e19 100644 --- a/recipes/logr/all/test_package/conanfile.py +++ b/recipes/logr/all/test_package/conanfile.py @@ -3,7 +3,6 @@ from conan.tools.cmake import cmake_layout, CMake import os - class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" @@ -22,5 +21,5 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/logr/all/test_package/example.cpp b/recipes/logr/all/test_package/test_package.cpp similarity index 100% rename from recipes/logr/all/test_package/example.cpp rename to recipes/logr/all/test_package/test_package.cpp diff --git a/recipes/logr/all/test_v1_package/CMakeLists.txt b/recipes/logr/all/test_v1_package/CMakeLists.txt index 7a2102f144a4f..77c0a1e824e62 100644 --- a/recipes/logr/all/test_v1_package/CMakeLists.txt +++ b/recipes/logr/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) find_package(logr REQUIRED CONFIG) -add_executable(${PROJECT_NAME} ../test_package/example.cpp) +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) target_link_libraries(${PROJECT_NAME} logr::logr) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logr/config.yml b/recipes/logr/config.yml index 2642be9922766..71c5abd93f78c 100644 --- a/recipes/logr/config.yml +++ b/recipes/logr/config.yml @@ -1,15 +1,15 @@ versions: - "0.1.0": - folder: 0.1.0 - "0.2.0": - folder: all - "0.2.1": + "0.6.0": folder: all - "0.3.0": + "0.5.1": folder: all "0.4.0": folder: all - "0.5.1": + "0.3.0": folder: all - "0.6.0": + "0.2.1": folder: all + "0.2.0": + folder: all + "0.1.0": + folder: 0.1.0 diff --git a/recipes/loguru/all/conandata.yml b/recipes/loguru/all/conandata.yml new file mode 100644 index 0000000000000..779d9ad6aa366 --- /dev/null +++ b/recipes/loguru/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230406": + url: "https://github.com/emilk/loguru/archive/4adaa185883e3c04da25913579c451d3c32cfac1.tar.gz" + sha256: "1424f3ce814fa413e5fbdf2949994d455e3914560f958d2931ba869349a686a8" diff --git a/recipes/loguru/all/conanfile.py b/recipes/loguru/all/conanfile.py new file mode 100644 index 0000000000000..098d77e4ec8b7 --- /dev/null +++ b/recipes/loguru/all/conanfile.py @@ -0,0 +1,139 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.microsoft import is_msvc +from conan.tools.files import get, load, save, rmdir, rm +from conan.tools.build import check_min_cppstd + + +required_conan_version = ">=1.53.0" + + +class LoguruConan(ConanFile): + name = "loguru" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/emilk/loguru" + license = "Unlicense" + topics = ("logging", "log", "fmt") + description = "Loguru is a C++11 logging library." + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_fmt": [True, False], + "verbose_scope_endings": [True, False], + "redefine_assert": [True, False], + "enable_streams": [True, False], + "enable_fileabs": [True, False], + "replace_glog": [True, False], + + "scope_text_size": [None, "ANY"], + "scope_time_precision": [None, "ANY"], + "filename_width": [None, "ANY"], + "threadname_width": [None, "ANY"], + } + + default_options = { + "shared": False, + "fPIC": True, + "with_fmt": False, + "verbose_scope_endings": True, + "redefine_assert": False, + "enable_streams": False, + "enable_fileabs": False, + "replace_glog": False, + "scope_text_size": 196, + "scope_time_precision": 3, + "filename_width": 23, + "threadname_width": 16, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def requirements(self): + if self.options.with_fmt: + self.requires("fmt/9.1.0", transitive_headers=True) + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + if self.options.replace_glog and not self.options.enable_streams: + # https://github.com/emilk/loguru/blob/4adaa185883e3c04da25913579c451d3c32cfac1/docs/index.html#L692 + raise ConanInvalidConfiguration(f"{self.ref}:replace_glog needs {self.ref}:enable_streams=True") + + 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["LOGURU_USE_FMTLIB"] = self.options.with_fmt + tc.variables["LOGURU_VERBOSE_SCOPE_ENDINGS"] = self.options.verbose_scope_endings + tc.variables["LOGURU_REDEFINE_ASSERT"] = self.options.redefine_assert + tc.variables["LOGURU_WITH_STREAMS"] = self.options.enable_streams + tc.variables["LOGURU_WITH_FILEABS"] = self.options.enable_fileabs + tc.variables["LOGURU_REPLACE_GLOG"] = self.options.replace_glog + tc.variables["LOGURU_SCOPE_TEXT_SIZE"] = self.options.scope_text_size + tc.variables["LOGURU_SCOPE_TIME_PRECISION"] = self.options.scope_time_precision + tc.variables["LOGURU_FILENAME_WIDTH"] = self.options.filename_width + tc.variables["LOGURU_THREADNAME_WIDTH"] = self.options.threadname_width + if is_msvc(self) and self.options.shared: + tc.preprocessor_definitions["LOGURU_EXPORT"] = "__declspec(dllexport)" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _extracted_license(self): + tmp = load(self, os.path.join(self.source_folder, 'loguru.hpp')) + return tmp[2:tmp.find("# Inspiration", 0)].strip() + + def package(self): + save(self, os.path.join(self.package_folder, 'licenses', 'LICENSE'), self._extracted_license) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + suffix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"loguru{suffix}"] + self.cpp_info.includedirs = [os.path.join("include", "loguru")] + # https://github.com/emilk/loguru/blob/4adaa185883e3c04da25913579c451d3c32cfac1/CMakeLists.txt#L301 + self.cpp_info.set_property("cmake_file_name", "loguru") + self.cpp_info.set_property("cmake_target_name", "loguru::loguru") + + self.cpp_info.defines.append(f"LOGURU_USE_FMTLIB={self.options.with_fmt}") + self.cpp_info.defines.append(f"LOGURU_SCOPE_TEXT_SIZE={self.options.scope_text_size}") + self.cpp_info.defines.append(f"LOGURU_SCOPE_TIME_PRECISION={self.options.scope_time_precision}") + self.cpp_info.defines.append(f"LOGURU_FILENAME_WIDTH={self.options.filename_width}") + self.cpp_info.defines.append(f"LOGURU_THREADNAME_WIDTH={self.options.threadname_width}") + self.cpp_info.defines.append(f"LOGURU_VERBOSE_SCOPE_ENDINGS={self.options.verbose_scope_endings}") + self.cpp_info.defines.append(f"LOGURU_REDEFINE_ASSERT={self.options.redefine_assert}") + self.cpp_info.defines.append(f"LOGURU_WITH_STREAMS={self.options.enable_streams}") + self.cpp_info.defines.append(f"LOGURU_WITH_FILEABS={self.options.enable_fileabs}") + self.cpp_info.defines.append(f"LOGURU_REPLACE_GLOG={self.options.replace_glog}") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "dl", "m"] diff --git a/recipes/loguru/all/test_package/CMakeLists.txt b/recipes/loguru/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..aba0bad284220 --- /dev/null +++ b/recipes/loguru/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(loguru REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PUBLIC loguru::loguru) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/loguru/all/test_package/conanfile.py b/recipes/loguru/all/test_package/conanfile.py new file mode 100644 index 0000000000000..543315cd0fbb8 --- /dev/null +++ b/recipes/loguru/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/loguru/all/test_package/test_package.cpp b/recipes/loguru/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..58460d1478be0 --- /dev/null +++ b/recipes/loguru/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +// Partially taken from: https://github.com/emilk/loguru/tree/master/loguru_example + +#include +#include +#include +#include + +inline void sleep_ms(int ms) +{ + VLOG_F(2, "Sleeping for %d ms", ms); + std::this_thread::sleep_for(std::chrono::milliseconds(ms)); +} + +inline void complex_calculation() +{ + LOG_SCOPE_F(INFO, "complex_calculation"); + LOG_F(INFO, "Starting time machine..."); + LOG_F(WARNING, "The flux capacitor is not getting enough power!"); + LOG_F(INFO, "Lighting strike!"); + VLOG_F(1, "Found 1.21 gigawatts..."); +} + +int main(int argc, char *argv[]) +{ + loguru::init(argc, argv); + LOG_F(INFO, "Hello from main.cpp!"); + complex_calculation(); + LOG_F(INFO, "main function about to end!"); +} diff --git a/recipes/loguru/all/test_v1_package/CMakeLists.txt b/recipes/loguru/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/loguru/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/loguru/all/test_v1_package/conanfile.py b/recipes/loguru/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/loguru/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/loguru/config.yml b/recipes/loguru/config.yml new file mode 100644 index 0000000000000..82675897e9768 --- /dev/null +++ b/recipes/loguru/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230406": + folder: all diff --git a/recipes/luau/all/conandata.yml b/recipes/luau/all/conandata.yml index c127812d6a812..1dc4953f665e9 100644 --- a/recipes/luau/all/conandata.yml +++ b/recipes/luau/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.582": + url: "https://github.com/Roblox/luau/archive/0.582.tar.gz" + sha256: "ee6da6329e58afc956bcca907ed9c6bc0455cd580990aa73f7cfb285aea22a6d" "0.577": url: "https://github.com/Roblox/luau/archive/0.577.tar.gz" sha256: "4fd3f0d7a3bb6a9f4ed69711d261c4ae6ab6dfe8eb8e444f738c3338c559c7c8" @@ -33,6 +36,10 @@ sources: url: "https://github.com/Roblox/luau/archive/0.540.tar.gz" sha256: "84b3e52b3b0ccf4d5bc0e0c04055f3a9b2f045c1281e203a858335a6fe76b0ff" patches: + "0.582": + - patch_file: "patches/0.572-0001-fix-cmake.patch" + patch_description: "enable shared build" + patch_type: "portability" "0.577": - patch_file: "patches/0.572-0001-fix-cmake.patch" patch_description: "enable shared build" diff --git a/recipes/luau/config.yml b/recipes/luau/config.yml index 53d1e61ba8c54..8a8c09827d38e 100644 --- a/recipes/luau/config.yml +++ b/recipes/luau/config.yml @@ -1,4 +1,6 @@ versions: + "0.582": + folder: all "0.577": folder: all "0.572": diff --git a/recipes/luple/all/conandata.yml b/recipes/luple/all/conandata.yml index c2dbecf43978d..37619e3ffc243 100644 --- a/recipes/luple/all/conandata.yml +++ b/recipes/luple/all/conandata.yml @@ -2,5 +2,3 @@ sources: "1.2": - url: "https://github.com/alexpolt/luple/archive/1.2.tar.gz" sha256: "810e622b656fa4f1cae5b299db94f550262eb49c81d373cfe770edcea3e8a68b" - - url: "https://unlicense.org/UNLICENSE" - sha256: "7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c" diff --git a/recipes/luple/all/conanfile.py b/recipes/luple/all/conanfile.py index 9334773f3ff8a..2170039c6be4b 100644 --- a/recipes/luple/all/conanfile.py +++ b/recipes/luple/all/conanfile.py @@ -10,13 +10,14 @@ class LupleConan(ConanFile): name = "luple" - license = "Unlicense" + license = "Public-domain" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/alexpolt/luple" description = "Home to luple, nuple, C++ String Interning, Struct Reader and C++ Type Loophole" topics = ("loophole", "luple", "nuple", "struct", "intern") settings = "os", "arch", "compiler", "build_type" no_copy_source = True + package_type = "header-library" @property def _min_cppstd(self): @@ -57,13 +58,13 @@ def loose_lt_semver(v1, v2): def source(self): get(self, **self.conan_data["sources"][self.version][0], destination=self.source_folder, strip_root=True) - download(self, filename="LICENSE", **self.conan_data["sources"][self.version][1]) def build(self): pass def package(self): - copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + # This package doesn't have a license file, it is public domain declared in the Readme + copy(self, "README.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) copy(self, "*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) def package_info(self): diff --git a/recipes/magic_enum/all/conandata.yml b/recipes/magic_enum/all/conandata.yml index 4ecb46e8a245f..94cca110de7e5 100644 --- a/recipes/magic_enum/all/conandata.yml +++ b/recipes/magic_enum/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.3": + url: "https://github.com/Neargye/magic_enum/archive/v0.9.3.tar.gz" + sha256: "3cadd6a05f1bffc5141e5e731c46b2b73c2dbff025e723c8abaa659e0a24f072" "0.9.2": url: "https://github.com/Neargye/magic_enum/archive/v0.9.2.tar.gz" sha256: "7887d6a2dfdec65acb7a529a620b3c6f53f30cca55b419ac8ca688a089149e1a" diff --git a/recipes/magic_enum/config.yml b/recipes/magic_enum/config.yml index 5a84973326ded..469bd978f09f4 100644 --- a/recipes/magic_enum/config.yml +++ b/recipes/magic_enum/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.3": + folder: all "0.9.2": folder: all "0.9.1": diff --git a/recipes/mailio/all/conandata.yml b/recipes/mailio/all/conandata.yml index 068f2f54981f1..38e35d02a9f6f 100644 --- a/recipes/mailio/all/conandata.yml +++ b/recipes/mailio/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.23.0": + url: "https://github.com/karastojko/mailio/archive/refs/tags/0.23.0.tar.gz" + sha256: "9fc3f1f803a85170c2081cbbef2e301473a400683fc1dffefa2d6707598206a5" + "0.22.0": + url: "https://github.com/karastojko/mailio/archive/refs/tags/0.22.0.tar.gz" + sha256: "e177522f0479f33b6cbc7085268ca385140457eb752b45f07e5d6b41e314ece9" "0.21.0": url: "https://github.com/karastojko/mailio/archive/refs/tags/0.21.0.tar.gz" sha256: "8f58dfc8bcbe01224c788f22c544c27611e3c411ed5a2097488fbb32a3c0fb3d" @@ -6,6 +12,14 @@ sources: url: "https://github.com/karastojko/mailio/archive/refs/tags/0.20.0.tar.gz" sha256: "073d6b1ff891444b54a01c2a3f17074fd612f9e2e14d9ebd61863c70737b1882" patches: + "0.23.0": + - patch_file: "patches/0.23.0-adapt-cmakelists.patch" + patch_description: "fix install path" + patch_type: "conan" + "0.22.0": + - patch_file: "patches/0.22.0-adapt-cmakelists.patch" + patch_description: "fix install path" + patch_type: "conan" "0.21.0": - patch_file: "patches/0.21.0-adapt-cmakelists.patch" patch_description: "fix install path" diff --git a/recipes/mailio/all/conanfile.py b/recipes/mailio/all/conanfile.py index 67ea0faeba25f..28d892d6df1a4 100644 --- a/recipes/mailio/all/conanfile.py +++ b/recipes/mailio/all/conanfile.py @@ -57,8 +57,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0", transitive_headers=True) - self.requires("openssl/[>=1.1 <4]") + self.requires("boost/1.82.0", transitive_headers=True, transitive_libs=True) + self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True) def validate(self): if self.settings.get_safe("compiler.cppstd"): @@ -84,6 +84,8 @@ def generate(self): tc.variables["MAILIO_BUILD_SHARED_LIBRARY"] = self.options.shared tc.variables["MAILIO_BUILD_DOCUMENTATION"] = False tc.variables["MAILIO_BUILD_EXAMPLES"] = False + if Version(self.version) >= "0.22.0": + tc.variables["MAILIO_BUILD_TESTS"] = False tc.generate() deps = CMakeDeps(self) @@ -100,10 +102,20 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.libs = ["mailio"] - self.cpp_info.requires = ["boost::system", "boost::date_time", "boost::regex", "openssl::openssl"] + self.cpp_info.requires = [ + "boost::system", + "boost::date_time", + "boost::regex", + "openssl::openssl", + ] + if self.dependencies["boost"].options.get_safe("with_stacktrace_backtrace"): + self.cpp_info.requires.append("boost::stacktrace_backtrace") + + self.cpp_info.set_property("pkg_config_name", "mailio") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/mailio/all/patches/0.22.0-adapt-cmakelists.patch b/recipes/mailio/all/patches/0.22.0-adapt-cmakelists.patch new file mode 100644 index 0000000000000..417d346368830 --- /dev/null +++ b/recipes/mailio/all/patches/0.22.0-adapt-cmakelists.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a79e042..9306cba 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -145,7 +145,7 @@ configure_file(mailio.pc.in ${CMAKE_BINARY_DIR}/mailio.pc IMMEDIATE @ONLY) + install(FILES ${CMAKE_BINARY_DIR}/mailio.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) + + configure_file(${PROJECT_SOURCE_DIR}/include/version.hpp.in version.hpp) +-install(FILES ${CMAKE_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) ++install(FILES ${PROJECT_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) + + # generate the export header for exporting symbols + # this is needed to generate a shared library. +@@ -181,16 +181,11 @@ endif() + install(DIRECTORY include/mailio DESTINATION ${INCLUDE_INSTALL_DIR}) + + install(TARGETS ${PROJECT_NAME} +- EXPORT ${PROJECT_NAME}Config + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + RUNTIME DESTINATION ${BIN_INSTALL_DIR} + ) + +-export(TARGETS ${PROJECT_NAME} FILE ${PROJECT_NAME}Config.cmake) +- +-install(EXPORT ${PROJECT_NAME}Config DESTINATION share/${PROJECT_NAME}/cmake) +- + # optionally build examples + if(${MAILIO_BUILD_EXAMPLES}) + add_subdirectory(examples) diff --git a/recipes/mailio/all/patches/0.23.0-adapt-cmakelists.patch b/recipes/mailio/all/patches/0.23.0-adapt-cmakelists.patch new file mode 100644 index 0000000000000..a29154c581b87 --- /dev/null +++ b/recipes/mailio/all/patches/0.23.0-adapt-cmakelists.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e3b30fd..d1adcab 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -146,7 +146,7 @@ configure_file(mailio.pc.in ${CMAKE_BINARY_DIR}/mailio.pc IMMEDIATE @ONLY) + install(FILES ${CMAKE_BINARY_DIR}/mailio.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) + + configure_file(${PROJECT_SOURCE_DIR}/include/version.hpp.in version.hpp) +-install(FILES ${CMAKE_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) ++install(FILES ${PROJECT_BINARY_DIR}/version.hpp DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) + + # generate the export header for exporting symbols + # this is needed to generate a shared library. diff --git a/recipes/mailio/all/test_package/test_package.cpp b/recipes/mailio/all/test_package/test_package.cpp index ffc54c18c0369..43678d207e054 100644 --- a/recipes/mailio/all/test_package/test_package.cpp +++ b/recipes/mailio/all/test_package/test_package.cpp @@ -8,7 +8,4 @@ int main() { msg.add_recipient(mailio::mail_address("mailio library", "mailio@gmail.com")); msg.subject("smtps simple message"); msg.content("Hello, World!"); - - mailio::smtps conn("smtp.gmail.com", 587); - std::cout << msg.content() << "\n";; } diff --git a/recipes/mailio/config.yml b/recipes/mailio/config.yml index ad2748292fb8c..01caa19ce9c40 100644 --- a/recipes/mailio/config.yml +++ b/recipes/mailio/config.yml @@ -1,4 +1,8 @@ versions: + "0.23.0": + folder: all + "0.22.0": + folder: all "0.21.0": folder: all "0.20.0": diff --git a/recipes/mathter/all/conanfile.py b/recipes/mathter/all/conanfile.py index be28b561bbcae..3c07c54ec5fb2 100644 --- a/recipes/mathter/all/conanfile.py +++ b/recipes/mathter/all/conanfile.py @@ -1,20 +1,30 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + class MathterConan(ConanFile): name = "mathter" + description = "Powerful 3D math and small-matrix linear algebra library for games and science." license = "MIT" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/petiaccja/Mathter" - url = "https://github.com/conan-io/conan-center-index/" - description = "Powerful 3D math and small-matrix linear algebra library for games and science." - topics = ("game-dev", "linear-algebra", "vector-math", "matrix-library") + topics = ("game-dev", "linear-algebra", "vector-math", "matrix-library", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - settings = "compiler" @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -25,25 +35,39 @@ def _compilers_minimum_version(self): "Visual Studio": 16, } - 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.cppstd: - tools.check_min_cppstd(self, "17") + check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("mathter requires C++17, which your compiler does not support.") + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++{self._min_cppstd}, " + f"which your compiler does not support.") else: - self.output.warn("mathter requires C++17. Your compiler is unknown. Assuming it supports C++17.") + self.output.warning(f"{self.name} requires C++{self._min_cppstd}. " + f"Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("Mathter-" + self.version, self._source_subfolder) - + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def package(self): - self.copy("*.hpp", dst=os.path.join("include", "Mathter"), src=os.path.join(self._source_subfolder, "Mathter")) - self.copy("*.natvis", dst=os.path.join("include", "Mathter"), src=os.path.join(self._source_subfolder, "Mathter")) - self.copy("LICENCE", dst="licenses", src=self._source_subfolder) + copy(self, "*.hpp", + dst=os.path.join(self.package_folder, "include", "Mathter"), + src=os.path.join(self.source_folder, "Mathter")) + copy(self, "*.natvis", + dst=os.path.join(self.package_folder, "include", "Mathter"), + src=os.path.join(self.source_folder, "Mathter")) + copy(self, "LICENCE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/mathter/all/test_package/CMakeLists.txt b/recipes/mathter/all/test_package/CMakeLists.txt index 27af59f1d203b..e6eb2612386c1 100644 --- a/recipes/mathter/all/test_package/CMakeLists.txt +++ b/recipes/mathter/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(TestPackage CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(mathter REQUIRED CONFIG) add_executable(test_package test_package.cpp) -target_link_libraries(test_package ${CONAN_LIBS}) -target_compile_features(test_package PUBLIC cxx_std_17) +target_link_libraries(test_package PRIVATE mathter::mathter) +target_compile_features(test_package PRIVATE cxx_std_17) diff --git a/recipes/mathter/all/test_package/conanfile.py b/recipes/mathter/all/test_package/conanfile.py index 30d42d996e79e..fae501d0afb9e 100644 --- a/recipes/mathter/all/test_package/conanfile.py +++ b/recipes/mathter/all/test_package/conanfile.py @@ -1,9 +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 MathterTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mathter/all/test_package/test_package.cpp b/recipes/mathter/all/test_package/test_package.cpp index 9452f0f208fc1..f9de551629038 100644 --- a/recipes/mathter/all/test_package/test_package.cpp +++ b/recipes/mathter/all/test_package/test_package.cpp @@ -3,9 +3,9 @@ int main() { using Vec3 = mathter::Vector; - Vec3 v1 = {1, 0, 3}; - Vec3 v2 = {2, 5, 3}; - auto r = v1 + v2; - std::cout << "Mathter installation works." << std::endl; - return 0; + Vec3 v1 = {1, 0, 3}; + Vec3 v2 = {2, 5, 3}; + auto r = v1 + v2; + std::cout << "Mathter installation works." << std::endl; + return 0; } diff --git a/recipes/mathter/all/test_v1_package/CMakeLists.txt b/recipes/mathter/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/mathter/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mathter/all/test_v1_package/conanfile.py b/recipes/mathter/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7177bb22dc3a9 --- /dev/null +++ b/recipes/mathter/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class MathterTestConan(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/mattiasgustavsson-libs/all/conanfile.py b/recipes/mattiasgustavsson-libs/all/conanfile.py index bfba3abb27bab..064ab9c964c61 100644 --- a/recipes/mattiasgustavsson-libs/all/conanfile.py +++ b/recipes/mattiasgustavsson-libs/all/conanfile.py @@ -1,37 +1,53 @@ -from conans import ConanFile, tools -import os.path -import glob +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, load, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class MattiasgustavssonLibsConan(ConanFile): name = "mattiasgustavsson-libs" description = "Single-file public domain libraries for C/C++" - homepage = "https://github.com/mattiasgustavsson/libs" - url = "https://github.com/conan-io/conan-center-index" license = ("Unlicense", "MIT") - topics = ("utilities", "mattiasgustavsson", "libs") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mattiasgustavsson/libs" + topics = ("utilities", "mattiasgustavsson", "libs", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return os.path.join(self.source_folder, "source_subfolder") + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob('libs-*/')[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def _extract_licenses(self): - header = tools.load(os.path.join(self._source_subfolder, "thread.h")) - mit_content = header[header.find("ALTERNATIVE A - "):header.find("ALTERNATIVE B -")] - tools.save("LICENSE_MIT", mit_content) - unlicense_content = header[header.find("ALTERNATIVE B - "):header.rfind("*/", 1)] - tools.save("LICENSE_UNLICENSE", unlicense_content) + header = load(self, os.path.join(self.source_folder, "thread.h")) + mit_content = header[header.find("ALTERNATIVE A - ") : header.find("ALTERNATIVE B -")] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE_MIT"), mit_content) + unlicense_content = header[header.find("ALTERNATIVE B - ") : header.rfind("*/", 1)] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE_UNLICENSE"), unlicense_content) def package(self): - self.copy(pattern="*.h", dst="include", src=self._source_subfolder) self._extract_licenses() - self.copy("LICENSE_MIT", dst="licenses") - self.copy("LICENSE_UNLICENSE", dst="licenses") + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt b/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt index 7557711b6dc83..fe3e7c23a7d9b 100644 --- a/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt +++ b/recipes/mattiasgustavsson-libs/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(mattiasgustavsson-libs REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE mattiasgustavsson-libs::mattiasgustavsson-libs) diff --git a/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py b/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py +++ b/recipes/mattiasgustavsson-libs/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/maven/all/conandata.yml b/recipes/maven/all/conandata.yml new file mode 100644 index 0000000000000..7cdcaeb46d6b1 --- /dev/null +++ b/recipes/maven/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.9.2": + url: "https://dlcdn.apache.org/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.tar.gz" + sha256: "809ef3220c6d179195c06c324cb9a6d34d8ecba566c5cfd8eb83167bc034117d" diff --git a/recipes/maven/all/conanfile.py b/recipes/maven/all/conanfile.py new file mode 100644 index 0000000000000..f1f95efee4fb1 --- /dev/null +++ b/recipes/maven/all/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.47.0" + +class MavenConan(ConanFile): + name = "maven" + description = "Apache Maven is a software project management and comprehension tool." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://maven.apache.org/" + topics = ("build", "project management") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass + + def requirements(self): + self.requires("zulu-openjdk/11.0.15") + + def package_id(self): + del self.info.settings.arch + del self.info.settings.compiler + del self.info.settings.build_type + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + for target in ("bin", "boot", "conf", "lib"): + copy(self, pattern="*", dst=os.path.join(self.package_folder, target), src=os.path.join(self.source_folder, target)) + + def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] diff --git a/recipes/maven/all/test_package/conanfile.py b/recipes/maven/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a44299cfabc6 --- /dev/null +++ b/recipes/maven/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + if can_run(self): + self.run("mvn --version") diff --git a/recipes/maven/config.yml b/recipes/maven/config.yml new file mode 100644 index 0000000000000..2f82b90ebcf02 --- /dev/null +++ b/recipes/maven/config.yml @@ -0,0 +1,3 @@ +versions: + "3.9.2": + folder: all diff --git a/recipes/metis/all/CMakeLists.txt b/recipes/metis/all/CMakeLists.txt index 15cbde395086d..b311c024ef0c5 100644 --- a/recipes/metis/all/CMakeLists.txt +++ b/recipes/metis/all/CMakeLists.txt @@ -1,10 +1,17 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper LANGUAGES C) +cmake_minimum_required(VERSION 3.15) +project(METIS C) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -set(GKLIB_PATH "${CMAKE_CURRENT_LIST_DIR}/source_subfolder/GKlib" CACHE PATH "") +include(gkbuild.cmake) -add_subdirectory(source_subfolder) +find_package(gklib REQUIRED) + +file(GLOB metis_sources libmetis/*.c) +add_library(metis ${metis_sources}) +target_include_directories(metis PRIVATE libmetis include) +target_link_libraries(metis PRIVATE gklib::gklib) + +include(GNUInstallDirs) +install(TARGETS metis) +install(DIRECTORY include/ DESTINATION include) diff --git a/recipes/metis/all/conandata.yml b/recipes/metis/all/conandata.yml index 396a06387b94f..2250bb8608a80 100644 --- a/recipes/metis/all/conandata.yml +++ b/recipes/metis/all/conandata.yml @@ -1,16 +1,21 @@ sources: + "5.2.1": + url: "https://github.com/KarypisLab/METIS/archive/refs/tags/v5.2.1.tar.gz" + sha256: "1a4665b2cd07edc2f734e30d7460afb19c1217c2547c2ac7bf6e1848d50aff7a" "5.1.1": url: "https://github.com/KarypisLab/METIS/archive/refs/tags/v5.1.1-DistDGL-v0.5.tar.gz" sha256: "cedf0b32d32a8496bac7eb078b2b8260fb00ddb8d50c27e4082968a01bc33331" patches: "5.1.1": - - patch_file: "patches/001-add-gklib-system-cmake.patch" - base_path: "source_subfolder" - - patch_file: "patches/002-support-pure-cmake.patch" - base_path: "source_subfolder" - - patch_file: "patches/003-remove-programs.patch" - base_path: "source_subfolder" - - patch_file: "patches/004-use-conan-gklib.patch" - base_path: "source_subfolder" - - patch_file: "patches/005-fix-install.patch" - base_path: "source_subfolder" + - patch_file: "patches/5.1.1-001-fix-coarse-graph-memory-bugs.patch" + patch_type: "bugfix" + patch_source: "https://github.com/KarypisLab/METIS/commit/36262adecaa9720a4417a67124428061c367fd3f" + patch_description: "Fix memory bug when coarser graph stays the same" + - patch_file: "patches/5.1.1-002-fix-out-out-of-bounds-errors.patch" + patch_type: "bugfix" + patch_source: "https://github.com/KarypisLab/METIS/commit/b9e8609ea16d27cf61e1ad8a38af1bfd6185eca5" + patch_description: "Fix out out-of-bounds memory errors" + - patch_file: "patches/5.1.1-003-reduce-maximum-memory-use.patch" + patch_type: "bugfix" + patch_source: "https://github.com/KarypisLab/METIS/commit/aef54c5b2a72f9d0c3c91b008c35271560b79cac" + patch_description: "Small changes to reduce maximum memory use" diff --git a/recipes/metis/all/conanfile.py b/recipes/metis/all/conanfile.py index 7e077e7ea6112..7782c2735e124 100644 --- a/recipes/metis/all/conanfile.py +++ b/recipes/metis/all/conanfile.py @@ -1,101 +1,149 @@ -from conans import ConanFile, CMake, tools -from conan.tools.files import apply_conandata_patches import os -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rm, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class METISConan(ConanFile): name = "metis" + description = ( + "Set of serial programs for partitioning graphs, " + "partitioning finite element meshes, and producing " + "fill reducing orderings for sparse matrices" + ) license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/KarypisLab/METIS" - description = "set of serial programs for partitioning graphs," \ - " partitioning finite element meshes, and producing" \ - " fill reducing orderings for sparse matrices" topics = ("karypislab", "graph", "partitioning-algorithms") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], + "with_64bit_types": [True, False], + "enable_gkrand": [True, False], + "enable_gkregex": [True, False], + "with_openmp": [True, False], + "with_pcre": [True, False], + "with_valgrind": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_64bit_types": True, + "enable_gkrand": False, + "enable_gkregex": False, + "with_openmp": False, + "with_pcre": False, + "with_valgrind": False, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - - @property - def _is_mingw(self): - return self.settings.os == "Windows" and self.settings.compiler == "gcc" 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) + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + copy( + self, + "gkbuild.cmake", + self.recipe_folder, + os.path.join(self.export_sources_folder, "src"), + ) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + del self.options.enable_gkregex def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("gklib/5.1.1") 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) + rm(self, "*.pdf", self.source_folder, recursive=True) + copy(self, "CMakeLists.txt", self.export_sources_folder, self.source_folder) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["VALGRIND"] = self.options.with_valgrind + tc.cache_variables["OPENMP"] = self.options.with_openmp + tc.cache_variables["PCRE"] = self.options.with_pcre + tc.cache_variables["GKREGEX"] = self.settings.os == "Windows" or self.options.enable_gkregex + tc.cache_variables["GKRAND"] = self.options.enable_gkrand + if self.settings.build_type == "Debug": + tc.preprocessor_definitions["DEBUG"] = "" + else: + # NDEBUG is defined by default by CMake + # tc.preprocessor_definitions["NDEBUG"] = "" + tc.preprocessor_definitions["NDEBUG2"] = "" + bits = 64 if self.options.with_64bit_types else 32 + tc.preprocessor_definitions["IDXTYPEWIDTH"] = str(bits) + tc.preprocessor_definitions["REALTYPEWIDTH"] = str(bits) + tc.generate() + tc = CMakeDeps(self) + tc.generate() def _patch_sources(self): apply_conandata_patches(self) - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - self._cmake.definitions["SHARED"] = self.options.shared - self._cmake.definitions["METIS_INSTALL"] = True - self._cmake.definitions["ASSERT"] = self.settings.build_type == "Debug" - self._cmake.definitions["ASSERT2"] = self.settings.build_type == "Debug" - self._cmake.definitions["METIS_IDX64"] = True - self._cmake.definitions["METIS_REAL64"] = True - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - 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() - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + rm(self, "*.cmake", self.package_folder, recursive=True) + rm(self, "*.pc", self.package_folder, recursive=True) + rm(self, "*.pdb", self.package_folder, recursive=True) def package_info(self): self.cpp_info.libs = ["metis"] - self.cpp_info.requires.append("gklib::gklib") + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - if self._is_msvc or self._is_mingw: - self.cpp_info.defines.append("USE_GKREGEX") - if self._is_msvc: + self.cpp_info.defines.append("LINUX") + elif self.settings.os == "Windows": + self.cpp_info.defines.append("WIN32") + self.cpp_info.defines.append("MSC") + self.cpp_info.defines.append("_CRT_SECURE_NO_DEPRECATE") + elif self.settings.os == "Macos": + self.cpp_info.defines.append("MACOS") + elif self.settings.os == "SunOS": + self.cpp_info.defines.append("SUNOS") + + if is_msvc(self): self.cpp_info.defines.append("__thread=__declspec(thread)") + + bits = 64 if self.options.with_64bit_types else 32 + self.cpp_info.defines.append(f"IDXTYPEWIDTH={bits}") + self.cpp_info.defines.append(f"REALTYPEWIDTH={bits}") + + # Defines for GKLib headers + if self.settings.os == "Windows" or self.options.enable_gkregex: + self.cpp_info.defines.append("USE_GKREGEX") + if self.options.enable_gkrand: + self.cpp_info.defines.append("USE_GKRAND") + if self.options.with_pcre: + self.cpp_info.defines.append("__WITHPCRE__") + if self.options.with_openmp: + self.cpp_info.defines.append("__OPENMP__") diff --git a/recipes/metis/all/gkbuild.cmake b/recipes/metis/all/gkbuild.cmake new file mode 100644 index 0000000000000..c5f8ebbaa39fe --- /dev/null +++ b/recipes/metis/all/gkbuild.cmake @@ -0,0 +1,121 @@ +# Source:https://github.com/KarypisLab/METIS/blob/e0f1b88/conf/gkbuild.cmake +# With some of the config moved to conanfile.py. + +# Helper modules. +include(CheckFunctionExists) +include(CheckIncludeFile) + +# Setup options. +option(GPROF "add gprof support" OFF) +option(VALGRIND "add valgrind support" OFF) +option(OPENMP "enable OpenMP support" OFF) +option(PCRE "enable PCRE support" OFF) +option(GKREGEX "enable GKREGEX support" OFF) +option(GKRAND "enable GKRAND support" OFF) + +# Add compiler flags. +if(MSVC) + set(GK_COPTS "/Ox") + set(GK_COPTIONS "-DWIN32 -DMSC -D_CRT_SECURE_NO_DEPRECATE -DUSE_GKREGEX") +elseif(MINGW) + set(GK_COPTS "-DUSE_GKREGEX") +else() + set(GK_COPTIONS "-DLINUX -D_FILE_OFFSET_BITS=64") +endif() +if(CYGWIN) + set(GK_COPTIONS "${GK_COPTIONS} -DCYGWIN") +endif() +if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + # GCC opts. + set(GK_COPTIONS "${GK_COPTIONS} -std=c99 -fno-strict-aliasing") + if(VALGRIND) + set(GK_COPTIONS "${GK_COPTIONS} -march=x86-64 -mtune=generic") + else() + # -march=native is not a valid flag on PPC: + if(CMAKE_SYSTEM_PROCESSOR MATCHES "power|ppc|powerpc|ppc64|powerpc64" OR (APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64")) + set(GK_COPTIONS "${GK_COPTIONS} -mtune=native") + else() + set(GK_COPTIONS "${GK_COPTIONS} -march=native") + endif() + endif() + # GCC warnings. + set(GK_COPTIONS "${GK_COPTIONS} -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label") +elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun") + # Sun insists on -xc99. + set(GK_COPTIONS "${GK_COPTIONS} -xc99") +endif() + +if(${CMAKE_C_COMPILER_ID} STREQUAL "Intel") + set(GK_COPTIONS "${GK_COPTIONS} -xHost") + # set(GK_COPTIONS "${GK_COPTIONS} -fast") +endif() + +# Add support for MacOS items +if(APPLE) + set(GK_COPTIONS "${GK_COPTIONS} -DMACOS") +endif() + +# Find OpenMP if it is requested. +if(OPENMP) + include(FindOpenMP) + if(OPENMP_FOUND) + set(GK_COPTIONS "${GK_COPTIONS} -D__OPENMP__ ${OpenMP_C_FLAGS}") + else() + message(WARNING "OpenMP was requested but support was not found") + endif() +endif() + +if(GPROF) + set(GK_COPTS "-pg") +endif() + +# Add various options +if(PCRE) + set(GK_COPTIONS "${GK_COPTIONS} -D__WITHPCRE__") +endif() + +if(GKREGEX) + set(GK_COPTIONS "${GK_COPTIONS} -DUSE_GKREGEX") +endif() + +if(GKRAND) + set(GK_COPTIONS "${GK_COPTIONS} -DUSE_GKRAND") +endif() + + +# Check for features. +check_include_file(execinfo.h HAVE_EXECINFO_H) +if(HAVE_EXECINFO_H) + set(GK_COPTIONS "${GK_COPTIONS} -DHAVE_EXECINFO_H") +endif() + +check_function_exists(getline HAVE_GETLINE) +if(HAVE_GETLINE) + set(GK_COPTIONS "${GK_COPTIONS} -DHAVE_GETLINE") +endif() + + +# Custom check for TLS. +if(MSVC) + set(GK_COPTIONS "${GK_COPTIONS} -D__thread=__declspec(thread)") + + # This if checks if that value is cached or not. + if("${HAVE_THREADLOCALSTORAGE}" MATCHES "^${HAVE_THREADLOCALSTORAGE}$") + file(WRITE ${CMAKE_SOURCE_DIR}/check_thread_storage.c + "extern __thread int x; int main() { return 0; }") + try_compile(HAVE_THREADLOCALSTORAGE + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/check_thread_storage.c) + if(HAVE_THREADLOCALSTORAGE) + message(STATUS "checking for thread-local storage - found") + else() + message(STATUS "checking for thread-local storage - not found") + endif() + endif() + if(NOT HAVE_THREADLOCALSTORAGE) + set(GK_COPTIONS "${GK_COPTIONS} -D__thread=") + endif() +endif() + +# Finally set the official C flags. +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GK_COPTIONS} ${GK_COPTS}") diff --git a/recipes/metis/all/patches/001-add-gklib-system-cmake.patch b/recipes/metis/all/patches/001-add-gklib-system-cmake.patch deleted file mode 100644 index 2c6798304339e..0000000000000 --- a/recipes/metis/all/patches/001-add-gklib-system-cmake.patch +++ /dev/null @@ -1,151 +0,0 @@ -Add gklib system cmake ---- /dev/null -+++ b/GKlib/GKlibSystem.cmake -@@ -0,0 +1,133 @@ -+# Helper modules. -+include(CheckFunctionExists) -+include(CheckIncludeFile) -+ -+# Setup options. -+option(GDB "enable use of GDB" OFF) -+option(ASSERT "turn asserts on" OFF) -+option(ASSERT2 "additional assertions" OFF) -+option(DEBUG "add debugging support" OFF) -+option(GPROF "add gprof support" OFF) -+option(OPENMP "enable OpenMP support" OFF) -+option(PCRE "enable PCRE support" OFF) -+option(GKREGEX "enable GKREGEX support" OFF) -+option(GKRAND "enable GKRAND support" OFF) -+ -+ -+# Add compiler flags. -+if(MSVC) -+ set(GKlib_COPTS "/Ox") -+ set(GKlib_COPTIONS "-DWIN32 -DMSC -D_CRT_SECURE_NO_DEPRECATE -DUSE_GKREGEX") -+elseif(MINGW) -+ set(GKlib_COPTS "-DUSE_GKREGEX") -+else() -+ set(GKlib_COPTIONS "-DLINUX -D_FILE_OFFSET_BITS=64") -+endif(MSVC) -+if(CYGWIN) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DCYGWIN") -+endif(CYGWIN) -+if(CMAKE_COMPILER_IS_GNUCC) -+# GCC opts. -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -std=c99 -fno-strict-aliasing") -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -march=native") -+ if(NOT MINGW) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -fPIC") -+ endif(NOT MINGW) -+# GCC warnings. -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label") -+elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun") -+# Sun insists on -xc99. -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -xc99") -+endif(CMAKE_COMPILER_IS_GNUCC) -+ -+# Intel compiler -+if(${CMAKE_C_COMPILER_ID} MATCHES "Intel") -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -xHost -std=c99") -+endif() -+ -+# Find OpenMP if it is requested. -+if(OPENMP) -+ include(FindOpenMP) -+ if(OPENMP_FOUND) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__OPENMP__ ${OpenMP_C_FLAGS}") -+ else() -+ message(WARNING "OpenMP was requested but support was not found") -+ endif(OPENMP_FOUND) -+endif(OPENMP) -+ -+ -+# Add various definitions. -+if(GDB) -+ set(GKlib_COPTS "${GKlib_COPTS} -g") -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror") -+else() -+ set(GKlib_COPTS "-O3") -+endif(GDB) -+ -+ -+if(DEBUG) -+ set(GKlib_COPTS "-g") -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DDEBUG") -+endif(DEBUG) -+ -+if(GPROF) -+ set(GKlib_COPTS "-pg") -+endif(GPROF) -+ -+if(NOT ASSERT) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DNDEBUG") -+endif(NOT ASSERT) -+ -+if(NOT ASSERT2) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DNDEBUG2") -+endif(NOT ASSERT2) -+ -+ -+# Add various options -+if(PCRE) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__WITHPCRE__") -+endif(PCRE) -+ -+if(GKREGEX) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DUSE_GKREGEX") -+endif(GKREGEX) -+ -+if(GKRAND) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DUSE_GKRAND") -+endif(GKRAND) -+ -+ -+# Check for features. -+check_include_file(execinfo.h HAVE_EXECINFO_H) -+if(HAVE_EXECINFO_H) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DHAVE_EXECINFO_H") -+endif(HAVE_EXECINFO_H) -+ -+check_function_exists(getline HAVE_GETLINE) -+if(HAVE_GETLINE) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -DHAVE_GETLINE") -+endif(HAVE_GETLINE) -+ -+ -+# Custom check for TLS. -+if(MSVC) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__thread=__declspec(thread)") -+ -+ # This if checks if that value is cached or not. -+ if("${HAVE_THREADLOCALSTORAGE}" MATCHES "^${HAVE_THREADLOCALSTORAGE}$") -+ try_compile(HAVE_THREADLOCALSTORAGE -+ ${CMAKE_BINARY_DIR} -+ ${GKLIB_PATH}/conf/check_thread_storage.c) -+ if(HAVE_THREADLOCALSTORAGE) -+ message(STATUS "checking for thread-local storage - found") -+ else() -+ message(STATUS "checking for thread-local storage - not found") -+ endif() -+ endif() -+ if(NOT HAVE_THREADLOCALSTORAGE) -+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__thread=") -+ endif() -+endif() -+ -+# Finally set the official C flags. -+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GKlib_COPTIONS} ${GKlib_COPTS}") -diff --git a/GKlib/conf/check_thread_storage.c b/GKlib/conf/check_thread_storage.c -new file mode 100644 -index 0000000..e6e1e98 ---- /dev/null -+++ b/GKlib/conf/check_thread_storage.c -@@ -0,0 +1,5 @@ -+extern __thread int x; -+ -+int main(int argc, char **argv) { -+ return 0; -+} --- -2.33.1.windows.1 - diff --git a/recipes/metis/all/patches/002-support-pure-cmake.patch b/recipes/metis/all/patches/002-support-pure-cmake.patch deleted file mode 100644 index 7fc0e8b45ccb7..0000000000000 --- a/recipes/metis/all/patches/002-support-pure-cmake.patch +++ /dev/null @@ -1,771 +0,0 @@ -Generate metis.h based on CMake options ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -20,26 +20,28 @@ endif(SHARED) - include(${GKLIB_PATH}/GKlibSystem.cmake) - - # METIS' custom options --#option(IDX64 "enable 64 bit ints" OFF) --#option(REAL64 "enable 64 bit floats (i.e., double)" OFF) --#if(IDX64) --# set(METIS_COPTIONS "${METIS_COPTIONS} -DIDXTYPEWIDTH=64") --#else() --# set(METIS_COPTIONS "${METIS_COPTIONS} -DIDXTYPEWIDTH=32") --#endif(IDX64) --#if(REAL64) --# set(METIS_COPTIONS "${METIS_COPTIONS} -DREALTYPEWIDTH=64") --#else() --# set(METIS_COPTIONS "${METIS_COPTIONS} -DREALTYPEWIDTH=32") --#endif(REAL64) --# --#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${METIS_COPTIONS}") -- -+option(METIS_IDX64 "enable 64 bit ints" OFF) -+option(METIS_REAL64 "enable 64 bit floats (i.e., double)" OFF) -+if (METIS_IDX64) -+ set(METIS_IDXTYPEWIDTH 64) -+else () -+ set(METIS_IDXTYPEWIDTH 32) -+endif () -+if (METIS_REAL64) -+ set(METIS_REALTYPEWIDTH 64) -+else () -+ set(METIS_REALTYPEWIDTH 32) -+endif () - - # Add include directories. - include_directories(${GKLIB_PATH}) --include_directories(build/xinclude) -+configure_file(${PROJECT_SOURCE_DIR}/include/metis.h.in -+ ${PROJECT_BINARY_DIR}/include/metis.h) -+include_directories(${PROJECT_BINARY_DIR}/include) -+if (METIS_INSTALL) -+ install(FILES ${PROJECT_BINARY_DIR}/include/metis.h DESTINATION include) -+endif () -+ - # Recursively look for CMakeLists.txt in subdirs. --add_subdirectory("build/xinclude") - add_subdirectory("libmetis") - add_subdirectory("programs") ---- a/include/metis.h -+++ /dev/null -@@ -1,358 +0,0 @@ --/*! --\file metis.h --\brief This file contains function prototypes and constant definitions for METIS -- * --\author George --\date Started 8/9/02 --\version\verbatim $Id$\endverbatim --*/ -- --#ifndef _METIS_H_ --#define _METIS_H_ -- --/**************************************************************************** --* A set of defines that can be modified by the user --*****************************************************************************/ -- --/*-------------------------------------------------------------------------- -- Specifies the width of the elementary data type that will hold information -- about vertices and their adjacency lists. -- -- Possible values: -- 32 : Use 32 bit signed integers -- 64 : Use 64 bit signed integers -- -- A width of 64 should be specified if the number of vertices or the total -- number of edges in the graph exceed the limits of a 32 bit signed integer -- i.e., 2^31-1. -- Proper use of 64 bit integers requires that the c99 standard datatypes -- int32_t and int64_t are supported by the compiler. -- GCC does provides these definitions in stdint.h, but it may require some -- modifications on other architectures. ----------------------------------------------------------------------------*/ --//#define IDXTYPEWIDTH 32 -- -- --/*-------------------------------------------------------------------------- -- Specifies the data type that will hold floating-point style information. -- -- Possible values: -- 32 : single precission floating point (float) -- 64 : double precission floating point (double) ----------------------------------------------------------------------------*/ --//#define REALTYPEWIDTH 32 -- -- -- --/**************************************************************************** --* In principle, nothing needs to be changed beyond this point, unless the --* int32_t and int64_t cannot be found in the normal places. --*****************************************************************************/ -- --/* Uniform definitions for various compilers */ --#if defined(_MSC_VER) -- #define COMPILER_MSC --#endif --#if defined(__ICC) -- #define COMPILER_ICC --#endif --#if defined(__GNUC__) -- #define COMPILER_GCC --#endif -- --/* Include c99 int definitions and need constants. When building the library, -- * these are already defined by GKlib; hence the test for _GKLIB_H_ */ --#ifndef _GKLIB_H_ --#ifdef COMPILER_MSC --#include -- --typedef __int32 int32_t; --typedef __int64 int64_t; --#define PRId32 "I32d" --#define PRId64 "I64d" --#define SCNd32 "ld" --#define SCNd64 "I64d" --#define INT32_MIN ((int32_t)_I32_MIN) --#define INT32_MAX _I32_MAX --#define INT64_MIN ((int64_t)_I64_MIN) --#define INT64_MAX _I64_MAX --#else --#include --#endif --#endif -- -- --/*------------------------------------------------------------------------ --* Setup the basic datatypes --*-------------------------------------------------------------------------*/ --#if IDXTYPEWIDTH == 32 -- typedef int32_t idx_t; -- -- #define IDX_MAX INT32_MAX -- #define IDX_MIN INT32_MIN -- -- #define SCIDX SCNd32 -- #define PRIDX PRId32 -- -- #define strtoidx strtol -- #define iabs abs --#elif IDXTYPEWIDTH == 64 -- typedef int64_t idx_t; -- -- #define IDX_MAX INT64_MAX -- #define IDX_MIN INT64_MIN -- -- #define SCIDX SCNd64 -- #define PRIDX PRId64 -- --#ifdef COMPILER_MSC -- #define strtoidx _strtoi64 --#else -- #define strtoidx strtoll --#endif -- #define iabs labs --#else -- #error "Incorrect user-supplied value fo IDXTYPEWIDTH" --#endif -- -- --#if REALTYPEWIDTH == 32 -- typedef float real_t; -- -- #define SCREAL "f" -- #define PRREAL "f" -- #define REAL_MAX FLT_MAX -- #define REAL_MIN FLT_MIN -- #define REAL_EPSILON FLT_EPSILON -- -- #define rabs fabsf -- #define REALEQ(x,y) ((rabs((x)-(y)) <= FLT_EPSILON)) -- --#ifdef COMPILER_MSC -- #define strtoreal (float)strtod --#else -- #define strtoreal strtof --#endif --#elif REALTYPEWIDTH == 64 -- typedef double real_t; -- -- #define SCREAL "lf" -- #define PRREAL "lf" -- #define REAL_MAX DBL_MAX -- #define REAL_MIN DBL_MIN -- #define REAL_EPSILON DBL_EPSILON -- -- #define rabs fabs -- #define REALEQ(x,y) ((rabs((x)-(y)) <= DBL_EPSILON)) -- -- #define strtoreal strtod --#else -- #error "Incorrect user-supplied value for REALTYPEWIDTH" --#endif -- -- --/*------------------------------------------------------------------------ --* Constant definitions --*-------------------------------------------------------------------------*/ --/* Metis's version number */ --#define METIS_VER_MAJOR 5 --#define METIS_VER_MINOR 1 --#define METIS_VER_SUBMINOR 0 -- --/* The maximum length of the options[] array */ --#define METIS_NOPTIONS 40 -- -- -- --/*------------------------------------------------------------------------ --* Function prototypes --*-------------------------------------------------------------------------*/ -- --#ifdef _WINDLL --#define METIS_API(type) __declspec(dllexport) type __cdecl --#elif defined(__cdecl) --#define METIS_API(type) type __cdecl --#else --#define METIS_API(type) type --#endif -- -- -- --#ifdef __cplusplus --extern "C" { --#endif -- --METIS_API(int) METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, -- idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, -- idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, -- idx_t *edgecut, idx_t *part); -- --METIS_API(int) METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, -- idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, -- idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, -- idx_t *edgecut, idx_t *part); -- --METIS_API(int) METIS_MeshToDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -- idx_t *ncommon, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy); -- --METIS_API(int) METIS_MeshToNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -- idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy); -- --METIS_API(int) METIS_PartMeshNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -- idx_t *vwgt, idx_t *vsize, idx_t *nparts, real_t *tpwgts, -- idx_t *options, idx_t *objval, idx_t *epart, idx_t *npart); -- --METIS_API(int) METIS_PartMeshDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -- idx_t *vwgt, idx_t *vsize, idx_t *ncommon, idx_t *nparts, -- real_t *tpwgts, idx_t *options, idx_t *objval, idx_t *epart, -- idx_t *npart); -- --METIS_API(int) METIS_NodeND(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, -- idx_t *options, idx_t *perm, idx_t *iperm); -- --METIS_API(int) METIS_Free(void *ptr); -- --METIS_API(int) METIS_SetDefaultOptions(idx_t *options); -- -- --/* These functions are used by ParMETIS */ -- --METIS_API(int) METIS_NodeNDP(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, -- idx_t npes, idx_t *options, idx_t *perm, idx_t *iperm, -- idx_t *sizes); -- --METIS_API(int) METIS_ComputeVertexSeparator(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, -- idx_t *vwgt, idx_t *options, idx_t *sepsize, idx_t *part); -- --METIS_API(int) METIS_NodeRefine(idx_t nvtxs, idx_t *xadj, idx_t *vwgt, idx_t *adjncy, -- idx_t *where, idx_t *hmarker, real_t ubfactor); -- -- --/* These functions are used by DGL */ -- --METIS_API(int) METIS_CacheFriendlyReordering(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, -- idx_t *part, idx_t *old2new); -- --#ifdef __cplusplus --} --#endif -- -- -- --/*------------------------------------------------------------------------ --* Enum type definitions --*-------------------------------------------------------------------------*/ --/*! Return codes */ --typedef enum { -- METIS_OK = 1, /*!< Returned normally */ -- METIS_ERROR_INPUT = -2, /*!< Returned due to erroneous inputs and/or options */ -- METIS_ERROR_MEMORY = -3, /*!< Returned due to insufficient memory */ -- METIS_ERROR = -4 /*!< Some other errors */ --} rstatus_et; -- -- --/*! Operation type codes */ --typedef enum { -- METIS_OP_PMETIS, -- METIS_OP_KMETIS, -- METIS_OP_OMETIS --} moptype_et; -- -- --/*! Options codes (i.e., options[]) */ --typedef enum { -- METIS_OPTION_PTYPE, -- METIS_OPTION_OBJTYPE, -- METIS_OPTION_CTYPE, -- METIS_OPTION_IPTYPE, -- METIS_OPTION_RTYPE, -- METIS_OPTION_DBGLVL, -- METIS_OPTION_NIPARTS, -- METIS_OPTION_NITER, -- METIS_OPTION_NCUTS, -- METIS_OPTION_SEED, -- METIS_OPTION_NO2HOP, -- METIS_OPTION_ONDISK, -- METIS_OPTION_MINCONN, -- METIS_OPTION_CONTIG, -- METIS_OPTION_COMPRESS, -- METIS_OPTION_CCORDER, -- METIS_OPTION_PFACTOR, -- METIS_OPTION_NSEPS, -- METIS_OPTION_UFACTOR, -- METIS_OPTION_NUMBERING, -- METIS_OPTION_DROPEDGES, -- -- /* Used for command-line parameter purposes */ -- METIS_OPTION_HELP, -- METIS_OPTION_TPWGTS, -- METIS_OPTION_NCOMMON, -- METIS_OPTION_NOOUTPUT, -- METIS_OPTION_BALANCE, -- METIS_OPTION_GTYPE, -- METIS_OPTION_UBVEC --} moptions_et; -- -- --/*! Partitioning Schemes */ --typedef enum { -- METIS_PTYPE_RB, -- METIS_PTYPE_KWAY --} mptype_et; -- --/*! Graph types for meshes */ --typedef enum { -- METIS_GTYPE_DUAL, -- METIS_GTYPE_NODAL --} mgtype_et; -- --/*! Coarsening Schemes */ --typedef enum { -- METIS_CTYPE_RM, -- METIS_CTYPE_SHEM --} mctype_et; -- --/*! Initial partitioning schemes */ --typedef enum { -- METIS_IPTYPE_GROW, -- METIS_IPTYPE_RANDOM, -- METIS_IPTYPE_EDGE, -- METIS_IPTYPE_NODE, -- METIS_IPTYPE_METISRB --} miptype_et; -- -- --/*! Refinement schemes */ --typedef enum { -- METIS_RTYPE_FM, -- METIS_RTYPE_GREEDY, -- METIS_RTYPE_SEP2SIDED, -- METIS_RTYPE_SEP1SIDED --} mrtype_et; -- -- --/*! Debug Levels */ --typedef enum { -- METIS_DBG_INFO = 1, /*!< Shows various diagnostic messages */ -- METIS_DBG_TIME = 2, /*!< Perform timing analysis */ -- METIS_DBG_COARSEN = 4, /*!< Show the coarsening progress */ -- METIS_DBG_REFINE = 8, /*!< Show the refinement progress */ -- METIS_DBG_IPART = 16, /*!< Show info on initial partitioning */ -- METIS_DBG_MOVEINFO = 32, /*!< Show info on vertex moves during refinement */ -- METIS_DBG_SEPINFO = 64, /*!< Show info on vertex moves during sep refinement */ -- METIS_DBG_CONNINFO = 128, /*!< Show info on minimization of subdomain connectivity */ -- METIS_DBG_CONTIGINFO = 256, /*!< Show info on elimination of connected components */ -- METIS_DBG_MEMORY = 2048, /*!< Show info related to wspace allocation */ --} mdbglvl_et; -- -- --/* Types of objectives */ --typedef enum { -- METIS_OBJTYPE_CUT, -- METIS_OBJTYPE_VOL, -- METIS_OBJTYPE_NODE --} mobjtype_et; -- -- -- --#endif /* _METIS_H_ */ ---- /dev/null -+++ b/include/metis.h.in -@@ -0,0 +1,358 @@ -+/*! -+\file metis.h -+\brief This file contains function prototypes and constant definitions for METIS -+ * -+\author George -+\date Started 8/9/02 -+\version\verbatim $Id$\endverbatim -+*/ -+ -+#ifndef _METIS_H_ -+#define _METIS_H_ -+ -+/**************************************************************************** -+* A set of defines that can be modified by the user -+*****************************************************************************/ -+ -+/*-------------------------------------------------------------------------- -+ Specifies the width of the elementary data type that will hold information -+ about vertices and their adjacency lists. -+ -+ Possible values: -+ 32 : Use 32 bit signed integers -+ 64 : Use 64 bit signed integers -+ -+ A width of 64 should be specified if the number of vertices or the total -+ number of edges in the graph exceed the limits of a 32 bit signed integer -+ i.e., 2^31-1. -+ Proper use of 64 bit integers requires that the c99 standard datatypes -+ int32_t and int64_t are supported by the compiler. -+ GCC does provides these definitions in stdint.h, but it may require some -+ modifications on other architectures. -+--------------------------------------------------------------------------*/ -+#define IDXTYPEWIDTH @METIS_IDXTYPEWIDTH@ -+ -+ -+/*-------------------------------------------------------------------------- -+ Specifies the data type that will hold floating-point style information. -+ -+ Possible values: -+ 32 : single precission floating point (float) -+ 64 : double precission floating point (double) -+--------------------------------------------------------------------------*/ -+#define REALTYPEWIDTH @METIS_REALTYPEWIDTH@ -+ -+ -+ -+/**************************************************************************** -+* In principle, nothing needs to be changed beyond this point, unless the -+* int32_t and int64_t cannot be found in the normal places. -+*****************************************************************************/ -+ -+/* Uniform definitions for various compilers */ -+#if defined(_MSC_VER) -+ #define COMPILER_MSC -+#endif -+#if defined(__ICC) -+ #define COMPILER_ICC -+#endif -+#if defined(__GNUC__) -+ #define COMPILER_GCC -+#endif -+ -+/* Include c99 int definitions and need constants. When building the library, -+ * these are already defined by GKlib; hence the test for _GKLIB_H_ */ -+#ifndef _GKLIB_H_ -+#ifdef COMPILER_MSC -+#include -+ -+typedef __int32 int32_t; -+typedef __int64 int64_t; -+#define PRId32 "I32d" -+#define PRId64 "I64d" -+#define SCNd32 "ld" -+#define SCNd64 "I64d" -+#define INT32_MIN ((int32_t)_I32_MIN) -+#define INT32_MAX _I32_MAX -+#define INT64_MIN ((int64_t)_I64_MIN) -+#define INT64_MAX _I64_MAX -+#else -+#include -+#endif -+#endif -+ -+ -+/*------------------------------------------------------------------------ -+* Setup the basic datatypes -+*-------------------------------------------------------------------------*/ -+#if IDXTYPEWIDTH == 32 -+ typedef int32_t idx_t; -+ -+ #define IDX_MAX INT32_MAX -+ #define IDX_MIN INT32_MIN -+ -+ #define SCIDX SCNd32 -+ #define PRIDX PRId32 -+ -+ #define strtoidx strtol -+ #define iabs abs -+#elif IDXTYPEWIDTH == 64 -+ typedef int64_t idx_t; -+ -+ #define IDX_MAX INT64_MAX -+ #define IDX_MIN INT64_MIN -+ -+ #define SCIDX SCNd64 -+ #define PRIDX PRId64 -+ -+#ifdef COMPILER_MSC -+ #define strtoidx _strtoi64 -+#else -+ #define strtoidx strtoll -+#endif -+ #define iabs labs -+#else -+ #error "Incorrect user-supplied value fo IDXTYPEWIDTH" -+#endif -+ -+ -+#if REALTYPEWIDTH == 32 -+ typedef float real_t; -+ -+ #define SCREAL "f" -+ #define PRREAL "f" -+ #define REAL_MAX FLT_MAX -+ #define REAL_MIN FLT_MIN -+ #define REAL_EPSILON FLT_EPSILON -+ -+ #define rabs fabsf -+ #define REALEQ(x,y) ((rabs((x)-(y)) <= FLT_EPSILON)) -+ -+#ifdef COMPILER_MSC -+ #define strtoreal (float)strtod -+#else -+ #define strtoreal strtof -+#endif -+#elif REALTYPEWIDTH == 64 -+ typedef double real_t; -+ -+ #define SCREAL "lf" -+ #define PRREAL "lf" -+ #define REAL_MAX DBL_MAX -+ #define REAL_MIN DBL_MIN -+ #define REAL_EPSILON DBL_EPSILON -+ -+ #define rabs fabs -+ #define REALEQ(x,y) ((rabs((x)-(y)) <= DBL_EPSILON)) -+ -+ #define strtoreal strtod -+#else -+ #error "Incorrect user-supplied value for REALTYPEWIDTH" -+#endif -+ -+ -+/*------------------------------------------------------------------------ -+* Constant definitions -+*-------------------------------------------------------------------------*/ -+/* Metis's version number */ -+#define METIS_VER_MAJOR 5 -+#define METIS_VER_MINOR 1 -+#define METIS_VER_SUBMINOR 0 -+ -+/* The maximum length of the options[] array */ -+#define METIS_NOPTIONS 40 -+ -+ -+ -+/*------------------------------------------------------------------------ -+* Function prototypes -+*-------------------------------------------------------------------------*/ -+ -+#ifdef _WINDLL -+#define METIS_API(type) __declspec(dllexport) type __cdecl -+#elif defined(__cdecl) -+#define METIS_API(type) type __cdecl -+#else -+#define METIS_API(type) type -+#endif -+ -+ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+METIS_API(int) METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, -+ idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, -+ idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, -+ idx_t *edgecut, idx_t *part); -+ -+METIS_API(int) METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, -+ idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, -+ idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, -+ idx_t *edgecut, idx_t *part); -+ -+METIS_API(int) METIS_MeshToDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -+ idx_t *ncommon, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy); -+ -+METIS_API(int) METIS_MeshToNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -+ idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy); -+ -+METIS_API(int) METIS_PartMeshNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -+ idx_t *vwgt, idx_t *vsize, idx_t *nparts, real_t *tpwgts, -+ idx_t *options, idx_t *objval, idx_t *epart, idx_t *npart); -+ -+METIS_API(int) METIS_PartMeshDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, -+ idx_t *vwgt, idx_t *vsize, idx_t *ncommon, idx_t *nparts, -+ real_t *tpwgts, idx_t *options, idx_t *objval, idx_t *epart, -+ idx_t *npart); -+ -+METIS_API(int) METIS_NodeND(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, -+ idx_t *options, idx_t *perm, idx_t *iperm); -+ -+METIS_API(int) METIS_Free(void *ptr); -+ -+METIS_API(int) METIS_SetDefaultOptions(idx_t *options); -+ -+ -+/* These functions are used by ParMETIS */ -+ -+METIS_API(int) METIS_NodeNDP(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, -+ idx_t npes, idx_t *options, idx_t *perm, idx_t *iperm, -+ idx_t *sizes); -+ -+METIS_API(int) METIS_ComputeVertexSeparator(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, -+ idx_t *vwgt, idx_t *options, idx_t *sepsize, idx_t *part); -+ -+METIS_API(int) METIS_NodeRefine(idx_t nvtxs, idx_t *xadj, idx_t *vwgt, idx_t *adjncy, -+ idx_t *where, idx_t *hmarker, real_t ubfactor); -+ -+ -+/* These functions are used by DGL */ -+ -+METIS_API(int) METIS_CacheFriendlyReordering(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, -+ idx_t *part, idx_t *old2new); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+ -+ -+/*------------------------------------------------------------------------ -+* Enum type definitions -+*-------------------------------------------------------------------------*/ -+/*! Return codes */ -+typedef enum { -+ METIS_OK = 1, /*!< Returned normally */ -+ METIS_ERROR_INPUT = -2, /*!< Returned due to erroneous inputs and/or options */ -+ METIS_ERROR_MEMORY = -3, /*!< Returned due to insufficient memory */ -+ METIS_ERROR = -4 /*!< Some other errors */ -+} rstatus_et; -+ -+ -+/*! Operation type codes */ -+typedef enum { -+ METIS_OP_PMETIS, -+ METIS_OP_KMETIS, -+ METIS_OP_OMETIS -+} moptype_et; -+ -+ -+/*! Options codes (i.e., options[]) */ -+typedef enum { -+ METIS_OPTION_PTYPE, -+ METIS_OPTION_OBJTYPE, -+ METIS_OPTION_CTYPE, -+ METIS_OPTION_IPTYPE, -+ METIS_OPTION_RTYPE, -+ METIS_OPTION_DBGLVL, -+ METIS_OPTION_NIPARTS, -+ METIS_OPTION_NITER, -+ METIS_OPTION_NCUTS, -+ METIS_OPTION_SEED, -+ METIS_OPTION_NO2HOP, -+ METIS_OPTION_ONDISK, -+ METIS_OPTION_MINCONN, -+ METIS_OPTION_CONTIG, -+ METIS_OPTION_COMPRESS, -+ METIS_OPTION_CCORDER, -+ METIS_OPTION_PFACTOR, -+ METIS_OPTION_NSEPS, -+ METIS_OPTION_UFACTOR, -+ METIS_OPTION_NUMBERING, -+ METIS_OPTION_DROPEDGES, -+ -+ /* Used for command-line parameter purposes */ -+ METIS_OPTION_HELP, -+ METIS_OPTION_TPWGTS, -+ METIS_OPTION_NCOMMON, -+ METIS_OPTION_NOOUTPUT, -+ METIS_OPTION_BALANCE, -+ METIS_OPTION_GTYPE, -+ METIS_OPTION_UBVEC -+} moptions_et; -+ -+ -+/*! Partitioning Schemes */ -+typedef enum { -+ METIS_PTYPE_RB, -+ METIS_PTYPE_KWAY -+} mptype_et; -+ -+/*! Graph types for meshes */ -+typedef enum { -+ METIS_GTYPE_DUAL, -+ METIS_GTYPE_NODAL -+} mgtype_et; -+ -+/*! Coarsening Schemes */ -+typedef enum { -+ METIS_CTYPE_RM, -+ METIS_CTYPE_SHEM -+} mctype_et; -+ -+/*! Initial partitioning schemes */ -+typedef enum { -+ METIS_IPTYPE_GROW, -+ METIS_IPTYPE_RANDOM, -+ METIS_IPTYPE_EDGE, -+ METIS_IPTYPE_NODE, -+ METIS_IPTYPE_METISRB -+} miptype_et; -+ -+ -+/*! Refinement schemes */ -+typedef enum { -+ METIS_RTYPE_FM, -+ METIS_RTYPE_GREEDY, -+ METIS_RTYPE_SEP2SIDED, -+ METIS_RTYPE_SEP1SIDED -+} mrtype_et; -+ -+ -+/*! Debug Levels */ -+typedef enum { -+ METIS_DBG_INFO = 1, /*!< Shows various diagnostic messages */ -+ METIS_DBG_TIME = 2, /*!< Perform timing analysis */ -+ METIS_DBG_COARSEN = 4, /*!< Show the coarsening progress */ -+ METIS_DBG_REFINE = 8, /*!< Show the refinement progress */ -+ METIS_DBG_IPART = 16, /*!< Show info on initial partitioning */ -+ METIS_DBG_MOVEINFO = 32, /*!< Show info on vertex moves during refinement */ -+ METIS_DBG_SEPINFO = 64, /*!< Show info on vertex moves during sep refinement */ -+ METIS_DBG_CONNINFO = 128, /*!< Show info on minimization of subdomain connectivity */ -+ METIS_DBG_CONTIGINFO = 256, /*!< Show info on elimination of connected components */ -+ METIS_DBG_MEMORY = 2048, /*!< Show info related to wspace allocation */ -+} mdbglvl_et; -+ -+ -+/* Types of objectives */ -+typedef enum { -+ METIS_OBJTYPE_CUT, -+ METIS_OBJTYPE_VOL, -+ METIS_OBJTYPE_NODE -+} mobjtype_et; -+ -+ -+ -+#endif /* _METIS_H_ */ diff --git a/recipes/metis/all/patches/003-remove-programs.patch b/recipes/metis/all/patches/003-remove-programs.patch deleted file mode 100644 index 73a59f03ddbac..0000000000000 --- a/recipes/metis/all/patches/003-remove-programs.patch +++ /dev/null @@ -1,8 +0,0 @@ -Do not build programs ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -44,4 +44,3 @@ endif () - - # Recursively look for CMakeLists.txt in subdirs. - add_subdirectory("libmetis") --add_subdirectory("programs") diff --git a/recipes/metis/all/patches/004-use-conan-gklib.patch b/recipes/metis/all/patches/004-use-conan-gklib.patch deleted file mode 100644 index 60a824f3c58d1..0000000000000 --- a/recipes/metis/all/patches/004-use-conan-gklib.patch +++ /dev/null @@ -1,17 +0,0 @@ -find gklib from conan ---- a/libmetis/CMakeLists.txt -+++ b/libmetis/CMakeLists.txt -@@ -3,9 +3,11 @@ include_directories(.) - # Find sources. - file(GLOB metis_sources *.c) - # Build libmetis. --add_library(metis ${METIS_LIBRARY_TYPE} ${GKlib_sources} ${metis_sources}) -+add_library(metis ${METIS_LIBRARY_TYPE} ${metis_sources}) -+find_package(gklib REQUIRED) -+target_link_libraries(metis PRIVATE gklib::gklib) - if(UNIX) -- target_link_libraries(metis m) -+ target_link_libraries(metis PRIVATE m) - endif() - - if(METIS_INSTALL) diff --git a/recipes/metis/all/patches/005-fix-install.patch b/recipes/metis/all/patches/005-fix-install.patch deleted file mode 100644 index 0ddb28f482535..0000000000000 --- a/recipes/metis/all/patches/005-fix-install.patch +++ /dev/null @@ -1,28 +0,0 @@ -Always install and fix runtime destination ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -4,11 +4,7 @@ project(METIS C) - set(GKLIB_PATH "${CMAKE_SOURCE_DIR}/GKlib" CACHE PATH "path to GKlib") - set(SHARED FALSE CACHE BOOL "build a shared library") - --if(MSVC) -- set(METIS_INSTALL FALSE) --else() -- set(METIS_INSTALL TRUE) --endif() -+set(METIS_INSTALL TRUE) - - # Configure libmetis library. - if(SHARED) -diff --git a/libmetis/CMakeLists.txt b/libmetis/CMakeLists.txt -index b577360..e9c7825 100644 ---- a/libmetis/CMakeLists.txt -+++ b/libmetis/CMakeLists.txt -@@ -13,6 +13,6 @@ endif() - if(METIS_INSTALL) - install(TARGETS metis - LIBRARY DESTINATION lib -- RUNTIME DESTINATION lib -+ RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib) - endif() diff --git a/recipes/metis/all/patches/5.1.1-001-fix-coarse-graph-memory-bugs.patch b/recipes/metis/all/patches/5.1.1-001-fix-coarse-graph-memory-bugs.patch new file mode 100644 index 0000000000000..d1640f063425d --- /dev/null +++ b/recipes/metis/all/patches/5.1.1-001-fix-coarse-graph-memory-bugs.patch @@ -0,0 +1,246 @@ +From 36262adecaa9720a4417a67124428061c367fd3f Mon Sep 17 00:00:00 2001 +From: George Karypis +Date: Fri, 27 Nov 2020 23:17:52 +0000 +Subject: [PATCH] fixed a memory bug that appears when the coarser graph stayed + the same size as the original graph + +diff --git a/libmetis/coarsen.c b/libmetis/coarsen.c +--- a/libmetis/coarsen.c ++++ b/libmetis/coarsen.c +@@ -629,7 +629,7 @@ + idx_t *xadj, *vwgt, *adjncy, *adjwgt, *maxvwgt; + idx_t *match, *cmap, *degrees, *perm, *tperm, *vec, *marker; + idx_t mytwgt, xtwgt, ctwgt; +- float bscore, score; ++ real_t bscore, score; + + WCOREPUSH; + +@@ -817,6 +817,7 @@ + printf(" ]\n"); + } + ++#if 0 + + /*************************************************************************/ + /*! This function creates the coarser graph. It uses a simple hash-table +@@ -1327,6 +1328,7 @@ + WCOREPOP; + } + ++#endif + + /*************************************************************************/ + /*! This function creates the coarser graph. Depending on the size of the +@@ -1340,11 +1342,11 @@ + idx_t j, jj, k, kk, l, m, istart, iend, nvtxs, nedges, ncon, + cnedges, v, u, mask; + idx_t *xadj, *vwgt, *vsize, *adjncy, *adjwgt; +- idx_t *cmap, *htable, *table; ++ idx_t *cmap, *htable, *dtable; + idx_t *cxadj, *cvwgt, *cvsize, *cadjncy, *cadjwgt; + graph_t *cgraph; + int dovsize, dropedges; +- idx_t cv, nkeep, droppedewgt; ++ idx_t cv, nkeys, droppedewgt; + idx_t *keys=NULL, *medianewgts=NULL, *noise=NULL; + + WCOREPUSH; +@@ -1367,12 +1369,13 @@ + + /* Setup structures for dropedges */ + if (dropedges) { +- for (nkeep=-1, v=0; vadjncy; + cadjwgt = cgraph->adjwgt; + +- htable = iset(gk_min(cnvtxs+1, mask+1), -1, iwspacemalloc(ctrl, mask+1)); +- table = iset(cnvtxs, -1, iwspacemalloc(ctrl, cnvtxs)); ++ htable = iset(mask+1, -1, iwspacemalloc(ctrl, mask+1)); /* hash table */ ++ dtable = iset(cnvtxs, -1, iwspacemalloc(ctrl, cnvtxs)); /* direct table */ + + cxadj[0] = cnvtxs = cnedges = 0; + for (v=0; v=0; j--) { + k = cadjncy[j]; +- for (kk=k&mask; cadjncy[htable[kk]]!=k; kk=((kk+1)%mask)); ++ for (kk=k&mask; cadjncy[htable[kk]]!=k; kk=((kk+1)&mask)); + htable[kk] = -1; + } + +@@ -1474,10 +1478,10 @@ + iend = xadj[v+1]; + for (j=istart; j= min(medianewgts[u], medianewgts[v]) */ + if (dropedges) { +- for (j=0; j>1)]; ++ ASSERTP(nedges < nkeys, ("%"PRIDX", %"PRIDX"\n", nkeys, nedges)); ++ medianewgts[cnvtxs] = 8; /* default for island nodes */ ++ if (nedges > 0) { ++ for (j=0; j>1))]; ++ } + } + + cadjncy += nedges; +@@ -1542,6 +1550,8 @@ + iend = cxadj[u+1]; + for (j=istart; j= 0, ("%"PRIDX" %"PRIDX"\n", u, medianewgts[u])); ++ ASSERTP(medianewgts[v] >= 0, ("%"PRIDX" %"PRIDX" %"PRIDX"\n", v, medianewgts[v], cnvtxs)); + if ((cadjwgt[j]<<8) + noise[u] + noise[v] >= gk_min(medianewgts[u], medianewgts[v])) { + cadjncy[cnedges] = cadjncy[j]; + cadjwgt[cnedges++] = cadjwgt[j]; +@@ -1573,6 +1583,7 @@ + WCOREPOP; + } + ++#if 0 + + /*************************************************************************/ + /*! This function creates the coarser graph. It uses a full-size array +@@ -1925,6 +1936,7 @@ + WCOREPOP; + } + ++#endif + + /*************************************************************************/ + /*! Setup the various arrays for the coarse graph +@@ -1942,10 +1954,14 @@ + cgraph->finer = graph; + graph->coarser = cgraph; + +- /* Allocate memory for the coarser graph */ ++ /* Allocate memory for the coarser graph. ++ NOTE: The +1 in the adjwgt/adjncy is to allow the optimization of self-loop ++ detection by adding ahead of time the self-loop. That optimization ++ requires a +1 adjncy/adjwgt array for the limit case where the ++ coarser graph is of the same size of the previous graph. */ + cgraph->xadj = imalloc(cnvtxs+1, "SetupCoarseGraph: xadj"); +- cgraph->adjncy = imalloc(graph->nedges, "SetupCoarseGraph: adjncy"); +- cgraph->adjwgt = imalloc(graph->nedges, "SetupCoarseGraph: adjwgt"); ++ cgraph->adjncy = imalloc(graph->nedges+1, "SetupCoarseGraph: adjncy"); ++ cgraph->adjwgt = imalloc(graph->nedges+1, "SetupCoarseGraph: adjwgt"); + cgraph->vwgt = imalloc(cgraph->ncon*cnvtxs, "SetupCoarseGraph: vwgt"); + cgraph->tvwgt = imalloc(cgraph->ncon, "SetupCoarseGraph: tvwgt"); + cgraph->invtvwgt = rmalloc(cgraph->ncon, "SetupCoarseGraph: invtvwgt"); +diff --git a/libmetis/proto.h b/libmetis/proto.h +--- a/libmetis/proto.h ++++ b/libmetis/proto.h +@@ -51,10 +51,6 @@ + void PrintCGraphStats(ctrl_t *ctrl, graph_t *graph); + void CreateCoarseGraph(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, + idx_t *match); +-void CreateCoarseGraphNoMask(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, +- idx_t *match); +-void CreateCoarseGraphPerm(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, +- idx_t *match, idx_t *perm); + graph_t *SetupCoarseGraph(graph_t *graph, idx_t cnvtxs, int dovsize); + void ReAdjustMemory(ctrl_t *ctrl, graph_t *graph, graph_t *cgraph); + +diff --git a/libmetis/rename.h b/libmetis/rename.h +--- a/libmetis/rename.h ++++ b/libmetis/rename.h +@@ -41,8 +41,6 @@ + #define Match_JC libmetis__Match_JC + #define PrintCGraphStats libmetis__PrintCGraphStats + #define CreateCoarseGraph libmetis__CreateCoarseGraph +-#define CreateCoarseGraphNoMask libmetis__CreateCoarseGraphNoMask +-#define CreateCoarseGraphPerm libmetis__CreateCoarseGraphPerm + #define SetupCoarseGraph libmetis__SetupCoarseGraph + #define ReAdjustMemory libmetis__ReAdjustMemory + diff --git a/recipes/metis/all/patches/5.1.1-002-fix-out-out-of-bounds-errors.patch b/recipes/metis/all/patches/5.1.1-002-fix-out-out-of-bounds-errors.patch new file mode 100644 index 0000000000000..2e67aa23bc3a8 --- /dev/null +++ b/recipes/metis/all/patches/5.1.1-002-fix-out-out-of-bounds-errors.patch @@ -0,0 +1,199 @@ +Fix out out-of-bounds memory errors + +Squashed commits: +- Avoid out-of-bound memory access for empty graphs +- Fixed incorrect part[] vector when nparts == 1 +- issue #46: fixed the out-of-bound with mdeg+delta + +diff --git a/libmetis/checkgraph.c b/libmetis/checkgraph.c +--- a/libmetis/checkgraph.c ++++ b/libmetis/checkgraph.c +@@ -45,9 +45,11 @@ + + htable = ismalloc(nvtxs, 0, "htable"); + +- minedge = maxedge = adjncy[0]; +- if (adjwgt) +- minewgt = maxewgt = adjwgt[0]; ++ if (graph->nedges > 0) { ++ minedge = maxedge = adjncy[0]; ++ if (adjwgt) ++ minewgt = maxewgt = adjwgt[0]; ++ } + + for (i=0; idbglvl, METIS_DBG_TIME, InitTimers(ctrl)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_startcputimer(ctrl->TotalTmr)); + +- if (ctrl->dbglvl&512) { +- *objval = BlockKWayPartitioning(ctrl, graph, part); +- } +- else { +- *objval = MlevelKWayPartitioning(ctrl, graph, part); +- } ++ iset(*nvtxs, 0, part); ++ if (ctrl->dbglvl&512) ++ *objval = (*nparts == 1 ? 0 : BlockKWayPartitioning(ctrl, graph, part)); ++ else ++ *objval = (*nparts == 1 ? 0 : MlevelKWayPartitioning(ctrl, graph, part)); + + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->TotalTmr)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, PrintTimers(ctrl)); +diff --git a/libmetis/mmd.c b/libmetis/mmd.c +--- a/libmetis/mmd.c ++++ b/libmetis/mmd.c +@@ -59,24 +59,24 @@ + if (neqns <= 0) + return; + +- /* Adjust from C to Fortran */ ++ /* adjust from C to Fortran */ + xadj--; adjncy--; invp--; perm--; head--; qsize--; list--; marker--; + +- /* initialization for the minimum degree algorithm. */ ++ /* initialization for the minimum degree algorithm */ + *ncsub = 0; + mmdint(neqns, xadj, adjncy, head, invp, perm, qsize, list, marker); + +- /* 'num' counts the number of ordered nodes plus 1. */ ++ /* 'num' counts the number of ordered nodes plus 1 */ + num = 1; + +- /* eliminate all isolated nodes. */ ++ /* eliminate all isolated nodes */ + nextmd = head[1]; + while (nextmd > 0) { + mdeg_node = nextmd; + nextmd = invp[mdeg_node]; + marker[mdeg_node] = maxint; + invp[mdeg_node] = -num; +- num = num + 1; ++ num++; + } + + /* search for node of the minimum degree. 'mdeg' is the current */ +@@ -87,14 +87,16 @@ + head[1] = 0; + mdeg = 2; + +- /* infinite loop here ! */ ++ /* infinite loop here */ + while (1) { + while (head[mdeg] <= 0) + mdeg++; + + /* use value of 'delta' to set up 'mdlmt', which governs */ + /* when a degree update is to be performed. */ +- mdlmt = mdeg + delta; ++ //mdlmt = mdeg + delta; ++ // the need for gk_min() was identified by jsf67 ++ mdlmt = gk_min(neqns, mdeg+delta); + ehead = 0; + + n500: +@@ -107,7 +109,7 @@ + mdeg_node = head[mdeg]; + }; + +- /* remove 'mdeg_node' from the degree structure. */ ++ /* remove 'mdeg_node' from the degree structure */ + nextmd = invp[mdeg_node]; + head[mdeg] = nextmd; + if (nextmd > 0) +@@ -140,7 +142,7 @@ + /* minimum degree nodes elimination. */ + if (num > neqns) + goto n1000; +- mmdupd( ehead, neqns, xadj, adjncy, delta, &mdeg, head, invp, perm, qsize, list, marker, maxint, &tag); ++ mmdupd(ehead, neqns, xadj, adjncy, delta, &mdeg, head, invp, perm, qsize, list, marker, maxint, &tag); + }; /* end of -- while ( 1 ) -- */ + + n1000: +@@ -289,6 +291,7 @@ + return; + } + ++ + /*************************************************************************** + * mmdint ---- mult minimum degree initialization + * purpose -- this routine performs initialization for the +@@ -305,33 +308,30 @@ + idx_t mmdint(idx_t neqns, idx_t *xadj, idx_t *adjncy, idx_t *head, idx_t *forward, + idx_t *backward, idx_t *qsize, idx_t *list, idx_t *marker) + { +- idx_t fnode, ndeg, node; ++ idx_t fnode, ndeg, node; + +- for ( node = 1; node <= neqns; node++ ) { +- head[node] = 0; +- qsize[node] = 1; +- marker[node] = 0; +- list[node] = 0; +- }; ++ for (node=1; node<=neqns; node++) { ++ head[node] = 0; ++ qsize[node] = 1; ++ marker[node] = 0; ++ list[node] = 0; ++ }; + +- /* initialize the degree doubly linked lists. */ +- for ( node = 1; node <= neqns; node++ ) { +- // The following is something that Olaf Schenk identified as potentially a +- // bug that I introduced in the original code. For now, I reverted back +- // to the original code until I have some time to check. +- // ndeg = xadj[node+1] - xadj[node]/* + 1*/; /* george */ +- ndeg = xadj[node+1] - xadj[node] + 1; +- if (ndeg == 0) +- ndeg = 1; +- fnode = head[ndeg]; +- forward[node] = fnode; +- head[ndeg] = node; +- if ( fnode > 0 ) backward[fnode] = node; +- backward[node] = -ndeg; +- }; +- return 0; ++ /* initialize the degree doubly linked lists. */ ++ for (node=1; node<=neqns; node++) { ++ ndeg = xadj[node+1]-xadj[node]+1; ++ fnode = head[ndeg]; ++ forward[node] = fnode; ++ head[ndeg] = node; ++ if (fnode > 0) ++ backward[fnode] = node; ++ backward[node] = -ndeg; ++ }; ++ ++ return 0; + } + ++ + /**************************************************************************** + * mmdnum --- multi minimum degree numbering + * purpose -- this routine performs the final step in producing +@@ -395,6 +395,7 @@ + return; + } + ++ + /**************************************************************************** + * mmdupd ---- multiple minimum degree update + * purpose -- this routine updates the degrees of nodes after a +diff --git a/libmetis/pmetis.c b/libmetis/pmetis.c +--- a/libmetis/pmetis.c ++++ b/libmetis/pmetis.c +@@ -130,7 +130,8 @@ + IFSET(ctrl->dbglvl, METIS_DBG_TIME, InitTimers(ctrl)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_startcputimer(ctrl->TotalTmr)); + +- *objval = MlevelRecursiveBisection(ctrl, graph, *nparts, part, ctrl->tpwgts, 0); ++ iset(*nvtxs, 0, part); ++ *objval = (*nparts == 1 ? 0 : MlevelRecursiveBisection(ctrl, graph, *nparts, part, ctrl->tpwgts, 0)); + + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->TotalTmr)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, PrintTimers(ctrl)); diff --git a/recipes/metis/all/patches/5.1.1-003-reduce-maximum-memory-use.patch b/recipes/metis/all/patches/5.1.1-003-reduce-maximum-memory-use.patch new file mode 100644 index 0000000000000..93745cf28bbb4 --- /dev/null +++ b/recipes/metis/all/patches/5.1.1-003-reduce-maximum-memory-use.patch @@ -0,0 +1,197 @@ +From aef54c5b2a72f9d0c3c91b008c35271560b79cac Mon Sep 17 00:00:00 2001 +From: George Karypis +Date: Fri, 7 Jan 2022 14:01:46 +0000 +Subject: [PATCH] Small changes to reduce maximum memory use + +diff --git a/libmetis/checkgraph.c b/libmetis/checkgraph.c +--- a/libmetis/checkgraph.c ++++ b/libmetis/checkgraph.c +@@ -45,9 +45,11 @@ + + htable = ismalloc(nvtxs, 0, "htable"); + +- minedge = maxedge = adjncy[0]; +- if (adjwgt) +- minewgt = maxewgt = adjwgt[0]; ++ if (graph->nedges > 0) { ++ minedge = maxedge = adjncy[0]; ++ if (adjwgt) ++ minewgt = maxewgt = adjwgt[0]; ++ } + + for (i=0; idbglvl, METIS_DBG_TIME, InitTimers(ctrl)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_startcputimer(ctrl->TotalTmr)); + +- if (ctrl->dbglvl&512) { +- *objval = BlockKWayPartitioning(ctrl, graph, part); +- } +- else { +- *objval = MlevelKWayPartitioning(ctrl, graph, part); +- } ++ iset(*nvtxs, 0, part); ++ if (ctrl->dbglvl&512) ++ *objval = (*nparts == 1 ? 0 : BlockKWayPartitioning(ctrl, graph, part)); ++ else ++ *objval = (*nparts == 1 ? 0 : MlevelKWayPartitioning(ctrl, graph, part)); + + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->TotalTmr)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, PrintTimers(ctrl)); +diff --git a/libmetis/mmd.c b/libmetis/mmd.c +--- a/libmetis/mmd.c ++++ b/libmetis/mmd.c +@@ -59,24 +59,24 @@ + if (neqns <= 0) + return; + +- /* Adjust from C to Fortran */ ++ /* adjust from C to Fortran */ + xadj--; adjncy--; invp--; perm--; head--; qsize--; list--; marker--; + +- /* initialization for the minimum degree algorithm. */ ++ /* initialization for the minimum degree algorithm */ + *ncsub = 0; + mmdint(neqns, xadj, adjncy, head, invp, perm, qsize, list, marker); + +- /* 'num' counts the number of ordered nodes plus 1. */ ++ /* 'num' counts the number of ordered nodes plus 1 */ + num = 1; + +- /* eliminate all isolated nodes. */ ++ /* eliminate all isolated nodes */ + nextmd = head[1]; + while (nextmd > 0) { + mdeg_node = nextmd; + nextmd = invp[mdeg_node]; + marker[mdeg_node] = maxint; + invp[mdeg_node] = -num; +- num = num + 1; ++ num++; + } + + /* search for node of the minimum degree. 'mdeg' is the current */ +@@ -87,14 +87,16 @@ + head[1] = 0; + mdeg = 2; + +- /* infinite loop here ! */ ++ /* infinite loop here */ + while (1) { + while (head[mdeg] <= 0) + mdeg++; + + /* use value of 'delta' to set up 'mdlmt', which governs */ + /* when a degree update is to be performed. */ +- mdlmt = mdeg + delta; ++ //mdlmt = mdeg + delta; ++ // the need for gk_min() was identified by jsf67 ++ mdlmt = gk_min(neqns, mdeg+delta); + ehead = 0; + + n500: +@@ -107,7 +109,7 @@ + mdeg_node = head[mdeg]; + }; + +- /* remove 'mdeg_node' from the degree structure. */ ++ /* remove 'mdeg_node' from the degree structure */ + nextmd = invp[mdeg_node]; + head[mdeg] = nextmd; + if (nextmd > 0) +@@ -140,7 +142,7 @@ + /* minimum degree nodes elimination. */ + if (num > neqns) + goto n1000; +- mmdupd( ehead, neqns, xadj, adjncy, delta, &mdeg, head, invp, perm, qsize, list, marker, maxint, &tag); ++ mmdupd(ehead, neqns, xadj, adjncy, delta, &mdeg, head, invp, perm, qsize, list, marker, maxint, &tag); + }; /* end of -- while ( 1 ) -- */ + + n1000: +@@ -289,6 +291,7 @@ + return; + } + ++ + /*************************************************************************** + * mmdint ---- mult minimum degree initialization + * purpose -- this routine performs initialization for the +@@ -305,33 +308,30 @@ + idx_t mmdint(idx_t neqns, idx_t *xadj, idx_t *adjncy, idx_t *head, idx_t *forward, + idx_t *backward, idx_t *qsize, idx_t *list, idx_t *marker) + { +- idx_t fnode, ndeg, node; ++ idx_t fnode, ndeg, node; + +- for ( node = 1; node <= neqns; node++ ) { +- head[node] = 0; +- qsize[node] = 1; +- marker[node] = 0; +- list[node] = 0; +- }; ++ for (node=1; node<=neqns; node++) { ++ head[node] = 0; ++ qsize[node] = 1; ++ marker[node] = 0; ++ list[node] = 0; ++ }; + +- /* initialize the degree doubly linked lists. */ +- for ( node = 1; node <= neqns; node++ ) { +- // The following is something that Olaf Schenk identified as potentially a +- // bug that I introduced in the original code. For now, I reverted back +- // to the original code until I have some time to check. +- // ndeg = xadj[node+1] - xadj[node]/* + 1*/; /* george */ +- ndeg = xadj[node+1] - xadj[node] + 1; +- if (ndeg == 0) +- ndeg = 1; +- fnode = head[ndeg]; +- forward[node] = fnode; +- head[ndeg] = node; +- if ( fnode > 0 ) backward[fnode] = node; +- backward[node] = -ndeg; +- }; +- return 0; ++ /* initialize the degree doubly linked lists. */ ++ for (node=1; node<=neqns; node++) { ++ ndeg = xadj[node+1]-xadj[node]+1; ++ fnode = head[ndeg]; ++ forward[node] = fnode; ++ head[ndeg] = node; ++ if (fnode > 0) ++ backward[fnode] = node; ++ backward[node] = -ndeg; ++ }; ++ ++ return 0; + } + ++ + /**************************************************************************** + * mmdnum --- multi minimum degree numbering + * purpose -- this routine performs the final step in producing +@@ -395,6 +395,7 @@ + return; + } + ++ + /**************************************************************************** + * mmdupd ---- multiple minimum degree update + * purpose -- this routine updates the degrees of nodes after a +diff --git a/libmetis/pmetis.c b/libmetis/pmetis.c +--- a/libmetis/pmetis.c ++++ b/libmetis/pmetis.c +@@ -130,7 +130,8 @@ + IFSET(ctrl->dbglvl, METIS_DBG_TIME, InitTimers(ctrl)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_startcputimer(ctrl->TotalTmr)); + +- *objval = MlevelRecursiveBisection(ctrl, graph, *nparts, part, ctrl->tpwgts, 0); ++ iset(*nvtxs, 0, part); ++ *objval = (*nparts == 1 ? 0 : MlevelRecursiveBisection(ctrl, graph, *nparts, part, ctrl->tpwgts, 0)); + + IFSET(ctrl->dbglvl, METIS_DBG_TIME, gk_stopcputimer(ctrl->TotalTmr)); + IFSET(ctrl->dbglvl, METIS_DBG_TIME, PrintTimers(ctrl)); diff --git a/recipes/metis/all/test_package/CMakeLists.txt b/recipes/metis/all/test_package/CMakeLists.txt index 04b6e4c9401dc..54194f54c0961 100644 --- a/recipes/metis/all/test_package/CMakeLists.txt +++ b/recipes/metis/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(metis REQUIRED CONFIG) add_executable(${PROJECT_NAME} test.cpp) diff --git a/recipes/metis/all/test_package/conanfile.py b/recipes/metis/all/test_package/conanfile.py index 46d71712aba54..02eb5ce439fb4 100644 --- a/recipes/metis/all/test_package/conanfile.py +++ b/recipes/metis/all/test_package/conanfile.py @@ -1,17 +1,20 @@ -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 +# It will become the standard on Conan 2.x 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 build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": - # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being - # set. This could be because you are using a Mac OS X version less than 10.5 - # or because CMake's platform configuration is corrupt. - self.build_requires("cmake/3.20.1") + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -19,6 +22,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/metis/all/test_package/test.cpp b/recipes/metis/all/test_package/test.cpp index df955f7eb7be3..6a150009d25d4 100644 --- a/recipes/metis/all/test_package/test.cpp +++ b/recipes/metis/all/test_package/test.cpp @@ -1,10 +1,9 @@ #include #include -#include - -int main(){ +#include +int main() { idx_t nVertices = 6; idx_t nEdges = 7; idx_t nWeights = 1; @@ -14,10 +13,10 @@ int main(){ idx_t part[6]; // Indexes of starting points in adjacent array - idx_t xadj[6+1] = {0,2,5,7,9,12,14}; + idx_t xadj[6 + 1] = {0, 2, 5, 7, 9, 12, 14}; // Adjacent vertices in consecutive index order - idx_t adjncy[2 * 7] = {1,3,0,4,2,1,5,0,4,3,1,5,4,2}; + idx_t adjncy[2 * 7] = {1, 3, 0, 4, 2, 1, 5, 0, 4, 3, 1, 5, 4, 2}; // Weights of vertices // if all weights are equal then can be set to NULL @@ -29,7 +28,7 @@ int main(){ std::cout << ret << std::endl; - for(unsigned part_i = 0; part_i < nVertices; part_i++){ + for (unsigned part_i = 0; part_i < nVertices; part_i++) { std::cout << part_i << " " << part[part_i] << std::endl; } diff --git a/recipes/metis/config.yml b/recipes/metis/config.yml index e7148244c2a2f..bf774fe223f43 100644 --- a/recipes/metis/config.yml +++ b/recipes/metis/config.yml @@ -1,3 +1,5 @@ versions: + "5.2.1": + folder: all "5.1.1": folder: all diff --git a/recipes/microservice-essentials/all/conandata.yml b/recipes/microservice-essentials/all/conandata.yml new file mode 100644 index 0000000000000..79b465764338c --- /dev/null +++ b/recipes/microservice-essentials/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/seboste/microservice-essentials/archive/refs/tags/0.1.0.tar.gz" + sha256: "9739f7052ee9de96c4b206e0d345d6de5594dcf2bd6f8d3364d44788e83fbe58" diff --git a/recipes/microservice-essentials/all/conanfile.py b/recipes/microservice-essentials/all/conanfile.py new file mode 100644 index 0000000000000..f5d6bdeaef07d --- /dev/null +++ b/recipes/microservice-essentials/all/conanfile.py @@ -0,0 +1,105 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +import os + +required_conan_version = ">=1.53.0" + +class MicroserviceEssentials(ConanFile): + name = "microservice-essentials" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/seboste/microservice-essentials" + license = "MIT" + description = """microservice-essentials is a portable, independent C++ library that takes care of typical recurring concerns that occur in microservice development.""" + topics = ("microservices", "cloud-native", "request-handling") + settings = "os", "compiler", "arch", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_tests": [True, False], + "with_examples": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_tests": False, + "with_examples": False + } + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15.7", + "msvc": "191", + } + + def build_requirements(self): + self.tool_requires("cmake/[>=3.16.3 <4]") + + def requirements(self): + if self.options.with_examples: + self.requires("cpp-httplib/0.12.4") + self.requires("nlohmann_json/3.11.2") + self.requires("openssl/[>=3 <4]") + self.requires("grpc/1.50.1") + if self.options.with_tests: + self.requires("catch2/3.3.2") + self.requires("nlohmann_json/3.11.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["BUILD_TESTING"] = self.options.with_tests + tc.variables["BUILD_EXAMPLES"] = self.options.with_examples + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "17") + + 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._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( + "{} requires C++17, which your compiler does not support.".format(self.name) + ) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def 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 = ["microservice-essentials"] + self.cpp_info.bindirs.extend(["lib"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/microservice-essentials/all/test_package/CMakeLists.txt b/recipes/microservice-essentials/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f5945294e9935 --- /dev/null +++ b/recipes/microservice-essentials/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +find_package(microservice-essentials REQUIRED) + +add_executable(test_package main.cpp) +target_link_libraries(test_package microservice-essentials::microservice-essentials) diff --git a/recipes/microservice-essentials/all/test_package/conanfile.py b/recipes/microservice-essentials/all/test_package/conanfile.py new file mode 100644 index 0000000000000..27bfec4efb0d4 --- /dev/null +++ b/recipes/microservice-essentials/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan import ConanFile +from conan.tools.build import cross_building +import os + +class TestPckage(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/microservice-essentials/all/test_package/main.cpp b/recipes/microservice-essentials/all/test_package/main.cpp new file mode 100644 index 0000000000000..bb1a1722bce6b --- /dev/null +++ b/recipes/microservice-essentials/all/test_package/main.cpp @@ -0,0 +1,13 @@ +#include +#include +#include + +int main() +{ + mse::Context ctx; + std::cout << "context created" << std::endl; + // SignalHandler requires pthread. Check if it builds. + mse::SignalHandler signal_handler(mse::Signal::SIG_SHUTDOWN, []() {}); + std::cout << "signal_handler created" << std::endl; + return 0; +} diff --git a/recipes/microservice-essentials/config.yml b/recipes/microservice-essentials/config.yml new file mode 100644 index 0000000000000..5e5e3d8a61814 --- /dev/null +++ b/recipes/microservice-essentials/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: "all" diff --git a/recipes/mingw-builds/all/conanfile.py b/recipes/mingw-builds/all/conanfile.py index f3b3a8f3278f4..8b875ba354b42 100644 --- a/recipes/mingw-builds/all/conanfile.py +++ b/recipes/mingw-builds/all/conanfile.py @@ -1,7 +1,7 @@ import os from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import download, rmdir +from conan.tools.files import copy, download, rmdir required_conan_version = ">=1.47.0" @@ -16,7 +16,6 @@ class MingwConan(ConanFile): settings = "os", "arch" options = {"threads": ["posix", "win32"], "exception": ["seh", "sjlj"]} default_options = {"threads": "posix", "exception": "seh"} - provides = "mingw-w64" @property @@ -38,15 +37,17 @@ def validate(self): if str(self.settings_target.arch) not in valid_arch: raise ConanInvalidConfiguration(f"MinGW {self.version} is only supported for the following architectures on {self.settings.os}: {valid_arch}") if self.settings_target.compiler != "gcc": - raise ConanInvalidConfiguration("Only GCC is allowed as compiler.") - if str(self.settings_target.compiler.threads) != str(self.options.threads): - raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " - f"with threads={self.options.threads}, your profile:host declares " - f"threads={self.settings_target.compiler.threads}, please use the same value for both.") - if str(self.settings_target.compiler.exception) != str(self.options.exception): - raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " - f"with exception={self.options.exception}, your profile:host declares " - f"exception={self.settings_target.compiler.exception}, please use the same value for both.") + self.output.warning("Only GCC is allowed as compiler. Make sure you are using the right compiler with this package!") + threads_value = self.settings_target.compiler.get_safe("threads") + if str(threads_value) != str(self.options.threads): + self.output.warning("Tool require 'mingw-builds' provides binaries for gcc " + f"with options.threads={self.options.threads}, but your profile:host declares " + f"settings.compiler.threads={threads_value}, please use the same value for both.") + exception_value = self.settings_target.compiler.get_safe("exception") + if str(exception_value) != str(self.options.exception): + self.output.warning("Tool require 'mingw-builds' provides binaries for gcc " + f"with options.exception={self.options.exception}, your profile:host declares " + f"settings.compiler.exception={exception_value}, please use the same value for both.") def build_requirements(self): self.build_requires("7zip/19.00") @@ -62,7 +63,7 @@ def build(self): def package(self): target = "mingw64" if self.settings.arch == "x86_64" else "mingw32" - self.copy("*", dst="", src=target) + copy(self, "*", src=target, dst=self.package_folder) rmdir(self, target) rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "opt", "lib", "cmake")) @@ -70,18 +71,34 @@ def package(self): def package_info(self): if getattr(self, "settings_target", None): if self.settings_target.compiler != "gcc": - raise ConanInvalidConfiguration("Only GCC is allowed as compiler.") - if str(self.settings_target.compiler.threads) != str(self.options.threads): - raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " - f"with threads={self.options.threads}, your profile:host declares " - f"threads={self.settings_target.compiler.threads}, please use the same value for both.") - if str(self.settings_target.compiler.exception) != str(self.options.exception): - raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " - f"with exception={self.options.exception}, your profile:host declares " - f"exception={self.settings_target.compiler.exception}, please use the same value for both.") + self.output.warning("Only GCC is allowed as compiler. Make sure you are using the right compiler with this package!") + threads_value = self.settings_target.compiler.get_safe("threads") + if str(threads_value) != str(self.options.threads): + self.output.warning("Tool require 'mingw-builds' provides binaries for gcc " + f"with options.threads={self.options.threads}, but your profile:host declares " + f"settings.compiler.threads={threads_value}, please use the same value for both.") + exception_value = self.settings_target.compiler.get_safe("exception") + if str(exception_value) != str(self.options.exception): + self.output.warning("Tool require 'mingw-builds' provides binaries for gcc " + f"with options.exception={self.options.exception}, your profile:host declares " + f"settings.compiler.exception={exception_value}, please use the same value for both.") + + self.buildenv_info.define("MINGW_HOME", str(self.package_folder)) + self.buildenv_info.define("CONAN_CMAKE_GENERATOR", "MinGW Makefiles") + self.buildenv_info.define("CXX", os.path.join(self.package_folder, "bin", "g++.exe").replace("\\", "/")) + self.buildenv_info.define("CC", os.path.join(self.package_folder, "bin", "gcc.exe").replace("\\", "/")) + self.buildenv_info.define("LD", os.path.join(self.package_folder, "bin", "ld.exe").replace("\\", "/")) + self.buildenv_info.define("NM", os.path.join(self.package_folder, "bin", "nm.exe").replace("\\", "/")) + self.buildenv_info.define("AR", os.path.join(self.package_folder, "bin", "ar.exe").replace("\\", "/")) + self.buildenv_info.define("AS", os.path.join(self.package_folder, "bin", "as.exe").replace("\\", "/")) + self.buildenv_info.define("STRIP", os.path.join(self.package_folder, "bin", "strip.exe").replace("\\", "/")) + self.buildenv_info.define("RANLIB", os.path.join(self.package_folder, "bin", "ranlib.exe").replace("\\", "/")) + self.buildenv_info.define("STRINGS", os.path.join(self.package_folder, "bin", "strings.exe").replace("\\", "/")) + self.buildenv_info.define("OBJDUMP", os.path.join(self.package_folder, "bin", "objdump.exe").replace("\\", "/")) + self.buildenv_info.define("GCOV", os.path.join(self.package_folder, "bin", "gcov.exe").replace("\\", "/")) + # TODO: Remove this after conan v1 support is dropped 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.MINGW_HOME = str(self.package_folder) diff --git a/recipes/mingw-builds/all/test_package/conanfile.py b/recipes/mingw-builds/all/test_package/conanfile.py index fde2fbd35a165..dbf3513dc9ad8 100644 --- a/recipes/mingw-builds/all/test_package/conanfile.py +++ b/recipes/mingw-builds/all/test_package/conanfile.py @@ -1,16 +1,14 @@ import os -from conans import ConanFile, tools +from conan import ConanFile class MinGWTestConan(ConanFile): - generators = "gcc" - settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + settings = "os", "arch" + test_type = "explicit" - def build(self): - source_file = os.path.join(self.source_folder, "main.cpp") - self.run("gcc.exe {} @conanbuildinfo.gcc -lstdc++ -o main".format(source_file), run_environment=True) + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def test(self): - if not tools.cross_building(self): - self.run("gcc.exe --version", run_environment=True) - self.run("main") + self.run("gcc.exe --version") diff --git a/recipes/mingw-builds/all/test_package/main.cpp b/recipes/mingw-builds/all/test_package/main.cpp deleted file mode 100644 index b5597569f64e0..0000000000000 --- a/recipes/mingw-builds/all/test_package/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include // test if we can include one of MinGW bundled header - -int main(void) { - std::cout << "Hello world!" << std::endl; - return 0; -} diff --git a/recipes/minimp3/all/conandata.yml b/recipes/minimp3/all/conandata.yml index f86679db763b3..f9521b04b54c6 100644 --- a/recipes/minimp3/all/conandata.yml +++ b/recipes/minimp3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20211201": + url: "https://github.com/lieff/minimp3/archive/afb604c06bc8beb145fecd42c0ceb5bda8795144.zip" + sha256: "94f847efbb83349ed38dd05888e54bdd8dc6d7bbc3616efd4a1ac899a16bb82e" "20200304": url: "https://github.com/lieff/minimp3/archive/55da78cbeea5fb6757f8df672567714e1e8ca3e9.zip" sha256: "108074684c080a34f0d08f23a709128ea518d48651c8381bce91b73b29185479" diff --git a/recipes/minimp3/all/conanfile.py b/recipes/minimp3/all/conanfile.py index 6886956b3c461..b188314ed0522 100644 --- a/recipes/minimp3/all/conanfile.py +++ b/recipes/minimp3/all/conanfile.py @@ -10,21 +10,21 @@ class Minimp3Conan(ConanFile): name = "minimp3" description = "Minimalistic MP3 decoder single header library." license = "CC0-1.0" - topics = ("minimp3", "decoder", "mp3", "header-only") - homepage = "https://github.com/lieff/minimp3" + topics = ("decoder", "mp3", "header-only") url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lieff/minimp3" + 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 @@ -35,6 +35,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/minimp3/all/test_package/conanfile.py b/recipes/minimp3/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/minimp3/all/test_package/conanfile.py +++ b/recipes/minimp3/all/test_package/conanfile.py @@ -7,6 +7,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/minimp3/config.yml b/recipes/minimp3/config.yml index d49b70495df47..242cda7011c1f 100644 --- a/recipes/minimp3/config.yml +++ b/recipes/minimp3/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20211201": + folder: all "20200304": folder: all "20200221": diff --git a/recipes/minizip-ng/all/conanfile.py b/recipes/minizip-ng/all/conanfile.py index a47310a4b7929..01bda6f608ccb 100644 --- a/recipes/minizip-ng/all/conanfile.py +++ b/recipes/minizip-ng/all/conanfile.py @@ -73,8 +73,6 @@ def configure(self): self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") - if self.options.mz_compatibility: - self.provides = "minizip" if self.options.get_safe("with_libcomp"): del self.options.with_zlib @@ -98,7 +96,7 @@ def requirements(self): def build_requirements(self): if self._needs_pkg_config: - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/1.9.5") if Version(self.version) >= "4.0.0": self.tool_requires("cmake/[>=3.19 <4]") @@ -177,7 +175,8 @@ def package_info(self): self.cpp_info.components["minizip"].defines.append("HAVE_BZIP2") if Version(self.version) >= "4.0.0": - self.cpp_info.components["minizip"].includedirs.append(os.path.join("include", "minizip-ng")) + minizip_dir = "minizip" if self.options.mz_compatibility else "minizip-ng" + self.cpp_info.components["minizip"].includedirs.append(os.path.join(self.package_folder, "include", minizip_dir)) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "minizip" @@ -203,5 +202,3 @@ def package_info(self): if self.settings.os != "Windows" and self.options.with_iconv: self.cpp_info.components["minizip"].requires.append("libiconv::libiconv") - - diff --git a/recipes/mongo-c-driver/all/conandata.yml b/recipes/mongo-c-driver/all/conandata.yml index 4adb823d08a96..eefdc63f63260 100644 --- a/recipes/mongo-c-driver/all/conandata.yml +++ b/recipes/mongo-c-driver/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.24.1": + url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.24.1/mongo-c-driver-1.24.1.tar.gz" + sha256: "f9bdf71f24c6621c12535bad07f4654a218d84f16b85a68aca3abf6cd36d1859" "1.23.5": url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.23.5/mongo-c-driver-1.23.5.tar.gz" sha256: "260dc2207881ccbe7b79b1fa6b3ba84ab9be94eb93d4beefbbe8a6cb562947ed" @@ -17,16 +20,17 @@ sources: "1.17.6": url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.17.6/mongo-c-driver-1.17.6.tar.gz" sha256: "8644deec7ae585e8d12566978f2017181e883f303a028b5b3ccb83c91248b150" - "1.17.4": - url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.17.4/mongo-c-driver-1.17.4.tar.gz" - sha256: "9ec8fe7fb54d636886fa823460658ccf660e3d82520d10810fb7c9d302ac974f" - "1.17.3": - url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.17.3/mongo-c-driver-1.17.3.tar.gz" - sha256: "6594cbae17389005bcac5a8d4091af3be4894d5314a519504d4b4509effcc0df" - "1.17.2": - url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.17.2/mongo-c-driver-1.17.2.tar.gz" - sha256: "bc53d5f72ab628a1ae549db6888325d6dc34db3ca31c5e16e550c1bb4266d864" patches: + "1.24.1": + - patch_file: "patches/1.24.1-0001-disable-shared-when-static.patch" + patch_description: "separate static and shared builds" + patch_type: "conan" + - patch_file: "patches/1.24.1-0002-fix-uninitialized-warning.patch" + patch_description: "fix uninitialized variable warning" + patch_type: "portability" + - patch_file: "patches/1.22.0-0003-disable-warning-errors.patch" + patch_description: "disable compiler flags to make warnings into errors" + patch_type: "conan" "1.23.5": - patch_file: "patches/1.23.2-0001-disable-shared-when-static.patch" patch_description: "separate static and shared builds" @@ -81,15 +85,3 @@ patches: - patch_file: "patches/1.17.6-0001-disable-shared-when-static.patch" patch_description: "separate static and shared builds" patch_type: "conan" - "1.17.4": - - patch_file: "patches/1.17.2-0001-disable-shared-when-static.patch" - patch_description: "separate static and shared builds" - patch_type: "conan" - "1.17.3": - - patch_file: "patches/1.17.2-0001-disable-shared-when-static.patch" - patch_description: "separate static and shared builds" - patch_type: "conan" - "1.17.2": - - patch_file: "patches/1.17.2-0001-disable-shared-when-static.patch" - patch_description: "separate static and shared builds" - patch_type: "conan" diff --git a/recipes/mongo-c-driver/all/conanfile.py b/recipes/mongo-c-driver/all/conanfile.py index e53dfd765dfa4..c67766ae04dd2 100644 --- a/recipes/mongo-c-driver/all/conanfile.py +++ b/recipes/mongo-c-driver/all/conanfile.py @@ -78,7 +78,7 @@ def requirements(self): if self.options.with_zstd: self.requires("zstd/1.5.5") if self.options.with_icu: - self.requires("icu/73.1") + self.requires("icu/73.2") def validate(self): if self.options.with_ssl == "darwin" and not is_apple_os(self): diff --git a/recipes/mongo-c-driver/all/patches/1.17.2-0001-disable-shared-when-static.patch b/recipes/mongo-c-driver/all/patches/1.24.1-0001-disable-shared-when-static.patch similarity index 74% rename from recipes/mongo-c-driver/all/patches/1.17.2-0001-disable-shared-when-static.patch rename to recipes/mongo-c-driver/all/patches/1.24.1-0001-disable-shared-when-static.patch index 8767b278cd009..2ec7380ba4806 100644 --- a/recipes/mongo-c-driver/all/patches/1.17.2-0001-disable-shared-when-static.patch +++ b/recipes/mongo-c-driver/all/patches/1.24.1-0001-disable-shared-when-static.patch @@ -1,22 +1,24 @@ +diff --git a/src/libbson/CMakeLists.txt b/src/libbson/CMakeLists.txt +index 61e9267..ff26474 100644 --- a/src/libbson/CMakeLists.txt +++ b/src/libbson/CMakeLists.txt -@@ -230,6 +230,7 @@ set (HEADERS_FORWARDING +@@ -205,6 +205,7 @@ set (HEADERS_FORWARDING ${PROJECT_SOURCE_DIR}/src/bson/forwarding/bson.h ) +if (NOT MONGOC_ENABLE_STATIC_BUILD) add_library (bson_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) - set (CMAKE_CXX_VISIBILITY_PRESET hidden) - target_compile_definitions (bson_shared PRIVATE BSON_COMPILATION JSONSL_PARSE_NAN) -@@ -272,6 +273,7 @@ if (WIN32) + if (MSVC AND MSVC_VERSION VERSION_LESS 1900) + message (STATUS "Disabling warning C4756 for VS 2013 and older") +@@ -282,6 +283,7 @@ if (WIN32) # must be handled specially since we can't resolve them set (BSON_SYSTEM_LIBRARIES ${BSON_SYSTEM_LIBRARIES} ws2_32) endif () -+endif() ++endif () if (MONGOC_ENABLE_STATIC_BUILD) add_library (bson_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) -@@ -330,7 +332,7 @@ set (BSON_HEADER_INSTALL_DIR +@@ -367,7 +369,7 @@ set (BSON_HEADER_INSTALL_DIR ) if (MONGOC_ENABLE_STATIC_INSTALL) @@ -25,17 +27,19 @@ else () set (TARGETS_TO_INSTALL bson_shared) endif () +diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt +index bf95bd0..03a0f51 100644 --- a/src/libmongoc/CMakeLists.txt +++ b/src/libmongoc/CMakeLists.txt -@@ -725,6 +725,7 @@ if (MONGOC_ENABLE_MONGODB_AWS_AUTH) - endif() +@@ -745,6 +745,7 @@ if (MONGOC_ENABLE_STATIC_BUILD) + set_target_properties (mcd_rpc PROPERTIES OUTPUT_NAME "mcd-rpc") endif () +if (NOT MONGOC_ENABLE_STATIC_BUILD) add_library (mongoc_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) set_target_properties (mongoc_shared PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden) target_link_libraries (mongoc_shared PRIVATE ${LIBRARIES} PUBLIC ${BSON_LIBRARIES}) -@@ -744,6 +745,7 @@ target_compile_definitions (mongoc_shared PRIVATE MONGOC_COMPILATION ${KMS_MSG_D +@@ -785,6 +786,7 @@ target_include_directories ( set_target_properties (mongoc_shared PROPERTIES VERSION 0.0.0 SOVERSION 0) set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BASENAME}-${MONGOC_API_VERSION}") @@ -43,7 +47,7 @@ if (MONGOC_ENABLE_STATIC_BUILD) add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) -@@ -766,6 +768,7 @@ if (MONGOC_ENABLE_STATIC_BUILD) +@@ -828,6 +830,7 @@ if (MONGOC_ENABLE_STATIC_BUILD) set_target_properties (mongoc_static PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BASENAME}-static-${MONGOC_API_VERSION}") endif () @@ -51,11 +55,11 @@ if (ENABLE_APPLE_FRAMEWORK) set_target_properties (mongoc_shared PROPERTIES FRAMEWORK TRUE -@@ -776,9 +779,14 @@ if (ENABLE_APPLE_FRAMEWORK) +@@ -838,9 +841,15 @@ if (ENABLE_APPLE_FRAMEWORK) PUBLIC_HEADER "${HEADERS}" ) endif () -+endif() ++endif () add_executable (mongoc-stat ${PROJECT_SOURCE_DIR}/../../src/tools/mongoc-stat.c) +if (NOT MONGOC_ENABLE_STATIC_BUILD) @@ -63,10 +67,11 @@ +else () +target_link_libraries (mongoc-stat mongoc_static ${STATIC_LIBRARIES}) +endif () ++ # mongoc-stat works if shared memory performance counters are enabled. - if (ENABLE_SHM_COUNTERS STREQUAL "ON") -@@ -1040,7 +1048,7 @@ file (COPY ${PROJECT_SOURCE_DIR}/tests/x509gen DESTINATION ${PROJECT_BINARY_DIR} + if (ENABLE_SHM_COUNTERS) +@@ -1150,7 +1159,7 @@ file (COPY ${PROJECT_SOURCE_DIR}/tests/x509gen DESTINATION ${PROJECT_BINARY_DIR} file (COPY ${PROJECT_SOURCE_DIR}/tests/release_files DESTINATION ${PROJECT_BINARY_DIR}/tests) if (MONGOC_ENABLE_STATIC_INSTALL) diff --git a/recipes/mongo-c-driver/all/patches/1.24.1-0002-fix-uninitialized-warning.patch b/recipes/mongo-c-driver/all/patches/1.24.1-0002-fix-uninitialized-warning.patch new file mode 100644 index 0000000000000..7f59dea94d008 --- /dev/null +++ b/recipes/mongo-c-driver/all/patches/1.24.1-0002-fix-uninitialized-warning.patch @@ -0,0 +1,13 @@ +diff --git a/src/libbson/src/bson/bson-iter.c b/src/libbson/src/bson/bson-iter.c +index 00aa5c5..38e9c2b 100644 +--- a/src/libbson/src/bson/bson-iter.c ++++ b/src/libbson/src/bson/bson-iter.c +@@ -2146,7 +2146,7 @@ bson_iter_visit_all (bson_iter_t *iter, /* INOUT */ + + if (iter->err_off) { + if (unsupported && visitor->visit_unsupported_type && +- bson_utf8_validate (key, strlen (key), false)) { ++ key != NULL && bson_utf8_validate (key, strlen (key), false)) { + visitor->visit_unsupported_type (iter, key, bson_type, data); + return false; + } diff --git a/recipes/mongo-c-driver/config.yml b/recipes/mongo-c-driver/config.yml index 8d257ac381ff8..20b511f9ecd13 100644 --- a/recipes/mongo-c-driver/config.yml +++ b/recipes/mongo-c-driver/config.yml @@ -1,4 +1,6 @@ versions: + "1.24.1": + folder: all "1.23.5": folder: all "1.23.4": @@ -11,9 +13,3 @@ versions: folder: all "1.17.6": folder: all - "1.17.4": - folder: all - "1.17.3": - folder: all - "1.17.2": - folder: all diff --git a/recipes/mongo-cxx-driver/all/conandata.yml b/recipes/mongo-cxx-driver/all/conandata.yml index 63919e45005aa..5f674bff2da01 100644 --- a/recipes/mongo-cxx-driver/all/conandata.yml +++ b/recipes/mongo-cxx-driver/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.7.2": + url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.7.2/mongo-cxx-driver-r3.7.2.tar.gz" + sha256: "bc0f5193a8184db47a75685b58acd484b0e489eb0476b4d931d1bf4f5fc2186e" "3.7.0": url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.7.0/mongo-cxx-driver-r3.7.0.tar.gz" sha256: "fb2da11178db728f63147fe4b0c7509eb49b1b02c5cb55f9bee5f927e451a0c7" @@ -15,6 +18,13 @@ sources: url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.1/mongo-cxx-driver-r3.6.1.tar.gz" sha256: "83523e897ef18f7ce05d85d1632dd4ba486c264a1b89c09020163ab29e11eab7" patches: + "3.7.2": + - patch_file: "patches/3.7.2-0001-dirs.patch" + patch_description: "disable documentation features, fix directories" + patch_type: "conan" + - patch_file: "patches/3.7.2-0002-poly_use_std_define.patch" + patch_description: "use poly macro instead __cplusplus" + patch_type: "portability" "3.7.0": - patch_file: "patches/3.7.0-dirs.patch" patch_description: "disable documentation features, fix directories" diff --git a/recipes/mongo-cxx-driver/all/conanfile.py b/recipes/mongo-cxx-driver/all/conanfile.py index 118ad3a647540..557880613c87c 100644 --- a/recipes/mongo-cxx-driver/all/conanfile.py +++ b/recipes/mongo-cxx-driver/all/conanfile.py @@ -17,7 +17,7 @@ class MongoCxxConan(ConanFile): homepage = "http://mongocxx.org" description = "C++ Driver for MongoDB" topics = ("libbsoncxx", "libmongocxx", "mongo", "mongodb", "database", "db") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -47,9 +47,9 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("mongo-c-driver/1.23.2") + self.requires("mongo-c-driver/1.23.5") if self.options.polyfill == "boost": - self.requires("boost/1.81.0") + self.requires("boost/1.82.0", transitive_headers=True) @property def _minimal_std_version(self): diff --git a/recipes/mongo-cxx-driver/all/patches/3.7.2-0001-dirs.patch b/recipes/mongo-cxx-driver/all/patches/3.7.2-0001-dirs.patch new file mode 100644 index 0000000000000..f1c52fb2f96e1 --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.7.2-0001-dirs.patch @@ -0,0 +1,80 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 20254fa..d7dc7c4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -206,6 +206,7 @@ set (BUILD_SOURCE_DIR ${CMAKE_BINARY_DIR}) + + include (MakeDistFiles) + ++if(FALSE) + add_custom_target(hugo_dir + COMMAND ${CMAKE_COMMAND} -E make_directory hugo + ) +@@ -261,6 +262,7 @@ add_custom_target(format-lint + add_custom_target(docs + DEPENDS hugo doxygen-current + ) ++endif() + + set(THIRD_PARTY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party) + +@@ -270,6 +272,9 @@ if (ENABLE_TESTS) + enable_testing() + endif () + ++set(MONGO_CXX_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) ++set(MONGO_CXX_PROJECT_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}) ++ + add_subdirectory(src) + + add_subdirectory(examples EXCLUDE_FROM_ALL) +@@ -281,6 +286,7 @@ add_subdirectory(benchmark EXCLUDE_FROM_ALL) + # CMake does not implement anything like 'dist' from autotools. + # This implementation is based on the one in GnuCash. + ++if(FALSE) + add_subdirectory (cmake) + add_subdirectory (data) + add_subdirectory (docs) +@@ -381,4 +387,4 @@ endif () + if (CMAKE_GENERATOR_TOOLSET) + message (STATUS "\tinstance: ${CMAKE_GENERATOR_TOOLSET}") + endif () +- ++endif() +diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt +index d87d588..1aefd91 100644 +--- a/src/bsoncxx/CMakeLists.txt ++++ b/src/bsoncxx/CMakeLists.txt +@@ -71,7 +71,7 @@ set(BSONCXX_VERSION_NO_EXTRA ${BSONCXX_VERSION_MAJOR}.${BSONCXX_VERSION_MINOR}.$ + set(BSONCXX_VERSION ${BSONCXX_VERSION_NO_EXTRA}${BSONCXX_VERSION_EXTRA}) + message ("bsoncxx version: ${BSONCXX_VERSION}") + set(BSONCXX_INLINE_NAMESPACE "v${BSONCXX_ABI_VERSION}") +-set(BSONCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/bsoncxx/${BSONCXX_INLINE_NAMESPACE}" CACHE INTERNAL "") ++set(BSONCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}" CACHE INTERNAL "") + + set(LIBBSON_REQUIRED_VERSION 1.13.0) + set(LIBBSON_REQUIRED_ABI_VERSION 1.0) +@@ -94,7 +94,8 @@ if(TARGET bson_shared OR TARGET bson_static) + endif() + else() + # Attempt to find libbson by new package name (without lib). +- find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} ${LIBBSON_REQUIRED_VERSION} QUIET) ++ find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} REQUIRED) ++ set(bson-${LIBBSON_REQUIRED_ABI_VERSION}_FOUND TRUE) + + if(bson-${LIBBSON_REQUIRED_ABI_VERSION}_FOUND) + message ("found libbson version ${bson-${LIBBSON_REQUIRED_ABI_VERSION}_VERSION}") +diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt +index a7e6ded..4fb9027 100644 +--- a/src/mongocxx/CMakeLists.txt ++++ b/src/mongocxx/CMakeLists.txt +@@ -27,7 +27,7 @@ set(MONGOCXX_VERSION_NO_EXTRA ${MONGOCXX_VERSION_MAJOR}.${MONGOCXX_VERSION_MINOR + set(MONGOCXX_VERSION ${MONGOCXX_VERSION_NO_EXTRA}${MONGOCXX_VERSION_EXTRA}) + message ("mongocxx version: ${MONGOCXX_VERSION}") + set(MONGOCXX_INLINE_NAMESPACE "v${MONGOCXX_ABI_VERSION}") +-set(MONGOCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/mongocxx/${MONGOCXX_INLINE_NAMESPACE}" CACHE INTERNAL "") ++set(MONGOCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/" CACHE INTERNAL "") + + set(LIBMONGOC_REQUIRED_VERSION 1.22.1) + set(LIBMONGOC_REQUIRED_ABI_VERSION 1.0) diff --git a/recipes/mongo-cxx-driver/all/patches/3.7.2-0002-poly_use_std_define.patch b/recipes/mongo-cxx-driver/all/patches/3.7.2-0002-poly_use_std_define.patch new file mode 100644 index 0000000000000..1105c439eae72 --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.7.2-0002-poly_use_std_define.patch @@ -0,0 +1,13 @@ +diff --git a/src/bsoncxx/stdx/make_unique.hpp b/src/bsoncxx/stdx/make_unique.hpp +index fe8bb2d..737e76b 100644 +--- a/src/bsoncxx/stdx/make_unique.hpp ++++ b/src/bsoncxx/stdx/make_unique.hpp +@@ -48,7 +48,7 @@ using ::boost::make_unique; + BSONCXX_INLINE_NAMESPACE_END + } // namespace bsoncxx + +-#elif __cplusplus >= 201402L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) ++#elif defined(BSONCXX_POLY_USE_STD) + + #include + diff --git a/recipes/mongo-cxx-driver/all/test_package/test_package.cpp b/recipes/mongo-cxx-driver/all/test_package/test_package.cpp index 57282320fb7a6..d44d69617b5ba 100644 --- a/recipes/mongo-cxx-driver/all/test_package/test_package.cpp +++ b/recipes/mongo-cxx-driver/all/test_package/test_package.cpp @@ -6,8 +6,6 @@ #include // Compilation check -#include -#include #include int main() { diff --git a/recipes/mongo-cxx-driver/config.yml b/recipes/mongo-cxx-driver/config.yml index fe3fd8b511744..454f3110a5cca 100644 --- a/recipes/mongo-cxx-driver/config.yml +++ b/recipes/mongo-cxx-driver/config.yml @@ -1,4 +1,6 @@ versions: + "3.7.2": + folder: all "3.7.0": folder: all "3.6.7": diff --git a/recipes/mppp/all/conandata.yml b/recipes/mppp/all/conandata.yml index 60d10df366776..9c91fb1f269aa 100644 --- a/recipes/mppp/all/conandata.yml +++ b/recipes/mppp/all/conandata.yml @@ -10,6 +10,10 @@ patches: - patch_file: "patches/0.27-0001-disable-warning-error.patch" patch_description: "disable the flag for treats warning as errors" patch_type: "portability" + - patch_file: "patches/0.27-0002-remove-fmt-version.patch" + # https://github.com/conan-io/conan/issues/14172 + patch_description: "remove fmt version number from find_package" + patch_type: "conan" "0.26": - patch_file: "patches/0.26-0001-disable-warning-error.patch" patch_description: "disable the flag for treats warning as errors" diff --git a/recipes/mppp/all/conanfile.py b/recipes/mppp/all/conanfile.py index 4677b62f734c2..bf3dbe732b8b1 100644 --- a/recipes/mppp/all/conanfile.py +++ b/recipes/mppp/all/conanfile.py @@ -61,15 +61,15 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("gmp/6.2.1") + self.requires("gmp/6.2.1", transitive_headers=True) if self.options.with_mpfr: self.requires("mpfr/4.1.0") if self.options.with_mpc: self.requires("mpc/1.2.0") if self.options.with_boost: - self.requires("boost/1.81.0") + self.requires("boost/1.82.0") if self.options.get_safe("with_fmt"): - self.requires("fmt/9.1.0") + self.requires("fmt/10.0.0", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/mppp/all/patches/0.27-0002-remove-fmt-version.patch b/recipes/mppp/all/patches/0.27-0002-remove-fmt-version.patch new file mode 100644 index 0000000000000..28109b89756fd --- /dev/null +++ b/recipes/mppp/all/patches/0.27-0002-remove-fmt-version.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 22e275f..1a97423 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -414,9 +414,8 @@ endif() + + # NOTE: need at least version 6.2 + # to print 128-bit integers. +-set(_MPPP_MIN_FMT_VERSION "6.2") + if(MPPP_WITH_FMT) +- find_package(fmt ${_MPPP_MIN_FMT_VERSION} REQUIRED CONFIG) ++ find_package(fmt REQUIRED CONFIG) + message(STATUS "fmt version: ${fmt_VERSION}") + target_link_libraries(mp++ PUBLIC fmt::fmt) + endif() diff --git a/recipes/msdf-atlas-gen/all/CMakeLists.txt b/recipes/msdf-atlas-gen/all/CMakeLists.txt deleted file mode 100644 index 39b22c5320bd6..0000000000000 --- a/recipes/msdf-atlas-gen/all/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -find_package(msdfgen REQUIRED) - -add_subdirectory(source_subfolder) - diff --git a/recipes/msdf-atlas-gen/all/conandata.yml b/recipes/msdf-atlas-gen/all/conandata.yml index 20e043a17e6cd..1c3664b5df564 100644 --- a/recipes/msdf-atlas-gen/all/conandata.yml +++ b/recipes/msdf-atlas-gen/all/conandata.yml @@ -2,3 +2,8 @@ sources: "1.2.2": url: "https://github.com/Chlumsky/msdf-atlas-gen/archive/refs/tags/v1.2.2.tar.gz" sha256: "7D2EA46F66E21AB9A205BF7703D520F209B9A035EE13CBB266A3B8322F62FA28" +patches: + "1.2.2": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "Fix CMakeLists.txt to get libraries from Conan and install in bin dir" + patch_type: "conan" diff --git a/recipes/msdf-atlas-gen/all/conanfile.py b/recipes/msdf-atlas-gen/all/conanfile.py index a6c7d8b9a0b2a..51daed7b1f501 100644 --- a/recipes/msdf-atlas-gen/all/conanfile.py +++ b/recipes/msdf-atlas-gen/all/conanfile.py @@ -1,7 +1,11 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.files import get, copy, apply_conandata_patches, export_conandata_patches +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.33.0" + +required_conan_version = ">=1.53.0" class MsdfAtlasGenConan(ConanFile): @@ -12,60 +16,54 @@ class MsdfAtlasGenConan(ConanFile): description = "MSDF font atlas generator" topics = ("msdf-atlas-gen", "msdf", "font", "atlas") settings = "os", "arch", "compiler", "build_type" - - generators = "cmake", "cmake_find_package_multi" - exports_sources = ["CMakeLists.txt"] - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "application" def requirements(self): self.requires("artery-font-format/1.0") self.requires("msdfgen/1.9.1") + self.requires("lodepng/cci.20200615") + + def layout(self): + cmake_layout(self, src_folder="src") - def validate(self): + def validate_build(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) def package_id(self): del self.info.settings.compiler + del self.info.settings.build_type - def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - def _patch_sources(self): - cmakelists = os.path.join( - self._source_subfolder, "CMakeLists.txt") + def export_sources(self): + export_conandata_patches(self) - tools.replace_in_file(cmakelists, - "add_subdirectory(msdfgen)", "") - tools.save_append(cmakelists, - "install(TARGETS msdf-atlas-gen-standalone DESTINATION bin)") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["MSDF_ATLAS_GEN_BUILD_STANDALONE"] = True - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MSDF_ATLAS_GEN_BUILD_STANDALONE"] = True + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): + self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] - 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: Legacy, to be removed on Conan 2.0 + bin_folder = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_folder) diff --git a/recipes/msdf-atlas-gen/all/patches/0001-fix-cmake.patch b/recipes/msdf-atlas-gen/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..356c6a09fe8be --- /dev/null +++ b/recipes/msdf-atlas-gen/all/patches/0001-fix-cmake.patch @@ -0,0 +1,42 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,9 +7,11 @@ + set(MSDFGEN_USE_OPENMP OFF CACHE INTERNAL "Build with OpenMP support for multithreaded code (disabled for atlas gen)" FORCE) + set(MSDFGEN_USE_CPP11 ON CACHE INTERNAL "Build with C++11 enabled (always enabled for atlas gen)" FORCE) + set(MSDFGEN_INSTALL OFF CACHE BOOL "Generate installation target for msdfgen") +-add_subdirectory(msdfgen) + ++ + find_package(Threads REQUIRED) ++find_package(msdfgen REQUIRED) ++find_package(artery-font-format REQUIRED) + + file(GLOB_RECURSE msdf-atlas-gen_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + "msdf-atlas-gen/*.h" +@@ -24,19 +26,12 @@ + add_library(msdf-atlas-gen ${msdf-atlas-gen_SOURCES} ${msdf-atlas-gen_HEADERS}) + add_library(msdf-atlas-gen::msdf-atlas-gen ALIAS msdf-atlas-gen) + set_target_properties(msdf-atlas-gen PROPERTIES PUBLIC_HEADER "${msdf-atlas-gen_HEADERS}") +-target_include_directories(msdf-atlas-gen +-INTERFACE +- $ +-PRIVATE +- ${CMAKE_CURRENT_SOURCE_DIR}/msdfgen/include # for lodepng.h +- ${CMAKE_CURRENT_SOURCE_DIR}/artery-font-format +-) + + if (MSVC) + target_compile_definitions(msdf-atlas-gen PUBLIC _CRT_SECURE_NO_WARNINGS) + endif() + target_compile_features(msdf-atlas-gen PUBLIC cxx_std_11) +-target_link_libraries(msdf-atlas-gen PUBLIC Threads::Threads msdfgen::msdfgen msdfgen::msdfgen-ext) ++target_link_libraries(msdf-atlas-gen PUBLIC Threads::Threads msdfgen::msdfgen msdfgen::msdfgen-ext artery-font-format::artery-font-format) + + # TODO make these public in msdfgen so that this doesn't have to be repeated here + if(FREETYPE_WITH_PNG) +@@ -58,3 +53,5 @@ + target_compile_features(msdf-atlas-gen-standalone PUBLIC cxx_std_11) + target_link_libraries(msdf-atlas-gen-standalone PUBLIC msdf-atlas-gen::msdf-atlas-gen) + endif() ++ ++install(TARGETS msdf-atlas-gen-standalone DESTINATION bin) diff --git a/recipes/msdf-atlas-gen/all/test_package/conanfile.py b/recipes/msdf-atlas-gen/all/test_package/conanfile.py index 0e314c3e127bb..f15dfbbe1bd98 100644 --- a/recipes/msdf-atlas-gen/all/test_package/conanfile.py +++ b/recipes/msdf-atlas-gen/all/test_package/conanfile.py @@ -1,9 +1,16 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run + import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) @property def _atlas_texture_file(self): @@ -14,15 +21,14 @@ def _atlas_desc_file(self): return os.path.join(self.build_folder, "atlas_desc.json") def test(self): - if not tools.cross_building(self): - ttf_path = os.path.join( - self.source_folder, "Sacramento-Regular.ttf") - charset_path = os.path.join( - self.source_folder, "uppercase_charset") + if can_run(self): + ttf_path = os.path.join(self.source_folder, "Sacramento-Regular.ttf") + charset_path = os.path.join(self.source_folder, "uppercase_charset") ret_code = self.run( - "msdf-atlas-gen -font {} -charset {} -imageout {} -json {}".format(ttf_path, charset_path, self._atlas_texture_file, self._atlas_desc_file), run_environment=True) + "msdf-atlas-gen -font {} -charset {} -imageout {} -json {}".format(ttf_path, charset_path, self._atlas_texture_file, self._atlas_desc_file), env="conanrun") assert ret_code == 0 assert os.path.isfile(self._atlas_texture_file) assert os.path.isfile(self._atlas_desc_file) + diff --git a/recipes/nanodbc/all/CMakeLists.txt b/recipes/nanodbc/all/CMakeLists.txt deleted file mode 100644 index 6ba47d078b389..0000000000000 --- a/recipes/nanodbc/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -if(WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/nanodbc/all/conandata.yml b/recipes/nanodbc/all/conandata.yml index 60ad84e0835de..7a0d0542f3be6 100644 --- a/recipes/nanodbc/all/conandata.yml +++ b/recipes/nanodbc/all/conandata.yml @@ -11,16 +11,28 @@ sources: patches: "cci.20200807": - patch_file: "patches/0001-odbc-from-cci.patch" - base_path: "source_subfolder" + patch_description: "Allow compilation on CI with ODBC library" + patch_type: "portability" - patch_file: "patches/0002-allow-windows-shared.patch" - base_path: "source_subfolder" + patch_description: "Allow windows to compile shared libraries" + patch_type: "portability" + - patch_file: "patches/0003-add-missing-include.patch" + patch_description: "Add missing include to fix compilation for v2.13 and v20200807" + patch_type: "portability" "2.13.0": - patch_file: "patches/0001-odbc-from-cci.patch" - base_path: "source_subfolder" + patch_description: "Allow compilation on CI with ODBC library" + patch_type: "portability" - patch_file: "patches/0002-allow-windows-shared.patch" - base_path: "source_subfolder" + patch_description: "Allow windows to compile shared libraries" + patch_type: "portability" + - patch_file: "patches/0003-add-missing-include.patch" + patch_description: "Add missing include to fix compilation for v2.13 and v20200807" + patch_type: "portability" "2.14.0": - patch_file: "patches/0001-odbc-from-cci.patch" - base_path: "source_subfolder" + patch_description: "Allow compilation on CI with ODBC library" + patch_type: "portability" - patch_file: "patches/0002-allow-windows-shared.patch" - base_path: "source_subfolder" + patch_description: "Allow windows to compile shared libraries" + patch_type: "portability" diff --git a/recipes/nanodbc/all/conanfile.py b/recipes/nanodbc/all/conanfile.py index 44cbf934e3a4d..e2bd806901885 100644 --- a/recipes/nanodbc/all/conanfile.py +++ b/recipes/nanodbc/all/conanfile.py @@ -1,18 +1,20 @@ -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import glob +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.tools.files import get, apply_conandata_patches, export_conandata_patches, rmdir, copy +from conan.tools.scm import Version import os - class NanodbcConan(ConanFile): name = "nanodbc" description = "A small C++ wrapper for the native C ODBC API" topics = ("conan", "nanodbc", "odbc", "database") license = "MIT" homepage = "https://github.com/nanodbc/nanodbc/" + package_type = "library" url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch", "compiler", "build_type" - exports_sources = "CMakeLists.txt", "patches/**" options = { "shared": [True, False], "fPIC": [True, False], @@ -27,36 +29,51 @@ class NanodbcConan(ConanFile): "unicode": False, "with_boost": False, } - generators = "cmake", "cmake_find_package" - - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - _compiler_cxx14 = { - "gcc": 5, - "clang": "3.4", - "Visual Studio": 14, - "apple-clang": "9.1", # FIXME: wild guess - } + def export_sources(self): + export_conandata_patches(self) + + 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") + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "3.4", + "Visual Studio": "14", + "msvc": "190", + "apple-clang": "9.1", # FIXME: this is a guess + } + + def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 14) - _minimum_compiler = self._compiler_cxx14.get(str(self.settings.compiler)) - if _minimum_compiler: - if tools.Version(self.settings.compiler.version) < _minimum_compiler: - raise ConanInvalidConfiguration("nanodbc requires c++14, which your compiler does not support") - else: - self.output.warn("nanodbc requires c++14, but is unknown to this recipe. Assuming your compiler supports c++14.") + check_min_cppstd(self, 14) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + if self.settings.compiler == "apple-clang" and Version(self.version) != "2.14.0": + raise ConanInvalidConfiguration(""" + `apple-clang` compilation is supported only for version 2.14.0 and up. + See https://github.com/nanodbc/nanodbc/issues/274 for more details. + """) def requirements(self): if self.options.with_boost: @@ -65,40 +82,41 @@ def requirements(self): self.requires("odbc/2.3.9") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(glob.glob("nanodbc-*")[0], self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["NANODBC_DISABLE_ASYNC"] = not self.options.get_safe("async") - self._cmake.definitions["NANODBC_ENABLE_UNICODE"] = self.options.unicode - self._cmake.definitions["NANODBC_ENABLE_BOOST"] = self.options.with_boost - self._cmake.definitions["NANODBC_DISABLE_LIBCXX"] = self.settings.get_safe("compiler.libcxx") != "libc++" - - self._cmake.definitions["NANODBC_DISABLE_INSTALL"] = False - self._cmake.definitions["NANODBC_DISABLE_EXAMPLES"] = True - self._cmake.definitions["NANODBC_DISABLE_TESTS"] = True - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["NANODBC_DISABLE_ASYNC"] = not self.options.get_safe("async") + tc.cache_variables["NANODBC_ENABLE_UNICODE"] = self.options.unicode + tc.cache_variables["NANODBC_ENABLE_BOOST"] = self.options.with_boost + tc.cache_variables["NANODBC_DISABLE_LIBCXX"] = self.settings.get_safe("compiler.libcxx") != "libc++" + tc.cache_variables["NANODBC_DISABLE_INSTALL"] = False + tc.cache_variables["NANODBC_DISABLE_EXAMPLES"] = True + tc.cache_variables["NANODBC_DISABLE_TESTS"] = True + tc.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.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 package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.libs = ["nanodbc"] - if not self.options.shared: - if self.settings.os == "Windows": - self.cpp_info.system_libs = ["odbc32"] + + if not self.options.shared and self.settings.os == "Windows": + self.cpp_info.system_libs = ["odbc32"] diff --git a/recipes/nanodbc/all/patches/0001-odbc-from-cci.patch b/recipes/nanodbc/all/patches/0001-odbc-from-cci.patch index f5a355e45690b..5ab0d54e37333 100644 --- a/recipes/nanodbc/all/patches/0001-odbc-from-cci.patch +++ b/recipes/nanodbc/all/patches/0001-odbc-from-cci.patch @@ -9,18 +9,19 @@ # Try to find unixODBC first via odbc_config program. find_program(ODBC_CONFIG odbc_config PATHS $ENV{ODBC_PATH}/bin /usr/bin /usr/local/bin) -@@ -171,8 +171,8 @@ +@@ -171,8 +171,9 @@ ## find ODBC libraries to link ######################################## if(UNIX) - set(ODBC_LIBRARIES ${ODBCLIB}) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ODBC_LINK_FLAGS}") -+ set(ODBC_LIBRARIES CONAN_PKG::odbc) ++ find_package(ODBC REQUIRED CONFIG) ++ set(ODBC_LIBRARIES ODBC::ODBC) + #set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ODBC_LINK_FLAGS}") elseif(MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "Intel") set(ODBC_LIBRARIES odbc32.lib odbccp32.lib Ws2_32.lib) elseif(MINGW) -@@ -188,7 +188,7 @@ +@@ -188,7 +189,7 @@ find_package(Boost COMPONENTS locale REQUIRED) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) diff --git a/recipes/nanodbc/all/patches/0002-allow-windows-shared.patch b/recipes/nanodbc/all/patches/0002-allow-windows-shared.patch index 5ab2c375b7053..5c996393bca3b 100644 --- a/recipes/nanodbc/all/patches/0002-allow-windows-shared.patch +++ b/recipes/nanodbc/all/patches/0002-allow-windows-shared.patch @@ -1,6 +1,6 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -215,9 +215,9 @@ else() +@@ -216,9 +216,9 @@ else() message(STATUS "nanodbc build: Enable nanodbc target - STATIC") endif() diff --git a/recipes/nanodbc/all/patches/0003-add-missing-include.patch b/recipes/nanodbc/all/patches/0003-add-missing-include.patch new file mode 100644 index 0000000000000..6c70a6f9a9d0b --- /dev/null +++ b/recipes/nanodbc/all/patches/0003-add-missing-include.patch @@ -0,0 +1,10 @@ +--- a/nanodbc/nanodbc.cpp ++++ b/nanodbc/nanodbc.cpp +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/recipes/nanodbc/all/test_package/CMakeLists.txt b/recipes/nanodbc/all/test_package/CMakeLists.txt index f6bbde9919354..2b2d925656261 100644 --- a/recipes/nanodbc/all/test_package/CMakeLists.txt +++ b/recipes/nanodbc/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() +find_package(nanodbc REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE nanodbc::nanodbc) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/nanodbc/all/test_package/conanfile.py b/recipes/nanodbc/all/test_package/conanfile.py index bd7165a553cf4..c1e9a5dd84db0 100644 --- a/recipes/nanodbc/all/test_package/conanfile.py +++ b/recipes/nanodbc/all/test_package/conanfile.py @@ -1,10 +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 TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +19,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/nanoflann/all/conandata.yml b/recipes/nanoflann/all/conandata.yml index c3fd08f9f02f0..b6d2b6c2d459b 100644 --- a/recipes/nanoflann/all/conandata.yml +++ b/recipes/nanoflann/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.0": + url: "https://github.com/jlblancoc/nanoflann/archive/v1.5.0.tar.gz" + sha256: "89aecfef1a956ccba7e40f24561846d064f309bc547cc184af7f4426e42f8e65" "1.4.3": url: "https://github.com/jlblancoc/nanoflann/archive/v1.4.3.tar.gz" sha256: "cbcecf22bec528a8673a113ee9b0e134f91f1f96be57e913fa1f74e98e4449fa" diff --git a/recipes/nanoflann/config.yml b/recipes/nanoflann/config.yml index abdc53043545d..6332b5bdd9493 100644 --- a/recipes/nanoflann/config.yml +++ b/recipes/nanoflann/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.0": + folder: "all" "1.4.3": folder: "all" "1.4.2": diff --git a/recipes/nanort/all/conandata.yml b/recipes/nanort/all/conandata.yml new file mode 100644 index 0000000000000..8dcd77657a999 --- /dev/null +++ b/recipes/nanort/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230207": + url: "https://github.com/lighttransport/nanort/archive/0bb8ab5284ee8ab7e75705aaedeaea7d7e63e1fe.zip" + sha256: "08b22d1a8bd3ec2667a71cb71281c08d37d72a81baa0c3272e01db24ef191db5" diff --git a/recipes/nanort/all/conanfile.py b/recipes/nanort/all/conanfile.py new file mode 100644 index 0000000000000..934e494b287de --- /dev/null +++ b/recipes/nanort/all/conanfile.py @@ -0,0 +1,44 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd + + +import os + + +class NanoRTConan(ConanFile): + name = "nanort" + description = "Single header only modern ray tracing kernel" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lighttransport/nanort" + topics = ("graphics", "raytracing", "header-only") + license = "MIT" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "nanort.h", self.source_folder, os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/nanort/all/test_package/CMakeLists.txt b/recipes/nanort/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..358520baebdbd --- /dev/null +++ b/recipes/nanort/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(nanort REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nanort::nanort) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + diff --git a/recipes/nanort/all/test_package/conanfile.py b/recipes/nanort/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f5cf204295e19 --- /dev/null +++ b/recipes/nanort/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nanort/all/test_package/test_package.cpp b/recipes/nanort/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..76b9d8b357488 --- /dev/null +++ b/recipes/nanort/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include +#include + +#include "nanort.h" + + +int main(void) { + const std::array vertices = {0.0f, 0.0f, 0.0f, + 1.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f}; + const std::array faces = {0, 1, 2}; + + nanort::TriangleMesh triangle_mesh(vertices.data(), faces.data(), sizeof(float) * 3); + nanort::TriangleSAHPred triangle_pred(vertices.data(), faces.data(), sizeof(float) * 3); + + nanort::BVHAccel accel; + const auto ret = accel.Build(1, triangle_mesh, triangle_pred); + + if (!ret) { + std::cerr << "Failed to build BVH" << std::endl; + return EXIT_FAILURE; + } + + std::cout << "Successfully built simple BVH with nanort" << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/nanort/config.yml b/recipes/nanort/config.yml new file mode 100644 index 0000000000000..42394be2d8324 --- /dev/null +++ b/recipes/nanort/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230207": + folder: all diff --git a/recipes/nextsilicon-cpp-subprocess/all/conanfile.py b/recipes/nextsilicon-cpp-subprocess/all/conanfile.py index cc556b383afc6..01f1e1a74c95e 100644 --- a/recipes/nextsilicon-cpp-subprocess/all/conanfile.py +++ b/recipes/nextsilicon-cpp-subprocess/all/conanfile.py @@ -1,27 +1,54 @@ -from conans import ConanFile, tools +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class CppSubprocess(ConanFile): name = "nextsilicon-cpp-subprocess" + description = ( + "Subprocessing with modern C++. " + "The only goal was to develop something that is as close as possible" + " to the Python subprocess module in dealing with processes." + ) license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/nextsilicon/cpp-subprocess" - topics = ("subprocess", "os", "fork") - description = ("Subprocessing with modern C++, " - "The only goal was to develop something that is as close as" - "python subprocess module in dealing with processes.") - no_copy_source = True + topics = ("subprocess", "os", "fork", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True - _source_subfolder = 'cpp-subprocess' + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + @property + def _min_cppstd(self): + return 11 + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data['sources'][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("subprocess.hpp", dst="include/cpp-subprocess", src=self._source_subfolder) - self.copy("LICENSE.MIT", dst="licenses", src=self._source_subfolder) + copy(self, "subprocess.hpp", + dst=os.path.join(self.package_folder, "include/cpp-subprocess"), + src=self.source_folder) + copy(self, "LICENSE.MIT", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt b/recipes/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt index c61a7aada95ff..ccc5e64288292 100644 --- a/recipes/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt +++ b/recipes/nextsilicon-cpp-subprocess/all/test_package/CMakeLists.txt @@ -1,14 +1,12 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - set(CMAKE_CXX_STANDARD 11) -set(CMAKE_BUILD_TYPE Debug) set(THREADS_PREFER_PTHREAD_FLAG ON) + +find_package(nextsilicon-cpp-subprocess REQUIRED CONFIG) find_package(Threads REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} Threads::Threads) +target_link_libraries(${PROJECT_NAME} PRIVATE nextsilicon-cpp-subprocess::nextsilicon-cpp-subprocess Threads::Threads) diff --git a/recipes/nextsilicon-cpp-subprocess/all/test_package/conanfile.py b/recipes/nextsilicon-cpp-subprocess/all/test_package/conanfile.py index fc4fe1905b49a..ef5d7042163ec 100644 --- a/recipes/nextsilicon-cpp-subprocess/all/test_package/conanfile.py +++ b/recipes/nextsilicon-cpp-subprocess/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nlohmann_json/all/conandata.yml b/recipes/nlohmann_json/all/conandata.yml index 6d20bef200f0e..3da3e0aae2e97 100644 --- a/recipes/nlohmann_json/all/conandata.yml +++ b/recipes/nlohmann_json/all/conandata.yml @@ -38,6 +38,9 @@ sources: "3.7.0": sha256: D51A3A8D3EFBB1139D7608E28782EA9EFEA7E7933157E8FF8184901EFD8EE760 url: https://github.com/nlohmann/json/archive/v3.7.0.tar.gz + "3.5.0": + sha256: E0B1FC6CC6CA05706CCE99118A87ACA5248BD9DB3113E703023D23F044995C1D + url: https://github.com/nlohmann/json/archive/v3.5.0.tar.gz "3.4.0": sha256: C377963A95989270C943D522BFEFE7B889EF5ED0E1E15D535FD6F6F16ED70732 url: https://github.com/nlohmann/json/archive/v3.4.0.tar.gz diff --git a/recipes/nlohmann_json/config.yml b/recipes/nlohmann_json/config.yml index f26a7154dd392..e38fadbe1b4de 100644 --- a/recipes/nlohmann_json/config.yml +++ b/recipes/nlohmann_json/config.yml @@ -25,6 +25,8 @@ versions: folder: all "3.7.0": folder: all + "3.5.0": + folder: all "3.4.0": folder: all "3.2.0": diff --git a/recipes/nss/all/conandata.yml b/recipes/nss/all/conandata.yml index 1d61f4b23cee2..254439032f647 100644 --- a/recipes/nss/all/conandata.yml +++ b/recipes/nss/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.91": + url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_91_RTM/src/nss-3.91.tar.gz" + sha256: "84bd46376df17118c55f6d73d30fd93a0af21296c66e7690471547e5898fc4b3" "3.89": url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_89_RTM/src/nss-3.89.tar.gz" sha256: "55c37a3f4da010d0574fb8b39264cb1e7b4ce9e6c2954c1c7ecf9f41ee00bed5" diff --git a/recipes/nss/config.yml b/recipes/nss/config.yml index 4e88bb8ad9d3b..741d3aab48e70 100644 --- a/recipes/nss/config.yml +++ b/recipes/nss/config.yml @@ -1,4 +1,6 @@ versions: + "3.91": + folder: all "3.89": folder: all "3.88.1": diff --git a/recipes/nudb/all/conanfile.py b/recipes/nudb/all/conanfile.py index 4613f1e67604a..f02496ac2b32a 100644 --- a/recipes/nudb/all/conanfile.py +++ b/recipes/nudb/all/conanfile.py @@ -1,42 +1,66 @@ -from conans import ConanFile, CMake, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class NudbConan(ConanFile): name = "nudb" - license = "BSL-1.0" description = "A fast key/value insert-only database for SSD drives in C++11" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/CPPAlliance/NuDB" - url = "https://github.com/conan-io/conan-center-index/" topics = ("header-only", "KVS", "insert-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.78.0") + self.requires("boost/1.82.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - self.copy("*.hpp", "include", src=os.path.join(self._source_subfolder, "include")) - self.copy("*.ipp", "include", src=os.path.join(self._source_subfolder, "include")) - - def package_id(self): - self.info.header_only() + copy(self, "LICENSE*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "NuDB" - self.cpp_info.names["cmake_find_package_multi"] = "NuDB" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_target_name", "NuDB") + self.cpp_info.set_property("cmake_target_aliases", ["NuDB::nudb"]) + self.cpp_info.set_property("cmake_find_module", "both") + + self.cpp_info.components["core"].set_property("cmake_target_name", "nudb") self.cpp_info.components["core"].names["cmake_find_package"] = "nudb" self.cpp_info.components["core"].names["cmake_find_package_multi"] = "nudb" self.cpp_info.components["core"].requires = ["boost::thread", "boost::system"] - self.cpp_info.set_property("cmake_target_name", "NuDB") - self.cpp_info.set_property("cmake_target_module_name", "NuDB::nudb") - self.cpp_info.set_property("cmake_find_module", "both") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "NuDB" + self.cpp_info.names["cmake_find_package_multi"] = "NuDB" diff --git a/recipes/nudb/all/test_package/CMakeLists.txt b/recipes/nudb/all/test_package/CMakeLists.txt index 8aef4010c6c96..ba8bae2a7d0d2 100644 --- a/recipes/nudb/all/test_package/CMakeLists.txt +++ b/recipes/nudb/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(NuDB CONFIG REQUIRED) +find_package(NuDB REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} NuDB::nudb) diff --git a/recipes/nudb/all/test_package/conanfile.py b/recipes/nudb/all/test_package/conanfile.py index 573376a19a476..fae501d0afb9e 100644 --- a/recipes/nudb/all/test_package/conanfile.py +++ b/recipes/nudb/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class NudbTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nudb/all/test_v1_package/CMakeLists.txt b/recipes/nudb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/nudb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/nudb/all/test_v1_package/conanfile.py b/recipes/nudb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..573376a19a476 --- /dev/null +++ b/recipes/nudb/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class NudbTestConan(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/numcpp/all/conandata.yml b/recipes/numcpp/all/conandata.yml index bc5d4611e644e..2dd7a89a18962 100644 --- a/recipes/numcpp/all/conandata.yml +++ b/recipes/numcpp/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.11.0": + url: "https://github.com/dpilger26/NumCpp/archive/Version_2.11.0.tar.gz" + sha256: "ea675775c3535589f268224efa31ae6003a68e95a465e92c99496a0c9366bdc2" + "2.10.1": + url: "https://github.com/dpilger26/NumCpp/archive/Version_2.10.1.tar.gz" + sha256: "847382a780bea2a9b804c1835dcc5f9addabd0d1e3eb9c8339cde9422a5008d6" "2.9.0": url: "https://github.com/dpilger26/NumCpp/archive/Version_2.9.0.tar.gz" sha256: "1c15e23beb4f3d4933d7a6e8d5eb0259e825685973c8f0219485d3f606e5378a" diff --git a/recipes/numcpp/all/conanfile.py b/recipes/numcpp/all/conanfile.py index 16ba0517e3916..9f1e7ec1b42e9 100644 --- a/recipes/numcpp/all/conanfile.py +++ b/recipes/numcpp/all/conanfile.py @@ -17,6 +17,7 @@ class NumCppConan(ConanFile): homepage = "https://github.com/dpilger26/NumCpp" license = "MIT" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "with_boost" : [True, False], @@ -61,7 +62,7 @@ def layout(self): def requirements(self): if self.options.get_safe("with_boost", True): - self.requires("boost/1.80.0", transitive_headers=True) + self.requires("boost/1.82.0", transitive_headers=True) def package_id(self): self.info.clear() @@ -75,6 +76,14 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", ) + # since 2.10.0, numcpp requires filesystem + if Version(self.version) >= "2.10.0" and \ + self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "12" and \ + self.settings.compiler.libcxx == "libstdc++11": + raise ConanInvalidConfiguration( + f"{self.ref} doesn't support clang<12 with libstdc++11 due to filesystem library.", + ) + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -101,6 +110,12 @@ def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + if Version(self.version) >= "2.10.0": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": + self.cpp_info.system_libs.append("stdc++fs") + if self.settings.compiler == "clang" and Version(self.settings.compiler.version).major == "7": + self.cpp_info.system_libs.append("c++fs") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "NumCpp" self.cpp_info.names["cmake_find_package_multi"] = "NumCpp" diff --git a/recipes/numcpp/config.yml b/recipes/numcpp/config.yml index 8bc128c7f1485..f550cd05e46c5 100644 --- a/recipes/numcpp/config.yml +++ b/recipes/numcpp/config.yml @@ -1,4 +1,8 @@ versions: + "2.11.0": + folder: "all" + "2.10.1": + folder: "all" "2.9.0": folder: "all" "2.8.0": diff --git a/recipes/nv-codec-headers/all/conanfile.py b/recipes/nv-codec-headers/all/conanfile.py index b7d41a1b54635..b85d4da96e184 100644 --- a/recipes/nv-codec-headers/all/conanfile.py +++ b/recipes/nv-codec-headers/all/conanfile.py @@ -1,60 +1,67 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools import os -required_conan_version = ">=1.35.0" +from conan import ConanFile +from conan.tools.files import chdir, get, load, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class FFNvEncHeaders(ConanFile): name = "nv-codec-headers" description = "FFmpeg version of headers required to interface with Nvidia's codec APIs" - topics = ("ffmpeg", "video", "nvidia", "headers") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/FFmpeg/nv-codec-headers" - license = "MIT" - settings = "os" + topics = ("ffmpeg", "video", "nvidia", "headers", "header-only") - _autotools = None - _source_subfolder = "source_subfolder" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + def build_requirements(self): if self._settings_build.os == "Windows": if "CONAN_MAKE_PROGRAM" not in os.environ: self.build_requires("make/4.2.1") - def package_id(self): - self.info.header_only() - 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 _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - return self._autotools + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() def build(self): - autotools = self._configure_autotools() - with tools.chdir(os.path.join(self.build_folder, self._source_subfolder)): + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.make() def _extract_license(self): # Extract the License/s from the header to a file - tmp = tools.load(os.path.join(self._source_subfolder, "include", "ffnvcodec", "nvEncodeAPI.h")) - license_contents = tmp[2:tmp.find("*/", 1)] # The license begins with a C comment /* and ends with */ - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + tmp = load(self, os.path.join(self.source_folder, "include", "ffnvcodec", "nvEncodeAPI.h")) + license_contents = tmp[2 : tmp.find("*/", 1)] # The license begins with a C comment /* and ends with */ + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) def package(self): self._extract_license() - - autotools = self._configure_autotools() - with tools.chdir(os.path.join(self.build_folder, self._source_subfolder)): - autotools.install(args=["PREFIX={}".format(self.package_folder)]) - - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install(args=["PREFIX=/"]) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.names["pkg_config"] = "ffnvcodec" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("pkg_config_name", "ffnvcodec") diff --git a/recipes/nv-codec-headers/all/test_package/CMakeLists.txt b/recipes/nv-codec-headers/all/test_package/CMakeLists.txt index 7b9b613cbb24a..a89c9eadf95fc 100644 --- a/recipes/nv-codec-headers/all/test_package/CMakeLists.txt +++ b/recipes/nv-codec-headers/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(nv-codec-headers REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE nv-codec-headers::nv-codec-headers) diff --git a/recipes/nv-codec-headers/all/test_package/conanfile.py b/recipes/nv-codec-headers/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/nv-codec-headers/all/test_package/conanfile.py +++ b/recipes/nv-codec-headers/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nv-codec-headers/all/test_package/test_package.c b/recipes/nv-codec-headers/all/test_package/test_package.c index 6742254a188e9..2cb0fd61df830 100644 --- a/recipes/nv-codec-headers/all/test_package/test_package.c +++ b/recipes/nv-codec-headers/all/test_package/test_package.c @@ -4,7 +4,7 @@ #include #include -int main () { +int main() { printf("hello NVENC API version %u.%u\n", NVENCAPI_MAJOR_VERSION, NVENCAPI_MINOR_VERSION); return EXIT_SUCCESS; } diff --git a/recipes/ois/all/CMakeLists.txt b/recipes/ois/all/CMakeLists.txt deleted file mode 100644 index cdeeef45d13c1..0000000000000 --- a/recipes/ois/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") - include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -else() - include(conanbuildinfo.cmake) -endif() -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/ois/all/conandata.yml b/recipes/ois/all/conandata.yml index 0c7f109273e17..cad4b4f6daeb0 100644 --- a/recipes/ois/all/conandata.yml +++ b/recipes/ois/all/conandata.yml @@ -1,8 +1,11 @@ sources: + "1.5.1": + url: "https://github.com/wgois/OIS/archive/v1.5.1.tar.gz" + sha256: "614f6ef6d69cf6d84f1b50efff46a6c1acce426933e5f0dcf29862ea8332af73" "1.5": url: "https://github.com/wgois/OIS/archive/v1.5.tar.gz" sha256: "aa3e6b840b1149bb06835e04365957f4659c08b3e3095a48b289050f1637a174" patches: "1.5": - - patch_file: "patches/1.5/001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch" - base_path: "source_subfolder" + - patch_file: "patches/1.5-0001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch" + patch_type: "conan" diff --git a/recipes/ois/all/conanfile.py b/recipes/ois/all/conanfile.py index 53d83bec3c91b..3520d291b333d 100644 --- a/recipes/ois/all/conanfile.py +++ b/recipes/ois/all/conanfile.py @@ -1,17 +1,25 @@ import os import glob -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import ( + apply_conandata_patches, + export_conandata_patches, + get, copy, rmdir, collect_libs + ) +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + +required_conan_version = ">=1.53.0" + class OisConan(ConanFile): name = "ois" description = "Object oriented Input System." - topics = ("conan", "ois", "input" ) + topics = ("input system", "input" ) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/wgois/OIS" license = "Zlib" - exports_sources = ["CMakeLists.txt", "patches/*"] - generators = "cmake" + package_type = "library" settings = "os", "compiler", "build_type", "arch" options = { "shared": [True, False], @@ -22,19 +30,12 @@ class OisConan(ConanFile): "fPIC": True, } - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 - @property - def _build_subfolder(self): - return "build_subfolder" - - def requirements(self): - if self.settings.os == "Linux": - self.requires("xorg/system") + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -42,48 +43,59 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "OIS-{}".format(self.version) - os.rename(extracted_dir, self._source_subfolder) + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.settings.os == "Linux": + self.requires("xorg/system") - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["OIS_BUILD_SHARED_LIBS"] = self.options.shared - self._cmake.definitions["OIS_BUILD_DEMOS"] = False - self._cmake.configure(build_folder=self._build_subfolder) + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) - return self._cmake + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["OIS_BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["OIS_BUILD_DEMOS"] = False + 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 package(self): - self.copy("LICENSE.md", src=os.path.join(self.source_folder, self._source_subfolder), dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE.md", src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) for pdb_file in glob.glob(os.path.join(self.package_folder, "bin", "*.pdb")): os.unlink(pdb_file) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) - self.cpp_info.names["pkg_config"] = "OIS" - self.cpp_info.names["cmake_find_package"] = "OIS" - self.cpp_info.names["cmake_find_package_multi"] = "OIS" + self.cpp_info.set_property("pkg_config_name", "OIS") if self.settings.os == "Macos": - self.cpp_info.frameworks = ["Foundation", "Cocoa", "IOKit"] + self.cpp_info.frameworks = ["Foundation", "Cocoa", "IOKit", "AppKit", "CoreFoundation", "CoreGraphics"] elif self.settings.os == "Windows": self.cpp_info.defines = ["OIS_WIN32_XINPUT_SUPPORT"] self.cpp_info.system_libs = ["dinput8", "dxguid"] if self.options.shared: self.cpp_info.defines.append("OIS_DYNAMIC_LIB") + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "OIS" + self.cpp_info.names["cmake_find_package_multi"] = "OIS" diff --git a/recipes/ois/all/patches/1.5/001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch b/recipes/ois/all/patches/1.5-0001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch similarity index 100% rename from recipes/ois/all/patches/1.5/001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch rename to recipes/ois/all/patches/1.5-0001_export_headers_from_CMAKE_CURRENT_SOURCE_DIR.patch diff --git a/recipes/ois/all/test_package/CMakeLists.txt b/recipes/ois/all/test_package/CMakeLists.txt index 196188113685c..6704daeed1834 100644 --- a/recipes/ois/all/test_package/CMakeLists.txt +++ b/recipes/ois/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(ois REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE ois::ois) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/ois/all/test_package/conanfile.py b/recipes/ois/all/test_package/conanfile.py index bd7165a553cf4..3a91c9439218e 100644 --- a/recipes/ois/all/test_package/conanfile.py +++ b/recipes/ois/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def 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", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ois/config.yml b/recipes/ois/config.yml index 289ff2f2a0c3c..1ce6b25b9dda7 100644 --- a/recipes/ois/config.yml +++ b/recipes/ois/config.yml @@ -1,3 +1,5 @@ versions: + "1.5.1": + folder: all "1.5": folder: all diff --git a/recipes/onnx/all/conanfile.py b/recipes/onnx/all/conanfile.py index f12c6c1c0716c..ddc3a6ff03194 100644 --- a/recipes/onnx/all/conanfile.py +++ b/recipes/onnx/all/conanfile.py @@ -51,7 +51,7 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if self.version < "1.9.0": + if Version(self.version) < "1.9.0": del self.options.disable_static_registration def configure(self): @@ -99,7 +99,7 @@ def generate(self): tc.variables["ONNX_VERIFY_PROTO3"] = Version(self.dependencies.host["protobuf"].ref.version).major == "3" if is_msvc(self): tc.variables["ONNX_USE_MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) - if self.version >= "1.9.0": + if Version(self.version) >= "1.9.0": tc.variables["ONNX_DISABLE_STATIC_REGISTRATION"] = self.options.get_safe('disable_static_registration') tc.generate() deps = CMakeDeps(self) diff --git a/recipes/onnxruntime/all/conandata.yml b/recipes/onnxruntime/all/conandata.yml index 93052017c9ff5..4a029ad509a2b 100644 --- a/recipes/onnxruntime/all/conandata.yml +++ b/recipes/onnxruntime/all/conandata.yml @@ -1,8 +1,18 @@ sources: + "1.15.1": + url: "https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.15.1.tar.gz" + sha256: "93a9b6f148639938ccbaa48d0f641d8f33312fdfcc69ee9466e11362b43917c4" "1.14.1": url: "https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.14.1.tar.gz" sha256: "f998352b131bb89fa7dd1f1d87ddbafe647dfaddd11929b6b5168b3f4ef857de" patches: + "1.15.1": + - patch_file: "patches/1.15.1-0001-cmake-dependencies.patch" + patch_description: "CMake: ensure conan dependencies are used" + patch_type: "conan" + - patch_file: "patches/1.14.1-0004-abseil-no-string-view.patch" + patch_description: "allow to build with abseil built without c++17 support" + patch_type: "portability" "1.14.1": - patch_file: "patches/1.14.1-0001-cmake-dependencies.patch" patch_description: "CMake: ensure conan dependencies are used (upstreamed future versions)" diff --git a/recipes/onnxruntime/all/conanfile.py b/recipes/onnxruntime/all/conanfile.py index cd2777075e37e..7d8bf9dd19bda 100644 --- a/recipes/onnxruntime/all/conanfile.py +++ b/recipes/onnxruntime/all/conanfile.py @@ -7,6 +7,7 @@ from conan.tools.scm import Version from conan.tools.env import VirtualBuildEnv import os +import sys required_conan_version = ">=1.53.0" @@ -43,7 +44,7 @@ def _compilers_minimum_version(self): return { "Visual Studio": "16", "msvc": "192", - "gcc": "8", + "gcc": "7", "clang": "5", "apple-clang": "10", } @@ -62,12 +63,20 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + @property + def _onnx_version(self): + version = Version(self.version) + return { + "1.14": "1.13.1", + "1.15": "1.14.0", + }[f"{version.major}.{version.minor}"] + def requirements(self): self.requires("abseil/20230125.2") self.requires("protobuf/3.21.9") self.requires("date/3.0.1") self.requires("re2/20230301") - self.requires("onnx/1.13.1") + self.requires(f"onnx/{self._onnx_version}") self.requires("flatbuffers/1.12.0") self.requires("boost/1.81.0", headers=True, libs=False, run=False) # for mp11, header only, no need for libraries to link/run self.requires("safeint/3.0.28") @@ -88,7 +97,14 @@ def validate(self): minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version and Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + f"{self.ref} requires minimum compiler version {minimum_version}." + ) + + def validate_build(self): + if self.version >= Version("1.15.0") and self.options.shared and sys.version_info[:2] < (3, 8): + # https://github.com/microsoft/onnxruntime/blob/638146b79ea52598ece514704d3f592c10fab2f1/cmake/CMakeLists.txt#LL500C12-L500C12 + raise ConanInvalidConfiguration( + f"{self.ref} requires python 3.8+ to be built as shared." ) def build_requirements(self): @@ -102,6 +118,8 @@ def generate(self): tc = CMakeToolchain(self) # disable downloading dependencies to ensure conan ones are used tc.variables["FETCHCONTENT_FULLY_DISCONNECTED"] = True + if self.version >= Version("1.15.0") and self.options.shared: + tc.variables["Python_EXECUTABLE"] = sys.executable tc.variables["onnxruntime_BUILD_SHARED_LIB"] = self.options.shared tc.variables["onnxruntime_USE_FULL_PROTOBUF"] = not self.dependencies["protobuf"].options.lite @@ -181,6 +199,15 @@ def generate(self): tc.variables["onnxruntime_USE_CANN"] = False tc.generate() deps = CMakeDeps(self) + + if self.dependencies["flatbuffers"].options.shared: + deps.set_property("flatbuffers", "cmake_target_name", "flatbuffers::flatbuffers") + + deps.set_property("boost::headers", "cmake_target_name", "Boost::mp11") + deps.set_property("date", "cmake_target_name", "date_interface") + deps.set_property("safeint", "cmake_target_name", "safeint_interface") + deps.set_property("xnnpack", "cmake_target_name", "XNNPACK") + deps.generate() vbe = VirtualBuildEnv(self) vbe.generate(scope="build") @@ -217,6 +244,8 @@ def package_info(self): "common", "flatbuffers", ] + if self.options.with_xnnpack: + onnxruntime_libs.append("providers_xnnpack") self.cpp_info.libs = [f"onnxruntime_{lib}" for lib in onnxruntime_libs] self.cpp_info.includedirs.append("include/onnxruntime/core/session") diff --git a/recipes/onnxruntime/all/patches/1.14.1-0002-cmake-dependencies.patch b/recipes/onnxruntime/all/patches/1.14.1-0002-cmake-dependencies.patch index 33dc41a44c7b2..9d0a0f6763613 100644 --- a/recipes/onnxruntime/all/patches/1.14.1-0002-cmake-dependencies.patch +++ b/recipes/onnxruntime/all/patches/1.14.1-0002-cmake-dependencies.patch @@ -1,3 +1,5 @@ +diff --git a/cmake/external/abseil-cpp.cmake b/cmake/external/abseil-cpp.cmake +index 54d2f9c5c1..3195ef15a0 100644 --- a/cmake/external/abseil-cpp.cmake +++ b/cmake/external/abseil-cpp.cmake @@ -22,6 +22,7 @@ FetchContent_Declare( @@ -8,6 +10,8 @@ ) onnxruntime_fetchcontent_makeavailable(abseil_cpp) +diff --git a/cmake/external/eigen.cmake b/cmake/external/eigen.cmake +index 266dd534af..3c7cb77891 100644 --- a/cmake/external/eigen.cmake +++ b/cmake/external/eigen.cmake @@ -14,8 +14,11 @@ else () @@ -24,6 +28,8 @@ + onnxruntime_fetchcontent_makeavailable(eigen) + get_target_property(eigen_INCLUDE_DIRS Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES) endif() +diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake +index f85336e8bb..b051ff0be1 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -97,7 +97,7 @@ FetchContent_Declare( @@ -35,18 +41,15 @@ ) #Here we support two build mode: -@@ -136,8 +136,10 @@ FetchContent_Declare( +@@ -136,6 +136,7 @@ FetchContent_Declare( date URL ${DEP_URL_date} URL_HASH SHA1=${DEP_SHA1_date} + FIND_PACKAGE_ARGS NAMES date ) onnxruntime_fetchcontent_makeavailable(date) -+add_library(date_interface ALIAS date::date) - - -@@ -145,6 +147,7 @@ FetchContent_Declare( +@@ -145,6 +146,7 @@ FetchContent_Declare( mp11 URL ${DEP_URL_mp11} URL_HASH SHA1=${DEP_SHA1_mp11} @@ -54,7 +57,7 @@ ) set(JSON_BuildTests OFF CACHE INTERNAL "") -@@ -263,10 +266,12 @@ FetchContent_Declare( +@@ -263,6 +265,7 @@ FetchContent_Declare( safeint URL ${DEP_URL_safeint} URL_HASH SHA1=${DEP_SHA1_safeint} @@ -62,23 +65,7 @@ ) # The next line will generate an error message "fatal: not a git repository", but it is ok. It is from flatbuffers - onnxruntime_fetchcontent_makeavailable(Protobuf nlohmann_json mp11 re2 safeint GSL flatbuffers) -+add_library(Boost::mp11 ALIAS Boost::headers) - if(NOT flatbuffers_FOUND) - if(NOT TARGET flatbuffers::flatbuffers) - add_library(flatbuffers::flatbuffers ALIAS flatbuffers) -@@ -291,6 +296,10 @@ namespace std { using ::getenv; } - target_compile_options(flatc PRIVATE /FI${CMAKE_BINARY_DIR}/gdk_cstdlib_wrapper.h) - endif() - endif() -+else() -+ if(NOT TARGET flatbuffers::flatbuffers) -+ add_library(flatbuffers::flatbuffers ALIAS flatbuffers::flatbuffers_shared) -+ endif() - endif() - - if (onnxruntime_BUILD_UNIT_TESTS) -@@ -359,6 +368,7 @@ FetchContent_Declare( +@@ -359,6 +362,7 @@ FetchContent_Declare( URL ${DEP_URL_onnx} URL_HASH SHA1=${DEP_SHA1_onnx} PATCH_COMMAND ${ONNXRUNTIME_ONNX_PATCH_COMMAND} @@ -86,19 +73,16 @@ ) -@@ -386,8 +396,9 @@ endif() +@@ -386,8 +390,6 @@ endif() set(GSL_TARGET "Microsoft.GSL::GSL") set(GSL_INCLUDE_DIR "$") -add_library(safeint_interface INTERFACE) -target_include_directories(safeint_interface INTERFACE ${safeint_SOURCE_DIR}) -+add_library(safeint_interface ALIAS safeint::safeint) -+#target_include_directories(safeint_interface INTERFACE ${safeint_SOURCE_DIR}) -+ # XNNPACK EP if (onnxruntime_USE_XNNPACK) -@@ -416,9 +427,9 @@ set(onnxruntime_EXTERNAL_LIBRARIES ${onnxruntime_EXTERNAL_LIBRARIES_XNNPACK} WIL +@@ -416,9 +418,9 @@ set(onnxruntime_EXTERNAL_LIBRARIES ${onnxruntime_EXTERNAL_LIBRARIES_XNNPACK} WIL # The other libs do not have the problem. All the sources are already there. We can compile them in any order. set(onnxruntime_EXTERNAL_DEPENDENCIES onnx_proto flatbuffers::flatbuffers) @@ -110,6 +94,8 @@ endif() if (onnxruntime_RUN_ONNX_TESTS) +diff --git a/cmake/external/wil.cmake b/cmake/external/wil.cmake +index d38535c4a1..8b181871f9 100644 --- a/cmake/external/wil.cmake +++ b/cmake/external/wil.cmake @@ -11,12 +11,18 @@ FetchContent_Declare( @@ -139,9 +125,11 @@ -endif() \ No newline at end of file +endif() +diff --git a/cmake/external/xnnpack.cmake b/cmake/external/xnnpack.cmake +index 1fc2c6ccdc..a2c28957f9 100644 --- a/cmake/external/xnnpack.cmake +++ b/cmake/external/xnnpack.cmake -@@ -25,12 +25,19 @@ set(FXDIV_SOURCE_DIR ${fxdiv_SOURCE_DIR}) +@@ -25,12 +25,15 @@ set(FXDIV_SOURCE_DIR ${fxdiv_SOURCE_DIR}) FetchContent_Declare(pthreadpool URL ${DEP_URL_pthreadpool} URL_HASH SHA1=${DEP_SHA1_pthreadpool}) onnxruntime_fetchcontent_makeavailable(pthreadpool) @@ -158,13 +146,11 @@ onnxruntime_fetchcontent_makeavailable(googlexnnpack) -set(XNNPACK_DIR ${googlexnnpack_SOURCE_DIR}) -set(XNNPACK_INCLUDE_DIR ${XNNPACK_DIR}/include) -+# set(XNNPACK_DIR ${googlexnnpack_SOURCE_DIR}) -+# set(XNNPACK_INCLUDE_DIR ${XNNPACK_DIR}/include) -+ -+add_library(XNNPACK ALIAS xnnpack::xnnpack) set(onnxruntime_EXTERNAL_LIBRARIES_XNNPACK XNNPACK pthreadpool) +diff --git a/cmake/onnxruntime_common.cmake b/cmake/onnxruntime_common.cmake +index 0410d3361c..685df7a487 100644 --- a/cmake/onnxruntime_common.cmake +++ b/cmake/onnxruntime_common.cmake @@ -195,7 +195,7 @@ if (ARM64 OR ARM OR X86 OR X64 OR X86_64) @@ -176,6 +162,8 @@ endif() endif() endif() +diff --git a/cmake/onnxruntime_providers.cmake b/cmake/onnxruntime_providers.cmake +index 7a99bac233..bbf1955494 100644 --- a/cmake/onnxruntime_providers.cmake +++ b/cmake/onnxruntime_providers.cmake @@ -1561,10 +1561,6 @@ if (onnxruntime_USE_XNNPACK) diff --git a/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch b/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..7da019aa807e9 --- /dev/null +++ b/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch @@ -0,0 +1,172 @@ +diff --git a/cmake/external/abseil-cpp.cmake b/cmake/external/abseil-cpp.cmake +index 54d2f9c5c1..3195ef15a0 100644 +--- a/cmake/external/abseil-cpp.cmake ++++ b/cmake/external/abseil-cpp.cmake +@@ -22,6 +22,7 @@ FetchContent_Declare( + URL ${DEP_URL_abseil_cpp} + URL_HASH SHA1=${DEP_SHA1_abseil_cpp} + PATCH_COMMAND ${ABSL_PATCH_COMMAND} ++ FIND_PACKAGE_ARGS REQUIRED CONFIG NAMES absl + ) + + onnxruntime_fetchcontent_makeavailable(abseil_cpp) +diff --git a/cmake/external/eigen.cmake b/cmake/external/eigen.cmake +index 266dd534af..12b1792862 100644 +--- a/cmake/external/eigen.cmake ++++ b/cmake/external/eigen.cmake +@@ -14,8 +14,9 @@ else () + FetchContent_Declare( + eigen + URL https://gitlab.com/libeigen/eigen/-/archive/d10b27fe37736d2944630ecd7557cefa95cf87c9/eigen-d10b27fe37736d2944630ecd7557cefa95cf87c9.zip ++ FIND_PACKAGE_ARGS REQUIRED CONFIG NAMES Eigen3 + ) + endif() +- FetchContent_Populate(eigen) +- set(eigen_INCLUDE_DIRS "${eigen_SOURCE_DIR}") ++ onnxruntime_fetchcontent_makeavailable(eigen) ++ get_target_property(eigen_INCLUDE_DIRS Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES) + endif() +diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake +index 9effd1a2db..a059c28e36 100644 +--- a/cmake/external/onnxruntime_external_deps.cmake ++++ b/cmake/external/onnxruntime_external_deps.cmake +@@ -152,7 +152,7 @@ FetchContent_Declare( + URL ${DEP_URL_protobuf} + URL_HASH SHA1=${DEP_SHA1_protobuf} + PATCH_COMMAND ${ONNXRUNTIME_PROTOBUF_PATCH_COMMAND} +- FIND_PACKAGE_ARGS 3.21.12 NAMES Protobuf ++ FIND_PACKAGE_ARGS NAMES Protobuf + ) + set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests" FORCE) + if (CMAKE_SYSTEM_NAME STREQUAL "Android") +@@ -173,6 +173,7 @@ FetchContent_Declare( + date + URL ${DEP_URL_date} + URL_HASH SHA1=${DEP_SHA1_date} ++ FIND_PACKAGE_ARGS NAMES date + ) + onnxruntime_fetchcontent_makeavailable(date) + +@@ -182,6 +183,7 @@ FetchContent_Declare( + mp11 + URL ${DEP_URL_mp11} + URL_HASH SHA1=${DEP_SHA1_mp11} ++ FIND_PACKAGE_ARGS NAMES Boost + ) + + set(JSON_BuildTests OFF CACHE INTERNAL "") +@@ -300,6 +302,7 @@ FetchContent_Declare( + safeint + URL ${DEP_URL_safeint} + URL_HASH SHA1=${DEP_SHA1_safeint} ++ FIND_PACKAGE_ARGS NAMES safeint + ) + + # The next line will generate an error message "fatal: not a git repository", but it is ok. It is from flatbuffers +@@ -396,6 +399,7 @@ FetchContent_Declare( + URL ${DEP_URL_onnx} + URL_HASH SHA1=${DEP_SHA1_onnx} + PATCH_COMMAND ${ONNXRUNTIME_ONNX_PATCH_COMMAND} ++ FIND_PACKAGE_ARGS NAMES onnx ONNX + ) + + +@@ -423,9 +427,6 @@ endif() + set(GSL_TARGET "Microsoft.GSL::GSL") + set(GSL_INCLUDE_DIR "$") + +-add_library(safeint_interface INTERFACE) +-target_include_directories(safeint_interface INTERFACE ${safeint_SOURCE_DIR}) +- + # XNNPACK EP + if (onnxruntime_USE_XNNPACK) + if (onnxruntime_DISABLE_CONTRIB_OPS) +@@ -453,9 +454,9 @@ set(onnxruntime_EXTERNAL_LIBRARIES ${onnxruntime_EXTERNAL_LIBRARIES_XNNPACK} WIL + # The other libs do not have the problem. All the sources are already there. We can compile them in any order. + set(onnxruntime_EXTERNAL_DEPENDENCIES onnx_proto flatbuffers::flatbuffers) + +-target_compile_definitions(onnx PUBLIC $ PRIVATE "__ONNX_DISABLE_STATIC_REGISTRATION") ++# target_compile_definitions(onnx PUBLIC $ PRIVATE "__ONNX_DISABLE_STATIC_REGISTRATION") + if (NOT onnxruntime_USE_FULL_PROTOBUF) +- target_compile_definitions(onnx PUBLIC "__ONNX_NO_DOC_STRINGS") ++ # target_compile_definitions(onnx PUBLIC "__ONNX_NO_DOC_STRINGS") + endif() + + if (onnxruntime_RUN_ONNX_TESTS) +diff --git a/cmake/external/wil.cmake b/cmake/external/wil.cmake +index d38535c4a1..02d6dbd85d 100644 +--- a/cmake/external/wil.cmake ++++ b/cmake/external/wil.cmake +@@ -9,14 +9,10 @@ FetchContent_Declare( + URL_HASH SHA1=${DEP_SHA1_microsoft_wil} + FIND_PACKAGE_ARGS NAMES wil + ) +-#We can not use FetchContent_MakeAvailable(microsoft_wil) at here, since their cmake file +-#always executes install command without conditions. +-FetchContent_Populate(microsoft_wil) +-if(NOT wil_FOUND) ++ ++if(WIN32) ++ FetchContent_MakeAvailable(microsoft_wil) ++else() + add_library(WIL INTERFACE) + add_library(WIL::WIL ALIAS WIL) +- +- # The interface's include directory. +- target_include_directories(WIL INTERFACE +- $) +-endif() +\ No newline at end of file ++endif() +diff --git a/cmake/external/xnnpack.cmake b/cmake/external/xnnpack.cmake +index 1fc2c6ccdc..a2c28957f9 100644 +--- a/cmake/external/xnnpack.cmake ++++ b/cmake/external/xnnpack.cmake +@@ -25,12 +25,15 @@ set(FXDIV_SOURCE_DIR ${fxdiv_SOURCE_DIR}) + + FetchContent_Declare(pthreadpool URL ${DEP_URL_pthreadpool} URL_HASH SHA1=${DEP_SHA1_pthreadpool}) + onnxruntime_fetchcontent_makeavailable(pthreadpool) +-FetchContent_Declare(googlexnnpack URL ${DEP_URL_googlexnnpack} URL_HASH SHA1=${DEP_SHA1_googlexnnpack} +-PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/xnnpack/AddEmscriptenAndIosSupport.patch) ++FetchContent_Declare( ++ googlexnnpack ++ URL ${DEP_URL_googlexnnpack} ++ URL_HASH SHA1=${DEP_SHA1_googlexnnpack} ++ PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/xnnpack/AddEmscriptenAndIosSupport.patch ++ FIND_PACKAGE_ARGS NAMES xnnpack ++) + + onnxruntime_fetchcontent_makeavailable(googlexnnpack) +-set(XNNPACK_DIR ${googlexnnpack_SOURCE_DIR}) +-set(XNNPACK_INCLUDE_DIR ${XNNPACK_DIR}/include) + + set(onnxruntime_EXTERNAL_LIBRARIES_XNNPACK XNNPACK pthreadpool) + +diff --git a/cmake/onnxruntime_common.cmake b/cmake/onnxruntime_common.cmake +index 0410d3361c..685df7a487 100644 +--- a/cmake/onnxruntime_common.cmake ++++ b/cmake/onnxruntime_common.cmake +@@ -195,7 +195,7 @@ if (ARM64 OR ARM OR X86 OR X64 OR X86_64) + # Its functionality in detecting x86 cpu features are lacking, so is support for Windows. + if (CPUINFO_SUPPORTED) + onnxruntime_add_include_to_target(onnxruntime_common cpuinfo::cpuinfo) +- list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::cpuinfo cpuinfo::clog) ++ list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::cpuinfo) + endif() + endif() + endif() +diff --git a/cmake/onnxruntime_providers.cmake b/cmake/onnxruntime_providers.cmake +index 0daa1b8a3d..1f25467a8c 100644 +--- a/cmake/onnxruntime_providers.cmake ++++ b/cmake/onnxruntime_providers.cmake +@@ -1711,10 +1711,6 @@ if (onnxruntime_USE_XNNPACK) + add_dependencies(onnxruntime_providers_xnnpack onnx ${onnxruntime_EXTERNAL_DEPENDENCIES}) + set_target_properties(onnxruntime_providers_xnnpack PROPERTIES FOLDER "ONNXRuntime") + +- install(DIRECTORY ${ONNXRUNTIME_INCLUDE_DIR}/core/providers/xnnpack +- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/core/providers +- ) +- + set_target_properties(onnxruntime_providers_xnnpack PROPERTIES LINKER_LANGUAGE CXX) + + if (NOT onnxruntime_BUILD_SHARED_LIB) diff --git a/recipes/onnxruntime/config.yml b/recipes/onnxruntime/config.yml index 0414d9adf6108..4b89de81e9882 100644 --- a/recipes/onnxruntime/config.yml +++ b/recipes/onnxruntime/config.yml @@ -1,3 +1,5 @@ versions: + "1.15.1": + folder: all "1.14.1": folder: all diff --git a/recipes/openblas/all/CMakeLists.txt b/recipes/openblas/all/CMakeLists.txt deleted file mode 100644 index cdeeef45d13c1..0000000000000 --- a/recipes/openblas/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") - include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -else() - include(conanbuildinfo.cmake) -endif() -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/openblas/all/conanfile.py b/recipes/openblas/all/conanfile.py index 01041ab44fd28..d0b7d2c131bf8 100644 --- a/recipes/openblas/all/conanfile.py +++ b/recipes/openblas/all/conanfile.py @@ -1,9 +1,14 @@ -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 copy, get, replace_in_file, rmdir, collect_libs +from conan.tools.build import cross_building +from conan.tools.scm import Version +from conan.tools.apple import fix_apple_shared_install_name +from conan.errors import ConanInvalidConfiguration import os import functools -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class OpenblasConan(ConanFile): @@ -28,66 +33,70 @@ class OpenblasConan(ConanFile): "use_thread": True, "dynamic_arch": False, } - generators = "cmake" short_paths = True - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - def export_sources(self): - self.copy("CMakeLists.txt") - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def validate(self): - if hasattr(self, "settings_build") and tools.cross_building(self, skip_x64_x86=True): + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): raise ConanInvalidConfiguration("Cross-building not implemented") def source(self): - tools.get( + get(self, **self.conan_data["sources"][self.version], strip_root=True, - destination=self._source_subfolder + destination=self.source_folder ) + if Version(self.version) <= "0.3.15": + replace_in_file(self, os.path.join(self.source_folder, "cmake", "utils.cmake"), + "set(obj_defines ${defines_in})", "set(obj_defines ${defines_in})\r\n\r\n" + + "list(FIND obj_defines \"RC\" def_idx)\r\n" + "if (${def_idx} GREATER -1) \r\n\t" + + "list (REMOVE_ITEM obj_defines \"RC\")\r\n\t" + "list(APPEND obj_defines \"RC=RC\")\r\n" + + "endif ()\r\n" + "list(FIND obj_defines \"CR\" def_idx)\r\n" + + "if (${def_idx} GREATER -1) \r\n\t" + "list (REMOVE_ITEM obj_defines \"CR\")\r\n\t" + + "list(APPEND obj_defines \"CR=CR\")\r\n" + "endif ()") + @functools.lru_cache(1) def _configure_cmake(self): cmake = CMake(self) + cmake.configure() + return cmake + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) if self.options.build_lapack: - self.output.warn("Building with lapack support requires a Fortran compiler.") - cmake.definitions["NOFORTRAN"] = not self.options.build_lapack - cmake.definitions["BUILD_WITHOUT_LAPACK"] = not self.options.build_lapack - cmake.definitions["DYNAMIC_ARCH"] = self.options.dynamic_arch - cmake.definitions["USE_THREAD"] = self.options.use_thread + self.output.warning("Building with lapack support requires a Fortran compiler.") + tc.cache_variables["NOFORTRAN"] = not self.options.build_lapack + tc.cache_variables["BUILD_WITHOUT_LAPACK"] = not self.options.build_lapack + tc.cache_variables["DYNAMIC_ARCH"] = self.options.dynamic_arch + tc.cache_variables["USE_THREAD"] = self.options.use_thread # Required for safe concurrent calls to OpenBLAS routines - cmake.definitions["USE_LOCKING"] = not self.options.use_thread + tc.cache_variables["USE_LOCKING"] = not self.options.use_thread - cmake.definitions[ + tc.cache_variables[ "MSVC_STATIC_CRT" ] = False # don't, may lie to consumer, /MD or /MT is managed by conan # This is a workaround to add the libm dependency on linux, # which is required to successfully compile on older gcc versions. - cmake.definitions["ANDROID"] = self.settings.os in ["Linux", "Android"] + tc.cache_variables["ANDROID"] = self.settings.os in ["Linux", "Android"] - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.generate() def build(self): - if tools.Version(self.version) >= "0.3.12": + if Version(self.version) >= "0.3.12": search = """message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK")""" replace = ( """message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.")""" @@ -104,8 +113,8 @@ def build(self): set (NO_LAPACK 1) endif()""" - tools.replace_in_file( - os.path.join(self._source_subfolder, "cmake", "f_check.cmake"), + replace_in_file(self, + os.path.join(self.source_folder, self.source_folder, "cmake", "f_check.cmake"), search, replace, ) @@ -113,11 +122,12 @@ def build(self): cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = self._configure_cmake() cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) def package_info(self): # CMake config file: @@ -132,7 +142,7 @@ def package_info(self): self.cpp_info.components["openblas_component"].includedirs.append( os.path.join("include", "openblas") ) - self.cpp_info.components["openblas_component"].libs = tools.collect_libs(self) + self.cpp_info.components["openblas_component"].libs = collect_libs(self) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["openblas_component"].system_libs.append("m") if self.options.use_thread: diff --git a/recipes/openblas/all/test_package/CMakeLists.txt b/recipes/openblas/all/test_package/CMakeLists.txt index 4b2a260fe0ab9..eaf07820c3b1c 100644 --- a/recipes/openblas/all/test_package/CMakeLists.txt +++ b/recipes/openblas/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(OpenBLAS REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/openblas/all/test_package/conanfile.py b/recipes/openblas/all/test_package/conanfile.py index 38f4483872d47..02eb5ce439fb4 100644 --- a/recipes/openblas/all/test_package/conanfile.py +++ b/recipes/openblas/all/test_package/conanfile.py @@ -1,10 +1,20 @@ -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 +# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +22,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/opencolorio/all/CMakeLists.txt b/recipes/opencolorio/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2b..0000000000000 --- a/recipes/opencolorio/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/opencolorio/all/conandata.yml b/recipes/opencolorio/all/conandata.yml index 23ef77f414ab2..7b09a12ca594b 100644 --- a/recipes/opencolorio/all/conandata.yml +++ b/recipes/opencolorio/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.1": + url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.2.1.tar.gz" + sha256: "36f27c5887fc4e5c241805c29b8b8e68725aa05520bcaa7c7ec84c0422b8580e" "2.1.0": url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.1.0.tar.gz" sha256: "81fc7853a490031632a69c73716bc6ac271b395e2ba0e2587af9995c2b0efb5f" @@ -6,13 +9,31 @@ sources: url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v1.1.1.tar.gz" sha256: "c9b5b9def907e1dafb29e37336b702fff22cc6306d445a13b1621b8a754c14c8" patches: + "2.2.1": + - patch_file: "patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch" + patch_description: "use cci package, use PROJECT_BINARY_DIR/PROJECT_SOURCE_DIR" + patch_type: "conan" + - patch_file: "patches/2.2.1-0002-fix-pystring.patch" + patch_description: "fix include path for pystring" + patch_type: "conan" + - patch_file: "patches/2.2.1-0003-strlen.patch" + patch_description: "add std namespace for strlen" + patch_type: "portability" "2.1.0": - - patch_file: "patches/fix-cmake-source-dir-and-targets.patch" - base_path: "source_subfolder" - - patch_file: "patches/pstring.patch" - base_path: "source_subfolder" - - patch_file: "patches/strlen.patch" - base_path: "source_subfolder" + - patch_file: "patches/2.1.0-0001-fix-cmake-source-dir-and-targets.patch" + patch_description: "use cci package, use PROJECT_BINARY_DIR/PROJECT_SOURCE_DIR" + patch_type: "conan" + - patch_file: "patches/2.1.0-0002-fix-pystring.patch" + patch_description: "fix include path for pystring" + patch_type: "conan" + - patch_file: "patches/2.1.0-0003-strlen.patch" + patch_description: "include string.h for strlen" + patch_type: "portability" + - patch_file: "patches/2.1.0-0004-fix-cpp-version-check.patch" + patch_description: "fix C++20 compilation error" + patch_type: "portability" + patch_source: "https://github.com/AcademySoftwareFoundation/OpenColorIO/pull/1542" "1.1.1": - - patch_file: "patches/1.1.1.patch" - base_path: "source_subfolder" + - patch_file: "patches/1.1.1-fix-cmake.patch" + patch_description: "use cci package, use PROJECT_BINARY_DIR/PROJECT_SOURCE_DIR" + patch_type: "conan" diff --git a/recipes/opencolorio/all/conanfile.py b/recipes/opencolorio/all/conanfile.py index 82c7ed3d43c8c..35b16f76f4166 100644 --- a/recipes/opencolorio/all/conanfile.py +++ b/recipes/opencolorio/all/conanfile.py @@ -1,10 +1,14 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc -from conans import ConanFile, CMake, tools -import functools +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, 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 -required_conan_version = ">=1.45.0" - +required_conan_version = ">=1.53.0" class OpenColorIOConan(ConanFile): name = "opencolorio" @@ -13,7 +17,6 @@ class OpenColorIOConan(ConanFile): homepage = "https://opencolorio.org/" url = "https://github.com/conan-io/conan-center-index" topics = ("colors", "visual", "effects", "animation") - settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,20 +29,8 @@ class OpenColorIOConan(ConanFile): "use_sse": True, } - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -49,96 +40,129 @@ 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("expat/2.4.8") - self.requires("openexr/2.5.7") + self.requires("expat/2.5.0") + if Version(self.version) < "2.2.0": + self.requires("openexr/2.5.7") + else: + self.requires("openexr/3.1.7") + self.requires("imath/3.1.6") + self.requires("yaml-cpp/0.7.0") - if tools.Version(self.version) < "2.0.0": + if Version(self.version) < "2.0.0": self.requires("tinyxml/2.6.2") else: - self.requires("pystring/1.1.3") + self.requires("pystring/1.1.4") + + if Version(self.version) >= "2.2.0": + self.requires("minizip-ng/3.0.7") + # for tools only - self.requires("lcms/2.13.1") + self.requires("lcms/2.14") # TODO: add GLUT (needed for ociodisplay tool) def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + # opencolorio>=2.2.0 requires minizip-ng with with_zlib + if Version(self.version) >= "2.2.0" and \ + not self.dependencies["minizip-ng"].options.get_safe("with_zlib", False): + raise ConanInvalidConfiguration(f"{self.ref} requires minizip-ng with with_zlib = True.") + + if Version(self.version) == "1.1.1" and self.options.shared and self.dependencies["yaml-cpp"].options.shared: + raise ConanInvalidConfiguration(f"{self.ref} requires static build yaml-cpp") + if Version(self.version) == "2.2.1" and self.options.shared and self.dependencies["minizip-ng"].options.shared: + raise ConanInvalidConfiguration(f"{self.ref} requires static build minizip-ng") - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) + def build_requirements(self): + if Version(self.version) >= "2.2.0": + self.tool_requires("cmake/[>=3.16 <4]") - if tools.Version(self.version) >= "2.1.0": - cmake.definitions["OCIO_BUILD_PYTHON"] = False + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_VERBOSE_MAKEFILE"] = True + if Version(self.version) >= "2.1.0": + tc.variables["OCIO_BUILD_PYTHON"] = False else: - cmake.definitions["OCIO_BUILD_SHARED"] = self.options.shared - cmake.definitions["OCIO_BUILD_STATIC"] = not self.options.shared - cmake.definitions["OCIO_BUILD_PYGLUE"] = False + tc.variables["OCIO_BUILD_SHARED"] = self.options.shared + tc.variables["OCIO_BUILD_STATIC"] = not self.options.shared + tc.variables["OCIO_BUILD_PYGLUE"] = False - cmake.definitions["USE_EXTERNAL_YAML"] = True - cmake.definitions["USE_EXTERNAL_TINYXML"] = True - cmake.definitions["USE_EXTERNAL_LCMS"] = True + tc.variables["USE_EXTERNAL_YAML"] = True + tc.variables["USE_EXTERNAL_TINYXML"] = True + tc.variables["TINYXML_OBJECT_LIB_EMBEDDED"] = False + tc.variables["USE_EXTERNAL_LCMS"] = True - cmake.definitions["OCIO_USE_SSE"] = self.options.get_safe("use_sse", False) + tc.variables["OCIO_USE_SSE"] = self.options.get_safe("use_sse", False) # openexr 2.x provides Half library - cmake.definitions["OCIO_USE_OPENEXR_HALF"] = True + tc.variables["OCIO_USE_OPENEXR_HALF"] = True - cmake.definitions["OCIO_BUILD_APPS"] = True - cmake.definitions["OCIO_BUILD_DOCS"] = False - cmake.definitions["OCIO_BUILD_TESTS"] = False - cmake.definitions["OCIO_BUILD_GPU_TESTS"] = False - cmake.definitions["OCIO_USE_BOOST_PTR"] = False + tc.variables["OCIO_BUILD_APPS"] = True + tc.variables["OCIO_BUILD_DOCS"] = False + tc.variables["OCIO_BUILD_TESTS"] = False + tc.variables["OCIO_BUILD_GPU_TESTS"] = False + tc.variables["OCIO_USE_BOOST_PTR"] = False # avoid downloading dependencies - cmake.definitions["OCIO_INSTALL_EXT_PACKAGE"] = "NONE" + tc.variables["OCIO_INSTALL_EXT_PACKAGE"] = "NONE" if is_msvc(self) and not self.options.shared: # define any value because ifndef is used - cmake.definitions["OpenColorIO_SKIP_IMPORTS"] = True + tc.variables["OpenColorIO_SKIP_IMPORTS"] = True - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0091"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) - for module in ("expat", "lcms2", "pystring", "yaml-cpp", "Imath"): - tools.remove_files_by_mask(os.path.join(self._source_subfolder, "share", "cmake", "modules"), "Find"+module+".cmake") + for module in ("expat", "lcms2", "pystring", "yaml-cpp", "Imath", "minizip-ng"): + rm(self, "Find"+module+".cmake", os.path.join(self.source_folder, "share", "cmake", "modules")) def build(self): self._patch_sources() - cm = self._configure_cmake() + cm = CMake(self) + cm.configure() cm.build() def package(self): - cm = self._configure_cmake() + cm = CMake(self) cm.install() if not self.options.shared: - self.copy("*", src=os.path.join(self.package_folder, - "lib", "static"), dst="lib") - tools.rmdir(os.path.join(self.package_folder, "lib", "static")) - - tools.rmdir(os.path.join(self.package_folder, "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "share")) + copy(self, "*", + src=os.path.join(self.package_folder, "lib", "static"), + dst=os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "static")) + + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) # nop for 2.x - tools.remove_files_by_mask(self.package_folder, "OpenColorIOConfig*.cmake") + rm(self, "OpenColorIOConfig*.cmake", self.package_folder) + + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + if Version(self.version) == "1.1.1": + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.set_property("cmake_file_name", "OpenColorIO") @@ -147,12 +171,14 @@ def package_info(self): self.cpp_info.libs = ["OpenColorIO"] - if tools.Version(self.version) < "2.1.0": + if Version(self.version) < "2.1.0": if not self.options.shared: self.cpp_info.defines.append("OpenColorIO_STATIC") - if self.settings.os == "Macos": + if is_apple_os(self): self.cpp_info.frameworks.extend(["Foundation", "IOKit", "ColorSync", "CoreGraphics"]) + if Version(self.version) == "2.1.0": + self.cpp_info.frameworks.extend(["Carbon", "CoreFoundation"]) if is_msvc(self) and not self.options.shared: self.cpp_info.defines.append("OpenColorIO_SKIP_IMPORTS") diff --git a/recipes/opencolorio/all/patches/1.1.1-fix-cmake.patch b/recipes/opencolorio/all/patches/1.1.1-fix-cmake.patch new file mode 100644 index 0000000000000..39c1981eda4b5 --- /dev/null +++ b/recipes/opencolorio/all/patches/1.1.1-fix-cmake.patch @@ -0,0 +1,287 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e4f3119..9eb6d07 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,14 +1,16 @@ ++cmake_minimum_required(VERSION 2.8) + project(OpenColorIO) + set(OCIO_VERSION_MAJOR 1) + set(OCIO_VERSION_MINOR 1) + set(OCIO_VERSION_PATCH 1) + +-cmake_minimum_required(VERSION 2.8) +-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/share/cmake) ++list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/share/cmake) + if(NOT DEFINED CMAKE_FIRST_RUN) + SET(CMAKE_FIRST_RUN 1 CACHE INTERNAL "") + endif() + ++set(CMAKE_CXX_STANDARD 11) ++ + ############################################################################### + ### GLOBAL ### + +@@ -142,11 +144,11 @@ endif(CMAKE_COMPILER_IS_GNUCXX) + ############################################################################### + ### Python ### + +-OCIOFindPython() ++#OCIOFindPython() + + # Find Python, used for (possibly) building pyglue, and now to + # construct the external project path +-set(EXTDIST_ROOT ${CMAKE_BINARY_DIR}/ext/dist) ++set(EXTDIST_ROOT ${PROJECT_BINARY_DIR}/ext/dist) + set(EXTDIST_BINPATH ${EXTDIST_ROOT}/bin) + if(PYTHON_OK) + set(EXTDIST_PYTHONPATH ${EXTDIST_ROOT}/${PYTHON_VARIANT_PATH}) +@@ -170,7 +172,12 @@ messageonce("Setting EXTDIST_PYTHONPATH: ${EXTDIST_PYTHONPATH}") + + if(USE_EXTERNAL_TINYXML) + set(TINYXML_VERSION_MIN "2.6.1") +- find_package(TinyXML) ++ find_package(TinyXML REQUIRED) ++ set(TINYXML_FOUND ${TinyXML_FOUND}) ++ set(TINYXML_LIBRARIES tinyxml::tinyxml) ++ set(TINYXML_VERSION "${TinyXML_VERSION}") ++ list(APPEND EXTERNAL_LIBRARIES ${TINYXML_LIBRARIES}) ++ + if(TINYXML_FOUND) + if(TINYXML_VERSION VERSION_EQUAL ${TINYXML_VERSION_MIN} OR + TINYXML_VERSION VERSION_GREATER ${TINYXML_VERSION_MIN}) +@@ -251,6 +258,13 @@ endif(USE_EXTERNAL_TINYXML) + if(USE_EXTERNAL_YAML) + # Set minimum yaml version for non-patched sources. + set(YAML_VERSION_MIN "0.3.0") ++ find_package(yaml-cpp REQUIRED) ++ set(YAML_CPP_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_YAML-CPP}") ++ set(YAML_CPP_LIBRARIES yaml-cpp) ++ set(YAML_CPP_VERSION "${yaml-cpp_VERSION}") ++ list(APPEND EXTERNAL_LIBRARIES ${YAML_CPP_LIBRARIES}) ++ ++ if(0) + include(FindPkgConfig) + pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp) + find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h +@@ -293,6 +307,7 @@ if(USE_EXTERNAL_YAML) + else(YAML_CPP_FOUND) + message(FATAL_ERROR "ERROR: System yaml-cpp library was not found. Make sure the library is installed and the pkg-config file exists.") + endif(YAML_CPP_FOUND) ++ endif() + else(USE_EXTERNAL_YAML) ## provide 2 ways to build this dependency + set(YAML_CPP_VERSION 0.3.0) + set(YAML_CPP_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/ext/dist -DYAML_CPP_BUILD_TOOLS:BOOL=FALSE -DOCIO_INLINES_HIDDEN:BOOL=${OCIO_INLINES_HIDDEN}) +@@ -384,7 +399,7 @@ else() + set(OCIO_INLINES_HIDDEN OFF) + endif() + +-set(EXTERNAL_COMPILE_FLAGS "-DTIXML_USE_STL ${YAML_CPP_COMPILE_FLAGS} ${GCC_COMPILE_FLAGS}") ++set(EXTERNAL_COMPILE_FLAGS "${YAML_CPP_COMPILE_FLAGS} ${GCC_COMPILE_FLAGS}") + + set(EXTERNAL_LINK_FLAGS "") + set(EXTERNAL_LIBRARY_DIRS ${PROJECT_BINARY_DIR}/ext/dist/lib) +@@ -460,7 +475,7 @@ endif() + if(OCIO_BUILD_APPS AND (OCIO_BUILD_STATIC OR OCIO_BUILD_SHARED) ) + + # Try to find OpenImageIO (OIIO) and OpenGL stuff +- OCIOFindOpenImageIO() ++ #OCIOFindOpenImageIO() + + if(OIIO_FOUND) + add_subdirectory(src/apps/ocioconvert) +@@ -528,7 +543,7 @@ endif() + + ############################################################################### + ### Configure env script ### +-configure_file(${CMAKE_SOURCE_DIR}/share/ocio/setup_ocio.sh.in ++configure_file(${PROJECT_SOURCE_DIR}/share/ocio/setup_ocio.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/setup_ocio.sh @ONLY) + + INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/setup_ocio.sh DESTINATION share/ocio/) +@@ -597,7 +612,7 @@ if(TARGET OpenColorIO_STATIC) + endif() + endif() + install(EXPORT OpenColorIO DESTINATION cmake) +-file(WRITE "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake" ++file(WRITE "${PROJECT_BINARY_DIR}/OpenColorIOConfig.cmake" + " + get_filename_component(OpenColorIO_DIR \"\${CMAKE_CURRENT_LIST_FILE}\" PATH) + +@@ -646,4 +661,4 @@ file(WRITE "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake" + message(STATUS OPENCOLORIO_FOUND=\${OPENCOLORIO_FOUND}) + " + ) +-install(FILES "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake" DESTINATION .) ++install(FILES "${PROJECT_BINARY_DIR}/OpenColorIOConfig.cmake" DESTINATION .) +diff --git a/share/cmake/OCIOMacros.cmake b/share/cmake/OCIOMacros.cmake +index b9fb239..b1a206e 100644 +--- a/share/cmake/OCIOMacros.cmake ++++ b/share/cmake/OCIOMacros.cmake +@@ -356,9 +356,9 @@ ENDMACRO() + + MACRO(ExtractRstCPP INFILE OUTFILE) + add_custom_command( +- WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++ WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + OUTPUT ${OUTFILE} +- COMMAND ${PYTHON} ${CMAKE_SOURCE_DIR}/share/sphinx/ExtractRstFromSourceCPP.py ${INFILE} ${OUTFILE} ++ COMMAND ${PYTHON} ${PROJECT_SOURCE_DIR}/share/sphinx/ExtractRstFromSourceCPP.py ${INFILE} ${OUTFILE} + DEPENDS ${INFILE} + COMMENT "Extracting reStructuredText from ${INFILE} (using old process)" + ) +@@ -366,9 +366,9 @@ ENDMACRO() + + MACRO(ExtractRstSimple INFILE OUTFILE) + add_custom_command( +- WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++ WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + OUTPUT ${OUTFILE} +- COMMAND ${PYTHON} ${CMAKE_SOURCE_DIR}/share/sphinx/ExtractRstFromSourceSimple.py ${INFILE} ${OUTFILE} ++ COMMAND ${PYTHON} ${PROJECT_SOURCE_DIR}/share/sphinx/ExtractRstFromSourceSimple.py ${INFILE} ${OUTFILE} + DEPENDS ${INFILE} + COMMENT "Extracting reStructuredText from ${INFILE}" + ) +diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt +index d31b4e3..4aa1efb 100644 +--- a/src/apps/ociobakelut/CMakeLists.txt ++++ b/src/apps/ociobakelut/CMakeLists.txt +@@ -1,6 +1,10 @@ + # LCMS +-include(FindPkgConfig FindPackageMessage) +-pkg_check_modules(LCMS QUIET lcms2) ++find_package(lcms REQUIRED) ++set(LCMS_FOUND ${lcms_FOUND}) ++set(LCMS_VERSION ${lcms_VERSION}) ++set(LCMS_LIBRARIES ${lcms_LIBRARIES}) ++set(LCMS_INCLUDE_DIR ${lcms_INCLUDE_DIR}) ++ + if(LCMS_FOUND AND (LCMS_VERSION VERSION_EQUAL 2.1 OR LCMS_VERSION VERSION_GREATER 2.1)) + FIND_PACKAGE_MESSAGE(LCMS "Found lcms: ${LCMS_LIBRARIES}" + "${LCMS_INCLUDE_DIR}") +@@ -29,12 +33,12 @@ else() + set(LCMS_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/${CMAKE_STATIC_LIBRARY_PREFIX}lcms2${CMAKE_STATIC_LIBRARY_SUFFIX}) + endif() + +-file(GLOB_RECURSE share_src_files "${CMAKE_SOURCE_DIR}/src/apps/share/*.cpp") ++file(GLOB_RECURSE share_src_files "${PROJECT_SOURCE_DIR}/src/apps/share/*.cpp") + + include_directories( +- ${CMAKE_SOURCE_DIR}/export/ +- ${CMAKE_BINARY_DIR}/export/ +- ${CMAKE_SOURCE_DIR}/src/apps/share/ ++ ${PROJECT_SOURCE_DIR}/export/ ++ ${PROJECT_BINARY_DIR}/export/ ++ ${PROJECT_SOURCE_DIR}/src/apps/share/ + ${LCMS_INCLUDE_DIRS} + ${Boost_INCLUDE_DIR} + ) +diff --git a/src/apps/ociocheck/CMakeLists.txt b/src/apps/ociocheck/CMakeLists.txt +index 4955f4d..14b5017 100644 +--- a/src/apps/ociocheck/CMakeLists.txt ++++ b/src/apps/ociocheck/CMakeLists.txt +@@ -1,9 +1,9 @@ +-file(GLOB_RECURSE share_src_files "${CMAKE_SOURCE_DIR}/src/apps/share/*.cpp") ++file(GLOB_RECURSE share_src_files "${PROJECT_SOURCE_DIR}/src/apps/share/*.cpp") + + include_directories( +- ${CMAKE_SOURCE_DIR}/export/ +- ${CMAKE_BINARY_DIR}/export/ +- ${CMAKE_SOURCE_DIR}/src/apps/share/ ++ ${PROJECT_SOURCE_DIR}/export/ ++ ${PROJECT_BINARY_DIR}/export/ ++ ${PROJECT_SOURCE_DIR}/src/apps/share/ + ${Boost_INCLUDE_DIR} + ) + +diff --git a/src/core/CDLTransform.cpp b/src/core/CDLTransform.cpp +index 8b05deb..a7d6031 100644 +--- a/src/core/CDLTransform.cpp ++++ b/src/core/CDLTransform.cpp +@@ -126,7 +126,11 @@ OCIO_NAMESPACE_ENTER + TiXmlPrinter printer; + printer.SetStreamPrinting(); + doc.Accept( &printer ); +- return printer.Str(); ++ #ifdef TIXML_USE_STL ++ return printer.Str(); ++ #else ++ return printer.CStr(); ++ #endif + } + } + +diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt +index 1eb691b..a2f099a 100644 +--- a/src/core/CMakeLists.txt ++++ b/src/core/CMakeLists.txt +@@ -2,29 +2,29 @@ + ### OCIO CORE ### + + include_directories( +- ${CMAKE_SOURCE_DIR}/export/ +- ${CMAKE_BINARY_DIR}/export/ +- ${CMAKE_SOURCE_DIR}/ext/oiio/src/include ++ ${PROJECT_SOURCE_DIR}/export/ ++ ${PROJECT_BINARY_DIR}/export/ ++ ${PROJECT_SOURCE_DIR}/ext/oiio/src/include + ${EXTERNAL_INCLUDE_DIRS} + ) + +-file(GLOB_RECURSE core_src_files "${CMAKE_SOURCE_DIR}/src/core/*.cpp") +-file(GLOB_RECURSE core_export_headers "${CMAKE_SOURCE_DIR}/export/OpenColorIO/*.h") ++file(GLOB_RECURSE core_src_files "${PROJECT_SOURCE_DIR}/src/core/*.cpp") ++file(GLOB_RECURSE core_export_headers "${PROJECT_SOURCE_DIR}/export/OpenColorIO/*.h") + + message(STATUS "Create OpenColorABI.h from OpenColorABI.h.in") +-configure_file(${CMAKE_SOURCE_DIR}/export/OpenColorIO/OpenColorABI.h.in +- ${CMAKE_BINARY_DIR}/export/OpenColorABI.h @ONLY) +-list(APPEND core_export_headers ${CMAKE_BINARY_DIR}/export/OpenColorABI.h) ++configure_file(${PROJECT_SOURCE_DIR}/export/OpenColorIO/OpenColorABI.h.in ++ ${PROJECT_BINARY_DIR}/export/OpenColorABI.h @ONLY) ++list(APPEND core_export_headers ${PROJECT_BINARY_DIR}/export/OpenColorABI.h) + + # Process all warnings as errors + + if(WIN32) + # On debug mode there are other kinds of warning... + if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") +- set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} /WX") ++ # set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} /WX") + endif() + else() +- set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} -Werror") ++ # set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} -Werror") + endif() + + # SHARED +@@ -75,7 +75,7 @@ endif() + # STATIC + + if(OCIO_BUILD_STATIC) +- list(REMOVE_ITEM core_src_files ${CMAKE_SOURCE_DIR}/src/core/UnitTest.cpp) ++ list(REMOVE_ITEM core_src_files ${PROJECT_SOURCE_DIR}/src/core/UnitTest.cpp) + add_library(OpenColorIO_STATIC STATIC ${EXTERNAL_OBJECTS} ${core_src_files}) + add_dependencies(OpenColorIO_STATIC TINYXML_LIB YAML_CPP_LIB) + if(EXTERNAL_LIBRARIES) +@@ -113,7 +113,7 @@ install(FILES ${core_export_headers} + + # pkg-config + message(STATUS "Create OpenColorIO.pc from OpenColorIO.pc.in") +-configure_file(${CMAKE_SOURCE_DIR}/export/pkgconfig/OpenColorIO.pc.in ++configure_file(${PROJECT_SOURCE_DIR}/export/pkgconfig/OpenColorIO.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc + DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/lib${LIB_SUFFIX}/pkgconfig/) +diff --git a/src/core/OCIOYaml.cpp b/src/core/OCIOYaml.cpp +index 68fcef6..a1c1c1d 100644 +--- a/src/core/OCIOYaml.cpp ++++ b/src/core/OCIOYaml.cpp +@@ -1442,7 +1442,7 @@ OCIO_NAMESPACE_ENTER + #ifdef OLDYAML + if(node.FindValue("ocio_profile_version") == NULL) + #else +- if(node["ocio_profile_version"] == NULL) ++ if(node["ocio_profile_version"].IsNull()) + #endif + { + std::ostringstream os; diff --git a/recipes/opencolorio/all/patches/2.1.0-0001-fix-cmake-source-dir-and-targets.patch b/recipes/opencolorio/all/patches/2.1.0-0001-fix-cmake-source-dir-and-targets.patch new file mode 100644 index 0000000000000..5de7b145077d6 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.1.0-0001-fix-cmake-source-dir-and-targets.patch @@ -0,0 +1,61 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b0840ac..e4875ab 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,9 +9,9 @@ cmake_minimum_required(VERSION 3.12) + + set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} +- ${CMAKE_SOURCE_DIR}/share/cmake/utils +- ${CMAKE_SOURCE_DIR}/share/cmake/macros +- ${CMAKE_SOURCE_DIR}/share/cmake/modules ++ ${CMAKE_CURRENT_SOURCE_DIR}/share/cmake/utils ++ ${CMAKE_CURRENT_SOURCE_DIR}/share/cmake/macros ++ ${CMAKE_CURRENT_SOURCE_DIR}/share/cmake/modules + ) + + set(CMAKE_WARN_DEPRECATED ON) +@@ -272,7 +272,7 @@ else() + set(OCIO_SETUP_NAME setup_ocio.sh) + endif() + +-configure_file(${CMAKE_SOURCE_DIR}/share/ocio/${OCIO_SETUP_NAME}.in ++configure_file(${PROJECT_SOURCE_DIR}/share/ocio/${OCIO_SETUP_NAME}.in + ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/${OCIO_SETUP_NAME} @ONLY) + + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/${OCIO_SETUP_NAME} DESTINATION share/ocio/) +diff --git a/share/cmake/modules/FindExtPackages.cmake b/share/cmake/modules/FindExtPackages.cmake +index 86a0225..73d8599 100644 +--- a/share/cmake/modules/FindExtPackages.cmake ++++ b/share/cmake/modules/FindExtPackages.cmake +@@ -50,7 +50,7 @@ else() + + # OpenEXR/IlmBase (<=2.5) + # https://github.com/AcademySoftwareFoundation/openexr +- find_package(Half 2.4.0 REQUIRED) ++ find_package(OpenEXR 2.4.0 REQUIRED) + + set(OCIO_HALF_LIB IlmBase::Half CACHE STRING "Half library target" FORCE) + set(OCIO_USE_IMATH_HALF "0" CACHE STRING "Whether 'half' type will be sourced from the Imath library (>=v3.0)" FORCE) +@@ -65,7 +65,7 @@ if(OCIO_BUILD_APPS) + + # lcms2 + # https://github.com/mm2/Little-CMS +- find_package(lcms2 2.2 REQUIRED) ++ find_package(lcms 2.2 REQUIRED) + endif() + + if(OCIO_BUILD_OPENFX) +diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt +index 7eb1cd8..de13607 100755 +--- a/src/apps/ociobakelut/CMakeLists.txt ++++ b/src/apps/ociobakelut/CMakeLists.txt +@@ -35,7 +35,7 @@ set_target_properties(ociobakelut + target_link_libraries(ociobakelut + PRIVATE + apputils +- lcms2::lcms2 ++ lcms::lcms + OpenColorIO + ) + diff --git a/recipes/opencolorio/all/patches/2.1.0-0002-fix-pystring.patch b/recipes/opencolorio/all/patches/2.1.0-0002-fix-pystring.patch new file mode 100644 index 0000000000000..38f15d7e20889 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.1.0-0002-fix-pystring.patch @@ -0,0 +1,117 @@ +diff --git a/src/OpenColorIO/Context.cpp b/src/OpenColorIO/Context.cpp +index 26fdcbee..9ddb4522 100644 +--- a/src/OpenColorIO/Context.cpp ++++ b/src/OpenColorIO/Context.cpp +@@ -14,7 +14,7 @@ + #include "Mutex.h" + #include "PathUtils.h" + #include "PrivateTypes.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + + +diff --git a/src/OpenColorIO/OCIOYaml.cpp b/src/OpenColorIO/OCIOYaml.cpp +index 67cafdf1..744fb817 100644 +--- a/src/OpenColorIO/OCIOYaml.cpp ++++ b/src/OpenColorIO/OCIOYaml.cpp +@@ -19,7 +19,7 @@ + #include "ParseUtils.h" + #include "PathUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + #include "ViewingRules.h" + #include "yaml-cpp/yaml.h" +diff --git a/src/OpenColorIO/Op.cpp b/src/OpenColorIO/Op.cpp +index ebbba040..08db0f68 100755 +--- a/src/OpenColorIO/Op.cpp ++++ b/src/OpenColorIO/Op.cpp +@@ -20,7 +20,7 @@ + #include "ops/lut1d/Lut1DOp.h" + #include "ops/lut3d/Lut3DOp.h" + #include "ops/range/RangeOp.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + + namespace OCIO_NAMESPACE + { +diff --git a/src/OpenColorIO/PathUtils.cpp b/src/OpenColorIO/PathUtils.cpp +index 7ed5e9e8..e71d03d9 100644 +--- a/src/OpenColorIO/PathUtils.cpp ++++ b/src/OpenColorIO/PathUtils.cpp +@@ -10,7 +10,7 @@ + + #include "Mutex.h" + #include "PathUtils.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + + #if !defined(_WIN32) +diff --git a/src/OpenColorIO/fileformats/FileFormatCTF.cpp b/src/OpenColorIO/fileformats/FileFormatCTF.cpp +index 89c13066..648aabc0 100644 +--- a/src/OpenColorIO/fileformats/FileFormatCTF.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatCTF.cpp +@@ -22,7 +22,7 @@ + #include "OpBuilders.h" + #include "ops/noop/NoOps.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "TransformBuilder.h" + #include "transforms/FileTransform.h" + #include "utils/StringUtils.h" +diff --git a/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp b/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp +index a52bc728..bd827f06 100755 +--- a/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp +@@ -16,7 +16,7 @@ + #include "ops/lut1d/Lut1DOp.h" + #include "ops/lut3d/Lut3DOp.h" + #include "ParseUtils.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "Platform.h" + #include "transforms/FileTransform.h" + #include "utils/StringUtils.h" +diff --git a/src/OpenColorIO/fileformats/FileFormatICC.cpp b/src/OpenColorIO/fileformats/FileFormatICC.cpp +index df86206e..b6983cf6 100755 +--- a/src/OpenColorIO/fileformats/FileFormatICC.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatICC.cpp +@@ -12,7 +12,7 @@ + #include "ops/gamma/GammaOp.h" + #include "ops/lut1d/Lut1DOp.h" + #include "ops/matrix/MatrixOp.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "transforms/FileTransform.h" + + +diff --git a/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp b/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp +index 0f83f5b3..d6ee59de 100755 +--- a/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp +@@ -13,7 +13,7 @@ + #include "ops/lut3d/Lut3DOp.h" + #include "ParseUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "transforms/FileTransform.h" + #include "utils/StringUtils.h" + +diff --git a/src/OpenColorIO/transforms/FileTransform.cpp b/src/OpenColorIO/transforms/FileTransform.cpp +index 4f6ea887..97621959 100755 +--- a/src/OpenColorIO/transforms/FileTransform.cpp ++++ b/src/OpenColorIO/transforms/FileTransform.cpp +@@ -17,7 +17,7 @@ + #include "ops/noop/NoOps.h" + #include "PathUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + + diff --git a/recipes/opencolorio/all/patches/2.1.0-0003-strlen.patch b/recipes/opencolorio/all/patches/2.1.0-0003-strlen.patch new file mode 100644 index 0000000000000..b90bcdfcf5d57 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.1.0-0003-strlen.patch @@ -0,0 +1,12 @@ +diff --git a/src/OpenColorIO/FileRules.cpp b/src/OpenColorIO/FileRules.cpp +index 794dfdbe..94729459 100644 +--- a/src/OpenColorIO/FileRules.cpp ++++ b/src/OpenColorIO/FileRules.cpp +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + + #include + diff --git a/recipes/opencolorio/all/patches/2.1.0-0004-fix-cpp-version-check.patch b/recipes/opencolorio/all/patches/2.1.0-0004-fix-cpp-version-check.patch new file mode 100644 index 0000000000000..50d9ce38deeed --- /dev/null +++ b/recipes/opencolorio/all/patches/2.1.0-0004-fix-cpp-version-check.patch @@ -0,0 +1,18 @@ +diff --git a/share/cmake/utils/CppVersion.cmake b/share/cmake/utils/CppVersion.cmake +index aeca6c0..6b4dc4e 100644 +--- a/share/cmake/utils/CppVersion.cmake ++++ b/share/cmake/utils/CppVersion.cmake +@@ -12,11 +12,11 @@ if(NOT DEFINED CMAKE_CXX_STANDARD) + message(STATUS "Setting C++ version to '11' as none was specified.") + set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard to compile against") + elseif(NOT CMAKE_CXX_STANDARD IN_LIST SUPPORTED_CXX_STANDARDS) +- message(FATAL_ERROR ++ message(WARNING + "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} is unsupported. Supported standards are: ${SUPPORTED_CXX_STANDARDS_STR}.") + endif() + +-set_property(CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS "${SUPPORTED_CXX_STANDARDS}") ++#set_property(CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS "${SUPPORTED_CXX_STANDARDS}") + + include(CheckCXXCompilerFlag) + diff --git a/recipes/opencolorio/all/patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch b/recipes/opencolorio/all/patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch new file mode 100644 index 0000000000000..7ddacb8e6a532 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch @@ -0,0 +1,96 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 17e188d..91af0ec 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -332,7 +332,7 @@ install( + FILE ${OCIO_TARGETS_EXPORT_NAME} + ) + +-if (NOT BUILD_SHARED_LIBS) ++if (0) + # Install custom macros used in the find modules. + install(FILES + ${CMAKE_CURRENT_LIST_DIR}/share/cmake/macros/VersionUtils.cmake +diff --git a/share/cmake/modules/FindExtPackages.cmake b/share/cmake/modules/FindExtPackages.cmake +index 5455a08..eb91a37 100644 +--- a/share/cmake/modules/FindExtPackages.cmake ++++ b/share/cmake/modules/FindExtPackages.cmake +@@ -138,7 +138,7 @@ endif() + + # minizip-ng + # https://github.com/zlib-ng/minizip-ng +-find_package(minizip-ng 3.0.7 REQUIRED) ++find_package(minizip 3.0.7 REQUIRED) + + if(OCIO_BUILD_APPS) + +@@ -149,7 +149,7 @@ if(OCIO_BUILD_APPS) + + # lcms2 + # https://github.com/mm2/Little-CMS +- find_package(lcms2 2.2 REQUIRED) ++ find_package(lcms 2.2 REQUIRED) + endif() + + if(OCIO_BUILD_OPENFX) +@@ -214,7 +214,7 @@ if(OCIO_BUILD_APPS) + # OpenEXR + # https://github.com/AcademySoftwareFoundation/openexr + set(_OpenEXR_ExternalProject_VERSION "3.1.5") +- find_package(OpenEXR 3.0) ++ find_package(OpenEXR CONFIG) + + if(OpenEXR_FOUND AND TARGET OpenEXR::OpenEXR) + add_library(OpenColorIO::ImageIOBackend ALIAS OpenEXR::OpenEXR) +diff --git a/share/cmake/utils/CppVersion.cmake b/share/cmake/utils/CppVersion.cmake +index 175d89c..2d34a65 100644 +--- a/share/cmake/utils/CppVersion.cmake ++++ b/share/cmake/utils/CppVersion.cmake +@@ -16,8 +16,6 @@ elseif(NOT CMAKE_CXX_STANDARD IN_LIST SUPPORTED_CXX_STANDARDS) + "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} is unsupported. Supported standards are: ${SUPPORTED_CXX_STANDARDS_STR}.") + endif() + +-set_property(CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS "${SUPPORTED_CXX_STANDARDS}") +- + include(CheckCXXCompilerFlag) + + # As CheckCXXCompilerFlag implicitly uses CMAKE_CXX_FLAGS some custom flags could trigger unrelated +diff --git a/src/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt +index 1c4d774..da70227 100755 +--- a/src/OpenColorIO/CMakeLists.txt ++++ b/src/OpenColorIO/CMakeLists.txt +@@ -289,7 +289,7 @@ target_link_libraries(OpenColorIO + "$" + "$" + yaml-cpp +- MINIZIP::minizip-ng ++ MINIZIP::minizip + ) + + if(APPLE) +diff --git a/src/apps/ocioarchive/CMakeLists.txt b/src/apps/ocioarchive/CMakeLists.txt +index 6b868d1..820e36c 100644 +--- a/src/apps/ocioarchive/CMakeLists.txt ++++ b/src/apps/ocioarchive/CMakeLists.txt +@@ -19,7 +19,7 @@ target_link_libraries(ocioarchive + PRIVATE + apputils + OpenColorIO +- MINIZIP::minizip-ng ++ MINIZIP::minizip + ) + + install(TARGETS ocioarchive +diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt +index a50e87e..37174ea 100755 +--- a/src/apps/ociobakelut/CMakeLists.txt ++++ b/src/apps/ociobakelut/CMakeLists.txt +@@ -28,7 +28,7 @@ set_target_properties(ociobakelut + target_link_libraries(ociobakelut + PRIVATE + apputils +- lcms2::lcms2 ++ lcms::lcms + OpenColorIO + ) + diff --git a/recipes/opencolorio/all/patches/2.2.1-0002-fix-pystring.patch b/recipes/opencolorio/all/patches/2.2.1-0002-fix-pystring.patch new file mode 100644 index 0000000000000..fc58ce5a2da84 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.2.1-0002-fix-pystring.patch @@ -0,0 +1,163 @@ +diff --git a/src/OpenColorIO/Config.cpp b/src/OpenColorIO/Config.cpp +index 665d522..6abc149 100644 +--- a/src/OpenColorIO/Config.cpp ++++ b/src/OpenColorIO/Config.cpp +@@ -33,7 +33,7 @@ + #include "Platform.h" + #include "PrivateTypes.h" + #include "Processor.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "transforms/FileTransform.h" + #include "utils/StringUtils.h" + #include "ViewingRules.h" +diff --git a/src/OpenColorIO/Context.cpp b/src/OpenColorIO/Context.cpp +index bb6fb07..a8890ed 100644 +--- a/src/OpenColorIO/Context.cpp ++++ b/src/OpenColorIO/Context.cpp +@@ -15,7 +15,7 @@ + #include "OCIOZArchive.h" + #include "PathUtils.h" + #include "PrivateTypes.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + + namespace OCIO_NAMESPACE +diff --git a/src/OpenColorIO/OCIOYaml.cpp b/src/OpenColorIO/OCIOYaml.cpp +index 62cbb0d..59c1564 100644 +--- a/src/OpenColorIO/OCIOYaml.cpp ++++ b/src/OpenColorIO/OCIOYaml.cpp +@@ -19,7 +19,7 @@ + #include "ParseUtils.h" + #include "PathUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + #include "ViewingRules.h" + #include "yaml-cpp/yaml.h" +diff --git a/src/OpenColorIO/OCIOZArchive.cpp b/src/OpenColorIO/OCIOZArchive.cpp +index 85fc7bb..4cd1448 100644 +--- a/src/OpenColorIO/OCIOZArchive.cpp ++++ b/src/OpenColorIO/OCIOZArchive.cpp +@@ -11,7 +11,7 @@ + #include + #include "Mutex.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + #include "transforms/FileTransform.h" + +@@ -630,4 +630,4 @@ void CIOPOciozArchive::buildEntries() + getEntriesMappingFromArchiveFile(m_archiveAbsPath, m_entries); + } + +-} // namespace OCIO_NAMESPACE +\ No newline at end of file ++} // namespace OCIO_NAMESPACE +diff --git a/src/OpenColorIO/Op.cpp b/src/OpenColorIO/Op.cpp +index 1ae607a..bb5406f 100755 +--- a/src/OpenColorIO/Op.cpp ++++ b/src/OpenColorIO/Op.cpp +@@ -20,7 +20,7 @@ + #include "ops/lut1d/Lut1DOp.h" + #include "ops/lut3d/Lut3DOp.h" + #include "ops/range/RangeOp.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + + namespace OCIO_NAMESPACE + { +diff --git a/src/OpenColorIO/PathUtils.cpp b/src/OpenColorIO/PathUtils.cpp +index 9dc8c6b..4a1096d 100644 +--- a/src/OpenColorIO/PathUtils.cpp ++++ b/src/OpenColorIO/PathUtils.cpp +@@ -10,7 +10,7 @@ + #include "Mutex.h" + #include "PathUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + #include "OCIOZArchive.h" + +diff --git a/src/OpenColorIO/fileformats/FileFormatCTF.cpp b/src/OpenColorIO/fileformats/FileFormatCTF.cpp +index ebed326..9f70ff8 100644 +--- a/src/OpenColorIO/fileformats/FileFormatCTF.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatCTF.cpp +@@ -23,7 +23,7 @@ + #include "OpBuilders.h" + #include "ops/noop/NoOps.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "TransformBuilder.h" + #include "transforms/FileTransform.h" + #include "utils/StringUtils.h" +diff --git a/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp b/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp +index a52bc72..bd827f0 100755 +--- a/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp +@@ -16,7 +16,7 @@ + #include "ops/lut1d/Lut1DOp.h" + #include "ops/lut3d/Lut3DOp.h" + #include "ParseUtils.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "Platform.h" + #include "transforms/FileTransform.h" + #include "utils/StringUtils.h" +diff --git a/src/OpenColorIO/fileformats/FileFormatICC.cpp b/src/OpenColorIO/fileformats/FileFormatICC.cpp +index 786c8a5..4953103 100755 +--- a/src/OpenColorIO/fileformats/FileFormatICC.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatICC.cpp +@@ -14,7 +14,7 @@ + #include "ops/lut1d/Lut1DOp.h" + #include "ops/matrix/MatrixOp.h" + #include "ops/range/RangeOp.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "transforms/FileTransform.h" + + +diff --git a/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp b/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp +index 7402efd..cc3acb4 100755 +--- a/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp +@@ -13,7 +13,7 @@ + #include "ops/lut3d/Lut3DOp.h" + #include "ParseUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "transforms/FileTransform.h" + #include "utils/StringUtils.h" + #include "utils/NumberUtils.h" +diff --git a/src/OpenColorIO/transforms/FileTransform.cpp b/src/OpenColorIO/transforms/FileTransform.cpp +index 4fd4d5d..dc5eb3c 100755 +--- a/src/OpenColorIO/transforms/FileTransform.cpp ++++ b/src/OpenColorIO/transforms/FileTransform.cpp +@@ -19,7 +19,7 @@ + #include "ops/noop/NoOps.h" + #include "PathUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + + namespace OCIO_NAMESPACE +diff --git a/vendor/openfx/OCIOUtils.cpp b/vendor/openfx/OCIOUtils.cpp +index ca44905..469ed35 100644 +--- a/vendor/openfx/OCIOUtils.cpp ++++ b/vendor/openfx/OCIOUtils.cpp +@@ -9,7 +9,7 @@ namespace OCIO = OCIO_NAMESPACE; + #include + + #include "ofxsLog.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + + namespace + { diff --git a/recipes/opencolorio/all/patches/2.2.1-0003-strlen.patch b/recipes/opencolorio/all/patches/2.2.1-0003-strlen.patch new file mode 100644 index 0000000000000..b694178bdf977 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.2.1-0003-strlen.patch @@ -0,0 +1,13 @@ +diff --git a/src/OpenColorIO/FileRules.cpp b/src/OpenColorIO/FileRules.cpp +index 61a5e0f..e0df0d0 100644 +--- a/src/OpenColorIO/FileRules.cpp ++++ b/src/OpenColorIO/FileRules.cpp +@@ -62,7 +62,7 @@ std::string ConvertToRegularExpression(const char * globPattern, bool ignoreCase + + if (ignoreCase) + { +- const size_t length = strlen(globPattern); ++ const size_t length = std::strlen(globPattern); + bool respectCase = false; + for (size_t i = 0; i < length; ++i) + { diff --git a/recipes/opencolorio/all/test_package/CMakeLists.txt b/recipes/opencolorio/all/test_package/CMakeLists.txt index 074c63fccc550..825fa34216bd6 100644 --- a/recipes/opencolorio/all/test_package/CMakeLists.txt +++ b/recipes/opencolorio/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(OpenColorIO REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} OpenColorIO::OpenColorIO) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE OpenColorIO::OpenColorIO) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/opencolorio/all/test_package/conanfile.py b/recipes/opencolorio/all/test_package/conanfile.py index 38f4483872d47..a9fb96656f203 100644 --- a/recipes/opencolorio/all/test_package/conanfile.py +++ b/recipes/opencolorio/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/opencolorio/all/test_v1_package/CMakeLists.txt b/recipes/opencolorio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/opencolorio/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/opencolorio/all/test_v1_package/conanfile.py b/recipes/opencolorio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/opencolorio/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/opencolorio/config.yml b/recipes/opencolorio/config.yml index 1f2bc2497ef89..f6a7702dbfaa4 100644 --- a/recipes/opencolorio/config.yml +++ b/recipes/opencolorio/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.1": + folder: "all" "2.1.0": folder: "all" "1.1.1": diff --git a/recipes/opencore-amr/all/conandata.yml b/recipes/opencore-amr/all/conandata.yml index 44a009a38d2e0..8ac0f24717894 100644 --- a/recipes/opencore-amr/all/conandata.yml +++ b/recipes/opencore-amr/all/conandata.yml @@ -5,3 +5,12 @@ sources: "0.1.5": url: "https://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.5.tar.gz" sha256: "2c006cb9d5f651bfb5e60156dbff6af3c9d35c7bbcc9015308c0aff1e14cd341" +patches: + "0.1.6": + - patch_file: "patches/0001-remove-deprecated-register-keyword.patch" + patch_description: "remove deprecated register keyword" + patch_type: "portability" + "0.1.5": + - patch_file: "patches/0001-remove-deprecated-register-keyword.patch" + patch_description: "remove deprecated register keyword" + patch_type: "portability" diff --git a/recipes/opencore-amr/all/conanfile.py b/recipes/opencore-amr/all/conanfile.py index 3c1ebbcb2a163..c502c5b4aa5f7 100644 --- a/recipes/opencore-amr/all/conanfile.py +++ b/recipes/opencore-amr/all/conanfile.py @@ -1,13 +1,13 @@ from conan import ConanFile -from conan.tools import files -from conan.tools.microsoft import is_msvc -from conan.tools.scm import Version -from conans import AutoToolsBuildEnvironment -from conans.tools import environment_append, get_env, os_info, vcvars, unix_path -from contextlib import contextmanager +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.54.0" class OpencoreAmrConan(ConanFile): @@ -17,6 +17,7 @@ class OpencoreAmrConan(ConanFile): topics = ("audio-codec", "amr", "opencore") url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" + package_type = "library" settings = "os", "compiler", "build_type", "arch" options = { "shared": [True, False], @@ -27,82 +28,83 @@ class OpencoreAmrConan(ConanFile): "fPIC": True, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") def build_requirements(self): - if self._settings_build.os == "Windows" and not get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - if self.settings.compiler == "Visual Studio": - self.build_requires("automake/1.16.5") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") def source(self): - files.get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @contextmanager - def _build_context(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--disable-compile-c", + "--disable-examples", + ]) if is_msvc(self): - with vcvars(self): - env = { - "CC": "cl -nologo", - "CXX": "cl -nologo", - "LD": "link -nologo", - "AR": "{} lib".format(unix_path(self.deps_user_info["automake"].ar_lib)), - } - with environment_append(env): - yield - else: - yield - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment( - self, win_bash=os_info.is_windows) - - def yes_no(v): return "yes" if v else "no" - args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - ] + tc.extra_cxxflags.append("-EHsc") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cxxflags.append("-FS") + tc.generate() + if is_msvc(self): - self._autotools.cxx_flags.append("-EHsc") - if Version(self.settings.compiler.version) >= "12": - self._autotools.flags.append("-FS") - self._autotools.configure( - args=args, configure_dir=self._source_subfolder) - return self._autotools + env = Environment() + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_msvc") def build(self): - with self._build_context(): - self._configure_autotools() - self._autotools.make() + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self._autotools.install() - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - files.rm(self, "*.la", os.path.join(self.package_folder, "lib")) - files.rmdir(self, os.path.join( - self.package_folder, "lib", "pkgconfig")) - if self.settings.compiler == "Visual Studio" and self.options.shared: + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + fix_apple_shared_install_name(self) + + if is_msvc(self) and self.options.shared: for lib in ("opencore-amrwb", "opencore-amrnb"): - files.rename(self, os.path.join(self.package_folder, "lib", "{}.dll.lib".format(lib)), + rename(self, os.path.join(self.package_folder, "lib", "{}.dll.lib".format(lib)), os.path.join(self.package_folder, "lib", "{}.lib".format(lib))) def package_info(self): @@ -114,5 +116,8 @@ def package_info(self): "cmake_target_name", f'opencore-amr::{lib}') self.cpp_info.components[lib].set_property("pkg_config_name", lib) self.cpp_info.components[lib].libs = [lib] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components[lib].system_libs.extend(["m"]) + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generator removed self.cpp_info.components[lib].names["pkg_config"] = lib diff --git a/recipes/opencore-amr/all/patches/0001-remove-deprecated-register-keyword.patch b/recipes/opencore-amr/all/patches/0001-remove-deprecated-register-keyword.patch new file mode 100644 index 0000000000000..8604cff0abf61 --- /dev/null +++ b/recipes/opencore-amr/all/patches/0001-remove-deprecated-register-keyword.patch @@ -0,0 +1,1357 @@ +From 8fa46c7a3092186e922ed27e9b38d79caf178f36 Mon Sep 17 00:00:00 2001 +From: Gregor Jasny +Date: Mon, 19 Jun 2023 20:41:15 +0200 +Subject: [PATCH] remove deprecated register keyword + +--- + .../common/include/basic_op_arm_gcc_v5.h | 62 ++++++------ + .../common/include/basic_op_c_equivalent.h | 10 +- + .../gsm_amr/amr_nb/common/include/l_add.h | 8 +- + .../gsm_amr/amr_nb/common/include/l_mac.h | 6 +- + .../gsm_amr/amr_nb/common/include/l_msu.h | 6 +- + .../gsm_amr/amr_nb/common/include/l_mult.h | 6 +- + .../gsm_amr/amr_nb/common/include/l_sub.h | 8 +- + .../gsm_amr/amr_nb/common/include/mpy_32.h | 14 +-- + .../gsm_amr/amr_nb/common/include/mpy_32_16.h | 6 +- + .../gsm_amr/amr_nb/common/include/mult.h | 6 +- + .../gsm_amr/amr_nb/common/include/negate.h | 2 +- + .../gsm_amr/amr_nb/common/include/norm_l.h | 4 +- + .../gsm_amr/amr_nb/common/include/norm_s.h | 4 +- + .../gsm_amr/amr_nb/common/src/az_lsp.cpp | 8 +- + .../audio/gsm_amr/amr_nb/common/src/div_s.cpp | 4 +- + .../gsm_amr/amr_nb/common/src/gc_pred.cpp | 8 +- + .../gsm_amr/amr_nb/common/src/gmed_n.cpp | 6 +- + .../audio/gsm_amr/amr_nb/common/src/l_abs.cpp | 2 +- + .../gsm_amr/amr_nb/common/src/l_shr_r.cpp | 2 +- + .../gsm_amr/amr_nb/common/src/lsp_az.cpp | 8 +- + .../gsm_amr/amr_nb/common/src/mult_r.cpp | 2 +- + .../gsm_amr/amr_nb/common/src/negate.cpp | 2 +- + .../gsm_amr/amr_nb/common/src/norm_l.cpp | 4 +- + .../gsm_amr/amr_nb/common/src/norm_s.cpp | 4 +- + .../gsm_amr/amr_nb/common/src/pred_lt.cpp | 6 +- + .../gsm_amr/amr_nb/common/src/q_plsf_3.cpp | 6 +- + .../gsm_amr/amr_nb/common/src/residu.cpp | 2 +- + .../audio/gsm_amr/amr_nb/common/src/round.cpp | 2 +- + .../audio/gsm_amr/amr_nb/common/src/shr.cpp | 4 +- + .../audio/gsm_amr/amr_nb/common/src/shr_r.cpp | 2 +- + .../gsm_amr/amr_nb/common/src/weight_a.cpp | 2 +- + .../audio/gsm_amr/amr_nb/dec/src/d1035pf.cpp | 2 +- + .../audio/gsm_amr/amr_nb/dec/src/d_plsf_5.cpp | 2 +- + .../audio/gsm_amr/amr_nb/dec/src/int_lsf.cpp | 6 +- + .../audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp | 8 +- + .../audio/gsm_amr/amr_nb/dec/src/pstfilt.cpp | 4 +- + .../audio/gsm_amr/amr_nb/enc/src/autocorr.cpp | 6 +- + .../audio/gsm_amr/amr_nb/enc/src/c2_9pf.cpp | 24 ++--- + .../audio/gsm_amr/amr_nb/enc/src/cl_ltp.cpp | 2 +- + .../audio/gsm_amr/amr_nb/enc/src/convolve.cpp | 2 +- + .../audio/gsm_amr/amr_nb/enc/src/cor_h.cpp | 4 +- + .../audio/gsm_amr/amr_nb/enc/src/cor_h_x.cpp | 6 +- + .../audio/gsm_amr/amr_nb/enc/src/cor_h_x2.cpp | 6 +- + .../audio/gsm_amr/amr_nb/enc/src/dtx_enc.cpp | 6 +- + .../audio/gsm_amr/amr_nb/enc/src/l_negate.cpp | 2 +- + .../audio/gsm_amr/amr_nb/enc/src/levinson.cpp | 10 +- + .../audio/gsm_amr/amr_nb/enc/src/pitch_ol.cpp | 2 +- + .../audio/gsm_amr/amr_nb/enc/src/pre_proc.cpp | 2 +- + .../audio/gsm_amr/amr_nb/enc/src/set_sign.cpp | 2 +- + .../gsm_amr/amr_wb/dec/src/normalize_amr_wb.h | 4 +- + .../amr_wb/dec/src/pvamrwb_math_op.cpp | 2 +- + .../src/pvamrwbdecoder_basic_op_gcc_armv5.h | 98 +++++++++---------- + 52 files changed, 208 insertions(+), 208 deletions(-) + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h +index 5752171..2c93015 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h +@@ -112,10 +112,10 @@ extern "C" + L_sum = 32-bit sum of L_var1 and L_var2 (Word32) + */ + +- static inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow) ++ static inline Word32 L_add(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + { +- register Word32 ra = L_var1; +- register Word32 rb = L_var2; ++ Word32 ra = L_var1; ++ Word32 rb = L_var2; + Word32 result; + + OSCL_UNUSED_ARG(pOverflow); +@@ -151,8 +151,8 @@ extern "C" + */ + static inline Word32 L_sub(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + { +- register Word32 ra = L_var1; +- register Word32 rb = L_var2; ++ Word32 ra = L_var1; ++ Word32 rb = L_var2; + Word32 result; + + OSCL_UNUSED_ARG(pOverflow); +@@ -190,9 +190,9 @@ extern "C" + */ + static inline Word32 L_mac(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = L_var3; +- register Word32 rb = var1; +- register Word32 rc = var2; ++ Word32 ra = L_var3; ++ Word32 rb = var1; ++ Word32 rc = var2; + Word32 result; + + OSCL_UNUSED_ARG(pOverflow); +@@ -234,8 +234,8 @@ extern "C" + + static inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = var1; +- register Word32 rb = var2; ++ Word32 ra = var1; ++ Word32 rb = var2; + Word32 result; + Word32 product; + +@@ -279,9 +279,9 @@ extern "C" + */ + static inline Word32 L_msu(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = L_var3; +- register Word32 rb = var1; +- register Word32 rc = var2; ++ Word32 ra = L_var3; ++ Word32 rb = var1; ++ Word32 rc = var2; + Word32 product; + Word32 result; + +@@ -326,13 +326,13 @@ extern "C" + Word16 L_var2_lo, + Flag *pOverflow) + { +- register Word32 product32; +- register Word32 L_sum; +- register Word32 L_product, result; +- register Word32 ra = L_var1_hi; +- register Word32 rb = L_var1_lo; +- register Word32 rc = L_var2_hi; +- register Word32 rd = L_var2_lo; ++ Word32 product32; ++ Word32 L_sum; ++ Word32 L_product, result; ++ Word32 ra = L_var1_hi; ++ Word32 rb = L_var1_lo; ++ Word32 rc = L_var2_hi; ++ Word32 rd = L_var2_lo; + + + +@@ -410,9 +410,9 @@ extern "C" + Flag *pOverflow) + { + +- register Word32 ra = L_var1_hi; +- register Word32 rb = L_var1_lo; +- register Word32 rc = var2; ++ Word32 ra = L_var1_hi; ++ Word32 rb = L_var1_lo; ++ Word32 rc = var2; + Word32 result, L_product; + + OSCL_UNUSED_ARG(pOverflow); +@@ -470,8 +470,8 @@ extern "C" + */ + static inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = var1; +- register Word32 rb = var2; ++ Word32 ra = var1; ++ Word32 rb = var2; + Word32 product; + Word32 temp; + +@@ -494,9 +494,9 @@ extern "C" + + static inline Word32 amrnb_fxp_mac_16_by_16bb(Word32 L_var1, Word32 L_var2, Word32 L_var3) + { +- register Word32 ra = L_var1; +- register Word32 rb = L_var2; +- register Word32 rc = L_var3; ++ Word32 ra = L_var1; ++ Word32 rb = L_var2; ++ Word32 rc = L_var3; + Word32 result; + + __asm__ volatile("smlabb %0, %1, %2, %3" +@@ -508,9 +508,9 @@ extern "C" + + static inline Word32 amrnb_fxp_msu_16_by_16bb(Word32 L_var1, Word32 L_var2, Word32 L_var3) + { +- register Word32 ra = L_var1; +- register Word32 rb = L_var2; +- register Word32 rc = L_var3; ++ Word32 ra = L_var1; ++ Word32 rb = L_var2; ++ Word32 rc = L_var3; + Word32 result; + + __asm__ volatile("rsb %0, %1, #0" +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h +index 62072a5..d56ecd0 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h +@@ -109,7 +109,7 @@ extern "C" + Returns: + L_sum = 32-bit sum of L_var1 and L_var2 (Word32) + */ +- static inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow) ++ static inline Word32 L_add(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + { + Word32 L_sum; + +@@ -148,8 +148,8 @@ extern "C" + Returns: + L_diff = 32-bit difference of L_var1 and L_var2 (Word32) + */ +- static inline Word32 L_sub(register Word32 L_var1, register Word32 L_var2, +- register Flag *pOverflow) ++ static inline Word32 L_sub(Word32 L_var1, Word32 L_var2, ++ Flag *pOverflow) + { + Word32 L_diff; + +@@ -240,7 +240,7 @@ extern "C" + */ + static inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 L_product; ++ Word32 L_product; + + L_product = (Word32) var1 * var2; + +@@ -446,7 +446,7 @@ extern "C" + */ + static inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 product; ++ Word32 product; + + product = ((Word32) var1 * var2) >> 15; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h +index ac72c31..fc849a5 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h +@@ -88,10 +88,10 @@ extern "C" + ; Function Prototype declaration + ----------------------------------------------------------------------------*/ + #if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/ +- __inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow) ++ __inline Word32 L_add(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + { +- register Word32 ra = L_var1; +- register Word32 rb = L_var2; ++ Word32 ra = L_var1; ++ Word32 rb = L_var2; + Word32 result; + + OSCL_UNUSED_ARG(pOverflow); +@@ -107,7 +107,7 @@ extern "C" + #else /* C EQUIVALENT */ + + +- static inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow) ++ static inline Word32 L_add(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + { + Word32 L_sum; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h +index f672428..173e1dd 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h +@@ -90,9 +90,9 @@ extern "C" + + static inline Word32 L_mac(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = L_var3; +- register Word32 rb = var1; +- register Word32 rc = var2; ++ Word32 ra = L_var3; ++ Word32 rb = var1; ++ Word32 rc = var2; + Word32 result; + + OSCL_UNUSED_ARG(pOverflow); +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h +index 86c5735..de07525 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h +@@ -92,9 +92,9 @@ extern "C" + + __inline Word32 L_msu(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = L_var3; +- register Word32 rb = var1; +- register Word32 rc = var2; ++ Word32 ra = L_var3; ++ Word32 rb = var1; ++ Word32 rc = var2; + Word32 product; + Word32 result; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h +index 33fedb1..5531509 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h +@@ -91,8 +91,8 @@ extern "C" + + __inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = var1; +- register Word32 rb = var2; ++ Word32 ra = var1; ++ Word32 rb = var2; + Word32 result; + Word32 product; + +@@ -115,7 +115,7 @@ extern "C" + + static inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 L_product; ++ Word32 L_product; + + L_product = (Word32) var1 * var2; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h +index 88d86ca..ef83f1c 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h +@@ -93,8 +93,8 @@ extern "C" + + __inline Word32 L_sub(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + { +- register Word32 ra = L_var1; +- register Word32 rb = L_var2; ++ Word32 ra = L_var1; ++ Word32 rb = L_var2; + Word32 result; + + OSCL_UNUSED_ARG(pOverflow); +@@ -109,8 +109,8 @@ extern "C" + + #else /* C EQUIVALENT */ + +- static inline Word32 L_sub(register Word32 L_var1, register Word32 L_var2, +- register Flag *pOverflow) ++ static inline Word32 L_sub(Word32 L_var1, Word32 L_var2, ++ Flag *pOverflow) + { + Word32 L_diff; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h +index 8df43c9..83505f4 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h +@@ -96,13 +96,13 @@ extern "C" + Word16 L_var2_lo, + Flag *pOverflow) + { +- register Word32 product32; +- register Word32 L_sum; +- register Word32 L_product, result; +- register Word32 ra = L_var1_hi; +- register Word32 rb = L_var1_lo; +- register Word32 rc = L_var2_hi; +- register Word32 rd = L_var2_lo; ++ Word32 product32; ++ Word32 L_sum; ++ Word32 L_product, result; ++ Word32 ra = L_var1_hi; ++ Word32 rb = L_var1_lo; ++ Word32 rc = L_var2_hi; ++ Word32 rd = L_var2_lo; + + + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h +index 3a68e69..4eaa732 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h +@@ -96,9 +96,9 @@ extern "C" + Flag *pOverflow) + { + +- register Word32 ra = L_var1_hi; +- register Word32 rb = L_var1_lo; +- register Word32 rc = var2; ++ Word32 ra = L_var1_hi; ++ Word32 rb = L_var1_lo; ++ Word32 rc = var2; + Word32 result, L_product; + + OSCL_UNUSED_ARG(pOverflow); +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h +index c89a94e..c2ebf9a 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h +@@ -89,8 +89,8 @@ extern "C" + + __inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 ra = var1; +- register Word32 rb = var2; ++ Word32 ra = var1; ++ Word32 rb = var2; + Word32 product; + Word32 temp = 0x7FFF; + +@@ -120,7 +120,7 @@ extern "C" + + static inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word32 product; ++ Word32 product; + + product = ((Word32) var1 * var2) >> 15; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/negate.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/negate.h +index 2b77f77..3ff7347 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/negate.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/negate.h +@@ -86,7 +86,7 @@ extern "C" + ; GLOBAL FUNCTION DEFINITIONS + ; Function Prototype declaration + ----------------------------------------------------------------------------*/ +- Word16 negate(register Word16 var1); ++ Word16 negate(Word16 var1); + + /*---------------------------------------------------------------------------- + ; END +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h +index 288b6c7..d3de69f 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h +@@ -91,8 +91,8 @@ extern "C" + #if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) + static inline Word16 norm_l(Word32 L_var1) + { +- register Word32 var_out = 0; +- register Word32 ra = L_var1; ++ Word32 var_out = 0; ++ Word32 ra = L_var1; + if (L_var1) + { + ra ^= (ra << 1); +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h +index 7847f34..e7865f8 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h +@@ -91,8 +91,8 @@ extern "C" + #if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) + static inline Word16 norm_s(Word16 var1) + { +- register Word32 var_out = 0; +- register Word32 ra = var1 << 16; ++ Word32 var_out = 0; ++ Word32 ra = var1 << 16; + if (ra) + { + ra ^= (ra << 1); +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp +index 7711ac9..b3194aa 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp +@@ -489,10 +489,10 @@ void Az_lsp( + Flag *pOverflow /* (i/o): overflow flag */ + ) + { +- register Word16 i; +- register Word16 j; +- register Word16 nf; +- register Word16 ip; ++ Word16 i; ++ Word16 j; ++ Word16 nf; ++ Word16 ip; + Word16 xlow; + Word16 ylow; + Word16 xhigh; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/div_s.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/div_s.cpp +index f60f18b..40667eb 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/div_s.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/div_s.cpp +@@ -165,13 +165,13 @@ Word16 div_s (Word16 var1, Word16 var2) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-OSCL_EXPORT_REF Word16 div_s(register Word16 var1, register Word16 var2) ++OSCL_EXPORT_REF Word16 div_s(Word16 var1, Word16 var2) + { + /*---------------------------------------------------------------------------- + ; Define all local variables + ----------------------------------------------------------------------------*/ + Word16 var_out = 0; +- register Word16 iteration; ++ Word16 iteration; + Word32 L_num; + Word32 L_denom; + Word32 L_denom_by_2; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp +index 71519e9..198cccc 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp +@@ -445,9 +445,9 @@ OSCL_EXPORT_REF void gc_pred( + Flag *pOverflow + ) + { +- register Word16 i; +- register Word32 L_temp1, L_temp2; +- register Word32 L_tmp; ++ Word16 i; ++ Word32 L_temp1, L_temp2; ++ Word32 L_tmp; + Word32 ener_code; + Word32 ener; + Word16 exp, frac; +@@ -929,7 +929,7 @@ OSCL_EXPORT_REF void gc_pred_average_limited( + ) + { + Word16 av_pred_en; +- register Word16 i; ++ Word16 i; + + /* do average in MR122 mode (log2() domain) */ + av_pred_en = 0; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gmed_n.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gmed_n.cpp +index a723ce4..e15549f 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gmed_n.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gmed_n.cpp +@@ -154,9 +154,9 @@ OSCL_EXPORT_REF Word16 gmed_n( /* o : the median value */ + Word16 n /* i : number of inputs */ + ) + { +- register Word16 i, j, ix = 0; +- register Word16 max; +- register Word16 medianIndex; ++ Word16 i, j, ix = 0; ++ Word16 max; ++ Word16 medianIndex; + Word16 tmp[NMAX]; + Word16 tmp2[NMAX]; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_abs.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_abs.cpp +index e436006..8f167c3 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_abs.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_abs.cpp +@@ -143,7 +143,7 @@ Word32 L_abs (Word32 L_var1) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-Word32 L_abs(register Word32 L_var1) ++Word32 L_abs(Word32 L_var1) + { + /*---------------------------------------------------------------------------- + ; Define all local variables +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_shr_r.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_shr_r.cpp +index 0a07135..ec120f0 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_shr_r.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/l_shr_r.cpp +@@ -159,7 +159,7 @@ Word32 L_shr_r (Word32 L_var1, Word16 var2) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-OSCL_EXPORT_REF Word32 L_shr_r(register Word32 L_var1, register Word16 var2, Flag *pOverflow) ++OSCL_EXPORT_REF Word32 L_shr_r(Word32 L_var1, Word16 var2, Flag *pOverflow) + { + Word32 result; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/lsp_az.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/lsp_az.cpp +index c41f614..af1a716 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/lsp_az.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/lsp_az.cpp +@@ -185,8 +185,8 @@ static void Get_lsp_pol( + Word32 *f, + Flag *pOverflow) + { +- register Word16 i; +- register Word16 j; ++ Word16 i; ++ Word16 j; + + Word16 hi; + Word16 lo; +@@ -332,8 +332,8 @@ OSCL_EXPORT_REF void Lsp_Az( + Flag *pOverflow /* (o) : overflow flag */ + ) + { +- register Word16 i; +- register Word16 j; ++ Word16 i; ++ Word16 j; + + Word32 f1[6]; + Word32 f2[6]; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp +index 003afc7..a6b4a62 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp +@@ -155,7 +155,7 @@ Word16 mult_r (Word16 var1, Word16 var2) + OSCL_EXPORT_REF Word16 mult_r(Word16 var1, Word16 var2, Flag *pOverflow) + { + +- register Word32 L_product_arr; ++ Word32 L_product_arr; + + L_product_arr = ((Word32) var1) * var2; /* product */ + L_product_arr += (Word32) 0x00004000L; /* round */ +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/negate.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/negate.cpp +index 3db2458..e16dca0 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/negate.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/negate.cpp +@@ -128,7 +128,7 @@ Word16 negate (Word16 var1) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-Word16 negate(register Word16 var1) ++Word16 negate(Word16 var1) + { + /*---------------------------------------------------------------------------- + ; Define all local variables +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp +index dc4ca72..fabbb44 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp +@@ -153,12 +153,12 @@ Word16 norm_l (Word32 L_var1) + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ + #if !((PV_CPU_ARCH_VERSION >=5) && ((PV_COMPILER == EPV_ARM_GNUC) || (PV_COMPILER == EPV_ARM_RVCT))) +-OSCL_EXPORT_REF Word16 norm_l(register Word32 L_var1) ++OSCL_EXPORT_REF Word16 norm_l(Word32 L_var1) + { + /*---------------------------------------------------------------------------- + ; Define all local variables + ----------------------------------------------------------------------------*/ +- register Word16 var_out = 0; ++ Word16 var_out = 0; + + /*---------------------------------------------------------------------------- + ; Function body here +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp +index 4fdc6d2..66dfb65 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp +@@ -155,13 +155,13 @@ Word16 norm_s (Word16 var1) + ----------------------------------------------------------------------------*/ + #if !((PV_CPU_ARCH_VERSION >=5) && ((PV_COMPILER == EPV_ARM_GNUC) || (PV_COMPILER == EPV_ARM_RVCT))) + +-OSCL_EXPORT_REF Word16 norm_s(register Word16 var1) ++OSCL_EXPORT_REF Word16 norm_s(Word16 var1) + { + /*---------------------------------------------------------------------------- + ; Define all local variables + ----------------------------------------------------------------------------*/ + +- register Word16 var_out = 0; ++ Word16 var_out = 0; + + /*---------------------------------------------------------------------------- + ; Function body here +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/pred_lt.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/pred_lt.cpp +index fd51242..abcfddc 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/pred_lt.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/pred_lt.cpp +@@ -202,9 +202,9 @@ OSCL_EXPORT_REF void Pred_lt_3or6( + Flag *pOverflow /* output: if set, overflow occurred in this function */ + ) + { +- register Word16 i; +- register Word16 j; +- register Word16 k; ++ Word16 i; ++ Word16 j; ++ Word16 k; + + Word16 *pX0; + Word16 *pX2; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/q_plsf_3.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/q_plsf_3.cpp +index 2c5446b..adb3542 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/q_plsf_3.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/q_plsf_3.cpp +@@ -216,7 +216,7 @@ static Word16 Vq_subvec4( /* o: quantization index, Q0 */ + Flag *pOverflow /* o : Flag set when overflow occurs */ + ) + { +- register Word16 i; ++ Word16 i; + Word16 temp; + const Word16 *p_dico; + Word16 index = 0; +@@ -510,7 +510,7 @@ static Word16 Vq_subvec3( /* o: quantization index, Q0 */ + Flag use_half, /* i: use every second entry in codebook */ + Flag *pOverflow) /* o : Flag set when overflow occurs */ + { +- register Word16 i; ++ Word16 i; + Word16 temp; + + const Word16 *p_dico; +@@ -884,7 +884,7 @@ OSCL_EXPORT_REF void Q_plsf_3( + Flag *pOverflow /* o : Flag set when overflow occurs */ + ) + { +- register Word16 i, j; ++ Word16 i, j; + Word16 lsf1[M]; + Word16 wf1[M]; + Word16 lsf_p[M]; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/residu.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/residu.cpp +index 787e043..3e8393e 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/residu.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/residu.cpp +@@ -152,7 +152,7 @@ OSCL_EXPORT_REF void Residu( + { + + +- register Word16 i, j; ++ Word16 i, j; + Word32 s1; + Word32 s2; + Word32 s3; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/round.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/round.cpp +index 9fd4abb..b46a44e 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/round.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/round.cpp +@@ -141,7 +141,7 @@ Word16 pv_round (Word32 L_var1) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-OSCL_EXPORT_REF Word16 pv_round(register Word32 L_var1, Flag *pOverflow) ++OSCL_EXPORT_REF Word16 pv_round(Word32 L_var1, Flag *pOverflow) + { + Word16 result; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr.cpp +index a0fbd35..dabe1a8 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr.cpp +@@ -157,9 +157,9 @@ Word16 shr_std (Word16 var1, Word16 var2) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-OSCL_EXPORT_REF Word16 shr(register Word16 var1, register Word16 var2, Flag *pOverflow) ++OSCL_EXPORT_REF Word16 shr(Word16 var1, Word16 var2, Flag *pOverflow) + { +- register Word16 result; ++ Word16 result; + + if (var2 != 0) + { +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr_r.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr_r.cpp +index b403885..04ef9e6 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr_r.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr_r.cpp +@@ -160,7 +160,7 @@ Word16 shr_r (Word16 var1, Word16 var2) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-OSCL_EXPORT_REF Word16 shr_r(register Word16 var1, register Word16 var2, Flag *pOverflow) ++OSCL_EXPORT_REF Word16 shr_r(Word16 var1, Word16 var2, Flag *pOverflow) + { + /*---------------------------------------------------------------------------- + ; Define all local variables +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/weight_a.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/weight_a.cpp +index 98382b8..04160d8 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/weight_a.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/weight_a.cpp +@@ -137,7 +137,7 @@ OSCL_EXPORT_REF void Weight_Ai( + Word16 a_exp[] /* (o) : Spectral expanded LPC coefficients */ + ) + { +- register Word16 i; ++ Word16 i; + + *(a_exp) = *(a); + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d1035pf.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d1035pf.cpp +index d56b922..5f147bd 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d1035pf.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d1035pf.cpp +@@ -177,7 +177,7 @@ void dec_10i40_35bits( + const Word16* dgray_ptr /* i : ptr to read-only tbl */ + ) + { +- register Word16 i, j, pos1, pos2; ++ Word16 i, j, pos1, pos2; + Word16 sign, tmp; + + for (i = 0; i < L_CODE; i++) +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d_plsf_5.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d_plsf_5.cpp +index 8a4e763..9218c4b 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d_plsf_5.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d_plsf_5.cpp +@@ -263,7 +263,7 @@ void D_plsf_5( + Flag *pOverflow /* o : Flag set when overflow occurs */ + ) + { +- register Word16 i; ++ Word16 i; + Word16 temp; + Word16 sign; + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/int_lsf.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/int_lsf.cpp +index e50eb6c..82844a1 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/int_lsf.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/int_lsf.cpp +@@ -176,9 +176,9 @@ void Int_lsf( + Flag *pOverflow /* o : flag set if overflow occurs */ + ) + { +- register Word16 i; +- register Word16 temp1; +- register Word16 temp2; ++ Word16 i; ++ Word16 temp1; ++ Word16 temp2; + + if (i_subfr == 0) + { +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp +index 22fe3b5..b2d00ff 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp +@@ -147,7 +147,7 @@ int ph_disp_reset (ph_dispState *state) + + Word16 ph_disp_reset(ph_dispState *state) + { +- register Word16 i; ++ Word16 i; + + if (state == (ph_dispState *) NULL) + { +@@ -560,15 +560,15 @@ void ph_disp( + Flag *pOverflow /* i/o : oveflow indicator */ + ) + { +- register Word16 i, i1; +- register Word16 tmp1; ++ Word16 i, i1; ++ Word16 tmp1; + Word32 L_temp; + Word32 L_temp2; + Word16 impNr; /* indicator for amount of disp./filter used */ + + Word16 inno_sav[L_SUBFR]; + Word16 ps_poss[L_SUBFR]; +- register Word16 nze, nPulse; ++ Word16 nze, nPulse; + Word16 ppos; + const Word16 *ph_imp; /* Pointer to phase dispersion filter */ + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/pstfilt.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/pstfilt.cpp +index 479ded7..2bbb9e1 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/pstfilt.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/pstfilt.cpp +@@ -376,10 +376,10 @@ void Post_Filter( + Word16 Ap4[MP1]; /* bandwidth expanded LP parameters */ + Word16 *Az; /* pointer to Az_4: */ + /* LPC parameters in each subframe */ +- register Word16 i_subfr; /* index for beginning of subframe */ ++ Word16 i_subfr; /* index for beginning of subframe */ + Word16 h[L_H]; + +- register Word16 i; ++ Word16 i; + Word16 temp1; + Word16 temp2; + Word32 L_tmp; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/autocorr.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/autocorr.cpp +index 033c93a..014a124 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/autocorr.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/autocorr.cpp +@@ -224,9 +224,9 @@ Word16 Autocorr( + Flag *pOverflow /* (o) : indicates overflow */ + ) + { +- register Word16 i; +- register Word16 j; +- register Word16 norm; ++ Word16 i; ++ Word16 j; ++ Word16 norm; + + Word16 y[L_WINDOW]; + Word32 sum; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/c2_9pf.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/c2_9pf.cpp +index 052a53f..2bcb7b8 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/c2_9pf.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/c2_9pf.cpp +@@ -267,7 +267,7 @@ extern "C" + Word16 dn_sign[L_CODE]; + Word16 rr[L_CODE][L_CODE]; + +- register Word16 i; ++ Word16 i; + + Word16 index; + Word16 sharp; +@@ -527,10 +527,10 @@ extern "C" + Flag * pOverflow /* o : Flag set when overflow occurs */ + ) + { +- register Word16 i0; +- register Word16 i1; ++ Word16 i0; ++ Word16 i1; + Word16 ix = 0; /* initialization only needed to keep gcc silent */ +- register Word16 track1; ++ Word16 track1; + Word16 ipos[NB_PULSE]; + Word16 psk; + Word16 ps0; +@@ -543,7 +543,7 @@ extern "C" + Word32 s; + Word32 alp0; + Word32 alp1; +- register Word16 i; ++ Word16 i; + Word32 L_temp; + Word16 *p_codvec = &codvec[0]; + +@@ -898,13 +898,13 @@ extern "C" + Flag *pOverflow /* o : Flag set when overflow occurs */ + ) + { +- register Word16 i; +- register Word16 j; +- register Word16 k; +- register Word16 track; +- register Word16 first; +- register Word16 index; +- register Word16 rsign; ++ Word16 i; ++ Word16 j; ++ Word16 k; ++ Word16 track; ++ Word16 first; ++ Word16 index; ++ Word16 rsign; + Word16 indx; + Word16 _sign[NB_PULSE]; + Word16 *p0; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cl_ltp.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cl_ltp.cpp +index 50eb6b9..2b49af2 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cl_ltp.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cl_ltp.cpp +@@ -545,7 +545,7 @@ void cl_ltp( + Flag *pOverflow /* o : overflow indicator */ + ) + { +- register Word16 i; ++ Word16 i; + Word16 index; + Word32 L_temp; /* temporarily variable */ + Word16 resu3; /* flag for upsample resolution */ +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/convolve.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/convolve.cpp +index e1471d6..c059532 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/convolve.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/convolve.cpp +@@ -155,7 +155,7 @@ void Convolve( + Word16 L /* (i) : vector size */ + ) + { +- register Word16 i, n; ++ Word16 i, n; + Word32 s1, s2; + + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h.cpp +index 32fbdd1..1b2f3d4 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h.cpp +@@ -193,8 +193,8 @@ void cor_h( + Flag *pOverflow + ) + { +- register Word16 i; +- register Word16 dec; ++ Word16 i; ++ Word16 dec; + + Word16 h2[L_CODE]; + Word32 s; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x.cpp +index 7bb54bb..492e4b8 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x.cpp +@@ -202,9 +202,9 @@ void cor_h_x( + Flag *pOverflow /* (o): pointer to overflow flag */ + ) + { +- register Word16 i; +- register Word16 j; +- register Word16 k; ++ Word16 i; ++ Word16 j; ++ Word16 k; + + Word32 s; + Word32 y32[L_CODE]; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x2.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x2.cpp +index 9d72ab3..fc126b2 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x2.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/cor_h_x2.cpp +@@ -194,9 +194,9 @@ void cor_h_x2( + Flag *pOverflow + ) + { +- register Word16 i; +- register Word16 j; +- register Word16 k; ++ Word16 i; ++ Word16 j; ++ Word16 k; + Word32 s; + Word32 y32[L_CODE]; + Word32 max; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/dtx_enc.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/dtx_enc.cpp +index f4f25f9..202ba2d 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/dtx_enc.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/dtx_enc.cpp +@@ -67,7 +67,7 @@ terms listed above has been obtained from the copyright holder. + ; MACROS + ; Define module specific macros here + ----------------------------------------------------------------------------*/ +-extern Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow); ++extern Word32 L_add(Word32 L_var1, Word32 L_var2, Flag *pOverflow); + + /*---------------------------------------------------------------------------- + ; DEFINES +@@ -544,7 +544,7 @@ void dtx_enc(dtx_encState *st, /* i/o : State struct */ + Flag *pOverflow /* i/o : overflow indicator */ + ) + { +- register Word16 i, j; ++ Word16 i, j; + Word16 temp; + Word16 log_en; + Word16 lsf[M]; +@@ -800,7 +800,7 @@ void dtx_buffer(dtx_encState *st, /* i/o : State struct */ + ) + { + +- register Word16 i; ++ Word16 i; + Word32 L_frame_en; + Word32 L_temp; + Word16 log_en_e; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/l_negate.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/l_negate.cpp +index 9699095..01b9dca 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/l_negate.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/l_negate.cpp +@@ -125,7 +125,7 @@ Word32 L_negate (Word32 L_var1) + /*---------------------------------------------------------------------------- + ; FUNCTION CODE + ----------------------------------------------------------------------------*/ +-Word32 L_negate(register Word32 L_var1) ++Word32 L_negate(Word32 L_var1) + { + /*---------------------------------------------------------------------------- + ; Define all local variables +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/levinson.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/levinson.cpp +index cbd27d7..c138e5d 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/levinson.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/levinson.cpp +@@ -573,8 +573,8 @@ Word16 Levinson( + Flag *pOverflow + ) + { +- register Word16 i; +- register Word16 j; ++ Word16 i; ++ Word16 j; + Word16 hi; + Word16 lo; + Word16 Kh; /* reflexion coefficient; hi and lo */ +@@ -586,9 +586,9 @@ Word16 Levinson( + Word16 Al[M + 1]; + Word16 Anh[M + 1]; /* LPC coef.for next iteration in */ + Word16 Anl[M + 1]; /* double prec. */ +- register Word32 t0; /* temporary variable */ +- register Word32 t1; /* temporary variable */ +- register Word32 t2; /* temporary variable */ ++ Word32 t0; /* temporary variable */ ++ Word32 t1; /* temporary variable */ ++ Word32 t2; /* temporary variable */ + + Word16 *p_Rh; + Word16 *p_Rl; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pitch_ol.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pitch_ol.cpp +index d8efa1e..1d0ff1e 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pitch_ol.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pitch_ol.cpp +@@ -303,7 +303,7 @@ static Word16 Lag_max( /* o : lag found */ + ) + #endif + { +- register Word16 i; ++ Word16 i; + Word16 *p; + Word32 max; + Word32 t0; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pre_proc.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pre_proc.cpp +index 93d23b5..4108f3f 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pre_proc.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/pre_proc.cpp +@@ -436,7 +436,7 @@ void Pre_Process( + Word16 signal[], /* input/output signal */ + Word16 lg) /* length of signal */ + { +- register Word16 i; ++ Word16 i; + Word16 x_n_2; + Word16 x_n_1; + Word32 L_tmp; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/set_sign.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/set_sign.cpp +index f759901..f25b062 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/set_sign.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/set_sign.cpp +@@ -194,7 +194,7 @@ void set_sign(Word16 dn[], /* i/o : correlation between target and h[] */ + Word16 n /* i : # of maximum correlations in dn2[] */ + ) + { +- register Word16 i, j, k; ++ Word16 i, j, k; + Word16 val, min; + Word16 pos = 0; /* initialization only needed to keep gcc silent */ + +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h +index 73ccb71..5132d7d 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h +@@ -66,8 +66,8 @@ terms listed above has been obtained from the copyright holder. + + __inline int16 normalize_amr_wb(int32 x) + { +- register int32 y; +- register int32 ra = x; ++ int32 y; ++ int32 ra = x; + + + asm volatile( +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwb_math_op.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwb_math_op.cpp +index d1ec790..5872512 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwb_math_op.cpp ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwb_math_op.cpp +@@ -205,7 +205,7 @@ int16 div_16by16(int16 var1, int16 var2) + { + + int16 var_out = 0; +- register int16 iteration; ++ int16 iteration; + int32 L_num; + int32 L_denom; + int32 L_denom_by_2; +diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h +index c2c9f36..e9ddbf1 100644 +--- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h ++++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h +@@ -51,10 +51,10 @@ extern "C" + + static inline int16 sub_int16(int16 var1, int16 var2) + { +- register int32 L_var_out; +- register int32 L_var_aux; +- register int32 ra = (int32)var1; +- register int32 rb = (int32)var2; ++ int32 L_var_out; ++ int32 L_var_aux; ++ int32 ra = (int32)var1; ++ int32 rb = (int32)var2; + + asm volatile( + "mov %0, %2, lsl #16\n" +@@ -72,10 +72,10 @@ extern "C" + + static inline int16 add_int16(int16 var1, int16 var2) + { +- register int32 L_var_out; +- register int32 L_var_aux; +- register int32 ra = (int32)var1; +- register int32 rb = (int32)var2; ++ int32 L_var_out; ++ int32 L_var_aux; ++ int32 ra = (int32)var1; ++ int32 rb = (int32)var2; + + asm volatile( + "mov %0, %2, lsl #16\n" +@@ -93,11 +93,11 @@ extern "C" + + static inline int32 mul_32by16(int16 hi, int16 lo, int16 n) + { +- register int32 H_32; +- register int32 L_32; +- register int32 ra = (int32)hi; +- register int32 rb = (int32)lo; +- register int32 rc = (int32)n; ++ int32 H_32; ++ int32 L_32; ++ int32 ra = (int32)hi; ++ int32 rb = (int32)lo; ++ int32 rc = (int32)n; + + + asm volatile( +@@ -117,9 +117,9 @@ extern "C" + + static inline int32 sub_int32(int32 L_var1, int32 L_var2) + { +- register int32 L_var_out; +- register int32 ra = L_var1; +- register int32 rb = L_var2; ++ int32 L_var_out; ++ int32 ra = L_var1; ++ int32 rb = L_var2; + + asm volatile( + "qsub %0, %1, %2" +@@ -132,9 +132,9 @@ extern "C" + + static inline int32 add_int32(int32 L_var1, int32 L_var2) + { +- register int32 L_var_out; +- register int32 ra = L_var1; +- register int32 rb = L_var2; ++ int32 L_var_out; ++ int32 ra = L_var1; ++ int32 rb = L_var2; + + asm volatile( + "qadd %0, %1, %2" +@@ -147,10 +147,10 @@ extern "C" + + static inline int32 msu_16by16_from_int32(int32 L_var3, int16 var1, int16 var2) + { +- register int32 L_var_out; +- register int32 ra = (int32)var1; +- register int32 rb = (int32)var2; +- register int32 rc = L_var3; ++ int32 L_var_out; ++ int32 ra = (int32)var1; ++ int32 rb = (int32)var2; ++ int32 rc = L_var3; + + asm volatile( + "smulbb %0, %1, %2\n" +@@ -166,10 +166,10 @@ extern "C" + + static inline int32 mac_16by16_to_int32(int32 L_var3, int16 var1, int16 var2) + { +- register int32 L_var_out; +- register int32 ra = (int32)var1; +- register int32 rb = (int32)var2; +- register int32 rc = L_var3; ++ int32 L_var_out; ++ int32 ra = (int32)var1; ++ int32 rb = (int32)var2; ++ int32 rc = L_var3; + + asm volatile( + "smulbb %0, %1, %2\n" +@@ -185,9 +185,9 @@ extern "C" + + static inline int32 mul_16by16_to_int32(int16 var1, int16 var2) + { +- register int32 L_var_out; +- register int32 ra = (int32)var1; +- register int32 rb = (int32)var2; ++ int32 L_var_out; ++ int32 ra = (int32)var1; ++ int32 rb = (int32)var2; + + asm volatile( + "smulbb %0, %1, %2\n" +@@ -202,9 +202,9 @@ extern "C" + + static inline int16 mult_int16(int16 var1, int16 var2) + { +- register int32 L_var_out; +- register int32 ra = (int32)var1; +- register int32 rb = (int32)var2; ++ int32 L_var_out; ++ int32 ra = (int32)var1; ++ int32 rb = (int32)var2; + + asm volatile( + "smulbb %0, %1, %2\n" +@@ -218,9 +218,9 @@ extern "C" + + static inline int16 amr_wb_round(int32 L_var1) + { +- register int32 L_var_out; +- register int32 ra = (int32)L_var1; +- register int32 rb = (int32)0x00008000L; ++ int32 L_var_out; ++ int32 ra = (int32)L_var1; ++ int32 rb = (int32)0x00008000L; + + asm volatile( + "qadd %0, %1, %2\n" +@@ -233,9 +233,9 @@ extern "C" + + static inline int16 amr_wb_shl1_round(int32 L_var1) + { +- register int32 L_var_out; +- register int32 ra = (int32)L_var1; +- register int32 rb = (int32)0x00008000L; ++ int32 L_var_out; ++ int32 ra = (int32)L_var1; ++ int32 rb = (int32)0x00008000L; + + asm volatile( + "qadd %0, %1, %1\n" +@@ -250,10 +250,10 @@ extern "C" + + static inline int32 fxp_mac_16by16(const int16 L_var1, const int16 L_var2, int32 L_add) + { +- register int32 tmp; +- register int32 ra = (int32)L_var1; +- register int32 rb = (int32)L_var2; +- register int32 rc = (int32)L_add; ++ int32 tmp; ++ int32 ra = (int32)L_var1; ++ int32 rb = (int32)L_var2; ++ int32 rc = (int32)L_add; + + asm volatile( + "smlabb %0, %1, %2, %3" +@@ -266,9 +266,9 @@ extern "C" + + static inline int32 fxp_mul_16by16bb(int16 L_var1, const int16 L_var2) + { +- register int32 tmp; +- register int32 ra = (int32)L_var1; +- register int32 rb = (int32)L_var2; ++ int32 tmp; ++ int32 ra = (int32)L_var1; ++ int32 rb = (int32)L_var2; + + asm volatile( + "smulbb %0, %1, %2" +@@ -284,9 +284,9 @@ extern "C" + + static inline int32 fxp_mul32_by_16(int32 L_var1, const int32 L_var2) + { +- register int32 tmp; +- register int32 ra = (int32)L_var1; +- register int32 rb = (int32)L_var2; ++ int32 tmp; ++ int32 ra = (int32)L_var1; ++ int32 rb = (int32)L_var2; + + asm volatile( + "smulwb %0, %1, %2" +-- +2.41.0 + diff --git a/recipes/opencore-amr/all/test_package/CMakeLists.txt b/recipes/opencore-amr/all/test_package/CMakeLists.txt index f8165a7ba4d2f..b4b3b8c570e31 100644 --- a/recipes/opencore-amr/all/test_package/CMakeLists.txt +++ b/recipes/opencore-amr/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(opencore-amr REQUIRED) @@ -10,4 +7,4 @@ add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE opencore-amr::opencore-amrnb opencore-amr::opencore-amrwb - ) +) diff --git a/recipes/opencore-amr/all/test_package/conanfile.py b/recipes/opencore-amr/all/test_package/conanfile.py index e16563695d6b4..e730ad6dc0dfc 100644 --- a/recipes/opencore-amr/all/test_package/conanfile.py +++ b/recipes/opencore-amr/all/test_package/conanfile.py @@ -1,9 +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", "arch", "build_type" - generators = "cmake", "cmake_find_package" + 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) @@ -11,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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/opencore-amr/all/test_v1_package/CMakeLists.txt b/recipes/opencore-amr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/opencore-amr/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/opencore-amr/all/test_v1_package/conanfile.py b/recipes/opencore-amr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e16563695d6b4 --- /dev/null +++ b/recipes/opencore-amr/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/opencv/2.x/conanfile.py b/recipes/opencv/2.x/conanfile.py index 33f0ecba72fd2..2dc9254ee3172 100644 --- a/recipes/opencv/2.x/conanfile.py +++ b/recipes/opencv/2.x/conanfile.py @@ -362,18 +362,18 @@ def requirements(self): if self.options.get_safe("with_jpeg") == "libjpeg": self.requires("libjpeg/9e") elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.4") + self.requires("libjpeg-turbo/2.1.5") elif self.options.get_safe("with_jpeg") == "mozjpeg": self.requires("mozjpeg/4.1.1") if self.options.get_safe("with_png"): - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.get_safe("with_jasper"): self.requires("jasper/4.0.0") if self.options.get_safe("with_openexr"): # opencv 2.x doesn't support openexr >= 3 self.requires("openexr/2.5.7") if self.options.get_safe("with_tiff"): - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.5.1") if self.options.get_safe("with_gtk"): self.requires("gtk/system") diff --git a/recipes/opencv/3.x/conanfile.py b/recipes/opencv/3.x/conanfile.py index 51dc5157837a5..40d745d3074f7 100644 --- a/recipes/opencv/3.x/conanfile.py +++ b/recipes/opencv/3.x/conanfile.py @@ -80,27 +80,27 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.4") + self.requires("libjpeg-turbo/2.1.5") elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.1") if self.options.with_png: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_jasper: self.requires("jasper/4.0.0") if self.options.with_openexr: # opencv 3.x doesn't support openexr >= 3 self.requires("openexr/2.5.7") if self.options.with_tiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.5.1") if self.options.with_eigen: - self.requires("eigen/3.3.9") + self.requires("eigen/3.4.0") if self.options.parallel == "tbb": # opencv 3.x doesn't support onetbb >= 2021 self.requires("onetbb/2020.3") if self.options.with_webp: - self.requires("libwebp/1.2.4") + self.requires("libwebp/1.3.1") if self.options.contrib: - self.requires("freetype/2.12.1") + self.requires("freetype/2.13.0") self.requires("harfbuzz/6.0.0") self.requires("gflags/2.2.2") self.requires("glog/0.6.0") diff --git a/recipes/opencv/4.x/conanfile.py b/recipes/opencv/4.x/conanfile.py index dc9fe5f7a71d2..2e1ee11d66a59 100644 --- a/recipes/opencv/4.x/conanfile.py +++ b/recipes/opencv/4.x/conanfile.py @@ -180,7 +180,7 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.4") + self.requires("libjpeg-turbo/2.1.5") elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.1") if self.options.get_safe("with_jpeg2000") == "jasper": @@ -188,15 +188,15 @@ def requirements(self): elif self.options.get_safe("with_jpeg2000") == "openjpeg": self.requires("openjpeg/2.5.0") if self.options.with_png: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_openexr: if Version(self.version) < "4.5.3": # opencv < 4.5.3 doesn't support openexr >= 3 self.requires("openexr/2.5.7") else: - self.requires("openexr/3.1.5") + self.requires("openexr/3.1.7") if self.options.get_safe("with_tiff"): - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.5.1") if self.options.with_eigen: self.requires("eigen/3.4.0") if self.options.get_safe("with_ffmpeg"): @@ -207,9 +207,9 @@ def requirements(self): if self.options.with_ipp == "intel-ipp": self.requires("intel-ipp/2020") if self.options.with_webp: - self.requires("libwebp/1.3.0") + self.requires("libwebp/1.3.1") if self.options.get_safe("contrib_freetype"): - self.requires("freetype/2.12.1") + self.requires("freetype/2.13.0") self.requires("harfbuzz/6.0.0") if self.options.get_safe("contrib_sfm"): self.requires("gflags/2.2.2") diff --git a/recipes/openh264/all/conanfile.py b/recipes/openh264/all/conanfile.py index 0d33427fd3228..00cb4e7604b28 100644 --- a/recipes/openh264/all/conanfile.py +++ b/recipes/openh264/all/conanfile.py @@ -129,7 +129,7 @@ def _make_args(self): libcxx = str(self.settings.compiler.libcxx) stl_lib = f'$(NDKROOT)/sources/cxx-stl/llvm-libc++/libs/$(APP_ABI)/lib{"c++_static.a" if libcxx == "c++_static" else "c++_shared.so"}' \ + "$(NDKROOT)/sources/cxx-stl/llvm-libc++/libs/$(APP_ABI)/libc++abi.a" - ndk_home = os.environ["ANDROID_NDK_HOME"] + ndk_home = self.conf.get("tools.android:ndk_path") args.extend([ f"NDKLEVEL={self.settings.os.api_level}", f"STL_LIB={stl_lib}", diff --git a/recipes/openimageio/all/conanfile.py b/recipes/openimageio/all/conanfile.py index b8281c87a2d2c..f741a725420ff 100644 --- a/recipes/openimageio/all/conanfile.py +++ b/recipes/openimageio/all/conanfile.py @@ -93,12 +93,12 @@ def requirements(self): # Required libraries self.requires("zlib/1.2.13") self.requires("boost/1.78.0") - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.5.1") self.requires("openexr/2.5.7") if self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.2") + self.requires("libjpeg-turbo/2.1.5") self.requires("pugixml/1.12.1") self.requires("libsquish/1.15") self.requires("tsl-robin-map/1.0.1") @@ -106,9 +106,9 @@ def requirements(self): # Optional libraries if self.options.with_libpng: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_freetype: - self.requires("freetype/2.12.1") + self.requires("freetype/2.13.0") if self.options.with_hdf5: self.requires("hdf5/1.12.1") if self.options.with_opencolorio: @@ -138,7 +138,7 @@ def requirements(self): if self.options.with_ptex: self.requires("ptex/2.4.0") if self.options.with_libwebp: - self.requires("libwebp/1.2.4") + self.requires("libwebp/1.3.1") # TODO: R3DSDK dependency # TODO: Nuke dependency diff --git a/recipes/openmvg/all/conanfile.py b/recipes/openmvg/all/conanfile.py index cb31a55747055..b320aba511407 100644 --- a/recipes/openmvg/all/conanfile.py +++ b/recipes/openmvg/all/conanfile.py @@ -67,8 +67,8 @@ def requirements(self): self.requires("eigen/3.4.0", transitive_headers=True) self.requires("flann/1.9.2", transitive_headers=True, transitive_libs=True) self.requires("libjpeg/9e") - self.requires("libpng/1.6.39") - self.requires("libtiff/4.5.0") + self.requires("libpng/1.6.40") + self.requires("libtiff/4.5.1") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index b22982d840a75..5d6b6d3a14882 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -125,18 +125,18 @@ def requirements(self): self.requires("opengl/system") if self.options.use_fontconfig: - self.requires("fontconfig/2.13.93") + self.requires("fontconfig/2.14.2") if self.options.get_safe("with_asio", False): # Should these be private requires? self.requires("asio/1.22.1") - self.requires("boost/1.79.0") + self.requires("boost/1.81.0") if self.options.with_curl: - self.requires("libcurl/7.83.1") + self.requires("libcurl/8.0.1") if self.options.get_safe("with_dcmtk"): self.requires("dcmtk/3.6.6") if self.options.with_freetype: - self.requires("freetype/2.12.1") + self.requires("freetype/2.13.0") if self.options.with_gdal: self.requires("gdal/3.4.3") if self.options.get_safe("with_gif"): @@ -148,11 +148,11 @@ def requirements(self): if self.options.get_safe("with_jpeg"): self.requires("libjpeg/9e") if self.options.get_safe("with_openexr"): - self.requires("openexr/3.1.5") + self.requires("openexr/3.1.7") if self.options.get_safe("with_png"): - self.requires("libpng/1.6.37") + self.requires("libpng/1.6.40") if self.options.with_tiff: - self.requires("libtiff/4.3.0") + self.requires("libtiff/4.5.1") if self.options.with_zlib: self.requires("zlib/1.2.13") diff --git a/recipes/opentelemetry-cpp/all/conandata.yml b/recipes/opentelemetry-cpp/all/conandata.yml index 88ad3e40bea9c..2342d2e0da093 100644 --- a/recipes/opentelemetry-cpp/all/conandata.yml +++ b/recipes/opentelemetry-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.9.1": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.9.1.tar.gz" + sha256: "668de24f81c8d36d75092ad9dcb02a97cd41473adbe72485ece05e336db48249" "1.8.1": url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.8.1.tar.gz" sha256: "3d640201594b07f08dade9cd1017bd0b59674daca26223b560b9bb6bf56264c2" @@ -25,6 +28,10 @@ sources: sha256: "32f12ff15ec257e3462883f84bc291c2d5dc30055604c12ec4b46a36dfa3f189" patches: + "1.9.1": + - patch_file: "patches/1.9.1-0001-fix-cmake.patch" + patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected" + patch_type: "conan" "1.8.1": - patch_file: "patches/1.8.1-0001-fix-cmake.patch" patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected" diff --git a/recipes/opentelemetry-cpp/all/conanfile.py b/recipes/opentelemetry-cpp/all/conanfile.py index 28a5a3dd6a2cd..7d1799e99839a 100644 --- a/recipes/opentelemetry-cpp/all/conanfile.py +++ b/recipes/opentelemetry-cpp/all/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.microsoft import check_min_vs +from conan.tools.env import Environment import os import textwrap @@ -18,6 +19,7 @@ class OpenTelemetryCppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/open-telemetry/opentelemetry-cpp" topics = ("opentelemetry", "telemetry", "tracing", "metrics", "logs") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -91,14 +93,14 @@ def requirements(self): self.requires("ms-gsl/4.0.0") if self.options.with_abseil: - self.requires("abseil/20220623.0") + self.requires("abseil/20220623.0", transitive_headers=True) if self.options.with_otlp: - self.requires("protobuf/3.21.4") + self.requires("protobuf/3.21.9") if Version(self.version) <= "1.4.1": self.requires("opentelemetry-proto/0.11.0") else: - self.requires("opentelemetry-proto/0.19.0") + self.requires("opentelemetry-proto/0.20.0") if self.options.get_safe("with_otlp_grpc"): self.requires("grpc/1.50.1") @@ -109,13 +111,13 @@ def requirements(self): self.options.with_etw ): self.requires("nlohmann_json/3.11.2") - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") if (self.options.with_zipkin or self.options.with_elasticsearch or self.options.get_safe("with_otlp_http") ): - self.requires("libcurl/7.87.0") + self.requires("libcurl/8.1.1") if self.options.with_prometheus: self.requires("prometheus-cpp/1.1.0") @@ -124,7 +126,7 @@ def requirements(self): self.requires("thrift/0.17.0") if Version(self.version) >= "1.3.0": - self.requires("boost/1.81.0") + self.requires("boost/1.82.0") @property def _required_boost_components(self): @@ -144,8 +146,9 @@ def validate(self): if self.options.get_safe("with_otlp_http") and not self.options.with_otlp: raise ConanInvalidConfiguration("Option 'with_otlp_http' requires 'with_otlp'") - if not self.dependencies["grpc"].options.cpp_plugin: - raise ConanInvalidConfiguration(f"{self.ref} requires grpc with cpp_plugin=True") + if self.options.get_safe("with_otlp_grpc"): + if not self.dependencies["grpc"].options.cpp_plugin: + raise ConanInvalidConfiguration(f"{self.ref} requires grpc with cpp_plugin=True") boost_required_comp = any(self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) for boost_comp in self._required_boost_components) @@ -157,8 +160,10 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("protobuf/3.21.4") - self.tool_requires("grpc/1.50.1") + if self.options.with_otlp: + self.tool_requires("protobuf/3.21.9") + if self.options.get_safe("with_otlp_grpc"): + self.tool_requires("grpc/1.50.1") def _create_cmake_module_variables(self, module_file): content = textwrap.dedent("""\ @@ -172,8 +177,7 @@ def _create_cmake_module_variables(self, module_file): save(self, module_file, content) 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) @@ -181,6 +185,7 @@ def generate(self): tc.variables["BUILD_TESTING"] = False tc.variables["BUILD_BENCHMARK"] = False + tc.variables["WITH_EXAMPLES"] = False tc.variables["WITH_NO_DEPRECATED_CODE"] = self.options.with_no_deprecated_code tc.variables["WITH_STL"] = self.options.with_stl tc.variables["WITH_GSL"] = self.options.with_gsl @@ -198,14 +203,21 @@ def generate(self): tc.variables["WITH_LOGS_PREVIEW"] = self.options.with_logs_preview tc.variables["WITH_ASYNC_EXPORT_PREVIEW"] = self.options.with_async_export_preview tc.variables["WITH_METRICS_EXEMPLAR_PREVIEW"] = self.options.with_metrics_exemplar_preview - tc.generate() tc = CMakeDeps(self) tc.generate() + if self.settings.os == "Linux": + env = Environment() + if self.dependencies["grpc"].options.shared: + env.append_path("LD_LIBRARY_PATH", os.path.join(self.dependencies["grpc"].package_folder, "lib")) + if self.dependencies["protobuf"].options.shared: + env.append_path("LD_LIBRARY_PATH", os.path.join(self.dependencies["protobuf"].package_folder, "lib")) + env.vars(self).save_script("conanbuild_loadpath") + def _patch_sources(self): - protos_path = self.deps_user_info["opentelemetry-proto"].proto_root.replace("\\", "/") + protos_path = self.dependencies["opentelemetry-proto"].conf_info.get("user.opentelemetry-proto:proto_root").replace("\\", "/") protos_cmake_path = os.path.join( self.source_folder, "cmake", @@ -215,10 +227,17 @@ def _patch_sources(self): protos_cmake_path, "if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto/.git)", "if(1)") - replace_in_file(self, - protos_cmake_path, - "set(PROTO_PATH \"${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto\")", - f"set(PROTO_PATH \"{protos_path}\")") + if Version(self.version) < "1.9.0": + replace_in_file(self, + protos_cmake_path, + "set(PROTO_PATH \"${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto\")", + f"set(PROTO_PATH \"{protos_path}\")") + else: + replace_in_file(self, + protos_cmake_path, + "\"${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto\")", + f"\"{protos_path}\")") + rmdir(self, os.path.join(self.source_folder, "api", "include", "opentelemetry", "nostd", "absl")) apply_conandata_patches(self) @@ -424,6 +443,7 @@ def package_info(self): self.options.with_elasticsearch ): self.cpp_info.components[self._http_client_name].requires.append("libcurl::libcurl") + self.cpp_info.components[self._http_client_name].requires.append("openssl::openssl") if self.options.get_safe("with_otlp_http"): self.cpp_info.components["opentelemetry_exporter_otlp_http_client"].requires.extend([ diff --git a/recipes/opentelemetry-cpp/all/patches/1.9.1-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.9.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..6deba6e434af5 --- /dev/null +++ b/recipes/opentelemetry-cpp/all/patches/1.9.1-0001-fix-cmake.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dbfb6a2..83c92cc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -299,7 +299,6 @@ if(WITH_JAEGER) + find_package(Thrift QUIET) + if(Thrift_FOUND) + find_package(Boost REQUIRED) +- include_directories(${Boost_INCLUDE_DIR}) + else() + # Install Thrift and propagate via vcpkg toolchain file + if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) +diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake +index 34b33d3..19e67e9 100644 +--- a/cmake/opentelemetry-proto.cmake ++++ b/cmake/opentelemetry-proto.cmake +@@ -311,6 +311,10 @@ if(WITH_OTLP_GRPC) + endif() + endif() + ++if(TARGET gRPC::grpc++) ++ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) ++endif() ++ + if(BUILD_SHARED_LIBS) + foreach(proto_target ${OPENTELEMETRY_PROTO_TARGETS}) + set_property(TARGET ${proto_target} PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/recipes/opentelemetry-cpp/config.yml b/recipes/opentelemetry-cpp/config.yml index 4dd7c49be1a03..8429e67e0bca0 100644 --- a/recipes/opentelemetry-cpp/config.yml +++ b/recipes/opentelemetry-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.9.1": + folder: all "1.8.1": folder: all "1.7.0": diff --git a/recipes/outcome/all/conandata.yml b/recipes/outcome/all/conandata.yml index 862ef733ccf23..a2d2ce108afcd 100644 --- a/recipes/outcome/all/conandata.yml +++ b/recipes/outcome/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.4": + url: "https://github.com/ned14/outcome/archive/v2.2.4.tar.gz" + sha256: "29ad35c1980cf7f75294bb52df678c6a08817228e880fac8454cd6ac390fa1fc" "2.2.3": url: "https://github.com/ned14/outcome/archive/v2.2.3.tar.gz" sha256: "31cc987d73b2625a70f35083ccff26d1c2634d89304f1ea606a294da36cb2958" diff --git a/recipes/outcome/config.yml b/recipes/outcome/config.yml index 5e58124a1d058..a37008481a173 100644 --- a/recipes/outcome/config.yml +++ b/recipes/outcome/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.4": + folder: all "2.2.3": folder: all "2.2.2": diff --git a/recipes/p-ranav-glob/all/conanfile.py b/recipes/p-ranav-glob/all/conanfile.py index 3db82dd1c8225..882ff198b6b6c 100644 --- a/recipes/p-ranav-glob/all/conanfile.py +++ b/recipes/p-ranav-glob/all/conanfile.py @@ -1,23 +1,26 @@ import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class PRanavGlobConan(ConanFile): name = "p-ranav-glob" + description = "Glob for C++17" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/p-ranav/glob" - description = "Glob for C++17" topics = ("c++17", "config", "filesystem", "header-only") - settings = "compiler" - no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _compilers_minimum_version(self): @@ -28,23 +31,33 @@ def _compilers_minimum_version(self): "apple-clang": "11", } - 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.cppstd: - tools.check_min_cppstd(self, 17) + check_min_cppstd(self, 17) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++17, which your compiler does not support.") else: - self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) - - def package_id(self): - self.info.header_only() + self.output.warning(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*", dst="include", src=os.path.join(self._source_subfolder, "single_include")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "single_include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/p-ranav-glob/all/test_package/CMakeLists.txt b/recipes/p-ranav-glob/all/test_package/CMakeLists.txt index 481262167c9f5..5baf64aba53ee 100644 --- a/recipes/p-ranav-glob/all/test_package/CMakeLists.txt +++ b/recipes/p-ranav-glob/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(p-ranav-glob REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE p-ranav-glob::p-ranav-glob) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/p-ranav-glob/all/test_package/conanfile.py b/recipes/p-ranav-glob/all/test_package/conanfile.py index 4903f1a7e8fa0..ef5d7042163ec 100644 --- a/recipes/p-ranav-glob/all/test_package/conanfile.py +++ b/recipes/p-ranav-glob/all/test_package/conanfile.py @@ -1,9 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/p-ranav-glob/all/test_v1_package/CMakeLists.txt b/recipes/p-ranav-glob/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/p-ranav-glob/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/p-ranav-glob/all/test_v1_package/conanfile.py b/recipes/p-ranav-glob/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6c9d5dba712c7 --- /dev/null +++ b/recipes/p-ranav-glob/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + 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/perfetto/all/conandata.yml b/recipes/perfetto/all/conandata.yml index 2fbc0e9ee87b3..9a9ac089dcd8f 100644 --- a/recipes/perfetto/all/conandata.yml +++ b/recipes/perfetto/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "35.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v35.0.tar.gz" + sha256: "224b6552e60ad0fc7c1447bdf719ddd9ceceaf2b6773b71541c21df5890f4166" "34.0": url: "https://github.com/google/perfetto/archive/refs/tags/v34.0.tar.gz" sha256: "81dbf2fac446a0389c80e309b2060dcccd926012ce2a61621a47e3e432aee8c1" diff --git a/recipes/perfetto/config.yml b/recipes/perfetto/config.yml index 0c134a6c0d779..bd944a09e558e 100644 --- a/recipes/perfetto/config.yml +++ b/recipes/perfetto/config.yml @@ -1,4 +1,6 @@ versions: + "35.0": + folder: all "34.0": folder: all "32.1": diff --git a/recipes/pkgconf/all/conandata.yml b/recipes/pkgconf/all/conandata.yml index e18df3ec61ad1..9d79648be05d0 100644 --- a/recipes/pkgconf/all/conandata.yml +++ b/recipes/pkgconf/all/conandata.yml @@ -1,14 +1,19 @@ sources: + "1.9.5": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.9.5.tar.xz" + sha256: "1ac1656debb27497563036f7bffc281490f83f9b8457c0d60bcfb638fb6b6171" "1.9.3": - url: "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.9.3.tar.xz" + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.9.3.tar.xz" sha256: "5fb355b487d54fb6d341e4f18d4e2f7e813a6622cf03a9e87affa6a40565699d" "1.7.4": - url: "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.7.4.tar.xz" + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.7.4.tar.xz" sha256: "d73f32c248a4591139a6b17777c80d4deab6b414ec2b3d21d0a24be348c476ab" "1.7.3": - url: "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.7.3.tar.xz" + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.7.3.tar.xz" sha256: "b846aea51cf696c3392a0ae58bef93e2e72f8e7073ca6ad1ed8b01c85871f9c0" patches: + "1.9.5": + - patch_file: "patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" "1.9.3": - patch_file: "patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" "1.7.4": diff --git a/recipes/pkgconf/all/conanfile.py b/recipes/pkgconf/all/conanfile.py index 33928609ef2e5..2645619ecf320 100644 --- a/recipes/pkgconf/all/conanfile.py +++ b/recipes/pkgconf/all/conanfile.py @@ -48,7 +48,7 @@ def configure(self): self.options.rm_safe("shared") elif self.options.shared: self.options.rm_safe("fPIC") - + self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") @@ -74,7 +74,11 @@ def generate(self): env.generate() tc = MesonToolchain(self) - tc.project_options["tests"] = False + if Version(self.version) >= "1.9.4": + tc.project_options["tests"] = "disabled" + else: + tc.project_options["tests"] = False + if not self.options.enable_lib: tc.project_options["default_library"] = "static" tc.generate() @@ -96,12 +100,12 @@ def package(self): if self.options.enable_lib and not self.options.shared: rename(self, os.path.join(self.package_folder, "lib", "libpkgconf.a"), os.path.join(self.package_folder, "lib", "pkgconf.lib"),) - + if not self.options.enable_lib: rmdir(self, os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "include")) - + rmdir(self, os.path.join(self.package_folder, "share", "man")) rename(self, os.path.join(self.package_folder, "share", "aclocal"), os.path.join(self.package_folder, "bin", "aclocal")) diff --git a/recipes/pkgconf/config.yml b/recipes/pkgconf/config.yml index 9816b088e4d7b..04e2163e1ba77 100644 --- a/recipes/pkgconf/config.yml +++ b/recipes/pkgconf/config.yml @@ -1,4 +1,6 @@ versions: + "1.9.5": + folder: "all" "1.9.3": folder: "all" "1.7.4": diff --git a/recipes/platform.hashing/all/conandata.yml b/recipes/platform.hashing/all/conandata.yml index 82435a6d7e4a8..c156d1c289438 100644 --- a/recipes/platform.hashing/all/conandata.yml +++ b/recipes/platform.hashing/all/conandata.yml @@ -1,10 +1,13 @@ sources: - "0.2.0": - url: https://github.com/linksplatform/Hashing/archive/refs/tags/0.2.0.zip - sha256: 8e34a10d2768d0f2d9ba0cbb88ce193b32245c5a46f14f7ec860c9fddbe8f39f - "0.3.0": - url: https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.3.0.zip - sha256: 8f7d6d401eaec1a78d1f10bfa3783b31ac6189a6ea8edf1ef7f300c47c0e5cb1 + "0.5.5": + url: "https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.5.5.tar.gz" + sha256: "8155f1d0b18cfdad7b93f6c41aaabbe655c9f7ce6bfddb10eae86156cbff02cf" "0.4.0": - url: https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.4.0.zip - sha256: afb8a27a483f636515ca4289f2bfa80fbd37c8416631f0b3ff7001d17a054320 + url: "https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.4.0.zip" + sha256: "afb8a27a483f636515ca4289f2bfa80fbd37c8416631f0b3ff7001d17a054320" + "0.3.0": + url: "https://github.com/linksplatform/Hashing/archive/refs/tags/cpp_0.3.0.zip" + sha256: "8f7d6d401eaec1a78d1f10bfa3783b31ac6189a6ea8edf1ef7f300c47c0e5cb1" + "0.2.0": + url: "https://github.com/linksplatform/Hashing/archive/refs/tags/0.2.0.zip" + sha256: "8e34a10d2768d0f2d9ba0cbb88ce193b32245c5a46f14f7ec860c9fddbe8f39f" diff --git a/recipes/platform.hashing/all/conanfile.py b/recipes/platform.hashing/all/conanfile.py index 7e465451b8a23..8e331fda1698f 100644 --- a/recipes/platform.hashing/all/conanfile.py +++ b/recipes/platform.hashing/all/conanfile.py @@ -1,91 +1,105 @@ from conan import ConanFile -try: - from conan.tools.build import check_min_cppstd -except ImportError: - from conans.tools import check_min_cppstd # FIXME : not in 1.49 -from conan.tools.files import get -from conan.tools.scm import Version 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 +from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class PlatformInterfacesConan(ConanFile): name = "platform.hashing" - license = "LGPL-3.0-only" - homepage = "https://github.com/linksplatform/Hashing" - url = "https://github.com/conan-io/conan-center-index" description = "platform.hashing is one of the libraries of the LinksPlatform modular framework, " \ "which contains std::hash specializations for:\n" \ " - trivial and standard-layout types\n" \ " - types constrained by std::ranges::range\n" \ " - std::any" - topics = ("linksplatform", "cpp20", "hashing", "any", "ranges", "native") - settings = "compiler", "arch" + license = "LGPL-3.0-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/linksplatform/Hashing" + topics = ("linksplatform", "cpp20", "hashing", "any", "ranges", "native", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _internal_cpp_subfolder(self): + return os.path.join(self.source_folder, "cpp", "Platform.Hashing") @property - def _internal_cpp_subfolder(self): - return os.path.join(self._source_subfolder, "cpp", "Platform.Hashing") + def _min_cppstd(self): + return 20 @property def _compilers_minimum_version(self): return { "gcc": "10", "Visual Studio": "16", + "msvc": "192", "clang": "14", "apple-clang": "14" } - @property - def _minimum_cpp_standard(self): - return 20 - - def validate(self): - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) + def layout(self): + basic_layout(self, src_folder="src") - if not minimum_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler)) + def requirements(self): + if Version(self.version) >= "0.5.0": + self.requires("cpu_features/0.8.0", transitive_headers=True) - elif Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{}/{} requires c++{}, " - "which is not supported by {} {}.".format( - self.name, self.version, self._minimum_cpp_standard, self.settings.compiler, - self.settings.compiler.version)) + def package_id(self): + self.info.clear() + 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) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) if self.settings.arch in ("x86", ): - raise ConanInvalidConfiguration("{} does not support arch={}".format(self.name, self.settings.arch)) - - def package_id(self): - self.info.header_only() + raise ConanInvalidConfiguration(f"{self.ref} does not support arch={self.settings.arch}") 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) def package(self): - self.copy("*.h", dst="include", src=self._internal_cpp_subfolder) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + 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, "cpp", "Platform.Hashing") + ) def package_info(self): self.cpp_info.libdirs = [] - suggested_flags = "" - if self.settings.compiler != "Visual Studio": + self.cpp_info.bindirs = [] + if is_msvc(self): + if Version(self.version) >= "0.5.0": + arch_macros = { + "x86_64": "_X86_64_", + "armv8": "_AARCH_", + }.get(str(self.settings.arch), "") + self.cpp_info.defines.append(arch_macros) + else: suggested_flags = { "x86_64": "-march=haswell", "armv7": "-march=armv7", "armv8": "-march=armv8-a", }.get(str(self.settings.arch), "") - self.user_info.suggested_flags = suggested_flags + self.conf_info.define("user.platform_hashing:suggested_flags", suggested_flags) - if "-march" not in "{} {}".format(os.environ.get("CPPFLAGS", ""), os.environ.get("CXXFLAGS", "")): - self.output.warn("platform.hashing needs to have `-march=ARCH` added to CPPFLAGS/CXXFLAGS. " - "A suggestion is available in deps_user_info[{name}].suggested_flags.".format(name=self.name)) + if "-march" not in "{} {}".format(os.environ.get("CPPFLAGS", ""), os.environ.get("CXXFLAGS", "")): + self.output.warning("platform.hashing needs to have `-march=ARCH` added to CPPFLAGS/CXXFLAGS. " + f"A suggestion is available in dependencies[{self.name}].conf_info.get(\"user.platform_hashing:suggested_flags\")") diff --git a/recipes/platform.hashing/all/test_package/CMakeLists.txt b/recipes/platform.hashing/all/test_package/CMakeLists.txt index f3ca06da8ddf9..bbee5010aae03 100644 --- a/recipes/platform.hashing/all/test_package/CMakeLists.txt +++ b/recipes/platform.hashing/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) set(EXTRA_FLAGS "" CACHE STRING "Extra compiler flags") separate_arguments(EXTRA_FLAGS UNIX_COMMAND ${EXTRA_FLAGS}) @@ -7,9 +7,8 @@ if(EXTRA_FLAGS) add_compile_options(${EXTRA_FLAGS}) endif() -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(platform.hashing REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20) +target_link_libraries(${PROJECT_NAME} PRIVATE platform.hashing::platform.hashing) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/platform.hashing/all/test_package/conanfile.py b/recipes/platform.hashing/all/test_package/conanfile.py index ef7d3547638fa..f5e26207308c7 100644 --- a/recipes/platform.hashing/all/test_package/conanfile.py +++ b/recipes/platform.hashing/all/test_package/conanfile.py @@ -1,28 +1,38 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanException +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps +from conan.tools.microsoft import is_msvc import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" @property def _extra_flags(self): - return self.deps_user_info["platform.hashing"].suggested_flags + return self.dependencies["platform.hashing"].conf_info.get("user.platform_hashing:suggested_flags", check_type=str) - def build(self): - if self.settings.compiler != "Visual Studio": - if not self._extra_flags: - raise ConanException("Suggested flags are not available for os={}/arch={}".format(self.settings.os, self.settings.arch)) + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + def generate(self): + tc = CMakeToolchain(self) + if not is_msvc(self): + tc.variables["EXTRA_FLAGS"] = self._extra_flags + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): cmake = CMake(self) - if self.settings.compiler != "Visual Studio": - cmake.definitions["EXTRA_FLAGS"] = self._extra_flags 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) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/platform.hashing/config.yml b/recipes/platform.hashing/config.yml index ee25f0e067a38..ee55970fe3a0b 100644 --- a/recipes/platform.hashing/config.yml +++ b/recipes/platform.hashing/config.yml @@ -1,7 +1,9 @@ versions: - "0.2.0": + "0.5.5": + folder: all + "0.4.0": folder: all "0.3.0": folder: all - "0.4.0": + "0.2.0": folder: all diff --git a/recipes/portable-file-dialogs/all/conanfile.py b/recipes/portable-file-dialogs/all/conanfile.py index c45d2c0106dee..9ef96147823bf 100644 --- a/recipes/portable-file-dialogs/all/conanfile.py +++ b/recipes/portable-file-dialogs/all/conanfile.py @@ -1,36 +1,42 @@ import os -from conans import ConanFile, tools + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class PortableFileDialogsConan(ConanFile): name = "portable-file-dialogs" + description = "Portable GUI dialogs library, C++11, single-header" license = "WTFPL" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/samhocevar/portable-file-dialogs" - description = "Portable GUI dialogs library, C++11, single-header" - topics = ("conan", "gui", "dialogs") - no_copy_source = True - settings = "compiler" + topics = ("gui", "dialogs", "header-only") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True def configure(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() 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 package(self): - self.copy("portable-file-dialogs.h", dst="include", src=self._source_subfolder) - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - - def package_id(self): - self.info.header_only() + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "portable-file-dialogs.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) def package_info(self): self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] diff --git a/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt b/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt index 33ae887aa6aea..c54c9c2b41cf2 100644 --- a/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt +++ b/recipes/portable-file-dialogs/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(portable-file-dialogs REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE portable-file-dialogs::portable-file-dialogs) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/portable-file-dialogs/all/test_package/conanfile.py b/recipes/portable-file-dialogs/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/portable-file-dialogs/all/test_package/conanfile.py +++ b/recipes/portable-file-dialogs/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pprint/all/conanfile.py b/recipes/pprint/all/conanfile.py index bff4a1689bd94..364e5bce8ca73 100644 --- a/recipes/pprint/all/conanfile.py +++ b/recipes/pprint/all/conanfile.py @@ -1,48 +1,63 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + class PprintConan(ConanFile): name = "pprint" - homepage = "https://github.com/p-ranav/pprint" - url = "https://github.com/conan-io/conan-center-index" description = "Pretty Printer for Modern C++" license = "MIT" - settings = "os", "compiler" - topics = ("conan", "pprint", "pretty", "printer") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/p-ranav/pprint" + topics = ("pretty", "printer", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 - def configure(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 17) + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "15", + } - min_compiler_version = { - "gcc": 7, - "clang": 7, - "apple-clang": 10, - "Visual Studio": 15, - }.get(str(self.settings.compiler), None) + def layout(self): + basic_layout(self, src_folder="src") - if min_compiler_version: - if tools.Version(self.settings.compiler.version) < min_compiler_version: - raise ConanInvalidConfiguration("The compiler does not support c++17") - else: - self.output.warn("pprint needs a c++17 capable compiler") + 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): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("{}-{}".format(self.name, self.version), self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") - self.copy(pattern="*.h", src=os.path.join(self._source_subfolder, "include"), dst="include") - self.copy(pattern="*.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/pprint/all/test_package/CMakeLists.txt b/recipes/pprint/all/test_package/CMakeLists.txt index 3572b806e9a79..58ce520a06b4f 100644 --- a/recipes/pprint/all/test_package/CMakeLists.txt +++ b/recipes/pprint/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(pprint REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE pprint::pprint) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/pprint/all/test_package/conanfile.py b/recipes/pprint/all/test_package/conanfile.py index bd7165a553cf4..e0e49c1e8d6b6 100644 --- a/recipes/pprint/all/test_package/conanfile.py +++ b/recipes/pprint/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pprint/all/test_v1_package/CMakeLists.txt b/recipes/pprint/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/pprint/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/pprint/all/test_v1_package/conanfile.py b/recipes/pprint/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/pprint/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pranav-csv2/all/conanfile.py b/recipes/pranav-csv2/all/conanfile.py index f73a81dd87306..ce5e7775c6355 100644 --- a/recipes/pranav-csv2/all/conanfile.py +++ b/recipes/pranav-csv2/all/conanfile.py @@ -1,100 +1,116 @@ +# TODO: verify the Conan v2 migration + import os -import functools import textwrap -from conans.errors import ConanInvalidConfiguration -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, save +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" -required_conan_version = ">=1.33.0" class PranavCSV2Conan(ConanFile): name = "pranav-csv2" - license = "MIT" description = "Various header libraries mostly future std lib, replacements for(e.g. visit), or some misc" - topics = ("csv", "iterator", "header-only", ) + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/p-ranav/csv2" - settings = "os", "arch", "compiler", "build_type", - generators = "cmake", + topics = ("csv", "iterator", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - _compiler_required_cpp11 = { - "Visual Studio": "16", - "gcc": "8", - "clang": "7", - "apple-clang": "12.0", - } + @property + def _min_cppstd(self): + return 11 @property - def _source_subfolder(self): - return "source_subfolder" + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, self._min_cppstd) - minimum_version = self._compiler_required_cpp11.get(str(self.settings.compiler), False) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{} requires C++11, which your compiler does not support.".format(self.name)) + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++11, which your compiler does not support.") else: - self.output.warn("{0} requires C++11. Your compiler is unknown. Assuming it supports C++11.".format(self.name)) + self.output.warning(f"{self.name} requires C++11. Your compiler is unknown. Assuming it supports C++11.") 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.configure(source_folder=self._source_subfolder) - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() - @property - def _module_subfolder(self): - return os.path.join("lib", "cmake") - - @property - def _module_file_rel_path(self): - return os.path.join(self._module_subfolder, - "conan-official-{}-targets.cmake".format(self.name)) + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + """) + save(self, module_file, content) def package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(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")) + rmdir(self, os.path.join(self.package_folder, "share")) self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), {"csv2": "csv2::csv2"} ) - def package_id(self): - self.info.header_only() + @property + def _module_subfolder(self): + return os.path.join("lib", "cmake") + + @property + def _module_file_rel_path(self): + return os.path.join(self._module_subfolder, f"conan-official-{self.name}-targets.cmake") def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "csv2") self.cpp_info.set_property("cmake_target_name", "csv2::csv2") + self.cpp_info.builddirs.append(self._module_subfolder) + self.cpp_info.filenames["cmake_find_package"] = "csv2" self.cpp_info.filenames["cmake_find_package_multi"] = "csv2" self.cpp_info.names["cmake_find_package"] = "csv2" self.cpp_info.names["cmake_find_package_multi"] = "csv2" - - self.cpp_info.builddirs.append(self._module_subfolder) self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/pranav-csv2/all/test_package/CMakeLists.txt b/recipes/pranav-csv2/all/test_package/CMakeLists.txt index f958b282d05ea..b8a570a3eafe7 100644 --- a/recipes/pranav-csv2/all/test_package/CMakeLists.txt +++ b/recipes/pranav-csv2/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(csv2 CONFIG REQUIRED) +find_package(csv2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} csv2) +target_link_libraries(${PROJECT_NAME} csv2::csv2) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/pranav-csv2/all/test_package/conanfile.py b/recipes/pranav-csv2/all/test_package/conanfile.py index 0197f07f63c5d..fae501d0afb9e 100644 --- a/recipes/pranav-csv2/all/test_package/conanfile.py +++ b/recipes/pranav-csv2/all/test_package/conanfile.py @@ -1,9 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class DawHeaderLibrariesTestConan(ConanFile): + +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pranav-csv2/all/test_package/test_package.cpp b/recipes/pranav-csv2/all/test_package/test_package.cpp index 6119ae1a3e0f9..d415b3cf575ef 100644 --- a/recipes/pranav-csv2/all/test_package/test_package.cpp +++ b/recipes/pranav-csv2/all/test_package/test_package.cpp @@ -3,7 +3,7 @@ int main() { csv2::Reader< csv2::delimiter<','>, - csv2::quote_character<'"'>, + csv2::quote_character<'"'>, csv2::first_row_is_header, csv2::trim_policy::trim_whitespace> csv; diff --git a/recipes/pranav-csv2/all/test_v1_package/CMakeLists.txt b/recipes/pranav-csv2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/pranav-csv2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/pranav-csv2/all/test_v1_package/conanfile.py b/recipes/pranav-csv2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0197f07f63c5d --- /dev/null +++ b/recipes/pranav-csv2/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class DawHeaderLibrariesTestConan(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/pretty-name/all/conanfile.py b/recipes/pretty-name/all/conanfile.py index 994d455d12104..3cfd0f89c07f3 100644 --- a/recipes/pretty-name/all/conanfile.py +++ b/recipes/pretty-name/all/conanfile.py @@ -1,33 +1,30 @@ import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class PrettyNameConan(ConanFile): name = "pretty-name" + description = "An easy and consistent way how to get type names in C++" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Rechip/pretty-name" - description = "An easy and consistent way how to get type names in C++" - topics = ("cpp", "typename") - settings = ["compiler"] + topics = ("cpp", "typename", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - def package(self): - self.copy(pattern="LICENSE", dst="licenses", - src=self._source_subfolder) - self.copy(pattern="*", dst="include", - src=os.path.join(self._source_subfolder, "include")) + def _min_cppstd(self): + return 14 @property def _minimum_compilers_version(self): @@ -38,21 +35,39 @@ def _minimum_compilers_version(self): "apple-clang": "5.1", } + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "14") - minimum_version = self._minimum_compilers_version.get( - str(self.settings.compiler), False) + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) if not minimum_version: - self.output.warn( - "pretty-name requires C++14. Your compiler is unknown. Assuming it supports C++14.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - "pretty-name requires C++14, which your compiler does not support.") + self.output.warning("pretty-name requires C++14. Your compiler is unknown. Assuming it supports C++14.") + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("pretty-name requires C++14, which your compiler does not support.") - def package_id(self): - self.info.header_only() + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*", + 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", "pretty-name") + self.cpp_info.set_property("cmake_target_name", "pretty-name::pretty-name") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "pretty-name" self.cpp_info.names["cmake_find_package_multi"] = "pretty-name" diff --git a/recipes/pretty-name/all/test_package/CMakeLists.txt b/recipes/pretty-name/all/test_package/CMakeLists.txt index 036c165068273..8cdadcdcea642 100644 --- a/recipes/pretty-name/all/test_package/CMakeLists.txt +++ b/recipes/pretty-name/all/test_package/CMakeLists.txt @@ -1,13 +1,10 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(pretty-name REQUIRED CONFIG) -find_package(pretty-name CONFIG REQUIRED) add_executable(${PROJECT_NAME} src/test.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE pretty-name::pretty-name) - set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 diff --git a/recipes/pretty-name/all/test_package/conanfile.py b/recipes/pretty-name/all/test_package/conanfile.py index cbe0be23191a2..fae501d0afb9e 100644 --- a/recipes/pretty-name/all/test_package/conanfile.py +++ b/recipes/pretty-name/all/test_package/conanfile.py @@ -1,17 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "arch", "build_type" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): - self.cmake = CMake(self) - self.cmake.configure() - self.cmake.build() + 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) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pretty-name/all/test_v1_package/CMakeLists.txt b/recipes/pretty-name/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/pretty-name/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/pretty-name/all/test_v1_package/conanfile.py b/recipes/pretty-name/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..cbe0be23191a2 --- /dev/null +++ b/recipes/pretty-name/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + self.cmake = CMake(self) + self.cmake.configure() + 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) diff --git a/recipes/pretty-name/all/test_v1_package/src/test.cpp b/recipes/pretty-name/all/test_v1_package/src/test.cpp new file mode 100644 index 0000000000000..8c761f54ec31c --- /dev/null +++ b/recipes/pretty-name/all/test_v1_package/src/test.cpp @@ -0,0 +1,23 @@ +#include +#include +#include + +struct Test { + int a; + int b; +}; + +namespace Namespace { +template +struct Test { + A a; + B b; +}; +} // namespace Namespace + +int main() { + std::cout << pretty_name::pretty_name() << std::endl; + std::cout << pretty_name::pretty_name>() << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/proj/all/conandata.yml b/recipes/proj/all/conandata.yml index 6a5d57f6c5cd3..8f4cf560d8dc4 100644 --- a/recipes/proj/all/conandata.yml +++ b/recipes/proj/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "9.2.1": + url: "https://github.com/OSGeo/PROJ/releases/download/9.2.1/proj-9.2.1.tar.gz" + sha256: "15ebf4afa8744b9e6fccb5d571fc9f338dc3adcf99907d9e62d1af815d4971a1" "9.1.1": url: "https://github.com/OSGeo/PROJ/releases/download/9.1.1/proj-9.1.1.tar.gz" sha256: "003cd4010e52bb5eb8f7de1c143753aa830c8902b6ed01209f294846e40e6d39" @@ -21,6 +24,10 @@ sources: url: "https://github.com/OSGeo/PROJ/releases/download/6.3.1/proj-6.3.1.tar.gz" sha256: "6de0112778438dcae30fcc6942dee472ce31399b9e5a2b67e8642529868c86f8" patches: + "9.2.1": + - patch_file: "patches/0001-use-cmake-targets-9.2.1.patch" + patch_type: "conan" + patch_description: "Use cmake targets" "9.1.1": - patch_file: "patches/0001-use-cmake-targets-9.1.0.patch" patch_type: "conan" diff --git a/recipes/proj/all/conanfile.py b/recipes/proj/all/conanfile.py index d65efd41b63cf..e5322b9f644f0 100644 --- a/recipes/proj/all/conanfile.py +++ b/recipes/proj/all/conanfile.py @@ -57,15 +57,15 @@ def layout(self): def requirements(self): self.requires("nlohmann_json/3.11.2") - self.requires("sqlite3/3.41.1", run=can_run(self)) + self.requires("sqlite3/3.42.0", run=can_run(self)) if self.options.get_safe("with_tiff"): - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.5.1") if self.options.get_safe("with_curl"): - self.requires("libcurl/7.88.1") + self.requires("libcurl/8.0.1") def build_requirements(self): if not can_run(self): - self.tool_requires("sqlite3/3.41.1") + self.tool_requires("sqlite3/3.42.0") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-9.2.1.patch b/recipes/proj/all/patches/0001-use-cmake-targets-9.2.1.patch new file mode 100644 index 0000000000000..0459aba7efc51 --- /dev/null +++ b/recipes/proj/all/patches/0001-use-cmake-targets-9.2.1.patch @@ -0,0 +1,12 @@ +--- a/src/lib_proj.cmake ++++ b/src/lib_proj.cmake +@@ -438,8 +438,7 @@ + target_link_libraries(proj PRIVATE ${CMAKE_THREAD_LIBS_INIT}) + endif() + +-target_include_directories(proj PRIVATE ${SQLITE3_INCLUDE_DIR}) +-target_link_libraries(proj PRIVATE ${SQLITE3_LIBRARY}) ++target_link_libraries(proj PRIVATE SQLite::SQLite3) + + if(NLOHMANN_JSON STREQUAL "external") + target_compile_definitions(proj PRIVATE EXTERNAL_NLOHMANN_JSON) diff --git a/recipes/proj/config.yml b/recipes/proj/config.yml index b8b070a608bed..1eba8e77164d5 100644 --- a/recipes/proj/config.yml +++ b/recipes/proj/config.yml @@ -1,4 +1,6 @@ versions: + "9.2.1": + folder: "all" "9.1.1": folder: "all" "9.1.0": diff --git a/recipes/protobuf-c/all/conandata.yml b/recipes/protobuf-c/all/conandata.yml new file mode 100644 index 0000000000000..9007e5a9a5e00 --- /dev/null +++ b/recipes/protobuf-c/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.4.1": + url: https://github.com/protobuf-c/protobuf-c/archive/v1.4.1.tar.gz + sha256: 99be336cdb15dfc5827efe34e5ac9aaa962e2485db547dd254d2a122a7d23102 +patches: + "1.4.1": + # TODO: This won't be needed once upstream PR (https://github.com/protobuf-c/protobuf-c/pull/555) gets merged + - patch_file: "patches/1.4.1-cmake-protobuf-target.patch" + patch_description: "Fit Protobuf directory variables to official targets" + patch_type: conan diff --git a/recipes/protobuf-c/all/conanfile.py b/recipes/protobuf-c/all/conanfile.py new file mode 100644 index 0000000000000..83f6ad3e9a327 --- /dev/null +++ b/recipes/protobuf-c/all/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile, __version__ as conan_version +from conan.tools.scm import Version +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv +import os + + +required_conan_version = ">=1.53.0" + + +class ProtobufCConan(ConanFile): + name = "protobuf-c" + description = "Protocol Buffers implementation in C" + license = "LicenseRef-LICENSE" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/protobuf-c/protobuf-c" + topics = ("protocol-buffers", "protocol-compiler", "serialization", "protocol-compiler") + # package_type = "library" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_proto3": [True, False], + "with_protoc": [True, False] + } + default_options = { + "fPIC": True, + "with_proto3": True, + "with_protoc": True + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + def export_sources(self): + export_conandata_patches(self) + # TODO: This won't be needed once upstream PR (https://github.com/protobuf-c/protobuf-c/pull/555) gets merged + copy(self, "protobuf-c.cmake", src=self.recipe_folder, dst=self.export_sources_folder, keep_path=False) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + # Since the package using protobuf-c will also need to use protoc (part of protobuf), + # we want to make sure the protobuf dep is visible, but the visible param is only available in v2 + # TODO: Remove after dropping Conan 1.x + if conan_version >= Version("2"): + self.tool_requires("protobuf/3.21.9", visible=True) + else: + self.tool_requires("protobuf/3.21.9") + + def requirements(self): + self.requires("protobuf/3.21.9") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_PROTO3"] = self.options.with_proto3 + tc.cache_variables["BUILD_PROTOC"] = self.options.with_protoc + # FIXME: Add shared library support. It was just too hairy to figure out initially + # tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.cache_variables["BUILD_TESTS"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate(scope="build") + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "build-cmake")) + cmake.build() + + @property + def _cmake_install_base_path(self): + return os.path.join("lib", "cmake", "protobuf-c") + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + # TODO: This won't be needed once upstream PR (https://github.com/protobuf-c/protobuf-c/pull/555) gets merged + copy(self, "protobuf-c.cmake", dst=os.path.join(self.package_folder, self._cmake_install_base_path), src=self.export_sources_folder) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + # upstream CMake config file name and target name matches the package name + self.cpp_info.libs = ["protobuf-c"] + self.cpp_info.builddirs.append(self._cmake_install_base_path) + # TODO: This won't be needed once upstream PR (https://github.com/protobuf-c/protobuf-c/pull/555) gets merged + self.cpp_info.set_property("cmake_build_modules", [ + os.path.join(self._cmake_install_base_path, "protobuf-c.cmake") + ]) + self.buildenv_info.append_path("PATH", os.path.join(self.package_folder, "bin")) diff --git a/recipes/protobuf-c/all/patches/1.4.1-cmake-protobuf-target.patch b/recipes/protobuf-c/all/patches/1.4.1-cmake-protobuf-target.patch new file mode 100644 index 0000000000000..fb664a553f528 --- /dev/null +++ b/recipes/protobuf-c/all/patches/1.4.1-cmake-protobuf-target.patch @@ -0,0 +1,56 @@ +diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt +--- a/build-cmake/CMakeLists.txt (revision c8f1ff465b55b00114af07d15ceca2aeedee1a4b) ++++ b/build-cmake/CMakeLists.txt (revision cabf46a8ab076fdce0c7bef4e393ac7819bb4b68) +@@ -63,7 +63,6 @@ + endif (MSVC AND NOT BUILD_SHARED_LIBS) + + FIND_PACKAGE(Protobuf REQUIRED) +-INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR}) + + if (BUILD_PROTO3) + ADD_DEFINITIONS(-DHAVE_PROTO3) +@@ -92,16 +91,16 @@ + SET(CMAKE_CXX_STANDARD_REQUIRED ON) + SET(CMAKE_CXX_EXTENSIONS OFF) + ADD_CUSTOM_COMMAND(OUTPUT protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h +- COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} ++ COMMAND ${Protobuf_PROTOC_EXECUTABLE} + ARGS --cpp_out ${CMAKE_BINARY_DIR} -I${MAIN_DIR} ${MAIN_DIR}/protobuf-c/protobuf-c.proto) + FILE(GLOB PROTOC_GEN_C_SRC ${MAIN_DIR}/protoc-c/*.h ${MAIN_DIR}/protoc-c/*.cc ) + ADD_EXECUTABLE(protoc-gen-c ${PROTOC_GEN_C_SRC} protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h) + +-TARGET_LINK_LIBRARIES(protoc-gen-c ${PROTOBUF_PROTOC_LIBRARY} ${PROTOBUF_LIBRARY}) ++TARGET_LINK_LIBRARIES(protoc-gen-c protobuf::libprotoc protobuf::libprotobuf) + + IF (MSVC AND BUILD_SHARED_LIBS) + TARGET_COMPILE_DEFINITIONS(protoc-gen-c PRIVATE -DPROTOBUF_USE_DLLS) +- GET_FILENAME_COMPONENT(PROTOBUF_DLL_DIR ${PROTOBUF_PROTOC_EXECUTABLE} DIRECTORY) ++ GET_FILENAME_COMPONENT(PROTOBUF_DLL_DIR ${Protobuf_PROTOC_EXECUTABLE} DIRECTORY) + FILE(GLOB PROTOBUF_DLLS ${PROTOBUF_DLL_DIR}/*.dll) + FILE(COPY ${PROTOBUF_DLLS} DESTINATION ${CMAKE_BINARY_DIR}) + ENDIF (MSVC AND BUILD_SHARED_LIBS) +@@ -114,7 +113,7 @@ + + FUNCTION(GENERATE_TEST_SOURCES PROTO_FILE SRC HDR) + ADD_CUSTOM_COMMAND(OUTPUT ${SRC} ${HDR} +- COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} ++ COMMAND ${Protobuf_PROTOC_EXECUTABLE} + ARGS --plugin=$ -I${MAIN_DIR} ${PROTO_FILE} --c_out=${CMAKE_BINARY_DIR} + DEPENDS protoc-gen-c) + ENDFUNCTION() +@@ -130,13 +129,13 @@ + + + ADD_CUSTOM_COMMAND(OUTPUT t/test-full.pb.cc t/test-full.pb.h +- COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} ++ COMMAND ${Protobuf_PROTOC_EXECUTABLE} + ARGS --cpp_out ${CMAKE_BINARY_DIR} -I${MAIN_DIR} ${TEST_DIR}/test-full.proto) + + GENERATE_TEST_SOURCES(${TEST_DIR}/test-full.proto t/test-full.pb-c.c t/test-full.pb-c.h) + + ADD_EXECUTABLE(cxx-generate-packed-data ${TEST_DIR}/generated-code2/cxx-generate-packed-data.cc t/test-full.pb.h t/test-full.pb.cc protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h) +-TARGET_LINK_LIBRARIES(cxx-generate-packed-data ${PROTOBUF_LIBRARY}) ++TARGET_LINK_LIBRARIES(cxx-generate-packed-data protobuf::libprotobuf) + IF (MSVC AND BUILD_SHARED_LIBS) + TARGET_COMPILE_DEFINITIONS(cxx-generate-packed-data PRIVATE -DPROTOBUF_USE_DLLS) + ENDIF (MSVC AND BUILD_SHARED_LIBS) diff --git a/recipes/protobuf-c/all/protobuf-c.cmake b/recipes/protobuf-c/all/protobuf-c.cmake new file mode 100644 index 0000000000000..ad1143afc4edc --- /dev/null +++ b/recipes/protobuf-c/all/protobuf-c.cmake @@ -0,0 +1,72 @@ +find_package(Protobuf REQUIRED) +find_program(PROTOC_GEN_C protoc-gen-c REQUIRED) + +function(protobuf_generate_c SRCS HDRS) + cmake_parse_arguments(protobuf_generate_c "" "EXPORT_MACRO;DESCRIPTORS" "" + ${ARGN}) + + set(_proto_files "${protobuf_generate_c_UNPARSED_ARGUMENTS}") + if(NOT _proto_files) + message( + SEND_ERROR "Error: protobuf_generate_c() called without any proto files") + return() + endif() + + if(protobuf_generate_c_APPEND_PATH) + set(_append_arg APPEND_PATH) + endif() + + if(protobuf_generate_c_DESCRIPTORS) + set(_descriptors DESCRIPTORS) + endif() + + if(DEFINED Protobuf_IMPORT_DIRS) + set(_import_arg IMPORT_DIRS ${Protobuf_IMPORT_DIRS}) + endif() + + set(_outvar) + protobuf_generate( + ${_append_arg} + ${_descriptors} + LANGUAGE + c + PLUGIN + ${PROTOC_GEN_C} + GENERATE_EXTENSIONS + .pb-c.h + .pb-c.c + EXPORT_MACRO + ${protobuf_generate_c_EXPORT_MACRO} + OUT_VAR + _outvar + ${_import_arg} + PROTOS + ${_proto_files}) + + set(${SRCS}) + set(${HDRS}) + if(protobuf_generate_c_DESCRIPTORS) + set(${protobuf_generate_c_DESCRIPTORS}) + endif() + + foreach(_file ${_outvar}) + if(_file MATCHES "c$") + list(APPEND ${SRCS} ${_file}) + elseif(_file MATCHES "desc$") + list(APPEND ${protobuf_generate_c_DESCRIPTORS} ${_file}) + else() + list(APPEND ${HDRS} ${_file}) + endif() + endforeach() + set(${SRCS} + ${${SRCS}} + PARENT_SCOPE) + set(${HDRS} + ${${HDRS}} + PARENT_SCOPE) + if(protobuf_generate_c_DESCRIPTORS) + set(${protobuf_generate_c_DESCRIPTORS} + "${${protobuf_generate_c_DESCRIPTORS}}" + PARENT_SCOPE) + endif() +endfunction() diff --git a/recipes/protobuf-c/all/test_package/CMakeLists.txt b/recipes/protobuf-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..99e745b3cbd08 --- /dev/null +++ b/recipes/protobuf-c/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(protobuf-c CONFIG REQUIRED) + +protobuf_generate_c(TEST_PROTO_SRCS TEST_PROTO_HDRS hero.proto) + +add_executable(${PROJECT_NAME} test_package.c hero.proto ${TEST_PROTO_SRCS} ${TEST_PROTO_HDRS}) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries(${PROJECT_NAME} protobuf-c::protobuf-c) diff --git a/recipes/protobuf-c/all/test_package/conanfile.py b/recipes/protobuf-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..979cebae5cc2b --- /dev/null +++ b/recipes/protobuf-c/all/test_package/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.build import can_run, cross_building +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + if cross_building(self) and hasattr(self, "settings_build"): + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + VirtualRunEnv(self).generate() + if cross_building(self) and hasattr(self, "settings_build"): + VirtualBuildEnv(self).generate() + else: + VirtualRunEnv(self).generate(scope="build") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + # We need to be able to call protoc (from protobuf) under the hood + self.run("protoc --version", env="conanbuild") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/protobuf-c/all/test_package/hero.proto b/recipes/protobuf-c/all/test_package/hero.proto new file mode 100644 index 0000000000000..5192fe660ef3c --- /dev/null +++ b/recipes/protobuf-c/all/test_package/hero.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; +package the; + +message Hero { + string name = 1; +} diff --git a/recipes/protobuf-c/all/test_package/test_package.c b/recipes/protobuf-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..7e9da10a4d2c4 --- /dev/null +++ b/recipes/protobuf-c/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include + +#include "hero.pb-c.h" + +int main() +{ + The__Hero hero; + hero.name = "the_storyteller"; + + printf("The hero's name is %s.\n", hero.name); + + return 0; +} diff --git a/recipes/protobuf-c/config.yml b/recipes/protobuf-c/config.yml new file mode 100644 index 0000000000000..4709a2eb80f4c --- /dev/null +++ b/recipes/protobuf-c/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.1": + folder: all diff --git a/recipes/protobuf/all/conandata.yml b/recipes/protobuf/all/conandata.yml index 502de4a7d6777..76af562b2e6c0 100644 --- a/recipes/protobuf/all/conandata.yml +++ b/recipes/protobuf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.21.12": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.12.tar.gz" + sha256: "930c2c3b5ecc6c9c12615cf5ad93f1cd6e12d0aba862b572e076259970ac3a53" "3.21.9": url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.9.tar.gz" sha256: "1add10f9bd92775b91f326da259f243881e904dd509367d5031d4c782ba82810" @@ -21,6 +24,11 @@ sources: url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.17.1.tar.gz" sha256: "036d66d6eec216160dd898cfb162e9d82c1904627642667cc32b104d407bb411" patches: + "3.21.12": + - patch_file: "patches/protobuf-3.21.12-upstream-macos-macros.patch" + patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" + patch_type: "bugfix" + patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" "3.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" diff --git a/recipes/protobuf/all/patches/protobuf-3.21.12-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.21.12-upstream-macos-macros.patch new file mode 100644 index 0000000000000..3a152f62bca69 --- /dev/null +++ b/recipes/protobuf/all/patches/protobuf-3.21.12-upstream-macos-macros.patch @@ -0,0 +1,25 @@ +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index f00daf7..d956db2 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -870,6 +870,8 @@ + // Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. + #pragma push_macro("UID_MAX") + #undef UID_MAX ++#pragma push_macro("GID_MAX") ++#undef GID_MAX + #endif // __APPLE__ + + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) +diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc +index e880fa5..f8968d9 100644 +--- a/src/google/protobuf/port_undef.inc ++++ b/src/google/protobuf/port_undef.inc +@@ -144,6 +144,7 @@ + #pragma pop_macro("TRUE") + #pragma pop_macro("FALSE") + #pragma pop_macro("UID_MAX") ++#pragma pop_macro("GID_MAX") + #endif // __APPLE__ + + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/config.yml b/recipes/protobuf/config.yml index c22211a7a9d4e..1c42531d91fe0 100644 --- a/recipes/protobuf/config.yml +++ b/recipes/protobuf/config.yml @@ -1,4 +1,6 @@ versions: + "3.21.12": + folder: all "3.21.9": folder: all "3.21.4": diff --git a/recipes/qt/5.x.x/conandata.yml b/recipes/qt/5.x.x/conandata.yml index 353dd22d4b636..d0847c695c371 100644 --- a/recipes/qt/5.x.x/conandata.yml +++ b/recipes/qt/5.x.x/conandata.yml @@ -1,4 +1,26 @@ sources: + "5.15.10": + url: + - "https://download.qt.io/official_releases/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://download.qt.io/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://ftp1.nluug.nl/languages/qt/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://ftp2.nluug.nl/languages/qt/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://master.qt.io/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://mirror.web4africa.ng/qt/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/5.15/5.15.10/single/qt-everywhere-opensource-src-5.15.10.tar.xz" + sha256: "b545cb83c60934adc9a6bbd27e2af79e5013de77d46f5b9f5bb2a3c762bf55ca" "5.15.9": url: - "https://download.qt.io/official_releases/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" @@ -32,21 +54,30 @@ sources: - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.7/single/qt-everywhere-opensource-src-5.15.7.tar.xz" - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.7/single/qt-everywhere-opensource-src-5.15.7.tar.xz" sha256: "8a71986676a3f37a198a9113acedbfd5bc5606a459b6b85816d951458adbe9a0" - "5.15.6": - url: - - "https://download.qt.io/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" - - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" - sha256: "ebc77d27934b70b25b3dc34fbec7c4471eb451848e891c42b32409ea30fe309f" - "5.15.5": - url: - - "https://download.qt.io/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" - - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" - sha256: "5a97827bdf9fd515f43bc7651defaf64fecb7a55e051c79b8f80510d0e990f06" patches: + "5.15.10": + - "base_path": "qt5/qtbase" + "patch_file": "patches/aa2a39dea5.diff" + - "base_path": "qt5/qtwebengine" + "patch_file": "patches/c72097e.diff" + - "base_path": "qt5/qttools" + "patch_file": "patches/fix-macdeployqt.diff" + - "base_path": "qt5/qtwebengine/src/3rdparty/chromium/v8" + "patch_file": "patches/chromium-v8-missing-constexpr.patch" + - "base_path": "qt5/qtwebengine/src/3rdparty" + "patch_file": "patches/chromium-skia-missing-iterator-include.patch" + - "base_path": "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" + "patch_file": "patches/skia-cd397f3.diff" + - "base_path": "qt5/qtwebengine/src/3rdparty" + "patch_file": "patches/0001-Find-fontconfig-using-pkg-config.patch" + - "base_path": "qt5/qtbase" + "patch_file": "patches/337f28c9ab-5.15.8.patch" + - "base_path": "qt5/qtbase" + "patch_file": "patches/android-backtrace.diff" + - "base_path": "qt5/qtbase" + "patch_file": "patches/android-openssl.diff" + - "base_path": "qt5/qtbase" + "patch_file": "patches/android-new-ndk.diff" "5.15.9": - "base_path": "qt5/qtbase" "patch_file": "patches/aa2a39dea5.diff" @@ -124,65 +155,3 @@ patches: base_path: "qt5/qtbase" - patch_file: "patches/android-new-ndk.diff" base_path: "qt5/qtbase" - "5.15.6": - - patch_file: "patches/337f28c9ab.patch" - base_path: "qt5/qtbase" - - patch_file: "patches/aa2a39dea5.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/c72097e.diff" - base_path: "qt5/qtwebengine" - - patch_file: "patches/fix-macdeployqt.diff" - base_path: "qt5/qttools" - - patch_file: "patches/dece6f5.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/QTBUG-98813.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/d3396fb6fc.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/107ed30ec5.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/chromium-v8-missing-constexpr.patch" - base_path: "qt5/qtwebengine/src/3rdparty/chromium/v8" - - patch_file: "patches/chromium-skia-missing-iterator-include.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/skia-cd397f3.diff" - base_path: "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" - - patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/android-backtrace.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/android-openssl.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/android-new-ndk.diff" - base_path: "qt5/qtbase" - "5.15.5": - - patch_file: "patches/337f28c9ab-5.15.5.patch" - base_path: "qt5/qtbase" - - patch_file: "patches/aa2a39dea5.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/c72097e.diff" - base_path: "qt5/qtwebengine" - - patch_file: "patches/fix-macdeployqt.diff" - base_path: "qt5/qttools" - - patch_file: "patches/dece6f5.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/QTBUG-98813.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/d3396fb6fc.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/107ed30ec5.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/chromium-v8-missing-constexpr.patch" - base_path: "qt5/qtwebengine/src/3rdparty/chromium/v8" - - patch_file: "patches/chromium-skia-missing-iterator-include.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/skia-cd397f3.diff" - base_path: "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" - - patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/android-backtrace.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/android-openssl.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/android-new-ndk.diff" - base_path: "qt5/qtbase" diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 75d1c67bc8f2c..f89a95f7dc6b3 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -349,19 +349,19 @@ def requirements(self): if is_apple_os(self): self.requires("moltenvk/1.2.2") if self.options.with_glib: - self.requires("glib/2.76.2") + self.requires("glib/2.76.3") # if self.options.with_libiconv: # QTBUG-84708 # self.requires("libiconv/1.16")# QTBUG-84708 if self.options.with_doubleconversion and not self.options.multiconfiguration: - self.requires("double-conversion/3.2.1") + self.requires("double-conversion/3.3.0") if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: self.requires("freetype/2.13.0") if self.options.get_safe("with_fontconfig", False): self.requires("fontconfig/2.14.2") if self.options.get_safe("with_icu", False): - self.requires("icu/73.1") + self.requires("icu/73.2") if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: - self.requires("harfbuzz/7.1.0") + self.requires("harfbuzz/7.3.0") if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: if self.options.with_libjpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/2.1.5") @@ -370,7 +370,7 @@ def requirements(self): if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: self.requires("libpng/1.6.39") if self.options.with_sqlite3 and not self.options.multiconfiguration: - self.requires("sqlite3/3.41.2") + self.requires("sqlite3/3.42.0") if self.options.get_safe("with_mysql", False): self.requires("libmysqlclient/8.0.31") if self.options.with_pq: @@ -403,14 +403,14 @@ def requirements(self): if self.options.get_safe("with_pulseaudio", False): self.requires("pulseaudio/14.2") if self.options.with_dbus: - self.requires("dbus/1.15.2") + self.requires("dbus/1.15.6") if self.options.qtwayland: - self.requires("wayland/1.21.0") + self.requires("wayland/1.22.0") self.requires("xkbcommon/1.5.0") if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: self.requires("krb5/1.18.3") # conan-io/conan-center-index#4102 if self.options.get_safe("with_atspi"): - self.requires("at-spi2-core/2.48.0") + self.requires("at-spi2-core/2.48.3") if self.options.get_safe("with_md4c", False): self.requires("md4c/0.4.8") @@ -442,7 +442,7 @@ def build_requirements(self): self.tool_requires("bison/3.8.2") self.tool_requires("flex/2.6.4") if self.options.qtwayland: - self.tool_requires("wayland/1.21.0") + self.tool_requires("wayland/1.22.0") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -1003,7 +1003,14 @@ def _create_module(module, requires=[], has_include_dir=True): self.cpp_info.components[componentname].libs = [f"Qt5{libname}{libsuffix}"] if has_include_dir: self.cpp_info.components[componentname].includedirs = ["include", os.path.join("include", f"Qt{module}")] - self.cpp_info.components[componentname].defines = [f"QT_{module.upper()}_LIB"] + define = module.upper() + if define == "TEST": + define = "TESTLIB" + elif define == "XCBQPA": + define = "XCB_QPA_LIB" + elif define.endswith("SUPPORT"): + define = define.replace("SUPPORT", "_SUPPORT") + self.cpp_info.components[componentname].defines = [f"QT_{define}_LIB"] if module != "Core" and "Core" not in requires: requires.append("Core") self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) diff --git a/recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch b/recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch deleted file mode 100644 index a2ea249c1db5f..0000000000000 --- a/recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 337f28c9abb12f28538cfe2f49e5afc460578b32 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= -Date: Tue, 5 Jul 2022 15:38:33 +0200 -Subject: Darwin: Replace deprecated symbol kIOMasterPortDefault with - equivalent - -We can't use the replacement kIOMainPortDefault yet, as it's not -available in operating system versions we still support, but the -kIOMasterPortDefault documentation explicitly says that passing -NULL as a port argument indicates "use the default". - -As the underlying type of a mach_port_t is potentially either -a pointer or an unsigned int, we initialize the default to 0. - -Pick-to: 6.2 6.3 6.4 5.15 -Change-Id: I288aa94b8f2fbda47fd1cbaf329799db7ab988a0 -Reviewed-by: Alexandru Croitor ---- - src/corelib/global/qglobal.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -(limited to 'src/corelib/global/qglobal.cpp') - -diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp -index 738e39658f..c894471ad6 100644 ---- a/src/corelib/global/qglobal.cpp -+++ b/src/corelib/global/qglobal.cpp -@@ -3059,7 +3059,8 @@ QByteArray QSysInfo::machineUniqueId() - { - #if defined(Q_OS_DARWIN) && __has_include() - char uuid[UuidStringLen + 1]; -- io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); -+ static const mach_port_t defaultPort = 0; // Effectively kIOMasterPortDefault/kIOMainPortDefault -+ io_service_t service = IOServiceGetMatchingService(defaultPort, IOServiceMatching("IOPlatformExpertDevice")); - QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0); - CFStringGetCString(stringRef, uuid, sizeof(uuid), kCFStringEncodingMacRoman); - return QByteArray(uuid); --- -cgit v1.2.1 - diff --git a/recipes/qt/5.x.x/qtmodules5.15.5.conf b/recipes/qt/5.x.x/qtmodules5.15.10.conf similarity index 100% rename from recipes/qt/5.x.x/qtmodules5.15.5.conf rename to recipes/qt/5.x.x/qtmodules5.15.10.conf diff --git a/recipes/qt/5.x.x/test_v1_package/conanfile.py b/recipes/qt/5.x.x/test_v1_package/conanfile.py index cc3b35ad8bcbd..5cb2041d25d7d 100644 --- a/recipes/qt/5.x.x/test_v1_package/conanfile.py +++ b/recipes/qt/5.x.x/test_v1_package/conanfile.py @@ -21,7 +21,7 @@ def build_requirements(self): if self._settings_build.os == "Windows" and self.settings.compiler == "Visual Studio": self.build_requires("jom/1.1.3") if self._meson_supported(): - self.build_requires("meson/1.1.0") + self.build_requires("meson/1.1.1") def generate(self): save(self, "qt.conf", """[Paths] diff --git a/recipes/qt/6.x.x/conandata.yml b/recipes/qt/6.x.x/conandata.yml index 6df3996bdfa44..f017b4e075adb 100644 --- a/recipes/qt/6.x.x/conandata.yml +++ b/recipes/qt/6.x.x/conandata.yml @@ -1,4 +1,24 @@ sources: + "6.5.1": + url: + - "https://download.qt.io/official_releases/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://download.qt.io/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://ftp1.nluug.nl/languages/qt/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://ftp2.nluug.nl/languages/qt/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://master.qt.io/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/6.5/6.5.1/single/qt-everywhere-src-6.5.1.tar.xz" + sha256: "a2d88a6f8c3835dca52f3b7433149c3de606a96bbf024640c27657276cc7350a" "6.5.0": url: - "https://download.qt.io/official_releases/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz" @@ -42,6 +62,10 @@ sources: - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" sha256: "b90524f686224a0e5a945c1d65307e16a375348dbe275c9ac11de171fe31374a" patches: + "6.5.1": + - base_path: "qtwebengine" + patch_description: "Workaround for too long .rps file name" + patch_file: "patches/c72097e.diff" "6.5.0": - base_path: "qtwebengine" patch_description: "Workaround for too long .rps file name" diff --git a/recipes/qt/5.x.x/qtmodules5.15.6.conf b/recipes/qt/6.x.x/qtmodules6.5.1.conf similarity index 68% rename from recipes/qt/5.x.x/qtmodules5.15.6.conf rename to recipes/qt/6.x.x/qtmodules6.5.1.conf index 452233655f279..32adb4f64f412 100644 --- a/recipes/qt/5.x.x/qtmodules5.15.6.conf +++ b/recipes/qt/6.x.x/qtmodules6.5.1.conf @@ -1,68 +1,61 @@ [submodule "qtbase"] path = qtbase url = ../qtbase.git - branch = 5.15 + branch = 6.5.1 status = essential [submodule "qtsvg"] depends = qtbase path = qtsvg url = ../qtsvg.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtdeclarative"] depends = qtbase - recommends = qtsvg + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver path = qtdeclarative url = ../qtdeclarative.git - branch = 5.15 + branch = 6.5.1 status = essential [submodule "qtactiveqt"] depends = qtbase path = qtactiveqt url = ../qtactiveqt.git - branch = 5.15 + branch = 6.5.1 status = addon -[submodule "qtscript"] - depends = qtbase - recommends = qttools - path = qtscript - url = ../qtscript.git - branch = 5.15 - status = deprecated [submodule "qtmultimedia"] - depends = qtbase - recommends = qtdeclarative + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d path = qtmultimedia url = ../qtmultimedia.git - branch = 5.15 - status = essential + branch = 6.5.1 + status = addon [submodule "qttools"] depends = qtbase recommends = qtdeclarative qtactiveqt path = qttools url = ../qttools.git - branch = 5.15 + branch = 6.5.1 status = essential [submodule "qtxmlpatterns"] depends = qtbase recommends = qtdeclarative path = qtxmlpatterns url = ../qtxmlpatterns.git - branch = 5.15 - status = deprecated + branch = dev + status = ignore [submodule "qttranslations"] depends = qttools path = qttranslations url = ../qttranslations.git - branch = 5.15 + branch = 6.5.1 status = essential priority = 30 [submodule "qtdoc"] depends = qtdeclarative qttools - recommends = qtmultimedia qtquickcontrols qtquickcontrols2 + recommends = qtmultimedia qtshadertools qtwebengine path = qtdoc url = ../qtdoc.git - branch = 5.15 + branch = 6.5.1 status = essential priority = 40 [submodule "qtrepotools"] @@ -75,22 +68,29 @@ depends = qtbase path = qtqa url = ../qtqa.git - branch = master + branch = dev status = essential priority = 50 [submodule "qtlocation"] - depends = qtbase - recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport + depends = qtbase qtpositioning + recommends = qtdeclarative path = qtlocation url = ../qtlocation.git - branch = 5.15 + branch = 6.5.1 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.5.1 status = addon [submodule "qtsensors"] depends = qtbase recommends = qtdeclarative path = qtsensors url = ../qtsensors.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtsystems"] depends = qtbase @@ -106,12 +106,6 @@ url = ../qtfeedback.git branch = master status = ignore -[submodule "qtdocgallery"] - depends = qtdeclarative - path = qtdocgallery - url = ../qtdocgallery.git - branch = master - status = ignore [submodule "qtpim"] depends = qtdeclarative path = qtpim @@ -120,102 +114,64 @@ status = ignore [submodule "qtconnectivity"] depends = qtbase - recommends = qtdeclarative qtandroidextras + recommends = qtdeclarative path = qtconnectivity url = ../qtconnectivity.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtwayland"] depends = qtbase recommends = qtdeclarative path = qtwayland url = ../qtwayland.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qt3d"] depends = qtbase - recommends = qtdeclarative qtimageformats qtgamepad + recommends = qtdeclarative qtshadertools path = qt3d url = ../qt3d.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtimageformats"] depends = qtbase path = qtimageformats url = ../qtimageformats.git - branch = 5.15 - status = addon -[submodule "qtgraphicaleffects"] - depends = qtdeclarative - path = qtgraphicaleffects - url = ../qtgraphicaleffects.git - branch = 5.15 - status = essential -[submodule "qtquickcontrols"] - depends = qtdeclarative - recommends = qtgraphicaleffects - path = qtquickcontrols - url = ../qtquickcontrols.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtserialbus"] depends = qtbase recommends = qtserialport path = qtserialbus url = ../qtserialbus.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtserialport"] depends = qtbase path = qtserialport url = ../qtserialport.git - branch = 5.15 - status = addon -[submodule "qtx11extras"] - depends = qtbase - path = qtx11extras - url = ../qtx11extras.git - branch = 5.15 - status = addon -[submodule "qtmacextras"] - depends = qtbase - path = qtmacextras - url = ../qtmacextras.git - branch = 5.15 - status = addon -[submodule "qtwinextras"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtwinextras - url = ../qtwinextras.git - branch = 5.15 - status = addon -[submodule "qtandroidextras"] - depends = qtbase - path = qtandroidextras - url = ../qtandroidextras.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtwebsockets"] depends = qtbase recommends = qtdeclarative path = qtwebsockets url = ../qtwebsockets.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtwebchannel"] depends = qtbase recommends = qtdeclarative qtwebsockets path = qtwebchannel url = ../qtwebchannel.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtwebengine"] depends = qtdeclarative - recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools + recommends = qtwebchannel qttools qtpositioning path = qtwebengine url = ../qtwebengine.git - branch = 5.15 + branch = 6.5.1 status = addon priority = 10 [submodule "qtcanvas3d"] @@ -229,98 +185,147 @@ recommends = qtwebengine path = qtwebview url = ../qtwebview.git - branch = 5.15 - status = addon -[submodule "qtquickcontrols2"] - depends = qtgraphicaleffects - recommends = qtimageformats - path = qtquickcontrols2 - url = ../qtquickcontrols2.git - branch = 5.15 - status = essential -[submodule "qtpurchasing"] - depends = qtbase - recommends = qtdeclarative qtandroidextras - path = qtpurchasing - url = ../qtpurchasing.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtcharts"] depends = qtbase recommends = qtdeclarative qtmultimedia path = qtcharts url = ../qtcharts.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtdatavis3d"] depends = qtbase recommends = qtdeclarative qtmultimedia path = qtdatavis3d url = ../qtdatavis3d.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtvirtualkeyboard"] depends = qtbase qtdeclarative qtsvg - recommends = qtmultimedia qtquickcontrols + recommends = qtmultimedia path = qtvirtualkeyboard url = ../qtvirtualkeyboard.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtgamepad"] depends = qtbase recommends = qtdeclarative path = qtgamepad url = ../qtgamepad.git - branch = 5.15 - status = addon + branch = dev + status = ignore [submodule "qtscxml"] depends = qtbase qtdeclarative path = qtscxml url = ../qtscxml.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtspeech"] depends = qtbase recommends = qtdeclarative qtmultimedia path = qtspeech url = ../qtspeech.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtnetworkauth"] depends = qtbase path = qtnetworkauth url = ../qtnetworkauth.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtremoteobjects"] depends = qtbase recommends = qtdeclarative path = qtremoteobjects url = ../qtremoteobjects.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtwebglplugin"] depends = qtbase qtwebsockets recommends = qtdeclarative path = qtwebglplugin url = ../qtwebglplugin.git - branch = 5.15 - status = addon + branch = dev + status = ignore [submodule "qtlottie"] depends = qtbase qtdeclarative path = qtlottie url = ../qtlottie.git - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtquicktimeline"] depends = qtbase qtdeclarative path = qtquicktimeline url = ../qtquicktimeline - branch = 5.15 + branch = 6.5.1 status = addon [submodule "qtquick3d"] - depends = qtbase qtdeclarative + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline path = qtquick3d url = ../qtquick3d.git - branch = 5.15 + branch = 6.5.1 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.5.1 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.5.1 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.5.1 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.5.1 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.5.1 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.5.1 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.5.1 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.5.1 + status = addon +[submodule "qtgrpc"] + depends = qtbase + path = qtgrpc + url = ../qtgrpc.git + branch = 6.5.1 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.5.1 status = addon diff --git a/recipes/qt/config.yml b/recipes/qt/config.yml index 13ce5a438f056..84b51c6e98dab 100644 --- a/recipes/qt/config.yml +++ b/recipes/qt/config.yml @@ -1,4 +1,6 @@ versions: + "6.5.1": + folder: 6.x.x "6.5.0": folder: 6.x.x "6.4.2": @@ -7,13 +9,11 @@ versions: folder: 6.x.x "6.3.2": folder: 6.x.x + "5.15.10": + folder: 5.x.x "5.15.9": folder: 5.x.x "5.15.8": folder: 5.x.x "5.15.7": folder: 5.x.x - "5.15.6": - folder: 5.x.x - "5.15.5": - folder: 5.x.x diff --git a/recipes/quaternions/all/conanfile.py b/recipes/quaternions/all/conanfile.py index 53d02dd9ca8a2..3270c603bde8d 100644 --- a/recipes/quaternions/all/conanfile.py +++ b/recipes/quaternions/all/conanfile.py @@ -1,36 +1,54 @@ import os -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, replace_in_file +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class QuaternionsConan(ConanFile): name = "quaternions" description = "A blazingly fast C++ library to work with quaternions." - topics = ("conan", "quaternions", "mathematics") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ferd36/quaternions" - license = "MIT" - settings = "compiler" + topics = ("mathematics", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 - def configure(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - url = self.conan_data["sources"][self.version]["url"] - extracted_dir = self.name + "-" + os.path.splitext(os.path.basename(url))[0] - os.rename(extracted_dir, self._source_subfolder) - tools.replace_in_file(os.path.join(self._source_subfolder, "include", "quaternion.h"), - "#include ", "") + get(self, **self.conan_data["sources"][self.version], strip_root=True) + replace_in_file(self, + os.path.join(self.source_folder, "include", "quaternion.h"), + "#include ", + "") def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/quaternions/all/test_package/CMakeLists.txt b/recipes/quaternions/all/test_package/CMakeLists.txt index 33ae887aa6aea..a5abaf06c8332 100644 --- a/recipes/quaternions/all/test_package/CMakeLists.txt +++ b/recipes/quaternions/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(quaternions REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE quaternions::quaternions) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/quaternions/all/test_package/conanfile.py b/recipes/quaternions/all/test_package/conanfile.py index ea57a464900be..fae501d0afb9e 100644 --- a/recipes/quaternions/all/test_package/conanfile.py +++ b/recipes/quaternions/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -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", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/quaternions/all/test_v1_package/CMakeLists.txt b/recipes/quaternions/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/quaternions/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/quaternions/all/test_v1_package/conanfile.py b/recipes/quaternions/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..84ee68733e516 --- /dev/null +++ b/recipes/quaternions/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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/quill/all/conandata.yml b/recipes/quill/all/conandata.yml index b46e32721c6ba..d0c356569441c 100644 --- a/recipes/quill/all/conandata.yml +++ b/recipes/quill/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.2.0": + url: "https://github.com/odygrd/quill/archive/v3.2.0.tar.gz" + sha256: "9745ad83b285bbd0481bd14c1b866b7e6121a981dd211b914f5d55955040fd00" + "3.1.0": + url: "https://github.com/odygrd/quill/archive/v3.1.0.tar.gz" + sha256: "9e7aa64c4f8101ed2b59d1cf3156b1c6bdd712ca89a2ec7aa7166905edc3e621" "3.0.2": url: "https://github.com/odygrd/quill/archive/v3.0.2.tar.gz" sha256: "76e9f607168f71cf1028ae7374fbe91225e400c11b5a51a6ebc992c85d012eed" @@ -20,24 +26,6 @@ sources: "2.6.0": url: "https://github.com/odygrd/quill/archive/v2.6.0.tar.gz" sha256: "d72fd5a01bf8d3e59ed93a789a8f103bc31efe0fb3c09182c74036a2e3a8451b" - "2.5.1": - url: "https://github.com/odygrd/quill/archive/v2.5.1.tar.gz" - sha256: "62227595cc2b4c0c42ed35f17ef5b7487d8231aca9e75234a4c0e346cea19928" - "2.4.2": - url: "https://github.com/odygrd/quill/archive/v2.4.2.tar.gz" - sha256: "4771dc08c0ff01cea9081d645ed7cae27cfa073185c986177ef3ce13743136af" - "2.3.4": - url: "https://github.com/odygrd/quill/archive/v2.3.4.tar.gz" - sha256: "b44d345c07b3023fcd1b88fd9d2554429bb8cccb6285d703d0b0907d9aa85fa1" - "2.2.0": - url: "https://github.com/odygrd/quill/archive/v2.2.0.tar.gz" - sha256: "6b123b60b16d41009228d907851f025c8be974d5fcf41af0b6afbe48edebbf73" - "2.1.0": - url: "https://github.com/odygrd/quill/archive/v2.1.0.tar.gz" - sha256: "66c59501ad827207e7d4682ccba0f1c33ca215269aa13a388df4d59ca195ee76" - "2.0.2": - url: "https://github.com/odygrd/quill/archive/v2.0.2.tar.gz" - sha256: "d2dc9004886b787f8357e97d2f2d0c74a460259f7f95d65ab49d060fe34a9b5c" "1.7.3": url: "https://github.com/odygrd/quill/archive/v1.7.3.tar.gz" sha256: "3fff0c5ffb19bbde5429369079741f84a6acce3a781b504cec5e677b05461208" diff --git a/recipes/quill/all/conanfile.py b/recipes/quill/all/conanfile.py index 51cfa188d7465..8de97161e3619 100644 --- a/recipes/quill/all/conanfile.py +++ b/recipes/quill/all/conanfile.py @@ -113,13 +113,11 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["QUILL_FMT_EXTERNAL"] = True tc.variables["QUILL_ENABLE_INSTALL"] = True - if Version(self.version) < "2.8.0": tc.variables["QUILL_USE_BOUNDED_QUEUE"] = self.options.with_bounded_queue else: if self.options.with_bounded_queue: tc.preprocessor_definitions["QUILL_USE_BOUNDED_QUEUE"] = 1 - tc.variables["QUILL_NO_EXCEPTIONS"] = self.options.with_no_exceptions tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True if self.is_quilll_x86_arch(): @@ -130,7 +128,8 @@ def generate(self): tc.variables["CMAKE_CXX_FLAGS"] = "-mclflushopt" if Version(self.version) >= "2.8.0" and self.options.get_safe("with_bounded_blocking_queue"): tc.preprocessor_definitions["QUILL_USE_BOUNDED_BLOCKING_QUEUE"] = 1 - + if Version(self.version) >= "3.2.0": + tc.variables["QUILL_DISABLE_POSITION_INDEPENDENT_CODE"] = not self.options.get_safe("fPIC") tc.generate() deps = CMakeDeps(self) diff --git a/recipes/quill/config.yml b/recipes/quill/config.yml index f987a8252400c..d8522cb2854c6 100644 --- a/recipes/quill/config.yml +++ b/recipes/quill/config.yml @@ -1,4 +1,8 @@ versions: + "3.2.0": + folder: "all" + "3.1.0": + folder: "all" "3.0.2": folder: "all" "2.9.2": @@ -13,17 +17,5 @@ versions: folder: "all" "2.6.0": folder: "all" - "2.5.1": - folder: "all" - "2.4.2": - folder: "all" - "2.3.4": - folder: "all" - "2.2.0": - folder: "all" - "2.1.0": - folder: "all" - "2.0.2": - folder: "all" "1.7.3": folder: "all" diff --git a/recipes/r8brain-free-src/all/conandata.yml b/recipes/r8brain-free-src/all/conandata.yml index 27ad749e21214..e43484f945f02 100644 --- a/recipes/r8brain-free-src/all/conandata.yml +++ b/recipes/r8brain-free-src/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.3": + url: "https://github.com/avaneev/r8brain-free-src/archive/refs/tags/version-6.3.tar.gz" + sha256: "f2cd46cd8806294d9be45ed4e6bda5f8ef1dc808625eec3facde784953d2bc23" "6.2": url: "https://github.com/avaneev/r8brain-free-src/archive/refs/tags/version-6.2.tar.gz" sha256: "5e576ec8cb6ae3969c4bcacb630ddc957fc20f60a6b08593681d16e06942597d" diff --git a/recipes/r8brain-free-src/all/conanfile.py b/recipes/r8brain-free-src/all/conanfile.py index c6a956008c5c7..50f5693f0f6cb 100644 --- a/recipes/r8brain-free-src/all/conanfile.py +++ b/recipes/r8brain-free-src/all/conanfile.py @@ -15,6 +15,7 @@ class R8brainFreeSrcConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/avaneev/r8brain-free-src" topics = ("audio", "sample-rate", "conversion", "audio-processing", "resampler") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -78,7 +79,7 @@ def package_info(self): self.cpp_info.libs = ["r8brain"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.extend(["pthread", "m",]) if self.options.fft == "pffft": self.cpp_info.defines.append("R8B_PFFFT") diff --git a/recipes/r8brain-free-src/config.yml b/recipes/r8brain-free-src/config.yml index 541a5f21084de..8f56257b3441d 100644 --- a/recipes/r8brain-free-src/config.yml +++ b/recipes/r8brain-free-src/config.yml @@ -1,4 +1,6 @@ versions: + "6.3": + folder: all "6.2": folder: all "4.6": diff --git a/recipes/range-v3/all/conanfile.py b/recipes/range-v3/all/conanfile.py index 4f9a2a5174d9a..a5064cb229661 100644 --- a/recipes/range-v3/all/conanfile.py +++ b/recipes/range-v3/all/conanfile.py @@ -16,7 +16,8 @@ class Rangev3Conan(ConanFile): license = "BSL-1.0" homepage = "https://github.com/ericniebler/range-v3" url = "https://github.com/conan-io/conan-center-index" - description = "Experimental range library for C++11/14/17" + package_type = "header-library" + description = "Range library for C++14/17/20, basis for C++20's std::ranges" topics = ("range", "range-library", "proposal", "iterator", "header-only") settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -36,9 +37,9 @@ def _min_cppstd(self): return "17" else: return "14" - + def layout(self): - basic_layout(self) + basic_layout(self, src_folder="src") def package_id(self): self.info.clear() @@ -67,6 +68,8 @@ def package(self): self.package_folder, "licenses"), src=self.source_folder) def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] self.cpp_info.components["range-v3-meta"].names["cmake_find_package"] = "meta" self.cpp_info.components["range-v3-meta"].names["cmake_find_package_multi"] = "meta" if is_msvc(self): diff --git a/recipes/rapidcsv/all/conandata.yml b/recipes/rapidcsv/all/conandata.yml index 502ec08fa730f..7a2083f7a43d3 100644 --- a/recipes/rapidcsv/all/conandata.yml +++ b/recipes/rapidcsv/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "8.77": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.77.tar.gz" + sha256: "2513c05e1a39799edd93787e86bdd83462bee06150b40942879af955288fa495" "8.75": url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.75.tar.gz" sha256: "004454890d371b4db370dfd44d64077f8f9b2b92e59d1d6471e1923f891485be" diff --git a/recipes/rapidcsv/all/conanfile.py b/recipes/rapidcsv/all/conanfile.py index a9d964b6536a3..758f7e3653563 100644 --- a/recipes/rapidcsv/all/conanfile.py +++ b/recipes/rapidcsv/all/conanfile.py @@ -13,6 +13,7 @@ class RapidcsvConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/d99kris/rapidcsv" topics = ("csv", "parser", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/rapidcsv/config.yml b/recipes/rapidcsv/config.yml index df34fa7350e3c..d18c0697363e9 100644 --- a/recipes/rapidcsv/config.yml +++ b/recipes/rapidcsv/config.yml @@ -1,4 +1,6 @@ versions: + "8.77": + folder: "all" "8.75": folder: "all" "8.69": diff --git a/recipes/redis-plus-plus/all/conandata.yml b/recipes/redis-plus-plus/all/conandata.yml index 2437f2fe67b15..fb21e925b3beb 100644 --- a/recipes/redis-plus-plus/all/conandata.yml +++ b/recipes/redis-plus-plus/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.3.10": + url: "https://github.com/sewenew/redis-plus-plus/archive/1.3.10.tar.gz" + sha256: "85d9d9ff84c873c4a14bd28bee569a1f311285fad8d4f2fb0e472f65d4bb842a" + "1.3.8": + url: "https://github.com/sewenew/redis-plus-plus/archive/1.3.8.tar.gz" + sha256: "ad521b4a24d1591a1564f945ba6370875b501210222e324f398065251df41641" "1.3.7": url: "https://github.com/sewenew/redis-plus-plus/archive/1.3.7.tar.gz" sha256: "89cb83b0a23ac5825300c301814eab74aa3cdcfcd12e87d443c2692e367768ba" @@ -11,10 +17,15 @@ sources: "1.2.3": url: "https://github.com/sewenew/redis-plus-plus/archive/1.2.3.tar.gz" sha256: "1a3336752133019c963e06c28667b96690d6395b804e5e326671777ff88982ea" - "1.2.1": - url: "https://github.com/sewenew/redis-plus-plus/archive/1.2.1.tar.gz" - sha256: "f09c9fcc362955edb887632cd008102887278c94934d7e8c9d0acb8707671902" patches: + "1.3.10": + - patch_file: "patches/1.3.8-0001-fix-dependencies-injection.patch" + patch_description: "Robust discovery & injection of dependencies, and handle missing hiredis_ssl-config.cmake" + patch_type: "conan" + "1.3.8": + - patch_file: "patches/1.3.8-0001-fix-dependencies-injection.patch" + patch_description: "Robust discovery & injection of dependencies, and handle missing hiredis_ssl-config.cmake" + patch_type: "conan" "1.3.7": - patch_file: "patches/1.3.7-0001-fix-dependencies-injection.patch" patch_description: "Robust discovery & injection of dependencies, and handle missing hiredis_ssl-config.cmake" @@ -31,10 +42,3 @@ patches: - patch_file: "patches/1.2.3-0001-fix-conan-cmake-package.patch" patch_description: "Robust discovery & injection of dependencies" patch_type: "conan" - "1.2.1": - - patch_file: "patches/1.2.1-0001-fix-hiredis-consumption.patch" - patch_description: "Robust discovery & injection of dependencies" - patch_type: "conan" - - patch_file: "patches/1.2.1-0002-cmake-minimum-required.patch" - patch_description: "CMake: move cmake_minimum_required() before project()" - patch_type: "conan" diff --git a/recipes/redis-plus-plus/all/conanfile.py b/recipes/redis-plus-plus/all/conanfile.py index b10c66e4f7f94..5895ab8dac984 100644 --- a/recipes/redis-plus-plus/all/conanfile.py +++ b/recipes/redis-plus-plus/all/conanfile.py @@ -6,17 +6,17 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class RedisPlusPlusConan(ConanFile): name = "redis-plus-plus" - homepage = "https://github.com/sewenew/redis-plus-plus" description = "Redis client written in C++" - topics = ("database", "redis", "client", "tls") - url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" - + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sewenew/redis-plus-plus" + topics = ("database", "redis", "client", "tls") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -58,18 +58,15 @@ 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): - self.requires("hiredis/1.1.0") + self.requires("hiredis/1.1.0", transitive_headers=True, transitive_libs=True) if self.options.get_safe("build_async"): - self.requires("libuv/1.44.2") + self.requires("libuv/1.46.0") def validate(self): if self.info.settings.compiler.get_safe("cppstd"): @@ -85,8 +82,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.name}:with_tls=True requires hiredis:with_ssl=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/redis-plus-plus/all/patches/1.3.8-0001-fix-dependencies-injection.patch b/recipes/redis-plus-plus/all/patches/1.3.8-0001-fix-dependencies-injection.patch new file mode 100644 index 0000000000000..620986816daec --- /dev/null +++ b/recipes/redis-plus-plus/all/patches/1.3.8-0001-fix-dependencies-injection.patch @@ -0,0 +1,58 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6470b32..d372d3d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -34,8 +34,7 @@ if(REDIS_PLUS_PLUS_BUILD_ASYNC) + message(STATUS "redis-plus-plus build async interface with libuv") + + # libuv dependency +- find_path(REDIS_PLUS_PLUS_ASYNC_LIB_HEADER NAMES uv.h) +- find_library(REDIS_PLUS_PLUS_ASYNC_LIB uv) ++ find_package(libuv REQUIRED CONFIG) + else() + message(FATAL_ERROR "invalid REDIS_PLUS_PLUS_BUILD_ASYNC") + endif() +@@ -133,7 +132,6 @@ if(hiredis_FOUND) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS hiredis::hiredis) + + if(REDIS_PLUS_PLUS_USE_TLS) +- find_package(hiredis_ssl REQUIRED) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS hiredis::hiredis_ssl) + find_package(OpenSSL REQUIRED) + list(APPEND REDIS_PLUS_PLUS_HIREDIS_LIBS ${OPENSSL_LIBRARIES}) +@@ -163,16 +161,10 @@ endif() + set(HIREDIS_FEATURE_TEST_HEADER "${HIREDIS_FEATURE_TEST_INCLUDE}/hiredis/hiredis.h") + + include(CheckSymbolExists) +-set(CMAKE_REQUIRED_LIBRARIES_BACK ${CMAKE_REQUIRED_LIBRARIES}) +-set(CMAKE_REQUIRED_LIBRARIES ${HIREDIS_FEATURE_TEST_LIB}) +- + CHECK_SYMBOL_EXISTS(redisEnableKeepAliveWithInterval ${HIREDIS_FEATURE_TEST_HEADER} REDIS_PLUS_PLUS_HAS_redisEnableKeepAliveWithInterval) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hiredis_features.h.in ${CMAKE_CURRENT_SOURCE_DIR}/${REDIS_PLUS_PLUS_SOURCE_DIR}/hiredis_features.h) + +-# Restore CMAKE_REQUIRED_LIBRARIES +-set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_BACK}) +- + # Build static library + option(REDIS_PLUS_PLUS_BUILD_STATIC "Build static library" ON) + message(STATUS "redis-plus-plus build static library: ${REDIS_PLUS_PLUS_BUILD_STATIC}") +@@ -214,7 +206,7 @@ if(REDIS_PLUS_PLUS_BUILD_STATIC) + + if(REDIS_PLUS_PLUS_BUILD_ASYNC) + target_include_directories(${STATIC_LIB} PUBLIC $) +- target_include_directories(${STATIC_LIB} PUBLIC $) ++ target_link_libraries(${STATIC_LIB} PUBLIC $,uv,uv_a>) + if(REDIS_PLUS_PLUS_ASYNC_FUTURE STREQUAL "boost") + target_include_directories(${STATIC_LIB} SYSTEM PUBLIC $) + endif() +@@ -267,8 +259,7 @@ if(REDIS_PLUS_PLUS_BUILD_SHARED) + + if(REDIS_PLUS_PLUS_BUILD_ASYNC) + target_include_directories(${SHARED_LIB} PUBLIC $) +- target_include_directories(${SHARED_LIB} PUBLIC $) +- target_link_libraries(${SHARED_LIB} PUBLIC ${REDIS_PLUS_PLUS_ASYNC_LIB}) ++ target_link_libraries(${SHARED_LIB} PUBLIC $,uv,uv_a>) + if(REDIS_PLUS_PLUS_ASYNC_FUTURE STREQUAL "boost") + target_include_directories(${SHARED_LIB} SYSTEM PUBLIC $) + endif() diff --git a/recipes/redis-plus-plus/all/test_package/CMakeLists.txt b/recipes/redis-plus-plus/all/test_package/CMakeLists.txt index df9a8c785c48c..a2c2b3348228e 100644 --- a/recipes/redis-plus-plus/all/test_package/CMakeLists.txt +++ b/recipes/redis-plus-plus/all/test_package/CMakeLists.txt @@ -9,10 +9,15 @@ if(TARGET redis++::redis++_static) else() target_link_libraries(${PROJECT_NAME} PRIVATE redis++::redis++) endif() -if(redis++_VERSION VERSION_GREATER_EQUAL "1.3.0") - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -else() - # no target_compile_features here because redis-plus-plus < 1.3.0 is built - # with C++11 by default and is not ABI compatible if consumed with C++17... - set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) + +if(NOT CMAKE_CXX_STANDARD) + # Cover the case where compiler.cppstd is not defined in the Conan profile + # (e.g. Conan 1.x), and define the compiler standard assuming the library defaults instead + if(redis++_VERSION VERSION_GREATER_EQUAL "1.3.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + else() + # no target_compile_features here because redis-plus-plus < 1.3.0 is built + # with C++11 by default and is not ABI compatible if consumed with C++17... + set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) + endif() endif() diff --git a/recipes/redis-plus-plus/config.yml b/recipes/redis-plus-plus/config.yml index 923fc0f3c1acb..38a930c3be65e 100644 --- a/recipes/redis-plus-plus/config.yml +++ b/recipes/redis-plus-plus/config.yml @@ -1,4 +1,8 @@ versions: + "1.3.10": + folder: all + "1.3.8": + folder: all "1.3.7": folder: all "1.3.3": @@ -7,5 +11,3 @@ versions: folder: all "1.2.3": folder: all - "1.2.1": - folder: all diff --git a/recipes/rmm/all/conandata.yml b/recipes/rmm/all/conandata.yml new file mode 100644 index 0000000000000..7df46299a9c8a --- /dev/null +++ b/recipes/rmm/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "23.06.00": + url: "https://github.com/rapidsai/rmm/archive/refs/tags/v23.06.00.tar.gz" + sha256: "3dade75a6ba21041e47493a6514513aa01d40e19bba500f5e648e399744e1a24" diff --git a/recipes/rmm/all/conanfile.py b/recipes/rmm/all/conanfile.py new file mode 100644 index 0000000000000..e9bb7d0e98006 --- /dev/null +++ b/recipes/rmm/all/conanfile.py @@ -0,0 +1,118 @@ +import os +import textwrap + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import export_conandata_patches, get, copy, replace_in_file, save +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class RmmConan(ConanFile): + name = "rmm" + description = "RAPIDS Memory Manager" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rapidsai/rmm" + topics = ("cuda", "memory-management", "memory-allocation", "rapids", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + # Based partially on https://github.com/rapidsai/rmm/tree/v23.06.00#get-rmm-dependencies + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "9.3", + "clang": "8", + "apple-clang": "14.0", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("thrust/1.17.2") + self.requires("spdlog/1.11.0") + self.requires("fmt/9.1.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.dependencies["thrust"].options.get_safe("backend") != "cuda": + self.output.warning( + "RMM requires the CUDA backend to be enabled in Thrust by setting thrust/*:backend=cuda." + ) + + def _write_version_header(self): + # Workaround for the `rapids_cmake_write_version_file(include/rmm/version_config.hpp)` CMakeLists.txt step + # https://github.com/rapidsai/rapids-cmake/blob/branch-23.08/rapids-cmake/cmake/write_version_file.cmake + # https://github.com/rapidsai/rapids-cmake/blob/branch-23.08/rapids-cmake/cmake/template/version.hpp.in + major, minor, patch = self.version.split(".")[:3] + save(self, os.path.join(self.source_folder, "include", "rmm", "version_config.hpp"), + textwrap.dedent(f"""\ + #pragma once + #define RMM_VERSION_MAJOR {int(major)} + #define RMM_VERSION_MINOR {int(minor)} + #define RMM_VERSION_PATCH {int(patch)} + """) + ) + + def _patch_sources(self): + if Version(self.version) < "23.08": + # https://github.com/rapidsai/rmm/pull/1295 + # Add missing include in logger.hpp + replace_in_file( + self, + os.path.join(self.source_folder, "include", "rmm", "logger.hpp"), + "#include ", + "#include \n#include ", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + self._write_version_header() + self._patch_sources() + + def package(self): + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + for pattern in ["*.hpp", "*.h"]: + copy( + self, + pattern=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 = [] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("dl") diff --git a/recipes/rmm/all/test_package/CMakeLists.txt b/recipes/rmm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..678b3e6095ba7 --- /dev/null +++ b/recipes/rmm/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(rmm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rmm::rmm) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/rmm/all/test_package/conanfile.py b/recipes/rmm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/rmm/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/rmm/all/test_package/test_package.cpp b/recipes/rmm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..981cc677b6529 --- /dev/null +++ b/recipes/rmm/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include +#include +#include + +int main() { + // The log output will be sent to rmm_log.txt in the build directory by default + RMM_LOG_INFO("rmm version: {}.{}.{}", RMM_VERSION_MAJOR, RMM_VERSION_MINOR, RMM_VERSION_PATCH); + return EXIT_SUCCESS; +} diff --git a/recipes/rmm/config.yml b/recipes/rmm/config.yml new file mode 100644 index 0000000000000..e04fd963f4a5f --- /dev/null +++ b/recipes/rmm/config.yml @@ -0,0 +1,3 @@ +versions: + "23.06.00": + folder: all diff --git a/recipes/rtm/all/conanfile.py b/recipes/rtm/all/conanfile.py index ab6e02732c88c..232084322c1ed 100644 --- a/recipes/rtm/all/conanfile.py +++ b/recipes/rtm/all/conanfile.py @@ -1,28 +1,46 @@ import os -from conans import ConanFile, tools + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class Rtmonan(ConanFile): name = "rtm" description = "Realtime Math" - topics = ("realtime", "math") license = "MIT" - homepage = "https://github.com/nfrechette/rtm" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nfrechette/rtm" + topics = ("realtime", "math", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) 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 package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "includes")) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "includes")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/rtm/all/test_package/CMakeLists.txt b/recipes/rtm/all/test_package/CMakeLists.txt index 33ae887aa6aea..6cc064494767b 100644 --- a/recipes/rtm/all/test_package/CMakeLists.txt +++ b/recipes/rtm/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(rtm REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE rtm::rtm) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/rtm/all/test_package/conanfile.py b/recipes/rtm/all/test_package/conanfile.py index a59a26a52c8dc..fae501d0afb9e 100644 --- a/recipes/rtm/all/test_package/conanfile.py +++ b/recipes/rtm/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -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", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/rtm/all/test_package/test_package.cpp b/recipes/rtm/all/test_package/test_package.cpp index 5e13600bd88fc..5392fd6c1108b 100644 --- a/recipes/rtm/all/test_package/test_package.cpp +++ b/recipes/rtm/all/test_package/test_package.cpp @@ -1,3 +1,6 @@ +// workaround for a missing include in rtm +#include + #include #include #include diff --git a/recipes/rtm/all/test_v1_package/CMakeLists.txt b/recipes/rtm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/rtm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/rtm/all/test_v1_package/conanfile.py b/recipes/rtm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..abcaeed3f89b6 --- /dev/null +++ b/recipes/rtm/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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sail/all/conanfile.py b/recipes/sail/all/conanfile.py index 6832bd1f1a055..fb389e804f131 100644 --- a/recipes/sail/all/conanfile.py +++ b/recipes/sail/all/conanfile.py @@ -56,17 +56,17 @@ def requirements(self): if self.options.with_gif: self.requires("giflib/5.2.1") if self.options.with_jpeg2000: - self.requires("jasper/2.0.33") + self.requires("jasper/4.0.0") if self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.4") + self.requires("libjpeg-turbo/2.1.5") elif self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") if self.options.with_png: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_tiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.5.1") if self.options.with_webp: - self.requires("libwebp/1.2.4") + self.requires("libwebp/1.3.1") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/sbp/all/CMakeLists.txt b/recipes/sbp/all/CMakeLists.txt deleted file mode 100644 index 454b398b885e5..0000000000000 --- a/recipes/sbp/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder/c") diff --git a/recipes/sbp/all/conandata.yml b/recipes/sbp/all/conandata.yml index f640026c27acb..c5be56f8c3b1f 100644 --- a/recipes/sbp/all/conandata.yml +++ b/recipes/sbp/all/conandata.yml @@ -1,11 +1,11 @@ sources: - "3.4.10": + "4.15.0": cmake: - url: "https://github.com/swift-nav/cmake/archive/373d4fcafbbc0c208dc9ecb278d36ed8c9448eda.zip" - sha256: 6077d2a754d013e3cb9826f589e47b19ab01f4d91ede4f5bfc14db74bc5dc894 + url: "https://github.com/swift-nav/cmake/archive/12b7f037e7cc721a9a36c7342ba2ca2b0cafc01e.zip" + sha256: 6a725914bf8c3ed13065812cf4d7b0a69e478eaa150561e0e3be4cd01bf3798f source: - url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v3.4.10.tar.gz" - sha256: f2fb738f49112b25e7849ca0c75415159127e9b5373b13e7027362b8fa0b1224 + url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v4.15.0.tar.gz" + sha256: e71fd7dd5536058d6b93ade443913e68da7b4f1896aa720dc369baab1864e9e9 "4.2.0": cmake: url: "https://github.com/swift-nav/cmake/archive/31604e72e72c09fa32effdbc37acc79dda7c99d7.zip" @@ -13,3 +13,10 @@ sources: source: url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v4.2.0.tar.gz" sha256: 9ee9808394867405938505fb0aa52ffeb8d98b7ce222e47629ffabdc9e23d3e4 + "3.4.10": + cmake: + url: "https://github.com/swift-nav/cmake/archive/373d4fcafbbc0c208dc9ecb278d36ed8c9448eda.zip" + sha256: 6077d2a754d013e3cb9826f589e47b19ab01f4d91ede4f5bfc14db74bc5dc894 + source: + url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v3.4.10.tar.gz" + sha256: f2fb738f49112b25e7849ca0c75415159127e9b5373b13e7027362b8fa0b1224 diff --git a/recipes/sbp/all/conanfile.py b/recipes/sbp/all/conanfile.py index 77edf2fd79a3e..b94c371fc9b5b 100644 --- a/recipes/sbp/all/conanfile.py +++ b/recipes/sbp/all/conanfile.py @@ -1,27 +1,30 @@ import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy + +required_conan_version = ">=1.53.0" class SbpConan(ConanFile): name = "sbp" + description = "Swift Binary Protocol client library" license = "MIT" - homepage = "https://github.com/swift-nav/libsbp" url = "https://github.com/conan-io/conan-center-index" - description = "Swift Binary Protocol client library" + homepage = "https://github.com/swift-nav/libsbp" topics = ("gnss",) - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - generators = "cmake" - exports_sources = "CMakeLists.txt", "c" - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def config_options(self): if self.settings.os == "Windows": @@ -29,41 +32,46 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def validate(self): if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Windows shared builds are not supported right now, see issue https://github.com/swift-nav/libsbp/issues/1062") + raise ConanInvalidConfiguration( + "Windows shared builds are not supported right now, " + "see issue https://github.com/swift-nav/libsbp/issues/1062" + ) + + def layout(self): + cmake_layout(self, src_folder="src") def source(self): data = self.conan_data["sources"][self.version] + get(self, **data["source"], strip_root=True) + get(self, **data["cmake"], strip_root=True, destination=os.path.join("c", "cmake", "common")) - tools.get(**data["source"], strip_root=True, destination=self._source_subfolder) - tools.get(**data["cmake"], strip_root=True, destination=os.path.join(self._source_subfolder, "c", "cmake", "common")) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - self._cmake.definitions["libsbp_ENABLE_TESTS"] = False - self._cmake.definitions["libsbp_ENABLE_DOCS"] = False - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["libsbp_ENABLE_TESTS"] = False + tc.variables["libsbp_ENABLE_DOCS"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder="c") cmake.build() def package(self): - self.copy( - "LICENSE", - src=self._source_subfolder, - dst="licenses", - ignore_case=True, - keep_path=False, + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, ) - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/sbp/all/test_package/CMakeLists.txt b/recipes/sbp/all/test_package/CMakeLists.txt index d9693fa5cada2..6da47266b9454 100644 --- a/recipes/sbp/all/test_package/CMakeLists.txt +++ b/recipes/sbp/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) find_package(sbp REQUIRED CONFIG) diff --git a/recipes/sbp/all/test_package/conanfile.py b/recipes/sbp/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/sbp/all/test_package/conanfile.py +++ b/recipes/sbp/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sbp/config.yml b/recipes/sbp/config.yml index 84cd65924d4fb..6e299a70ad6f8 100644 --- a/recipes/sbp/config.yml +++ b/recipes/sbp/config.yml @@ -1,5 +1,7 @@ versions: - "3.4.10": + "4.15.0": folder: "all" "4.2.0": folder: "all" + "3.4.10": + folder: "all" diff --git a/recipes/scip/all/conandata.yml b/recipes/scip/all/conandata.yml new file mode 100644 index 0000000000000..8e5c45d17a6da --- /dev/null +++ b/recipes/scip/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "8.0.3": + url: "https://github.com/scipopt/scip/archive/refs/tags/v803.tar.gz" + sha256: "fe7636f8165a8c9298ff55ed3220d084d4ea31ba9b69d2733beec53e0e4335d6" diff --git a/recipes/scip/all/conanfile.py b/recipes/scip/all/conanfile.py new file mode 100644 index 0000000000000..1afdaf21774a7 --- /dev/null +++ b/recipes/scip/all/conanfile.py @@ -0,0 +1,146 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +from os.path import join + +required_conan_version = ">=1.53.0" + + +class SCIPConan(ConanFile): + name = "scip" + description = "SCIP mixed integer (nonlinear) programming solver" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://scipopt.org/" + topics = ("mip", "solver", "linear", "programming") + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_gmp": [True, False], + "with_tpi": [False, "omp", "tny"], + "with_sym": [False, "bliss"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_gmp": True, + "with_tpi": False, + "with_sym": "bliss", + } + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "4", + "apple-clang": "7", + } + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") + if self.options.shared and self.options.with_sym == "bliss": + raise ConanInvalidConfiguration("Bliss is not supported in shared mode.") + comp = self.settings.compiler + if self.options.with_sym == "bliss" and comp == 'clang' and comp.libcxx and comp.libcxx == 'libc++': + raise ConanInvalidConfiguration("Bliss does not support libc++.") + if self.dependencies["soplex"].options.with_gmp and not self.options.with_gmp: + raise ConanInvalidConfiguration("The options 'with_gmp' should be aligned with 'soplex:with_gmp' too.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def requirements(self): + if self.options.with_gmp: + self.requires("gmp/6.2.1") + if self.options.with_sym == "bliss": + self.requires("bliss/0.77") + self.requires("soplex/6.0.3") + self.requires("zlib/1.2.13") + + def configure(self): + self.options["soplex"].with_gmp = self.options.with_gmp + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + @staticmethod + def _to_cmake(*arrays): + return ";".join(item.replace("\\", "/") for sublist in arrays for item in sublist) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SHARED"] = self.options.shared + tc.variables["READLINE"] = False # required for interactive stuff + tc.variables["GMP"] = self.options.with_gmp + tc.variables["TPI"] = self.options.with_tpi or "none" + tc.variables["LPS"] = "spx" + tc.variables["SYM"] = self.options.with_sym or "none" + tc.variables["SOPLEX_INCLUDE_DIRS"] = self._to_cmake(self.dependencies["soplex"].cpp_info.includedirs) + if self.options.shared: + # CMakeLists accesses different variables for SoPlex depending on the SHARED option + tc.variables["SOPLEX_PIC_LIBRARIES"] = "soplex" + if self.dependencies["soplex"].options.with_boost: + # INFO: docu states BOOST_ROOT, yet that does not exist in CMakeLists + tc.variables["SOPLEX_INCLUDE_DIRS"] = self._to_cmake( + self.dependencies["soplex"].cpp_info.includedirs, + self.dependencies["boost"].cpp_info.includedirs + ) + tc.variables["PAPILO"] = False # LGPL + tc.variables["ZIMPL"] = False # LPGL + tc.variables["IPOPT"] = False # no such coin package on conan center yet + tc.generate() + deps = CMakeDeps(self) + deps.set_property("sopex", "cmake_file_name", "SOPEX") + deps.set_property("gmp", "cmake_file_name", "GMP") + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build(target="libscip") + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=join(self.package_folder, "licenses")) + # cmake install is not used as this requires the command line tools to be built, which we do not do + copy(self, pattern="*.h", src=join(self.source_folder, "src"), dst=join(self.package_folder, "include")) + copy(self, pattern="*.h", src=join(self.build_folder, "scip"), dst=join(self.package_folder, "include", "scip")) + if self.options.shared: + copy(self, pattern="*.so*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) + copy(self, pattern="*.dylib*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) + else: + copy(self, pattern="*.a", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) + copy(self, pattern="*.lib", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.lib", src=self.build_folder, dst=join(self.package_folder, "lib"), keep_path=False) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["libscip" if is_msvc(self) else "scip"] + if self.options.with_tpi == "omp": + self.cpp_info.system_libs.append("-fopenmp") diff --git a/recipes/scip/all/test_package/CMakeLists.txt b/recipes/scip/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a3b0a4eba8335 --- /dev/null +++ b/recipes/scip/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) +set(CMAKE_CXX_STANDARD 14) + +find_package(scip REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE scip::scip) diff --git a/recipes/scip/all/test_package/conanfile.py b/recipes/scip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/scip/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/scip/all/test_package/test_package.cpp b/recipes/scip/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..36b9c1c15a47d --- /dev/null +++ b/recipes/scip/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include "scip/scip.h" + + +int main() { + SCIP* scip; + SCIPcreate(&scip); + SCIPprintVersion(scip, NULL); + SCIPinfoMessage(scip, NULL, "\n"); + return EXIT_SUCCESS; +} diff --git a/recipes/scip/config.yml b/recipes/scip/config.yml new file mode 100644 index 0000000000000..5a689d128f61a --- /dev/null +++ b/recipes/scip/config.yml @@ -0,0 +1,3 @@ +versions: + "8.0.3": + folder: all diff --git a/recipes/scons/all/conanfile.py b/recipes/scons/all/conanfile.py index f52d4fa5ffabe..c3cafc92f9e09 100644 --- a/recipes/scons/all/conanfile.py +++ b/recipes/scons/all/conanfile.py @@ -1,4 +1,6 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import copy, get, save +from conan.tools.scm import Version import os import shutil import textwrap @@ -11,17 +13,17 @@ class SConsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index/" homepage = "https://scons.org" topics = ("scons", "build", "configuration", "development") - settings = "os" # Added to let the CI test this package on all os'es + settings = "os" + package_type = "application" + no_copy_source = True + short_paths = True - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + self.folders.source = "src" 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, destination=self.source_folder) def _chmod_x(self, path): if os.name == "posix": @@ -36,19 +38,19 @@ def _scons_cmd(self): return os.path.join(self.package_folder, "bin", "scons.cmd") def package_id(self): - self.info.header_only() + self.info.clear() def package(self): - self.copy("LICENSE*", src=self._source_subfolder, dst="licenses") + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - if tools.Version(self.version) < 4: - shutil.copytree(os.path.join(self._source_subfolder, "engine", "SCons"), + if Version(self.version) < 4: + shutil.copytree(os.path.join(self.source_folder, "engine", "SCons"), os.path.join(self.package_folder, "res", "SCons")) else: - shutil.copytree(os.path.join(self._source_subfolder, "SCons"), + shutil.copytree(os.path.join(self.source_folder, "SCons"), os.path.join(self.package_folder, "res", "SCons")) - tools.save(self._scons_sh, textwrap.dedent("""\ + save(self, self._scons_sh, textwrap.dedent("""\ #!/bin/sh realpath() ( @@ -70,7 +72,7 @@ def package(self): exec ${PYTHON:-python3} "$currentdir/../res/SCons/__main__.py" "$@" """)) self._chmod_x(self._scons_sh) - tools.save(self._scons_cmd, textwrap.dedent(r""" + save(self, self._scons_cmd, textwrap.dedent(r""" @echo off set currentdir=%~dp0 if not defined PYTHON ( @@ -80,18 +82,14 @@ def package(self): CALL %PYTHON% %currentdir%\\..\\res\\SCons\\__main__.py %* """)) - # Mislead CI and create an empty header in the include directory - include_dir = os.path.join(self.package_folder, "include") - os.mkdir(include_dir) - tools.save(os.path.join(include_dir, "__nop.h"), "") - def package_info(self): self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] self._chmod_x(self._scons_sh) - bindir = os.path.join(self.package_folder, "bin") + + # For Conan 1.x downstream consumers, can be removed once recipe is Conan 2.x only: self.output.info("Appending PATH environment var: {}".format(bindir)) self.env_info.PATH.append(bindir) diff --git a/recipes/scons/all/test_package/SConscript b/recipes/scons/all/test_package/SConscript index 4292c616da88f..d87b9971cdc64 100644 --- a/recipes/scons/all/test_package/SConscript +++ b/recipes/scons/all/test_package/SConscript @@ -3,15 +3,6 @@ import os env = Environment() -conan = SConscript("SConscript_conan") -if not conan: - print("File `SConscript_conan` is missing.") - print("It should be generated by running `conan install`.") - sys.exit(1) - -flags = conan["conan"] -env.MergeFlags(flags) - print("CC is: {}".format(env.subst('$CC'))) test_package = env.Program(["test_package.c"]) diff --git a/recipes/scons/all/test_package/SConstruct b/recipes/scons/all/test_package/SConstruct index a01f66f16099c..ef39d8e2323d3 100644 --- a/recipes/scons/all/test_package/SConstruct +++ b/recipes/scons/all/test_package/SConstruct @@ -2,5 +2,6 @@ import os SConsignFile(os.path.join(GetLaunchDir(), "db")) SConscript('SConscript', - variant_dir=GetLaunchDir(), + build_dir='build', + src='.', duplicate=False) diff --git a/recipes/scons/all/test_package/conanfile.py b/recipes/scons/all/test_package/conanfile.py index 315bdaa33b945..ae2a5c9cf4727 100644 --- a/recipes/scons/all/test_package/conanfile.py +++ b/recipes/scons/all/test_package/conanfile.py @@ -1,43 +1,37 @@ -from conans import ConanFile, tools -from conans.errors import ConanException +from conan import ConanFile +from conan.tools.build import build_jobs, cross_building +from conan.tools.layout import basic_layout from io import StringIO import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "scons" + generators = "VirtualBuildEnv" + test_type = "explicit" - def build(self): - scons_path = self.deps_user_info["scons"].scons - if not scons_path: - raise ConanException("scons could not be found") - if not scons_path.replace("\\", "/").startswith(self.deps_cpp_info["scons"].rootpath.replace("\\", "/")): - raise ConanException("an external scons was found") + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + def layout(self): + basic_layout(self) + + def build(self): output = StringIO() - self.run("{} --version".format(scons_path), run_environment=True, output=output, ignore_errors=True) - self.output.info("output: %s" % output.getvalue()) - output = StringIO() - self.run("{} --version".format(scons_path), run_environment=True, output=output) - text = output.getvalue() - if self.deps_cpp_info["scons"].version not in text: - raise ConanException("scons --version does not return correct version") + self.run("scons --version", output) + self.output.info(output.getvalue()) + assert("SCons by Steven Knight" in output.getvalue()) scons_args = [ - "-j", str(tools.cpu_count()), + "-j", str(build_jobs(self)), "-C", self.source_folder, "-f", os.path.join(self.source_folder, "SConstruct"), ] - self.run("scons {}".format(" ".join(scons_args)), run_environment=True) + self.run("scons {}".format(" ".join(scons_args))) def test(self): - from io import StringIO - - if not tools.cross_building(self): - bin_path = os.path.join(".", "test_package") - output = StringIO() - self.run(bin_path, run_environment=True, ignore_errors=True, output=output) - self.output.info("output: %s" % output.getvalue()) - self.run(bin_path, run_environment=True) + if not cross_building(self): + # Scons build put executable righe here + bin_path = os.path.join(self.recipe_folder, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/screen_capture_lite/all/conandata.yml b/recipes/screen_capture_lite/all/conandata.yml index 87497fb96911b..aa72c475ba532 100644 --- a/recipes/screen_capture_lite/all/conandata.yml +++ b/recipes/screen_capture_lite/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "17.1.1327": + url: "https://github.com/smasherprog/screen_capture_lite/archive/refs/tags/17.1.1327.tar.gz" + sha256: "bc5c17f3df14c1013268fc0107b52a98c6d032803fd1faea1983772f3b7ac5ed" "17.1.1173": url: "https://github.com/smasherprog/screen_capture_lite/archive/refs/tags/17.1.1173.tar.gz" sha256: "17875fb58f0e5920b13b6ef2516c8e973055347339d3dbaabfa97ef448fdfff2" diff --git a/recipes/screen_capture_lite/config.yml b/recipes/screen_capture_lite/config.yml index 863f787460bb7..7298de37ef363 100644 --- a/recipes/screen_capture_lite/config.yml +++ b/recipes/screen_capture_lite/config.yml @@ -1,4 +1,6 @@ versions: + "17.1.1327": + folder: "all" "17.1.1173": folder: "all" "17.1.613": diff --git a/recipes/sdl_image/all/conanfile.py b/recipes/sdl_image/all/conanfile.py index 2bb32465a9dea..6543a9f1cf350 100644 --- a/recipes/sdl_image/all/conanfile.py +++ b/recipes/sdl_image/all/conanfile.py @@ -79,15 +79,15 @@ def layout(self): def requirements(self): # Headers are exposed https://github.com/conan-io/conan-center-index/pull/16167#issuecomment-1508347351 - self.requires("sdl/2.26.1", transitive_headers=True) + self.requires("sdl/2.26.5", transitive_headers=True) if self.options.with_libtiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.5.1") if self.options.with_libjpeg: self.requires("libjpeg/9e") if self.options.with_libpng: - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_libwebp: - self.requires("libwebp/1.3.0") + self.requires("libwebp/1.3.1") def validate(self): if self.options.shared and not self.dependencies["sdl"].options.shared: diff --git a/recipes/sdl_ttf/all/conandata.yml b/recipes/sdl_ttf/all/conandata.yml index ac34ee3b6fceb..556b69cb6d777 100644 --- a/recipes/sdl_ttf/all/conandata.yml +++ b/recipes/sdl_ttf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.20.2": + url: "https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.2/SDL2_ttf-2.20.2.tar.gz" + sha256: "9dc71ed93487521b107a2c4a9ca6bf43fb62f6bddd5c26b055e6b91418a22053" "2.20.1": url: "https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.1/SDL2_ttf-2.20.1.tar.gz" sha256: "78cdad51f3cc3ada6932b1bb6e914b33798ab970a1e817763f22ddbfd97d0c57" @@ -13,6 +16,10 @@ patches: - patch_file: "patches/2.20.1-0001-fix-cmake-min-version.patch" patch_description: "Disable useless .pc file install to avoid relying on CMake 3.21 features" patch_type: "conan" + - patch_file: "patches/2.20.1-0002-remove-unsupported-property.patch" + patch_description: "remove DEPRECATION property is available on CMake 3.17+ (Linux C3i is 3.15 and the Conan min)" + patch_type: "portability" + patch_source: "https://github.com/libsdl-org/SDL_ttf/commit/e49b6030bd57b7aa3f0e4e42cb7ccc5fee876184" "2.0.18": - patch_file: "patches/2.0.18-0001-cmake-fix-link-target.patch" patch_description: "correct target name, disable PIC fixed" diff --git a/recipes/sdl_ttf/all/conanfile.py b/recipes/sdl_ttf/all/conanfile.py index 984ebd5896713..3766809402fca 100644 --- a/recipes/sdl_ttf/all/conanfile.py +++ b/recipes/sdl_ttf/all/conanfile.py @@ -1,5 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save from conan.tools.microsoft import is_msvc @@ -51,7 +52,8 @@ def layout(self): def requirements(self): self.requires("freetype/2.12.1") - self.requires("sdl/2.26.1") + # https://github.com/conan-io/conan-center-index/pull/18366#issuecomment-1625464996 + self.requires("sdl/2.26.5", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_harfbuzz"): self.requires("harfbuzz/6.0.0") @@ -121,6 +123,10 @@ def package_info(self): self.cpp_info.components["_sdl2_ttf"].requires = ["freetype::freetype", "sdl::libsdl2"] if self.options.get_safe("with_harfbuzz"): self.cpp_info.components["_sdl2_ttf"].requires.append("harfbuzz::harfbuzz") + if Version(self.version) <= "2.0.18" and is_apple_os(self) and self.options.shared: + self.cpp_info.components["_sdl2_ttf"].frameworks = [ + "AppKit", "CoreGraphics", "CoreFoundation", "CoreServices" + ] # TODO: to remove in conan v2 self.cpp_info.names["cmake_find_package"] = "SDL2_ttf" diff --git a/recipes/sdl_ttf/all/patches/2.20.1-0002-remove-unsupported-property.patch b/recipes/sdl_ttf/all/patches/2.20.1-0002-remove-unsupported-property.patch new file mode 100644 index 0000000000000..b1c27e03bcce2 --- /dev/null +++ b/recipes/sdl_ttf/all/patches/2.20.1-0002-remove-unsupported-property.patch @@ -0,0 +1,25 @@ +From e49b6030bd57b7aa3f0e4e42cb7ccc5fee876184 Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Sat, 23 Jul 2022 17:28:28 +0200 +Subject: [PATCH] cmake: DEPRECATION property is available on CMake 3.17+ + +--- + CMakeLists.txt | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ebbe692d..64854ad3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -401,6 +401,9 @@ endif() + add_library(SDL2::ttf INTERFACE IMPORTED GLOBAL) + set_target_properties(SDL2::ttf PROPERTIES + INTERFACE_LINK_LIBRARIES "SDL2_ttf" +- DEPRECATION "Use SDL2_ttf::SDL2_ttf or SDL2_ttf::SDL2_ttf-static instead" + ) +- ++if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.17") ++ set_target_properties(SDL2::ttf PROPERTIES ++ DEPRECATION "Use SDL2_ttf::SDL2_ttf or SDL2_ttf::SDL2_ttf-static instead" ++ ) ++endif() diff --git a/recipes/sdl_ttf/config.yml b/recipes/sdl_ttf/config.yml index 0db264b704044..be62a6c021ae5 100644 --- a/recipes/sdl_ttf/config.yml +++ b/recipes/sdl_ttf/config.yml @@ -1,4 +1,6 @@ versions: + "2.20.2": + folder: all "2.20.1": folder: all "2.0.18": diff --git a/recipes/seadex-essentials/all/conanfile.py b/recipes/seadex-essentials/all/conanfile.py index e938a5f24cf68..a316b2670766b 100644 --- a/recipes/seadex-essentials/all/conanfile.py +++ b/recipes/seadex-essentials/all/conanfile.py @@ -39,7 +39,7 @@ def _compilers_minimum_version(self): "Visual Studio": "16", "msvc": "192", "apple-clang": "10" - } + } def config_options(self): if self.settings.os == "Windows": @@ -48,14 +48,12 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - self.options["fmt/*"].header_only = True - self.options["spdlog/*"].header_only = True def requirements(self): # Headers are exposed https://github.com/SeadexGmbH/essentials/blob/622a07dc1530f5668f5dde0ce18007d420c371cd/essentials/include/essentials/log/log_level.hpp#L15 self.requires("spdlog/1.11.0", transitive_headers=True) # Exposes headers and symbols https://github.com/SeadexGmbH/essentials/blob/622a07dc1530f5668f5dde0ce18007d420c371cd/essentials/include/essentials/type_wrapper.hpp#L282 - self.requires("fmt/9.1.0", transitive_headers=True, transitive_libs=True) + self.requires("fmt/10.0.0", transitive_headers=True, transitive_libs=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/seadex-genesis/all/conandata.yml b/recipes/seadex-genesis/all/conandata.yml new file mode 100644 index 0000000000000..176a61239e9e8 --- /dev/null +++ b/recipes/seadex-genesis/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "2.0.0": + url: + - "https://github.com/SeadexGmbH/genesis/archive/refs/tags/2.0.0.tar.gz" + sha256: "22bd4e438c1475d7b023d6f8f7d541f49f55784c89e8607acc68a73157bb4ea4" diff --git a/recipes/seadex-genesis/all/conanfile.py b/recipes/seadex-genesis/all/conanfile.py new file mode 100644 index 0000000000000..55649339605a9 --- /dev/null +++ b/recipes/seadex-genesis/all/conanfile.py @@ -0,0 +1,92 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class SeadexGenesisConan(ConanFile): + name = "seadex-genesis" + description = "genesis is a generator library developed by Seadex (written in C++11)." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://genesis.seadex.de/" + topics = ("generator", "c++") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8.3", + "clang": "12", + "Visual Studio": "16", + "msvc": "192", + "apple-clang": "10" + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def requirements(self): + # Exposes headers and symbols: https://github.com/SeadexGmbH/genesis/blob/master/genesis/source/version.cpp + self.requires("fmt/10.0.0", transitive_headers=True, transitive_libs=True) + self.requires("seadex-essentials/2.1.3", transitive_headers=True, transitive_libs=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["GEN_BUILD_EXAMPLES"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", self.source_folder, os.path.join(self.package_folder, "licenses") ) + cmake = CMake(self) + cmake.configure() + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["genesis"] diff --git a/recipes/seadex-genesis/all/test_package/CMakeLists.txt b/recipes/seadex-genesis/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..028f0b497eb5e --- /dev/null +++ b/recipes/seadex-genesis/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(seadex-genesis REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PUBLIC seadex-genesis::seadex-genesis) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/seadex-genesis/all/test_package/conanfile.py b/recipes/seadex-genesis/all/test_package/conanfile.py new file mode 100644 index 0000000000000..63dab6b31486d --- /dev/null +++ b/recipes/seadex-genesis/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/seadex-genesis/all/test_package/test_package.cpp b/recipes/seadex-genesis/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..48dc86c10dbd5 --- /dev/null +++ b/recipes/seadex-genesis/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include "genesis/grammar.hpp" + + +int main() { + + std::cout<< sx::genesis::LOOP_START_COMMAND << " test " << sx::genesis::LOOP_END_COMMAND << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/seadex-genesis/all/test_v1_package/CMakeLists.txt b/recipes/seadex-genesis/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/seadex-genesis/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/seadex-genesis/all/test_v1_package/conanfile.py b/recipes/seadex-genesis/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/seadex-genesis/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +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/seadex-genesis/config.yml b/recipes/seadex-genesis/config.yml new file mode 100644 index 0000000000000..d77ad03cbf510 --- /dev/null +++ b/recipes/seadex-genesis/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.0": + folder: all diff --git a/recipes/sentry-breakpad/all/conandata.yml b/recipes/sentry-breakpad/all/conandata.yml index 21ccf617970ea..ced5e36dba275 100644 --- a/recipes/sentry-breakpad/all/conandata.yml +++ b/recipes/sentry-breakpad/all/conandata.yml @@ -1,13 +1,13 @@ sources: - "0.6.2": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.2/sentry-native.zip" - sha256: "9b9f4b2cec961ca132039c7887fb876b3dd6f4795b31ca01d188187f69758efa" - "0.6.1": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.1/sentry-native.zip" - sha256: "47527a3513db141affb8af28a0b8d886f78348a65acd2110d7eed936e3d82954" - "0.6.0": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.0/sentry-native.zip" - sha256: "ae03c9c8487794cd0f6d7fb7bb9b3c13e1a253190b290eaf752e2b4f007fd089" + "0.6.5": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.5/sentry-native.zip" + sha256: "5f74a5c5c3abc6e1e7825d3306be9e3b3fd4e0f586f3cf7e86607d6f56a71995" + "0.6.4": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.4/sentry-native.zip" + sha256: "e00278bf9a4821bb4008985a5a552a84aba6ebb06d3f9e828082fcbf06b04a38" + "0.6.3": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.3/sentry-native.zip" + sha256: "6b515c17a9b860ea47c6a5fd7abdfdc89b4b8cbc654c23a8bb42a39bfcb87ad9" "0.5.4": url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" diff --git a/recipes/sentry-breakpad/config.yml b/recipes/sentry-breakpad/config.yml index 2e0e20ffce3ff..3450228c14b09 100644 --- a/recipes/sentry-breakpad/config.yml +++ b/recipes/sentry-breakpad/config.yml @@ -1,9 +1,9 @@ versions: - "0.6.2": + "0.6.5": folder: all - "0.6.1": + "0.6.4": folder: all - "0.6.0": + "0.6.3": folder: all "0.5.4": folder: all diff --git a/recipes/sentry-crashpad/all/conandata.yml b/recipes/sentry-crashpad/all/conandata.yml index 2bf59ee52fc8f..ced5e36dba275 100644 --- a/recipes/sentry-crashpad/all/conandata.yml +++ b/recipes/sentry-crashpad/all/conandata.yml @@ -1,10 +1,13 @@ sources: - "0.6.1": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.1/sentry-native.zip" - sha256: "47527a3513db141affb8af28a0b8d886f78348a65acd2110d7eed936e3d82954" - "0.6.0": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.0/sentry-native.zip" - sha256: "ae03c9c8487794cd0f6d7fb7bb9b3c13e1a253190b290eaf752e2b4f007fd089" + "0.6.5": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.5/sentry-native.zip" + sha256: "5f74a5c5c3abc6e1e7825d3306be9e3b3fd4e0f586f3cf7e86607d6f56a71995" + "0.6.4": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.4/sentry-native.zip" + sha256: "e00278bf9a4821bb4008985a5a552a84aba6ebb06d3f9e828082fcbf06b04a38" + "0.6.3": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.3/sentry-native.zip" + sha256: "6b515c17a9b860ea47c6a5fd7abdfdc89b4b8cbc654c23a8bb42a39bfcb87ad9" "0.5.4": url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" diff --git a/recipes/sentry-crashpad/all/conanfile.py b/recipes/sentry-crashpad/all/conanfile.py index cd2118a3e0d3c..645ba8aaf554d 100644 --- a/recipes/sentry-crashpad/all/conanfile.py +++ b/recipes/sentry-crashpad/all/conanfile.py @@ -8,7 +8,7 @@ import os -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.53.0" class SentryCrashpadConan(ConanFile): @@ -18,9 +18,8 @@ class SentryCrashpadConan(ConanFile): homepage = "https://github.com/getsentry/sentry-native" license = "Apache-2.0" topics = ("crashpad", "error-reporting", "crash-reporting") - provides = "crashpad", "mini_chromium" - + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -41,6 +40,7 @@ def _is_mingw(self): def _minimum_compilers_version(self): return { "Visual Studio": "16", + "msvc": "191", "gcc": "6", "clang": "3.4", "apple-clang": "5.1", @@ -62,9 +62,9 @@ def build_requirements(self): def requirements(self): self.requires("zlib/1.2.13") if self.settings.os in ("Linux", "FreeBSD"): - self.requires("libcurl/7.87.0") + self.requires("libcurl/8.1.2") if self.options.get_safe("with_tls"): - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -144,6 +144,7 @@ def package_info(self): self.cpp_info.components["crashpad_util"].requires = ["crashpad_compat", "crashpad_mini_chromium", "zlib::zlib"] if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.components["crashpad_util"].system_libs.extend(["pthread", "rt"]) + # Requires libcurl https://github.com/getsentry/crashpad/blob/2237d97ee2c38c930c07001e660be57324f69a37/util/CMakeLists.txt#L256 self.cpp_info.components["crashpad_util"].requires.extend(["libcurl::libcurl"]) elif self.settings.os == "Windows": self.cpp_info.components["crashpad_util"].system_libs.append("winhttp") diff --git a/recipes/sentry-crashpad/all/test_package/CMakeLists.txt b/recipes/sentry-crashpad/all/test_package/CMakeLists.txt index a9feb3cd284f7..f90e3b77e86ad 100644 --- a/recipes/sentry-crashpad/all/test_package/CMakeLists.txt +++ b/recipes/sentry-crashpad/all/test_package/CMakeLists.txt @@ -4,6 +4,10 @@ project(test_package CXX) find_package(crashpad REQUIRED CONFIG) +if(HAS_PROXY) + add_compile_definitions(HAS_PROXY) +endif() + add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE crashpad::client) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/sentry-crashpad/all/test_package/conanfile.py b/recipes/sentry-crashpad/all/test_package/conanfile.py index 3a9d92c6be51d..7088406970539 100644 --- a/recipes/sentry-crashpad/all/test_package/conanfile.py +++ b/recipes/sentry-crashpad/all/test_package/conanfile.py @@ -1,13 +1,14 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.files import mkdir -from conan.tools.cmake import cmake_layout, CMake +from conan.tools.files import mkdir, save, load +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +from conan.tools.scm import Version import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" def requirements(self): @@ -16,6 +17,14 @@ def requirements(self): def layout(self): cmake_layout(self) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["HAS_PROXY"] = Version(self.dependencies[self.tested_reference_str].ref.version) > "0.6.2" + tc.generate() + handler_exe = "crashpad_handler.exe" if self.settings.os == "Windows" else "crashpad_handler" + handler_bin_path = os.path.join(self.dependencies[self.tested_reference_str].package_folder, "bin", handler_exe) + save(self, os.path.join(self.build_folder, "handler_bin_path"), handler_bin_path) + def build(self): cmake = CMake(self) cmake.configure() @@ -26,6 +35,5 @@ def test(self): test_env_dir = "test_env" mkdir(self, test_env_dir) bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - handler_exe = "crashpad_handler.exe" if self.settings.os == "Windows" else "crashpad_handler" - handler_bin_path = os.path.join(self.deps_cpp_info["sentry-crashpad"].bin_paths[0], handler_exe) - self.run(f"{bin_path} {test_env_dir} {handler_bin_path}", run_environment=True) + handler_bin_path = load(self, os.path.join(self.build_folder, "handler_bin_path")) + self.run(f"{bin_path} {test_env_dir} {handler_bin_path}", env="conanrun") diff --git a/recipes/sentry-crashpad/all/test_package/test_package.cpp b/recipes/sentry-crashpad/all/test_package/test_package.cpp index 8f5ca824f1a03..e968f17053dfa 100644 --- a/recipes/sentry-crashpad/all/test_package/test_package.cpp +++ b/recipes/sentry-crashpad/all/test_package/test_package.cpp @@ -21,6 +21,9 @@ bool startCrashpad(const base::FilePath &db, db, db, url, +#ifdef HAS_PROXY + "", +#endif annotations, arguments, true, diff --git a/recipes/sentry-crashpad/all/test_v1_package/conanfile.py b/recipes/sentry-crashpad/all/test_v1_package/conanfile.py index 07143b37b946f..62bd626cd935e 100644 --- a/recipes/sentry-crashpad/all/test_v1_package/conanfile.py +++ b/recipes/sentry-crashpad/all/test_v1_package/conanfile.py @@ -1,6 +1,7 @@ from conans import ConanFile, CMake from conan.tools.build import cross_building from conan.tools.files import mkdir +from conan.tools.scm import Version import os @@ -10,6 +11,7 @@ class TestPackageV1Conan(ConanFile): def build(self): cmake = CMake(self) + cmake.definitions["HAS_PROXY"] = Version(self.deps_cpp_info["sentry-crashpad"].version) > "0.6.2" cmake.configure() cmake.build() diff --git a/recipes/sentry-crashpad/config.yml b/recipes/sentry-crashpad/config.yml index ea4872076354c..3450228c14b09 100644 --- a/recipes/sentry-crashpad/config.yml +++ b/recipes/sentry-crashpad/config.yml @@ -1,7 +1,9 @@ versions: - "0.6.1": + "0.6.5": folder: all - "0.6.0": + "0.6.4": + folder: all + "0.6.3": folder: all "0.5.4": folder: all diff --git a/recipes/sentry-native/all/conandata.yml b/recipes/sentry-native/all/conandata.yml index 29cda14cad1e6..17d89711effcc 100644 --- a/recipes/sentry-native/all/conandata.yml +++ b/recipes/sentry-native/all/conandata.yml @@ -1,19 +1,16 @@ sources: - "0.6.1": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.1/sentry-native.zip" - sha256: "47527a3513db141affb8af28a0b8d886f78348a65acd2110d7eed936e3d82954" - "0.6.0": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.0/sentry-native.zip" - sha256: "ae03c9c8487794cd0f6d7fb7bb9b3c13e1a253190b290eaf752e2b4f007fd089" + "0.6.4": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.4/sentry-native.zip" + sha256: "e00278bf9a4821bb4008985a5a552a84aba6ebb06d3f9e828082fcbf06b04a38" + "0.6.3": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.3/sentry-native.zip" + sha256: "6b515c17a9b860ea47c6a5fd7abdfdc89b4b8cbc654c23a8bb42a39bfcb87ad9" + "0.6.2": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.2/sentry-native.zip" + sha256: "9b9f4b2cec961ca132039c7887fb876b3dd6f4795b31ca01d188187f69758efa" "0.5.4": url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" "0.4.18": url: "https://github.com/getsentry/sentry-native/releases/download/0.4.18/sentry-native.zip" sha256: "41fdf6499cd8576142beb03104badcc9e0b80b8ef27080ca71cd4408cc1d7ece" -patches: - "0.6.0": - - patch_file: "patches/sentry-native-903c17a.patch" - patch_description: "Make it possible to build with support for the crashpad WER module while using the sentry-crashpad package" - patch_type: "official" - patch_source: "https://github.com/getsentry/sentry-native/pull/816" diff --git a/recipes/sentry-native/all/conanfile.py b/recipes/sentry-native/all/conanfile.py index 888d98c0fe1ef..faa6d8ed510e7 100644 --- a/recipes/sentry-native/all/conanfile.py +++ b/recipes/sentry-native/all/conanfile.py @@ -4,8 +4,9 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv -from conan.tools.files import copy, get, rm, rmdir, export_conandata_patches, apply_conandata_patches +from conan.tools.files import copy, get, rm, rmdir from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os @@ -49,6 +50,8 @@ class SentryNativeConan(ConanFile): @property def _min_cppstd(self): + if is_msvc(self): + return "17" return "14" @property @@ -61,9 +64,6 @@ def _minimum_compilers_version(self): "apple-clang": "5.1", } - def export_sources(self): - export_conandata_patches(self) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -103,7 +103,7 @@ def layout(self): def requirements(self): if self.options.transport == "curl": - self.requires("libcurl/7.87.0") + self.requires("libcurl/8.0.1") if self.options.backend == "crashpad": if self.options.with_crashpad == "sentry": self.requires(f"sentry-crashpad/{self.version}") @@ -115,8 +115,8 @@ def requirements(self): if self.options.with_breakpad == "google": self.requires("breakpad/cci.20210521") if self.options.get_safe("qt"): - self.requires("qt/5.15.8") - self.requires("openssl/1.1.1t") + self.requires("qt/5.15.9") + self.requires("openssl/[>=1.1 <4]") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -132,20 +132,9 @@ def validate(self): if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "10.0": raise ConanInvalidConfiguration("apple-clang < 10.0 not supported") - def _cmake_new_enough(self, required_version): - try: - import re - from io import StringIO - output = StringIO() - self.run("cmake --version", output) - m = re.search(r"cmake version (\d+\.\d+\.\d+)", output.getvalue()) - return Version(m.group(1)) >= required_version - except: - return False - def build_requirements(self): - if self.settings.os == "Windows" and not self._cmake_new_enough("3.16.4"): - self.tool_requires("cmake/3.25.2") + if self.settings.os == "Windows": + self.tool_requires("cmake/[>=3.16.4 <4]") if self.options.backend == "breakpad": if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/1.9.3") @@ -162,6 +151,8 @@ def generate(self): tc.variables["SENTRY_ENABLE_INSTALL"] = True tc.variables["SENTRY_TRANSPORT"] = self.options.transport tc.variables["SENTRY_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["SENTRY_BUILD_TESTS"] = False + tc.variables["SENTRY_BUILD_EXAMPLES"] = False tc.variables["SENTRY_INTEGRATION_QT"] = self.options.qt if self.options.get_safe("wer", False): tc.variables["CRASHPAD_WER_ENABLED"] = True @@ -171,7 +162,6 @@ def generate(self): PkgConfigDeps(self).generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/sentry-native/all/patches/sentry-native-903c17a.patch b/recipes/sentry-native/all/patches/sentry-native-903c17a.patch deleted file mode 100644 index ea2ffd463a7ad..0000000000000 --- a/recipes/sentry-native/all/patches/sentry-native-903c17a.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 903c17ae20888679caab1871cc74de577509452e Mon Sep 17 00:00:00 2001 -From: Cyriuz -Date: Mon, 13 Mar 2023 14:55:26 +0100 -Subject: [PATCH] Allow setting CRASHPAD_WER_ENABLED when using system crashpad - (#816) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 831e8e1..aeea09f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -426,8 +426,9 @@ if(SENTRY_BACKEND_CRASHPAD) - set(CRASHPAD_ENABLE_INSTALL ON CACHE BOOL "Enable crashpad installation" FORCE) - endif() - add_subdirectory(external/crashpad crashpad_build) -+ - if(CRASHPAD_WER_ENABLED) -- add_compile_definitions(CRASHPAD_WER_ENABLED) -+ add_dependencies(sentry crashpad::wer) - endif() - - # set static runtime if enabled -@@ -482,8 +483,9 @@ if(SENTRY_BACKEND_CRASHPAD) - endif() - endif() - add_dependencies(sentry crashpad::handler) -+ - if(CRASHPAD_WER_ENABLED) -- add_dependencies(sentry crashpad::wer) -+ add_compile_definitions(CRASHPAD_WER_ENABLED) - endif() - elseif(SENTRY_BACKEND_BREAKPAD) - option(SENTRY_BREAKPAD_SYSTEM "Use system breakpad" OFF) --- -2.39.1.windows.1 diff --git a/recipes/sentry-native/config.yml b/recipes/sentry-native/config.yml index ea4872076354c..fb99bc2eb64b8 100644 --- a/recipes/sentry-native/config.yml +++ b/recipes/sentry-native/config.yml @@ -1,7 +1,9 @@ versions: - "0.6.1": + "0.6.4": folder: all - "0.6.0": + "0.6.3": + folder: all + "0.6.2": folder: all "0.5.4": folder: all diff --git a/recipes/serdepp/all/conanfile.py b/recipes/serdepp/all/conanfile.py index 539c3a27d063b..3a9cae70272de 100644 --- a/recipes/serdepp/all/conanfile.py +++ b/recipes/serdepp/all/conanfile.py @@ -1,21 +1,26 @@ import os -from conans.errors import ConanInvalidConfiguration -from conans import ConanFile, tools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class SerdeppConan(ConanFile): name = "serdepp" description = "c++ serialize and deserialize adaptor library like rust serde.rs" license = "MIT" - topics = ("yaml", "toml", "serialization", "json", "reflection") - homepage = "https://github.com/injae/serdepp" url = "https://github.com/conan-io/conan-center-index" - settings = "arch", "build_type", "compiler", "os" + homepage = "https://github.com/injae/serdepp" + topics = ("yaml", "toml", "serialization", "json", "reflection", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" options = { - # keeping the option in case upstream support dynamic linking "with_nlohmann_json": [True, False], "with_rapidjson": [True, False], "with_fmt": [True, False], @@ -32,16 +37,8 @@ class SerdeppConan(ConanFile): no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, - strip_root=True) - - def package_id(self): - self.info.header_only() + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -52,48 +49,62 @@ def _compilers_minimum_version(self): "apple-clang": "10", } + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("nameof/0.10.1") + self.requires("magic_enum/0.7.3") + if self.options.with_toml11: + self.requires("toml11/3.7.0") + if self.options.with_yamlcpp: + self.requires("yaml-cpp/0.7.0") + if self.options.with_rapidjson: + self.requires("rapidjson/1.1.0") + if self.options.with_fmt: + self.requires("fmt/8.1.1") + if self.options.with_nlohmann_json: + self.requires("nlohmann_json/3.10.5") + + def package_id(self): + self.info.clear() + def validate(self): compiler = self.settings.compiler if compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") + check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if not minimum_version: - self.output.warn(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif tools.Version(self.settings.compiler.version) < minimum_version: + self.output.warning(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration(f"{self.name} requires a compiler that supports at least C++17") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def package(self): - s = lambda x: os.path.join(self._source_subfolder, x) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - include = os.path.join('include', 'serdepp') - self.copy('*.hpp', dst=include, src=s(include)) - attribute = os.path.join(include, 'attribute') - self.copy('*.hpp', dst=attribute, src=s(attribute)) - adaptor = os.path.join(include, 'adaptor') - self.copy('reflection.hpp', dst=adaptor, src=s(adaptor)) - self.copy('sstream.hpp', dst=adaptor, src=s(adaptor)) + s = lambda x: os.path.join(self.source_folder, x) + p = lambda x: os.path.join(self.package_folder, x) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + include = os.path.join("include", "serdepp") + copy(self, "*.hpp", dst=p(include), src=s(include)) + attribute = os.path.join(include, "attribute") + copy(self, "*.hpp", dst=p(attribute), src=s(attribute)) + adaptor = os.path.join(include, "adaptor") + copy(self, "reflection.hpp", dst=p(adaptor), src=s(adaptor)) + copy(self, "sstream.hpp", dst=p(adaptor), src=s(adaptor)) if self.options.with_toml11: - self.copy('toml11.hpp', dst=adaptor, src=s(adaptor)) + copy(self, "toml11.hpp", dst=p(adaptor), src=s(adaptor)) if self.options.with_yamlcpp: - self.copy('yaml-cpp.hpp', dst=adaptor, src=s(adaptor)) + copy(self, "yaml-cpp.hpp", dst=p(adaptor), src=s(adaptor)) if self.options.with_rapidjson: - self.copy('rapidjson.hpp', dst=adaptor, src=s(adaptor)) + copy(self, "rapidjson.hpp", dst=p(adaptor), src=s(adaptor)) if self.options.with_fmt: - self.copy('fmt.hpp', dst=adaptor, src=s(adaptor)) + copy(self, "fmt.hpp", dst=p(adaptor), src=s(adaptor)) if self.options.with_nlohmann_json: - self.copy('nlohmann_json.hpp', dst=adaptor, src=s(adaptor)) + copy(self, "nlohmann_json.hpp", dst=p(adaptor), src=s(adaptor)) - def requirements(self): - self.requires("nameof/0.10.1") - self.requires("magic_enum/0.7.3") - if self.options.with_toml11: - self.requires("toml11/3.7.0") - if self.options.with_yamlcpp: - self.requires("yaml-cpp/0.7.0") - if self.options.with_rapidjson: - self.requires("rapidjson/1.1.0") - if self.options.with_fmt: - self.requires("fmt/8.1.1") - if self.options.with_nlohmann_json: - self.requires("nlohmann_json/3.10.5") + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/serdepp/all/test_package/CMakeLists.txt b/recipes/serdepp/all/test_package/CMakeLists.txt index a4620c9ed66c9..f8c810f0f3968 100644 --- a/recipes/serdepp/all/test_package/CMakeLists.txt +++ b/recipes/serdepp/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(serdepp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/serdepp/all/test_package/conanfile.py b/recipes/serdepp/all/test_package/conanfile.py index e788460ad0765..fae501d0afb9e 100644 --- a/recipes/serdepp/all/test_package/conanfile.py +++ b/recipes/serdepp/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/serdepp/all/test_package/test_package.cpp b/recipes/serdepp/all/test_package/test_package.cpp index 427fde86f750f..c7b4aeafe407d 100644 --- a/recipes/serdepp/all/test_package/test_package.cpp +++ b/recipes/serdepp/all/test_package/test_package.cpp @@ -1,7 +1,9 @@ -#include -#include #include #include + +#include +#include + class test { public: template diff --git a/recipes/serdepp/all/test_v1_package/CMakeLists.txt b/recipes/serdepp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/serdepp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/serdepp/all/test_v1_package/conanfile.py b/recipes/serdepp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e788460ad0765 --- /dev/null +++ b/recipes/serdepp/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", "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/sfml/all/conandata.yml b/recipes/sfml/all/conandata.yml index 58f8c7d9b6cc4..500295e6f5faf 100644 --- a/recipes/sfml/all/conandata.yml +++ b/recipes/sfml/all/conandata.yml @@ -1,22 +1,41 @@ sources: + "2.6.0": + url: "https://www.sfml-dev.org/files/SFML-2.6.0-sources.zip" + sha256: "dc477fc7266641709046bd38628c909f5748bd2564b388cf6c750a9e20cdfef1" "2.5.1": url: "https://www.sfml-dev.org/files/SFML-2.5.1-sources.zip" sha256: "bf1e0643acb92369b24572b703473af60bac82caf5af61e77c063b779471bb7f" patches: + "2.6.0": + - patch_file: "patches/2.6.0-0001-cmake-robust-find-deps.patch" + patch_description: "Robust discovery of dependencies" + patch_type: "conan" + - patch_file: "patches/2.6.0-0003-allow-shared-MT.patch" + patch_description: "Allow to build shared SFML with MT runtime" + patch_type: "portability" + - patch_file: "patches/2.6.0-0004-fix-ios.patch" + patch_description: "Fix iOS detection logic in CMakeLists" + patch_type: "portability" + - patch_file: "patches/2.6.0-0006-disable-warning-flags.patch" + patch_description: "Disable warning flags which may cause compilation errors" + patch_type: "portability" + - patch_file: "patches/2.6.0-0007-use-cci-minimp3.patch" + patch_description: "use cci minimp3 recipe" + patch_type: "conan" "2.5.1": - - patch_file: "patches/0001-cmake-robust-find-deps.patch" + - patch_file: "patches/2.5.1-0001-cmake-robust-find-deps.patch" patch_description: "Robust discovery of dependencies" patch_type: "conan" - - patch_file: "patches/0002-allow-non-x86-64-macos.patch" + - patch_file: "patches/2.5.1-0002-allow-non-x86-64-macos.patch" patch_description: "Allow compilation for macOS arm" patch_type: "portability" - - patch_file: "patches/0003-allow-shared-MT.patch" + - patch_file: "patches/2.5.1-0003-allow-shared-MT.patch" patch_description: "Allow to build shared SFML with MT runtime" patch_type: "portability" - - patch_file: "patches/0004-fix-ios.patch" + - patch_file: "patches/2.5.1-0004-fix-ios.patch" patch_description: "Fix iOS detection logic in CMakeLists" patch_type: "portability" - - patch_file: "patches/0005-remove-auto-ptr.patch" + - patch_file: "patches/2.5.1-0005-remove-auto-ptr.patch" patch_description: "Remove usage of auto_ptr to allow compilation with C++17 standard" patch_type: "portability" patch_source: "https://github.com/SFML/SFML/commit/bf92efe9a4035fee0258386173d53556aa196e49" diff --git a/recipes/sfml/all/conanfile.py b/recipes/sfml/all/conanfile.py index 18f3ab2ca1e58..87a8da53f965f 100644 --- a/recipes/sfml/all/conanfile.py +++ b/recipes/sfml/all/conanfile.py @@ -2,8 +2,9 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, save +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, save, copy from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os import textwrap @@ -52,6 +53,7 @@ def layout(self): def requirements(self): if self.options.window: + # FIXME: use cci's glad if self.settings.os in ["Windows", "Linux", "FreeBSD", "Macos"]: self.requires("opengl/system") if self.settings.os == "Linux": @@ -64,6 +66,8 @@ def requirements(self): self.requires("flac/1.4.2") self.requires("openal-soft/1.22.2") self.requires("vorbis/1.3.7") + if Version(self.version) >= "2.6.0": + self.requires("minimp3/cci.20211201") def validate(self): if self.settings.os not in ["Windows", "Linux", "FreeBSD", "Android", "Macos", "iOS"]: @@ -73,7 +77,9 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - rmdir(self, os.path.join(self.source_folder, "extlibs")) + # sfml/2.6.0 uses minimp3 and glad in extlibs + if Version(self.version) < "2.6.0": + rmdir(self, os.path.join(self.source_folder, "extlibs")) def generate(self): tc = CMakeToolchain(self) @@ -86,6 +92,9 @@ def generate(self): tc.variables["SFML_INSTALL_PKGCONFIG_FILES"] = False tc.variables["SFML_GENERATE_PDB"] = False tc.variables["SFML_USE_SYSTEM_DEPS"] = True + tc.variables["WARNINGS_AS_ERRORS"] = False + if Version(self.version) >= "2.6.0": + tc.variables["CMAKE_CXX_STANDARD"] = 11 if is_msvc(self): tc.variables["SFML_USE_STATIC_STD_LIBS"] = is_msvc_static_runtime(self) tc.generate() @@ -99,9 +108,12 @@ def build(self): cmake.build() def package(self): + if Version(self.version) >= "2.6.0": + copy(self, pattern="license.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( @@ -168,6 +180,9 @@ def carbon(): def iokit(): return ["IOKit"] if self.settings.os == "Macos" else [] + def coreservices(): + return ["CoreServices"] if self.settings.os == "Macos" else [] + def coregraphics(): return ["CoreGraphics"] if self.settings.os == "iOS" else [] @@ -189,6 +204,9 @@ def opengles_android(): def opengles_ios(): return ["OpenGLES"] if self.settings.os == "iOS" else [] + def objc(): + return ["-ObjC"] if not self.options.shared and self.settings.os == "Macos" else [] + suffix = "" if self.options.shared else "-s" suffix += "-d" if self.settings.build_type == "Debug" else "" @@ -220,7 +238,8 @@ def opengles_ios(): "system_libs": gdi32() + winmm() + usbhid() + android() + opengles_android(), "frameworks": foundation() + appkit() + iokit() + carbon() + uikit() + coregraphics() + quartzcore() + - coremotion() + opengles_ios(), + coreservices() + coremotion() + opengles_ios(), + "exelinkflags": objc(), }, }) if self.options.graphics: @@ -241,11 +260,14 @@ def opengles_ios(): }, }) if self.options.audio: + audio_requires = ["system", "flac::flac", "openal-soft::openal-soft", "vorbis::vorbis"] + if Version(self.version) >= "2.6.0": + audio_requires.append("minimp3::minimp3") sfml_components.update({ "audio": { "target": "sfml-audio", "libs": [f"sfml-audio{suffix}"], - "requires": ["system", "flac::flac", "openal-soft::openal-soft", "vorbis::vorbis"], + "requires": audio_requires, "system_libs": android(), }, }) @@ -264,6 +286,7 @@ def _register_components(components): requires = values.get("requires", []) system_libs = values.get("system_libs", []) frameworks = values.get("frameworks", []) + exelinkflags = values.get("exelinkflags", []) # TODO: Properly model COMPONENTS names in CMakeDeps for find_package() call # (see https://github.com/conan-io/conan/issues/10258) # It should be: @@ -277,6 +300,7 @@ def _register_components(components): self.cpp_info.components[component].requires = requires self.cpp_info.components[component].system_libs = system_libs self.cpp_info.components[component].frameworks = frameworks + self.cpp_info.components[component].exelinkflags = exelinkflags # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.components[component].build_modules["cmake_find_package"] = [self._module_file_rel_path] diff --git a/recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch b/recipes/sfml/all/patches/2.5.1-0001-cmake-robust-find-deps.patch similarity index 100% rename from recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch rename to recipes/sfml/all/patches/2.5.1-0001-cmake-robust-find-deps.patch diff --git a/recipes/sfml/all/patches/0002-allow-non-x86-64-macos.patch b/recipes/sfml/all/patches/2.5.1-0002-allow-non-x86-64-macos.patch similarity index 100% rename from recipes/sfml/all/patches/0002-allow-non-x86-64-macos.patch rename to recipes/sfml/all/patches/2.5.1-0002-allow-non-x86-64-macos.patch diff --git a/recipes/sfml/all/patches/0003-allow-shared-MT.patch b/recipes/sfml/all/patches/2.5.1-0003-allow-shared-MT.patch similarity index 100% rename from recipes/sfml/all/patches/0003-allow-shared-MT.patch rename to recipes/sfml/all/patches/2.5.1-0003-allow-shared-MT.patch diff --git a/recipes/sfml/all/patches/0004-fix-ios.patch b/recipes/sfml/all/patches/2.5.1-0004-fix-ios.patch similarity index 100% rename from recipes/sfml/all/patches/0004-fix-ios.patch rename to recipes/sfml/all/patches/2.5.1-0004-fix-ios.patch diff --git a/recipes/sfml/all/patches/0005-remove-auto-ptr.patch b/recipes/sfml/all/patches/2.5.1-0005-remove-auto-ptr.patch similarity index 100% rename from recipes/sfml/all/patches/0005-remove-auto-ptr.patch rename to recipes/sfml/all/patches/2.5.1-0005-remove-auto-ptr.patch diff --git a/recipes/sfml/all/patches/2.6.0-0001-cmake-robust-find-deps.patch b/recipes/sfml/all/patches/2.6.0-0001-cmake-robust-find-deps.patch new file mode 100644 index 0000000000000..1e4a21511eb3b --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0001-cmake-robust-find-deps.patch @@ -0,0 +1,57 @@ +diff --git a/src/SFML/Audio/CMakeLists.txt b/src/SFML/Audio/CMakeLists.txt +index d27dc6d..27c3386 100644 +--- a/src/SFML/Audio/CMakeLists.txt ++++ b/src/SFML/Audio/CMakeLists.txt +@@ -69,19 +69,17 @@ endif() + + # find external libraries + sfml_find_package(OpenAL INCLUDE "OPENAL_INCLUDE_DIR" LINK "OPENAL_LIBRARY") +-sfml_find_package(VORBIS INCLUDE "VORBIS_INCLUDE_DIRS" LINK "VORBIS_LIBRARIES") ++sfml_find_package(Vorbis INCLUDE "VORBIS_INCLUDE_DIRS" LINK "VORBIS_LIBRARIES") + sfml_find_package(FLAC INCLUDE "FLAC_INCLUDE_DIR" LINK "FLAC_LIBRARY") + + # avoids warnings in vorbisfile.h +-target_compile_definitions(VORBIS INTERFACE "OV_EXCLUDE_STATIC_CALLBACKS") +-target_compile_definitions(FLAC INTERFACE "FLAC__NO_DLL") + + # define the sfml-audio target + sfml_add_library(sfml-audio + SOURCES ${SRC} ${CODECS_SRC}) + + # setup dependencies +-target_link_libraries(sfml-audio PRIVATE OpenAL) ++target_link_libraries(sfml-audio PRIVATE OpenAL::OpenAL) + + # minimp3 sources + target_include_directories(sfml-audio SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/minimp3") +@@ -92,4 +90,4 @@ endif() + + target_link_libraries(sfml-audio + PUBLIC sfml-system +- PRIVATE VORBIS FLAC) ++ PRIVATE Vorbis::vorbisenc Vorbis::vorbisfile FLAC::FLAC) +diff --git a/src/SFML/Graphics/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt +index a939a98..bd6a89b 100644 +--- a/src/SFML/Graphics/CMakeLists.txt ++++ b/src/SFML/Graphics/CMakeLists.txt +@@ -93,7 +93,8 @@ sfml_add_library(sfml-graphics + target_link_libraries(sfml-graphics PUBLIC sfml-window) + + # stb_image sources +-target_include_directories(sfml-graphics SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/stb_image") ++find_package(stb REQUIRED CONFIG) ++target_link_libraries(sfml-graphics PRIVATE stb::stb) + + # glad sources + target_include_directories(sfml-graphics SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/glad/include") +@@ -123,8 +124,8 @@ if((SFML_COMPILER_MSVC AND SFML_MSVC_VERSION GREATER_EQUAL 14) OR (SFML_COMPILER + target_link_libraries(sfml-graphics PRIVATE legacy_stdio_definitions.lib) + endif() + +-sfml_find_package(Freetype INCLUDE "FREETYPE_INCLUDE_DIRS" LINK "FREETYPE_LIBRARY") +-target_link_libraries(sfml-graphics PRIVATE Freetype) ++find_package(freetype REQUIRED) ++target_link_libraries(sfml-graphics PRIVATE freetype) + + # add preprocessor symbols + target_compile_definitions(sfml-graphics PRIVATE "STBI_FAILURE_USERMSG") diff --git a/recipes/sfml/all/patches/2.6.0-0003-allow-shared-MT.patch b/recipes/sfml/all/patches/2.6.0-0003-allow-shared-MT.patch new file mode 100644 index 0000000000000..59b4bbd230de7 --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0003-allow-shared-MT.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9e3f89d..003857e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -223,7 +223,7 @@ if(SFML_OS_WINDOWS) + sfml_set_option(SFML_USE_STATIC_STD_LIBS FALSE BOOL "TRUE to statically link to the standard libraries, FALSE to use them as DLLs") + + # the following combination of flags is not valid +- if(BUILD_SHARED_LIBS AND SFML_USE_STATIC_STD_LIBS) ++ if(0) + message(FATAL_ERROR "BUILD_SHARED_LIBS and SFML_USE_STATIC_STD_LIBS cannot be used together") + endif() + diff --git a/recipes/sfml/all/patches/2.6.0-0004-fix-ios.patch b/recipes/sfml/all/patches/2.6.0-0004-fix-ios.patch new file mode 100644 index 0000000000000..34b49a186218d --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0004-fix-ios.patch @@ -0,0 +1,28 @@ +diff --git a/cmake/Config.cmake b/cmake/Config.cmake +index 2ce5ac4..3cd3a07 100644 +--- a/cmake/Config.cmake ++++ b/cmake/Config.cmake +@@ -39,13 +39,12 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "^NetBSD$") + set(SFML_OS_NETBSD 1) + # don't use the OpenGL ES implementation on NetBSD + set(OPENGL_ES 0) +-elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") +- if(IOS) ++elseif(${CMAKE_SYSTEM_NAME} STREQUAL "iOS") + set(SFML_OS_IOS 1) + + # use the OpenGL ES implementation on iOS + set(OPENGL_ES 1) +- else() ++elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(SFML_OS_MACOSX 1) + + # don't use the OpenGL ES implementation on Mac OS X +@@ -58,7 +57,6 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + message(FATAL_ERROR "Unsupported version of OS X: ${MACOSX_VERSION_RAW}") + return() + endif() +- endif() + elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Android") + set(SFML_OS_ANDROID 1) + diff --git a/recipes/sfml/all/patches/2.6.0-0006-disable-warning-flags.patch b/recipes/sfml/all/patches/2.6.0-0006-disable-warning-flags.patch new file mode 100644 index 0000000000000..362c57e93365a --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0006-disable-warning-flags.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake +index e0118eb..85a7714 100644 +--- a/cmake/Macros.cmake ++++ b/cmake/Macros.cmake +@@ -66,8 +66,6 @@ macro(sfml_add_library target) + add_library(${target} ${THIS_SOURCES}) + endif() + +- set_file_warnings(${THIS_SOURCES}) +- + # define the export symbol of the module + string(REPLACE "-" "_" NAME_UPPER "${target}") + string(TOUPPER "${NAME_UPPER}" NAME_UPPER) +@@ -265,8 +263,6 @@ macro(sfml_add_example target) + add_executable(${target} ${target_input}) + endif() + +- set_file_warnings(${target_input}) +- + # set the debug suffix + set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) + diff --git a/recipes/sfml/all/patches/2.6.0-0007-use-cci-minimp3.patch b/recipes/sfml/all/patches/2.6.0-0007-use-cci-minimp3.patch new file mode 100644 index 0000000000000..d63dc230ed817 --- /dev/null +++ b/recipes/sfml/all/patches/2.6.0-0007-use-cci-minimp3.patch @@ -0,0 +1,14 @@ +diff --git a/src/SFML/Audio/CMakeLists.txt b/src/SFML/Audio/CMakeLists.txt +index 27c3386..6c455ca 100644 +--- a/src/SFML/Audio/CMakeLists.txt ++++ b/src/SFML/Audio/CMakeLists.txt +@@ -82,7 +82,8 @@ sfml_add_library(sfml-audio + target_link_libraries(sfml-audio PRIVATE OpenAL::OpenAL) + + # minimp3 sources +-target_include_directories(sfml-audio SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/minimp3") ++find_package(minimp3 REQUIRED CONFIG) ++target_include_directories(sfml-audio SYSTEM PRIVATE ${minimp3_INCLUDE_DIRS}) + + if(SFML_OS_ANDROID) + target_link_libraries(sfml-audio PRIVATE android OpenSLES) diff --git a/recipes/sfml/config.yml b/recipes/sfml/config.yml index eab83a303df52..a8b7c0e911e63 100644 --- a/recipes/sfml/config.yml +++ b/recipes/sfml/config.yml @@ -1,3 +1,5 @@ versions: + "2.6.0": + folder: all "2.5.1": folder: all diff --git a/recipes/simde/all/conandata.yml b/recipes/simde/all/conandata.yml new file mode 100644 index 0000000000000..c108fd42332f1 --- /dev/null +++ b/recipes/simde/all/conandata.yml @@ -0,0 +1,6 @@ +sources: + "0.7.6": + # A release tarball exists, but I want to use the archive tarball. + # Because the release tarball has only amalgatated(with lots of duplicate lines) header files. + url: "https://github.com/simd-everywhere/simde/archive/refs/tags/v0.7.6.tar.gz" + sha256: "c63e6c61392e324728da1c7e5de308cb31410908993a769594f5e21ff8de962b" diff --git a/recipes/simde/all/conanfile.py b/recipes/simde/all/conanfile.py new file mode 100644 index 0000000000000..9ede298cf49ed --- /dev/null +++ b/recipes/simde/all/conanfile.py @@ -0,0 +1,59 @@ +from conan import ConanFile +from conan.tools.files import copy, get, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +import os + +required_conan_version = ">=1.52.0" + + +class SIMEeConan(ConanFile): + name = "simde" + description = "Implementations of SIMD instruction sets for systems which don't natively support them." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/simd-everywhere/simde" + topics = ("neon", "avx", "sse", "simd", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def build_requirements(self): + self.tool_requires("meson/1.1.1") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = MesonToolchain(self) + tc.project_options["tests"] = False + tc.generate() + pkg = PkgConfigDeps(self) + pkg.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + meson = Meson(self) + meson.install() + + rmdir(self, os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("pkg_config_name", "SIMDe") diff --git a/recipes/simde/all/test_package/CMakeLists.txt b/recipes/simde/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..142cf36ac18b4 --- /dev/null +++ b/recipes/simde/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(simde REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE simde::simde) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/simde/all/test_package/conanfile.py b/recipes/simde/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/simde/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/simde/all/test_package/test_package.c b/recipes/simde/all/test_package/test_package.c new file mode 100644 index 0000000000000..7257838559828 --- /dev/null +++ b/recipes/simde/all/test_package/test_package.c @@ -0,0 +1,26 @@ +#include +#include + +int main(void) { + simde__m128i a = simde_mm_set_epi8( + INT8_C(-105), INT8_C(-116), INT8_C( -45), INT8_C(-102), + INT8_C( -3), INT8_C( 92), INT8_C( -99), INT8_C( 100), + INT8_C( 30), INT8_C(-115), INT8_C( 82), INT8_C( 84), + INT8_C(-106), INT8_C( 66), INT8_C(-107), INT8_C( 116) + ); + int la = 0; + simde__m128i b = simde_mm_set_epi8( + INT8_C( -89), INT8_C( 65), INT8_C( 68), INT8_C( -29), + INT8_C(-101), INT8_C( 113), INT8_C( -11), INT8_C( 53), + INT8_C( -5), INT8_C( -76), INT8_C( 28), INT8_C(-120), + INT8_C( 64), INT8_C( 43), INT8_C(-127), INT8_C( -44) + ); + int lb = 2; + int r = simde_mm_cmpestrs(a, la, b, lb, 0); + + if (r != 1) { + return 1; + } + + return 0; +} diff --git a/recipes/simde/config.yml b/recipes/simde/config.yml new file mode 100644 index 0000000000000..1d3599e3efc2e --- /dev/null +++ b/recipes/simde/config.yml @@ -0,0 +1,3 @@ +versions: + "0.7.6": + folder: all diff --git a/recipes/simdjson/all/conandata.yml b/recipes/simdjson/all/conandata.yml index afec1dc0cc483..68f7a88456dcd 100644 --- a/recipes/simdjson/all/conandata.yml +++ b/recipes/simdjson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.1": + url: "https://github.com/simdjson/simdjson/archive/v3.2.1.tar.gz" + sha256: "121206c9bfe972a2202a74d4cddb8cb0561932427f96d6c4b70fb49a2a74560e" "3.2.0": url: "https://github.com/simdjson/simdjson/archive/v3.2.0.tar.gz" sha256: "75a684dbbe38cf72b8b3bdbdc430764813f3615899a6029931c26ddd89812da4" @@ -20,24 +23,12 @@ sources: "3.0.1": url: "https://github.com/simdjson/simdjson/archive/v3.0.1.tar.gz" sha256: "156b1bc5eb0561b2bd166b46d191fd3d95a3e709cc63761477d3b7aec2b6e9ed" - "3.0.0": - url: "https://github.com/simdjson/simdjson/archive/v3.0.0.tar.gz" - sha256: "e6dd4bfaad2fd9599e6a026476db39a3bb9529436d3508ac3ae643bc663526c5" "2.2.3": url: "https://github.com/simdjson/simdjson/archive/v2.2.3.tar.gz" sha256: "4c62f2d82edec3dbc63650c10453dc471de9f1be689eb5b4bde89efed89db5d8" - "2.1.0": - url: "https://github.com/simdjson/simdjson/archive/v2.1.0.tar.gz" - sha256: "051b90427ddd1eac319f4eb34b973592728a6d8608fbac61e8aaa5a2dee4b693" - "2.0.4": - url: "https://github.com/simdjson/simdjson/archive/v2.0.4.tar.gz" - sha256: "c8a12cf60f6ce8c0e556f68bd80e7bd9f11f5876e198ed3637da8ccf182eaa24" "1.1.0": url: "https://github.com/simdjson/simdjson/archive/v1.1.0.tar.gz" sha256: "9effcb21fe48e4bcc9b96031e60c3911c58aa656ad8c78212d269c0db9e0133e" - "1.0.2": - url: "https://github.com/simdjson/simdjson/archive/v1.0.2.tar.gz" - sha256: "46d5995488de76ae61f1c3bcff445a9085c8d34f6cbc9bf0422a99c6d98a002c" "0.9.7": url: "https://github.com/simdjson/simdjson/archive/v0.9.7.tar.gz" sha256: "a21279ae4cf0049234a822c5c3550f99ec1707d3cda12156d331dcc8cd411ba0" diff --git a/recipes/simdjson/config.yml b/recipes/simdjson/config.yml index d5e9878fcbc91..5a66369f45d95 100644 --- a/recipes/simdjson/config.yml +++ b/recipes/simdjson/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.1": + folder: all "3.2.0": folder: all "3.1.8": @@ -13,17 +15,9 @@ versions: folder: all "3.0.1": folder: all - "3.0.0": - folder: all "2.2.3": folder: all - "2.1.0": - folder: all - "2.0.4": - folder: all "1.1.0": folder: all - "1.0.2": - folder: all "0.9.7": folder: all diff --git a/recipes/simple-websocket-server/all/conanfile.py b/recipes/simple-websocket-server/all/conanfile.py index 7af11bfe301d4..65dfdeec4ffb5 100644 --- a/recipes/simple-websocket-server/all/conanfile.py +++ b/recipes/simple-websocket-server/all/conanfile.py @@ -1,65 +1,76 @@ import os -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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class SimpleWebSocketServerConan(ConanFile): name = "simple-websocket-server" + description = ( + "A very simple, fast, multithreaded, platform independent WebSocket (WS) " + "and WebSocket Secure (WSS) server and client library." + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.com/eidheim/Simple-WebSocket-Server" - description = "A very simple, fast, multithreaded, platform independent WebSocket (WS) and WebSocket Secure (WSS) server and client library." topics = ("websocket", "socket", "server", "client", "header-only") - url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "arch", "build_type" + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = {"use_asio_standalone": [True, False]} + default_options = {"use_asio_standalone": True} no_copy_source = True - license = "MIT" - options = { - "use_asio_standalone": [True, False], - } - default_options = { - "use_asio_standalone": True, - } - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): self.requires("openssl/1.1.1q") # only version 2.0.2 upwards is able to build against asio 1.18.0 or higher - if tools.Version(self.version) <= "2.0.1": + if Version(self.version) <= "2.0.1": if self.options.use_asio_standalone: self.requires("asio/1.16.1") else: self.requires("boost/1.73.0") else: if self.options.use_asio_standalone: - self.requires("asio/1.23.0") + self.requires("asio/1.28.0") else: - self.requires("boost/1.79.0") + self.requires("boost/1.82.0") - def configure(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "11") + def package_id(self): + self.info.clear() - def build(self): - if tools.Version(self.version) <= "2.0.1" and "asio" in self.deps_cpp_info.deps and tools.Version(self.deps_cpp_info["asio"].version) >= "1.18.0": - raise ConanInvalidConfiguration("simple-websocket-server versions <=2.0.1 require asio < 1.18.0") - elif tools.Version(self.version) <= "2.0.1" and "boost" in self.deps_cpp_info.deps and tools.Version(self.deps_cpp_info["boost"].version) >= "1.74.0": - raise ConanInvalidConfiguration("simple-websocket-server versions <=2.0.1 require boost < 1.74.0") + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + if Version(self.version) <= "2.0.1": + if self.dependencies.get("asio"): + if Version(self.dependencies["asio"].ref.version) >= "1.18.0": + raise ConanInvalidConfiguration("simple-websocket-server versions <=2.0.1 require asio < 1.18.0") + elif self.dependencies.get("boost"): + if Version(self.dependencies["boost"].ref.version) >= "1.74.0": + raise ConanInvalidConfiguration("simple-websocket-server versions <=2.0.1 require boost < 1.74.0") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "Simple-WebSocket-Server-v" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.hpp", dst=os.path.join("include", "simple-websocket-server"), src=self._source_subfolder) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.hpp", + dst=os.path.join(self.package_folder, "include", "simple-websocket-server"), + src=self.source_folder) def package_info(self): - if self.options.use_asio_standalone: - self.cpp_info.defines.append('USE_STANDALONE_ASIO') + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] - def package_id(self): - self.info.header_only() + if self.options.use_asio_standalone: + self.cpp_info.defines.append("USE_STANDALONE_ASIO") diff --git a/recipes/simple-websocket-server/all/test_package/CMakeLists.txt b/recipes/simple-websocket-server/all/test_package/CMakeLists.txt index d50531ac251fb..fc5fbf247dae0 100644 --- a/recipes/simple-websocket-server/all/test_package/CMakeLists.txt +++ b/recipes/simple-websocket-server/all/test_package/CMakeLists.txt @@ -1,11 +1,10 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(simple-websocket-server REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE simple-websocket-server::simple-websocket-server) set_target_properties( ${PROJECT_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/recipes/simple-websocket-server/all/test_package/conanfile.py b/recipes/simple-websocket-server/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/simple-websocket-server/all/test_package/conanfile.py +++ b/recipes/simple-websocket-server/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/simple-websocket-server/all/test_v1_package/CMakeLists.txt b/recipes/simple-websocket-server/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/simple-websocket-server/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/simple-websocket-server/all/test_v1_package/conanfile.py b/recipes/simple-websocket-server/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/simple-websocket-server/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sjson-cpp/all/conanfile.py b/recipes/sjson-cpp/all/conanfile.py index 98115a520a666..cf743b47f8442 100644 --- a/recipes/sjson-cpp/all/conanfile.py +++ b/recipes/sjson-cpp/all/conanfile.py @@ -1,34 +1,50 @@ -from conans import ConanFile, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class SjsonCppConan(ConanFile): name = "sjson-cpp" description = "An Simplified JSON (SJSON) C++ reader and writer" - topics = ("json", "sjson", "simplified") license = "MIT" - homepage = "https://github.com/nfrechette/sjson-cpp" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nfrechette/sjson-cpp" + topics = ("json", "sjson", "simplified", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "includes")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "includes")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/sjson-cpp/all/test_package/CMakeLists.txt b/recipes/sjson-cpp/all/test_package/CMakeLists.txt index f5f3393af5f9a..401e13d3abd40 100644 --- a/recipes/sjson-cpp/all/test_package/CMakeLists.txt +++ b/recipes/sjson-cpp/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(sjson-cpp REQUIRED CONFIG) diff --git a/recipes/sjson-cpp/all/test_package/conanfile.py b/recipes/sjson-cpp/all/test_package/conanfile.py index 38f4483872d47..fae501d0afb9e 100644 --- a/recipes/sjson-cpp/all/test_package/conanfile.py +++ b/recipes/sjson-cpp/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sjson-cpp/all/test_v1_package/CMakeLists.txt b/recipes/sjson-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/sjson-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/sjson-cpp/all/test_v1_package/conanfile.py b/recipes/sjson-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sjson-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/snowhouse/all/conanfile.py b/recipes/snowhouse/all/conanfile.py index 8bca8ddf11dc6..ec6ca8d607092 100644 --- a/recipes/snowhouse/all/conanfile.py +++ b/recipes/snowhouse/all/conanfile.py @@ -1,28 +1,50 @@ -from conans import ConanFile, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" class SnowHouseConan(ConanFile): name = "snowhouse" description = "An assertion library for C++" - topics = ("assertion", "header-only") + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/banditcpp/snowhouse" - license = "BSL-1.0" + topics = ("assertion", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) 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="LICENSE_1_0.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE_1_0.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/snowhouse/all/test_package/CMakeLists.txt b/recipes/snowhouse/all/test_package/CMakeLists.txt index 33ae887aa6aea..2fd896601b32f 100644 --- a/recipes/snowhouse/all/test_package/CMakeLists.txt +++ b/recipes/snowhouse/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(snowhouse REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE snowhouse::snowhouse) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/snowhouse/all/test_package/conanfile.py b/recipes/snowhouse/all/test_package/conanfile.py index d4128b0450777..fae501d0afb9e 100644 --- a/recipes/snowhouse/all/test_package/conanfile.py +++ b/recipes/snowhouse/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/snowhouse/all/test_v1_package/CMakeLists.txt b/recipes/snowhouse/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/snowhouse/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/snowhouse/all/test_v1_package/conanfile.py b/recipes/snowhouse/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/snowhouse/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sonic-cpp/all/conandata.yml b/recipes/sonic-cpp/all/conandata.yml new file mode 100644 index 0000000000000..d309d05a897b8 --- /dev/null +++ b/recipes/sonic-cpp/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.0.0": + url: "https://github.com/bytedance/sonic-cpp/archive/refs/tags/v1.0.0.tar.gz" + sha256: "78af626fa070a2702fe9586d90617292b421d97d7ab1fe27a02cc20434467a80" +patches: + "1.0.0": + - patch_file: "patches/1.0.0-0001-use-cci.patch" + patch_description: "use cci recipes" + patch_type: "conan" diff --git a/recipes/sonic-cpp/all/conanfile.py b/recipes/sonic-cpp/all/conanfile.py new file mode 100644 index 0000000000000..8490a3d80c51b --- /dev/null +++ b/recipes/sonic-cpp/all/conanfile.py @@ -0,0 +1,79 @@ +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.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class SonicCppConan(ConanFile): + name = "sonic-cpp" + description = "A fast JSON serializing & deserializing library, accelerated by SIMD." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/bytedance/sonic-cpp" + topics = ("json", "parser", "writer", "serializer", "deserializer", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 11 + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def requirements(self): + cppstd = self.settings.get_safe("compiler.cppstd") + # Assume we would need it if not told otherwise + if not cppstd or cppstd < "17": + self.requires("string-view-lite/1.7.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + if self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"{self.ref} support x86, x86_64 only.") + + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC now.") + + 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, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.compiler in ["gcc", "clang", "apple-clang"]: + self.cpp_info.cxxflags.extend(["-mavx2", "-mpclmul"]) diff --git a/recipes/sonic-cpp/all/patches/1.0.0-0001-use-cci.patch b/recipes/sonic-cpp/all/patches/1.0.0-0001-use-cci.patch new file mode 100644 index 0000000000000..340323cf63a9a --- /dev/null +++ b/recipes/sonic-cpp/all/patches/1.0.0-0001-use-cci.patch @@ -0,0 +1,13 @@ +diff --git a/include/sonic/string_view.h b/include/sonic/string_view.h +index 67dfe2f..1fb2379 100644 +--- a/include/sonic/string_view.h ++++ b/include/sonic/string_view.h +@@ -21,7 +21,7 @@ namespace sonic_json { + using StringView = std::string_view; + } // namespace sonic_json + #else +-#include "thirdparty/string-view-lite/string_view.h" ++#include "nonstd/string_view.hpp" + namespace sonic_json { + using StringView = nonstd::string_view; + } // namespace sonic_json diff --git a/recipes/sonic-cpp/all/test_package/CMakeLists.txt b/recipes/sonic-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2af5927a3f12f --- /dev/null +++ b/recipes/sonic-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(sonic-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sonic-cpp::sonic-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sonic-cpp/all/test_package/conanfile.py b/recipes/sonic-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/sonic-cpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sonic-cpp/all/test_package/test_package.cpp b/recipes/sonic-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..384ea13453551 --- /dev/null +++ b/recipes/sonic-cpp/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include "sonic/sonic.h" + +#include +#include + +int main() +{ + std::string json = R"( + { + "a": 1, + "b": 2 + } + )"; + + sonic_json::Document doc; + doc.Parse(json); + if (doc.HasParseError()) { + std::cout << "Parse failed!\n"; + } else { + std::cout << "Parse successful!\n"; + } + return 0; +} diff --git a/recipes/sonic-cpp/all/test_v1_package/CMakeLists.txt b/recipes/sonic-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/sonic-cpp/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/sonic-cpp/all/test_v1_package/conanfile.py b/recipes/sonic-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/sonic-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sonic-cpp/config.yml b/recipes/sonic-cpp/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/sonic-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/source_location/all/conanfile.py b/recipes/source_location/all/conanfile.py index cbc67bb2eac20..305de2e31b857 100644 --- a/recipes/source_location/all/conanfile.py +++ b/recipes/source_location/all/conanfile.py @@ -1,33 +1,30 @@ import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class SourceLocationConan(ConanFile): name = "source_location" + description = "source_location header for some older compilers" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Rechip/source_location" - description = "source_location header for some older compilers" - topics = ("cpp", "source_location", "header-only") - settings = ["compiler"] + topics = ("cpp", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - def package(self): - self.copy(pattern="LICENSE", dst="licenses", - src=self._source_subfolder) - self.copy(pattern="*", dst="include", - src=os.path.join(self._source_subfolder, "include")) + def _min_cppstd(self): + return 11 @property def _minimum_compilers_version(self): @@ -38,17 +35,32 @@ def _minimum_compilers_version(self): "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"): - tools.check_min_cppstd(self, "11") - minimum_version = self._minimum_compilers_version.get( - str(self.settings.compiler), False) + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) if not minimum_version: - self.output.warn( - "source_location requires C++11. Your compiler is unknown. Assuming it supports C++11 and required functionality.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - "source_location requires C++11 and some embedded functionality, which your compiler does not support.") + self.output.warning("source_location requires C++11. Your compiler is unknown. Assuming it supports C++11 and required functionality.") + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("source_location requires C++11 and some embedded functionality, which your compiler does not support.") - def package_id(self): - self.info.header_only() + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/source_location/all/test_package/CMakeLists.txt b/recipes/source_location/all/test_package/CMakeLists.txt index 955a59f6e9c84..27bf673b3e4ae 100644 --- a/recipes/source_location/all/test_package/CMakeLists.txt +++ b/recipes/source_location/all/test_package/CMakeLists.txt @@ -1,13 +1,10 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(source_location REQUIRED CONFIG) -find_package(source_location CONFIG REQUIRED) add_executable(${PROJECT_NAME} src/test.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE source_location::source_location) - set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/recipes/source_location/all/test_package/conanfile.py b/recipes/source_location/all/test_package/conanfile.py index cbe0be23191a2..fae501d0afb9e 100644 --- a/recipes/source_location/all/test_package/conanfile.py +++ b/recipes/source_location/all/test_package/conanfile.py @@ -1,17 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "arch", "build_type" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): - self.cmake = CMake(self) - self.cmake.configure() - self.cmake.build() + 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) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/source_location/all/test_v1_package/CMakeLists.txt b/recipes/source_location/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/source_location/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/source_location/all/test_v1_package/conanfile.py b/recipes/source_location/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..cbe0be23191a2 --- /dev/null +++ b/recipes/source_location/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + self.cmake = CMake(self) + self.cmake.configure() + 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) diff --git a/recipes/source_location/all/test_v1_package/src/test.cpp b/recipes/source_location/all/test_v1_package/src/test.cpp new file mode 100644 index 0000000000000..1e3734bb24378 --- /dev/null +++ b/recipes/source_location/all/test_v1_package/src/test.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() { + constexpr auto loc = std::source_location::current(); + + return loc.line() == 5 ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/spdlog/all/conandata.yml b/recipes/spdlog/all/conandata.yml index ca7a629380047..f320d3a0e0568 100644 --- a/recipes/spdlog/all/conandata.yml +++ b/recipes/spdlog/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.12.0": + url: "https://github.com/gabime/spdlog/archive/v1.12.0.tar.gz" + sha256: "4dccf2d10f410c1e2feaff89966bfc49a1abb29ef6f08246335b110e001e09a9" "1.11.0": url: "https://github.com/gabime/spdlog/archive/v1.11.0.tar.gz" sha256: "ca5cae8d6cac15dae0ec63b21d6ad3530070650f68076f3a4a862ca293a858bb" @@ -14,3 +17,9 @@ sources: "1.8.5": url: "https://github.com/gabime/spdlog/archive/v1.8.5.tar.gz" sha256: "944d0bd7c763ac721398dca2bb0f3b5ed16f67cef36810ede5061f35a543b4b8" +patches: + "1.11.0": + - patch_file: "patches/1.11.0-0001-fix-fmt10-build.patch" + patch_description: "Fix fmt 10.0.0 build" + patch_type: "conan" + patch_source: "https://github.com/gabime/spdlog/pull/2694" diff --git a/recipes/spdlog/all/conanfile.py b/recipes/spdlog/all/conanfile.py index 7c21d2c9559c3..f2653d49db073 100644 --- a/recipes/spdlog/all/conanfile.py +++ b/recipes/spdlog/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.files import get, copy, rmdir, replace_in_file, apply_conandata_patches, export_conandata_patches from conan.tools.microsoft import is_msvc_static_runtime from conan.tools.scm import Version import os @@ -36,6 +36,9 @@ class SpdlogConan(ConanFile): "no_exceptions": False, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -54,7 +57,7 @@ def requirements(self): fmt_version = "7.1.3" if self_version >= "1.11.0": - fmt_version = "9.1.0" + fmt_version = "10.0.0" elif self_version >= "1.10.0": fmt_version = "8.1.1" elif self_version >= "1.9.0": @@ -106,6 +109,7 @@ def _disable_werror(self): replace_in_file(self, os.path.join(self.source_folder, "cmake", "utils.cmake"), "/WX", "") def build(self): + apply_conandata_patches(self) self._disable_werror() if not self.options.header_only: cmake = CMake(self) diff --git a/recipes/spdlog/all/patches/1.11.0-0001-fix-fmt10-build.patch b/recipes/spdlog/all/patches/1.11.0-0001-fix-fmt10-build.patch new file mode 100644 index 0000000000000..613990e4eb052 --- /dev/null +++ b/recipes/spdlog/all/patches/1.11.0-0001-fix-fmt10-build.patch @@ -0,0 +1,34 @@ +From 576210a1363822a132657090b9f37e305bd0e2c2 Mon Sep 17 00:00:00 2001 +From: pwqbot +Date: Tue, 20 Jun 2023 10:41:48 +0800 +Subject: [PATCH] fix fmt build + +--- + include/spdlog/common.h | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/include/spdlog/common.h b/include/spdlog/common.h +index f97fd48c..00f4d728 100644 +--- a/include/spdlog/common.h ++++ b/include/spdlog/common.h +@@ -160,12 +160,19 @@ using format_string_t = fmt::format_string; + template + using remove_cvref_t = typename std::remove_cv::type>::type; + ++template ++# if FMT_VERSION >= 90101 ++using fmt_runtime_string = fmt::runtime_format_string; ++# else ++using fmt_runtime_string = fmt::basic_runtime; ++# endif ++ + // clang doesn't like SFINAE disabled constructor in std::is_convertible<> so have to repeat the condition from basic_format_string here, + // in addition, fmt::basic_runtime is only convertible to basic_format_string but not basic_string_view + template + struct is_convertible_to_basic_format_string + : std::integral_constant>::value || std::is_same, fmt::basic_runtime>::value> ++ std::is_convertible>::value || std::is_same, fmt_runtime_string>::value> + {}; + + # if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) diff --git a/recipes/spdlog/config.yml b/recipes/spdlog/config.yml index 1323ecbb893ca..0228f28a93d75 100644 --- a/recipes/spdlog/config.yml +++ b/recipes/spdlog/config.yml @@ -1,4 +1,6 @@ versions: + "1.12.0": + folder: "all" "1.11.0": folder: "all" "1.10.0": diff --git a/recipes/sqlpp11/all/conandata.yml b/recipes/sqlpp11/all/conandata.yml index 08915d57967e4..3357310d8ea8c 100644 --- a/recipes/sqlpp11/all/conandata.yml +++ b/recipes/sqlpp11/all/conandata.yml @@ -1,13 +1,13 @@ sources: - "0.58": - url: "https://github.com/rbock/sqlpp11/archive/0.58.zip" - sha256: 8e2ba487b7a0ddc988bcfa5366443a0f5ca9f38ef86ac8e3f257801ab3cbf8eb - "0.59": - url: "https://github.com/rbock/sqlpp11/archive/0.59.zip" - sha256: 62ba9ba078e05901aa47cb056240bb474f9b8ef5cabf114f8219b4a6fa4f019b - "0.60": - url: "https://github.com/rbock/sqlpp11/archive/0.60.zip" - sha256: 27ccc750d5eb8f234445e26e41d53d72c9df329eb2b30d64dbf21078ae57c52c + "0.63": + url: "https://github.com/rbock/sqlpp11/archive/0.63.tar.gz" + sha256: "8e8229501679435e5052c2184d6772e4d6f61e6a9e2ec7231c5fb9a3d3b88d7e" + "0.62": + url: "https://github.com/rbock/sqlpp11/archive/0.62.tar.gz" + sha256: "6d8326e94c5b14a863ead15688d853ab7854136caa9ebc47389a833fe79db7c5" "0.61": url: "https://github.com/rbock/sqlpp11/archive/0.61.tar.gz" sha256: "d5a95e28ae93930f7701f517b1342ac14bcf33a9b1c5b5f0dff6aea5e315bb50" + "0.60": + url: "https://github.com/rbock/sqlpp11/archive/0.60.zip" + sha256: 27ccc750d5eb8f234445e26e41d53d72c9df329eb2b30d64dbf21078ae57c52c diff --git a/recipes/sqlpp11/all/conanfile.py b/recipes/sqlpp11/all/conanfile.py index 384cf91a4b695..9ada1d6896ced 100644 --- a/recipes/sqlpp11/all/conanfile.py +++ b/recipes/sqlpp11/all/conanfile.py @@ -1,8 +1,12 @@ -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.layout import basic_layout +from conan.tools.files import get, copy +from conan import Version import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class Sqlpp11Conan(ConanFile): @@ -12,60 +16,56 @@ class Sqlpp11Conan(ConanFile): homepage = "https://github.com/rbock/sqlpp11" description = "A type safe SQL template library for C++" topics = ("sql", "dsl", "embedded", "data-base") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" @property - def _min_stdcpp_version(self): - return 11 if tools.Version(self.version) < "0.61" else 14 + def _min_cppstd(self): + return 11 if Version(self.version) < "0.61" else 14 @property def _compilers_minimum_version(self): return { "gcc": "5", "Visual Studio": "14", + "msvc": "190", "clang": "3.4", "apple-clang": "10", } + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): self.requires("date/3.0.1") - def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, self._min_stdcpp_version) - - if self._min_stdcpp_version > 11: - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.name} requires C++14, which your compiler does not support.") - else: - self.output.warn(f"{self.name} requires C++14. Your compiler is unknown. Assuming it supports C++14.") - def package_id(self): - self.info.header_only() + 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): - tools.get( - **self.conan_data["sources"][self.version], - destination=self._source_subfolder, - strip_root=True - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("*", dst="bin", src=os.path.join(self._source_subfolder, "scripts")) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, "*", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.source_folder, "scripts")) def package_info(self): - self.cpp_info.filenames["cmake_find_package"] = "Sqlpp11" - self.cpp_info.filenames["cmake_find_package_multi"] = "Sqlpp11" + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "Sqlpp11") + self.cpp_info.set_property("cmake_target_name", "sqlpp11::sqlpp11") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed bindir = os.path.join(self.package_folder, "bin") self.output.info("Appending PATH environment variable: {}".format(bindir)) self.env_info.PATH.append(bindir) diff --git a/recipes/sqlpp11/all/test_package/CMakeLists.txt b/recipes/sqlpp11/all/test_package/CMakeLists.txt index 209e56f42630d..6c3b3cedf8364 100644 --- a/recipes/sqlpp11/all/test_package/CMakeLists.txt +++ b/recipes/sqlpp11/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(Sqlpp11 REQUIRED CONFIG) -find_package(Sqlpp11 CONFIG REQUIRED) - -add_executable(example example.cpp) -set_property(TARGET example PROPERTY CXX_STANDARD 14) -target_link_libraries(example sqlpp11::sqlpp11) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sqlpp11::sqlpp11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/sqlpp11/all/test_package/conanfile.py b/recipes/sqlpp11/all/test_package/conanfile.py index 11eb01c13ada3..3a91c9439218e 100644 --- a/recipes/sqlpp11/all/test_package/conanfile.py +++ b/recipes/sqlpp11/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 Sqlpp11TestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run(os.path.join("bin", "example"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sqlpp11/all/test_package/example.cpp b/recipes/sqlpp11/all/test_package/example.cpp deleted file mode 100644 index 9b0644427156d..0000000000000 --- a/recipes/sqlpp11/all/test_package/example.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() -{ - sqlpp::connection c; -} diff --git a/recipes/sqlpp11/all/test_package/test_package.cpp b/recipes/sqlpp11/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..aa306d637efdd --- /dev/null +++ b/recipes/sqlpp11/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include +#include + +int main() { + select(sqlpp::value(false).as(sqlpp::alias::a)); + return EXIT_SUCCESS; +} diff --git a/recipes/sqlpp11/all/test_v1_package/CMakeLists.txt b/recipes/sqlpp11/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/sqlpp11/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/sqlpp11/all/test_v1_package/conanfile.py b/recipes/sqlpp11/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..37ada808989d9 --- /dev/null +++ b/recipes/sqlpp11/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os + +from conan.tools.build import cross_building +from conans import ConanFile, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sqlpp11/config.yml b/recipes/sqlpp11/config.yml index a51d2c88cb4ae..e0a6c05b5e927 100644 --- a/recipes/sqlpp11/config.yml +++ b/recipes/sqlpp11/config.yml @@ -1,9 +1,9 @@ versions: - "0.58": + "0.63": folder: "all" - "0.59": - folder: "all" - "0.60": + "0.62": folder: "all" "0.61": folder: "all" + "0.60": + folder: "all" diff --git a/recipes/ssht/all/conanfile.py b/recipes/ssht/all/conanfile.py index bbf74c31ff0c0..616e2e41a56b1 100644 --- a/recipes/ssht/all/conanfile.py +++ b/recipes/ssht/all/conanfile.py @@ -1,9 +1,13 @@ from conan import ConanFile -from conan.tools import files from conan.errors import ConanInvalidConfiguration -from conans import CMake +from conan.tools.microsoft import is_msvc +from conan.tools.files import get, copy, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.50.0" class SshtConan(ConanFile): name = "ssht" @@ -13,47 +17,51 @@ class SshtConan(ConanFile): description = "Fast spin spherical harmonic transforms" settings = "os", "arch", "compiler", "build_type" topics = ("physics", "astrophysics", "radio interferometry") + package_type = "static-library" options = {"fPIC": [True, False]} default_options = {"fPIC": True} - requires = "fftw/3.3.9" - generators = "cmake", "cmake_find_package", "cmake_paths" - exports_sources = ["CMakeLists.txt"] - @property - def _source_subfolder(self): - return "source_subfolder" + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC - @property - def _build_subfolder(self): - return "build_subfolder" + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("fftw/3.3.9") - def config_options(self): - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx - def validate(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): raise ConanInvalidConfiguration("SSHT requires C99 support for complex numbers.") def source(self): - files.get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @property - def cmake(self): - if not hasattr(self, "_cmake"): - self._cmake = CMake(self) - self._cmake.definitions["tests"] = False - self._cmake.definitions["python"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["tests"] = False + tc.cache_variables["python"] = False + tc.generate() + deps = CMakeDeps(self) + deps.set_property("fftw", "cmake_target_name", "FFTW3::FFTW3") + deps.generate() + def build(self): - self.cmake.build() + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.cmake.install() + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.libs = ["ssht"] diff --git a/recipes/ssht/all/test_package/CMakeLists.txt b/recipes/ssht/all/test_package/CMakeLists.txt index dfe499c06a976..ef70db67c0029 100644 --- a/recipes/ssht/all/test_package/CMakeLists.txt +++ b/recipes/ssht/all/test_package/CMakeLists.txt @@ -1,11 +1,9 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.15) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package LANGUAGES C) find_package(Ssht REQUIRED NO_MODULE) add_executable(${PROJECT_NAME} example.c) target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) -target_link_libraries(${PROJECT_NAME} ssht::ssht) +target_link_libraries(${PROJECT_NAME} PRIVATE ssht::ssht) diff --git a/recipes/ssht/all/test_package/conanfile.py b/recipes/ssht/all/test_package/conanfile.py index 4930d744506dc..ef5d7042163ec 100644 --- a/recipes/ssht/all/test_package/conanfile.py +++ b/recipes/ssht/all/test_package/conanfile.py @@ -1,13 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class SshtTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" - def configure(self): - del self.settings.compiler.libcxx + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -15,6 +21,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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/stlab/all/conandata.yml b/recipes/stlab/all/conandata.yml index cde4739b5d32c..5b3683503f4d0 100644 --- a/recipes/stlab/all/conandata.yml +++ b/recipes/stlab/all/conandata.yml @@ -1,16 +1,4 @@ sources: - "1.6.2": - url: "https://github.com/stlab/libraries/archive/v1.6.2.tar.gz" - sha256: "d0369d889c7bf78068d0c4f4b5125d7e9fe9abb0ad7a3be35bf13b6e2c271676" - "1.5.6": - url: "https://github.com/stlab/libraries/archive/refs/tags/v1.5.6.tar.gz" - sha256: "a6b788848be637b6d6c471de76c38486789e708997648e9b9731fdb5a631030c" - "1.5.5": - url: "https://github.com/stlab/libraries/archive/v1.5.5.tar.gz" - sha256: "30ec5a36b4c074feac72a1b9a744f0b279010e18c7bb04bbdc5d44fe9eaf5ad8" - "1.5.4": - url: "https://github.com/stlab/libraries/archive/v1.5.4.tar.gz" - sha256: "87306f58f6614f4a1ca54dda52fedff7e610d3b3dae035829657bac77bc33640" - "1.5.2": - url: https://github.com/stlab/libraries/archive/v1.5.2.tar.gz - sha256: a82eb013e51d0bb3ee2050f0eda31e11997cb4ca74d2abfdc2c8249c5c67c9fb + "1.7.1": + url: "https://github.com/stlab/libraries/archive/refs/tags/v1.7.1.tar.gz" + sha256: "0160b5f7be7d423100a9a8b205a99285b106dd438f806978028a82b9f01c6b64" diff --git a/recipes/stlab/all/conanfile.py b/recipes/stlab/all/conanfile.py index b315741f04d56..b78d535f7ef8e 100644 --- a/recipes/stlab/all/conanfile.py +++ b/recipes/stlab/all/conanfile.py @@ -1,180 +1,179 @@ -from conans import ConanFile, tools -from conans.tools import Version -from conans.errors import ConanInvalidConfiguration import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + class Stlab(ConanFile): name = 'stlab' description = 'The Software Technology Lab libraries.' url = 'https://github.com/conan-io/conan-center-index' homepage = 'https://github.com/stlab/libraries' license = 'BSL-1.0' - topics = 'conan', 'c++', 'concurrency', 'futures', 'channels' - - settings = "arch", "os", "compiler", "build_type", - + topics = 'concurrency', 'futures', 'channels' + settings = "arch", "os", "compiler", "build_type", options = { - "boost_optional": [True, False], - "boost_variant": [True, False], - "coroutines": [True, False], - "task_system": ["portable", "libdispatch", "emscripten", "pnacl", "windows", "auto"], + "with_boost": [True, False], + "no_std_coroutines": [True, False], + "future_coroutines": [True, False], + "task_system": ["portable", "libdispatch", "emscripten", "pnacl", "windows"], + "thread_system": ["win32", "pthread", "pthread-emscripten", "pthread-apple", "none"], } - default_options = { - "boost_optional": False, - "boost_variant": False, - "coroutines": False, - "task_system": "auto", + "with_boost": False, + "no_std_coroutines": True, + "future_coroutines": False + # Handle default value for `thread_system` in `config_options` method + # Handle default value for `task_system` in `config_options` method } + package_type = "header-library" + short_paths = True - no_copy_source = True - _source_subfolder = 'source_subfolder' + def config_options(self): + self.options.thread_system = {"Macos": "pthread-apple", + "Linux": "pthread", + "Windows": "win32", + "Emscripten": "pthread-emscripten"}.get(str(self.settings.os), "none") + self.options.task_system = {"Macos": "libdispatch", + "Windows": "windows"}.get(str(self.settings.os), "portable") - def _use_boost(self): - return self.options.boost_optional or self.options.boost_variant + @property + def _minimum_cpp_standard(self): + return 17 - def _requires_libdispatch(self): - # On macOS it is not necessary to use the libdispatch conan package, because the library is - # included in the OS. - return self.options.task_system == "libdispatch" and self.settings.os != "Macos" + @property + def _compilers_minimum_version(self): + return {"gcc": "9", + "clang": "8", + "apple-clang": "13"} + + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.23.3]") def requirements(self): - if self._use_boost(): - self.requires("boost/1.75.0") + if self.options.with_boost: + self.requires("boost/1.82.0") - if self._requires_libdispatch(): + # On macOS, it is not necessary to use the libdispatch conan package, because the library is + # included in the OS. + if self.options.task_system == "libdispatch" and self.settings.os != "Macos": self.requires("libdispatch/5.3.2") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "libraries-" + self.version - os.rename(extracted_dir, self._source_subfolder) - - def _fix_boost_components(self): - if self.settings.os != "Macos": return - if self.settings.compiler != "apple-clang": return - if Version(self.settings.compiler.version) >= "12": return - - # - # On Apple we have to force the usage of boost.variant, because Apple's implementation of C++17 is not complete. - # - self.output.info("Apple-Clang versions less than 12 do not correctly support std::optional or std::variant, so we will use boost::optional and boost::variant instead.") - self.options.boost_optional = True - self.options.boost_variant = True - - def _default_task_system(self): - if self.settings.os == "Macos": - return "libdispatch" - - if self.settings.os == "Windows": - return "windows" - - if self.settings.os == "Emscripten": - return "emscripten" - - return "portable" - - def _validate_task_system_libdispatch(self): - if self.settings.os == "Linux": - if self.settings.compiler != "clang": - raise ConanInvalidConfiguration("{}/{} task_system=libdispatch needs Clang compiler when using OS: {}. Use Clang compiler or switch to task_system=portable or task_system=auto".format(self.name, self.version, self.settings.os)) - elif self.settings.os != "Macos": - raise ConanInvalidConfiguration("{}/{} task_system=libdispatch is not supported on {}. Try using task_system=auto".format(self.name, self.version, self.settings.os)) - - def _validate_task_system_windows(self): - if self.settings.os != "Windows": - self.output.info("Libdispatch is not supported on {}. The task system is changed to {}.".format(self.settings.os, self.options.task_system)) - raise ConanInvalidConfiguration("{}/{} task_system=windows is not supported on {}. Try using task_system=auto".format(self.name, self.version, self.settings.os)) - - def _validate_task_system_emscripten(self): - if self.settings.os != "Emscripten": - raise ConanInvalidConfiguration("{}/{} task_system=emscripten is not supported on {}. Try using task_system=auto".format(self.name, self.version, self.settings.os)) + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def _validate_task_system(self): if self.options.task_system == "libdispatch": - self._validate_task_system_libdispatch() - elif self.options.task_system == "windows": - self._validate_task_system_windows() - elif self.options.task_system == "emscripten": - self._validate_task_system_emscripten() + if self.settings.os == "Linux" and self.settings.compiler != "clang": + raise ConanInvalidConfiguration(f"{self.ref} task_system=libdispatch needs Clang compiler when using OS: {self.settings.os}." + f" Use Clang compiler or switch to task_system=portable") + elif self.settings.os != "Macos": + raise ConanInvalidConfiguration(f"{self.ref} task_system=libdispatch is not supported on {self.settings.os}") + elif self.options.task_system == "windows" and self.settings.os != "Windows": + raise ConanInvalidConfiguration(f"{self.ref} task_system=windows is not supported on {self.settings.os}") + + def _validate_thread_system(self): + if any([self.options.thread_system == "pthread-apple" and self.settings.os != "Macos", + self.options.thread_system == "pthread" and self.settings.os != "Linux", + self.options.thread_system == "win32" and self.settings.os != "Windows", + self.options.thread_system == "pthread-emscripten" and self.settings.os != "Emscripten"]): + raise ConanInvalidConfiguration(f"{self.ref} thread_system={self.options.thread_system} is not supported on {self.settings.os}") def _validate_boost_components(self): - if self.settings.os != "Macos": return - if self.settings.compiler != "apple-clang": return - if Version(self.settings.compiler.version) >= "12": return - if self.options.boost_optional and self.options.boost_variant: return - # - # On Apple we have to force the usage of boost.variant, because Apple's implementation of C++17 - # is not complete. - # - msg = "Apple-Clang versions less than 12 do not correctly support std::optional or std::variant, so we will use boost::optional and boost::variant instead. " - if not self.options.boost_optional and not self.options.boost_variant: - msg += "Try -o boost_optional=True -o boost_variant=True" - elif not self.options.boost_optional: - msg += "Try -o boost_optional=True." + if not any([self.settings.os != "Macos", self.settings.compiler != "apple-clang", + Version(str(self.settings.compiler.version)) >= "12", self.options.with_boost]): + # On Apple we have to force the usage of boost.variant and boost.optional, because Apple's implementation of C++17 + # is not complete. + raise ConanInvalidConfiguration( + f"Compiler Apple-Clang < 12 versions do not correctly support std::optional or std::variant, " + f"so we will use boost::optional and boost::variant instead. Try -o {self.ref}:with_boost=True.") + + def _validate_min_compiler_version(self): + if is_msvc(self): + check_min_vs(self, "192") else: - msg += "Try -o boost_variant=True." - - raise ConanInvalidConfiguration(msg) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn(f"{self.ref} requires C++{self._minimum_cpp_standard}. " + f"Your compiler is unknown. Assuming it supports C++{self._minimum_cpp_standard}.") + elif Version(str(self.settings.compiler.version)) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, " + f"which your compiler does not support.") + if self.settings.compiler == "clang" and str(self.settings.compiler.version) in ("13", "14"): + raise ConanInvalidConfiguration( + f"{self.ref} currently does not work with Clang {self.settings.compiler.version} on CCI, it enters " + f"in an infinite build loop (smells like a compiler bug). Contributions are welcomed!") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, '17') - - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9": - raise ConanInvalidConfiguration("Need GCC >= 9") - - if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "8": - raise ConanInvalidConfiguration("Need Clang >= 8") - - if self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) < "15.8": - raise ConanInvalidConfiguration("Need Visual Studio >= 2017 15.8 (MSVC 19.15)") - - # Actually, we want *at least* 15.8 (MSVC 19.15), but we cannot check this for now with Conan. - if self.settings.compiler == "msvc" and Version(self.settings.compiler.version) < "19.15": - raise ConanInvalidConfiguration("Need msvc >= 19.15") + check_min_cppstd(self, self._minimum_cpp_standard) + self._validate_min_compiler_version() self._validate_task_system() + self._validate_thread_system() self._validate_boost_components() def configure(self): - if self.options.task_system == "auto": - self.options.task_system = self._default_task_system() - self.output.info("Stlab Task System: {}.".format(self.options.task_system)) + self.output.info("STLab With Boost: {}.".format(self.options.with_boost)) + self.output.info("STLab Future Coroutines: {}.".format(self.options.future_coroutines)) + self.output.info("STLab No Standard Coroutines: {}.".format(self.options.no_std_coroutines)) + self.output.info("STLab Task System: {}.".format(self.options.task_system)) + self.output.info("STLab Thread System: {}.".format(self.options.thread_system)) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables['BUILD_TESTING'] = not self.conf.get("tools.build:skip_test", default=True, check_type=bool) + tc.variables["STLAB_USE_BOOST_CPP17_SHIMS"] = self.options.with_boost + tc.variables["STLAB_NO_STD_COROUTINES"] = self.options.no_std_coroutines + tc.variables["STLAB_THREAD_SYSTEM"] = self.options.thread_system + tc.variables["STLAB_TASK_SYSTEM"] = self.options.task_system + if cross_building(self): + tc.variables["STLAB_HAVE_FUNCTIONAL_VARIANT_OPTIONAL"] = True + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - self.copy("*LICENSE", dst="licenses", keep_path=False) - self.copy("stlab/*", src=self._source_subfolder, dst='include/') + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "msvcp*.dll", os.path.join(self.package_folder, "bin")) + rm(self, "concrt*.dll", os.path.join(self.package_folder, "bin")) + rm(self, "vcruntime*.dll", os.path.join(self.package_folder, "bin")) def package_id(self): - self.info.header_only() - self.info.options.boost_optional = "ANY" - self.info.options.boost_variant = "ANY" + # TODO: is header only but needs a header modified by cmake + # self.info.settings.clear() + # self.info.header_only() + pass def package_info(self): - coroutines_value = 1 if self.options.coroutines else 0 + future_coroutines_value = 1 if self.options.future_coroutines else 0 self.cpp_info.defines = [ - 'STLAB_FUTURE_COROUTINES={}'.format(coroutines_value) + 'STLAB_FUTURE_COROUTINES={}'.format(future_coroutines_value) ] - if self.options.boost_optional: - self.cpp_info.defines.append("STLAB_FORCE_BOOST_OPTIONAL") - - if self.options.boost_variant: - self.cpp_info.defines.append("STLAB_FORCE_BOOST_VARIANT") - - if self.options.task_system == "portable": - self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_PORTABLE") - elif self.options.task_system == "libdispatch": - self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_LIBDISPATCH") - elif self.options.task_system == "emscripten": - self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_EMSRIPTEN") #Note: there is a typo in Stlab Cmake. - self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_EMSCRIPTEN") #Note: for typo fix in later versions - elif self.options.task_system == "pnacl": - self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_PNACL") - elif self.options.task_system == "windows": - self.cpp_info.defines.append("STLAB_FORCE_TASK_SYSTEM_WINDOWS") + if self.settings.os == "Windows": + self.cpp_info.defines = ['NOMINMAX'] if self.settings.os == "Linux": self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/stlab/all/test_package/CMakeLists.txt b/recipes/stlab/all/test_package/CMakeLists.txt index 98fa8e5af1b41..b52ae3503ebad 100644 --- a/recipes/stlab/all/test_package/CMakeLists.txt +++ b/recipes/stlab/all/test_package/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) -set(CMAKE_CXX_STANDARD 17) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package CXX) # if the project uses c++ +find_package(stlab REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_compile_definitions( ${PROJECT_NAME} INTERFACE $<$:NOMINMAX> ) +target_link_libraries(${PROJECT_NAME} PRIVATE stlab::stlab) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + diff --git a/recipes/stlab/all/test_package/conanfile.py b/recipes/stlab/all/test_package/conanfile.py index bd7165a553cf4..ab351a264621f 100644 --- a/recipes/stlab/all/test_package/conanfile.py +++ b/recipes/stlab/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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/stlab/all/test_package/test_package.cpp b/recipes/stlab/all/test_package/test_package.cpp index cbf630bd2f9a3..b125ed3c4bd3d 100644 --- a/recipes/stlab/all/test_package/test_package.cpp +++ b/recipes/stlab/all/test_package/test_package.cpp @@ -16,6 +16,8 @@ int main() { while (!f.get_try()) { this_thread::sleep_for(chrono::milliseconds(1)); } cout << "The answer is " << *f.get_try() << "\n"; + + stlab::pre_exit(); } /* diff --git a/recipes/stlab/config.yml b/recipes/stlab/config.yml index 28a287ac4f61d..4821864cf318a 100644 --- a/recipes/stlab/config.yml +++ b/recipes/stlab/config.yml @@ -1,11 +1,3 @@ versions: - "1.6.2": - folder: all - "1.5.6": - folder: all - "1.5.5": - folder: all - "1.5.4": - folder: all - "1.5.2": + "1.7.1": folder: all diff --git a/recipes/stringtoolbox/all/conanfile.py b/recipes/stringtoolbox/all/conanfile.py index c1426333ba094..1753e2bcb8a5f 100644 --- a/recipes/stringtoolbox/all/conanfile.py +++ b/recipes/stringtoolbox/all/conanfile.py @@ -1,31 +1,41 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" -required_conan_version = ">=1.33.0" class DawHeaderLibrariesConan(ConanFile): name = "stringtoolbox" - license = "MIT" description = "A simple header-only, single-file string toolbox library for C++." - topics = ("string", "header-only",) + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/chrberger/stringtoolbox" - settings = "os", "arch", "compiler", "build_type", + topics = ("string", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, "11") - - def package_id(self): - self.info.header_only() + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - self.copy("stringtoolbox.hpp", "include", self._source_subfolder) + copy(self, "LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "stringtoolbox.hpp", 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/stringtoolbox/all/test_package/CMakeLists.txt b/recipes/stringtoolbox/all/test_package/CMakeLists.txt index 76fbeefd9810e..012002471f6a4 100644 --- a/recipes/stringtoolbox/all/test_package/CMakeLists.txt +++ b/recipes/stringtoolbox/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(stringtoolbox CONFIG REQUIRED) +find_package(stringtoolbox REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} stringtoolbox::stringtoolbox) diff --git a/recipes/stringtoolbox/all/test_package/conanfile.py b/recipes/stringtoolbox/all/test_package/conanfile.py index de03d357e14e0..ef5d7042163ec 100644 --- a/recipes/stringtoolbox/all/test_package/conanfile.py +++ b/recipes/stringtoolbox/all/test_package/conanfile.py @@ -1,9 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class DawHeaderLibrariesTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/structopt/all/conandata.yml b/recipes/structopt/all/conandata.yml index 6f0c202add0e6..0ba29b1eb7e13 100644 --- a/recipes/structopt/all/conandata.yml +++ b/recipes/structopt/all/conandata.yml @@ -13,14 +13,10 @@ sources: sha256: "a0552e81312cfafcc5319a25c0571ca2470f43461e9f3f72e5f9d89ea4139505" patches: "0.1.3": - - base_path: "source_subfolder" - patch_file: "patches/0.1.0-0001-use-recipes.patch" + - patch_file: "patches/0.1.0-0001-use-recipes.patch" "0.1.2": - - base_path: "source_subfolder" - patch_file: "patches/0.1.0-0001-use-recipes.patch" + - patch_file: "patches/0.1.0-0001-use-recipes.patch" "0.1.1": - - base_path: "source_subfolder" - patch_file: "patches/0.1.0-0001-use-recipes.patch" + - patch_file: "patches/0.1.0-0001-use-recipes.patch" "0.1.0": - - base_path: "source_subfolder" - patch_file: "patches/0.1.0-0001-use-recipes.patch" + - patch_file: "patches/0.1.0-0001-use-recipes.patch" diff --git a/recipes/structopt/all/conanfile.py b/recipes/structopt/all/conanfile.py index 08d36a1d38388..bca62b435e167 100644 --- a/recipes/structopt/all/conanfile.py +++ b/recipes/structopt/all/conanfile.py @@ -1,36 +1,32 @@ import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + class StructoptConan(ConanFile): name = "structopt" description = "Parse command line arguments by defining a struct+" - topics = ("structopt", "argument-parser", "cpp17", "header-only", - "single-header-lib", "header-library", "command-line", "arguments", - "mit-license", "modern-cpp", "structopt", "lightweight", "reflection", - "cross-platform", "library", "type-safety", "type-safe", "argparse", - "clap",) license = "MIT" - homepage = "https://github.com/p-ranav/structopt" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/p-ranav/structopt" + topics = ("argument-parser", "cpp17", "header-only", "single-header-lib", "command-line", + "arguments", "mit-license", "modern-cpp", "lightweight", "reflection", + "cross-platform", "type-safety", "type-safe", "argparse", "clap") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" - - def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) - - def requirements(self): - self.requires("magic_enum/0.8.0") - self.requires("visit_struct/1.0") - - def package_id(self): - self.info.header_only() + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -39,39 +35,58 @@ def _compilers_minimum_version(self): "Visual Studio": "15.0", "clang": "5", "apple-clang": "10", + "msvc": "191", } + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("magic_enum/0.9.2") + self.requires("visit_struct/1.1.0") + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") + check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("structopt: Unsupported compiler: {}-{} " - "(https://github.com/p-ranav/structopt#compiler-compatibility)." - .format(self.settings.compiler, self.settings.compiler.version)) + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"structopt: Unsupported compiler: {self.settings.compiler}-{self.settings.compiler.version} " + f"(https://github.com/p-ranav/structopt#compiler-compatibility)." + ) else: - self.output.warn("{} requires C++14. Your compiler is unknown. Assuming it supports C++14.".format(self.name)) + self.output.warning("{} requires C++14. Your compiler is unknown. Assuming it supports C++14.".format(self.name)) 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 _configure_cmake(self): - cmake = CMake(self) - cmake.configure(source_folder=self._source_subfolder) - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - tools.rmdir(os.path.join(self._source_subfolder, "include", "structopt", "third_party")) - + apply_conandata_patches(self) + rmdir(self, os.path.join(self.source_folder, "include", "structopt", "third_party")) def package(self): - self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.configure() cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(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")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/structopt/all/test_package/CMakeLists.txt b/recipes/structopt/all/test_package/CMakeLists.txt index edf44ae8164be..ea6a19b7561c5 100644 --- a/recipes/structopt/all/test_package/CMakeLists.txt +++ b/recipes/structopt/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(structopt REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/structopt/all/test_package/conanfile.py b/recipes/structopt/all/test_package/conanfile.py index 49a3a66ea5bad..fae501d0afb9e 100644 --- a/recipes/structopt/all/test_package/conanfile.py +++ b/recipes/structopt/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/structopt/all/test_v1_package/CMakeLists.txt b/recipes/structopt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/structopt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/structopt/all/test_v1_package/conanfile.py b/recipes/structopt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/structopt/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/svgwrite/all/CMakeLists.txt b/recipes/svgwrite/all/CMakeLists.txt deleted file mode 100644 index a7a84f24be646..0000000000000 --- a/recipes/svgwrite/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -if (WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif(WIN32 AND BUILD_SHARED_LIBS) - -add_subdirectory("source_subfolder") diff --git a/recipes/svgwrite/all/conandata.yml b/recipes/svgwrite/all/conandata.yml index 2732ab9e3e8f7..d4fffab589e1b 100644 --- a/recipes/svgwrite/all/conandata.yml +++ b/recipes/svgwrite/all/conandata.yml @@ -1,13 +1,31 @@ sources: - "0.1.0": - url: "https://gitlab.com/dvd0101/svgwrite/-/archive/v0.1.0/svgwrite-v0.1.0.tar.gz" - sha256: "beca35ebd5f95fd8a09f6c5b612990c633fd1101e4dd4f72769d819e91ef27bb" "0.2.0": url: "https://gitlab.com/dvd0101/svgwrite/-/archive/v0.2.0/svgwrite-v0.2.0.tar.gz" sha256: "aec13438ac991b13c840488a8f7e878255bdbdf24e757aa3f75de4482eae8812" + "0.1.0": + url: "https://gitlab.com/dvd0101/svgwrite/-/archive/v0.1.0/svgwrite-v0.1.0.tar.gz" + sha256: "beca35ebd5f95fd8a09f6c5b612990c633fd1101e4dd4f72769d819e91ef27bb" patches: + "0.2.0": + - patch_file: "patches/0.2.0-0001-fix-cmake.patch" + patch_description: "remove old conan features" + patch_type: "conan" + - patch_file: "patches/0.2.0-0002-include-cstdint.patch" + patch_description: "include cstdint for gcc 13 or later" + patch_type: "portability" + - patch_file: "patches/0.1.0-0004-add-fmt-runtime.patch" + patch_description: "add fmt::runtime to non-constexpr string" + patch_type: "portability" "0.1.0": - - patch_file: "patches/0001-remove-gcc-flags.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-span-lite-ns.patch" - base_path: "source_subfolder" + - patch_file: "patches/0.1.0-0001-fix-cmake.patch" + patch_description: "remove old conan features" + patch_type: "conan" + - patch_file: "patches/0.1.0-0002-remove-gcc-flags.patch" + patch_description: "disable gcc flags" + patch_type: "portability" + - patch_file: "patches/0.1.0-0003-span-lite-ns.patch" + patch_description: "fix target name" + patch_type: "conan" + - patch_file: "patches/0.1.0-0004-add-fmt-runtime.patch" + patch_description: "add fmt::runtime to non-constexpr string" + patch_type: "portability" diff --git a/recipes/svgwrite/all/conanfile.py b/recipes/svgwrite/all/conanfile.py index bef96e5e83402..cac9b7b0b66e8 100644 --- a/recipes/svgwrite/all/conanfile.py +++ b/recipes/svgwrite/all/conanfile.py @@ -1,79 +1,93 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +required_conan_version = ">=1.53.0" class SvgwriteConan(ConanFile): name = "svgwrite" + description = "a streaming svg library" license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.com/dvd0101/svgwrite" - description = "SVGWrite - a streaming svg library" - topics = ("svg", "stream", "vector", "image") - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - exports_sources = ("CMakeLists.txt", "patches/*") - requires = "span-lite/0.7.0", "fmt/6.1.2" - generators = "cmake", "cmake_find_package" - _cmake = None + topics = ("svg", "writer", "stream", "vector", "image") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property - def _build_subfolder(self): - return "build_subfolder" + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + "Visual Studio": "16", + "msvc": "192", + } + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - compiler = str(self.settings.compiler) - compiler_version = tools.Version(self.settings.compiler.version) + if self.options.shared: + self.options.rm_safe("fPIC") - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "17") + def layout(self): + cmake_layout(self, src_folder="src") - minimal_version = { - "Visual Studio": "16", - "gcc": "7.3", - "clang": "6", - "apple-clang": "10.0" - } + def requirements(self): + self.requires("span-lite/0.10.3", transitive_headers=True) + self.requires("fmt/10.0.0") - if compiler not in minimal_version: - self.output.warn("{} recipe lacks information about the {} compiler" - " standard version support".format(self.name, compiler)) - elif compiler_version < minimal_version.get(compiler): - raise ConanInvalidConfiguration("%s requires a compiler that supports" - " at least C++17. %s %s is not" - " supported." % (self.name, compiler, compiler_version)) + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_folder = self.name + "-v" + self.version - os.rename(extracted_folder, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + deps = CMakeDeps(self) + deps.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 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, "share")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.libs = ["svgwrite"] diff --git a/recipes/svgwrite/all/patches/0.1.0-0001-fix-cmake.patch b/recipes/svgwrite/all/patches/0.1.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..1576eca80f5fc --- /dev/null +++ b/recipes/svgwrite/all/patches/0.1.0-0001-fix-cmake.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d70de08..df997b1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,7 +9,7 @@ else() + set(BUILD_THIS_PROJECT False) + endif() + +-if(BUILD_THIS_PROJECT) ++if(0) + include(${CMAKE_BINARY_DIR}/conan_paths.cmake) + + include(CTest) diff --git a/recipes/svgwrite/all/patches/0001-remove-gcc-flags.patch b/recipes/svgwrite/all/patches/0.1.0-0002-remove-gcc-flags.patch similarity index 100% rename from recipes/svgwrite/all/patches/0001-remove-gcc-flags.patch rename to recipes/svgwrite/all/patches/0.1.0-0002-remove-gcc-flags.patch diff --git a/recipes/svgwrite/all/patches/0002-span-lite-ns.patch b/recipes/svgwrite/all/patches/0.1.0-0003-span-lite-ns.patch similarity index 100% rename from recipes/svgwrite/all/patches/0002-span-lite-ns.patch rename to recipes/svgwrite/all/patches/0.1.0-0003-span-lite-ns.patch diff --git a/recipes/svgwrite/all/patches/0.1.0-0004-add-fmt-runtime.patch b/recipes/svgwrite/all/patches/0.1.0-0004-add-fmt-runtime.patch new file mode 100644 index 0000000000000..dd055f311c058 --- /dev/null +++ b/recipes/svgwrite/all/patches/0.1.0-0004-add-fmt-runtime.patch @@ -0,0 +1,13 @@ +diff --git a/src/writer.cpp b/src/writer.cpp +index 81da66e..cd2419b 100644 +--- a/src/writer.cpp ++++ b/src/writer.cpp +@@ -56,7 +56,7 @@ namespace svgw::v1 { + template + void print(std::ostream& os, std::vector& buffer, std::string_view format_str, Args&&... args) { + buffer.clear(); +- fmt::format_to(std::back_inserter(buffer), format_str, args...); ++ fmt::format_to(std::back_inserter(buffer), fmt::runtime(format_str), args...); + buffer.push_back(0); + os << buffer.data(); + } diff --git a/recipes/svgwrite/all/patches/0.2.0-0001-fix-cmake.patch b/recipes/svgwrite/all/patches/0.2.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..c47884c595ab0 --- /dev/null +++ b/recipes/svgwrite/all/patches/0.2.0-0001-fix-cmake.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4467941..0212c5a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,13 +6,6 @@ option(SVGWRITE_BUILD_DOC "Build svgwrite documentation") + option(SVGWRITE_BUILD_EXAMPLES "Build svgwrite examples") + + if(SVGWRITE_BUILD_LIB) +- if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) +- include(${CMAKE_BINARY_DIR}/conan_paths.cmake) +- +- include(CTest) +- enable_testing() +- endif() +- + add_subdirectory(src) + + if(SVGWRITE_BUILD_EXAMPLES) diff --git a/recipes/svgwrite/all/patches/0.2.0-0002-include-cstdint.patch b/recipes/svgwrite/all/patches/0.2.0-0002-include-cstdint.patch new file mode 100644 index 0000000000000..a24c4a3a8233e --- /dev/null +++ b/recipes/svgwrite/all/patches/0.2.0-0002-include-cstdint.patch @@ -0,0 +1,19 @@ +diff --git a/include/svgwrite/writer.hpp b/include/svgwrite/writer.hpp +index d97bc96..711d453 100644 +--- a/include/svgwrite/writer.hpp ++++ b/include/svgwrite/writer.hpp +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + + /** + * The svgw namespace +@@ -255,4 +256,4 @@ namespace svgw { + std::ostream* os; + }; + } +-} +\ No newline at end of file ++} diff --git a/recipes/svgwrite/all/test_package/CMakeLists.txt b/recipes/svgwrite/all/test_package/CMakeLists.txt index 5f358b17c3b77..682e5fb4ea0e1 100644 --- a/recipes/svgwrite/all/test_package/CMakeLists.txt +++ b/recipes/svgwrite/all/test_package/CMakeLists.txt @@ -1,9 +1,9 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.15) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package LANGUAGES CXX) -add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) -set_property(TARGET example PROPERTY CXX_STANDARD 17) +find_package(svgwrite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE svgwrite::svgwrite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/svgwrite/all/test_package/conanfile.py b/recipes/svgwrite/all/test_package/conanfile.py index 4ead2ad43af38..ef5d7042163ec 100644 --- a/recipes/svgwrite/all/test_package/conanfile.py +++ b/recipes/svgwrite/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" -class SvgwriteTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/svgwrite/all/test_package/example.cpp b/recipes/svgwrite/all/test_package/test_package.cpp similarity index 100% rename from recipes/svgwrite/all/test_package/example.cpp rename to recipes/svgwrite/all/test_package/test_package.cpp diff --git a/recipes/svgwrite/config.yml b/recipes/svgwrite/config.yml index f97c9e447ad07..fc6f796e2eea9 100644 --- a/recipes/svgwrite/config.yml +++ b/recipes/svgwrite/config.yml @@ -1,5 +1,5 @@ versions: - "0.1.0": - folder: all "0.2.0": folder: all + "0.1.0": + folder: all diff --git a/recipes/tclap/all/conandata.yml b/recipes/tclap/all/conandata.yml index f7a05c00a83b7..21dfdafb52e1c 100644 --- a/recipes/tclap/all/conandata.yml +++ b/recipes/tclap/all/conandata.yml @@ -1,10 +1,11 @@ +# INFO: Moved from a fork to the original repository sources: "1.2.5": - url: "https://github.com/xguerin/tclap/archive/v1.2.5.tar.gz" - sha256: "a475fc46d82092c5d244f6ca8b0d2c0010fcb2c41936afde10a9c950f42eb95f" + url: "https://github.com/mirror/tclap/archive/refs/tags/v1.2.5.tar.gz" + sha256: "7e87d13734076fa4f626f6144ce9a02717198b3f054341a6886e2107b048b235" "1.2.4": - url: "https://github.com/xguerin/tclap/archive/v1.2.4.tar.gz" - sha256: "7363f8f571e6e733b269c4b4e9c18f392d3cd7240d39a379d95de5a4c4bdc47f" + url: "https://sourceforge.net/projects/tclap/files/tclap-1.2.4.tar.gz" + sha256: "634c5b59dbb1ccbc9d6a5f6de494a257e29a3f59dcb6fc30445ff39b45188574" "1.2.3": - sha256: ccccd3471776f3198bb360aa6c09a1cd527d18b44360ff4d2b8356cdf984e980 - url: https://github.com/xguerin/tclap/archive/v1.2.3.tar.gz + url: "https://sourceforge.net/projects/tclap/files/tclap-1.2.3.tar.gz" + sha256: "19e7db5281540f154348770bc3a7484575f4f549aef8e00aabcc94b395f773c9" diff --git a/recipes/tclap/all/conanfile.py b/recipes/tclap/all/conanfile.py index 7eaf320075187..8b33301f47d32 100644 --- a/recipes/tclap/all/conanfile.py +++ b/recipes/tclap/all/conanfile.py @@ -1,30 +1,33 @@ -from conans import ConanFile, tools - +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout import os + class TclapConan(ConanFile): name = "tclap" license = "MIT" - homepage = "http://github.com/xguerin/tclap" + homepage = "https://sourceforge.net/projects/tclap/" url = "https://github.com/conan-io/conan-center-index" description = "Templatized Command Line Argument Parser" - topics = ("c++", "commandline parser") + topics = ("parser", "command-line", "header-only") + settings = "os", "compiler", "build_type", "arch" + package_type = "header-library" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(self.name + "-" + self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - self.copy(pattern="*", src=os.path.join(self._source_subfolder, "include"), dst="include", keep_path=True) + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) def package_info(self): - self.cpp_info.names["pkg_config"] = "tclap" - - def package_id(self): - self.info.header_only() + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/tclap/all/test_package/CMakeLists.txt b/recipes/tclap/all/test_package/CMakeLists.txt index 943ae4571dee7..abb2293e73c6e 100644 --- a/recipes/tclap/all/test_package/CMakeLists.txt +++ b/recipes/tclap/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(tclap REQUIRED CONFIG) -add_executable(test_package test.cpp) -target_link_libraries(test_package CONAN_PKG::tclap) +add_executable(test_package test_package.cpp) +target_link_libraries(test_package tclap::tclap) diff --git a/recipes/tclap/all/test_package/conanfile.py b/recipes/tclap/all/test_package/conanfile.py index 78a3d05a29256..3a91c9439218e 100644 --- a/recipes/tclap/all/test_package/conanfile.py +++ b/recipes/tclap/all/test_package/conanfile.py @@ -1,9 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class TestTclapConan(ConanFile): - settings = "os", "compiler", "arch", "build_type" - 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) @@ -11,6 +21,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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tclap/all/test_package/test.cpp b/recipes/tclap/all/test_package/test_package.cpp similarity index 100% rename from recipes/tclap/all/test_package/test.cpp rename to recipes/tclap/all/test_package/test_package.cpp diff --git a/recipes/tclap/all/test_v1_package/CMakeLists.txt b/recipes/tclap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/tclap/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/tclap/all/test_v1_package/conanfile.py b/recipes/tclap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/tclap/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/thelink2012-any/all/conanfile.py b/recipes/thelink2012-any/all/conanfile.py index 2ecc1a7f7608f..b909aaa407a58 100644 --- a/recipes/thelink2012-any/all/conanfile.py +++ b/recipes/thelink2012-any/all/conanfile.py @@ -1,37 +1,54 @@ -from conans import ConanFile, tools +# TODO: verify the Conan v2 migration +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" -required_conan_version = ">=1.33.0" class Thelink2012AnyConan(ConanFile): name = "thelink2012-any" - license = "BSL-1.0" description = "Implementation of std::experimental::any, including small object optimization, for C++11 compilers" - topics = ("any", "c++11", "data-structures") - homepage = "https://github.com/thelink2012/any" + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/thelink2012/any" + topics = ("any", "c++11", "data-structures", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - generators = "cmake" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, self._min_cppstd) def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - self.copy("any.hpp", "include", self._source_subfolder) - - def package_id(self): - self.info.header_only() + copy(self, "LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "any.hpp", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "any") + self.cpp_info.set_property("cmake_target_name", "any::any") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "any" self.cpp_info.names["cmake_find_package_multi"] = "any" - self.cpp_info.set_property("cmake_target_name", "any::any") diff --git a/recipes/thelink2012-any/all/test_package/CMakeLists.txt b/recipes/thelink2012-any/all/test_package/CMakeLists.txt index 5e31011d1713d..6e9d1837691aa 100644 --- a/recipes/thelink2012-any/all/test_package/CMakeLists.txt +++ b/recipes/thelink2012-any/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(any CONFIG REQUIRED) +find_package(any REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} any::any) diff --git a/recipes/thelink2012-any/all/test_package/conanfile.py b/recipes/thelink2012-any/all/test_package/conanfile.py index 6b551939fbde3..fae501d0afb9e 100644 --- a/recipes/thelink2012-any/all/test_package/conanfile.py +++ b/recipes/thelink2012-any/all/test_package/conanfile.py @@ -1,9 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class TestConan(ConanFile): + +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/thelink2012-any/all/test_v1_package/CMakeLists.txt b/recipes/thelink2012-any/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/thelink2012-any/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/thelink2012-any/all/test_v1_package/conanfile.py b/recipes/thelink2012-any/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6b551939fbde3 --- /dev/null +++ b/recipes/thelink2012-any/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class TestConan(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/thrift/all/conandata.yml b/recipes/thrift/all/conandata.yml index ab039201f49e0..57ad35a140baa 100644 --- a/recipes/thrift/all/conandata.yml +++ b/recipes/thrift/all/conandata.yml @@ -1,23 +1,30 @@ sources: + "0.18.1": + url: "http://archive.apache.org/dist/thrift/0.18.1/thrift-0.18.1.tar.gz" + sha256: "04c6f10e5d788ca78e13ee2ef0d2152c7b070c0af55483d6b942e29cff296726" "0.17.0": - url: "https://github.com/apache/thrift/archive/v0.17.0.tar.gz" - sha256: "f5888bcd3b8de40c2c2ab86896867ad9b18510deb412cba3e5da76fb4c604c29" + url: "http://archive.apache.org/dist/thrift/0.17.0/thrift-0.17.0.tar.gz" + sha256: "b272c1788bb165d99521a2599b31b97fa69e5931d099015d91ae107a0b0cc58f" "0.16.0": - url: "https://github.com/apache/thrift/archive/refs/tags/v0.16.0.tar.gz" - sha256: "df2931de646a366c2e5962af679018bca2395d586e00ba82d09c0379f14f8e7b" + url: "http://archive.apache.org/dist/thrift/0.16.0/thrift-0.16.0.tar.gz" + sha256: "f460b5c1ca30d8918ff95ea3eb6291b3951cf518553566088f3f2be8981f6209" "0.15.0": - url: "https://github.com/apache/thrift/archive/refs/tags/v0.15.0.tar.gz" - sha256: "32d2f18aa9be114619ee54e1abc3bb497febb2a8aa917894c20bae21185fac15" + url: "http://archive.apache.org/dist/thrift/0.15.0/thrift-0.15.0.tar.gz" + sha256: "d5883566d161f8f6ddd4e21f3a9e3e6b8272799d054820f1c25b11e86718f86b" "0.14.2": - url: "https://github.com/apache/thrift/archive/v0.14.2.tar.gz" - sha256: "f966cdac6bb8d149a9950a761e6ee6f3b22d5a6073da43a333d3468f159ebeaa" + url: "http://archive.apache.org/dist/thrift/0.14.2/thrift-0.14.2.tar.gz" + sha256: "4191bfc0b7490e20cc69f9f4dc6e991fbb612d4551aa9eef1dbf7f4c47ce554d" "0.14.1": - url: "https://github.com/apache/thrift/archive/refs/tags/v0.14.1.tar.gz" - sha256: "5ae1c4d16452a22eaf9d802ba7489907147c2b316ff38c9758918552fae5132c" - "0.13.0": - url: "https://github.com/apache/thrift/archive/0.13.0.tar.gz" - sha256: "8469c8d72c684c6de72ddf55fc65d1c10868a576e7dc4d1f4a21a59814b97110" + url: "http://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz" + sha256: "13da5e1cd9c8a3bb89778c0337cc57eb0c29b08f3090b41cf6ab78594b410ca5" patches: + "0.18.1": + - patch_file: "patches/cmake-0.16.0.patch" + patch_description: "use cci packages" + patch_type: "conan" + - patch_file: "patches/0.18.1-0002-include-stddef.patch" + patch_description: "include cstddef" + patch_type: "portability" "0.17.0": - patch_file: "patches/cmake-0.16.0.patch" patch_description: "use cci packages" @@ -38,7 +45,3 @@ patches: - patch_file: "patches/cmake-0.14.1.patch" patch_description: "use cci packages" patch_type: "conan" - "0.13.0": - - patch_file: "patches/cmake-0.13.0.patch" - patch_description: "use cci packages" - patch_type: "conan" diff --git a/recipes/thrift/all/conanfile.py b/recipes/thrift/all/conanfile.py index 0aaa55ea7ce2b..54cc1c65d6945 100644 --- a/recipes/thrift/all/conanfile.py +++ b/recipes/thrift/all/conanfile.py @@ -67,7 +67,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0", transitive_headers=True) + self.requires("boost/1.82.0", transitive_headers=True) if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") if self.options.with_zlib: diff --git a/recipes/thrift/all/patches/0.18.1-0002-include-stddef.patch b/recipes/thrift/all/patches/0.18.1-0002-include-stddef.patch new file mode 100644 index 0000000000000..f8195ce2910ed --- /dev/null +++ b/recipes/thrift/all/patches/0.18.1-0002-include-stddef.patch @@ -0,0 +1,24 @@ +diff --git a/lib/cpp/src/thrift/numeric_cast.h b/lib/cpp/src/thrift/numeric_cast.h +index d7063db..8775121 100644 +--- a/lib/cpp/src/thrift/numeric_cast.h ++++ b/lib/cpp/src/thrift/numeric_cast.h +@@ -22,6 +22,7 @@ + + #include + #include ++#include + + #if defined(_MSC_VER) + // avoid compiler warnings and errors in MSVC if max is defined as a macro +diff --git a/lib/cpp/src/thrift/transport/TBufferTransports.h b/lib/cpp/src/thrift/transport/TBufferTransports.h +index f72d8f6..f745b8c 100644 +--- a/lib/cpp/src/thrift/transport/TBufferTransports.h ++++ b/lib/cpp/src/thrift/transport/TBufferTransports.h +@@ -22,6 +22,7 @@ + + #include + #include ++#include + #include + + #include diff --git a/recipes/thrift/config.yml b/recipes/thrift/config.yml index 66a1ad96af024..8ce3e9b3821f4 100644 --- a/recipes/thrift/config.yml +++ b/recipes/thrift/config.yml @@ -1,4 +1,6 @@ versions: + "0.18.1": + folder: all "0.17.0": folder: all "0.16.0": @@ -9,5 +11,3 @@ versions: folder: all "0.14.1": folder: all - "0.13.0": - folder: all diff --git a/recipes/thrust/all/conanfile.py b/recipes/thrust/all/conanfile.py index eb0ee0d040efe..01049f1cfb97f 100644 --- a/recipes/thrust/all/conanfile.py +++ b/recipes/thrust/all/conanfile.py @@ -31,9 +31,8 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - # TODO: https://github.com/conan-io/conan-center-index/pull/17484 # Otherwise CUB from system CUDA is used, which is not guaranteed to be compatible - # self.requires("cub/1.17.2") + self.requires("cub/1.17.2") if self.options.device_system == "tbb": self.requires("onetbb/2021.9.0") diff --git a/recipes/tinydir/all/conanfile.py b/recipes/tinydir/all/conanfile.py index 02a2a8bc1ce2e..05e3a7a3c83ca 100644 --- a/recipes/tinydir/all/conanfile.py +++ b/recipes/tinydir/all/conanfile.py @@ -1,7 +1,11 @@ import os -from conans import ConanFile, tools -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" + class TinydirConan(ConanFile): name = "tinydir" @@ -10,19 +14,24 @@ class TinydirConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/cxong/tinydir" topics = ("portable", "filesystem", "directory", "posix", "header-only") + + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() 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("tinydir.h", dst="include", src=self._source_subfolder) - self.copy("COPYING", dst="licenses", src=self._source_subfolder) + copy(self, "tinydir.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/tinydir/all/test_package/CMakeLists.txt b/recipes/tinydir/all/test_package/CMakeLists.txt index bd0eb537bad62..f2b0b480c35cb 100644 --- a/recipes/tinydir/all/test_package/CMakeLists.txt +++ b/recipes/tinydir/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) find_package(tinydir REQUIRED CONFIG) diff --git a/recipes/tinydir/all/test_package/conanfile.py b/recipes/tinydir/all/test_package/conanfile.py index 38f4483872d47..e0e49c1e8d6b6 100644 --- a/recipes/tinydir/all/test_package/conanfile.py +++ b/recipes/tinydir/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tinydir/all/test_v1_package/CMakeLists.txt b/recipes/tinydir/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/tinydir/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tinydir/all/test_v1_package/conanfile.py b/recipes/tinydir/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tinydir/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/tinydir/all/test_v1_package/test_package.c b/recipes/tinydir/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..cc0003c9c9d0c --- /dev/null +++ b/recipes/tinydir/all/test_v1_package/test_package.c @@ -0,0 +1,27 @@ +#include +#include + +#include "tinydir.h" + +int main() +{ + tinydir_dir dir; + tinydir_open(&dir, "."); + + while (dir.has_next) + { + tinydir_file file; + tinydir_readfile(&dir, &file); + + printf("%s", file.name); + if (file.is_dir) + { + printf("/"); + } + printf("\n"); + + tinydir_next(&dir); + } + + tinydir_close(&dir); +} diff --git a/recipes/tinyexr/all/conandata.yml b/recipes/tinyexr/all/conandata.yml index 6fdffb908d2c6..2b4deeb06840b 100644 --- a/recipes/tinyexr/all/conandata.yml +++ b/recipes/tinyexr/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.6": + url: "https://github.com/syoyo/tinyexr/archive/v1.0.6.tar.gz" + sha256: "807a5665a7da8dc5ba4dd2c0f69079d87f37a147399680a54e3b38f86486aa67" "1.0.1": url: "https://github.com/syoyo/tinyexr/archive/v1.0.1.tar.gz" sha256: "4dbbd8c7d17597ad557518de5eb923bd02683d26d0de765f9224e8d57d121677" diff --git a/recipes/tinyexr/all/conanfile.py b/recipes/tinyexr/all/conanfile.py index 889c4c311e95f..26a07647634a1 100644 --- a/recipes/tinyexr/all/conanfile.py +++ b/recipes/tinyexr/all/conanfile.py @@ -13,7 +13,7 @@ class TinyExrConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/syoyo/tinyexr" topics = ("exr", "header-only") - + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "with_z": ["zlib", "miniz"], @@ -38,7 +38,7 @@ def layout(self): def requirements(self): if self.options.with_z == "miniz": - self.requires("miniz/3.0.1") + self.requires("miniz/3.0.2") else: self.requires("zlib/1.2.13") if self.options.with_zfp: diff --git a/recipes/tinyexr/config.yml b/recipes/tinyexr/config.yml index af3bb0714e65c..b08dcb504fac7 100644 --- a/recipes/tinyexr/config.yml +++ b/recipes/tinyexr/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.6": + folder: all "1.0.1": folder: all "1.0.0": diff --git a/recipes/tinygltf/all/conandata.yml b/recipes/tinygltf/all/conandata.yml index 0e07d04c2de59..ecf335230f785 100644 --- a/recipes/tinygltf/all/conandata.yml +++ b/recipes/tinygltf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.8.13": + url: "https://github.com/syoyo/tinygltf/archive/v2.8.13.tar.gz" + sha256: "72c3e5affa8389442582e4cf67426376e2dff418e998e19822260f4bf58b74b8" "2.5.0": url: "https://github.com/syoyo/tinygltf/archive/v2.5.0.tar.gz" sha256: "5d85bd556b60b1b69527189293cfa4902957d67fabb8582b6532f23a5ef27ec1" diff --git a/recipes/tinygltf/all/conanfile.py b/recipes/tinygltf/all/conanfile.py index 1d6e2279c2680..4f9e36874366d 100644 --- a/recipes/tinygltf/all/conanfile.py +++ b/recipes/tinygltf/all/conanfile.py @@ -11,10 +11,10 @@ class TinygltfConan(ConanFile): name = "tinygltf" description = "Header only C++11 tiny glTF 2.0 library." license = "MIT" - topics = ("gltf") - homepage = "https://github.com/syoyo/tinygltf" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://github.com/syoyo/tinygltf" + topics = ("gltf", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "draco": [True, False], @@ -36,17 +36,16 @@ def package_id(self): def requirements(self): self.requires("nlohmann_json/3.11.2") if self.options.draco: - self.requires("draco/1.5.5") + self.requires("draco/1.5.6") if self.options.stb_image or self.options.stb_image_write: - self.requires("stb/cci.20210910") + self.requires("stb/cci.20220909") 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 build(self): replace_in_file(self, os.path.join(self.source_folder, "tiny_gltf.h"), diff --git a/recipes/tinygltf/config.yml b/recipes/tinygltf/config.yml index a23d2b23eb439..b8d9dd2cb9e3a 100644 --- a/recipes/tinygltf/config.yml +++ b/recipes/tinygltf/config.yml @@ -1,4 +1,6 @@ versions: + "2.8.13": + folder: all "2.5.0": folder: all "2.4.0": diff --git a/recipes/tl-optional/all/conandata.yml b/recipes/tl-optional/all/conandata.yml index eb9035a81e907..bf26f6c9e3c77 100644 --- a/recipes/tl-optional/all/conandata.yml +++ b/recipes/tl-optional/all/conandata.yml @@ -2,3 +2,6 @@ sources: "1.0.0": url: https://github.com/TartanLlama/optional/archive/v1.0.0.zip sha256: 8bb68defc61da3de2b4cd73ef9792eba44570ec5cb52c4da731286f24aecbb95 + "1.1.0": + url: https://github.com/TartanLlama/optional/archive/v1.1.0.zip + sha256: a336bb10f51945369c1dd6dc6d2a7086602ab9cab52c98a7a6224bfd782bc0c7 diff --git a/recipes/tl-optional/config.yml b/recipes/tl-optional/config.yml index 40341aa3db6cd..b0abed6f3ca04 100644 --- a/recipes/tl-optional/config.yml +++ b/recipes/tl-optional/config.yml @@ -1,3 +1,5 @@ versions: "1.0.0": folder: all + "1.1.0": + folder: all diff --git a/recipes/tllist/all/conanfile.py b/recipes/tllist/all/conanfile.py index 3aefd5f1a8e81..35ff91663df3f 100644 --- a/recipes/tllist/all/conanfile.py +++ b/recipes/tllist/all/conanfile.py @@ -1,40 +1,70 @@ -from conan import ConanFile -from conans import tools -from conans.errors import ConanInvalidConfiguration +import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class TllistConan(ConanFile): name = "tllist" + description = "A C header file only implementation of a typed linked list." license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://codeberg.org/dnkl/tllist" - description = "A C header file only implementation of a typed linked list." - topics = ("list", "utils", "typed-linked-list") - settings = "os", "arch", "build_type", "compiler" + topics = ("list", "utils", "typed-linked-list", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "gcc": "7", + "clang": "5.0", + "apple-clang": "9.1", + } + + 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." + ) + # tllist relies on __typeof__, not implemented in Visual Studio - if self.settings.compiler == "Visual Studio": + if is_msvc(self): raise ConanInvalidConfiguration("Visual Studio compiler is 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) def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("*.h", src=self._source_subfolder, dst="include") - - def package_id(self): - self.info.header_only() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.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 = [] + self.cpp_info.set_property("pkg_config_name", "tllist") diff --git a/recipes/tllist/all/test_package/CMakeLists.txt b/recipes/tllist/all/test_package/CMakeLists.txt index 929cb14b5f70b..33ff310d27421 100644 --- a/recipes/tllist/all/test_package/CMakeLists.txt +++ b/recipes/tllist/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tllist CONFIG REQUIRED) +find_package(tllist REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} tllist::tllist) diff --git a/recipes/tllist/all/test_package/conanfile.py b/recipes/tllist/all/test_package/conanfile.py index 49a3a66ea5bad..fae501d0afb9e 100644 --- a/recipes/tllist/all/test_package/conanfile.py +++ b/recipes/tllist/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tllist/all/test_v1_package/CMakeLists.txt b/recipes/tllist/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/tllist/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tllist/all/test_v1_package/conanfile.py b/recipes/tllist/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/tllist/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tllist/all/test_v1_package/test_package.c b/recipes/tllist/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..77b3400127915 --- /dev/null +++ b/recipes/tllist/all/test_v1_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include + +int main(int argc, const char *const *argv) { + tll(int) l = tll_init(); + + tll_push_back(l, 43); + + return EXIT_SUCCESS; +} diff --git a/recipes/tlx/all/conandata.yml b/recipes/tlx/all/conandata.yml index 5d98c93707e87..4dc1e534af439 100644 --- a/recipes/tlx/all/conandata.yml +++ b/recipes/tlx/all/conandata.yml @@ -1,8 +1,14 @@ sources: + "0.6.1": + url: "https://github.com/tlx/tlx/archive/refs/tags/v0.6.1.tar.gz" + sha256: "24dd1acf36dd43b8e0414420e3f9adc2e6bb0e75047e872a06167961aedad769" "0.5.20200222": url: "https://github.com/tlx/tlx/archive/refs/tags/v0.5.20200222.tar.gz" sha256: "99e63691af3ada066682243f3a65cd6eb32700071cdd6cfedb18777b5ff5ff4d" patches: + "0.6.1": + - patch_file: "patches/0001-fix-dll-install.patch" + - patch_file: "patches/0002-fix-shared-apple.patch" "0.5.20200222": - patch_file: "patches/0001-fix-dll-install.patch" - patch_file: "patches/0002-fix-shared-apple.patch" diff --git a/recipes/tlx/config.yml b/recipes/tlx/config.yml index 08dbe5e6d3977..1a2097579ad40 100644 --- a/recipes/tlx/config.yml +++ b/recipes/tlx/config.yml @@ -1,3 +1,5 @@ versions: + "0.6.1": + folder: all "0.5.20200222": folder: all diff --git a/recipes/tracy/all/conandata.yml b/recipes/tracy/all/conandata.yml index 266a1ecb7f6b1..e66204ae4d119 100644 --- a/recipes/tracy/all/conandata.yml +++ b/recipes/tracy/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.1": + url: "https://github.com/wolfpld/tracy/archive/refs/tags/v0.9.1.tar.gz" + sha256: "c2de9f35ab2a516a9689ff18f5b62a55b73b93b66514bd09ba013d7957993cd7" "0.9": url: "https://github.com/wolfpld/tracy/archive/refs/tags/v0.9.tar.gz" sha256: "93a91544e3d88f3bc4c405bad3dbc916ba951cdaadd5fcec1139af6fa56e6bfc" diff --git a/recipes/tracy/config.yml b/recipes/tracy/config.yml index 77aaa018b1794..6bea7d9080e33 100644 --- a/recipes/tracy/config.yml +++ b/recipes/tracy/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.1": + folder: all "0.9": folder: all "0.8.2.1": diff --git a/recipes/troldal-zippy/all/conandata.yml b/recipes/troldal-zippy/all/conandata.yml index 0c73d6b1de095..c40a62c37d987 100644 --- a/recipes/troldal-zippy/all/conandata.yml +++ b/recipes/troldal-zippy/all/conandata.yml @@ -1,8 +1,7 @@ sources: "cci.20200622": url: "https://github.com/troldal/Zippy/archive/a838de8522f9051df0d1b202473bb6befe648702.tar.gz" - sha256: "8be803861b69c51179ade1f2ce62f07fb1f2d301a084d705c8ec2374db22071a" + sha256: "0233303a49bae9f705cb25c44e7f8c9917c49a90c8e314ca79f48dd23dd1a836" patches: "cci.20200622": - patch_file: "patches/zippy-archive-mkdir.patch" - base_path: "source_subfolder" diff --git a/recipes/troldal-zippy/all/conanfile.py b/recipes/troldal-zippy/all/conanfile.py index 9264f7d6a36ec..c1f661d53497d 100644 --- a/recipes/troldal-zippy/all/conanfile.py +++ b/recipes/troldal-zippy/all/conanfile.py @@ -1,25 +1,26 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + class TroldalZippyConan(ConanFile): name = "troldal-zippy" - description = "A simple C++ wrapper around the \"miniz\" zip library " - topics = ("wrapper", "compression", "zip") + description = 'A simple C++ wrapper around the "miniz" zip library ' + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/troldal/Zippy" - license = "MIT" - settings = "compiler" - exports_sources = "patches/*" - - @property - def _source_subfolder(self): - return "source_subfolder" + topics = ("wrapper", "compression", "zip", "header-only") - def requirements(self): - self.requires("miniz/2.2.0") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _minimum_cpp_standard(self): @@ -34,34 +35,53 @@ def _minimum_compilers_version(self): "apple-clang": "10", } + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("miniz/2.2.0") + + 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.warning(f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.") else: - if tools.Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format( - self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler" + f" {self.settings.compiler} {self.settings.compiler.version} does not support it." + ) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.hpp", dst="include", src=os.path.join(self._source_subfolder, "library")) - - def package_id(self): - self.info.header_only() + apply_conandata_patches(self) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "library")) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + # To match the target created here - # https://github.com/troldal/Zippy/blob/a838de8522f9051df0d1b202473bb6befe648702/library/CMakeLists.txt#L10 + # https://github.com/troldal/Zippy/blob/a838de8522f9051df0d1b202473bb69befe648702/library/CMakeLists.txt#L10 + self.cpp_info.set_property("cmake_file_name", "Zippy") + self.cpp_info.set_property("cmake_target_name", "Zippy::Zippy") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "Zippy" self.cpp_info.filenames["cmake_find_package_multi"] = "Zippy" self.cpp_info.names["cmake_find_package"] = "Zippy" diff --git a/recipes/troldal-zippy/all/test_package/CMakeLists.txt b/recipes/troldal-zippy/all/test_package/CMakeLists.txt index 6c1d84c7e3d82..90b1ca052dca1 100644 --- a/recipes/troldal-zippy/all/test_package/CMakeLists.txt +++ b/recipes/troldal-zippy/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(Zippy REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE Zippy::Zippy) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/troldal-zippy/all/test_package/conanfile.py b/recipes/troldal-zippy/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/troldal-zippy/all/test_package/conanfile.py +++ b/recipes/troldal-zippy/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/troldal-zippy/all/test_v1_package/CMakeLists.txt b/recipes/troldal-zippy/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/troldal-zippy/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/troldal-zippy/all/test_v1_package/conanfile.py b/recipes/troldal-zippy/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/troldal-zippy/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tsl-hopscotch-map/all/conandata.yml b/recipes/tsl-hopscotch-map/all/conandata.yml index 6166a7c7730e6..191b340d98e5d 100644 --- a/recipes/tsl-hopscotch-map/all/conandata.yml +++ b/recipes/tsl-hopscotch-map/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.1": + url: "https://github.com/Tessil/hopscotch-map/archive/v2.3.1.tar.gz" + sha256: "53dab49005cd5dc859f2546d0d3eef058ec7fb3b74fc3b19f4965a9a151e9b20" "2.3.0": url: "https://github.com/Tessil/hopscotch-map/archive/v2.3.0.tar.gz" sha256: "a59d65b552dc7682521989842418c92257147f5068152b5af50e917892ad9317" diff --git a/recipes/tsl-hopscotch-map/all/conanfile.py b/recipes/tsl-hopscotch-map/all/conanfile.py index 6772f3c321bc9..cb1372f74dd49 100644 --- a/recipes/tsl-hopscotch-map/all/conanfile.py +++ b/recipes/tsl-hopscotch-map/all/conanfile.py @@ -11,9 +11,10 @@ class TslHopscotchMapConan(ConanFile): name = "tsl-hopscotch-map" license = "MIT" description = "C++ implementation of a fast hash map and hash set using hopscotch hashing" - topics = ("structure", "hash map", "hash set") - homepage = "https://github.com/Tessil/hopscotch-map" + topics = ("structure", "hash map", "hash set", "header-only") url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Tessil/hopscotch-map" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -28,8 +29,7 @@ def validate(self): 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 build(self): pass @@ -43,7 +43,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "tsl::hopscotch_map") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-hopscotch-map" @@ -55,4 +54,3 @@ def package_info(self): self.cpp_info.components["hopscotch_map"].set_property("cmake_target_name", "tsl::hopscotch_map") self.cpp_info.components["hopscotch_map"].bindirs = [] self.cpp_info.components["hopscotch_map"].libdirs = [] - self.cpp_info.components["hopscotch_map"].resdirs = [] diff --git a/recipes/tsl-hopscotch-map/config.yml b/recipes/tsl-hopscotch-map/config.yml index d724287fc23cb..7e1b2aadac1de 100644 --- a/recipes/tsl-hopscotch-map/config.yml +++ b/recipes/tsl-hopscotch-map/config.yml @@ -1,3 +1,5 @@ versions: + "2.3.1": + folder: all "2.3.0": folder: all diff --git a/recipes/type_safe/all/conandata.yml b/recipes/type_safe/all/conandata.yml index 8703a48442789..0be0030fda0b5 100644 --- a/recipes/type_safe/all/conandata.yml +++ b/recipes/type_safe/all/conandata.yml @@ -1,7 +1,10 @@ sources: + "0.2.3": + url: "https://github.com/foonathan/type_safe/archive/v0.2.3.tar.gz" + sha256: "19008ab9526b0d2db1ae6bbd6640f5f7a398826bb2266561472e9f1b10d85bec" "0.2.2": url: "https://github.com/foonathan/type_safe/archive/v0.2.2.tar.gz" sha256: "34d97123fb9bca04a333565c4a2498425d602ec0c759de4be1b8cfae77d05823" '0.2.1': - url: https://github.com/foonathan/type_safe/archive/v0.2.1.zip - sha256: 1c941f7ecd5e17e80773a2d8c9c905f552cc80417f8006ade7e9fa3525ff1b55 + url: "https://github.com/foonathan/type_safe/archive/v0.2.1.tar.gz" + sha256: "49c703d52b724635cb9ee0cfeac9e2c9957134380da900a69791bd0e3d0c3673" diff --git a/recipes/type_safe/all/conanfile.py b/recipes/type_safe/all/conanfile.py index 0864c1a6720cf..a527bd249ec3e 100644 --- a/recipes/type_safe/all/conanfile.py +++ b/recipes/type_safe/all/conanfile.py @@ -1,37 +1,53 @@ -from conans import ConanFile, tools import os -class TypeSafe(ConanFile): - name = 'type_safe' - description = 'Zero overhead utilities for preventing bugs at compile time' - url = 'https://github.com/conan-io/conan-center-index' - homepage = 'https://foonathan.net/type_safe' - license = 'MIT' - topics = 'conan', 'c++', 'strong typing', 'vocabulary-types' +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout - settings = 'compiler' +required_conan_version = ">=1.52.0" - no_copy_source = True - _source_subfolder = 'source_subfolder' - requires = 'debug_assert/1.3.3' +class TypeSafe(ConanFile): + name = "type_safe" + description = "Zero overhead utilities for preventing bugs at compile time" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://type_safe.foonathan.net/" + topics = ("c++", "strong typing", "vocabulary-types", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property - def _repo_folder(self): - return os.path.join(self.source_folder, self._source_subfolder) + def _min_cppstd(self): + return 11 - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("debug_assert/1.3.3") - def configure(self): + def package_id(self): + self.info.clear() + + def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, '11') + check_min_cppstd(self, self._min_cppstd) - def package(self): - self.copy("*LICENSE", dst="licenses", keep_path=False) - self.copy("*", src=os.path.join(self._repo_folder, 'include'), dst='include/') + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def package_id(self): - self.info.header_only() + def package(self): + copy(self, "*LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, keep_path=False) + copy(self, "*", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/type_safe/all/test_package/CMakeLists.txt b/recipes/type_safe/all/test_package/CMakeLists.txt index 33ae887aa6aea..d669047ac6039 100644 --- a/recipes/type_safe/all/test_package/CMakeLists.txt +++ b/recipes/type_safe/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(type_safe 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 type_safe::type_safe) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/type_safe/all/test_package/conanfile.py b/recipes/type_safe/all/test_package/conanfile.py index bd7165a553cf4..fae501d0afb9e 100644 --- a/recipes/type_safe/all/test_package/conanfile.py +++ b/recipes/type_safe/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/type_safe/all/test_v1_package/CMakeLists.txt b/recipes/type_safe/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/type_safe/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/type_safe/all/test_v1_package/conanfile.py b/recipes/type_safe/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7e2dfe859bb27 --- /dev/null +++ b/recipes/type_safe/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/type_safe/config.yml b/recipes/type_safe/config.yml index 3d99cc668cde3..ae20ba2754647 100644 --- a/recipes/type_safe/config.yml +++ b/recipes/type_safe/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.3": + folder: all "0.2.2": folder: all '0.2.1': diff --git a/recipes/ua-nodeset/all/conanfile.py b/recipes/ua-nodeset/all/conanfile.py index 0414764f76035..b0566af78f907 100644 --- a/recipes/ua-nodeset/all/conanfile.py +++ b/recipes/ua-nodeset/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, CMake, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.files import copy, get, load, save + +required_conan_version = ">=1.47.0" class UaNodeSetConan(ConanFile): @@ -12,32 +14,34 @@ class UaNodeSetConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" topics = ("opc-ua-specifications", "uanodeset", "normative-files", "companion-specification") - no_copy_source = True - - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "build-scripts" + settings = "os", "arch", "compiler", "build_type" + short_paths = True - def _extract_license(self): - content = tools.load(os.path.join(self.source_folder, self._source_subfolder, "AnsiC", "opcua_clientapi.c")) - license_contents = content[2:content.find("*/", 1)] - tools.save("LICENSE", license_contents) + def layout(self): + pass - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + def package_id(self): + self.info.clear() def build(self): - pass + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def _extract_license(self): + content = load(self, os.path.join(self.build_folder, "AnsiC", "opcua_clientapi.c")) + license_contents = content[2 : content.find("*/", 1)] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) def package(self): self._extract_license() - self.copy("*", dst="res", src=self._source_subfolder) - self.copy("LICENSE", dst="licenses") - + copy(self, "*", dst=os.path.join(self.package_folder, "res"), src=self.build_folder) def package_info(self): - self.cpp_info.libdirs = [] + self.conf_info.define("user.ua-nodeset:nodeset_dir", os.path.join(self.package_folder, "res")) self.cpp_info.resdirs = ["res"] - self.user_info.nodeset_dir = os.path.join(self.package_folder, "res") + self.cpp_info.libdirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.includedirs = [] + # TODO: to remove in conan v2 + self.user_info.nodeset_dir = os.path.join(self.package_folder, "res") diff --git a/recipes/ua-nodeset/all/test_package/conanfile.py b/recipes/ua-nodeset/all/test_package/conanfile.py index 872e7a1f2874d..02a908bec924b 100644 --- a/recipes/ua-nodeset/all/test_package/conanfile.py +++ b/recipes/ua-nodeset/all/test_package/conanfile.py @@ -1,12 +1,24 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.files import load, save -class TestUaNodeSetConan(ConanFile): - def build(self): +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def layout(self): pass - def test(self): - assert os.path.exists(os.path.join(self.deps_user_info["ua-nodeset"].nodeset_dir, "PLCopen")) + def generate(self): + nodeset_dir = self.dependencies["ua-nodeset"].conf_info.get("user.ua-nodeset:nodeset_dir") + save(self, "nodeset_dir", nodeset_dir) + def requirements(self): + self.requires(self.tested_reference_str) + + def test(self): + nodeset_dir = load(self, "nodeset_dir") + test_path = os.path.join(nodeset_dir, "PLCopen") + assert os.path.exists(test_path) diff --git a/recipes/ua-nodeset/all/test_v1_package/conanfile.py b/recipes/ua-nodeset/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..872e7a1f2874d --- /dev/null +++ b/recipes/ua-nodeset/all/test_v1_package/conanfile.py @@ -0,0 +1,12 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestUaNodeSetConan(ConanFile): + + def build(self): + pass + + def test(self): + assert os.path.exists(os.path.join(self.deps_user_info["ua-nodeset"].nodeset_dir, "PLCopen")) + diff --git a/recipes/uni-algo/all/conandata.yml b/recipes/uni-algo/all/conandata.yml index bbb5332eaec1a..506f983a8dd2c 100644 --- a/recipes/uni-algo/all/conandata.yml +++ b/recipes/uni-algo/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.0.0": + url: "https://github.com/uni-algo/uni-algo/archive/v1.0.0.tar.gz" + sha256: "a59d61cd4a4fff08672831c7e5a8c204bb6e96c21506b6471771c01b38958a15" + "0.8.2": + url: "https://github.com/uni-algo/uni-algo/archive/v0.8.2.tar.gz" + sha256: "c0dab8ae1dbbab3e33b0c5bb512e927badb57f53e7ee96517c1dfd2e078b7669" "0.8.1": url: "https://github.com/uni-algo/uni-algo/archive/v0.8.1.tar.gz" sha256: "11192280fa435a9d68131d5368d2b314201d7089e6d2f38f29a8591c9aafa776" diff --git a/recipes/uni-algo/config.yml b/recipes/uni-algo/config.yml index 1764f2d6c3778..9ca04a66695ca 100644 --- a/recipes/uni-algo/config.yml +++ b/recipes/uni-algo/config.yml @@ -1,4 +1,8 @@ versions: + "1.0.0": + folder: all + "0.8.2": + folder: all "0.8.1": folder: all "0.8.0": diff --git a/recipes/unity/all/conandata.yml b/recipes/unity/all/conandata.yml new file mode 100644 index 0000000000000..a3d7facb1dfbb --- /dev/null +++ b/recipes/unity/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.5.2": + url: "https://github.com/ThrowTheSwitch/Unity/archive/refs/tags/v2.5.2.tar.gz" + sha256: "3786de6c8f389be3894feae4f7d8680a02e70ed4dbcce36109c8f8646da2671a" diff --git a/recipes/unity/all/conanfile.py b/recipes/unity/all/conanfile.py new file mode 100644 index 0000000000000..7170cbf7699d0 --- /dev/null +++ b/recipes/unity/all/conanfile.py @@ -0,0 +1,62 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class UnityConan(ConanFile): + name = "unity" + description = "Unity Test is a unit testing framework built for C, with a focus on working with embedded toolchains" + topics = ("unit-test", "tdd", "bdd", "testing") + license = "MIT" + homepage = "http://www.throwtheswitch.org" + url = "https://github.com/conan-io/conan-center-index" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "fixture_extension": [True, False], + "memory_extension": [True, False], + } + default_options = { + "fPIC": True, + "fixture_extension": False, + "memory_extension": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["UNITY_EXTENSION_FIXTURE"] = self.options.fixture_extension + tc.cache_variables["UNITY_EXTENSION_MEMORY"] = self.options.memory_extension + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["unity"] + self.cpp_info.includedirs = ["include", "include/unity"] diff --git a/recipes/unity/all/test_package/CMakeLists.txt b/recipes/unity/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ac959a17f44e2 --- /dev/null +++ b/recipes/unity/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(unity REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE unity::unity) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/unity/all/test_package/conanfile.py b/recipes/unity/all/test_package/conanfile.py new file mode 100644 index 0000000000000..254feca104287 --- /dev/null +++ b/recipes/unity/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, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/unity/all/test_package/test_package.c b/recipes/unity/all/test_package/test_package.c new file mode 100644 index 0000000000000..ecc0ee2a6b4ef --- /dev/null +++ b/recipes/unity/all/test_package/test_package.c @@ -0,0 +1,22 @@ +#include + + +void setUp(void) +{ +} + +void tearDown(void) +{ +} + +void test_Something(void) +{ + TEST_ASSERT_EQUAL_INT(1, 1); +} + +int main(void) +{ + UNITY_BEGIN(); + RUN_TEST(test_Something); + return UNITY_END(); +} diff --git a/recipes/unity/config.yml b/recipes/unity/config.yml new file mode 100644 index 0000000000000..2ac88b6313aec --- /dev/null +++ b/recipes/unity/config.yml @@ -0,0 +1,3 @@ +versions: + "2.5.2": + folder: all diff --git a/recipes/usockets/all/conandata.yml b/recipes/usockets/all/conandata.yml index 5b4a41335be2a..e6a17b330a5a4 100644 --- a/recipes/usockets/all/conandata.yml +++ b/recipes/usockets/all/conandata.yml @@ -23,56 +23,44 @@ sources: patches: "0.8.5": - patch_file: "patches/0001-makefile_0.8.3.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" "0.8.3": - patch_file: "patches/0001-makefile_0.8.3.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" "0.8.2": - patch_file: "patches/0001-makefile_0.8.2.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" - patch_file: "patches/0002-vcxproj_0.8.1.patch" - base_path: "source_subfolder" patch_description: "build static library" patch_type: "conan" "0.8.1": - patch_file: "patches/0001-makefile_0.8.1.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" - patch_file: "patches/0002-vcxproj_0.8.1.patch" - base_path: "source_subfolder" patch_description: "build static library" patch_type: "conan" "0.7.1": - patch_file: "patches/0001-makefile_0.6.0.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" - patch_file: "patches/0002-vcxproj.patch" - base_path: "source_subfolder" patch_description: "build static library" patch_type: "conan" "0.6.0": - patch_file: "patches/0001-makefile_0.6.0.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" - patch_file: "patches/0002-vcxproj.patch" - base_path: "source_subfolder" patch_description: "build static library" patch_type: "conan" "0.4.0": - patch_file: "patches/0001-makefile.patch" - base_path: "source_subfolder" patch_description: "remove lto options" patch_type: "portability" - patch_file: "patches/0002-vcxproj.patch" - base_path: "source_subfolder" patch_description: "build static library" patch_type: "conan" diff --git a/recipes/usockets/all/conanfile.py b/recipes/usockets/all/conanfile.py index 09208942cd97e..4f69ddfc963bf 100644 --- a/recipes/usockets/all/conanfile.py +++ b/recipes/usockets/all/conanfile.py @@ -1,16 +1,15 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, chdir +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, rmdir, chdir, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path, MSBuild, MSBuildDeps, MSBuildToolchain from conan.tools.scm import Version -from conan.tools.microsoft import is_msvc -from conan.errors import ConanInvalidConfiguration -from conans import MSBuild, AutoToolsBuildEnvironment -from conans.tools import vcvars, environment_append, unix_path, get_env import os -import contextlib -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.57.0" class UsocketsConan(ConanFile): name = "usockets" @@ -19,6 +18,7 @@ class UsocketsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/uNetworking/uSockets" topics = ("socket", "network", "web") + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -47,12 +47,14 @@ def _minimum_compilers_version(self, cppstd): standards = { "14": { "Visual Studio": "15", + "msvc": "191", "gcc": "5", "clang": "3.4", "apple-clang": "10", }, "17": { "Visual Studio": "16", + "msvc": "192", "gcc": "7", "clang": "6", "apple-clang": "10", @@ -60,14 +62,17 @@ def _minimum_compilers_version(self, cppstd): } return standards.get(cppstd) or {} - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + @property + def _uses_msbuild(self): + return Version(self.version) < "0.8.3" and is_msvc(self) + def export_sources(self): export_conandata_patches(self) @@ -77,10 +82,10 @@ def config_options(self): self.options.eventloop = "libuv" def validate(self): - if self.options.eventloop == "syscall" and self.info.settings.os == "Windows": + if self.options.eventloop == "syscall" and self.settings.os == "Windows": raise ConanInvalidConfiguration("syscall is not supported on Windows") - if self.options.eventloop == "gcd" and (self.info.settings.os != "Linux" or self.info.settings.compiler != "clang"): + if self.options.eventloop == "gcd" and (self.settings.os != "Linux" or self.settings.compiler != "clang"): raise ConanInvalidConfiguration("eventloop=gcd is only supported on Linux with clang") if Version(self.version) < "0.8.0" and self.options.eventloop not in ("syscall", "libuv", "gcd"): @@ -96,10 +101,10 @@ def validate(self): if not cppstd: return - if self.info.settings.compiler.get_safe("cppstd"): + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, cppstd) - minimum_version = self._minimum_compilers_version(cppstd).get(str(self.info.settings.compiler), False) + minimum_version = self._minimum_compilers_version(cppstd).get(str(self.settings.compiler), False) if minimum_version: if Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("{} requires C++{}, which your compiler does not support.".format(self.name, cppstd)) @@ -108,72 +113,95 @@ def validate(self): def configure(self): if bool(self._minimum_cpp_standard) == False: - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def requirements(self): if self.options.with_ssl == "openssl": - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") elif self.options.with_ssl == "wolfssl": - self.requires("wolfssl/5.5.1") + self.requires("wolfssl/5.6.3") if self.options.eventloop == "libuv": - self.requires("libuv/1.44.2") + self.requires("libuv/1.46.0") elif self.options.eventloop == "gcd": self.requires("libdispatch/5.3.2") elif self.options.eventloop == "boost": - self.requires("boost/1.81.0") + self.requires("boost/1.82.0") def build_requirements(self): - if self._settings_build.os == "Windows" and not get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - if self.settings.compiler == "Visual Studio": - self.build_requires("automake/1.16.5") + if self._settings_build.os == "Windows" and not self._uses_msbuild: + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def _patch_sources(self): apply_conandata_patches(self) - - def _build_msvc(self): - with chdir(self, os.path.join(self._source_subfolder)): - msbuild = MSBuild(self) - msbuild.build(project_file="uSockets.vcxproj", platforms={"x86": "Win32"}) - - @contextlib.contextmanager - def _build_context(self): - if is_msvc(self): - with vcvars(self): - env = { - "CC": "{} cl -nologo".format(unix_path(self.deps_user_info["automake"].compile)), - "CXX": "{} cl -nologo".format(unix_path(self.deps_user_info["automake"].compile)), - "CFLAGS": "-{}".format(self.settings.compiler.runtime), - "LD": "link", - "NM": "dumpbin -symbols", - "STRIP": ":", - "AR": "{} lib".format(unix_path(self.deps_user_info["automake"].ar_lib)), - "RANLIB": ":", - } + if self._uses_msbuild: + vcxproj_file = os.path.join(self.source_folder, "uSockets.vcxproj") + platform_toolset = MSBuildToolchain(self).toolset + import_conan_generators = "" + for props_file in ["conantoolchain.props", "conandeps.props"]: + props_path = os.path.join(self.generators_folder, props_file) + if os.path.exists(props_path): + import_conan_generators += f"" + + replace_in_file( + self, vcxproj_file, + "v141", + f"{platform_toolset}", + ) + if import_conan_generators: + replace_in_file( + self, vcxproj_file, + '''''', + f'''{import_conan_generators}\n''', + ) + + def generate(self): + if self._uses_msbuild: + tc = MSBuildToolchain(self) + tc.generate() + deps = MSBuildDeps(self) + deps.generate() + else: + tc = AutotoolsToolchain(self) + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self.conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, self.conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", f"{compile_wrapper} link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") if self.options.eventloop == "libuv": - env["CPPFLAGS"] = "-I" + unix_path(self.deps_cpp_info["libuv"].include_paths[0]) + " " + # Workaround for: https://github.com/conan-io/conan/issues/12784 + # Otherwise AutotoolsDeps should suffice + env.append("CPPFLAGS", "-I" + unix_path(self, self.dependencies["libuv"].cpp_info.includedirs[0])) + tc.generate(env) - with environment_append(env): - yield - else: - yield + deps = AutotoolsDeps(self) + deps.generate() + + def _build_msvc(self): + with chdir(self, os.path.join(self.source_folder)): + msbuild = MSBuild(self) + msbuild.build("uSockets.vcxproj") - def _build_configure(self): - autotools = AutoToolsBuildEnvironment(self) + def _build_autotools(self): + autotools = Autotools(self) autotools.fpic = self.options.get_safe("fPIC", False) - with chdir(self, self._source_subfolder): + with chdir(self, self.source_folder): args = ["WITH_LTO=0"] if self.options.with_ssl == "openssl": args.append("WITH_OPENSSL=1") @@ -187,22 +215,20 @@ def _build_configure(self): elif self.options.eventloop == "boost": args.append("WITH_ASIO=1") - args.extend(f"{key}={value}" for key, value in autotools.vars.items()) autotools.make(target="default", args=args) def build(self): self._patch_sources() - if Version(self.version) < "0.8.3" and is_msvc(self): + if self._uses_msbuild: self._build_msvc() else: - with self._build_context(): - self._build_configure() + self._build_autotools() def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self._source_subfolder) - copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self._source_subfolder, "src"), keep_path=True) - copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) - copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + 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, "src"), keep_path=True) + copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) # drop internal headers rmdir(self, os.path.join(self.package_folder, "include", "internal")) diff --git a/recipes/usockets/all/test_package/CMakeLists.txt b/recipes/usockets/all/test_package/CMakeLists.txt index 8502a8260d7ce..be191d27f55a9 100644 --- a/recipes/usockets/all/test_package/CMakeLists.txt +++ b/recipes/usockets/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(usockets REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/usockets/all/test_package/conanfile.py b/recipes/usockets/all/test_package/conanfile.py index 7895db93c24a6..e845ae751a301 100644 --- a/recipes/usockets/all/test_package/conanfile.py +++ b/recipes/usockets/all/test_package/conanfile.py @@ -1,12 +1,19 @@ from conan import ConanFile -from conan.tools.build import cross_building -from conans import CMake +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -14,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/util-linux-libuuid/all/conandata.yml b/recipes/util-linux-libuuid/all/conandata.yml new file mode 100644 index 0000000000000..4e1010ee8b94f --- /dev/null +++ b/recipes/util-linux-libuuid/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.39": + url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/util-linux-2.39.tar.xz" + sha256: "32b30a336cda903182ed61feb3e9b908b762a5e66fe14e43efb88d37162075cb" diff --git a/recipes/util-linux-libuuid/all/conanfile.py b/recipes/util-linux-libuuid/all/conanfile.py new file mode 100644 index 0000000000000..736f1aadf0369 --- /dev/null +++ b/recipes/util-linux-libuuid/all/conanfile.py @@ -0,0 +1,115 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class UtilLinuxLibuuidConan(ConanFile): + name = "util-linux-libuuid" + description = "Universally unique id library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/util-linux/util-linux.git" + license = "BSD-3-Clause" + topics = "id", "identifier", "unique", "uuid" + package_type = "library" + provides = "libuuid" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _has_sys_file_header(self): + return self.settings.os in ["FreeBSD", "Linux", "Macos"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def _minimum_compiler_version(self, compiler, build_type): + min_version = { + "gcc": { + "Release": "4", + "Debug": "8", + }, + "clang": { + "Release": "3", + "Debug": "3", + }, + "apple-clang": { + "Release": "5", + "Debug": "5", + }, + } + return min_version.get(str(compiler), {}).get(str(build_type), "0") + + def validate(self): + min_version = self._minimum_compiler_version(self.settings.compiler, self.settings.build_type) + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration(f"{self.settings.compiler} {self.settings.compiler.version} does not meet the minimum version requirement of version {min_version}") + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Windows") + + def requirements(self): + if self.settings.os == "Macos": + # Required because libintl.{a,dylib} is not distributed via libc on Macos + self.requires("libgettext/0.21") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-all-programs") + tc.configure_args.append("--enable-libuuid") + if self._has_sys_file_header: + tc.extra_defines.append("HAVE_SYS_FILE_H") + if "x86" in self.settings.arch: + tc.extra_cflags.append("-mstackrealign") + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING.BSD-3-Clause", src=os.path.join(self.source_folder, "Documentation", "licenses"), dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "sbin")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "uuid") + self.cpp_info.set_property("cmake_target_name", "LibUUID::LibUUID") + self.cpp_info.set_property("cmake_file_name", "LibUUID") + self.cpp_info.libs = ["uuid"] + self.cpp_info.includedirs.append(os.path.join("include", "uuid")) diff --git a/recipes/util-linux-libuuid/all/test_package/CMakeLists.txt b/recipes/util-linux-libuuid/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..02a93367160a0 --- /dev/null +++ b/recipes/util-linux-libuuid/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(LibUUID REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE LibUUID::LibUUID) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/util-linux-libuuid/all/test_package/conanfile.py b/recipes/util-linux-libuuid/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/util-linux-libuuid/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/util-linux-libuuid/all/test_package/test_package.c b/recipes/util-linux-libuuid/all/test_package/test_package.c new file mode 100644 index 0000000000000..792d1d3fbf414 --- /dev/null +++ b/recipes/util-linux-libuuid/all/test_package/test_package.c @@ -0,0 +1,33 @@ +#include + +#include "uuid/uuid.h" + +int main(int argc, char *argv[]) { + uuid_t uuid; + uuid_generate_time_safe(uuid); + + char uuid_str[37]; + uuid_unparse_lower(uuid, uuid_str); + printf("generate uuid=%s\n", uuid_str); + + uuid_t uuid2; + uuid_parse(uuid_str, uuid2); + + int rv; + rv = uuid_compare(uuid, uuid2); + printf("uuid_compare() result=%d\n", rv); + + uuid_t uuid3; + uuid_parse("1b4e28ba-2fa1-11d2-883f-0016d3cca427", uuid3); + rv = uuid_compare(uuid, uuid3); + printf("uuid_compare() result=%d\n", rv); + + rv = uuid_is_null(uuid); + printf("uuid_null() result=%d\n", rv); + + uuid_clear(uuid); + rv = uuid_is_null(uuid); + printf("uuid_null() result=%d\n", rv); + + return 0; +} diff --git a/recipes/util-linux-libuuid/config.yml b/recipes/util-linux-libuuid/config.yml new file mode 100644 index 0000000000000..427b3a10b7a7d --- /dev/null +++ b/recipes/util-linux-libuuid/config.yml @@ -0,0 +1,3 @@ +versions: + "2.39": + folder: all diff --git a/recipes/uvw/all/conandata.yml b/recipes/uvw/all/conandata.yml index f854a4bf38927..2ce44b1f85239 100644 --- a/recipes/uvw/all/conandata.yml +++ b/recipes/uvw/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.0": + url: "https://github.com/skypjack/uvw/archive/v3.2.0_libuv_v1.46.tar.gz" + sha256: "bd5aed741765950074b1ea2507291dce81e528abdf56c406991ad4a27d8d1714" "3.1.0": url: "https://github.com/skypjack/uvw/archive/v3.1.0_libuv_v1.45.tar.gz" sha256: "0a612bd243150fbbe1365cdaf48203d32061c1d14f93825a31876b183922f93b" diff --git a/recipes/uvw/all/conanfile.py b/recipes/uvw/all/conanfile.py index 80186b62e3cfa..af145be3d5ce2 100644 --- a/recipes/uvw/all/conanfile.py +++ b/recipes/uvw/all/conanfile.py @@ -38,6 +38,7 @@ def _compilers_minimum_version(self): @property def _required_libuv_version(self): return { + "3.2.0": "1.46.0", "3.1.0": "1.45.0", "2.12.1": "1.44.2", "2.11.0": "1.43.0", diff --git a/recipes/uvw/config.yml b/recipes/uvw/config.yml index e703f58ea9d08..f7ecad1e5c9ed 100644 --- a/recipes/uvw/config.yml +++ b/recipes/uvw/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.0": + folder: "all" "3.1.0": folder: "all" "2.12.1": diff --git a/recipes/veque/all/conandata.yml b/recipes/veque/all/conandata.yml index 4a5e1d0f1ad9a..a57efe3175e66 100644 --- a/recipes/veque/all/conandata.yml +++ b/recipes/veque/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.7": + url: "https://github.com/Shmoopty/veque/archive/v1.3.7.tar.gz" + sha256: "f67ae3ce3f3e16e60f63bc8d4df0c606a6dfbc8651e01cba5a6c4ed1209349b1" "1.3.6": url: "https://github.com/Shmoopty/veque/archive/v1.3.6.tar.gz" sha256: "9d149b415d948529ac166c962501c59605ef24b3a8ab8561956a6d05f14870ea" diff --git a/recipes/veque/all/conanfile.py b/recipes/veque/all/conanfile.py index 54b31e162b380..8de4f7001f378 100644 --- a/recipes/veque/all/conanfile.py +++ b/recipes/veque/all/conanfile.py @@ -10,15 +10,19 @@ class VequeConan(ConanFile): name = "veque" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/Shmoopty/veque" description = "Fast C++ container combining the best features of std::vector and std::deque" - topics = ("cpp17", "vector", "deque") license = "BSL-1.0" - + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Shmoopty/veque" + topics = ("cpp17", "vector", "deque", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return 17 + @property def _compilers_minimum_version(self): return { @@ -29,12 +33,15 @@ def _compilers_minimum_version(self): "msvc": "191", } + 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) def loose_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] @@ -45,15 +52,11 @@ def loose_lt_semver(v1, v2): 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.name} {self.version} requires C++17, which your compiler does not support.", + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", ) - def layout(self): - basic_layout(self, src_folder="src") - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass @@ -64,6 +67,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/veque/all/test_package/conanfile.py b/recipes/veque/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/veque/all/test_package/conanfile.py +++ b/recipes/veque/all/test_package/conanfile.py @@ -7,6 +7,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/veque/config.yml b/recipes/veque/config.yml index 10d3a845bf8c7..3da45bc778250 100644 --- a/recipes/veque/config.yml +++ b/recipes/veque/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.7": + folder: all "1.3.6": folder: all "1.3.5": diff --git a/recipes/vo-amrwbenc/all/conandata.yml b/recipes/vo-amrwbenc/all/conandata.yml new file mode 100644 index 0000000000000..942ba6a84fca6 --- /dev/null +++ b/recipes/vo-amrwbenc/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.3": + url: "https://downloads.sourceforge.net/project/opencore-amr/vo-amrwbenc/vo-amrwbenc-0.1.3.tar.gz" + sha256: "5652b391e0f0e296417b841b02987d3fd33e6c0af342c69542cbb016a71d9d4e" diff --git a/recipes/vo-amrwbenc/all/conanfile.py b/recipes/vo-amrwbenc/all/conanfile.py new file mode 100644 index 0000000000000..71830859a3a43 --- /dev/null +++ b/recipes/vo-amrwbenc/all/conanfile.py @@ -0,0 +1,108 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import copy, get, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +import os + +required_conan_version = ">=1.54.0" + + +class OpencoreAmrConan(ConanFile): + name = "vo-amrwbenc" + homepage = "https://sourceforge.net/projects/opencore-amr/" + description = "VisualOn AMR-WB encoder library." + topics = ("audio-codec", "amr-wb", "G.722.2") + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + if is_msvc(self): + tc.extra_cflags.append("-EHsc") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.generate() + + if is_msvc(self): + env = Environment() + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_msvc") + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, pattern="NOTICE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + fix_apple_shared_install_name(self) + + if is_msvc(self) and self.options.shared: + for import_lib in ["vo-amrwbenc"]: + rename(self, os.path.join(self.package_folder, "lib", f"{import_lib}.dll.lib"), + os.path.join(self.package_folder, "lib", f"{import_lib}.lib")) + + def package_info(self): + self.cpp_info.libs = ["vo-amrwbenc"] + + self.cpp_info.set_property("pkg_config_name", "vo-amrwbenc") diff --git a/recipes/vo-amrwbenc/all/test_package/CMakeLists.txt b/recipes/vo-amrwbenc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..996db2c8839df --- /dev/null +++ b/recipes/vo-amrwbenc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(vo-amrwbenc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE vo-amrwbenc::vo-amrwbenc) diff --git a/recipes/vo-amrwbenc/all/test_package/conanfile.py b/recipes/vo-amrwbenc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/vo-amrwbenc/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/vo-amrwbenc/all/test_package/test_package.c b/recipes/vo-amrwbenc/all/test_package/test_package.c new file mode 100644 index 0000000000000..3680b1b652585 --- /dev/null +++ b/recipes/vo-amrwbenc/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include "vo-amrwbenc/enc_if.h" + +int main(void) +{ + void* state = E_IF_init(); + E_IF_exit(state); + + return EXIT_SUCCESS; +} diff --git a/recipes/vo-amrwbenc/config.yml b/recipes/vo-amrwbenc/config.yml new file mode 100644 index 0000000000000..ce394846b7adb --- /dev/null +++ b/recipes/vo-amrwbenc/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.3": + folder: "all" diff --git a/recipes/vsg/all/conandata.yml b/recipes/vsg/all/conandata.yml new file mode 100644 index 0000000000000..f79242254e9e4 --- /dev/null +++ b/recipes/vsg/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.0": + url: "https://github.com/vsg-dev/VulkanSceneGraph/archive/refs/tags/VulkanSceneGraph-1.0.0.tar.gz" + sha256: "5611284f4256893ea97a33f9e99f5ecc8bdda110cc9fb7770b291fb45e8f9cf6" + "1.0.3": + url: "https://github.com/vsg-dev/VulkanSceneGraph/archive/refs/tags/VulkanSceneGraph-1.0.3.tar.gz" + sha256: "84aa1d445ecdd2702843f8f01e760d4db32c2ab3fe8c5d6122f8a83b67a50e36" + "1.0.5": + url: "https://github.com/vsg-dev/VulkanSceneGraph/archive/refs/tags/v1.0.5.tar.gz" + sha256: "ff58260fcb88d19d92c40a70bc40ff06abb1a8805568eb76862a036d13ada75b" diff --git a/recipes/vsg/all/conanfile.py b/recipes/vsg/all/conanfile.py new file mode 100644 index 0000000000000..104e5dc3d7219 --- /dev/null +++ b/recipes/vsg/all/conanfile.py @@ -0,0 +1,118 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.files import get, copy, rm, rmdir, collect_libs +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake +import os + +required_conan_version = ">=1.53.0" + +class VsgConan(ConanFile): + name = "vsg" + description = "VulkanSceneGraph" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.vulkanscenegraph.org" + topics = ("vulkan", "scenegraph", "graphics", "3d") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "max_devices": [1,2,3,4], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "max_devices" : 1, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def requirements(self): + self.requires("vulkan-loader/1.3.239.0", transitive_headers=True) + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) + + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration(f"{self.name} does not support MSVC static runtime (MT/MTd) configurations, only dynamic runtime (MD/MDd) is supported") + + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = False + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["VSG_SUPPORTS_ShaderCompiler"] = 0 + tc.variables["VSG_MAX_DEVICES"] = self.options.max_devices + tc.generate() + + deps = CMakeDeps(self) + + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rm(self, "Find*.cmake", os.path.join(self.package_folder, "lib/cmake/vsg")) + rm(self, "*Config.cmake", os.path.join(self.package_folder, "lib/cmake/vsg")) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + + self.cpp_info.set_property("cmake_file_name", "vsg") + self.cpp_info.set_property("cmake_target_name", "vsg::vsg") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "vsg" + self.cpp_info.filenames["cmake_find_package_multi"] = "vsg" + self.cpp_info.names["cmake_find_package"] = "VSG" + self.cpp_info.names["cmake_find_package_multi"] = "vsg" diff --git a/recipes/vsg/all/test_package/CMakeLists.txt b/recipes/vsg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5b45e894695a3 --- /dev/null +++ b/recipes/vsg/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) # if the project uses c++ + +find_package(vsg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vsg::vsg) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/vsg/all/test_package/conanfile.py b/recipes/vsg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1111583fea732 --- /dev/null +++ b/recipes/vsg/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def 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/vsg/all/test_package/test_package.cpp b/recipes/vsg/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ef112a2f69aaf --- /dev/null +++ b/recipes/vsg/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ + +#include +#include +#include + + +#include + +#include +#include + +int main(int argc, char** argv) +{ + vsg::CommandLine arguments(&argc, argv); + auto numObjects = arguments.value(1u, {"---num-objects", "-n"}); + if (arguments.errors()) return arguments.writeErrorMessages(std::cerr); + + using Objects = std::vector>; + Objects objects; + objects.push_back(vsg::Node::create()); + + + return 0; +} diff --git a/recipes/vsg/config.yml b/recipes/vsg/config.yml new file mode 100644 index 0000000000000..058c041064a22 --- /dev/null +++ b/recipes/vsg/config.yml @@ -0,0 +1,7 @@ +versions: + "1.0.5": + folder: all + "1.0.3": + folder: all + "1.0.0": + folder: all diff --git a/recipes/wasmer/all/conandata.yml b/recipes/wasmer/all/conandata.yml index b910c1ff73d15..55462c58cc4d0 100644 --- a/recipes/wasmer/all/conandata.yml +++ b/recipes/wasmer/all/conandata.yml @@ -1,4 +1,31 @@ sources: + "4.0.0": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-windows-amd64.tar.gz" + sha256: "1ecbff4959fda10b316bdda3ea2230dcfaafabd4372125829e5dfaf01a75b1b6" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-windows-gnu64.tar.gz" + sha256: "80a2d653254c59791faffa35c15f264c6e9fc5725ba0733b62ee1e0186f53294" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-linux-amd64.tar.gz" + sha256: "6d905e328a155ef0059013d7315407bac13ea2a0cf9257e6cc957b96556df05e" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-linux-aarch64.tar.gz" + sha256: "20f98f4be160e73e387444437f87aeaa276b46c1efee12729ab1108ebeda1d16" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-darwin-amd64.tar.gz" + sha256: "435669d2bacf381f7c3c849a231825fb2d2126b0d3e90cb1298cc7a76d770184" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-darwin-arm64.tar.gz" + sha256: "0505c8423830fb0ce1634a27ef52dfacb3d4bc711f9354535e4e874c044730f4" "3.2.1": Windows: "x86_64": diff --git a/recipes/wasmer/config.yml b/recipes/wasmer/config.yml index 15cf31b8c9d16..23eb21bb556ff 100644 --- a/recipes/wasmer/config.yml +++ b/recipes/wasmer/config.yml @@ -1,4 +1,6 @@ versions: + "4.0.0": + folder: "all" "3.2.1": folder: "all" "3.1.0": diff --git a/recipes/wavelet_buffer/all/conanfile.py b/recipes/wavelet_buffer/all/conanfile.py index 69a04b499e31b..8e72fbe22217e 100644 --- a/recipes/wavelet_buffer/all/conanfile.py +++ b/recipes/wavelet_buffer/all/conanfile.py @@ -62,7 +62,7 @@ def requirements(self): self.requires("blaze/3.8", transitive_headers=True) self.requires("cimg/3.0.2") if self.options.jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.4") + self.requires("libjpeg-turbo/2.1.5") else: self.requires("libjpeg/9e") # FIXME: unvendor SfCompressor which is currently downloaded at build time :s diff --git a/recipes/wayland-protocols/all/conanfile.py b/recipes/wayland-protocols/all/conanfile.py index 8641e38f36bfb..04a7ce005ea56 100644 --- a/recipes/wayland-protocols/all/conanfile.py +++ b/recipes/wayland-protocols/all/conanfile.py @@ -27,7 +27,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.1.1") def layout(self): basic_layout(self, src_folder="src") diff --git a/recipes/wayland-protocols/all/test_package/conanfile.py b/recipes/wayland-protocols/all/test_package/conanfile.py index 19d2d81011711..06a3d74d24219 100644 --- a/recipes/wayland-protocols/all/test_package/conanfile.py +++ b/recipes/wayland-protocols/all/test_package/conanfile.py @@ -17,13 +17,13 @@ def _has_build_profile(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("wayland/1.21.0") + self.requires("wayland/1.22.0") def build_requirements(self): - self.tool_requires("meson/1.0.0") + self.tool_requires("meson/1.1.1") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/1.9.3") - self.tool_requires("wayland/1.21.0") + self.tool_requires("wayland/1.22.0") def layout(self): basic_layout(self) diff --git a/recipes/wayland/all/conandata.yml b/recipes/wayland/all/conandata.yml index b49acf6707671..02888e74f53f7 100644 --- a/recipes/wayland/all/conandata.yml +++ b/recipes/wayland/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.22.0": + url: "https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.22.0/downloads/wayland-1.22.0.tar.xz" + sha256: "1540af1ea698a471c2d8e9d288332c7e0fd360c8f1d12936ebb7e7cbc2425842" "1.21.0": url: "https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.21.0/downloads/wayland-1.21.0.tar.xz" sha256: "6dc64d7fc16837a693a51cfdb2e568db538bfdc9f457d4656285bb9594ef11ac" diff --git a/recipes/wayland/config.yml b/recipes/wayland/config.yml index 21b3598bd3d20..27ca5fdc22826 100644 --- a/recipes/wayland/config.yml +++ b/recipes/wayland/config.yml @@ -1,4 +1,6 @@ versions: + "1.22.0": + folder: all "1.21.0": folder: all "1.20.0": diff --git a/recipes/wglext/all/conanfile.py b/recipes/wglext/all/conanfile.py index 916b363760c68..7af57d6410b8e 100644 --- a/recipes/wglext/all/conanfile.py +++ b/recipes/wglext/all/conanfile.py @@ -1,37 +1,53 @@ 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, download, load, save +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.52.0" -required_conan_version = ">=1.37.0" class WglextConan(ConanFile): name = "wglext" + description = "WGL extension interfaces" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.khronos.org/registry/OpenGL/index_gl.php" - description = "WGL extension interfaces" - topics = ("opengl", "gl", "wgl", "wglext") + topics = ("opengl", "gl", "wgl", "wglext", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - requires = "opengl/system" - settings = "os", + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("opengl/system") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.os != "Windows": raise ConanInvalidConfiguration("wglext is only supported on Windows") def source(self): - tools.download(filename="wglext.h", **self.conan_data["sources"][self.version]) + download(self, filename="wglext.h", **self.conan_data["sources"][self.version]) - def package(self): - self.copy(pattern="wglext.h", dst=os.path.join("include", "GL")) - license_data = tools.load(os.path.join(self.source_folder, "wglext.h")) + def _extract_license(self): + license_data = load(self, os.path.join(self.source_folder, "wglext.h")) begin = license_data.find("/*") + len("/*") end = license_data.find("*/") license_data = license_data[begin:end] license_data = license_data.replace("**", "") - tools.save("LICENSE", license_data) - self.copy("LICENSE", dst="licenses") + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_data) - def package_id(self): - self.info.header_only() + def package(self): + self._extract_license() + copy(self, pattern="wglext.h", dst=os.path.join(self.package_folder, "include", "GL"), src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/wglext/all/test_package/CMakeLists.txt b/recipes/wglext/all/test_package/CMakeLists.txt index 121f8f8e30a8e..06dc988df0340 100644 --- a/recipes/wglext/all/test_package/CMakeLists.txt +++ b/recipes/wglext/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(wglext REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/wglext/all/test_package/conanfile.py b/recipes/wglext/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/wglext/all/test_package/conanfile.py +++ b/recipes/wglext/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/whisper-cpp/all/conandata.yml b/recipes/whisper-cpp/all/conandata.yml new file mode 100644 index 0000000000000..8d22eb9400cec --- /dev/null +++ b/recipes/whisper-cpp/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.2.1": + url: "https://github.com/ggerganov/whisper.cpp/archive/ad1389003d3f8bd47b8ca7d4c21b4764cc3844fc.tar.gz" + sha256: "e1459ddfe45430b68a1951e4e071478180a3a100a68c0d54f78d113c735e6363" + "1.4.2": + url: "https://github.com/ggerganov/whisper.cpp/archive/a5defbc1b98bea0f070331ce1e8b62d947b0443d.tar.gz" + sha256: "6dd0690b084269b22b1b749103b047e6d45d7b910d7bc9587085ce057dca5431" +patches: + "1.4.2": + - patch_file: "patches/1.4.2-0001-find_package_openblas.patch" + patch_description: "Fix OpenBlas cmake target name" + patch_type: "conan" diff --git a/recipes/whisper-cpp/all/conanfile.py b/recipes/whisper-cpp/all/conanfile.py new file mode 100644 index 0000000000000..bb939dac3e50e --- /dev/null +++ b/recipes/whisper-cpp/all/conanfile.py @@ -0,0 +1,156 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class WhisperCppConan(ConanFile): + name = "whisper-cpp" + description = "High-performance inference of OpenAI's Whisper automatic speech recognition (ASR) model" + topics = ("whisper", "asr") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ggerganov/whisper.cpp" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False], "sanitize_thread": [True, False], + "sanitize_address": [True, False], "sanitize_undefined": [True, False], + "no_avx": [True, False], "no_avx2": [True, False], "no_fma": [True, False], "no_f16c": [True, False], + "no_accelerate": [True, False], "with_coreml": [True, False], "coreml_allow_fallback": [True, False], + "with_blas": [True, False]} + default_options = {"shared": False, "fPIC": True, "sanitize_thread": False, + "sanitize_address": False, "sanitize_undefined": False, + "no_avx": False, "no_avx2": False, "no_fma": False, "no_f16c": False, + "no_accelerate": False, "with_coreml": False, "coreml_allow_fallback": False, + "with_blas": False} + package_type = "library" + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "gcc": "9", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) + + def config_options(self): + if is_apple_os(self): + del self.options.with_blas + else: + del self.options.no_accelerate + del self.options.with_coreml + del self.options.coreml_allow_fallback + + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + if is_apple_os(self): + if not self.options.with_coreml: + self.options.rm_safe("coreml_allow_fallback") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def requirements(self): + if not is_apple_os(self): + if self.options.with_blas: + self.requires("openblas/0.3.20") + + def layout(self): + cmake_layout(self, src_folder="src") + + def export_sources(self): + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + + tc = CMakeToolchain(self) + tc.variables["WHISPER_BUILD_TESTS"] = False + tc.variables["WHISPER_BUILD_EXAMPLES"] = False + + if self.options.shared: + tc.variables["BUILD_SHARED_LIBS"] = True + if self.options.sanitize_thread: + tc.variables["WHISPER_SANITIZE_THREAD"] = True + if self.options.sanitize_address: + tc.variables["WHISPER_SANITIZE_ADDRESS"] = True + if self.options.sanitize_undefined: + tc.variables["WHISPER_SANITIZE_UNDEFINED"] = True + if self.options.no_avx: + tc.variables["WHISPER_NO_AVX"] = True + if self.options.no_avx2: + tc.variables["WHISPER_NO_AVX2"] = True + if self.options.no_fma: + tc.variables["WHISPER_NO_FMA"] = True + if self.options.no_f16c: + tc.variables["WHISPER_NO_F16C"] = True + + if is_apple_os(self): + if self.options.no_accelerate: + tc.variables["WHISPER_NO_ACCELERATE"] = True + if self.options.with_coreml: + tc.variables["WHISPER_COREML"] = True + if self.options.coreml_allow_fallback: + tc.variables["WHISPER_COREML_ALLOW_FALLBACK"] = True + else: + if self.options.with_blas: + if Version(self.version) >= "1.4.2": + tc.variables["WHISPER_OPENBLAS"] = True + else: + tc.variables["WHISPER_SUPPORT_OPENBLAS"] = True + + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + copy(self, "*", os.path.join(self.source_folder, "models"), os.path.join(self.package_folder, "res", "models")) + + def package_info(self): + self.cpp_info.libs = ["whisper"] + self.cpp_info.resdirs = ["res"] + self.cpp_info.libdirs = ["lib", "lib/static"] + + if is_apple_os(self): + if not self.options.no_accelerate: + self.cpp_info.frameworks.append("Accelerate") + if self.options.with_coreml: + self.cpp_info.frameworks.append("CoreML") + elif self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) diff --git a/recipes/whisper-cpp/all/patches/1.4.2-0001-find_package_openblas.patch b/recipes/whisper-cpp/all/patches/1.4.2-0001-find_package_openblas.patch new file mode 100644 index 0000000000000..52b554a4dff49 --- /dev/null +++ b/recipes/whisper-cpp/all/patches/1.4.2-0001-find_package_openblas.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 92b5d0c..b0c2c86 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -127,17 +127,9 @@ if (APPLE) + endif() + + if (WHISPER_OPENBLAS) +- find_library(OPENBLAS_LIB +- NAMES openblas libopenblas +- ) +- if (OPENBLAS_LIB) +- message(STATUS "OpenBLAS found") +- +- set(WHISPER_EXTRA_LIBS ${WHISPER_EXTRA_LIBS} ${OPENBLAS_LIB}) +- set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_USE_OPENBLAS) +- else() +- message(WARNING "OpenBLAS not found") +- endif() ++ find_package(OpenBLAS REQUIRED CONFIG) ++ set(WHISPER_EXTRA_LIBS ${WHISPER_EXTRA_LIBS} OpenBLAS::OpenBLAS) ++ set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_USE_OPENBLAS) + endif() + + if (WHISPER_CUBLAS) diff --git a/recipes/whisper-cpp/all/test_package/CMakeLists.txt b/recipes/whisper-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6a90512af2d73 --- /dev/null +++ b/recipes/whisper-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) # if the project uses c++ + +find_package(whisper-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE whisper-cpp::whisper-cpp) + + +add_custom_command(TARGET test_package POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${whisper-cpp_INCLUDE_DIR}/../res/models + ${CMAKE_CURRENT_BINARY_DIR}/models) diff --git a/recipes/whisper-cpp/all/test_package/conanfile.py b/recipes/whisper-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7d2de09164073 --- /dev/null +++ b/recipes/whisper-cpp/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/whisper-cpp/all/test_package/test_package.cpp b/recipes/whisper-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1bc036b7b08b7 --- /dev/null +++ b/recipes/whisper-cpp/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include +#include +#include "whisper.h" + + +int main() { + auto context = std::unique_ptr( + whisper_init_from_file("models/for-tests-ggml-base.en.bin"), &whisper_free); + + if (context == nullptr) { + std::cout << "Failed to initialize whisper context!" << std::endl; + return 3; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/whisper-cpp/config.yml b/recipes/whisper-cpp/config.yml new file mode 100644 index 0000000000000..df53037008d38 --- /dev/null +++ b/recipes/whisper-cpp/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2.1": + folder: "all" + "1.4.2": + folder: "all" diff --git a/recipes/wilzegers-autotest/all/conanfile.py b/recipes/wilzegers-autotest/all/conanfile.py index 8ef12a62b9ce4..81cb48532fdf0 100644 --- a/recipes/wilzegers-autotest/all/conanfile.py +++ b/recipes/wilzegers-autotest/all/conanfile.py @@ -1,36 +1,70 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os -requires_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class WilzegersAutotestConan(ConanFile): name = "wilzegers-autotest" + description = "Autotest facilitates the testing of class interfaces" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.com/wilzegers/autotest" - description = "Autotest facilitates the testing of class interfaces" - topics = ("autotest", "testing") - settings = "compiler" + topics = ("autotest", "testing", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "5.0", + "apple-clang": "9.1", + } + + 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." + ) + if self.settings.compiler != "clang": raise ConanInvalidConfiguration("Only clang allowed") - def package_id(self): - self.info.header_only() + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("*.hpp", src=os.path.join(self._source_subfolder, "autotest/include"), dst="include") - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "*.hpp", + src=os.path.join(self.source_folder, "autotest/include"), + dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/wilzegers-autotest/all/test_package/CMakeLists.txt b/recipes/wilzegers-autotest/all/test_package/CMakeLists.txt index 041b6ec23c708..a64b138191fa5 100644 --- a/recipes/wilzegers-autotest/all/test_package/CMakeLists.txt +++ b/recipes/wilzegers-autotest/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(wilzegers-autotest REQUIRED CONFIG) diff --git a/recipes/wilzegers-autotest/all/test_package/conanfile.py b/recipes/wilzegers-autotest/all/test_package/conanfile.py index 49a3a66ea5bad..fae501d0afb9e 100644 --- a/recipes/wilzegers-autotest/all/test_package/conanfile.py +++ b/recipes/wilzegers-autotest/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wilzegers-autotest/all/test_package/test_package.cpp b/recipes/wilzegers-autotest/all/test_package/test_package.cpp index 152f5d33d3410..26e0bb71eb0f0 100644 --- a/recipes/wilzegers-autotest/all/test_package/test_package.cpp +++ b/recipes/wilzegers-autotest/all/test_package/test_package.cpp @@ -1,3 +1,6 @@ +// Workaround for a missing include in wilzegers-autotest/cci.20200921 +#include + #include #include diff --git a/recipes/wilzegers-autotest/all/test_v1_package/CMakeLists.txt b/recipes/wilzegers-autotest/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/wilzegers-autotest/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/wilzegers-autotest/all/test_v1_package/conanfile.py b/recipes/wilzegers-autotest/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/wilzegers-autotest/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wolfssl/all/conandata.yml b/recipes/wolfssl/all/conandata.yml index 9f6956c1ef7de..45f769c905838 100644 --- a/recipes/wolfssl/all/conandata.yml +++ b/recipes/wolfssl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.6.3": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.6.3-stable.tar.gz" + sha256: "2e74a397fa797c2902d7467d500de904907666afb4ff80f6464f6efd5afb114a" "5.5.1": url: "https://github.com/wolfSSL/wolfssl/archive/v5.5.1-stable.tar.gz" sha256: "97339e6956c90e7c881ba5c748dd04f7c30e5dbe0c06da765418c51375a6dee3" diff --git a/recipes/wolfssl/all/conanfile.py b/recipes/wolfssl/all/conanfile.py index d1489495db5d2..7233278df2e56 100644 --- a/recipes/wolfssl/all/conanfile.py +++ b/recipes/wolfssl/all/conanfile.py @@ -1,11 +1,12 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os from conan.tools.env import VirtualBuildEnv from conan.tools.files import copy, get, rename, rm, rmdir from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +from conan.tools.scm import Version import os required_conan_version = ">=1.54.0" @@ -157,3 +158,7 @@ def package_info(self): self.cpp_info.system_libs.extend(["m", "pthread"]) elif self.settings.os == "Windows": self.cpp_info.system_libs.extend(["advapi32", "ws2_32"]) + if Version(self.version) >= "5.6.0": + self.cpp_info.system_libs.append("crypt32") + elif is_apple_os(self) and Version(self.version) >= "5.6.0": + self.cpp_info.frameworks.extend(["CoreFoundation", "Security"]) diff --git a/recipes/wolfssl/config.yml b/recipes/wolfssl/config.yml index e4db787180ac0..92091015e6a56 100644 --- a/recipes/wolfssl/config.yml +++ b/recipes/wolfssl/config.yml @@ -1,4 +1,6 @@ versions: + "5.6.3": + folder: all "5.5.1": folder: all "5.4.0": diff --git a/recipes/wt/all/conandata.yml b/recipes/wt/all/conandata.yml index 8b83e78419f05..c26a610e865f7 100644 --- a/recipes/wt/all/conandata.yml +++ b/recipes/wt/all/conandata.yml @@ -14,18 +14,6 @@ sources: "4.6.0": url: "https://github.com/emweb/wt/archive/4.6.0.tar.gz" sha256: "7f709e132d32c4925e6db0a590c7ccc5613344e8b9052676ef891a25ccb550e6" - "4.5.1": - url: "https://github.com/emweb/wt/archive/4.5.1.tar.gz" - sha256: "c2820646095af5618fc235705c0108797e3898225fb1826f2c6185c405c21a17" - "4.5.0": - url: "https://github.com/emweb/wt/archive/4.5.0.tar.gz" - sha256: "119b1eae83285a153b9c901d3f4f25775c7a460d30b1e48242d7d2d649d61deb" - "4.4.0": - url: "https://github.com/emweb/wt/archive/4.4.0.tar.gz" - sha256: "2eabefea915ecc4deb36f9f67ab30dd3b1f6c73893d76c9d9fa39ac25f4f3690" - "4.3.1": - url: "https://github.com/emweb/wt/archive/4.3.1.tar.gz" - sha256: "6c0130f36c829ed67119679770c2f62d7768a62eaa281bb10070c4cf1b145139" patches: "4.9.1": - patch_file: "patches/4.8.0-0001-use-cci-package.patch" @@ -47,28 +35,3 @@ patches: - patch_file: "patches/4.6.2-0001-use-cci-package.patch" patch_description: "use cci package" patch_type: "conan" - "4.5.1": - - patch_file: "patches/4.3.1-0001-use-cci-package.patch" - patch_description: "use cci package" - patch_type: "conan" - "4.5.0": - - patch_file: "patches/4.3.1-0001-use-cci-package.patch" - patch_description: "use cci package" - patch_type: "conan" - - patch_file: "patches/4.3.1-0002-gcc_11.patch" - patch_description: "include limits header" - patch_type: "portability" - "4.4.0": - - patch_file: "patches/4.3.1-0001-use-cci-package.patch" - patch_description: "use cci package" - patch_type: "conan" - - patch_file: "patches/4.3.1-0002-gcc_11.patch" - patch_description: "include limits header" - patch_type: "portability" - "4.3.1": - - patch_file: "patches/4.3.1-0001-use-cci-package.patch" - patch_description: "use cci package" - patch_type: "conan" - - patch_file: "patches/4.3.1-0002-gcc_11.patch" - patch_description: "include limits header" - patch_type: "portability" diff --git a/recipes/wt/all/conanfile.py b/recipes/wt/all/conanfile.py index f997394d3639a..1ddcb9843676a 100644 --- a/recipes/wt/all/conanfile.py +++ b/recipes/wt/all/conanfile.py @@ -7,7 +7,8 @@ import os import shutil -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" + class WtConan(ConanFile): name = "wt" @@ -16,6 +17,7 @@ class WtConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/emweb/wt" topics = ("server", "web", "webapp", "websocket", "cgi", "fastcgi", "orm") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -95,26 +97,24 @@ def _required_boost_components(self): return ["program_options", "filesystem", "thread"] def requirements(self): - if Version(self.version) < "4.6.0": - self.requires("boost/1.76.0") - elif Version(self.version) < "4.9.0": - self.requires("boost/1.80.0") + if Version(self.version) < "4.9.0": + self.requires("boost/1.80.0", transitive_headers = True) else: - self.requires("boost/1.81.0") + self.requires("boost/1.82.0", transitive_headers = True) if self.options.connector_http: self.requires("zlib/1.2.13") if self.options.with_ssl: - self.requires("openssl/1.1.1t") + self.requires("openssl/[>=1.1 <4]") if self.options.get_safe("with_sqlite"): - self.requires("sqlite3/3.41.1") + self.requires("sqlite3/3.42.0") if self.options.get_safe("with_mysql"): self.requires("libmysqlclient/8.0.31", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_postgres"): - self.requires("libpq/14.7", transitive_headers=True, transitive_libs=True) + self.requires("libpq/15.3", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_mssql") and self.settings.os != "Windows": self.requires("odbc/2.3.11") if self.options.get_safe("with_unwind"): - self.requires("libunwind/1.6.2") + self.requires("libunwind/1.7.0") if self.options.with_haru: self.requires("libharu/2.4.3") @@ -235,8 +235,6 @@ def generate(self): else: tc.variables["CONNECTOR_FCGI"] = self.options.connector_fcgi tc.variables["CONNECTOR_ISAPI"] = False - - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) @@ -245,12 +243,18 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - replace_in_file(self, cmakelists, "find_package(OpenSSL)", "#find_package(OpenSSL)") replace_in_file(self, cmakelists, "INCLUDE(cmake/WtFindMysql.txt)", "#INCLUDE(cmake/WtFindMysql.txt)") replace_in_file(self, cmakelists, "INCLUDE(cmake/WtFindPostgresql.txt)", "#INCLUDE(cmake/WtFindPostgresql.txt)") if self.settings.os != "Windows": replace_in_file(self, cmakelists, "INCLUDE(cmake/WtFindOdbc.txt)", "#INCLUDE(cmake/WtFindOdbc.txt)") + if self.options.with_ssl: + # Ensure the conan-generated config is used for OpenSSL when required as a dependency + replace_in_file(self, cmakelists, "find_package(OpenSSL)", "find_package(OpenSSL CONFIG REQUIRED)") + else: + # Avoid searching for OpenSSL if it is not required + replace_in_file(self, cmakelists, "find_package(OpenSSL)", "") + # Do not pollute rpath of shared libs of the install tree on macOS please replace_in_file(self, cmakelists, diff --git a/recipes/wt/all/patches/4.3.1-0001-use-cci-package.patch b/recipes/wt/all/patches/4.3.1-0001-use-cci-package.patch deleted file mode 100644 index af7c47db572a3..0000000000000 --- a/recipes/wt/all/patches/4.3.1-0001-use-cci-package.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/src/Wt/Dbo/backend/CMakeLists.txt b/src/Wt/Dbo/backend/CMakeLists.txt -index 827abf3..5324034 100644 ---- a/src/Wt/Dbo/backend/CMakeLists.txt -+++ b/src/Wt/Dbo/backend/CMakeLists.txt -@@ -127,11 +127,12 @@ IF(ENABLE_POSTGRES AND POSTGRES_FOUND) - SET_PROPERTY(TARGET wtdbopostgres PROPERTY CXX_VISIBILITY_PRESET hidden) - SET_PROPERTY(TARGET wtdbopostgres PROPERTY VISIBILITY_INLINES_HIDDEN YES) - -+ find_package(PostgreSQL REQUIRED CONFIG) - TARGET_LINK_LIBRARIES(wtdbopostgres - PUBLIC - wtdbo - PRIVATE -- ${POSTGRES_LIBRARIES} -+ PostgreSQL::PostgreSQL - ) - - IF(TARGET Boost::headers) -@@ -291,11 +292,12 @@ IF(ENABLE_MYSQL AND MYSQL_FOUND) - SET_PROPERTY(TARGET wtdbomysql PROPERTY CXX_VISIBILITY_PRESET hidden) - SET_PROPERTY(TARGET wtdbomysql PROPERTY VISIBILITY_INLINES_HIDDEN YES) - -+ find_package(libmysqlclient REQUIRED CONFIG) - TARGET_LINK_LIBRARIES(wtdbomysql - PUBLIC - wtdbo - PRIVATE -- ${MYSQL_LIBRARIES} -+ libmysqlclient::libmysqlclient - ) - - INCLUDE_DIRECTORIES(${MYSQL_INCLUDE}) diff --git a/recipes/wt/all/patches/4.3.1-0002-gcc_11.patch b/recipes/wt/all/patches/4.3.1-0002-gcc_11.patch deleted file mode 100644 index 03d2aaff9236b..0000000000000 --- a/recipes/wt/all/patches/4.3.1-0002-gcc_11.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/Wt/Render/WTextRenderer.C -+++ b/src/Wt/Render/WTextRenderer.C -@@ -14,6 +14,7 @@ - #include "Block.h" - - #include -+#include - #include - - namespace { diff --git a/recipes/wt/config.yml b/recipes/wt/config.yml index f24f55b014506..d129fd323175f 100644 --- a/recipes/wt/config.yml +++ b/recipes/wt/config.yml @@ -9,11 +9,3 @@ versions: folder: all "4.6.0": folder: all - "4.5.1": - folder: all - "4.5.0": - folder: all - "4.4.0": - folder: all - "4.3.1": - folder: all diff --git a/recipes/xxsds-sdsl-lite/all/conandata.yml b/recipes/xxsds-sdsl-lite/all/conandata.yml index b6d6545a3fc79..f215951543959 100644 --- a/recipes/xxsds-sdsl-lite/all/conandata.yml +++ b/recipes/xxsds-sdsl-lite/all/conandata.yml @@ -8,11 +8,7 @@ sources: patches: cci.20210329: - patch_file: patches/bits.hpp.patch - base_path: source_subfolder - patch_file: patches/util.hpp.patch - base_path: source_subfolder 3.0.0: - patch_file: patches/bits.hpp.patch - base_path: source_subfolder - patch_file: patches/util.hpp.patch - base_path: source_subfolder diff --git a/recipes/xxsds-sdsl-lite/all/conanfile.py b/recipes/xxsds-sdsl-lite/all/conanfile.py index de8842c0e754e..1b6126a2f3e15 100644 --- a/recipes/xxsds-sdsl-lite/all/conanfile.py +++ b/recipes/xxsds-sdsl-lite/all/conanfile.py @@ -1,46 +1,65 @@ import os -from conans import ConanFile, tools -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.52.0" + class XXSDSSDSLLite(ConanFile): name = "xxsds-sdsl-lite" description = "SDSL - Succinct Data Structure Library" - homepage = "https://github.com/xxsds/sdsl-lite" - url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" - topics = ("conan", "sdsl", "succint", "data-structures") - settings = "compiler" - exports_sources = "patches/*" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xxsds/sdsl-lite" + topics = ("sdsl", "succint", "data-structures", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True provides = "sdsl-lite" - @property - def _source_subfolder(self): - return "source_subfolder" + 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"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) def package(self): - self.copy("*.hpp", dst="include", - src=os.path.join(self._source_subfolder, "include")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - - def package_id(self): - self.info.header_only() + copy(self, "*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) def package_info(self): - if self.settings.compiler == "Visual Studio": + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "sdsl-lite") + self.cpp_info.set_property("cmake_target_name", "sdsl-lite::sdsl-lite") + self.cpp_info.set_property("pkg_config_name", "sdsl-lite") + + if is_msvc(self): self.cpp_info.defines.append("MSVC_COMPILER") - self.cpp_info.names["pkgconfig"] = "sdsl-lite" + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "sdsl-lite" self.cpp_info.names["cmake_find_package_multi"] = "sdsl-lite" diff --git a/recipes/xxsds-sdsl-lite/all/test_package/CMakeLists.txt b/recipes/xxsds-sdsl-lite/all/test_package/CMakeLists.txt index 18fda057023dc..6b3bf7b3cbccb 100644 --- a/recipes/xxsds-sdsl-lite/all/test_package/CMakeLists.txt +++ b/recipes/xxsds-sdsl-lite/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(sdsl-lite CONFIG REQUIRED) diff --git a/recipes/xxsds-sdsl-lite/all/test_package/conanfile.py b/recipes/xxsds-sdsl-lite/all/test_package/conanfile.py index 75634e62bcb66..fae501d0afb9e 100644 --- a/recipes/xxsds-sdsl-lite/all/test_package/conanfile.py +++ b/recipes/xxsds-sdsl-lite/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools - class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/xxsds-sdsl-lite/all/test_v1_package/CMakeLists.txt b/recipes/xxsds-sdsl-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/xxsds-sdsl-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/xxsds-sdsl-lite/all/test_v1_package/conanfile.py b/recipes/xxsds-sdsl-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..75634e62bcb66 --- /dev/null +++ b/recipes/xxsds-sdsl-lite/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +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/zimg/all/conandata.yml b/recipes/zimg/all/conandata.yml index 6f58da26deae3..808d05daf7b4d 100644 --- a/recipes/zimg/all/conandata.yml +++ b/recipes/zimg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.5": + url: "https://github.com/sekrit-twc/zimg/archive/refs/tags/release-3.0.5.tar.gz" + sha256: "a9a0226bf85e0d83c41a8ebe4e3e690e1348682f6a2a7838f1b8cbff1b799bcf" "3.0.4": url: "https://github.com/sekrit-twc/zimg/archive/refs/tags/release-3.0.4.tar.gz" sha256: "219d1bc6b7fde1355d72c9b406ebd730a4aed9c21da779660f0a4c851243e32f" @@ -15,6 +18,9 @@ sources: url: "https://github.com/sekrit-twc/zimg/archive/release-2.9.3.tar.gz" sha256: "a15c0483fbe945ffe695a1a989bc43b3381c8bf33e2d1760464ec21d32cdf30b" patches: + "3.0.5": + - patch_file: "patches/0001-msvc-remove-windows-target-platform.patch" + - patch_file: "patches/0002-msvc-solution.patch" "3.0.4": - patch_file: "patches/0001-msvc-remove-windows-target-platform.patch" - patch_file: "patches/0002-msvc-solution.patch" diff --git a/recipes/zimg/all/conanfile.py b/recipes/zimg/all/conanfile.py index 6332a7e16ebe2..48a20f5432af3 100644 --- a/recipes/zimg/all/conanfile.py +++ b/recipes/zimg/all/conanfile.py @@ -6,6 +6,7 @@ from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import check_min_vs, is_msvc, MSBuild, MSBuildToolchain +from conan.tools.scm import Version import os required_conan_version = ">=1.54.0" @@ -14,11 +15,11 @@ class ZimgConan(ConanFile): name = "zimg" description = "Scaling, colorspace conversion, and dithering library" - topics = ("image", "manipulation") - homepage = "https://github.com/sekrit-twc/zimg" - url = "https://github.com/conan-io/conan-center-index" license = "WTFPL" - + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sekrit-twc/zimg" + topics = ("image", "manipulation") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -94,11 +95,18 @@ def build(self): platform_toolset = MSBuildToolchain(self).toolset conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) for vcxproj_file in vcxproj_files: - replace_in_file( - self, vcxproj_file, - "v142", - f"{platform_toolset}", - ) + if Version(self.version) >= "3.0.5": + replace_in_file( + self, vcxproj_file, + "v143", + f"{platform_toolset}", + ) + else: + replace_in_file( + self, vcxproj_file, + "v142", + f"{platform_toolset}", + ) replace_in_file( self, vcxproj_file, "", diff --git a/recipes/zimg/config.yml b/recipes/zimg/config.yml index b142332a0fe4c..4841523950979 100644 --- a/recipes/zimg/config.yml +++ b/recipes/zimg/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.5": + folder: "all" "3.0.4": folder: "all" "3.0.3": diff --git a/recipes/zlib-ng/all/conandata.yml b/recipes/zlib-ng/all/conandata.yml index 6a968e1b5df2d..27e5a03a3afe2 100644 --- a/recipes/zlib-ng/all/conandata.yml +++ b/recipes/zlib-ng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.3": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.3.tar.gz" + sha256: "d20e55f89d71991c59f1c5ad1ef944815e5850526c0d9cd8e504eaed5b24491a" "2.1.2": url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.2.tar.gz" sha256: "383560d6b00697c04e8878e26c0187b480971a8bce90ffd26a5a7b0f7ecf1a33" diff --git a/recipes/zlib-ng/config.yml b/recipes/zlib-ng/config.yml index c37d0e56fedc6..96567d37e1ee8 100644 --- a/recipes/zlib-ng/config.yml +++ b/recipes/zlib-ng/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.3": + folder: all "2.1.2": folder: all "2.0.7": diff --git a/recipes/zookeeper-client-c/all/conandata.yml b/recipes/zookeeper-client-c/all/conandata.yml new file mode 100644 index 0000000000000..5a209ac187af0 --- /dev/null +++ b/recipes/zookeeper-client-c/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "3.8.1": + url: "https://dlcdn.apache.org/zookeeper/zookeeper-3.8.1/apache-zookeeper-3.8.1.tar.gz" + sha256: "ccc16850c8ab2553583583234d11c813061b5ea5f3b8ff1d740cde6c1fd1e219" +patches: + "3.8.1": + - patch_file: "patches/3.8.1-0001-add-install.patch" + patch_description: "add installer, disable cli program" + patch_type: "conan" diff --git a/recipes/zookeeper-client-c/all/conanfile.py b/recipes/zookeeper-client-c/all/conanfile.py new file mode 100644 index 0000000000000..ec48f11ba450f --- /dev/null +++ b/recipes/zookeeper-client-c/all/conanfile.py @@ -0,0 +1,94 @@ +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + +class ZookeeperClientCConan(ConanFile): + name = "zookeeper-client-c" + description = "ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://zookeeper.apache.org/" + topics = ("zookeeper", "client") + settings = "os", "arch", "compiler", "build_type" + package_type = "static-library" + options = { + "fPIC": [True, False], + "with_cyrus_sasl": [True, False], + "with_openssl": [True, False], + } + default_options = { + "fPIC": True, + "with_cyrus_sasl": False, + "with_openssl": False, + } + short_paths = True + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_cyrus_sasl: + self.requires("cyrus-sasl/2.1.27") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + def build_requirements(self): + self.tool_requires("maven/3.9.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WANT_CPPUNIT"] = False + tc.variables["WITH_CYRUS_SASL"] = "ON" if self.options.with_cyrus_sasl else "OFF" + tc.variables["WITH_OPENSSL"] = "ON" if self.options.with_openssl else "OFF" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + bvenv = VirtualBuildEnv(self) + bvenv.generate() + + def build(self): + apply_conandata_patches(self) + + # We have to install maven to generate jute files which are required by zookeeper-client + self.run("mvn compile", cwd=os.path.join(self.source_folder, "zookeeper-jute")) + + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "zookeeper-client", "zookeeper-client-c")) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=os.path.join(self.source_folder, "zookeeper-client", "zookeeper-client-c") + ) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["zookeeper", "hashtable"] + self.cpp_info.defines.append("USE_STATIC_LIB") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["rt", "pthread", "m"]) + + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["wsock32", "ws2_32", ]) diff --git a/recipes/zookeeper-client-c/all/patches/3.8.1-0001-add-install.patch b/recipes/zookeeper-client-c/all/patches/3.8.1-0001-add-install.patch new file mode 100644 index 0000000000000..fe59dd04ecacb --- /dev/null +++ b/recipes/zookeeper-client-c/all/patches/3.8.1-0001-add-install.patch @@ -0,0 +1,54 @@ +diff --git a/zookeeper-client/zookeeper-client-c/CMakeLists.txt b/zookeeper-client/zookeeper-client-c/CMakeLists.txt +index 5d0175e..9349bc0 100644 +--- a/zookeeper-client/zookeeper-client-c/CMakeLists.txt ++++ b/zookeeper-client/zookeeper-client-c/CMakeLists.txt +@@ -228,16 +228,6 @@ if(CYRUS_SASL_FOUND) + target_link_libraries(zookeeper PUBLIC CyrusSASL) + endif() + +-# cli executable +-add_executable(cli src/cli.c) +-target_link_libraries(cli zookeeper) +- +-# load_gen executable +-if(WANT_SYNCAPI AND NOT WIN32) +- add_executable(load_gen src/load_gen.c) +- target_link_libraries(load_gen zookeeper) +-endif() +- + # tests + set(test_sources + tests/TestDriver.cc +@@ -290,3 +280,32 @@ if(WANT_CPPUNIT) + "ZKROOT=${CMAKE_CURRENT_SOURCE_DIR}/../.." + "CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar") + endif() ++ ++include(GNUInstallDirs) ++ ++install( ++ TARGETS zookeeper ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) ++ ++install( ++ TARGETS hashtable ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) ++ ++install(FILES ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/proto.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/recordio.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/win_getopt.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/winconfig.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/zookeeper.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/zookeeper_log.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/include/zookeeper_version.h ++ ${CMAKE_CURRENT_SOURCE_DIR}/generated/zookeeper.jute.h ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/zookeeper-client-c/all/test_package/CMakeLists.txt b/recipes/zookeeper-client-c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..614f9306973ce --- /dev/null +++ b/recipes/zookeeper-client-c/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package C) + +find_package(zookeeper-client-c REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE zookeeper-client-c::zookeeper-client-c) diff --git a/recipes/zookeeper-client-c/all/test_package/conanfile.py b/recipes/zookeeper-client-c/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/zookeeper-client-c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/zookeeper-client-c/all/test_package/test_package.c b/recipes/zookeeper-client-c/all/test_package/test_package.c new file mode 100644 index 0000000000000..d3ce6ffa2d6b7 --- /dev/null +++ b/recipes/zookeeper-client-c/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include "zookeeper_log.h" + +int main(void) { + zookeeper_close(0); + + return 0; +} diff --git a/recipes/zookeeper-client-c/config.yml b/recipes/zookeeper-client-c/config.yml new file mode 100644 index 0000000000000..f3cf585c380d6 --- /dev/null +++ b/recipes/zookeeper-client-c/config.yml @@ -0,0 +1,3 @@ +versions: + "3.8.1": + folder: all diff --git a/recipes/zug/all/conandata.yml b/recipes/zug/all/conandata.yml index ebe78dab88a5e..a182f02902b99 100644 --- a/recipes/zug/all/conandata.yml +++ b/recipes/zug/all/conandata.yml @@ -2,3 +2,6 @@ sources: "cci.20220125": url: "https://github.com/arximboldi/zug/archive/deb266f4c7c35d325de7eb3d033f06e0809495f2.tar.gz" sha256: "4b36442059899b8570336ff9e2901f62fd58b839c9e3ff5d35497454e2324625" + "0.1.0": + url: "https://github.com/arximboldi/zug/archive/refs/tags/v0.1.0.tar.gz" + sha256: "7d9d57a55399784392ba8fa67fcf246b9f5aec8f002c69e1fe4b5f66657214b8" diff --git a/recipes/zug/all/conanfile.py b/recipes/zug/all/conanfile.py index 6b0b0f5b3f121..c6c9a25ac397e 100644 --- a/recipes/zug/all/conanfile.py +++ b/recipes/zug/all/conanfile.py @@ -1,26 +1,31 @@ import os -from conans import ConanFile, tools + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc -from conans.errors import ConanInvalidConfiguration +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class ZugConan(ConanFile): name = "zug" + description = "Transducers for C++ — Clojure style higher order push/pull sequence transformations" license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://sinusoid.es/zug/" - description = "Transducers for C++ — Clojure style higher order push/pull \ - sequence transformations" - topics = ("transducer", "algorithm", "signals") - settings = ("compiler", "arch", "os", "build_type") + topics = ("transducer", "algorithm", "signals", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def source(self): - tools.get( - **self.conan_data["sources"][self.version], - strip_root=True, - destination=self.source_folder - ) + @property + def _min_cppstd(self): + return 14 @property def _compilers_minimum_version(self): @@ -28,30 +33,42 @@ def _compilers_minimum_version(self): "Visual Studio": "15", "gcc": "5", "clang": "3.5", - "apple-clang": "10" + "apple-clang": "10", } + 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, "14") + check_min_cppstd(self, self._min_cppstd) compiler = str(self.settings.compiler) if compiler not in self._compilers_minimum_version: - self.output.warn("Unknown compiler, assuming it supports at least C++14") + self.output.warning("Unknown compiler, assuming it supports at least C++14") return - version = tools.Version(self.settings.compiler.version) + version = Version(self.settings.compiler.version) if version < self._compilers_minimum_version[compiler]: raise ConanInvalidConfiguration(f"{self.name} requires a compiler that supports at least C++14") - def package_id(self): - self.info.header_only() + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self.source_folder) - self.copy(pattern="*.hpp", dst=os.path.join("include", "zug"), src=os.path.join(self.source_folder, "zug")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*.hpp", + dst=os.path.join(self.package_folder, "include", "zug"), + src=os.path.join(self.source_folder, "zug")) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if is_msvc(self): self.cpp_info.cxxflags = ["/Zc:externConstexpr"] - diff --git a/recipes/zug/all/test_package/CMakeLists.txt b/recipes/zug/all/test_package/CMakeLists.txt index 415cd1f23e3ba..d3e67e2768597 100644 --- a/recipes/zug/all/test_package/CMakeLists.txt +++ b/recipes/zug/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(zug CONFIG REQUIRED) +find_package(zug REQUIRED CONFIG) add_executable(test_package example.cpp) target_link_libraries(test_package zug::zug) diff --git a/recipes/zug/all/test_package/conanfile.py b/recipes/zug/all/test_package/conanfile.py index 34e439b02360c..fae501d0afb9e 100644 --- a/recipes/zug/all/test_package/conanfile.py +++ b/recipes/zug/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class ZugTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/zug/all/test_package/example.cpp b/recipes/zug/all/test_package/example.cpp index a9657ec7c452c..eee3087fd4982 100644 --- a/recipes/zug/all/test_package/example.cpp +++ b/recipes/zug/all/test_package/example.cpp @@ -1,8 +1,8 @@ -#include - #include #include +#include + using namespace zug; int main() diff --git a/recipes/zug/all/test_v1_package/CMakeLists.txt b/recipes/zug/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/zug/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/zug/all/test_v1_package/conanfile.py b/recipes/zug/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..34e439b02360c --- /dev/null +++ b/recipes/zug/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class ZugTestConan(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/zug/config.yml b/recipes/zug/config.yml index 9fd2ace3e66a6..80463c6cdc5cc 100644 --- a/recipes/zug/config.yml +++ b/recipes/zug/config.yml @@ -1,3 +1,5 @@ versions: "cci.20220125": folder: all + "0.1.0": + folder: all diff --git a/recipes/zxing-cpp/all/conandata.yml b/recipes/zxing-cpp/all/conandata.yml index baac1087c0b36..52b8beeb98353 100644 --- a/recipes/zxing-cpp/all/conandata.yml +++ b/recipes/zxing-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.0": + url: "https://github.com/zxing-cpp/zxing-cpp/archive/v2.1.0.tar.gz" + sha256: "6d54e403592ec7a143791c6526c1baafddf4c0897bb49b1af72b70a0f0c4a3fe" "2.0.0": url: "https://github.com/zxing-cpp/zxing-cpp/archive/v2.0.0.tar.gz" sha256: "12b76b7005c30d34265fc20356d340da179b0b4d43d2c1b35bcca86776069f76" diff --git a/recipes/zxing-cpp/all/conanfile.py b/recipes/zxing-cpp/all/conanfile.py index 2dd711e9b0caf..51a640fb637ef 100644 --- a/recipes/zxing-cpp/all/conanfile.py +++ b/recipes/zxing-cpp/all/conanfile.py @@ -16,7 +16,7 @@ class ZXingCppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/zxing-cpp/zxing-cpp" topics = ("zxing", "barcode", "scanner", "generator") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/recipes/zxing-cpp/config.yml b/recipes/zxing-cpp/config.yml index a4e6ca74f0f31..8e200e12001c5 100644 --- a/recipes/zxing-cpp/config.yml +++ b/recipes/zxing-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.0": + folder: all "2.0.0": folder: all "1.4.0":